diff options
author | richiesams | 2013-07-24 11:36:11 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:32:35 -0500 |
commit | 88934cd5d01c20c4add55c81277923f481674176 (patch) | |
tree | 7f674d2f64753a962a335593035d9a0840cfea2c | |
parent | de2e7fd144622436429da2af79e155724af49d46 (diff) | |
download | scummvm-rg350-88934cd5d01c20c4add55c81277923f481674176.tar.gz scummvm-rg350-88934cd5d01c20c4add55c81277923f481674176.tar.bz2 scummvm-rg350-88934cd5d01c20c4add55c81277923f481674176.zip |
ZVISION: Convert console code to use RenderManager and add method for setRenderState
-rw-r--r-- | engines/zvision/console.cpp | 24 | ||||
-rw-r--r-- | engines/zvision/console.h | 1 |
2 files changed, 24 insertions, 1 deletions
diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp index 2b45ed24b9..687be8f086 100644 --- a/engines/zvision/console.cpp +++ b/engines/zvision/console.cpp @@ -41,6 +41,7 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) { DCmd_Register("loadvideo", WRAP_METHOD(Console, cmdLoadVideo)); DCmd_Register("loadsound", WRAP_METHOD(Console, cmdLoadSound)); DCmd_Register("raw2wav", WRAP_METHOD(Console, cmdRawToWav)); + DCmd_Register("setrenderstate", WRAP_METHOD(Console, cmdSetRenderState)); } bool Console::cmdLoadImage(int argc, const char **argv) { @@ -61,7 +62,7 @@ bool Console::cmdLoadVideo(int argc, const char **argv) { Video::VideoDecoder *videoDecoder = new ZorkAVIDecoder(); if (videoDecoder && videoDecoder->loadFile(argv[1])) { - _engine->startVideo(videoDecoder); + _engine->getRenderManager()->startVideo(videoDecoder); } return true; @@ -92,6 +93,27 @@ bool Console::cmdRawToWav(int argc, const char **argv) { } convertRawToWav(argv[1], _engine, argv[2]); + return true; +} + +bool Console::cmdSetRenderState(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Use setrenderstate <RenderState: panorama, tilt, flat> to change the current render state\n"); + return true; + } + + Common::String renderState(argv[1]); + + if (renderState.matchString("panorama", true)) + _engine->getRenderManager()->setRenderState(RenderTable::PANORAMA); + else if (renderState.matchString("tilt", true)) + _engine->getRenderManager()->setRenderState(RenderTable::TILT); + else if (renderState.matchString("flat", true)) + _engine->getRenderManager()->setRenderState(RenderTable::FLAT); + else + DebugPrintf("Use setrenderstate <RenderState: panorama, tilt, flat> to change the current render state\n"); + + return true; } } // End of namespace ZVision diff --git a/engines/zvision/console.h b/engines/zvision/console.h index 05b8f1247f..e2937030eb 100644 --- a/engines/zvision/console.h +++ b/engines/zvision/console.h @@ -41,6 +41,7 @@ private: bool cmdLoadVideo(int argc, const char **argv); bool cmdLoadSound(int argc, const char **argv); bool cmdRawToWav(int argc, const char **argv); + bool cmdSetRenderState(int argc, const char **argv); }; } // End of namespace ZVision |