diff -u --rec -N --exclude=CVS --exclude=.deps --exclude=*.o scummvm.old/graphics/font.cpp scummvm/graphics/font.cpp
old
|
new
|
|
20 | 20 | |
21 | 21 | #include "common/stdafx.h" |
22 | 22 | #include "graphics/font.h" |
| 23 | #include "gui/newgui.h" |
23 | 24 | |
24 | 25 | namespace Graphics { |
25 | 26 | |
… |
… |
|
38 | 39 | |
39 | 40 | void NewFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color) const { |
40 | 41 | assert(dst != 0); |
| 42 | const int scaleFactorWidth = g_gui.getScaleFactorWidth(), scaleFactorHeight = g_gui.getScaleFactorHeight(); |
| 43 | tx *= scaleFactorWidth; ty *= scaleFactorHeight; |
| 44 | |
41 | 45 | byte *ptr = (byte *)dst->getBasePtr(tx, ty); |
42 | 46 | |
43 | 47 | assert(desc.bits != 0 && desc.maxwidth <= 16); |
… |
… |
|
54 | 58 | chr -= desc.firstchar; |
55 | 59 | const bitmap_t *tmp = desc.bits + (desc.offset ? desc.offset[chr] : (chr * desc.height)); |
56 | 60 | |
57 | | for (int y = 0; y < desc.height; y++, ptr += dst->pitch) { |
58 | | const bitmap_t buffer = *tmp++; |
| 61 | for (int y = 0; y < desc.height * scaleFactorHeight; y++, ptr += dst->pitch) { |
| 62 | const bitmap_t *buffer = 0; |
| 63 | if(scaleFactorHeight != 1) { |
| 64 | if(!(y % 2)) |
| 65 | buffer = tmp++; |
| 66 | else |
| 67 | buffer = tmp; |
| 68 | } else |
| 69 | buffer = tmp++; |
59 | 70 | bitmap_t mask = 0x8000; |
60 | 71 | if (ty + y < 0 || ty + y >= dst->h) |
61 | 72 | continue; |
62 | | |
63 | | for (int x = 0; x < w; x++, mask >>= 1) { |
| 73 | |
| 74 | for (int x = 0; x < w * scaleFactorWidth; x++) { |
| 75 | if(scaleFactorWidth != 1) { |
| 76 | if(!(x % 2) && x != 0) |
| 77 | mask >>= 1; |
| 78 | } else if(x != 0) |
| 79 | mask >>= 1; |
| 80 | |
64 | 81 | if (tx + x < 0 || tx + x >= dst->w) |
65 | 82 | continue; |
66 | | if ((buffer & mask) != 0) { |
| 83 | if ((*buffer & mask) != 0) { |
67 | 84 | if (dst->bytesPerPixel == 1) |
68 | 85 | ptr[x] = color; |
69 | 86 | else if (dst->bytesPerPixel == 2) |
… |
… |
|
91 | 108 | uint i; |
92 | 109 | int width = getStringWidth(s); |
93 | 110 | Common::String str; |
94 | | |
| 111 | |
95 | 112 | if (useEllipsis && width > w) { |
96 | 113 | // String is too wide. So we shorten it "intellegently", by replacing |
97 | 114 | // parts of it by an ellipsis ("..."). There are three possibilities |
… |
… |
|
100 | 117 | // make this configurable, replacing the middle probably is a good |
101 | 118 | // compromise. |
102 | 119 | const int ellipsisWidth = getStringWidth("..."); |
103 | | |
| 120 | |
104 | 121 | // SLOW algorithm to remove enough of the middle. But it is good enough |
105 | 122 | // for now. |
106 | 123 | const int halfWidth = (w - ellipsisWidth) / 2; |
107 | 124 | int w2 = 0; |
108 | | |
| 125 | |
109 | 126 | for (i = 0; i < s.size(); ++i) { |
110 | 127 | int charWidth = getCharWidth(s[i]); |
111 | 128 | if (w2 + charWidth > halfWidth) |
… |
… |
|
116 | 133 | // At this point we know that the first 'i' chars are together 'w2' |
117 | 134 | // pixels wide. We took the first i-1, and add "..." to them. |
118 | 135 | str += "..."; |
119 | | |
| 136 | |
120 | 137 | // The original string is width wide. Of those we already skipped past |
121 | 138 | // w2 pixels, which means (width - w2) remain. |
122 | 139 | // The new str is (w2+ellipsisWidth) wide, so we can accomodate about |
diff -u --rec -N --exclude=CVS --exclude=.deps --exclude=*.o scummvm.old/graphics/scummfont.cpp scummvm/graphics/scummfont.cpp
old
|
new
|
|
20 | 20 | |
21 | 21 | #include "stdafx.h" |
22 | 22 | #include "graphics/font.h" |
| 23 | #include "gui/newgui.h" |
23 | 24 | |
24 | 25 | namespace Graphics { |
25 | 26 | |
… |
… |
|
64 | 65 | //void ScummFont::drawChar(byte chr, int xx, int yy, OverlayColor color) { |
65 | 66 | void ScummFont::drawChar(const Surface *dst, byte chr, int tx, int ty, uint32 color) const { |
66 | 67 | assert(dst != 0); |
| 68 | const int scaleFactorWidth = g_gui.getScaleFactorWidth(), scaleFactorHeight = g_gui.getScaleFactorHeight(); |
| 69 | tx *= scaleFactorWidth; ty *= scaleFactorHeight; |
| 70 | |
67 | 71 | byte *ptr = (byte *)dst->getBasePtr(tx, ty); |
68 | 72 | |
69 | 73 | const byte *tmp = guifont + 6 + guifont[4] + chr * 8; |
70 | 74 | uint buffer = 0; |
71 | 75 | uint mask = 0; |
72 | 76 | |
73 | | for (int y = 0; y < 8; y++) { |
| 77 | for (int y = 0; y < 8 * scaleFactorHeight; y++) { |
74 | 78 | if (ty + y < 0 || ty + y >= dst->h) |
75 | 79 | continue; |
76 | | for (int x = 0; x < 8; x++) { |
| 80 | for (int x = 0; x < 8 * scaleFactorWidth; x++) { |
77 | 81 | if (tx + x < 0 || tx + x >= dst->w) |
78 | 82 | continue; |
79 | 83 | unsigned char c; |
80 | | mask >>= 1; |
| 84 | if(scaleFactorWidth != 1 && !(x % 2)) |
| 85 | mask >>= 1; |
| 86 | else if(scaleFactorWidth == 1) |
| 87 | mask >>= 1; |
| 88 | |
81 | 89 | if (mask == 0) { |
82 | | buffer = *tmp++; |
| 90 | if(scaleFactorHeight != 1 && !(y % 2)) |
| 91 | buffer = *tmp++; |
| 92 | else if(scaleFactorHeight == 1) |
| 93 | buffer = *tmp++; |
| 94 | |
83 | 95 | mask = 0x80; |
84 | 96 | } |
85 | 97 | c = ((buffer & mask) != 0); |
diff -u --rec -N --exclude=CVS --exclude=.deps --exclude=*.o scummvm.old/gui/dialog.cpp scummvm/gui/dialog.cpp
old
|
new
|
|
29 | 29 | |
30 | 30 | /* |
31 | 31 | * TODO list |
32 | | * - add some sense of the window being "active" (i.e. in front) or not. If it |
| 32 | * - add some sense of the window being "active" (i.e. in front) or not. If it |
33 | 33 | * was inactive and just became active, reset certain vars (like who is focused). |
34 | 34 | * Maybe we should just add lostFocus and receivedFocus methods to Dialog, just |
35 | 35 | * like we have for class Widget? |
… |
… |
|
98 | 98 | } |
99 | 99 | |
100 | 100 | void Dialog::drawDialog() { |
101 | | |
| 101 | |
102 | 102 | if (!isVisible()) |
103 | 103 | return; |
104 | 104 | |
… |
… |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | void Dialog::handleMouseDown(int x, int y, int button, int clickCount) { |
| 120 | x /= g_gui.getScaleFactorWidth(); y /= g_gui.getScaleFactorHeight(); |
| 121 | |
120 | 122 | Widget *w; |
| 123 | |
121 | 124 | w = findWidget(x, y); |
122 | | |
| 125 | |
123 | 126 | _dragWidget = w; |
124 | 127 | |
125 | 128 | // If the click occured inside a widget which is not the currently |
… |
… |
|
141 | 144 | } |
142 | 145 | |
143 | 146 | void Dialog::handleMouseUp(int x, int y, int button, int clickCount) { |
| 147 | x /= g_gui.getScaleFactorWidth(); y /= g_gui.getScaleFactorHeight(); |
| 148 | |
144 | 149 | Widget *w; |
145 | 150 | |
146 | 151 | if (_focusedWidget) { |
147 | 152 | //w = _focusedWidget; |
148 | | |
| 153 | |
149 | 154 | // Lose focus on mouseup unless the widget requested to retain the focus |
150 | 155 | if (! (_focusedWidget->getFlags() & WIDGET_RETAIN_FOCUS )) { |
151 | 156 | releaseFocus(); |
… |
… |
|
161 | 166 | } |
162 | 167 | |
163 | 168 | void Dialog::handleMouseWheel(int x, int y, int direction) { |
| 169 | x /= g_gui.getScaleFactorWidth(); y /= g_gui.getScaleFactorHeight(); |
| 170 | |
164 | 171 | Widget *w; |
165 | 172 | |
166 | 173 | // This may look a bit backwards, but I think it makes more sense for |
… |
… |
|
212 | 219 | } |
213 | 220 | |
214 | 221 | void Dialog::handleMouseMoved(int x, int y, int button) { |
| 222 | x /= g_gui.getScaleFactorWidth(); y /= g_gui.getScaleFactorHeight(); |
| 223 | |
215 | 224 | Widget *w; |
216 | | |
| 225 | |
217 | 226 | //if (!button) |
218 | 227 | // _dragWidget = 0; |
219 | | |
| 228 | |
220 | 229 | if (_focusedWidget && !_dragWidget) { |
221 | 230 | w = _focusedWidget; |
222 | 231 | int wx = w->getAbsX() - _x; |
223 | 232 | int wy = w->getAbsY() - _y; |
224 | | |
| 233 | |
225 | 234 | // We still send mouseEntered/Left messages to the focused item |
226 | 235 | // (but to no other items). |
227 | 236 | bool mouseInFocusedWidget = (x >= wx && x < wx + w->_w && y >= wy && y < wy + w->_h); |
… |
… |
|
237 | 246 | |
238 | 247 | w->handleMouseMoved(x - wx, y - wy, button); |
239 | 248 | } |
240 | | |
| 249 | |
241 | 250 | // While a "drag" is in process (i.e. mouse is moved while a button is pressed), |
242 | 251 | // only deal with the widget in which the click originated. |
243 | 252 | if (_dragWidget) |
… |
… |
|
251 | 260 | if (w) |
252 | 261 | w->handleMouseEntered(button); |
253 | 262 | _mouseWidget = w; |
254 | | } |
| 263 | } |
255 | 264 | |
256 | 265 | if (w && (w->getFlags() & WIDGET_TRACK_MOUSE)) { |
257 | 266 | w->handleMouseMoved(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), button); |
diff -u --rec -N --exclude=CVS --exclude=.deps --exclude=*.o scummvm.old/gui/newgui.cpp scummvm/gui/newgui.cpp
old
|
new
|
|
41 | 41 | * - allow multi line (l/c/r aligned) text via StaticTextWidget ? |
42 | 42 | * - add "close" widget to all dialogs (with a flag to turn it off) ? |
43 | 43 | * - make dialogs "moveable" ? |
44 | | * - come up with a new look & feel / theme for the GUI |
| 44 | * - come up with a new look & feel / theme for the GUI |
45 | 45 | * - ... |
46 | 46 | */ |
47 | 47 | |
… |
… |
|
56 | 56 | // Constructor |
57 | 57 | NewGui::NewGui() : _needRedraw(false), |
58 | 58 | _stateIsSaved(false), _cursorAnimateCounter(0), _cursorAnimateTimer(0) { |
59 | | |
| 59 | |
60 | 60 | _system = OSystem::instance(); |
61 | 61 | |
62 | 62 | // Clear the cursor |
… |
… |
|
64 | 64 | |
65 | 65 | // Reset key repeat |
66 | 66 | _currentKeyDown.keycode = 0; |
| 67 | |
| 68 | // updates the scaling factor |
| 69 | updateScaleFactor(); |
67 | 70 | } |
68 | 71 | |
69 | 72 | void NewGui::updateColors() { |
… |
… |
|
75 | 78 | _textcolorhi = _system->RGBToColor(0, 255, 0); |
76 | 79 | } |
77 | 80 | |
| 81 | void NewGui::updateScaleFactor() { |
| 82 | const int16 stdGuiWidth = 320; |
| 83 | const int16 stdGuiHeight = 200; |
| 84 | |
| 85 | _scaleFactorWidth = _system->getWidth() / stdGuiWidth; |
| 86 | _scaleFactorHeight = _system->getHeight() / stdGuiHeight; |
| 87 | } |
| 88 | |
78 | 89 | void NewGui::runLoop() { |
79 | 90 | Dialog *activeDialog = _dialogStack.top(); |
80 | 91 | bool didSaveState = false; |
81 | 92 | |
82 | 93 | if (activeDialog == 0) |
83 | 94 | return; |
84 | | |
| 95 | |
85 | 96 | // Setup some default GUI colors. Normally this will be done whenever an |
86 | 97 | // EVENT_SCREEN_CHANGED is received. However, not yet all backends support |
87 | 98 | // that event, so we also do it "manually" whenever a run loop is entered. |
88 | 99 | updateColors(); |
| 100 | updateScaleFactor(); |
89 | 101 | |
90 | 102 | if (!_stateIsSaved) { |
91 | 103 | saveState(); |
… |
… |
|
106 | 118 | } |
107 | 119 | |
108 | 120 | animateCursor(); |
109 | | _system->updateScreen(); |
| 121 | _system->updateScreen(); |
110 | 122 | |
111 | 123 | OSystem::Event event; |
112 | 124 | uint32 time = _system->getMillis(); |
… |
… |
|
131 | 143 | _currentKeyDown.keycode = 0; |
132 | 144 | break; |
133 | 145 | case OSystem::EVENT_MOUSEMOVE: |
134 | | activeDialog->handleMouseMoved(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y, 0); |
| 146 | activeDialog->handleMouseMoved(event.mouse.x - (activeDialog->_x * _scaleFactorWidth), event.mouse.y - (activeDialog->_y * _scaleFactorHeight), 0); |
135 | 147 | break; |
136 | 148 | // We don't distinguish between mousebuttons (for now at least) |
137 | 149 | case OSystem::EVENT_LBUTTONDOWN: |
… |
… |
|
146 | 158 | _lastClick.count = 1; |
147 | 159 | } |
148 | 160 | _lastClick.time = time; |
149 | | activeDialog->handleMouseDown(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y, 1, _lastClick.count); |
| 161 | activeDialog->handleMouseDown(event.mouse.x - (activeDialog->_x * _scaleFactorWidth), event.mouse.y - (activeDialog->_y * _scaleFactorHeight), 1, _lastClick.count); |
150 | 162 | break; |
151 | 163 | case OSystem::EVENT_LBUTTONUP: |
152 | 164 | case OSystem::EVENT_RBUTTONUP: |
153 | | activeDialog->handleMouseUp(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y, 1, _lastClick.count); |
| 165 | activeDialog->handleMouseUp(event.mouse.x - (activeDialog->_x * _scaleFactorWidth), event.mouse.y - (activeDialog->_y * _scaleFactorHeight), 1, _lastClick.count); |
154 | 166 | break; |
155 | 167 | case OSystem::EVENT_WHEELUP: |
156 | | activeDialog->handleMouseWheel(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y, -1); |
| 168 | activeDialog->handleMouseWheel(event.mouse.x - (activeDialog->_x * _scaleFactorWidth), event.mouse.y - (activeDialog->_y * _scaleFactorHeight), -1); |
157 | 169 | break; |
158 | 170 | case OSystem::EVENT_WHEELDOWN: |
159 | | activeDialog->handleMouseWheel(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y, 1); |
| 171 | activeDialog->handleMouseWheel(event.mouse.x - (activeDialog->_x * _scaleFactorWidth), event.mouse.y - (activeDialog->_y * _scaleFactorHeight), 1); |
160 | 172 | break; |
161 | 173 | case OSystem::EVENT_QUIT: |
162 | 174 | _system->quit(); |
163 | 175 | return; |
164 | 176 | case OSystem::EVENT_SCREEN_CHANGED: |
165 | 177 | updateColors(); |
| 178 | updateScaleFactor(); |
166 | 179 | activeDialog->handleScreenChanged(); |
167 | 180 | break; |
168 | 181 | } |
… |
… |
|
180 | 193 | // Delay for a moment |
181 | 194 | _system->delayMillis(10); |
182 | 195 | } |
183 | | |
| 196 | |
184 | 197 | if (didSaveState) |
185 | 198 | restoreState(); |
186 | 199 | } |
… |
… |
|
224 | 237 | } |
225 | 238 | |
226 | 239 | _system->updateScreen(); |
227 | | |
| 240 | |
228 | 241 | _stateIsSaved = false; |
229 | 242 | } |
230 | 243 | |
… |
… |
|
270 | 283 | } |
271 | 284 | |
272 | 285 | void NewGui::hLine(int x, int y, int x2, OverlayColor color) { |
273 | | _screen.hLine(x, y, x2, color); |
| 286 | _screen.hLine(x * _scaleFactorWidth, y * _scaleFactorHeight, x2 * _scaleFactorWidth, color); |
274 | 287 | } |
275 | 288 | |
276 | 289 | void NewGui::vLine(int x, int y, int y2, OverlayColor color) { |
277 | | _screen.vLine(x, y, y2, color); |
| 290 | _screen.vLine(x * _scaleFactorWidth, y * _scaleFactorHeight, y2 * _scaleFactorHeight, color); |
278 | 291 | } |
279 | 292 | |
280 | 293 | void NewGui::blendRect(int x, int y, int w, int h, OverlayColor color, int level) { |
281 | 294 | #ifdef NEWGUI_256 |
282 | 295 | fillRect(x, y, w, h, color); |
283 | 296 | #else |
284 | | Common::Rect rect(x, y, x + w, y + h); |
| 297 | Common::Rect rect(x * _scaleFactorWidth, y * _scaleFactorHeight, (x + w) * _scaleFactorWidth, (y + h) * _scaleFactorHeight); |
285 | 298 | rect.clip(_screen.w, _screen.h); |
286 | | |
| 299 | |
287 | 300 | if (!rect.isValidRect()) |
288 | 301 | return; |
289 | 302 | |
… |
… |
|
311 | 324 | } |
312 | 325 | |
313 | 326 | void NewGui::fillRect(int x, int y, int w, int h, OverlayColor color) { |
314 | | _screen.fillRect(Common::Rect(x, y, x+w, y+h), color); |
| 327 | _screen.fillRect(Common::Rect(x * _scaleFactorWidth, y * _scaleFactorHeight, (x+w) * _scaleFactorWidth, (y+h) * _scaleFactorHeight), color); |
315 | 328 | } |
316 | 329 | |
317 | 330 | void NewGui::frameRect(int x, int y, int w, int h, OverlayColor color) { |
318 | | _screen.frameRect(Common::Rect(x, y, x+w, y+h), color); |
| 331 | _screen.frameRect(Common::Rect(x * _scaleFactorWidth, y * _scaleFactorHeight, (x+w) * _scaleFactorWidth, (y+h) * _scaleFactorHeight), color); |
319 | 332 | } |
320 | 333 | |
321 | 334 | void NewGui::addDirtyRect(int x, int y, int w, int h) { |
322 | | Common::Rect rect(x, y, x + w, y + h); |
| 335 | Common::Rect rect(x * _scaleFactorWidth, y * _scaleFactorHeight, (x + w) * _scaleFactorWidth, (y + h) * _scaleFactorHeight); |
323 | 336 | rect.clip(_screen.w, _screen.h); |
324 | | |
| 337 | |
325 | 338 | if (!rect.isValidRect()) |
326 | 339 | return; |
327 | 340 | |
… |
… |
|
339 | 352 | } |
340 | 353 | |
341 | 354 | int NewGui::getStringWidth(const String &str) { |
342 | | return getFont().getStringWidth(str); |
| 355 | return getFont().getStringWidth(str) * _scaleFactorWidth; |
343 | 356 | } |
344 | 357 | |
345 | 358 | int NewGui::getCharWidth(byte c) { |
346 | | return getFont().getCharWidth(c); |
| 359 | return getFont().getCharWidth(c) * _scaleFactorWidth; |
347 | 360 | } |
348 | 361 | |
349 | 362 | void NewGui::drawString(const String &s, int x, int y, int w, OverlayColor color, TextAlignment align, int deltax, bool useEllipsis) { |
… |
… |
|
354 | 367 | // Draw an 8x8 bitmap at location (x,y) |
355 | 368 | // |
356 | 369 | void NewGui::drawBitmap(uint32 *bitmap, int tx, int ty, OverlayColor color, int h) { |
| 370 | tx *= _scaleFactorWidth; ty *= _scaleFactorHeight; |
| 371 | h *= _scaleFactorHeight; |
357 | 372 | OverlayColor *ptr = getBasePtr(tx, ty); |
358 | 373 | |
359 | 374 | for (int y = 0; y < h; y++, ptr += _screenPitch) { |
360 | 375 | uint32 mask = 0xF0000000; |
361 | 376 | if (ty + y < 0 || ty + y >= _screen.h) |
362 | 377 | continue; |
363 | | for (int x = 0; x < 8; x++, mask >>= 4) { |
| 378 | for (int x = 0; x < 8 * _scaleFactorWidth; x++) { |
| 379 | if(!(x % 2) && _scaleFactorWidth != 1 && x != 0) |
| 380 | mask >>= 4; |
| 381 | else if(_scaleFactorWidth == 1 && x != 0) |
| 382 | mask >>= 4; |
| 383 | |
364 | 384 | if (tx + x < 0 || tx + x >= _screen.w) |
365 | 385 | continue; |
366 | | if (bitmap[y] & mask) |
367 | | ptr[x] = color; |
| 386 | if (bitmap[y / _scaleFactorHeight] & mask) |
| 387 | ptr[x] = color; |
368 | 388 | } |
369 | 389 | } |
370 | 390 | } |
… |
… |
|
374 | 394 | // We could plug in a different cursor here if we like to. |
375 | 395 | // |
376 | 396 | void NewGui::animateCursor() { |
377 | | int time = _system->getMillis(); |
| 397 | int time = _system->getMillis(); |
378 | 398 | if (time > _cursorAnimateTimer + kCursorAnimateDelay) { |
379 | 399 | const byte colors[4] = { 15, 15, 7, 8 }; |
380 | 400 | const byte color = colors[_cursorAnimateCounter]; |
381 | 401 | int i; |
382 | | |
| 402 | |
383 | 403 | for (i = 0; i < 15; i++) { |
384 | 404 | if ((i < 6) || (i > 8)) { |
385 | 405 | _cursor[16 * 7 + i] = color; |
386 | 406 | _cursor[16 * i + 7] = color; |
387 | 407 | } |
388 | 408 | } |
389 | | |
| 409 | |
390 | 410 | _system->setMouseCursor(_cursor, 16, 16, 7, 7); |
391 | 411 | |
392 | 412 | _cursorAnimateTimer = time; |
diff -u --rec -N --exclude=CVS --exclude=.deps --exclude=*.o scummvm.old/gui/newgui.h scummvm/gui/newgui.h
old
|
new
|
|
52 | 52 | |
53 | 53 | /** |
54 | 54 | * GUI manager singleton. |
55 | | */ |
| 55 | */ |
56 | 56 | class NewGui : public Common::Singleton<NewGui> { |
57 | 57 | typedef Common::String String; |
58 | 58 | friend class Dialog; |
… |
… |
|
66 | 66 | |
67 | 67 | bool isActive() { return ! _dialogStack.empty(); } |
68 | 68 | |
| 69 | int getScaleFactorWidth() { return _scaleFactorWidth; } |
| 70 | int getScaleFactorHeight() { return _scaleFactorHeight; } |
| 71 | |
69 | 72 | protected: |
70 | | OSystem *_system; |
71 | | Graphics::Surface _screen; |
| 73 | OSystem *_system; |
| 74 | Graphics::Surface _screen; |
72 | 75 | int _screenPitch; |
73 | | |
| 76 | |
| 77 | int _scaleFactorWidth; |
| 78 | int _scaleFactorHeight; |
| 79 | |
74 | 80 | bool _needRedraw; |
75 | 81 | DialogStack _dialogStack; |
76 | | |
| 82 | |
77 | 83 | bool _stateIsSaved; |
78 | | |
| 84 | |
79 | 85 | // for continuous events (keyDown) |
80 | 86 | struct { |
81 | 87 | uint16 ascii; |
… |
… |
|
83 | 89 | int keycode; |
84 | 90 | } _currentKeyDown; |
85 | 91 | uint32 _keyRepeatTime; |
86 | | |
| 92 | |
87 | 93 | // position and time of last mouse click (used to detect double clicks) |
88 | 94 | struct { |
89 | 95 | int16 x, y; // Position of mouse when the click occured |
90 | 96 | uint32 time; // Time |
91 | 97 | int count; // How often was it already pressed? |
92 | 98 | } _lastClick; |
93 | | |
| 99 | |
94 | 100 | // mouse cursor state |
95 | 101 | bool _oldCursorMode; |
96 | | int _cursorAnimateCounter; |
97 | | int _cursorAnimateTimer; |
| 102 | int _cursorAnimateCounter; |
| 103 | int _cursorAnimateTimer; |
98 | 104 | byte _cursor[2048]; |
99 | 105 | |
100 | 106 | void saveState(); |
101 | 107 | void restoreState(); |
102 | | |
| 108 | |
103 | 109 | void openDialog(Dialog *dialog); |
104 | 110 | void closeTopDialog(); |
105 | | |
| 111 | |
106 | 112 | void loop(); |
107 | 113 | |
108 | 114 | void animateCursor(); |
109 | 115 | void updateColors(); |
| 116 | void updateScaleFactor(); |
110 | 117 | |
111 | 118 | OverlayColor *getBasePtr(int x, int y); |
112 | 119 | |
… |
… |
|
116 | 123 | OverlayColor _bgcolor; |
117 | 124 | OverlayColor _textcolor; |
118 | 125 | OverlayColor _textcolorhi; |
119 | | |
| 126 | |
120 | 127 | // Font |
121 | 128 | const Graphics::Font &getFont() const; |
122 | 129 | |