CRUISE: Initialize some variables in the contractor, change some variables to boolean

This commit is contained in:
Strangerke 2014-06-09 17:53:27 +02:00
parent 0a1c75bc32
commit ff93aef6ec
7 changed files with 19 additions and 24 deletions

View file

@ -50,6 +50,16 @@ CruiseEngine::CruiseEngine(OSystem * syst, const CRUISEGameDescription *gameDesc
_debugger = new Debugger(); _debugger = new Debugger();
_sound = new PCSound(_mixer, this); _sound = new PCSound(_mixer, this);
PCFadeFlag = false;
_preLoad = false;
_savedCursor = CURSOR_NOMOUSE;
lastTick = 0;
lastTickDebug = 0;
_gameSpeed = GAME_FRAME_DELAY_1;
_speedFlag = false;
_polyStructs = nullptr;
_polyStruct = nullptr;
// Setup mixer // Setup mixer
syncSoundSettings(); syncSoundSettings();
} }
@ -87,9 +97,6 @@ Common::Error CruiseEngine::run() {
Cruise::changeCursor(Cruise::CURSOR_NORMAL); Cruise::changeCursor(Cruise::CURSOR_NORMAL);
CursorMan.showMouse(true); CursorMan.showMouse(true);
lastTick = 0;
lastTickDebug = 0;
mainLoop(); mainLoop();
deinitialize(); deinitialize();
@ -98,24 +105,12 @@ Common::Error CruiseEngine::run() {
} }
void CruiseEngine::initialize() { void CruiseEngine::initialize() {
PCFadeFlag = 0;
_gameSpeed = GAME_FRAME_DELAY_1;
_speedFlag = false;
/*volVar1 = 0;
* fileData1 = 0; */
/*PAL_fileHandle = -1; */
// video init stuff // video init stuff
initSystem(); initSystem();
gfxModuleData_Init(); gfxModuleData_Init();
// another bit of video init // another bit of video init
readVolCnf(); readVolCnf();
_vm->_polyStruct = NULL;
} }
void CruiseEngine::deinitialize() { void CruiseEngine::deinitialize() {

View file

@ -1937,7 +1937,7 @@ void CruiseEngine::mainLoop() {
if (displayOn) { if (displayOn) {
if (doFade) if (doFade)
PCFadeFlag = 0; PCFadeFlag = false;
/*if (!PCFadeFlag)*/ /*if (!PCFadeFlag)*/
mainDraw(userWait); mainDraw(userWait);

View file

@ -644,7 +644,7 @@ int16 Op_FadeOut() {
flip(); flip();
fadeFlag = 1; fadeFlag = 1;
PCFadeFlag = 1; PCFadeFlag = true;
return 0; return 0;
} }

View file

@ -120,7 +120,7 @@ void fadeIn() {
gfxModuleData_setPal256(workpal); gfxModuleData_setPal256(workpal);
fadeFlag = 0; fadeFlag = 0;
PCFadeFlag = 0; PCFadeFlag = false;
} }
void flipScreen() { void flipScreen() {

View file

@ -735,7 +735,7 @@ void initVars() {
resetBackgroundIncrustList(&backgroundIncrustHead); resetBackgroundIncrustList(&backgroundIncrustHead);
vblLimit = 0; vblLimit = 0;
remdo = 0; remdo = false;
songLoaded = 0; songLoaded = 0;
songPlayed = 0; songPlayed = 0;
songLoop = 1; songLoop = 1;
@ -777,7 +777,7 @@ void initVars() {
buttonDown = 0; buttonDown = 0;
var41 = 0; var41 = 0;
playerMenuEnabled = 0; playerMenuEnabled = 0;
PCFadeFlag = 0; PCFadeFlag = false;
} }
Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName) { Common::Error saveSavegameData(int saveGameIdx, const Common::String &saveName) {

View file

@ -24,8 +24,8 @@
namespace Cruise { namespace Cruise {
uint16 remdo = 0; bool remdo = false;
uint16 PCFadeFlag; bool PCFadeFlag;
char *getText(int textIndex, int overlayIndex) { char *getText(int textIndex, int overlayIndex) {
if (!overlayTable[overlayIndex].ovlData) { if (!overlayTable[overlayIndex].ovlData) {

View file

@ -27,8 +27,8 @@
namespace Cruise { namespace Cruise {
extern uint16 remdo; extern bool remdo;
extern uint16 PCFadeFlag; extern bool PCFadeFlag;
int16 objInit(int ovlIdx, int param1, int param2); int16 objInit(int ovlIdx, int param1, int param2);
char *getText(int textIndex, int overlayIndex); char *getText(int textIndex, int overlayIndex);