From 92c8e4ef1ee3bb500685e7eceebcf3df29c8520c Mon Sep 17 00:00:00 2001 From: James Brown Date: Sat, 28 Dec 2002 04:51:34 +0000 Subject: Fix NewGui for higher resolutions (eg, CMI) svn-id: r6216 --- gui/console.cpp | 4 ++-- gui/console.h | 2 +- gui/newgui.cpp | 9 +++++---- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'gui') diff --git a/gui/console.cpp b/gui/console.cpp index 97984fd7c4..ce043f26ce 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -47,8 +47,8 @@ This code is not finished, so please don't complain :-) * - add a scrollbar widget to allow scrolling in the history * - a *lot* of others things, this code is in no way complete and heavily under progress */ -ConsoleDialog::ConsoleDialog(NewGui *gui) - : Dialog(gui, 0, 0, 320, 12*kLineHeight+2) +ConsoleDialog::ConsoleDialog(NewGui *gui, int _realWidth) + : Dialog(gui, 0, 0, _realWidth, 12*kLineHeight+2) { _lineWidth = (_w - kScrollBarWidth - 2) / kCharWidth; _linesPerPage = (_h - 2) / kLineHeight; diff --git a/gui/console.h b/gui/console.h index 322bbc3545..31d2b3c789 100644 --- a/gui/console.h +++ b/gui/console.h @@ -69,7 +69,7 @@ protected: int _historyLine; public: - ConsoleDialog(NewGui *gui); + ConsoleDialog(NewGui *gui, int _realWidth); void open(); void drawDialog(); diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 4f1db088bd..901db4d503 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -213,15 +213,16 @@ void NewGui::runLoop() void NewGui::saveState() { + int sys_height = _system->get_height(); + int sys_width = _system->get_width(); + // Backup old cursor _oldCursorMode = _system->show_mouse(true); _system->show_overlay(); // TODO - add getHeight & getWidth methods to OSystem. - _screen = new int16[320 * 240]; - _screenPitch = 320; -// _screen = new int16[_system->get_width() * _system->get_height()]; -// _screenPitch = _system->get_width(); + _screen = new int16[sys_width * sys_height]; + _screenPitch = sys_width; _system->grab_overlay(_screen, _screenPitch); _currentKeyDown.keycode = 0; -- cgit v1.2.3