annotate scn2k/scn2k_textimpl.cc @ 58:0aaa5bb3dde5

Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
author Thibaut GIRKA <thib@sitedethib.com>
date Fri, 18 Dec 2009 14:25:56 +0100
parents 6d9146f56ccf
children 36d92d21300f
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_text.h"
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
30
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
31 void Text::impl_txtClear(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
32 if (text != NULL) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
33 text->ResetFace();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
34 if (cmd.cmd2 == 3 && cmd.cmd3 == 151)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
35 text->wid->Clear();
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 cur_backlog_item.face = "";
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
38 if (cmd.cmd2 == 3 && cmd.cmd3 == 151)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
39 text_stream.Clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
40 hide();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
41 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
42
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
43 void Text::impl_logKoe(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
44 // PlayKoe ; 声出力コマンドをチェックする */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
45 cur_backlog_item.koe = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
46 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
47
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
48 void Text::impl_pause(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
49 if (text != NULL) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
50 eprintf("start\n");
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
51 text->StartText(text_stream);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
52 if (skip_mode & SKIP_TEXT) text->wid->Flush();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
53 else if (kcursor) kcursor->show();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
54 status = WAIT_TEXT;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
55 text_parsing = false;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
56 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
57 backlog_item = cur_backlog_item;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
58 if (cur_backlog_item.scn == 0 && cur_backlog_item.pos == -1) backlog_item.text = text_stream;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
59 cur_backlog_item.Clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
60
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
61 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
62 cmd.cmd_type = CMD_WAITFRAMEUPDATE; // 画像描画に戻る(skip時にテキストが描画されやすくするため)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
63 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
64
58
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
65 void Text::impl_PauseCursor(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
66 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
67 /* なんかよくわからないけどカーソル形状変更にしとく */
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
68 SetCursor(cmd.args[0].value);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
69 cmd.clear();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
70 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
71
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
72 void Text::impl_br(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
73 text_stream.AddReturn();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
74 cur_backlog_item.DeleteTextPos();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
75 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
76 }
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 void Text::impl_FaceOpen(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
79 if (text == NULL)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
80 show();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
81 string s = cmd.Str(cmd.args[0]);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
82 s += ".g00";
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
83 if (text != NULL)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
84 text->ShowFace(s.c_str());
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
85 cur_backlog_item.face = s;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
86 cmd.cmd_type = CMD_SAVECMD_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
87 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
88
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
89 void Text::impl_FaceClear(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
90 if (text == NULL)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
91 show();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
92 if (text)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
93 text->ResetFace();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
94 cur_backlog_item.face = "";
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
95 cmd.cmd_type = CMD_SAVECMD_ONCE;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
96 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
97
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
98 void Text::impl_doRuby(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
99 if (text == NULL) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
100 show();
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 if (cmd.cmd4 == 1) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
103 ruby_text_flag = true;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
104 eprintf("SetRubyText.");
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
105 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
106 } else if (cmd.cmd4 == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
107 if (ruby_text.length() == 0) { // ルビを振るテキストがない
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
108 eprintf("Cannot find ruby text.\n");
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
109 return;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
110 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
111 if (cmd.args.size() != 1) return;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
112 char debug1[1024], debug2[1024];
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
113 kconv( (unsigned char*)ruby_text.c_str(), (unsigned char*)debug1);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
114 kconv( (unsigned char*)cmd.Str(cmd.args[0]), (unsigned char*)debug2);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
115 eprintf("SetRuby. %s, %s",debug1, debug2);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
116 text_stream.AddRuby(ruby_text.c_str(), cmd.Str(cmd.args[0]));
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
117 cur_backlog_item.DeleteTextPos();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
118 cmd.clear();
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 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
121
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
122 void Text::impl_TextWindow(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
123 if (cmd.cmd4 == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
124 eprintf("set text window <- %d\n",cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
125 if (text != NULL) show(cmd.args[0].value);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
126 else text_window_number = cmd.args[0].value;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
127 } else if (cmd.cmd4 == 1) { // default value
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
128 eprintf("set text window <- default\n");
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
129 if (text != NULL) show(0);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
130 else text_window_number = 0;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
131 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
132 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
133 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
134
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
135 void Text::impl_FastText(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
136 //I think it's broken. For now, it's disabled.
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
137 if (cmd.cmd3 == 103) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
138 // テキストウィンドウ表示?
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
139 show();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
140 // 表示の際はテキストをクリアしない?
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
141 // if (text) text->wid->Clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
142 // text_stream.Clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
143 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
144 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
145 else if (cmd.cmd3 == 104) { // テキスト表示?
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
146 // 全テキスト表示
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
147 if (text != NULL) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
148 text->StartText(text_stream);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
149 text->wid->Flush();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
150 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
151 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
152 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
153 }
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 void Text::impl_msgClear(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
156 show();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
157 if (text != NULL) text->wid->Clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
158 text_stream.Clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
159 cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
160 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
161
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
162 void Text::impl_createSelect(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
163 if (cmd.cmd4 == 0) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
164 // 選択肢
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
165 CreateSelect(cmd);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
166 //FIXME: Check if it's really clean
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
167 if (text_parsing) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
168 show();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
169 text->StartText(text_stream);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
170 if (skip_mode & SKIP_TEXT) text->wid->Flush();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
171 else if (kcursor) kcursor->hide();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
172 text_parsing = false;
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
173 text_stream.Clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
174 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
175 cmd.cmd_type = CMD_ROLLBACKPOINT; /* 選択肢はセーブ位置 / シナリオ巻き戻し位置 */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
176 // cmd.clear();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
177 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
178 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
179 PrintCmd(cmd); //FIXME
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
180 }
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
181
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
182 void Text::impl_ShowBackground(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
183 status_mask = Status(CLEARSCR_MASK | status_mask);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
184 cmd.clear();
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
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
187 void Text::impl_SetSkipMode(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
188 status_mask = Status(SKIPMASK | status_mask);
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 void Text::impl_Wait(Cmd& cmd) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
193 eprintf("wait %dmsec\n",cmd.args[0].value);
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
194
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
195 if (cmd.cmd3 == 100 && text != NULL) {
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
196 /* 0x64 だと文字描画中の待ちに使うことがある */
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
197 text->StartText(text_stream);
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
198 text->wid->Flush();
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
199 }
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
200
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
201 if (cmd.cmd3 == 111 || cmd.cmd3 == 112 || cmd.cmd3 == 121)
58
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
202 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
203 int index;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
204 if (cmd.cmd4 == 1)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
205 index = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
206 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
207 index = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
208 wait_time = timer_var[index].start_time + cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
209 }
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
210 else
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
211 wait_time = old_time + cmd.args[0].value;
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
212
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
213 if (cmd.cmd3 == 101 || cmd.cmd3 == 112)
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
214 status = WAIT_CLICK;
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
215 else
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
216 status = WAIT;
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
217
56
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
218 cmd.cmd_type = CMD_WAITFRAMEUPDATE; // 画像描画に戻る(skip時にテキストが描画されやすくするため)
c7bcc0ec2267 * replaced Grp and Text classes by the TextImpl and GrpImpl ones
thib
parents:
diff changeset
219 }
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
220
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
221 void Text::impl_GetClick(Cmd& cmd) {
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
222 eprintf("wait and get mouse pos at click\n");
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
223 wait_time = old_time + 1000 * 1000;
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
224 status = WAIT_CLICK_MOUSEPOS;
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
225 wait_savedvar[0] = cmd.args[0];
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
226 wait_savedvar[1] = cmd.args[1];
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
227 cmd.clear();
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
228 }
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
229
58
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
230 void Text::impl_ResetTimer(Cmd& cmd) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
231 int index;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
232
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
233 if (cmd.cmd4 == 1)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
234 index = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
235 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
236 index = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
237
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
238 eprintf("set basetime (%d)\n",index);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
239 //TODO: Handle EX timer set
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
240 TimerAtom& atom = timer_var[index];
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
241 atom.start_time = old_time;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
242
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
243 cmd.clear();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
244 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
245
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
246 void Text::impl_Timer(Cmd& cmd) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
247 int index;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
248
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
249 if (cmd.cmd4 == 1)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
250 index = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
251 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
252 index = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
253
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
254 eprintf("get time %dth\n",index);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
255 if (timer_var.find(index) == timer_var.end())
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
256 cmd.SetSysvar(0);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
257 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
258 cmd.SetSysvar(old_time - timer_var[index].start_time);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
259 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
260
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
261 void Text::impl_ReadFrame(Cmd& cmd) {
58
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
262 eprintf("get timer value[%d]\n", cmd.args[0].value);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
263 if (frame_var.find(cmd.args[0].value) == frame_var.end())
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
264 cmd.SetSysvar(0);
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
265 else {
58
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
266 FrameTimerAtom& atom = frame_var[cmd.args[0].value];
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
267 if (atom.total_time <= 0) atom.total_time = 1;
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
268 int cur_tm = old_time - atom.start_time;
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
269 if (cur_tm < 0) cur_tm = atom.total_time; // エラーなら最終時間に合わせる
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
270 if (cur_tm > atom.total_time) cur_tm = atom.total_time;
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
271 // use 'long long'(64bit) or 'double'(80bit) type, since total_time, to and from is 32 bit.
58
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
272 int v = atom.from + (long long)(atom.to - atom.from)*cur_tm/int(atom.total_time);
57
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
273 cmd.SetSysvar(v);
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
274 }
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
275 }
6d9146f56ccf * Move some opcodes
Thibaut GIRKA <thib@sitedethib.com>
parents: 56
diff changeset
276
58
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
277 void Text::impl_InitFrame(Cmd& cmd) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
278 FrameTimerAtom& atom = frame_var[cmd.args[0].value];
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
279 atom.from = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
280 atom.to = cmd.args[2].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
281 atom.total_time = cmd.args[3].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
282 atom.start_time = old_time;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
283 cmd.clear();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
284 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
285
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
286 void Text::impl_InitFrames(Cmd& cmd) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
287 int i, j = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
288 for (i = 0; i < cmd.argc; i++)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
289 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
290 int cnt = cmd.args[j++].value; // £³€Ê€Î€Ç̵»ë
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
291 int num = cmd.args[j++].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
292 FrameTimerAtom& atom = frame_var[num];
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
293 atom.from = cmd.args[j++].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
294 atom.to = cmd.args[j++].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
295 atom.total_time = cmd.args[j++].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
296 atom.start_time = old_time;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
297 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
298 cmd.clear();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
299 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
300
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
301 void Text::impl_ReadFrames(Cmd& cmd) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
302 vector<VarInfo> args = cmd.args;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
303 vector<VarInfo>::iterator it = args.begin();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
304 int argc = cmd.argc;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
305 int timers_active = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
306 int i;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
307 for (i=0; i < argc; i++)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
308 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
309 int cnt = (it++)->value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
310 int num = (it++)->value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
311
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
312 if (frame_var.find(num) == frame_var.end()) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
313 cmd.SetFlagvar(*it++, 0);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
314 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
315 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
316 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
317 FrameTimerAtom& atom = frame_var[num];
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
318 if (atom.total_time <= 0)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
319 atom.total_time = 1;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
320 int cur_tm = old_time - atom.start_time;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
321 if (cur_tm < 0)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
322 cur_tm = atom.total_time; // ¥š¥é¡Œ€Ê€éºÇœª»þŽÖ€Ë¹ç€ï€»€ë
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
323 if (cur_tm > atom.total_time)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
324 cur_tm = atom.total_time;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
325 // use 'long long'(64bit) or 'double'(80bit) type, since total_time, to and from is 32 bit.
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
326 int v = atom.from + (long long)(atom.to-atom.from)*cur_tm/int(atom.total_time);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
327 cmd.SetFlagvar(*it++, v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
328 if (atom.total_time != -1 && cur_tm < atom.total_time)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
329 timers_active = 1;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
330 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
331 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
332 cmd.SetSysvar(timers_active);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
333 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
334
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
335 void Text::impl_rnd(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
336 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
337 /* rand() */
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
338 int min, max;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
339 if (cmd.args.size() == 2)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
340 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
341 min = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
342 max = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
343 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
344 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
345 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
346 min = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
347 max = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
348 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
349 if (min > max)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
350 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
351 int tmp = max;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
352 max = min;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
353 min = tmp;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
354 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
355 int r = random();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
356 if (min == max)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
357 r = min;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
358 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
359 r = (r % (max-min)) + min;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
360 cmd.SetSysvar(r);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
361 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
362
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
363 void Text::impl_pcnt(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
364 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
365 cmd.SetSysvar(100 * cmd.args[0].value / cmd.args[1].value);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
366 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
367
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
368 void Text::impl_abs(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
369 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
370 cmd.SetSysvar(abs(cmd.args[0].value));
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
371 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
372
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
373 void Text::impl_power(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
374 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
375 //TODO
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
376 //cmd.SetSysvar(pow(cmd.args[0].value, cmd.args[1].value));
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
377 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
378
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
379 void Text::impl_min(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
380 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
381 int a = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
382 int b = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
383 cmd.SetSysvar((a < b) ? a : b);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
384 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
385
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
386 void Text::impl_max(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
387 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
388 int a = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
389 int b = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
390 cmd.SetSysvar((a > b) ? a : b);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
391 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
392
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
393 void Text::impl_index_series(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
394 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
395 //TODO: This one is not fully documented in
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
396 // http://dev.haeleth.net/rldev/manual.html
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
397 // Try to figure out what's it...
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
398
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
399 /* range conversion : 比率に丸める */
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
400 // アルゴリズムは間違えてるような気がする
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
401 //
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
402 if (cmd.args.size() >= 7)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
403 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
404 int val = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
405 int offset = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
406 int r_min = cmd.args[2].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
407 int v_min = cmd.args[3].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
408 int v_max = cmd.args[4].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
409 int r_max = cmd.args[5].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
410 int mode = cmd.args[6].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
411 // rldev : mode == 1,3 : 'acceralating curve', 2,3: 'decelerating curve'
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
412 // 複数の引数リスト(r_minからmodeまでのリスト)もつこともあり、その場合は
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
413 // "cancel out in some way" らしい
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
414 if (mode == 1 || mode == 3)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
415 val += offset;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
416 else if (mode == 2 || mode == 4)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
417 val -= offset;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
418 if (cmd.args.size() != 7)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
419 fprintf(stderr,"\n%d/%d: cmd 01-04:0320 : XXXX NOT SUPPORTED LIST : DOUBLE RANGE CONVERSION! XXXXXXXXXXX\n",cmd.scn,cmd.pos);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
420 if (val < v_min)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
421 val = v_min;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
422 if (val > v_max)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
423 val = v_max;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
424 val = (r_max-r_min)*(val-v_min)/(v_max-v_min) + r_min;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
425 cmd.SetSysvar(val);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
426 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
427 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
428
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
429 void Text::impl_constrain(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
430 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
431 /* range 内に丸める */
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
432 int min = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
433 int val = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
434 int max = cmd.args[2].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
435 if (min > max) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
436 max = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
437 min = cmd.args[2].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
438 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
439 if (val < min)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
440 val = min;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
441 if (val > max)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
442 val = max;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
443 cmd.SetSysvar(val);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
444 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
445
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
446
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
447 void Text::impl_load(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
448 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
449 // メニューからのロード
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
450 cmd.cmd_type = CMD_LOADREQ;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
451 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
452
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
453 void Text::impl_GetWindowAttr(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
454 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
455 // テキストウィンドウの色設定
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
456 int r, g, b, a, flag;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
457
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
458 if (cmd.cmd3 == 2617) // 元設定を取り出す
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
459 config->GetOriginalParam("#WINDOW_ATTR", 5, &r, &g, &b, &a, &flag);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
460 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
461 config->GetParam("#WINDOW_ATTR", 5, &r, &g, &b, &a, &flag);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
462
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
463 if (cmd.args.size() != 5) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
464 fprintf(stderr,"cmd 01-04:%4d : invalid arg size\n", cmd.cmd3);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
465 } else {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
466 vector<VarInfo> args(cmd.args);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
467 cmd.SetFlagvar(args[0], r);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
468 cmd.SetFlagvar(args[1], g);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
469 cmd.SetFlagvar(args[2], b);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
470 cmd.SetFlagvar(args[3], a);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
471 cmd.SetFlagvar(args[4], flag);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
472 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
473 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
474
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
475 void Text::impl_SetWindowAttr(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
476 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
477 int r, g, b, a, flag;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
478 config->GetParam("#WINDOW_ATTR", 5, &r, &g, &b, &a, &flag);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
479
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
480 switch(cmd.cmd3) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
481 case 2260:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
482 r = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
483 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
484 case 2261:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
485 g = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
486 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
487 case 2262:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
488 b = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
489 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
490 case 2263:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
491 a = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
492 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
493 case 2264:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
494 flag = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
495 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
496 case 2267:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
497 r = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
498 g = cmd.args[1].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
499 b = cmd.args[2].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
500 a = cmd.args[3].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
501 flag = cmd.args[4].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
502 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
503 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
504 config->SetParam("#WINDOW_ATTR", 5, r, g, b, a, flag);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
505 SetWindowColor(r, g, b, a, flag);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
506 cmd.clear();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
507 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
508
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
509 void Text::impl_GetDefConfig(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
510 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
511 int v = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
512 switch(cmd.cmd3) {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
513 case 2600:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
514 case 2605:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
515 config->GetOriginalParam("#INIT_MESSAGE_SPEED", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
516 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
517 case 2601:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
518 config->GetOriginalParam("#INIT_MESSAGE_SPEED_MOD", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
519 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
520 case 2604:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
521 config->GetOriginalParam("#MESSAGE_KEY_WAIT_USE", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
522 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
523 case 2606:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
524 config->GetOriginalParam("#MESSAGE_KEY_WAIT_TIME", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
525 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
526 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
527 cmd.SetSysvar(v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
528 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
529
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
530 void Text::impl_GetConfig(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
531 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
532 int v;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
533 switch (cmd.cmd3)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
534 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
535 case 2323:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
536 case 2351:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
537 config->GetParam("#INIT_MESSAGE_SPEED", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
538 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
539 case 2324:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
540 config->GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
541 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
542 case 2350:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
543 config->GetParam("#MESSAGE_KEY_WAIT_USE", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
544 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
545 case 2352:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
546 config->GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
547 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
548 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
549
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
550 cmd.SetSysvar(v);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
551 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
552
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
553 void Text::impl_SetConfig(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
554 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
555 int speed, use_speed_mod, wait, use_wait_mod;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
556 config->GetParam("#INIT_MESSAGE_SPEED", 1, &speed);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
557 config->GetParam("#INIT_MESSAGE_SPEED_MOD", 1, &use_speed_mod);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
558 config->GetParam("#MESSAGE_KEY_WAIT_USE", 1, &use_wait_mod);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
559 config->GetParam("#MESSAGE_KEY_WAIT_TIME", 1, &wait);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
560 switch (cmd.cmd3)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
561 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
562 case 2223:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
563 case 2251:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
564 speed = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
565 if (speed < 10) //FIXME: ??? 0 ???
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
566 speed = 10;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
567 if (speed > 10000) //FIXME: ??? 255 ???
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
568 speed = 10000;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
569 config->SetParam("#INIT_MESSAGE_SPEED", 1, speed);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
570 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
571 case 2224:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
572 use_speed_mod = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
573 config->SetParam("#INIT_MESSAGE_SPEED_MOD", 1, use_speed_mod);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
574 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
575 case 2250:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
576 use_wait_mod = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
577 config->SetParam("#MESSAGE_KEY_WAIT_USE", 1, use_wait_mod);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
578 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
579 case 2252:
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
580 int wait = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
581 if (wait < 0)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
582 wait = 0;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
583 else if (wait > 60000)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
584 wait = 60000;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
585 config->SetParam("#MESSAGE_KEY_WAIT_TIME", 1, wait);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
586 break;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
587 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
588
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
589 if (use_speed_mod) // FIXME: Not the other way around?
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
590 SetTextSpeed(-1);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
591 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
592 SetTextSpeed(speed);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
593
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
594 if (use_wait_mod)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
595 SetTextWait(wait);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
596 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
597 SetTextWait(-1);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
598
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
599 cmd.clear();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
600 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
601
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
602 void Text::impl_GetName(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
603 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
604 // replace_name を得る
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
605 int n = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
606 if (n >= 0 && n < 26) // FIXME: Should go up to 702, but otakunoraifu is not ready for that yet
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
607 cmd.SetStrvar(cmd.args[1], replace_name[n]);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
608 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
609 cmd.SetStrvar(cmd.args[1], "");
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
610 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
611
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
612 void Text::impl_SetName(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
613 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
614 // replace_name を得る
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
615 int n = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
616 if (n >= 0 && n < 26) // FIXME: Should go up to 702, but otakunoraifu is not ready for that yet
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
617 replace_name[n] = cmd.Str(cmd.args[1]);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
618 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
619
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
620 void Text::impl_GetLocalName(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
621 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
622 // replace_name2 を得る
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
623 int n = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
624 if (n >= 0 && n < 26) // FIXME: Should go up to 702, but otakunoraifu is not ready for that yet
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
625 cmd.SetStrvar(cmd.args[1], replace_name2[n]);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
626 else
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
627 cmd.SetStrvar(cmd.args[1], "");
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
628 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
629
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
630 void Text::impl_SetLocalName(Cmd& cmd)
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
631 {
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
632 // replace_name2 の設定
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
633 int n = cmd.args[0].value;
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
634 if (n >= 0 && n < 26) // FIXME: Should go up to 702, but otakunoraifu is not ready for that yet
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
635 replace_name2[n] = cmd.Str(cmd.args[1]);
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
636
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
637 cmd.clear();
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
638 }
0aaa5bb3dde5 Moved all opcodes from scn2k_text.cc to scn2k_textimpl.cc
Thibaut GIRKA <thib@sitedethib.com>
parents: 57
diff changeset
639