Skip to content

Commit

Permalink
PRINCE: initroom from debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
Kamil Zbróg committed Nov 11, 2013
1 parent bd59732 commit 87e2229
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
3 changes: 1 addition & 2 deletions engines/prince/cursor.cpp
Expand Up @@ -44,9 +44,8 @@ bool Cursor::loadFromStream(Common::SeekableReadStream &stream) {
_surface = new Graphics::Surface();
_surface->create(w, h, Graphics::PixelFormat::createFormatCLUT8());

for (int ih = 0; ih < h; ++ih) {
for (int ih = 0; ih < h; ++ih)
stream.read(_surface->getBasePtr(0, ih), w);
}
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions engines/prince/debugger.cpp
Expand Up @@ -146,8 +146,8 @@ bool Debugger::Cmd_ChangeCursor(int argc, const char **argv) {
return true;
}

int flagNum = strToInt(argv[1]);
_vm->changeCursor(flagNum);
_cursorNr = strToInt(argv[1]);

return true;
}

Expand Down
3 changes: 2 additions & 1 deletion engines/prince/debugger.h
Expand Up @@ -35,7 +35,8 @@ class Debugger : public GUI::Debugger {
Debugger(PrinceEngine *vm);
virtual ~Debugger() {} // we need this for __SYMBIAN32__ archaic gcc/UIQ

uint32 _locationNr;
uint8 _locationNr;
uint8 _cursorNr;

private:
bool Cmd_DebugLevel(int argc, const char **argv);
Expand Down
10 changes: 6 additions & 4 deletions engines/prince/prince.cpp
Expand Up @@ -269,8 +269,9 @@ bool PrinceEngine::loadLocation(uint16 locationNr) {
return true;
}

void PrinceEngine::changeCursor(uint16 curId)
{
void PrinceEngine::changeCursor(uint16 curId) {
_debugger->_cursorNr = curId;

Graphics::Surface *curSurface = NULL;

uint16 hotspotX = 0;
Expand Down Expand Up @@ -583,9 +584,10 @@ void PrinceEngine::mainLoop() {
_cameraX = _newCameraX;
++_frameNr;

if (_debugger->_locationNr != _locationNr) {
if (_debugger->_locationNr != _locationNr)
loadLocation(_debugger->_locationNr);
}
if (_debugger->_cursorNr != _cursorNr)
changeCursor(_debugger->_cursorNr);
}
}

Expand Down
1 change: 1 addition & 0 deletions engines/prince/prince.h
Expand Up @@ -133,6 +133,7 @@ class PrinceEngine : public Engine {
void debugEngine(const char *s, ...);

uint16 _locationNr;
uint8 _cursorNr;

Common::RandomSource *_rnd;
Graphics::BitmapDecoder *_roomBmp;
Expand Down

0 comments on commit 87e2229

Please sign in to comment.