[Scummvm-cvs-logs] CVS: scummvm/saga interface.cpp,1.69,1.70 interface.h,1.34,1.35 script.cpp,1.53,1.54 script.h,1.56,1.57 sthread.cpp,1.62,1.63
Eugene Sandulenko
sev at users.sourceforge.net
Wed Jan 19 03:30:15 CET 2005
Update of /cvsroot/scummvm/scummvm/saga
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31288
Modified Files:
interface.cpp interface.h script.cpp script.h sthread.cpp
Log Message:
o Made ITEColors enum public in interface.h. Please use them. These colors
stay in each scene except intro and fade-in/fade-outs.
o Implemented status text coloring during work of auxiliary scripts.
Index: interface.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- interface.cpp 18 Jan 2005 21:13:28 -0000 1.69
+++ interface.cpp 19 Jan 2005 11:29:28 -0000 1.70
@@ -133,6 +133,7 @@
_savedMode = -1;
_inMainMode = false;
*_statusText = 0;
+ _statusOnceColor = -1;
_inventoryCount = 0;
_inventorySize = ITE_INVENTORY_SIZE;
@@ -283,6 +284,7 @@
assert(new_txt != NULL);
strncpy(_statusText, new_txt, STATUS_TEXT_LEN);
+ _statusOnceColor = -1;
return SUCCESS;
}
@@ -417,6 +419,7 @@
Rect rect;
int string_w;
+ int color;
// Disable this for IHNM for now, since that game uses the full screen
// in some cases.
@@ -436,8 +439,13 @@
string_w = _vm->_font->getStringWidth(SMALL_FONT_ID, _statusText, 0, 0);
+ if (_statusOnceColor == -1)
+ color = _vm->getDisplayInfo().statusTextColor;
+ else
+ color = _statusOnceColor;
+
_vm->_font->draw(SMALL_FONT_ID, ds, _statusText, 0, (_vm->getDisplayInfo().statusWidth / 2) - (string_w / 2),
- _vm->getDisplayInfo().statusY + _vm->getDisplayInfo().statusTextY, _vm->getDisplayInfo().statusTextColor, 0, 0);
+ _vm->getDisplayInfo().statusY + _vm->getDisplayInfo().statusTextY, color, 0, 0);
return SUCCESS;
}
@@ -742,15 +750,6 @@
return false;
}
-enum converseColors {
- kColorBrightWhite = 0x2,
- kColorGrey = 0xa,
- kColorDarkGrey = 0xb,
- kColorGreen = 0xba,
- kColorBlack = 0xf,
- kColorBlue = 0x93
-};
-
void Interface::converseDisplayText(int pos) {
int end;
@@ -768,7 +767,7 @@
_converseEndPos = end;
- converseDisplayTextLine(kColorBrightWhite, false, true);
+ converseDisplayTextLine(kITEColorBrightWhite, false, true);
}
@@ -796,10 +795,10 @@
&& _converseText[_conversePos].stringNum
== _converseText[relpos].stringNum) {
textcolors[0][i] = textcolor;
- textcolors[1][i] = (!btnDown) ? kColorDarkGrey : kColorGrey;
+ textcolors[1][i] = (!btnDown) ? kITEColorDarkGrey : kITEColorGrey;
} else {
- textcolors[0][i] = kColorBlue;
- textcolors[1][i] = kColorDarkGrey;
+ textcolors[0][i] = kITEColorBlue;
+ textcolors[1][i] = kITEColorDarkGrey;
}
}
// if no colors have changed, exit
@@ -813,7 +812,7 @@
rect.moveTo(_conversePanel.x + x, _conversePanel.y + y);
- drawRect(ds, &rect, kColorDarkGrey);
+ drawRect(ds, &rect, kITEColorDarkGrey);
rect.top = rect.left = 0;
rect.right = CONVERSE_MAX_TEXT_WIDTH;
@@ -836,13 +835,13 @@
byte tcolor, bcolor;
if (_converseText[relpos].textNum == 0) { // first entry
- tcolor = kColorGreen;
- bcolor = kColorBlack;
+ tcolor = kITEColorGreen;
+ bcolor = kITEColorBlack;
_vm->_font->draw(SMALL_FONT_ID, ds, bullet, strlen(bullet),
scrx + 2, scry, tcolor, bcolor, FONT_SHADOW | FONT_DONTMAP);
}
_vm->_font->draw(SMALL_FONT_ID, ds, str, strlen(str),
- scrx + 9, scry, foregnd, kColorBlack, FONT_SHADOW);
+ scrx + 9, scry, foregnd, kITEColorBlack, FONT_SHADOW);
}
}
@@ -853,7 +852,7 @@
if ((chg < 0 && _converseStartPos + chg >= 0) ||
(chg > 0 && _converseStartPos < _converseEndPos)) {
_converseStartPos += chg;
- converseDisplayTextLine(kColorBlue, false, true);
+ converseDisplayTextLine(kITEColorBlue, false, true);
}
}
@@ -865,7 +864,7 @@
return;
// FIXME: wait until Andrew defines proper color
- converseSetTextLines(selection, kColorBrightWhite, false);
+ converseSetTextLines(selection, kITEColorBrightWhite, false);
ct = &_converseText[_conversePos];
Index: interface.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/interface.h,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- interface.h 18 Jan 2005 15:01:20 -0000 1.34
+++ interface.h 19 Jan 2005 11:29:28 -0000 1.35
@@ -91,6 +91,16 @@
int replyBit;
};
+enum ITEColors {
+ kITEColorBrightWhite = 0x2,
+ kITEColorGrey = 0xa,
+ kITEColorDarkGrey = 0xb,
+ kITEColorGreen = 0xba,
+ kITEColorBlack = 0xf,
+ kITEColorBlue = 0x93
+};
+
+
class Interface {
public:
Interface(SagaEngine *vm);
@@ -105,6 +115,7 @@
void restoreMode();
bool isInMainMode() { return _inMainMode; }
int setStatusText(const char *new_txt);
+ void setStatusOnceColor(int color) { _statusOnceColor = color; }
int loadScenePortraits(int resourceId);
int setLeftPortrait(int portrait);
int setRightPortrait(int portrait);
@@ -165,6 +176,7 @@
int _lockedMode;
bool _inMainMode;
char _statusText[STATUS_TEXT_LEN];
+ int _statusOnceColor;
int _leftPortrait;
int _rightPortrait;
Index: script.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- script.cpp 18 Jan 2005 23:15:29 -0000 1.53
+++ script.cpp 19 Jan 2005 11:29:28 -0000 1.54
@@ -563,7 +563,7 @@
}
// verb
-void Script::showVerb() {
+void Script::showVerb(int statuscolor) {
const char *verbName;
const char *object1Name;
const char *object2Name;
@@ -609,6 +609,8 @@
_vm->_interface->setStatusText(statusString);
}
}
+ if (statuscolor != -1)
+ _vm->_interface->setStatusOnceColor(statuscolor);
}
void Script::setVerb(int verb) {
@@ -683,7 +685,6 @@
if ((hitZone->getFlags() & kHitZoneExit) == 0) {
scriptEntrypointNumber = hitZone->getScriptNumber();
}
-
} else {
if (objectType & (kGameObjectActor | kGameObjectObject)) {
scriptEntrypointNumber = _vm->_actor->getObjectScriptEntrypointNumber(_pendingObject[0]);
@@ -752,11 +753,10 @@
_pendingVerb = verb;
_leftButtonVerb = verb;
- if (_pendingVerb > kVerbNone) {
- // statusColor = BRIGHT_WHITE;
- }
- showVerb();
- /*statusColor = GREEN_BA;*/
+ if (_pendingVerb > kVerbNone)
+ showVerb(kITEColorBrightWhite);
+ else
+ showVerb();
_secondObjectNeeded = false;
_firstObjectSet = false;
@@ -787,11 +787,10 @@
}
_leftButtonVerb = verb;
- if (_pendingVerb > kVerbNone) {
- // statusColor = BRIGHT_WHITE;
- }
- showVerb();
- //statusColor = GREEN_BA;
+ if (_pendingVerb > kVerbNone)
+ showVerb(kITEColorBrightWhite);
+ else
+ showVerb();
}
}
Index: script.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/script.h,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -d -r1.56 -r1.57
--- script.h 18 Jan 2005 21:13:42 -0000 1.56
+++ script.h 19 Jan 2005 11:29:29 -0000 1.57
@@ -262,7 +262,7 @@
const char * getScriptString(int index) const { return _currentScript->strings.getString(index); }
void doVerb();
- void showVerb();
+ void showVerb(int statuscolor = -1);
void setVerb(int verb);
int getCurrentVerb() const { return _currentVerb; }
void setPointerVerb();
Index: sthread.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/saga/sthread.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- sthread.cpp 18 Jan 2005 11:55:31 -0000 1.62
+++ sthread.cpp 19 Jan 2005 11:29:29 -0000 1.63
@@ -260,7 +260,7 @@
// debug print (opCode name etc) should be placed here
// SDebugPrintInstr(thread)
-// debug(2, "Executing thread offset: %lu (%x) stack: %d", thread->instructionOffset, operandChar, thread->stackSize());
+ debug(8, "Executing thread offset: %lu (%x) stack: %d", thread->instructionOffset, operandChar, thread->stackSize());
switch (operandChar) {
case 0x01: // nextblock
// Some sort of "jump to the start of the next memory
@@ -463,6 +463,7 @@
data = thread->pop();
n_switch = scriptS.readUint16LE();
+
for (i = 0; i < n_switch; i++) {
switch_num = scriptS.readUint16LE();
switch_jmp = scriptS.readUint16LE();
More information about the Scummvm-git-logs
mailing list