WINTERMUTE: Privatize/Protect variables that don't need to be public.

This commit is contained in:
Einar Johan Trøan Sømåen 2012-07-25 05:08:13 +02:00
parent 28759d7aa3
commit 45c5eb5cab
25 changed files with 292 additions and 285 deletions

View File

@ -54,13 +54,9 @@ public:
virtual bool displayDebugInfo();
virtual bool initAfterLoad();
static void afterLoadScene(void *scene, void *data);
bool _smartItemCursor;
BaseArray<char *, char *> _speechDirs;
bool addSpeechDir(const char *dir);
bool removeSpeechDir(const char *dir);
char *findSpeechFile(char *StringID);
@ -71,18 +67,13 @@ public:
virtual bool resetContent();
bool addItem(AdItem *item);
AdItem *getItemByName(const char *name);
BaseArray<AdItem *, AdItem *> _items;
AdObject *_inventoryOwner;
bool isItemTaken(char *itemName);
bool registerInventory(AdInventory *inv);
bool unregisterInventory(AdInventory *inv);
AdObject *_invObject;
BaseArray<AdInventory *, AdInventory *> _inventories;
virtual bool displayContent(bool update = true, bool displayAll = false);
char *_debugStartupScene;
char *_startupScene;
bool _initialScene;
bool gameResponseUsed(int ID);
bool addGameResponse(int ID);
bool resetResponse(int ID);
@ -97,6 +88,7 @@ public:
AdSceneState *getSceneState(const char *filename, bool saving);
BaseViewport *_sceneViewport;
int _texItemLifeTime;
int _texWalkLifeTime;
int _texStandLifeTime;
@ -106,12 +98,9 @@ public:
virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor);
bool scheduleChangeScene(const char *filename, bool fadeIn);
char *_scheduledScene;
bool _scheduledFadeIn;
void setPrevSceneName(const char *name);
void setPrevSceneFilename(const char *name);
char *_prevSceneName;
char *_prevSceneFilename;
virtual bool loadGame(const char *filename);
AdItem *_selectedItem;
bool cleanup();
@ -119,9 +108,9 @@ public:
void finishSentences();
bool showCursor();
TGameStateEx _stateEx;
AdResponseBox *_responseBox;
AdInventoryBox *_inventoryBox;
bool displaySentences(bool frozen);
void addSentence(AdSentence *sentence);
bool changeScene(const char *filename, bool fadeIn);
@ -131,14 +120,8 @@ public:
bool initLoop();
AdGame();
virtual ~AdGame();
BaseArray<AdObject *, AdObject *> _objects;
BaseArray<AdSentence *, AdSentence *> _sentences;
BaseArray<AdSceneState *, AdSceneState *> _sceneStates;
BaseArray<char *, char *> _dlgPendingBranches;
BaseArray<AdResponseContext *, AdResponseContext *> _responsesBranch;
BaseArray<AdResponseContext *, AdResponseContext *> _responsesGame;
virtual bool loadFile(const char *filename);
virtual bool loadBuffer(byte *buffer, bool complete = true);
@ -146,14 +129,37 @@ public:
bool loadItemsFile(const char *filename, bool merge = false);
bool loadItemsBuffer(byte *buffer, bool merge = false);
virtual bool ExternalCall(ScScript *script, ScStack *stack, ScStack *thisStack, char *name);
// scripting interface
virtual ScValue *scGetProperty(const char *name);
virtual bool scSetProperty(const char *name, ScValue *value);
virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
bool validMouse();
private:
virtual bool ExternalCall(ScScript *script, ScStack *stack, ScStack *thisStack, char *name);
AdObject *_invObject;
BaseArray<AdInventory *, AdInventory *> _inventories;
char *_scheduledScene;
bool _scheduledFadeIn;
char *_prevSceneName;
char *_prevSceneFilename;
char *_debugStartupScene;
char *_startupScene;
bool _initialScene;
bool _smartItemCursor;
BaseArray<char *, char *> _speechDirs;
BaseArray<AdItem *, AdItem *> _items;
BaseArray<AdSentence *, AdSentence *> _sentences;
BaseArray<AdSceneState *, AdSceneState *> _sceneStates;
BaseArray<char *, char *> _dlgPendingBranches;
BaseArray<AdResponseContext *, AdResponseContext *> _responsesBranch;
BaseArray<AdResponseContext *, AdResponseContext *> _responsesGame;
AdResponseBox *_responseBox;
AdInventoryBox *_inventoryBox;
};
} // end of namespace WinterMute

View File

@ -131,7 +131,7 @@ char *AdNodeState::getCaption(int caseVal) {
bool AdNodeState::transferEntity(AdEntity *entity, bool includingSprites, bool saving) {
if (!entity) return STATUS_FAILED;
// hack!
// HACK!
if (this->_gameRef != entity->_gameRef) this->_gameRef = entity->_gameRef;
if (saving) {

View File

@ -49,10 +49,10 @@ public:
bool parseEditorProperty(byte *buffer, bool complete = true);
virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent = 0);
BaseClass();
BaseGame *_gameRef;
BaseClass(BaseGame *GameOwner);
virtual ~BaseClass();
BaseGame *_gameRef;
protected:
Common::HashMap<Common::String, Common::String> _editorProps;
Common::HashMap<Common::String, Common::String>::iterator _editorPropsIter;
/* std::map<std::string, std::string> _editorProps;

View File

@ -46,6 +46,7 @@ public:
DECLARE_PERSISTENT(BaseFader, BaseObject)
BaseFader(BaseGame *inGame);
virtual ~BaseFader();
private:
bool _active;
byte _red;
byte _green;

View File

@ -104,7 +104,6 @@ BaseGame::BaseGame(): BaseObject(this) {
_debugLogFile = NULL;
_debugDebugMode = false;
_debugAbsolutePathWarning = true;
_debugShowFPS = false;
_systemFont = NULL;
@ -180,7 +179,7 @@ BaseGame::BaseGame(): BaseObject(this) {
_compressedSavegames = true;
_editorMode = false;
_doNotExpandStrings = false;
//_doNotExpandStrings = false;
_engineLogCallback = NULL;
_engineLogCallbackData = NULL;
@ -3241,7 +3240,6 @@ bool BaseGame::loadGame(const char *filename) {
_indicatorDisplay = true;
_indicatorProgress = 0;
BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
_debugAbsolutePathWarning = false;
if (DID_FAIL(ret = pm->initLoad(filename))) goto load_finish;
//if(DID_FAIL(ret = cleanup())) goto load_finish;
@ -3259,7 +3257,6 @@ bool BaseGame::loadGame(const char *filename) {
getDebugMgr()->onGameInit();
load_finish:
_debugAbsolutePathWarning = true;
_indicatorDisplay = false;
delete pm;
@ -3555,7 +3552,6 @@ bool BaseGame::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_activeObject));
persistMgr->transfer(TMEMBER(_capturedObject));
persistMgr->transfer(TMEMBER(_cursorNoninteractive));
persistMgr->transfer(TMEMBER(_doNotExpandStrings));
persistMgr->transfer(TMEMBER(_editorMode));
persistMgr->transfer(TMEMBER(_fader));
persistMgr->transfer(TMEMBER(_freezeLevel));
@ -3838,14 +3834,11 @@ bool BaseGame::getSaveSlotDescription(int slot, char *buffer) {
BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
if (!pm) return STATUS_FAILED;
_debugAbsolutePathWarning = false;
if (DID_FAIL(pm->initLoad(filename))) {
_debugAbsolutePathWarning = true;
delete pm;
return STATUS_FAILED;
}
_debugAbsolutePathWarning = true;
strcpy(buffer, pm->_savedDescription);
delete pm;

View File

@ -105,54 +105,21 @@ public:
TTextEncoding _textEncoding;
bool _textRTL;
BaseSprite *_loadingIcon;
int _loadingIconX;
int _loadingIconY;
int _loadingIconPersistent;
virtual bool resetContent();
void DEBUG_DumpClassRegistry();
bool setWaitCursor(const char *filename);
char *_localSaveDir;
bool _saveDirChecked;
int _indicatorProgress;
protected:
bool _indicatorDisplay;
uint32 _indicatorColor;
int _indicatorX;
int _indicatorY;
int _indicatorWidth;
int _indicatorHeight;
int _indicatorProgress; // TODO: Hide
bool _richSavedGames;
char *_savedGameExt;
char *_loadImageName;
char *_saveImageName;
int _saveImageX;
int _saveImageY;
int _loadImageX;
int _loadImageY;
BaseSurface *_saveLoadImage;
bool displayIndicator();
bool _reportTextureFormat;
public:
int _thumbnailWidth;
int _thumbnailHeight;
void setEngineLogCallback(ENGINE_LOG_CALLBACK callback = NULL, void *data = NULL);
ENGINE_LOG_CALLBACK _engineLogCallback;
void *_engineLogCallbackData;
bool _editorMode;
bool _doNotExpandStrings;
void getOffset(int *offsetX, int *offsetY);
void setOffset(int offsetX, int offsetY);
int getSequence();
int _offsetY;
int _offsetX;
float _offsetPercentX;
@ -181,20 +148,16 @@ public:
BaseSurfaceStorage *_surfaceStorage;
BaseFontStorage *_fontStorage;
BaseGame();
virtual ~BaseGame();
void DEBUG_DebugDisable();
void DEBUG_DebugEnable(const char *filename = NULL);
bool _debugDebugMode;
bool _debugAbsolutePathWarning;
void *_debugLogFile;
int _sequence;
virtual bool loadFile(const char *filename);
virtual bool loadBuffer(byte *buffer, bool complete = true);
BaseArray<BaseQuickMsg *, BaseQuickMsg *> _quickMessages;
BaseArray<UIWindow *, UIWindow *> _windows;
BaseArray<BaseViewport *, BaseViewport *> _viewportStack;
int _viewportSP;
@ -203,22 +166,8 @@ public:
int _settingsResHeight;
char *_settingsGameFile;
bool _suppressScriptErrors;
bool _mouseLeftDown;
protected:
bool _mouseRightDown;
bool _mouseMidlleDown;
bool _settingsRequireAcceleration;
bool _settingsAllowWindowed;
bool _settingsAllowAdvanced;
bool _settingsAllowAccessTab;
bool _settingsAllowAboutTab;
bool _settingsRequireSound;
bool _settingsAllowDesktopRes;
int _settingsTLMode;
BaseFader *_fader;
virtual bool invalidateDeviceObjects();
virtual bool restoreDeviceObjects();
public:
bool _mouseLeftDown; // TODO: Hide
virtual bool ExternalCall(ScScript *script, ScStack *stack, ScStack *thisStack, char *name);
// scripting interface
virtual ScValue *scGetProperty(const char *name);
@ -228,68 +177,33 @@ public:
// compatibility bits
bool _compatKillMethodThreads;
private:
// FPS stuff
uint32 _lastTime;
uint32 _fpsTime;
uint32 _framesRendered;
Common::String _gameId;
public:
const char* getGameId() { return _gameId.c_str(); }
void setGameId(const Common::String& gameId) { _gameId = gameId; }
uint32 _surfaceGCCycleTime;
bool _smartCache;
bool _videoSubtitles;
bool _subtitles;
uint32 _musicStartTime[NUM_MUSIC_CHANNELS];
bool _compressedSavegames;
bool _smartCache; // RO
bool _subtitles; // RO
int _scheduledLoadSlot;
bool _loading;
bool _personalizedSave;
bool emptySaveSlot(int slot);
bool isSaveSlotUsed(int slot);
bool getSaveSlotDescription(int slot, char *buffer);
bool getSaveSlotFilename(int slot, char *buffer);
void setWindowTitle();
virtual bool handleMouseWheel(int delta);
bool _quitting;
virtual bool getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor);
virtual bool handleKeypress(Common::Event *event, bool printable = false);
virtual void handleKeyRelease(Common::Event *event);
protected:
int _freezeLevel;
public:
bool unfreeze();
bool freeze(bool includingMusic = true);
bool focusWindow(UIWindow *window);
VideoPlayer *_videoPlayer;
VideoTheoraPlayer *_theoraPlayer;
bool _loadInProgress;
UIWindow *_focusedWindow;
bool _editorForceScripts;
protected:
static void afterLoadRegion(void *region, void *data);
static void afterLoadSubFrame(void *subframe, void *data);
static void afterLoadSound(void *sound, void *data);
static void afterLoadFont(void *font, void *data);
static void afterLoadScript(void *script, void *data);
public:
static void invalidateValues(void *value, void *data);
bool loadSettings(const char *filename);
bool resumeMusic(int channel);
bool setMusicStartTime(int channel, uint32 time);
bool pauseMusic(int channel);
bool stopMusic(int channel);
bool playMusic(int channel, const char *filename, bool looping = true, uint32 loopStart = 0);
BaseSound *_music[NUM_MUSIC_CHANNELS];
bool _musicCrossfadeRunning;
bool _musicCrossfadeSwap;
uint32 _musicCrossfadeStartTime;
uint32 _musicCrossfadeLength;
int _musicCrossfadeChannel1;
int _musicCrossfadeChannel2;
bool displayWindows(bool inGame = false);
BaseRegistry *_registry;
bool _useD3D;
@ -298,10 +212,9 @@ public:
virtual bool loadGame(const char *filename);
virtual bool saveGame(int slot, const char *desc, bool quickSave = false);
virtual bool showCursor();
BaseSprite *_cursorNoninteractive;
BaseObject *_activeObject;
BaseKeyboardState *_keyboardState;
bool _interactive;
TGameState _state;
TGameState _origState;
@ -322,14 +235,7 @@ public:
void quickMessage(const char *text);
void quickMessageForm(char *fmt, ...);
bool displayQuickMsg();
uint32 _fps;
bool updateMusicCrossfade();
bool isVideoPlaying();
bool stopVideo();
BaseArray<BaseObject *, BaseObject *> _regObjects;
public:
virtual bool displayContent(bool update = true, bool displayAll = false);
virtual bool displayContentSimple();
bool _forceNonStreamedSounds;
@ -350,13 +256,114 @@ public:
BaseSaveThumbHelper *_cachedThumbnail;
AnsiString getDataDir();
void addMem(int bytes);
bool _touchInterface;
bool _constrainedMemory;
AnsiString getDeviceType() const;
protected:
BaseSprite *_loadingIcon;
int _loadingIconX;
int _loadingIconY;
int _loadingIconPersistent;
BaseFader *_fader;
bool _indicatorDisplay;
bool displayIndicator();
int _freezeLevel;
VideoPlayer *_videoPlayer;
VideoTheoraPlayer *_theoraPlayer;
static void afterLoadRegion(void *region, void *data);
private:
static void afterLoadSubFrame(void *subframe, void *data);
static void afterLoadSound(void *sound, void *data);
static void afterLoadFont(void *font, void *data);
static void afterLoadScript(void *script, void *data);
bool _mouseRightDown;
bool _mouseMidlleDown;
bool _settingsRequireAcceleration;
bool _settingsAllowWindowed;
bool _settingsAllowAdvanced;
bool _settingsAllowAccessTab;
bool _settingsAllowAboutTab;
bool _settingsRequireSound;
bool _settingsAllowDesktopRes;
int _settingsTLMode;
virtual bool invalidateDeviceObjects();
virtual bool restoreDeviceObjects();
uint32 _indicatorColor;
int _indicatorX;
int _indicatorY;
int _indicatorWidth;
int _indicatorHeight;
char *_localSaveDir;
bool _saveDirChecked;
bool _richSavedGames;
char *_savedGameExt;
char *_loadImageName;
char *_saveImageName;
int _saveImageX;
int _saveImageY;
int _loadImageX;
int _loadImageY;
BaseSurface *_saveLoadImage;
bool _reportTextureFormat;
// FPS stuff
uint32 _lastTime;
uint32 _fpsTime;
uint32 _framesRendered;
Common::String _gameId;
void setEngineLogCallback(ENGINE_LOG_CALLBACK callback = NULL, void *data = NULL);
ENGINE_LOG_CALLBACK _engineLogCallback;
void *_engineLogCallbackData;
bool _videoSubtitles;
uint32 _musicStartTime[NUM_MUSIC_CHANNELS];
bool _compressedSavegames;
bool _personalizedSave;
bool emptySaveSlot(int slot);
bool isSaveSlotUsed(int slot);
bool getSaveSlotDescription(int slot, char *buffer);
bool getSaveSlotFilename(int slot, char *buffer);
void setWindowTitle();
bool resumeMusic(int channel);
bool setMusicStartTime(int channel, uint32 time);
bool pauseMusic(int channel);
bool stopMusic(int channel);
bool playMusic(int channel, const char *filename, bool looping = true, uint32 loopStart = 0);
BaseSound *_music[NUM_MUSIC_CHANNELS];
bool _musicCrossfadeRunning;
bool _musicCrossfadeSwap;
uint32 _musicCrossfadeStartTime;
uint32 _musicCrossfadeLength;
int _musicCrossfadeChannel1;
int _musicCrossfadeChannel2;
BaseSprite *_cursorNoninteractive;
BaseKeyboardState *_keyboardState;
uint32 _fps;
bool updateMusicCrossfade();
bool isVideoPlaying();
bool stopVideo();
BaseDebugger *_debugMgr;
BaseArray<BaseQuickMsg *, BaseQuickMsg *> _quickMessages;
BaseArray<UIWindow *, UIWindow *> _windows;
BaseArray<BaseViewport *, BaseViewport *> _viewportStack;
BaseArray<BaseObject *, BaseObject *> _regObjects;
AnsiString getDeviceType() const;
struct LastClickInfo {
LastClickInfo() {

View File

@ -44,27 +44,9 @@ class ScValue;
class ScStack;
class ScScript;
class BaseObject : public BaseScriptHolder {
public:
TSpriteBlendMode _blendMode;
virtual bool afterMove();
float _relativeRotate;
bool _rotateValid;
float _rotate;
void setSoundEvent(const char *eventName);
bool _rotatable;
uint32 _alphaColor;
float _scale;
float _scaleX;
float _scaleY;
float _relativeScale;
virtual bool isReady();
virtual bool getExtendedFlag(const char *flagName);
virtual bool resetSoundPan();
virtual bool updateSounds();
bool updateOneSound(BaseSound *sound);
protected:
bool _autoSoundPanning;
uint32 _sFXStart;
int _sFXVolume;
bool setSFXTime(uint32 time);
bool setSFXVolume(int volume);
bool resumeSFX();
@ -72,12 +54,37 @@ public:
bool stopSFX(bool deleteSound = true);
bool playSFX(const char *filename, bool looping = false, bool playNow = true, const char *eventName = NULL, uint32 loopStart = 0);
BaseSound *_sFX;
TSFXType _sFXType;
float _sFXParam1;
float _sFXParam2;
float _sFXParam3;
float _sFXParam4;
float _relativeRotate;
bool _rotateValid;
float _rotate;
void setSoundEvent(const char *eventName);
bool _rotatable;
float _scaleX;
float _scaleY;
float _relativeScale;
bool _editorSelected;
bool _editorAlwaysRegister;
bool _ready;
Rect32 _rect;
bool _rectSet;
int _iD;
char *_soundEvent;
public:
TSpriteBlendMode _blendMode;
virtual bool afterMove();
float _scale;
uint32 _alphaColor;
virtual bool isReady();
virtual bool getExtendedFlag(const char *flagName);
virtual bool resetSoundPan();
virtual bool updateSounds();
bool updateOneSound(BaseSound *sound);
int _sFXVolume;
virtual bool handleMouseWheel(int delta);
virtual bool handleMouse(TMouseEvent event, TMouseButton button);
@ -88,10 +95,10 @@ public:
bool cleanup();
const char *getCaption(int caseVal = 1);
void setCaption(const char *caption, int caseVal = 1);
bool _editorSelected;
bool _editorAlwaysRegister;
bool _editorOnly;
bool _is3D;
DECLARE_PERSISTENT(BaseObject, BaseScriptHolder)
virtual bool showCursor();
BaseSprite *_cursor;
@ -99,22 +106,18 @@ public:
BaseSprite *_activeCursor;
virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent);
virtual bool listen(BaseScriptHolder *param1, uint32 param2);
bool _ready;
bool _registrable;
bool _movable;
bool _zoomable;
bool _shadowable;
Rect32 _rect;
bool _rectSet;
int _iD;
bool _movable;
BaseObject(BaseGame *inGame);
virtual ~BaseObject();
char *_caption[7];
char *_soundEvent;
int _posY;
int _posX;
bool _registrable;
char *_caption[7];
bool _saveState;
BaseObject(BaseGame *inGame);
virtual ~BaseObject();
// base
virtual bool update() {
return STATUS_FAILED;

View File

@ -309,7 +309,7 @@ bool BasePersistenceManager::readHeader(const Common::String &filename) {
}
//////////////////////////////////////////////////////////////////////////
bool BasePersistenceManager::initLoad(const char *filename) {
bool BasePersistenceManager::initLoad(const Common::String &filename) {
if (DID_FAIL(readHeader(filename))) {
cleanup();
return STATUS_FAILED;

View File

@ -62,7 +62,7 @@ public:
void deleteSaveSlot(int slot);
uint32 getMaxUsedSlot();
bool getSaveExists(int slot);
bool initLoad(const char *filename);
bool initLoad(const Common::String &filename);
bool initSave(const char *desc);
bool getBytes(byte *buffer, uint32 size);
bool putBytes(byte *buffer, uint32 size);

View File

@ -42,6 +42,7 @@ public:
bool storeThumbnail(bool doFlip = false);
BaseImage *_thumbnail;
private:
BaseImage *_richThumbnail;
};

View File

@ -102,9 +102,7 @@ char *BaseStringTable::getKey(const char *str) {
}
//////////////////////////////////////////////////////////////////////////
void BaseStringTable::expand(char **str, bool forceExpand) {
if (_gameRef->_doNotExpandStrings && !forceExpand) return;
void BaseStringTable::expand(char **str) {
if (str == NULL || *str == NULL || *str[0] != '/') return;
char *value = strchr(*str + 1, '/');
@ -132,14 +130,12 @@ void BaseStringTable::expand(char **str, bool forceExpand) {
delete [] *str;
*str = new_str;
if (strlen(*str) > 0 && *str[0] == '/') expand(str, forceExpand);
if (strlen(*str) > 0 && *str[0] == '/') expand(str);
}
//////////////////////////////////////////////////////////////////////////
const char *BaseStringTable::expandStatic(const char *string, bool forceExpand) {
if (_gameRef->_doNotExpandStrings && !forceExpand) return string;
const char *BaseStringTable::expandStatic(const char *string) {
if (string == NULL || string[0] == '\0' || string[0] != '/') return string;
const char *value = strchr(string + 1, '/');
@ -163,7 +159,7 @@ const char *BaseStringTable::expandStatic(const char *string, bool forceExpand)
delete [] key;
if (strlen(new_str) > 0 && new_str[0] == '/') return expandStatic(new_str, forceExpand);
if (strlen(new_str) > 0 && new_str[0] == '/') return expandStatic(new_str);
else return new_str;
}

View File

@ -37,9 +37,9 @@ namespace WinterMute {
class BaseStringTable : public BaseClass {
public:
const char *expandStatic(const char *string, bool forceExpand = false);
const char *expandStatic(const char *string);
bool loadFile(const char *filename, bool deleteAll = true);
void expand(char **str, bool forceExpand = false);
void expand(char **str);
bool addString(const char *key, const char *val, bool reportDuplicities = true);
BaseStringTable(BaseGame *inGame);
virtual ~BaseStringTable();

View File

@ -68,18 +68,14 @@ bool BaseSaveThumbFile::open(const Common::String &filename) {
int slot = atoi(tempFilename);
delete [] tempFilename;
char slotFilename[MAX_PATH_LENGTH + 1];
_gameRef->getSaveSlotFilename(slot, slotFilename);
BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
Common::String slotFilename = pm->getFilenameForSlot(slot);
if (!pm) return STATUS_FAILED;
_gameRef->_debugAbsolutePathWarning = false;
if (DID_FAIL(pm->initLoad(slotFilename))) {
_gameRef->_debugAbsolutePathWarning = true;
delete pm;
return STATUS_FAILED;
}
_gameRef->_debugAbsolutePathWarning = true;
bool res;

View File

@ -47,7 +47,7 @@ public:
BaseFontBitmap(BaseGame *inGame);
virtual ~BaseFontBitmap();
private:
bool getWidths();
BaseSprite *_sprite;
int _widthsFrame;
@ -59,7 +59,6 @@ public:
BaseSubFrame *_subframe;
bool _wholeCell;
private:
int getCharWidth(byte index);
void drawChar(byte c, int x, int y);

View File

@ -104,21 +104,23 @@ public:
return STATUS_OK;
};
bool pointInViewport(Point32 *P);
uint32 _forceAlphaColor;
uint32 _window;
uint32 _clipperWindow;
bool _active;
bool _ready;
bool _windowed;
int _bPP;
int _height;
int _width;
uint32 _window;
uint32 _forceAlphaColor;
void addRectToList(BaseActiveRect *rect);
protected:
uint32 _clipperWindow;
Rect32 _windowRect;
Rect32 _viewportRect;
Rect32 _screenRect;
Rect32 _monitorRect;
int _bPP;
int _height;
int _width;
void addRectToList(BaseActiveRect *rect);
private:
Common::Array<BaseActiveRect *> _rectList;
};

View File

@ -39,15 +39,9 @@ class BaseSurface: public BaseClass {
public:
virtual bool invalidate();
virtual bool prepareToDraw();
bool _ckDefault;
byte _ckRed;
byte _ckGreen;
byte _ckBlue;
uint32 _lastUsedTime;
bool _valid;
int _lifeTime;
bool _keepLoaded;
bool _pixelOpReady;
BaseSurface(BaseGame *inGame);
@ -88,6 +82,12 @@ public:
//void SetWidth(int Width){ _width = Width; }
//void SetHeight(int Height){ _height = Height; }
protected:
bool _ckDefault;
byte _ckRed;
byte _ckGreen;
byte _ckBlue;
bool _keepLoaded;
Common::String _filename;
int _height;
int _width;

View File

@ -43,63 +43,8 @@ public:
PartEmitter(BaseGame *inGame, BaseScriptHolder *Owner);
virtual ~PartEmitter(void);
int _width;
int _height;
int _angle1;
int _angle2;
float _rotation1;
float _rotation2;
float _angVelocity1;
float _angVelocity2;
float _growthRate1;
float _growthRate2;
bool _exponentialGrowth;
float _velocity1;
float _velocity2;
bool _velocityZBased;
float _scale1;
float _scale2;
bool _scaleZBased;
int _maxParticles;
int _lifeTime1;
int _lifeTime2;
bool _lifeTimeZBased;
int _genInterval;
int _genAmount;
bool _running;
int _overheadTime;
int _maxBatches;
int _batchesGenerated;
Rect32 _border;
int _borderThicknessLeft;
int _borderThicknessRight;
int _borderThicknessTop;
int _borderThicknessBottom;
int _fadeInTime;
int _fadeOutTime;
int _alpha1;
int _alpha2;
bool _alphaTimeBased;
bool _useRegion;
char *_emitEvent;
BaseScriptHolder *_owner;
bool start();
bool update();
@ -125,6 +70,62 @@ public:
private:
int _width;
int _height;
int _angle1;
int _angle2;
float _rotation1;
float _rotation2;
float _angVelocity1;
float _angVelocity2;
float _growthRate1;
float _growthRate2;
bool _exponentialGrowth;
float _velocity1;
float _velocity2;
bool _velocityZBased;
float _scale1;
float _scale2;
bool _scaleZBased;
int _maxParticles;
int _lifeTime1;
int _lifeTime2;
bool _lifeTimeZBased;
int _genInterval;
int _genAmount;
bool _running;
int _overheadTime;
int _maxBatches;
int _batchesGenerated;
Rect32 _border;
int _borderThicknessLeft;
int _borderThicknessRight;
int _borderThicknessTop;
int _borderThicknessBottom;
int _fadeInTime;
int _alpha1;
int _alpha2;
bool _alphaTimeBased;
bool _useRegion;
char *_emitEvent;
BaseScriptHolder *_owner;
PartForce *addForceByName(const char *name);
int static compareZ(const void *obj1, const void *obj2);
bool initParticle(PartParticle *particle, uint32 currentTime, uint32 timerDelta);

View File

@ -55,9 +55,10 @@ public:
bool copyParameters(ScStack *stack);
void afterLoad();
private:
ScValue *_operand;
ScValue *_reg1;
public:
bool _freezable;
bool resume();
bool pause();
@ -145,6 +146,13 @@ public:
ScScript(BaseGame *inGame, ScEngine *Engine);
virtual ~ScScript();
char *_filename;
bool _thread;
bool _methodThread;
char *_threadEvent;
BaseScriptHolder *_owner;
ScScript::TExternalFunction *getExternal(char *name);
bool externalCall(ScStack *stack, ScStack *thisStack, ScScript::TExternalFunction *function);
private:
char **_symbols;
uint32 _numSymbols;
TFunctionPos *_functions;
@ -155,13 +163,7 @@ public:
uint32 _numFunctions;
uint32 _numMethods;
uint32 _numEvents;
bool _thread;
bool _methodThread;
char *_threadEvent;
BaseScriptHolder *_owner;
ScScript::TExternalFunction *getExternal(char *name);
bool externalCall(ScStack *stack, ScStack *thisStack, ScScript::TExternalFunction *function);
private:
bool initScript();
bool initTables();

View File

@ -45,6 +45,7 @@ public:
bool scSetProperty(const char *name, ScValue *value);
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
private:
int _length;
ScValue *_values;
};

View File

@ -44,9 +44,9 @@ public:
bool scSetProperty(const char *name, ScValue *value);
bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
private:
char *_string;
TimeDate _tm;
private:
Common::String _strRep;
};

View File

@ -46,8 +46,9 @@ public:
SXMemBuffer(BaseGame *inGame, void *buffer);
virtual ~SXMemBuffer();
virtual void *scToMemBuffer();
int _size;
private:
int _size;
bool resize(int newSize);
void *_buffer;
void cleanup();

View File

@ -39,7 +39,6 @@ public:
DECLARE_PERSISTENT(SXObject, BaseObject)
SXObject(BaseGame *inGame, ScStack *Stack);
virtual ~SXObject();
};
} // end of namespace WinterMute

View File

@ -88,7 +88,7 @@ public:
ScValue *getProp(const char *name);
BaseScriptable *_valNative;
ScValue *_valRef;
protected:
private:
bool _valBool;
int _valInt;
double _valFloat;

View File

@ -48,7 +48,6 @@ public:
BaseSoundBuffer(BaseGame *inGame);
virtual ~BaseSoundBuffer();
bool pause();
bool play(bool looping = false, uint32 startSample = 0);
bool resume();
@ -86,12 +85,12 @@ public:
uint32 _loopStart;
Audio::Mixer::SoundType _type;
bool _looping;
Common::SeekableReadStream *_file;
char *_filename;
bool _streamed;
int _privateVolume;
private:
char *_filename;
bool _streamed;
Common::SeekableReadStream *_file;
int _volume;
};

View File

@ -255,7 +255,7 @@ int WinterMuteEngine::init() {
_game = NULL;
return false;
}
_game->setWindowTitle();
//_game->setWindowTitle();
_game->_renderer->_ready = true;
_game->_miniUpdateEnabled = true;