TSAGE: Fix CID 1002393, 1002395, 1002396. Get rid of some magic values

This commit is contained in:
Strangerke 2013-10-27 14:29:41 +01:00
parent 90a6a2168a
commit c145daf625
7 changed files with 18 additions and 6 deletions

View File

@ -343,7 +343,7 @@ void Scene50::synchronize(Serializer &s) {
void Scene50::postInit(SceneObjectList *OwnerList) {
SceneExt::postInit();
BF_GLOBALS._interfaceY = 200;
BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
T2_GLOBALS._uiElements._active = false;
BF_GLOBALS._player.postInit();
BF_GLOBALS._player.setVisage(830);

View File

@ -1399,7 +1399,7 @@ bool Scene325::Item1::startAction(CursorType action, Event &event) {
void Scene325::postInit(SceneObjectList *OwnerList) {
SceneExt::postInit();
loadScene(325);
BF_GLOBALS._interfaceY = 200;
BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
BF_GLOBALS.clearFlag(fCanDrawGun);
if (BF_GLOBALS._dayNumber == 0)

View File

@ -275,7 +275,7 @@ bool Scene666::Item1::startAction(CursorType action, Event &event) {
void Scene666::postInit(SceneObjectList *OwnerList) {
BF_GLOBALS._sound1.play(27);
SceneExt::postInit();
BF_GLOBALS._interfaceY = 200;
BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
loadScene(999);
BF_GLOBALS._screenSurface.fillRect(BF_GLOBALS._screenSurface.getBounds(), 0);

View File

@ -3577,7 +3577,7 @@ void Scene935::postInit(SceneObjectList *OwnerList) {
PalettedScene::postInit();
loadScene(935);
BF_GLOBALS._interfaceY = 200;
BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
BF_GLOBALS._player.disableControl();
_visualSpeaker._textMode = ALIGN_CENTER;
_visualSpeaker._hideObjects = false;
@ -3812,7 +3812,7 @@ void Scene940::postInit(SceneObjectList *OwnerList) {
BF_GLOBALS._sound1.play(115);
BF_GLOBALS._dayNumber = 6;
BF_GLOBALS._interfaceY = 200;
BF_GLOBALS._interfaceY = SCREEN_HEIGHT;
T2_GLOBALS._uiElements._active = false;
_gameTextSpeaker2._speakerName = "SENTTEXT";

View File

@ -204,6 +204,11 @@ void Globals::dispatchSounds() {
/*--------------------------------------------------------------------------*/
TsAGE2Globals::TsAGE2Globals() {
_onSelectItem = NULL;
_interfaceY = 0;
}
void TsAGE2Globals::reset() {
Globals::reset();

View File

@ -110,7 +110,7 @@ public:
int _interfaceY;
ASoundExt _inventorySound;
TsAGE2Globals() { _onSelectItem = NULL; }
TsAGE2Globals();
virtual void reset();
virtual void synchronize(Serializer &s);
};

View File

@ -710,6 +710,11 @@ GfxElement::GfxElement() {
_owner = NULL;
_keycode = 0;
_flags = 0;
_fontNumber = 0;
_color1 = 0;
_color2 = 0;
_color3 = 0;
}
void GfxElement::setDefaults() {
@ -1367,6 +1372,8 @@ GfxFont::GfxFont() {
_bpp = 0;
_fontData = NULL;
_fillFlag = false;
_gfxManager = nullptr;
}
GfxFont::~GfxFont() {