[Scummvm-cvs-logs] CVS: scummvm/sword2 anims.cpp,1.38,1.39 controls.cpp,1.40,1.41 controls.h,1.8,1.9 mouse.cpp,1.31,1.32 speech.cpp,1.36,1.37 sword2.cpp,1.69,1.70
Torbj?rn Andersson
eriktorbjorn at users.sourceforge.net
Sat Nov 1 09:09:05 CET 2003
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sword2 anims.cpp,1.37,1.38 build_display.cpp,1.38,1.39 build_display.h,1.10,1.11 controls.cpp,1.39,1.40 debug.cpp,1.18,1.19 function.cpp,1.31,1.32 layers.cpp,1.16,1.17 logic.h,1.11,1.12 mouse.cpp,1.30,1.31 resman.cpp,1.58,1.59 sword2.cpp,1.68,1.69 sword2.h,1.27,1.28
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sword2 controls.cpp,1.41,1.42
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1:/tmp/cvs-serv11858
Modified Files:
anims.cpp controls.cpp controls.h mouse.cpp speech.cpp
sword2.cpp
Log Message:
Create the gui object dynamically
Index: anims.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/anims.cpp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- anims.cpp 1 Nov 2003 16:55:19 -0000 1.38
+++ anims.cpp 1 Nov 2003 17:08:23 -0000 1.39
@@ -538,7 +538,7 @@
// if we want subtitles, or speech failed to load
- if (gui._subtitles || !speechRunning) {
+ if (gui->_subtitles || !speechRunning) {
// open text resource & get the line
text = FetchTextLine(res_man.open(text_res), local_text);
// make the sprite
Index: controls.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/controls.cpp,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- controls.cpp 1 Nov 2003 16:55:19 -0000 1.40
+++ controls.cpp 1 Nov 2003 17:08:23 -0000 1.41
@@ -45,7 +45,7 @@
// our fonts start on SPACE character (32)
#define SIZE_OF_CHAR_SET (256 - 32)
-Gui gui;
+Gui *gui;
enum {
kAlignLeft,
@@ -775,11 +775,11 @@
registerWidget(_okButton);
registerWidget(_cancelButton);
- gui.readOptionSettings();
+ gui->readOptionSettings();
- _objectLabelsSwitch->setValue(gui._pointerTextSelected != 0);
- _subtitlesSwitch->setValue(gui._subtitles != 0);
- _reverseStereoSwitch->setValue(gui._stereoReversed != 0);
+ _objectLabelsSwitch->setValue(gui->_pointerTextSelected != 0);
+ _subtitlesSwitch->setValue(gui->_subtitles != 0);
+ _reverseStereoSwitch->setValue(gui->_stereoReversed != 0);
_musicSwitch->setValue(!g_sound->isMusicMute());
_speechSwitch->setValue(!g_sound->isSpeechMute());
_fxSwitch->setValue(!g_sound->isFxMute());
@@ -843,9 +843,9 @@
// is handled when the dialog is terminated.
if (widget == _reverseStereoSwitch) {
- if (result != gui._stereoReversed)
+ if (result != gui->_stereoReversed)
g_sound->reverseStereo();
- gui._stereoReversed = result;
+ gui->_stereoReversed = result;
} else if (widget == _musicSwitch) {
g_sound->muteMusic(result);
} else if (widget == _musicSlider) {
@@ -858,7 +858,7 @@
_fxSwitch->setValue(result != 0);
} else if (widget == _gfxSlider) {
_gfxPreview->setState(result);
- gui.updateGraphicsLevel(result);
+ gui->updateGraphicsLevel(result);
} else if (widget == _okButton) {
// Apply the changes
g_sound->muteMusic(!_musicSwitch->getValue());
@@ -868,17 +868,17 @@
g_sound->setSpeechVolume(_speechSlider->getValue());
g_sound->setFxVolume(_fxSlider->getValue());
- gui.updateGraphicsLevel(_gfxSlider->getValue());
+ gui->updateGraphicsLevel(_gfxSlider->getValue());
- gui._subtitles = _subtitlesSwitch->getValue();
- gui._pointerTextSelected = _objectLabelsSwitch->getValue();
- gui._stereoReversed = _reverseStereoSwitch->getValue();
+ gui->_subtitles = _subtitlesSwitch->getValue();
+ gui->_pointerTextSelected = _objectLabelsSwitch->getValue();
+ gui->_stereoReversed = _reverseStereoSwitch->getValue();
- gui.writeOptionSettings();
+ gui->writeOptionSettings();
setResult(1);
} else if (widget == _cancelButton) {
// Revert the changes
- gui.readOptionSettings();
+ gui->readOptionSettings();
setResult(0);
}
}
@@ -1074,13 +1074,13 @@
void updateSlots() {
for (int i = 0; i < 8; i++) {
- Slot *slot = _slotButton[(gui._baseSlot + i) % 8];
+ Slot *slot = _slotButton[(gui->_baseSlot + i) % 8];
FontRendererGui *fr;
uint8 description[SAVE_DESCRIPTION_LEN];
slot->setY(72 + i * 36);
- if (gui._baseSlot + i == _selectedSlot) {
+ if (gui->_baseSlot + i == _selectedSlot) {
slot->setEditable(_mode == kSaveDialog);
slot->setState(1);
fr = _fr2;
@@ -1090,11 +1090,11 @@
fr = _fr1;
}
- if (GetSaveDescription(gui._baseSlot + i, description) == SR_OK) {
- slot->setText(fr, gui._baseSlot + i, (char *) description);
+ if (GetSaveDescription(gui->_baseSlot + i, description) == SR_OK) {
+ slot->setText(fr, gui->_baseSlot + i, (char *) description);
slot->setClickable(true);
} else {
- slot->setText(fr, gui._baseSlot + i, NULL);
+ slot->setText(fr, gui->_baseSlot + i, NULL);
slot->setClickable(_mode == kSaveDialog);
}
@@ -1107,29 +1107,29 @@
virtual void onAction(Widget *widget, int result = 0) {
if (widget == _zupButton) {
- if (gui._baseSlot > 0) {
- if (gui._baseSlot >= 8)
- gui._baseSlot -= 8;
+ if (gui->_baseSlot > 0) {
+ if (gui->_baseSlot >= 8)
+ gui->_baseSlot -= 8;
else
- gui._baseSlot = 0;
+ gui->_baseSlot = 0;
updateSlots();
}
} else if (widget == _upButton) {
- if (gui._baseSlot > 0) {
- gui._baseSlot--;
+ if (gui->_baseSlot > 0) {
+ gui->_baseSlot--;
updateSlots();
}
} else if (widget == _downButton) {
- if (gui._baseSlot < 92) {
- gui._baseSlot++;
+ if (gui->_baseSlot < 92) {
+ gui->_baseSlot++;
updateSlots();
}
} else if (widget == _zdownButton) {
- if (gui._baseSlot < 92) {
- if (gui._baseSlot <= 84)
- gui._baseSlot += 8;
+ if (gui->_baseSlot < 92) {
+ if (gui->_baseSlot <= 84)
+ gui->_baseSlot += 8;
else
- gui._baseSlot = 92;
+ gui->_baseSlot = 92;
updateSlots();
}
} else if (widget == _okButton) {
@@ -1187,7 +1187,7 @@
}
} else {
if (result == kSelectSlot)
- _selectedSlot = gui._baseSlot + (slot->getY() - 72) / 35;
+ _selectedSlot = gui->_baseSlot + (slot->getY() - 72) / 35;
else if (result == kDeselectSlot)
_selectedSlot = -1;
@@ -1215,7 +1215,7 @@
// but I doubt that will make any noticeable difference.
slot->paint();
- _fr2->drawText(_editBuffer, 130, 78 + (_selectedSlot - gui._baseSlot) * 36);
+ _fr2->drawText(_editBuffer, 130, 78 + (_selectedSlot - gui->_baseSlot) * 36);
}
virtual void paint() {
@@ -1392,9 +1392,9 @@
ConfMan.set("speech_mute", g_sound->isSpeechMute());
ConfMan.set("sfx_mute", g_sound->isFxMute());
ConfMan.set("gfx_details", g_display->getRenderLevel());
- ConfMan.set("nosubtitles", !gui._subtitles);
- ConfMan.set("object_labels", gui._pointerTextSelected);
- ConfMan.set("reverse_stereo", gui._stereoReversed);
+ ConfMan.set("nosubtitles", !_subtitles);
+ ConfMan.set("object_labels", _pointerTextSelected);
+ ConfMan.set("reverse_stereo", _stereoReversed);
ConfMan.flushToDisk();
}
Index: controls.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/controls.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- controls.h 29 Oct 2003 07:53:05 -0000 1.8
+++ controls.h 1 Nov 2003 17:08:23 -0000 1.9
@@ -47,7 +47,7 @@
void updateGraphicsLevel(int newLevel);
};
-extern Gui gui;
+extern Gui *gui;
} // End of namespace Sword2
Index: mouse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/mouse.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- mouse.cpp 1 Nov 2003 16:55:19 -0000 1.31
+++ mouse.cpp 1 Nov 2003 17:08:23 -0000 1.32
@@ -243,19 +243,19 @@
// call the relevent screen
switch (hit) {
case 0:
- gui.optionControl();
+ gui->optionControl();
break;
case 1:
- gui.quitControl();
+ gui->quitControl();
break;
case 2:
- gui.saveControl();
+ gui->saveControl();
break;
case 3:
- gui.restoreControl();
+ gui->restoreControl();
break;
case 4:
- gui.restartControl();
+ gui->restartControl();
break;
}
@@ -877,7 +877,7 @@
int16 xOffset, yOffset;
uint8 justification;
- if (gui._pointerTextSelected) {
+ if (gui->_pointerTextSelected) {
if (textId) {
// check what the pointer is, to set offsets
// correctly for text position
Index: speech.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/speech.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- speech.cpp 29 Oct 2003 07:53:05 -0000 1.36
+++ speech.cpp 1 Nov 2003 17:08:23 -0000 1.37
@@ -959,7 +959,7 @@
// for this line either, then just quit back to script right
// now!
- if (gui._subtitles == 0 && WantSpeechForLine(params[S_WAV]) == 0)
+ if (gui->_subtitles == 0 && WantSpeechForLine(params[S_WAV]) == 0)
return IR_CONT;
if (cycle_skip == 0) {
@@ -1191,7 +1191,7 @@
}
// if we want subtitles, or speech failed to load
- if (gui._subtitles || speechRunning == 0) {
+ if (gui->_subtitles || speechRunning == 0) {
// then we're going to show the text
textRunning = 1;
Index: sword2.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/sword2.cpp,v
retrieving revision 1.69
retrieving revision 1.70
diff -u -d -r1.69 -r1.70
--- sword2.cpp 1 Nov 2003 16:55:20 -0000 1.69
+++ sword2.cpp 1 Nov 2003 17:08:23 -0000 1.70
@@ -137,6 +137,7 @@
g_sound = _sound = new Sound(_mixer);
g_display = _display = new Display(640, 480);
+ gui = new Gui();
_newgui = g_gui;
_debugger = new Debugger(this);
@@ -159,6 +160,7 @@
delete _sound;
delete _display;
delete _debugger;
+ delete gui;
}
void Sword2Engine::errorString(const char *buf1, char *buf2) {
@@ -301,7 +303,7 @@
// via a window, thus time becomes a loop.
debug(5, "CALLING: readOptionSettings");
- gui.readOptionSettings();
+ gui->readOptionSettings();
debug(5, "CALLING: InitialiseGame");
if (InitialiseGame()) {
@@ -314,7 +316,7 @@
RestoreGame(_saveSlot);
else { // show restore menu
Set_mouse(NORMAL_MOUSE_ID);
- if (!gui.restoreControl())
+ if (!gui->restoreControl())
Start_game();
}
} else
@@ -517,8 +519,8 @@
// if level at max, turn down because palette-matching won't work
// when dimmed
- if (gui._currentGraphicsLevel == 3) {
- gui.updateGraphicsLevel(2);
+ if (gui->_currentGraphicsLevel == 3) {
+ gui->updateGraphicsLevel(2);
graphics_level_fudged = 1;
}
@@ -545,7 +547,7 @@
// If graphics level at max, turn up again
if (graphics_level_fudged) {
- gui.updateGraphicsLevel(3);
+ gui->updateGraphicsLevel(3);
graphics_level_fudged = 0;
}
- Previous message: [Scummvm-cvs-logs] CVS: scummvm/sword2 anims.cpp,1.37,1.38 build_display.cpp,1.38,1.39 build_display.h,1.10,1.11 controls.cpp,1.39,1.40 debug.cpp,1.18,1.19 function.cpp,1.31,1.32 layers.cpp,1.16,1.17 logic.h,1.11,1.12 mouse.cpp,1.30,1.31 resman.cpp,1.58,1.59 sword2.cpp,1.68,1.69 sword2.h,1.27,1.28
- Next message: [Scummvm-cvs-logs] CVS: scummvm/sword2 controls.cpp,1.41,1.42
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Scummvm-git-logs
mailing list