diff options
Diffstat (limited to 'engines/mads/debugger.cpp')
-rw-r--r-- | engines/mads/debugger.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/engines/mads/debugger.cpp b/engines/mads/debugger.cpp index 99251f9fbb..b9731b1d31 100644 --- a/engines/mads/debugger.cpp +++ b/engines/mads/debugger.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -49,6 +49,7 @@ Debugger::Debugger(MADSEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("item", WRAP_METHOD(Debugger, Cmd_Item)); registerCmd("play_anim", WRAP_METHOD(Debugger, Cmd_PlayAnim)); registerCmd("play_text", WRAP_METHOD(Debugger, Cmd_PlayText)); + registerCmd("set_camera", WRAP_METHOD(Debugger, Cmd_SetCamera)); } static int strToInt(const char *s) { @@ -157,7 +158,7 @@ bool Debugger::Cmd_ShowCodes(int argc, const char **argv) { Scene &scene = _vm->_game->_scene; // Copy the depth/walk surface to the background and flag for screen refresh - scene._depthSurface.copyTo(&scene._backgroundSurface); + scene._depthSurface.blitFrom(scene._backgroundSurface); scene._spriteSlots.fullRefresh(); // Draw the locations of scene nodes onto the background @@ -391,4 +392,17 @@ bool Debugger::Cmd_PlayText(int argc, const char **argv) { } } +bool Debugger::Cmd_SetCamera(int argc, const char **argv) { + if (argc != 3) { + debugPrintf("Usage: %s <x> <y>\n", argv[0]); + return true; + } else { + int x = strToInt(argv[1]); + int y = strToInt(argv[2]); + _vm->_game->_scene.setCamera(Common::Point(x, y)); + _vm->_game->_scene.resetScene(); + _vm->_game->_scene.drawElements(kTransitionNone, false); + return false; + } +} } // End of namespace MADS |