diff options
author | richiesams | 2013-07-29 15:20:51 -0500 |
---|---|---|
committer | richiesams | 2013-08-04 13:32:46 -0500 |
commit | 0e4e6ee9bf1f3a640191df6b22e6965a7199d171 (patch) | |
tree | 10a4565a7823ec49a9bedcb93ca149f4b6af5caa /engines | |
parent | b9dd61437c88fae024fd2d344b1f75020a5f7eb5 (diff) | |
download | scummvm-rg350-0e4e6ee9bf1f3a640191df6b22e6965a7199d171.tar.gz scummvm-rg350-0e4e6ee9bf1f3a640191df6b22e6965a7199d171.tar.bz2 scummvm-rg350-0e4e6ee9bf1f3a640191df6b22e6965a7199d171.zip |
ZVISION: Create methods for altering panoramaOptions and create console commands for them
Diffstat (limited to 'engines')
-rw-r--r-- | engines/zvision/console.cpp | 14 | ||||
-rw-r--r-- | engines/zvision/console.h | 2 | ||||
-rw-r--r-- | engines/zvision/render_table.cpp | 9 | ||||
-rw-r--r-- | engines/zvision/render_table.h | 3 |
4 files changed, 28 insertions, 0 deletions
diff --git a/engines/zvision/console.cpp b/engines/zvision/console.cpp index e9bbdd74bb..3dad7af376 100644 --- a/engines/zvision/console.cpp +++ b/engines/zvision/console.cpp @@ -43,6 +43,8 @@ Console::Console(ZVision *engine) : GUI::Debugger(), _engine(engine) { DCmd_Register("raw2wav", WRAP_METHOD(Console, cmdRawToWav)); DCmd_Register("setrenderstate", WRAP_METHOD(Console, cmdSetRenderState)); DCmd_Register("generaterendertable", WRAP_METHOD(Console, cmdGenerateRenderTable)); + DCmd_Register("setpanoramafov", WRAP_METHOD(Console, cmdSetPanoramaFoV)); + DCmd_Register("setpanoramascale", WRAP_METHOD(Console, cmdSetPanoramaScale)); } bool Console::cmdLoadImage(int argc, const char **argv) { @@ -127,11 +129,23 @@ bool Console::cmdGenerateRenderTable(int argc, const char **argv) { } bool Console::cmdSetPanoramaFoV(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Use setpanoramafov <fieldOfView> to change the current panorama field of view\n"); + return true; + } + + _engine->getRenderManager()->getRenderTable()->setPanoramaFoV(atof(argv[1])); return true; } bool Console::cmdSetPanoramaScale(int argc, const char **argv) { + if (argc != 2) { + DebugPrintf("Use setpanoramascale <scale> to change the current panorama scale\n"); + return true; + } + + _engine->getRenderManager()->getRenderTable()->setPanoramaScale(atof(argv[1])); return true; } diff --git a/engines/zvision/console.h b/engines/zvision/console.h index 7fa4acc194..7b1beeb304 100644 --- a/engines/zvision/console.h +++ b/engines/zvision/console.h @@ -43,6 +43,8 @@ private: bool cmdRawToWav(int argc, const char **argv); bool cmdSetRenderState(int argc, const char **argv); bool cmdGenerateRenderTable(int argc, const char **argv); + bool cmdSetPanoramaFoV(int argc, const char **argv); + bool cmdSetPanoramaScale(int argc, const char **argv); }; } // End of namespace ZVision diff --git a/engines/zvision/render_table.cpp b/engines/zvision/render_table.cpp index 1ba1648d39..b5a2809444 100644 --- a/engines/zvision/render_table.cpp +++ b/engines/zvision/render_table.cpp @@ -156,7 +156,16 @@ void RenderTable::generatePanoramaLookupTable() { } void RenderTable::generateTiltLookupTable() { +void RenderTable::setPanoramaFoV(float fov) { + assert(fov > 0.0f); + _panoramaOptions.fieldOfView = fov; +} + +void RenderTable::setPanoramaScale(float scale) { + assert(scale > 0.0f); + + _panoramaOptions.linearScale = scale; } } // End of namespace ZVision diff --git a/engines/zvision/render_table.h b/engines/zvision/render_table.h index a48e608db8..5698feaa03 100644 --- a/engines/zvision/render_table.h +++ b/engines/zvision/render_table.h @@ -64,6 +64,9 @@ public: void mutateImage(uint16 *sourceBuffer, uint16* destBuffer, uint32 imageWidth, uint32 imageHeight, Common::Rect subRectangle, Common::Rect destRectangle); void generateRenderTable(); + void setPanoramaFoV(float fov); + void setPanoramaScale(float scale); + private: void generatePanoramaLookupTable(); void generateTiltLookupTable(); |