annotate scn2k/scn2k_grpimpl.cc @ 74:f8751d74918b default tip

Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sat, 02 Apr 2011 19:13:54 +0200
parents 1fd20d231376
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
1 /*
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
2 * Copyright (c) 2009 Thibaut GIRKA
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
3 * Copyright (c) 2004-2006 Kazunori "jagarl" Ueno
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
4 * All rights reserved.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
5 *
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
7 * modification, are permitted provided that the following conditions
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
8 * are met:
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
9 * 1. Redistributions of source code must retain the above copyright
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
10 * notice, this list of conditions and the following disclaimer.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
11 * 2. Redistributions in binary form must reproduce the above copyright
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
12 * notice, this list of conditions and the following disclaimer in the
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
13 * documentation and/or other materials provided with the distribution.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
14 * 3. The name of the author may not be used to endorse or promote products
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
15 * derived from this software without specific prior written permission.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
16 *
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
27 */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
28
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
29 #include "scn2k_grp.h"
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
30 #include "system/system_config.h"
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
31 #include "music2/music.h"
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
32 #include "window/render.h"
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
33
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
34 void Grp::impl_stackClear (Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
35 cmd.cmd_type = CMD_SAVECMDGRP_START;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
36 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
37
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
38 void Grp::impl_grpBuffer (Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
39 const char* name = cmd.Str(cmd.args[0]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
40 int pdt = cmd.args[1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
41 eprintf("load surface %s pdt %d\n",name, pdt);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
42 if (pdt == 0)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
43 reserved_load_surface0 = name; // 画像読み込みは 01-1f:0000 まで待つ
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
44 else if (pdt == 1)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
45 LoadSurface(name); // 背景絵読み込み?
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
46 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
47 LoadSurface(name, pdt);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
48 cmd.cmd_type = CMD_SAVECMDGRP;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
49 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
50
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
51 void Grp::impl_grpMulti(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
52 int pos = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
53 const char* name = cmd.Str(cmd.args[1]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
54 int sel = cmd.args[2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
55 eprintf("set foreground %s sel %d pos %d\n",name, sel, pos);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
56 AddSurface(name);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
57 StartAnm(sel);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
58 event.RegisterGlobalPressFunc(&Pressed, (void*)this);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
59 status = WAIT_ANM;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
60 cmd.cmd_type = CMD_SAVECMDGRP_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
61 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
62
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
63 void Grp::impl_grpOpen(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
64 const char* name = cmd.Str(cmd.args[0]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
65 int sel = cmd.args[1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
66
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
67 if (name[0] == '?')
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
68 LoadSurface();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
69 else if(cmd.cmd3 == 73)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
70 LoadSurface(name, 1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
71 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
72 LoadSurface(name);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
73
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
74 StartAnm(sel);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
75 status = WAIT_ANM;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
76 event.RegisterGlobalPressFunc(&Pressed, (void*)this);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
77
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
78 if (name[0] == '?')
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
79 cmd.cmd_type = CMD_SAVECMDGRP_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
80 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
81 cmd.cmd_type = CMD_SAVECMDGRP_START;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
82 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
83
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
84 void Grp::impl_shake(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
85 // shake screen
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
86 char key[11];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
87 sprintf(key, "#SHAKE.%03d", cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
88 if (config->SearchParam(key) != 2) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
89 fprintf(stderr,"Cannot find shake pattern %d; use default pattern\n",cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
90 strcpy(key, "#SHAKE.000"); // default key
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
91 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
92 int num;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
93 const int* pattern;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
94 pattern = config->GetParamArray(key, num);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
95 if (pattern) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
96 StartShake(num, pattern);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
97 status = WAIT_SHAKE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
98 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
99 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
100 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
101
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
102 void Grp::impl_grpCopy(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
103 if (cmd.cmd4 == 2) { // copy (KANOGI)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
104 int sx = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
105 int sy = cmd.args[1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
106 int w = cmd.args[2].value - sx;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
107 int h = cmd.args[3].value - sy;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
108 Rect rect(sx, sy, sx+w, sy+h);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
109 int src = cmd.args[4].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
110 int dx = cmd.args[5].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
111 int dy = cmd.args[6].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
112 int dest = cmd.args[7].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
113 unsigned char alpha;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
114 eprintf("copy surface %d:(%d,%d) size(%d,%d) -> %d:(%d,%d)\n",src,sx,sy,w,h,dest,dx,dy);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
115 printf("copy surface %d:(%d,%d) size(%d,%d) -> %d:(%d,%d)\n",src,sx,sy,w,h,dest,dx,dy);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
116 if (src == dest) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
117 DSurfaceMove(Ssurface(src), rect, Dsurface(WORKPDT), rect);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
118 src = WORKPDT;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
119 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
120 parent.Root().BlitSurface(Ssurface(src), rect, Dsurface(dest), Rect(dx,dy));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
121 if (dest == 0) screen->ReBlit(Rect(dx,dy,dx+w,dy+h));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
122 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
123 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
124 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
125
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
126 void Grp::impl_recFill(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
127 int x = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
128 int y = cmd.args[1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
129 int w = cmd.args[2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
130 int h = cmd.args[3].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
131 Rect rect(x, y, x+w, y+w);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
132 int pdt = cmd.args[4].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
133 int r = cmd.args[5].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
134 int g = cmd.args[6].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
135 int b = cmd.args[7].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
136
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
137 if (cmd.cmd4 == 2) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
138 eprintf("clear %d:(%d,%d) size (%d,%d) r %d g %d b %d\n",pdt,x,y,w,h,r,g,b);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
139 DSurfaceFill(Dsurface(pdt), rect, r, g, b);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
140 // if (pdt == 0) screen->ReBlit(rect);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
141 cmd.cmd_type = CMD_SAVECMDGRP;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
142 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
143 else if (cmd.cmd4 == 3) { // alpha つきfill
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
144 int a = cmd.args[8].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
145 eprintf("alpha-clear %d:(%d,%d) size (%d,%d) r %d g %d b %d a %d\n",pdt,x,y,w,h,r,g,b,a);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
146 if (a <= 0) ;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
147 else if (a >= 255) DSurfaceFill(Dsurface(pdt), rect, r, g, b);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
148 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
149 DSurfaceFill(Dsurface(WORKPDT), rect, r, g, b, a);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
150 parent.Root().BlitSurface(Dsurface(WORKPDT), rect, Dsurface(pdt), rect);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
151 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
152 // if (pdt == 0) screen->ReBlit(rect);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
153 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
154 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
155 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
156
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
157 void Grp::impl_recCopy(Cmd& cmd) {
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
158 //TODO: Handle forms 0 and 1
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
159 int sx = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
160 int sy = cmd.args[1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
161 int w = cmd.args[2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
162 int h = cmd.args[3].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
163 Rect rect(sx, sy, sx + w, sy + h);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
164 int src = cmd.args[4].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
165 int dx = cmd.args[5].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
166 int dy = cmd.args[6].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
167 int dest = cmd.args[7].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
168
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
169 if (cmd.cmd4 == 2) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
170 eprintf("copy surface %d:(%d,%d) size(%d,%d) -> %d:(%d,%d)\n",src,sx,sy,w,h,dest,dx,dy);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
171 parent.Root().BlitSurface(Ssurface(src), rect, Dsurface(dest), Rect(dx,dy));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
172 //DSurfaceMove(Ssurface(src), Rect(sx,sy,sx+w,sy+h), Dsurface(dest), Rect(dx,dy));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
173 // if (dest == 0) screen->ReBlit(Rect(dx,dy,dx+w,dy+h));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
174 cmd.cmd_type = CMD_SAVECMDGRP;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
175 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
176 else if (cmd.cmd4 == 3) { // alpha つきcopy
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
177 unsigned char alpha;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
178 if (cmd.args[8].value < 0) alpha = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
179 else if (cmd.args[8].value > 255) alpha = 255;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
180 else alpha = cmd.args[8].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
181 eprintf("copy surface %d:(%d,%d) size(%d,%d) -> %d:(%d,%d)\n",src,sx,sy,w,h,dest,dx,dy);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
182 if (src == dest) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
183 DSurfaceMove(Ssurface(src), rect, Dsurface(WORKPDT), rect);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
184 src = WORKPDT;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
185 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
186 if (alpha != 0)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
187 parent.Root().BlitSurface(Ssurface(src), rect, &alpha, Rect(0,0,1,1), Dsurface(dest), Rect(dx,dy), 0);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
188 // if (dest == 0) screen->ReBlit(Rect(dx,dy,dx+w,dy+h));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
189 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
190 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
191 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
192
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
193 void Grp::impl_recAdd(Cmd& cmd) {
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
194 if (cmd.cmd4 == 3) { // add mode で alpha 付き copy
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
195 int sx = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
196 int sy = cmd.args[1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
197 int w = cmd.args[2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
198 int h = cmd.args[3].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
199 Rect rect(sx, sy, sx+w, sy+h);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
200 int src = cmd.args[4].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
201 int dx = cmd.args[5].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
202 int dy = cmd.args[6].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
203 int dest = cmd.args[7].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
204 unsigned char alpha;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
205 if (cmd.args[8].value < 0) alpha = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
206 else if (cmd.args[8].value > 255) alpha = 255;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
207 else alpha = cmd.args[8].value;
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
208 eprintf("copy surface w/ add %d:(%d,%d) size(%d,%d) -> %d:(%d,%d)\n",src,sx,sy,w,h,dest,dx,dy);
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
209 if (src == dest) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
210 DSurfaceMove(Ssurface(src), rect, Dsurface(WORKPDT), rect);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
211 src = WORKPDT;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
212 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
213 if (alpha != 0) {
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
214 // add mode : screen (picture) を一時的に作成
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
215 PicBase* screen_tmp = parent.create_leaf(Rect(0, 0, parent.Width(), parent.Height()), 0);
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
216 screen_tmp->SetSurface(Ssurface(src), 0, 0, PicBase::BLIT_ADD);
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
217 screen_tmp->SetSurfaceRect(rect);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
218 screen_tmp->Move(dx, dy);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
219 screen_tmp->SetSurfaceAlpha(&alpha, Rect(0,0,1,1));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
220 screen_tmp->SimpleBlit(Dsurface(dest));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
221 delete screen_tmp;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
222 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
223 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
224 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
225 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
226
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
227 void Grp::impl_grpPan(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
228 if (cmd.cmd4 == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
229 Rect r_from(cmd.args[0].value, cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
230 Rect r_to(cmd.args[2].value, cmd.args[3].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
231 int src_pdt = cmd.args[4].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
232 Rect r(cmd.args[5].value,cmd.args[6].value,cmd.args[7].value+1,cmd.args[8].value+1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
233 int tm = cmd.args[9].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
234 fprintf(stderr,"??? cmd time %d\n",tm);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
235 // anm1 = new ScnGrpMove(event, screen, parent.Root(), surface, r, Ssurface(2), r_from, r_to, tm);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
236 // status = WAIT_ANM;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
237 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
238 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
239
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
240 void Grp::impl_snmBgScroll(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
241 if (cmd.cmd4 == 0) { // スクロールする画像効果(Princess Bride)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
242 if (anm2 != NULL) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
243 anm2->Abort();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
244 delete anm2;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
245 anm2 = NULL;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
246 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
247 PicBase* pic; Surface* s;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
248 Rect r(cmd.args[1].value, cmd.args[2].value, cmd.args[3].value+1, cmd.args[4].value+1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
249 const char* name = cmd.Str(cmd.args[5]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
250 Rect sr_start(cmd.args[6].value,cmd.args[7].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
251 Rect sr_end(cmd.args[8].value,cmd.args[9].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
252 int tm = cmd.args[10].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
253 LoadSurface(name, 2); /* PDT2 に読み込み、と決め打ち */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
254
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
255 anm2 = new ScnGrpMove(event, screen, parent.Root(), Dsurface(1), r, Ssurface(2), sr_start, sr_end, tm);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
256 cmd.cmd_type = CMD_SAVECMDGRP;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
257 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
258 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
259
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
260 void Grp::impl_snmPlay(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
261 if (cmd.cmd4 == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
262 // カードが落ちるアニメーション
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
263 int i;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
264 ScnGrpAnm* new_anm = new ScnGrpAnm(event, screen, *this);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
265 if (cmd.cmd3 == 0x834 || cmd.cmd3 == 0x835) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
266 AbortAnm();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
267 anm1 = new_anm;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
268 if (cmd.cmd3 == 0x835) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
269 status = WAIT_ANM;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
270 event.RegisterGlobalPressFunc(&Pressed, (void*)this);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
271 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
272 } else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
273 anm2 = new_anm;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
274 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
275 for (i=0; i<cmd.argc; i++) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
276 const char* name = cmd.Str(cmd.args[i*3+1]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
277 int tm = cmd.args[i*3+2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
278 new_anm->push_back(ScnGrpAnmAtom(name,tm));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
279 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
280 new_anm->CalcTotal();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
281 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
282 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
283 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
284
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
285 void Grp::impl_cgGet(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
286 if (cmd.cmd3 == 0x5dc) // Total number of CG
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
287 cmd.SetSysvar(cgm_size);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
288
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
289 if (cmd.cmd3 == 0x5dd) // Number of CG viewed
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
290 cmd.SetSysvar(cgm_data.size());
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
291
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
292 if (cmd.cmd3 == 0x5de) // Percentage of CG viewed
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
293 cmd.SetSysvar(cgm_data.size() * 100 / cgm_size);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
294 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
295
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
296 void Grp::impl_cgStatus(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
297 string s = cmd.Str(cmd.args[0]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
298 if (cgm_info.find(s) == cgm_info.end()) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
299 fprintf(stderr,"cmd 01-04:05e0 : cannot find cgm-info of '%s'\n",s.c_str());
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
300 cmd.SetSysvar(-1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
301 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
302 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
303 int n = cgm_info[s];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
304 if (cmd.cmd3 == 1503) cmd.SetSysvar(n);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
305 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
306 if (cgm_data.find(n) == cgm_data.end()) cmd.SetSysvar(0);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
307 else cmd.SetSysvar(1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
308 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
309 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
310 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
311
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
312 void Grp::impl_objClear(Cmd& cmd) { //FIXME: may be broken (doesn't reflect what Haeleth says)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
313 if (cmd.cmd1 == 1)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
314 DeleteObj(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
315 if (cmd.cmd1 == 2)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
316 DeleteSubObj(cmd.args[0].value, cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
317 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
318 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
319
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
320 void Grp::impl_createObj(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
321 /**************:
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
322 0x47 : オブジェクト内容の設定
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
323 1100: G00 file
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
324 1003: GAN file
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
325 1100: rect
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
326 1200: string
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
327 1300: weather effects
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
328 1400: number
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
329 */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
330 int base_argc = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
331
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
332 if (cmd.cmd1 == 1) { // 1: group object
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
333 DeleteObjPic(cmd.args[0].value); // 旧ファイル名のsurfaceを削除
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
334 if (cmd.cmd2 == 71)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
335 DeleteObjPic(cmd.args[0].value); // 旧ファイル名のsurfaceを削除
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
336 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
337 else { // 2: single object in group
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
338 DeleteSubObjPic(cmd.args[0].value, cmd.args[1].value); // 旧ファイル名のsurfaceを削除
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
339 if (cmd.cmd2 == 71)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
340 DeleteSubObjPic(cmd.args[0].value, cmd.args[1].value); // 旧ファイル名のsurfaceを削除
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
341 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
342
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
343 GrpObj* g = (cmd.cmd2 == 71) ? &grpobj[cmd.args[0].value] : &bs_obj[cmd.args[0].value];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
344 if (cmd.cmd1 == 2) // 2: single object in a group
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
345 g = &g->children_obj[cmd.args[1].value];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
346
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
347 if (cmd.cmd1 == 2)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
348 base_argc = 1;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
349
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
350 if (cmd.cmd3 == 1000) { /* ファイル名設定 */
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
351 g->gtype = GrpObj::FILE;
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
352 string name = cmd.Str(cmd.args[base_argc + 1]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
353 if (name.find('?') != -1) {//TODO
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
354 //Used for shading, with DAT/tcdata.tcc or other filename provided by #TONECURVE_FILENAME
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
355 printf("Warning: the part after the '?' was removed: '%s'\n", name.c_str());
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
356 name.erase(name.find('?')); // '?' 以降の意味がわからない
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
357 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
358 g->name = name;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
359 } else if (cmd.cmd3 == 1003) { /* ファイル名設定(GAN含む) */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
360 g->gtype = GrpObj::GAN;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
361 if (cmd.Str(cmd.args[base_argc + 1]) == string("???"))
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
362 g->name = cmd.Str(cmd.args[base_argc + 2]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
363 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
364 g->name = cmd.Str(cmd.args[base_argc + 1]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
365 g->gan_name = cmd.Str(cmd.args[base_argc + 2]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
366
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
367 if (cmd.cmd4 >= 1 && cmd.args[base_argc + 3].value == 0)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
368 g->attr = GrpObj::Attribute(g->attr | GrpObj::HIDDEN);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
369 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
370 g->attr = GrpObj::Attribute(g->attr & ~(GrpObj::HIDDEN));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
371
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
372 if (cmd.argc >= base_argc + 5)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
373 g->SetPos(1, cmd.args[base_argc + 4].value, -cmd.args[base_argc + 5].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
374
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
375 if (g->name.find('?') != -1) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
376 g->name.erase(g->name.find('?'));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
377 g->gan_name = cmd.Str(cmd.args[base_argc + 2]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
378 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
379 } else if (cmd.cmd3 == 1200) { // 画像を文字列として指定
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
380 g->gtype = GrpObj::MOJI;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
381 g->print_moji = cmd.Str(cmd.args[base_argc + 1]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
382 g->attr = GrpObj::Attribute(g->attr & (~GrpObj::HIDDEN)); // 常に表示がデフォルト?
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
383 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
384 } else if (cmd.cmd3 == 1400) { // 数値を画像として表示
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
385 g->gtype = GrpObj::DIGIT;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
386 g->name = cmd.Str(cmd.args[base_argc + 1]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
387 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
388
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
389 CreateObj(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
390 if (cmd.cmd1 == 2)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
391 CreateSubObj(cmd.args[0].value, cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
392
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
393 if (cmd.cmd3 == 1000 || cmd.cmd3 == 1003 || cmd.cmd3 == 1200 || cmd.cmd3 == 1400) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
394 // FILE, GAN, MOJI, DIGIT ならば座標等の設定を行う
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
395 if (cmd.cmd4 >= 1) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
396 if (cmd.args[2+base_argc].value == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
397 g->attr = GrpObj::Attribute(g->attr | GrpObj::HIDDEN);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
398 } else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
399 g->attr = GrpObj::Attribute(g->attr & (~GrpObj::HIDDEN));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
400 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
401 SetObjChanged(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
402 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
403 if (cmd.cmd4 >= 2) { // 座標等も設定
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
404 g->SetPos(0, cmd.args[3+base_argc].value, cmd.args[4+base_argc].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
405 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
406 if ( (cmd.cmd3 == 1000 || cmd.cmd3 == 1003) && cmd.cmd4 >= 3) { // pattern 番号も設定
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
407 g->SetSurfaceNum(cmd.args[5+base_argc].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
408 base_argc++; // 1000 (FILE) / 1003 (GAN) の場合のみこのオプションは存在する
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
409 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
410 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
411 } else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
412 fprintf(stderr,"CreateObj : cmd.cmd3 = %04x ; not supported!\n",cmd.cmd3);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
413 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
414 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
415
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
416 void Grp::impl_gan(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
417 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
418 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
419
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
420 if (cmd.cmd3 == 3) { // ganIsPlaying
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
421 if (g->anm == NULL || g->anm->IsEnd())
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
422 cmd.SetSysvar(0);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
423 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
424 cmd.SetSysvar(1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
425 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
426 else if (cmd.cmd3 == 1000) { // ganStop
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
427 if (g->anm == NULL || g->anm->IsEnd())
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
428 g->SetSurfaceNum(cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
429 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
430 g->anm->Abort();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
431 g->SetSurfaceNum(cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
432 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
433 SetObjChanged(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
434 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
435 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
436 else if (cmd.cmd3 == 2003) { // objPlay
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
437 g->CreateGanSpecial(event, 0, cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
438 // g.attr = GrpObj::Attribute(g.attr & (~GrpObj::HIDDEN));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
439 SetObjChanged(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
440 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
441 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
442 else if (cmd.cmd3 == 3001 || cmd.cmd3 == 3003 || cmd.cmd3 == 3005 ||
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
443 cmd.cmd3 == 1001 || cmd.cmd3 == 1003 || cmd.cmd3 == 1005) { // ganPlay*
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
444 g->CreateGan(event, cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
445 // g.attr = GrpObj::Attribute(g.attr & (~GrpObj::HIDDEN));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
446 SetObjChanged(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
447 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
448 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
449 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
450
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
451 void Grp::impl_objSetPos(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
452 //obj or objBg
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
453 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
454 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
455
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
456 int index, x, y;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
457 if (cmd.cmd3 == 1006 || cmd.cmd3 == 2006) { //objAdjust
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
458 index = cmd.args[1+base_arg].value + 1;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
459 x = cmd.args[2+base_arg].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
460 y = cmd.args[3+base_arg].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
461 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
462 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
463 index = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
464 if (cmd.cmd3 == 1000) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
465 x = cmd.args[1+base_arg].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
466 y = cmd.args[2+base_arg].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
467 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
468 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
469 g->GetPos(index, x, y);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
470 if (cmd.cmd3 == 1001)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
471 x = cmd.args[1+base_arg].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
472 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
473 y = cmd.args[1+base_arg].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
474 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
475 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
476
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
477 g->SetPos(index, x, y);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
478 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
479 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
480
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
481 void Grp::impl_objAlpha(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
482 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
483 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
484
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
485 g->SetAlpha(cmd.args[base_arg + 1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
486 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
487 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
488
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
489 void Grp::impl_objShow(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
490 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
491 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
492
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
493 if (cmd.args[base_arg + 1].value)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
494 g->attr = GrpObj::Attribute(g->attr & (~GrpObj::HIDDEN));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
495 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
496 g->attr = GrpObj::Attribute(g->attr | GrpObj::HIDDEN);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
497
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
498 g->attr = GrpObj::Attribute(g->attr | GrpObj::UPDATE_VISIBLE);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
499 // グループ単位で次の RefreshObj で表示・消去
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
500 if (cmd.cmd2 == 0x51) //not Bg
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
501 SetObjChanged(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
502 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
503 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
504
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
505 void Grp::impl_objColour(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
506 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
507 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
508
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
509 g->print_r = cmd.args[base_arg+1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
510 g->print_g = cmd.args[base_arg+2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
511 g->print_b = cmd.args[base_arg+3].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
512 g->SetUpdate();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
513 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
514 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
515
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
516 void Grp::impl_objComposite(Cmd& cmd) {//FIXME
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
517 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
518 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
61
bdd8a5ff8f46 Revert an old change that disabled cursors...
Thibaut GIRKA <thib@sitedethib.com>
parents: 60
diff changeset
519 if (cmd.args[base_arg + 1].value == 1)
bdd8a5ff8f46 Revert an old change that disabled cursors...
Thibaut GIRKA <thib@sitedethib.com>
parents: 60
diff changeset
520 {
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
521 g->attr = GrpObj::Attribute(g->attr | GrpObj::BLIT_ADD);
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
522 cmd.clear();
61
bdd8a5ff8f46 Revert an old change that disabled cursors...
Thibaut GIRKA <thib@sitedethib.com>
parents: 60
diff changeset
523 }
bdd8a5ff8f46 Revert an old change that disabled cursors...
Thibaut GIRKA <thib@sitedethib.com>
parents: 60
diff changeset
524 else if (cmd.args[base_arg + 1].value == 0)
bdd8a5ff8f46 Revert an old change that disabled cursors...
Thibaut GIRKA <thib@sitedethib.com>
parents: 60
diff changeset
525 {
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
526 g->attr = GrpObj::Attribute(g->attr & (~GrpObj::BLIT_ADD));
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
527 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
528 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
529 g->SetUpdate();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
530 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
531
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
532 void Grp::impl_objSetText(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
533 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
534 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
535
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
536 g->print_moji = cmd.Str(cmd.args[base_arg + 1]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
537 g->SetUpdate();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
538 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
539 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
540
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
541 void Grp::impl_objTextOpts(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
542 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
543 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
544
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
545 // 画像を文字列として設定:文字の大きさなど
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
546 g->print_size = cmd.args[base_arg + 1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
547 /* 前景色を得る */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
548 int cr, cg, cb;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
549 char key[17];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
550 sprintf(key, "#COLOR_TABLE.%03d", cmd.args[base_arg + 5].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
551 if (config->GetParam(key, 3, &cr, &cg, &cb)) { // color not found
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
552 cr = cg = cb = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
553 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
554 g->print_r = cr;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
555 g->print_g = cg;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
556 g->print_b = cb;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
557 g->SetUpdate();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
558 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
559 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
560
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
561 void Grp::impl_objOrder(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
562 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
563 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
564
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
565 int order = cmd.args[base_arg + 1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
566 g->order = order;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
567 ZMoveObj(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
568 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
569 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
570
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
571 void Grp::impl_objDispArea(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
572 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
573 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
574
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
575 // オブジェクトのどの部分を画面に表示するか(クリップ領域)の設定
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
576 int rx, ry, w, h;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
577 if (cmd.args.size() == base_arg + 5) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
578 int rx = cmd.args[base_arg + 1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
579 int ry = cmd.args[base_arg + 2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
580 int w = cmd.args[base_arg + 3].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
581 int h = cmd.args[base_arg + 4].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
582 if (cmd.cmd3 == 1005) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
583 w -= rx;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
584 h -= ry;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
585 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
586 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
587 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
588 rx = ry = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
589 w = screen->Width();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
590 h = screen->Height();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
591 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
592 g->SetClipArea(rx, ry, w, h); //TODO: case when cmd.args.size() == 1
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
593 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
594 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
595
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
596 void Grp::impl_objSetDigits(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
597 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
598 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
599
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
600 g->dig_number = cmd.args[base_arg + 1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
601 g->SetUpdate();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
602 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
603 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
604
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
605 void Grp::impl_objNumOpts(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
606 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
607 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
608
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
609 g->dig_digit = cmd.args[base_arg + 1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
610 int attr = g->attr;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
611 attr &= ~(GrpObj::DIG_ZERO | GrpObj::DIG_SIGN | GrpObj::DIG_PACK);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
612 if (cmd.args[base_arg + 2].value) attr |= GrpObj::DIG_ZERO;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
613 if (cmd.args[base_arg + 3].value) attr |= GrpObj::DIG_SIGN;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
614 if (cmd.args[base_arg + 4].value) attr |= GrpObj::DIG_PACK;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
615 g->attr = GrpObj::Attribute(attr);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
616 g->SetUpdate();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
617 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
618 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
619
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
620 void Grp::impl_objPattNo(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
621 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
622 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
623
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
624 g->SetSurfaceNum(cmd.args[base_arg + 1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
625 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
626 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
627
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
628 void Grp::impl_objScale(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
629 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
630 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
631
74
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
632 int zoomx = -1;
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
633 int zoomy = -1;
71
1fd20d231376 Fix objScale with 2D zoom; implement objWidth and objHeight.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 61
diff changeset
634
74
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
635 if (cmd.cmd3 < 1048) {
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
636 zoomx = cmd.args[base_arg + 1].value * 256 / 100;
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
637 if (cmd.cmd3 == 1046)
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
638 zoomy = cmd.args[base_arg + 2].value * 256 / 100;
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
639 } else
f8751d74918b Remove “duplicate” functions as they can be remplaced by a nearly-identical existing function.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 71
diff changeset
640 zoomy = cmd.args[base_arg + 1].value * 256 / 100;
71
1fd20d231376 Fix objScale with 2D zoom; implement objWidth and objHeight.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 61
diff changeset
641
1fd20d231376 Fix objScale with 2D zoom; implement objWidth and objHeight.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 61
diff changeset
642 g->SetZoomRotate(zoomx, zoomy, -1);
1fd20d231376 Fix objScale with 2D zoom; implement objWidth and objHeight.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 61
diff changeset
643 cmd.clear();
1fd20d231376 Fix objScale with 2D zoom; implement objWidth and objHeight.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 61
diff changeset
644 }
1fd20d231376 Fix objScale with 2D zoom; implement objWidth and objHeight.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 61
diff changeset
645
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
646 void Grp::impl_objRotate(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
647 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
648 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, (cmd.cmd2 == 0x51));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
649
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
650 int angle = cmd.args[base_arg + 1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
651 angle /= 10;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
652 if (angle < 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
653 angle %= 360;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
654 angle += 360;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
655 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
656 angle %= 360;
71
1fd20d231376 Fix objScale with 2D zoom; implement objWidth and objHeight.
Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
parents: 61
diff changeset
657 g->SetZoomRotate(-1, -1, angle);
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
658 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
659 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
660
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
661 void Grp::impl_objPosDims(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
662 int base_arg = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
663 GrpObj* g = GetGraphicObjVarMode(cmd, base_arg, true);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
664
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
665 VarInfo arg1 = cmd.args[base_arg + 1];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
666 VarInfo arg2 = cmd.args[base_arg + 2];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
667
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
668 int val1, val2;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
669
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
670 if (cmd.cmd3 == 1000)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
671 g->GetPos(0, val1, val2);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
672 else if (cmd.cmd3 == 1100)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
673 g->GetSrcGeom(val1, val2);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
674
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
675 cmd.SetFlagvar(arg1, val1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
676 cmd.SetFlagvar(arg2, val2);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
677 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
678
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
679 void Grp::impl_refresh(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
680 // 本来は grpstack clear らしい
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
681 RefreshObj();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
682 // Princess Bride の中途 Staff roll
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
683 // このタイミングで描画するのが都合がいいので、
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
684 //シナリオループを抜けて描画を起動
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
685 cmd.cmd_type = CMD_WAITFRAMEUPDATE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
686 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
687
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
688 void Grp::impl_bgmLoop(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
689 if (cmd.cmd4 == 0 || cmd.cmd4 == 2) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
690 int count = 8000;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
691 if (cmd.cmd3 == 2)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
692 count = 0; //bgmPlay, play once
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
693 music->PlayCDROM((char*)cmd.Str(cmd.args[0]), count);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
694 cmd.cmd_type = CMD_SAVECMD_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
695 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
696 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
697
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
698 void Grp::impl_bgmStop(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
699 if (cmd.cmd4 == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
700 if (cmd.cmd3 == 5)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
701 music->StopCDROM(0);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
702 else if (cmd.cmd3 == 105)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
703 music->StopCDROM(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
704 cmd.cmd_type = CMD_SAVECMD_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
705 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
706 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
707
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
708 void Grp::impl_playWav(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
709 if (cmd.cmd3 == 2) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
710 music->PlaySE(cmd.Str(cmd.args[0]), 1); //loop
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
711 cmd.cmd_type = CMD_SAVECMD_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
712 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
713 else {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
714 music->PlaySE(cmd.Str(cmd.args[0]));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
715 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
716 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
717 if (cmd.cmd3 == 1)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
718 status = WAIT_SE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
719 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
720
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
721 void Grp::impl_playSE(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
722 music->PlaySE(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
723 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
724 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
725
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
726 void Grp::impl_stopWav(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
727 if (cmd.cmd3 == 5)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
728 music->StopSE();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
729 else if (cmd.cmd3 == 105)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
730 music->StopSE(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
731
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
732 cmd.cmd_type = CMD_SAVECMD_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
733 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
734
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
735 void Grp::impl_SetVolMod(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
736 music->volmod[cmd.cmd3-0x8b6] = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
737 config->SetParam("#VOLMOD", 4, music->volmod[0], music->volmod[1], music->volmod[2], music->volmod[3]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
738 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
739 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
740
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
741 void Grp::impl_GetVolMod(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
742 cmd.SetSysvar(music->volmod[cmd.cmd3-0x91a]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
743 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
744
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
745 void Grp::impl_koePlay(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
746 eprintf("play koe %d",cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
747 if (cmd.cmd4 == 1) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
748 eprintf(", para? %d",cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
749 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
750 eprintf("\n");
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
751 char buf[1024]; sprintf(buf, "%d",cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
752 if ( !(skip_mode & SKIP_TEXT)) music->PlayKoe(buf);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
753 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
754 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
755
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
756 /*It may be useful... or not.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
757 void Grp::impl_objSwap(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
758 if (cmd.cmd1 == 1 && cmd.args.size() == 2) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
759 SwapObj(cmd.args[0].value, cmd.args[1].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
760 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
761 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
762 }*/
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
763
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
764 void Grp::impl_movPlay(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
765 if ( cmd.cmd4 == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
766 const char* str = cmd.Str(cmd.args[0]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
767 int x = cmd.args[1].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
768 int y = cmd.args[2].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
769 int x2 = cmd.args[3].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
770 int y2 = cmd.args[4].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
771 eprintf("play movie ; name %s pos %d,%d - %d,%d\n",str,x,y,x2,y2);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
772 music->PlayMovie(str, x, y, x2, y2,1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
773 status = WAIT_MOVIE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
774 event.RegisterGlobalPressFunc(&Pressed, (void*)this);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
775 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
776 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
777 }
60
e16e13d8cd68 Replaced SATURATE -> ADD, implemented objComposite, corrected minor things
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
778