aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-10-26 01:48:20 +0300
committerFilippos Karapetis2011-10-26 01:54:27 +0300
commitac559b0212c21c7f4a3a10455b8dff211d7ebb87 (patch)
tree65e492a570689d153c858f4e407d5dd959e982d8
parent764ffff578d9650621a82ddc5bd5c9530940c5ae (diff)
downloadscummvm-rg350-ac559b0212c21c7f4a3a10455b8dff211d7ebb87.tar.gz
scummvm-rg350-ac559b0212c21c7f4a3a10455b8dff211d7ebb87.tar.bz2
scummvm-rg350-ac559b0212c21c7f4a3a10455b8dff211d7ebb87.zip
SCI: Renamed GfxControls to GfxControls16
-rw-r--r--engines/sci/engine/kgraphics.cpp17
-rw-r--r--engines/sci/graphics/controls16.cpp (renamed from engines/sci/graphics/controls.cpp)30
-rw-r--r--engines/sci/graphics/controls16.h (renamed from engines/sci/graphics/controls.h)10
-rw-r--r--engines/sci/module.mk2
-rw-r--r--engines/sci/sci.cpp8
-rw-r--r--engines/sci/sci.h4
6 files changed, 37 insertions, 34 deletions
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index ea2b4816fc..566f2a9a7d 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -39,7 +39,7 @@
#include "sci/graphics/animate.h"
#include "sci/graphics/cache.h"
#include "sci/graphics/compare.h"
-#include "sci/graphics/controls.h"
+#include "sci/graphics/controls16.h"
#include "sci/graphics/cursor.h"
#include "sci/graphics/palette.h"
#include "sci/graphics/paint16.h"
@@ -810,13 +810,13 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
switch (type) {
case SCI_CONTROLS_TYPE_BUTTON:
debugC(kDebugLevelGraphics, "drawing button %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y);
- g_sci->_gfxControls->kernelDrawButton(rect, controlObject, g_sci->strSplit(text.c_str(), NULL).c_str(), fontId, style, hilite);
+ g_sci->_gfxControls16->kernelDrawButton(rect, controlObject, g_sci->strSplit(text.c_str(), NULL).c_str(), fontId, style, hilite);
return;
case SCI_CONTROLS_TYPE_TEXT:
alignment = readSelectorValue(s->_segMan, controlObject, SELECTOR(mode));
debugC(kDebugLevelGraphics, "drawing text %04x:%04x ('%s') to %d,%d, mode=%d", PRINT_REG(controlObject), text.c_str(), x, y, alignment);
- g_sci->_gfxControls->kernelDrawText(rect, controlObject, g_sci->strSplit(text.c_str()).c_str(), fontId, alignment, style, hilite);
+ g_sci->_gfxControls16->kernelDrawText(rect, controlObject, g_sci->strSplit(text.c_str()).c_str(), fontId, alignment, style, hilite);
s->r_acc = g_sci->_gfxText16->allocAndFillReferenceRectArray();
return;
@@ -830,7 +830,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
writeSelectorValue(s->_segMan, controlObject, SELECTOR(cursor), cursorPos);
}
debugC(kDebugLevelGraphics, "drawing edit control %04x:%04x (text %04x:%04x, '%s') to %d,%d", PRINT_REG(controlObject), PRINT_REG(textReference), text.c_str(), x, y);
- g_sci->_gfxControls->kernelDrawTextEdit(rect, controlObject, g_sci->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, cursorPos, maxChars, hilite);
+ g_sci->_gfxControls16->kernelDrawTextEdit(rect, controlObject, g_sci->strSplit(text.c_str(), NULL).c_str(), fontId, mode, style, cursorPos, maxChars, hilite);
return;
case SCI_CONTROLS_TYPE_ICON:
@@ -847,7 +847,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
priority = -1;
}
debugC(kDebugLevelGraphics, "drawing icon control %04x:%04x to %d,%d", PRINT_REG(controlObject), x, y - 1);
- g_sci->_gfxControls->kernelDrawIcon(rect, controlObject, viewId, loopNo, celNo, priority, style, hilite);
+ g_sci->_gfxControls16->kernelDrawIcon(rect, controlObject, viewId, loopNo, celNo, priority, style, hilite);
return;
case SCI_CONTROLS_TYPE_LIST:
@@ -895,7 +895,7 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
}
debugC(kDebugLevelGraphics, "drawing list control %04x:%04x to %d,%d, diff %d", PRINT_REG(controlObject), x, y, SCI_MAX_SAVENAME_LENGTH);
- g_sci->_gfxControls->kernelDrawList(rect, controlObject, maxChars, listCount, listEntries, fontId, style, upperPos, cursorPos, isAlias, hilite);
+ g_sci->_gfxControls16->kernelDrawList(rect, controlObject, maxChars, listCount, listEntries, fontId, style, upperPos, cursorPos, isAlias, hilite);
free(listEntries);
delete[] listStrings;
return;
@@ -975,7 +975,10 @@ reg_t kEditControl(EngineState *s, int argc, reg_t *argv) {
switch (controlType) {
case SCI_CONTROLS_TYPE_TEXTEDIT:
// Only process textedit controls in here
- g_sci->_gfxControls->kernelTexteditChange(controlObject, eventObject);
+ g_sci->_gfxControls16->kernelTexteditChange(controlObject, eventObject);
+ break;
+ default:
+ break;
}
}
return s->r_acc;
diff --git a/engines/sci/graphics/controls.cpp b/engines/sci/graphics/controls16.cpp
index a0750c7d3e..ab54e468d1 100644
--- a/engines/sci/graphics/controls.cpp
+++ b/engines/sci/graphics/controls16.cpp
@@ -36,26 +36,26 @@
#include "sci/graphics/font.h"
#include "sci/graphics/screen.h"
#include "sci/graphics/text16.h"
-#include "sci/graphics/controls.h"
+#include "sci/graphics/controls16.h"
namespace Sci {
-GfxControls::GfxControls(SegManager *segMan, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen)
+GfxControls16::GfxControls16(SegManager *segMan, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen)
: _segMan(segMan), _ports(ports), _paint16(paint16), _text16(text16), _screen(screen) {
init();
}
-GfxControls::~GfxControls() {
+GfxControls16::~GfxControls16() {
}
-void GfxControls::init() {
+void GfxControls16::init() {
_texteditCursorVisible = false;
}
const char controlListUpArrow[2] = { 0x18, 0 };
const char controlListDownArrow[2] = { 0x19, 0 };
-void GfxControls::drawListControl(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 upperPos, int16 cursorPos, bool isAlias) {
+void GfxControls16::drawListControl(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 upperPos, int16 cursorPos, bool isAlias) {
Common::Rect workerRect = rect;
GuiResourceId oldFontId = _text16->GetFontId();
int16 oldPenColor = _ports->_curPort->penClr;
@@ -112,7 +112,7 @@ void GfxControls::drawListControl(Common::Rect rect, reg_t obj, int16 maxChars,
_text16->SetFont(oldFontId);
}
-void GfxControls::texteditCursorDraw(Common::Rect rect, const char *text, uint16 curPos) {
+void GfxControls16::texteditCursorDraw(Common::Rect rect, const char *text, uint16 curPos) {
int16 textWidth, i;
if (!_texteditCursorVisible) {
textWidth = 0;
@@ -130,7 +130,7 @@ void GfxControls::texteditCursorDraw(Common::Rect rect, const char *text, uint16
}
}
-void GfxControls::texteditCursorErase() {
+void GfxControls16::texteditCursorErase() {
if (_texteditCursorVisible) {
_paint16->invertRect(_texteditCursorRect);
_paint16->bitsShow(_texteditCursorRect);
@@ -139,11 +139,11 @@ void GfxControls::texteditCursorErase() {
texteditSetBlinkTime();
}
-void GfxControls::texteditSetBlinkTime() {
+void GfxControls16::texteditSetBlinkTime() {
_texteditBlinkTime = g_system->getMillis() + (30 * 1000 / 60);
}
-void GfxControls::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {
+void GfxControls16::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {
uint16 cursorPos = readSelectorValue(_segMan, controlObject, SELECTOR(cursor));
uint16 maxChars = readSelectorValue(_segMan, controlObject, SELECTOR(max));
reg_t textReference = readSelector(_segMan, controlObject, SELECTOR(text));
@@ -277,13 +277,13 @@ void GfxControls::kernelTexteditChange(reg_t controlObject, reg_t eventObject) {
writeSelectorValue(_segMan, controlObject, SELECTOR(cursor), cursorPos);
}
-int GfxControls::getPicNotValid() {
+int GfxControls16::getPicNotValid() {
if (getSciVersion() >= SCI_VERSION_1_1)
return _screen->_picNotValidSci11;
return _screen->_picNotValid;
}
-void GfxControls::kernelDrawButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) {
+void GfxControls16::kernelDrawButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite) {
int16 sci0EarlyPen = 0, sci0EarlyBack = 0;
if (!hilite) {
if (getSciVersion() == SCI_VERSION_0_EARLY) {
@@ -321,7 +321,7 @@ void GfxControls::kernelDrawButton(Common::Rect rect, reg_t obj, const char *tex
}
}
-void GfxControls::kernelDrawText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, TextAlignment alignment, int16 style, bool hilite) {
+void GfxControls16::kernelDrawText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, TextAlignment alignment, int16 style, bool hilite) {
if (!hilite) {
rect.grow(1);
_paint16->eraseRect(rect);
@@ -338,7 +338,7 @@ void GfxControls::kernelDrawText(Common::Rect rect, reg_t obj, const char *text,
}
}
-void GfxControls::kernelDrawTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite) {
+void GfxControls16::kernelDrawTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite) {
Common::Rect textRect = rect;
uint16 oldFontId = _text16->GetFontId();
@@ -359,7 +359,7 @@ void GfxControls::kernelDrawTextEdit(Common::Rect rect, reg_t obj, const char *t
_paint16->bitsShow(rect);
}
-void GfxControls::kernelDrawIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 priority, int16 style, bool hilite) {
+void GfxControls16::kernelDrawIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 priority, int16 style, bool hilite) {
if (!hilite) {
_paint16->drawCelAndShow(viewId, loopNo, celNo, rect.left, rect.top, priority, 0);
if (style & 0x20) {
@@ -373,7 +373,7 @@ void GfxControls::kernelDrawIcon(Common::Rect rect, reg_t obj, GuiResourceId vie
}
}
-void GfxControls::kernelDrawList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite) {
+void GfxControls16::kernelDrawList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite) {
if (!hilite) {
drawListControl(rect, obj, maxChars, count, entries, fontId, upperPos, cursorPos, isAlias);
rect.grow(1);
diff --git a/engines/sci/graphics/controls.h b/engines/sci/graphics/controls16.h
index 17e7c39318..90bd7beacb 100644
--- a/engines/sci/graphics/controls.h
+++ b/engines/sci/graphics/controls16.h
@@ -20,8 +20,8 @@
*
*/
-#ifndef SCI_GRAPHICS_CONTROLS_H
-#define SCI_GRAPHICS_CONTROLS_H
+#ifndef SCI_GRAPHICS_CONTROLS16_H
+#define SCI_GRAPHICS_CONTROLS16_H
namespace Sci {
@@ -50,10 +50,10 @@ class GfxScreen;
/**
* Controls class, handles drawing of controls in SCI16 (SCI0-SCI1.1) games
*/
-class GfxControls {
+class GfxControls16 {
public:
- GfxControls(SegManager *segMan, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen);
- ~GfxControls();
+ GfxControls16(SegManager *segMan, GfxPorts *ports, GfxPaint16 *paint16, GfxText16 *text16, GfxScreen *screen);
+ ~GfxControls16();
void kernelDrawButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
void kernelDrawText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite);
diff --git a/engines/sci/module.mk b/engines/sci/module.mk
index c129ae5439..828a36298d 100644
--- a/engines/sci/module.mk
+++ b/engines/sci/module.mk
@@ -43,7 +43,7 @@ MODULE_OBJS := \
graphics/animate.o \
graphics/cache.o \
graphics/compare.o \
- graphics/controls.o \
+ graphics/controls16.o \
graphics/coordadjuster.o \
graphics/cursor.o \
graphics/font.o \
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 1d0d63870d..2dc8c95fec 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -46,7 +46,7 @@
#include "sci/graphics/animate.h"
#include "sci/graphics/cache.h"
#include "sci/graphics/compare.h"
-#include "sci/graphics/controls.h"
+#include "sci/graphics/controls16.h"
#include "sci/graphics/coordadjuster.h"
#include "sci/graphics/cursor.h"
#include "sci/graphics/maciconbar.h"
@@ -152,7 +152,7 @@ SciEngine::~SciEngine() {
delete _gfxFrameout;
#endif
delete _gfxMenu;
- delete _gfxControls;
+ delete _gfxControls16;
delete _gfxText16;
delete _gfxAnimate;
delete _gfxPaint;
@@ -588,7 +588,7 @@ void SciEngine::initGraphics() {
_gfxAnimate = 0;
_gfxCache = 0;
_gfxCompare = 0;
- _gfxControls = 0;
+ _gfxControls16 = 0;
_gfxCoordAdjuster = 0;
_gfxCursor = 0;
_gfxMacIconBar = 0;
@@ -636,7 +636,7 @@ void SciEngine::initGraphics() {
_gfxPaint = _gfxPaint16;
_gfxAnimate = new GfxAnimate(_gamestate, _gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen, _gfxPalette, _gfxCursor, _gfxTransitions);
_gfxText16 = new GfxText16(_resMan, _gfxCache, _gfxPorts, _gfxPaint16, _gfxScreen);
- _gfxControls = new GfxControls(_gamestate->_segMan, _gfxPorts, _gfxPaint16, _gfxText16, _gfxScreen);
+ _gfxControls16 = new GfxControls16(_gamestate->_segMan, _gfxPorts, _gfxPaint16, _gfxText16, _gfxScreen);
_gfxMenu = new GfxMenu(_eventMan, _gamestate->_segMan, _gfxPorts, _gfxPaint16, _gfxText16, _gfxScreen, _gfxCursor);
_gfxMenu->reset();
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 81bbdc51de..e76b71b61e 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -59,7 +59,7 @@ class SegManager;
class GfxAnimate;
class GfxCache;
class GfxCompare;
-class GfxControls;
+class GfxControls16;
class GfxCoordAdjuster;
class GfxCursor;
class GfxMacIconBar;
@@ -303,7 +303,7 @@ public:
GfxAnimate *_gfxAnimate; // Animate for 16-bit gfx
GfxCache *_gfxCache;
GfxCompare *_gfxCompare;
- GfxControls *_gfxControls; // Controls for 16-bit gfx
+ GfxControls16 *_gfxControls16; // Controls for 16-bit gfx
GfxCoordAdjuster *_gfxCoordAdjuster;
GfxCursor *_gfxCursor;
GfxMenu *_gfxMenu; // Menu for 16-bit gfx