Permalink
Comparing changes
Open a pull request
- 16 commits
- 19 files changed
- 0 commit comments
- 2 contributors
Commits on Mar 22, 2017
Unified
Split
Showing
with
175 additions
and 225 deletions.
- +7 −7 engines/fullpipe/behavior.cpp
- +3 −7 engines/fullpipe/fullpipe.cpp
- +8 −8 engines/fullpipe/fullpipe.h
- +17 −30 engines/fullpipe/gfx.cpp
- +6 −7 engines/fullpipe/gfx.h
- +1 −4 engines/fullpipe/interaction.cpp
- +1 −1 engines/fullpipe/interaction.h
- +3 −4 engines/fullpipe/motion.cpp
- +1 −1 engines/fullpipe/motion.h
- +6 −6 engines/fullpipe/objects.h
- +17 −34 engines/fullpipe/scene.cpp
- +5 −5 engines/fullpipe/scene.h
- +17 −15 engines/fullpipe/sound.cpp
- +2 −2 engines/fullpipe/sound.h
- +16 −23 engines/fullpipe/stateloader.cpp
- +24 −28 engines/fullpipe/statics.cpp
- +3 −3 engines/fullpipe/statics.h
- +31 −33 engines/fullpipe/utils.cpp
- +7 −7 engines/fullpipe/utils.h
| @@ -49,7 +49,7 @@ void BehaviorManager::clear() { | ||
| } | ||
|
|
||
| void BehaviorManager::initBehavior(Scene *sc, GameVar *var) { | ||
| debugC(2, kDebugBehavior, "BehaviorManager::initBehavior(%d, %s)", sc->_sceneId, transCyrillic((byte *)var->_varName)); | ||
| debugC(2, kDebugBehavior, "BehaviorManager::initBehavior(%d, %s)", sc->_sceneId, transCyrillic(var->_varName)); | ||
|
|
||
| clear(); | ||
| _scene = sc; | ||
| @@ -63,8 +63,8 @@ void BehaviorManager::initBehavior(Scene *sc, GameVar *var) { | ||
| debugC(3, kDebugBehavior, "BehaviorManager::initBehavior. have Variable"); | ||
|
|
||
| for (GameVar *subvar = behvar->_subVars; subvar; subvar = subvar->_nextVarObj) { | ||
| debugC(3, kDebugBehavior, "BehaviorManager::initBehavior. subVar %s", transCyrillic((byte *)subvar->_varName)); | ||
| if (!strcmp(subvar->_varName, "AMBIENT")) { | ||
| debugC(3, kDebugBehavior, "BehaviorManager::initBehavior. subVar %s", transCyrillic(subvar->_varName)); | ||
| if (subvar->_varName == "AMBIENT") { | ||
| behinfo = new BehaviorInfo; | ||
| behinfo->initAmbientBehavior(subvar, sc); | ||
|
|
||
| @@ -151,7 +151,7 @@ void BehaviorManager::updateBehavior(BehaviorInfo *behaviorInfo, BehaviorAnim *e | ||
| } | ||
|
|
||
| void BehaviorManager::updateStaticAniBehavior(StaticANIObject *ani, int delay, BehaviorAnim *bhe) { | ||
| debugC(6, kDebugBehavior, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic((byte *)ani->_objectName)); | ||
| debugC(6, kDebugBehavior, "BehaviorManager::updateStaticAniBehavior(%s)", transCyrillic(ani->_objectName)); | ||
|
|
||
| MessageQueue *mq = 0; | ||
|
|
||
| @@ -243,7 +243,7 @@ void BehaviorInfo::clear() { | ||
| } | ||
|
|
||
| void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) { | ||
| debugC(4, kDebugBehavior, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic((byte *)var->_varName)); | ||
| debugC(4, kDebugBehavior, "BehaviorInfo::initAmbientBehavior(%s)", transCyrillic(var->_varName)); | ||
|
|
||
| clear(); | ||
| _animsCount = 1; | ||
| @@ -267,8 +267,8 @@ void BehaviorInfo::initAmbientBehavior(GameVar *var, Scene *sc) { | ||
| } | ||
|
|
||
| void BehaviorInfo::initObjectBehavior(GameVar *var, Scene *sc, StaticANIObject *ani) { | ||
| Common::String s((char *)transCyrillic((byte *)var->_varName)); | ||
| debugC(4, kDebugBehavior, "BehaviorInfo::initObjectBehavior(%s, %d, %s)", s.c_str(), sc->_sceneId, transCyrillic((byte *)ani->_objectName)); | ||
| Common::String s((char *)transCyrillic(var->_varName)); | ||
| debugC(4, kDebugBehavior, "BehaviorInfo::initObjectBehavior(%s, %d, %s)", s.c_str(), sc->_sceneId, transCyrillic(ani->_objectName)); | ||
|
|
||
| clear(); | ||
|
|
||
| @@ -131,10 +131,6 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc) | ||
|
|
||
| _stream2playing = false; | ||
|
|
||
| memset(_sceneTracks, 0, sizeof(_sceneTracks)); | ||
| memset(_trackName, 0, sizeof(_trackName)); | ||
| memset(_sceneTracksCurrentTrack, 0, sizeof(_sceneTracksCurrentTrack)); | ||
|
|
||
| _numSceneTracks = 0; | ||
| _sceneTrackHasSequence = false; | ||
| _sceneTrackIsPlaying = false; | ||
| @@ -552,7 +548,7 @@ void FullpipeEngine::updateScreen() { | ||
| ++_updateTicks; | ||
| } | ||
|
|
||
| int FullpipeEngine::getObjectEnumState(const char *name, const char *state) { | ||
| int FullpipeEngine::getObjectEnumState(Common::String name, const char *state) { | ||
| GameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); | ||
|
|
||
| if (!var) { | ||
| @@ -569,7 +565,7 @@ int FullpipeEngine::getObjectEnumState(const char *name, const char *state) { | ||
| return 0; | ||
| } | ||
|
|
||
| int FullpipeEngine::getObjectState(const char *objname) { | ||
| int FullpipeEngine::getObjectState(Common::String objname) { | ||
| GameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); | ||
|
|
||
| if (var) | ||
| @@ -578,7 +574,7 @@ int FullpipeEngine::getObjectState(const char *objname) { | ||
| return 0; | ||
| } | ||
|
|
||
| void FullpipeEngine::setObjectState(const char *name, int state) { | ||
| void FullpipeEngine::setObjectState(Common::String name, int state) { | ||
| GameVar *var = _gameLoader->_gameVar->getSubVarByName("OBJSTATES"); | ||
|
|
||
| if (!var) { | ||
| @@ -165,15 +165,15 @@ class FullpipeEngine : public ::Engine { | ||
| int _currSoundListCount; | ||
| bool _soundEnabled; | ||
| bool _flgSoundList; | ||
| char _sceneTracks[10][260]; | ||
| Common::String _sceneTracks[10]; | ||
| int _numSceneTracks; | ||
| bool _sceneTrackHasSequence; | ||
| int _musicMinDelay; | ||
| int _musicMaxDelay; | ||
| int _musicLocal; | ||
| char _trackName[2600]; | ||
| Common::String _trackName; | ||
| int _trackStartDelay; | ||
| char _sceneTracksCurrentTrack[260]; | ||
| Common::String _sceneTracksCurrentTrack; | ||
| bool _sceneTrackIsPlaying; | ||
|
|
||
| void stopAllSounds(); | ||
| @@ -183,8 +183,8 @@ class FullpipeEngine : public ::Engine { | ||
| int getSceneTrack(); | ||
| void updateTrackDelay(); | ||
| void startSceneTrack(); | ||
| void startSoundStream1(const char *trackName); | ||
| void playOggSound(const char *trackName, Audio::SoundHandle *stream); | ||
| void startSoundStream1(Common::String trackName); | ||
| void playOggSound(Common::String trackName, Audio::SoundHandle *stream); | ||
| void stopSoundStream2(); | ||
| void stopAllSoundStreams(); | ||
| void stopAllSoundInstances(int id); | ||
| @@ -272,9 +272,9 @@ class FullpipeEngine : public ::Engine { | ||
| void setCursor(int id); | ||
| void updateCursorCommon(); | ||
|
|
||
| int getObjectState(const char *objname); | ||
| void setObjectState(const char *name, int state); | ||
| int getObjectEnumState(const char *name, const char *state); | ||
| int getObjectState(Common::String objname); | ||
| void setObjectState(Common::String name, int state); | ||
| int getObjectEnumState(Common::String name, const char *state); | ||
|
|
||
| void sceneAutoScrolling(); | ||
| bool sceneSwitcher(EntranceInfo *entrance); | ||
| @@ -41,7 +41,6 @@ Background::Background() { | ||
| _bigPictureArray1Count = 0; | ||
| _bigPictureArray2Count = 0; | ||
| _bigPictureArray = 0; | ||
| _bgname = 0; | ||
| _palette = 0; | ||
| } | ||
|
|
||
| @@ -260,16 +259,14 @@ GameObject::GameObject() { | ||
| _priority = 0; | ||
| _field_20 = 0; | ||
| _field_8 = 0; | ||
| _objectName = 0; | ||
| } | ||
|
|
||
| GameObject::GameObject(GameObject *src) { | ||
| _odelay = 1; | ||
| _flags = 0; | ||
| _id = src->_id; | ||
|
|
||
| _objectName = (char *)calloc(strlen(src->_objectName) + 1, 1); | ||
| strncpy(_objectName, src->_objectName, strlen(src->_objectName)); | ||
| _objectName = src->_objectName; | ||
|
|
||
| _ox = src->_ox; | ||
| _oy = src->_oy; | ||
| @@ -279,7 +276,6 @@ GameObject::GameObject(GameObject *src) { | ||
| } | ||
|
|
||
| GameObject::~GameObject() { | ||
| free(_objectName); | ||
| } | ||
|
|
||
| bool GameObject::load(MfcArchive &file) { | ||
| @@ -474,12 +470,12 @@ Picture::~Picture() { | ||
| } | ||
|
|
||
| void Picture::freePicture() { | ||
| debugC(5, kDebugMemory, "Picture::freePicture(): file: %s", _memfilename); | ||
| debugC(5, kDebugMemory, "Picture::freePicture(): file: %s", _memfilename.c_str()); | ||
|
|
||
| if (_bitmap) { | ||
| if (testFlags() && !_field_54) { | ||
| freeData(); | ||
| free(_bitmap); | ||
| delete _bitmap; | ||
| _bitmap = 0; | ||
| } | ||
| } | ||
| @@ -490,7 +486,6 @@ void Picture::freePicture() { | ||
| } | ||
|
|
||
| if (_convertedBitmap) { | ||
| free(_convertedBitmap->_pixels); | ||
| delete _convertedBitmap; | ||
| _convertedBitmap = 0; | ||
| } | ||
| @@ -536,7 +531,7 @@ bool Picture::load(MfcArchive &file) { | ||
|
|
||
| getData(); | ||
|
|
||
| debugC(5, kDebugLoading, "Picture::load: loaded <%s>", _memfilename); | ||
| debugC(5, kDebugLoading, "Picture::load: loaded <%s>", _memfilename.c_str()); | ||
|
|
||
| return true; | ||
| } | ||
| @@ -556,7 +551,7 @@ void Picture::setAOIDs() { | ||
| } | ||
|
|
||
| void Picture::init() { | ||
| debugC(5, kDebugLoading, "Picture::init(), %s", _memfilename); | ||
| debugC(5, kDebugLoading, "Picture::init(), %s", _memfilename.c_str()); | ||
|
|
||
| MemoryObject::getData(); | ||
|
|
||
| @@ -589,19 +584,16 @@ void Picture::getDibInfo() { | ||
| } | ||
|
|
||
| if (!_data) { | ||
| warning("Picture::getDibInfo: data is empty <%s>", _memfilename); | ||
| warning("Picture::getDibInfo: data is empty <%s>", _memfilename.c_str()); | ||
|
|
||
| MemoryObject::load(); | ||
| } | ||
|
|
||
| Common::MemoryReadStream *s = new Common::MemoryReadStream(_data + off - 32, 32); | ||
|
|
||
| _bitmap->load(s); | ||
| _bitmap->_pixels = _data; | ||
|
|
||
| _bitmap->decode((int32 *)(_paletteData ? _paletteData : g_fp->_globalPalette)); | ||
| delete s; | ||
|
|
||
| _bitmap->_pixels = 0; | ||
| _bitmap->decode(_data, (int32 *)(_paletteData ? _paletteData : g_fp->_globalPalette)); | ||
| } | ||
|
|
||
| Bitmap *Picture::getPixelData() { | ||
| @@ -615,7 +607,7 @@ void Picture::draw(int x, int y, int style, int angle) { | ||
| int x1 = x; | ||
| int y1 = y; | ||
|
|
||
| debugC(7, kDebugDrawing, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename); | ||
| debugC(7, kDebugDrawing, "Picture::draw(%d, %d, %d, %d) (%s)", x, y, style, angle, _memfilename.c_str()); | ||
|
|
||
| if (x != -1) | ||
| x1 = x; | ||
| @@ -766,7 +758,6 @@ Bitmap::Bitmap() { | ||
| _y = 0; | ||
| _width = 0; | ||
| _height = 0; | ||
| _pixels = 0; | ||
| _type = 0; | ||
| _dataSize = 0; | ||
| _flags = 0; | ||
| @@ -783,20 +774,16 @@ Bitmap::Bitmap(Bitmap *src) { | ||
| _type = src->_type; | ||
| _width = src->_width; | ||
| _height = src->_height; | ||
| _pixels = src->_pixels; | ||
| _surface = new Graphics::TransparentSurface(*src->_surface); | ||
| _copied_surface = true; | ||
| _flipping = src->_flipping; | ||
| } | ||
|
|
||
| Bitmap::~Bitmap() { | ||
|
|
||
| if (!_copied_surface) | ||
| _surface->free(); | ||
| delete _surface; | ||
| _surface = 0; | ||
|
|
||
| _pixels = 0; | ||
| } | ||
|
|
||
| void Bitmap::load(Common::ReadStream *s) { | ||
| @@ -825,15 +812,15 @@ bool Bitmap::isPixelHitAtPos(int x, int y) { | ||
| return ((*((int32 *)_surface->getBasePtr(x - _x, y - _y)) & 0xff) != 0); | ||
| } | ||
|
|
||
| void Bitmap::decode(int32 *palette) { | ||
| void Bitmap::decode(byte *pixels, int32 *palette) { | ||
| _surface = new Graphics::TransparentSurface; | ||
|
|
||
| _surface->create(_width, _height, Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0)); | ||
|
|
||
| if (_type == MKTAG('R', 'B', '\0', '\0')) | ||
| putDibRB(palette); | ||
| putDibRB(pixels, palette); | ||
| else | ||
| putDibCB(palette); | ||
| putDibCB(pixels, palette); | ||
| } | ||
|
|
||
| void Bitmap::putDib(int x, int y, int32 *palette, byte alpha) { | ||
| @@ -865,7 +852,7 @@ void Bitmap::putDib(int x, int y, int32 *palette, byte alpha) { | ||
| g_fp->_system->copyRectToScreen(g_fp->_backgroundSurface->getBasePtr(x1, y1), g_fp->_backgroundSurface->pitch, x1, y1, sub.width(), sub.height()); | ||
| } | ||
|
|
||
| bool Bitmap::putDibRB(int32 *palette) { | ||
| bool Bitmap::putDibRB(byte *pixels, int32 *palette) { | ||
| uint32 *curDestPtr; | ||
| int endy; | ||
| int x; | ||
| @@ -890,7 +877,7 @@ bool Bitmap::putDibRB(int32 *palette) { | ||
|
|
||
| y = endy; | ||
|
|
||
| srcPtr = (uint16 *)_pixels; | ||
| srcPtr = (uint16 *)pixels; | ||
|
|
||
| bool breakup = false; | ||
| for (y = endy; y >= starty && !breakup; y--) { | ||
| @@ -967,7 +954,7 @@ bool Bitmap::putDibRB(int32 *palette) { | ||
| return false; | ||
| } | ||
|
|
||
| void Bitmap::putDibCB(int32 *palette) { | ||
| void Bitmap::putDibCB(byte *pixels, int32 *palette) { | ||
| uint32 *curDestPtr; | ||
| int endx; | ||
| int endy; | ||
| @@ -986,10 +973,10 @@ void Bitmap::putDibCB(int32 *palette) { | ||
| bpp = cb05_format ? 2 : 1; | ||
| pitch = (bpp * _width + 3) & 0xFFFFFFFC; | ||
|
|
||
| byte *srcPtr = &_pixels[pitch * endy]; | ||
| byte *srcPtr = &pixels[pitch * endy]; | ||
|
|
||
| if (endy < _height) | ||
| srcPtr = &_pixels[pitch * (_height - 1)]; | ||
| srcPtr = &pixels[pitch * (_height - 1)]; | ||
|
|
||
| int starty = 0; | ||
| int startx = 0; | ||
| @@ -39,7 +39,6 @@ struct Bitmap { | ||
| int _y; | ||
| int _width; | ||
| int _height; | ||
| byte *_pixels; | ||
| int _type; | ||
| int _dataSize; | ||
| int _flags; | ||
| @@ -52,10 +51,10 @@ struct Bitmap { | ||
| ~Bitmap(); | ||
|
|
||
| void load(Common::ReadStream *s); | ||
| void decode(int32 *palette); | ||
| void decode(byte *pixels, int32 *palette); | ||
| void putDib(int x, int y, int32 *palette, byte alpha); | ||
| bool putDibRB(int32 *palette); | ||
| void putDibCB(int32 *palette); | ||
| bool putDibRB(byte *pixels, int32 *palette); | ||
| void putDibCB(byte *pixels, int32 *palette); | ||
|
|
||
| void colorFill(uint32 *dest, int len, int32 color); | ||
| void paletteFill(uint32 *dest, byte *src, int len, int32 *palette); | ||
| @@ -133,7 +132,7 @@ class GameObject : public CObject { | ||
| int _field_8; | ||
| int16 _flags; | ||
| int16 _id; | ||
| char *_objectName; | ||
| Common::String _objectName; | ||
| int _ox; | ||
| int _oy; | ||
| int _priority; | ||
| @@ -150,7 +149,7 @@ class GameObject : public CObject { | ||
| void renumPictures(Common::Array<PictureObject *> *lst); | ||
| void setFlags(int16 flags) { _flags = flags; } | ||
| void clearFlags() { _flags = 0; } | ||
| const char *getName() { return _objectName; } | ||
| Common::String getName() { return _objectName; } | ||
|
|
||
| bool getPicAniInfo(PicAniInfo *info); | ||
| bool setPicAniInfo(PicAniInfo *info); | ||
| @@ -186,7 +185,7 @@ class Background : public CObject { | ||
| public: | ||
| Common::Array<PictureObject *> _picObjList; | ||
|
|
||
| char *_bgname; | ||
| Common::String _bgname; | ||
| int _x; | ||
| int _y; | ||
| int16 _messageQueueId; | ||
| @@ -128,7 +128,7 @@ bool InteractionController::handleInteraction(StaticANIObject *subj, GameObject | ||
| if (cinter->_messageQueue) | ||
| cinter->_messageQueue->calcDuration(subj); | ||
|
|
||
| debugC(5, kDebugInteractions, "Interaction: %s", transCyrillic((byte *)cinter->_actionName)); | ||
| debugC(5, kDebugInteractions, "Interaction: %s", transCyrillic(cinter->_actionName)); | ||
|
|
||
| PicAniInfo aniInfo; | ||
|
|
||
| @@ -428,7 +428,6 @@ Interaction::Interaction() { | ||
| _staticsId2 = 0; | ||
| _field_28 = 0; | ||
| _sceneId = -1; | ||
| _actionName = 0; | ||
| } | ||
|
|
||
| Interaction::~Interaction() { | ||
| @@ -438,8 +437,6 @@ Interaction::~Interaction() { | ||
| } | ||
|
|
||
| delete _messageQueue; | ||
|
|
||
| free(_actionName); | ||
| } | ||
|
|
||
| bool Interaction::load(MfcArchive &file) { | ||
Oops, something went wrong.