aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Brown2002-12-28 04:51:34 +0000
committerJames Brown2002-12-28 04:51:34 +0000
commit92c8e4ef1ee3bb500685e7eceebcf3df29c8520c (patch)
tree7dad3852d2db379e716eda9092597eee22289c9d
parentae5b30df3d67644f341a30997de5192fed8bcbdc (diff)
downloadscummvm-rg350-92c8e4ef1ee3bb500685e7eceebcf3df29c8520c.tar.gz
scummvm-rg350-92c8e4ef1ee3bb500685e7eceebcf3df29c8520c.tar.bz2
scummvm-rg350-92c8e4ef1ee3bb500685e7eceebcf3df29c8520c.zip
Fix NewGui for higher resolutions (eg, CMI)
svn-id: r6216
-rw-r--r--backends/sdl/sdl-common.cpp8
-rw-r--r--backends/sdl/sdl-common.h2
-rw-r--r--gui/console.cpp4
-rw-r--r--gui/console.h2
-rw-r--r--gui/newgui.cpp9
-rw-r--r--scumm/debugger.cpp2
6 files changed, 19 insertions, 8 deletions
diff --git a/backends/sdl/sdl-common.cpp b/backends/sdl/sdl-common.cpp
index 4d9b7f3174..1bc2ec1416 100644
--- a/backends/sdl/sdl-common.cpp
+++ b/backends/sdl/sdl-common.cpp
@@ -1008,6 +1008,14 @@ void OSystem_SDL_Common::clear_overlay()
_forceFull = true;
}
+int16 OSystem_SDL_Common::get_height() {
+ return _screenHeight;
+}
+
+int16 OSystem_SDL_Common::get_width() {
+ return _screenWidth;
+}
+
void OSystem_SDL_Common::grab_overlay(int16 *buf, int pitch)
{
if (!_overlayVisible)
diff --git a/backends/sdl/sdl-common.h b/backends/sdl/sdl-common.h
index 05a7d9e9b0..dc07aeef89 100644
--- a/backends/sdl/sdl-common.h
+++ b/backends/sdl/sdl-common.h
@@ -109,6 +109,8 @@ public:
virtual void clear_overlay();
virtual void grab_overlay(int16 *buf, int pitch);
virtual void copy_rect_overlay(const int16 *buf, int pitch, int x, int y, int w, int h);
+ virtual int16 OSystem_SDL_Common::get_height();
+ virtual int16 OSystem_SDL_Common::get_width();
// Methods that convert RBG to/from colors suitable for the overlay.
virtual int16 RBGToColor(uint8 r, uint8 g, uint8 b);
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;
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp
index 7c50c9a659..c882cc2bea 100644
--- a/scumm/debugger.cpp
+++ b/scumm/debugger.cpp
@@ -128,7 +128,7 @@ void ScummDebugger::enter()
{
#ifdef USE_CONSOLE
if (!_s->_debuggerDialog) {
- _s->_debuggerDialog = new ConsoleDialog(_s->_newgui);
+ _s->_debuggerDialog = new ConsoleDialog(_s->_newgui, _s->_realWidth);
Debug_Printf("Debugger started, type 'exit' to return to the game\n");
}