aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2010-01-05 01:37:57 +0000
committerFilippos Karapetis2010-01-05 01:37:57 +0000
commitd99aa0f12634bed7b5101b4b5a64f50ee744961b (patch)
tree037401495ebf794eaa3b7386b49ee03dbe1cdac1 /engines/sci
parent2f1a909696838533758acdb026b1fd9c3631d6f0 (diff)
downloadscummvm-rg350-d99aa0f12634bed7b5101b4b5a64f50ee744961b.tar.gz
scummvm-rg350-d99aa0f12634bed7b5101b4b5a64f50ee744961b.tar.bz2
scummvm-rg350-d99aa0f12634bed7b5101b4b5a64f50ee744961b.zip
More renaming
svn-id: r47009
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp2
-rw-r--r--engines/sci/engine/kernel.cpp2
-rw-r--r--engines/sci/engine/kevent.cpp2
-rw-r--r--engines/sci/engine/kgraphics.cpp22
-rw-r--r--engines/sci/engine/kmenu.cpp2
-rw-r--r--engines/sci/engine/kmovement.cpp2
-rw-r--r--engines/sci/engine/state.h2
-rw-r--r--engines/sci/event.cpp2
-rw-r--r--engines/sci/graphics/animate.cpp (renamed from engines/sci/graphics/gui_animate.cpp)76
-rw-r--r--engines/sci/graphics/animate.h (renamed from engines/sci/graphics/gui_animate.h)30
-rw-r--r--engines/sci/graphics/controls.cpp (renamed from engines/sci/graphics/gui_controls.cpp)10
-rw-r--r--engines/sci/graphics/controls.h (renamed from engines/sci/graphics/gui_controls.h)16
-rw-r--r--engines/sci/graphics/cursor.cpp (renamed from engines/sci/graphics/gui_cursor.cpp)36
-rw-r--r--engines/sci/graphics/cursor.h (renamed from engines/sci/graphics/gui_cursor.h)20
-rw-r--r--engines/sci/graphics/font.cpp (renamed from engines/sci/graphics/gui_font.cpp)20
-rw-r--r--engines/sci/graphics/font.h (renamed from engines/sci/graphics/gui_font.h)14
-rw-r--r--engines/sci/graphics/gfx.cpp (renamed from engines/sci/graphics/gui_gfx.cpp)118
-rw-r--r--engines/sci/graphics/gfx.h (renamed from engines/sci/graphics/gui_gfx.h)56
-rw-r--r--engines/sci/graphics/gui.cpp86
-rw-r--r--engines/sci/graphics/gui.h42
-rw-r--r--engines/sci/graphics/helpers.h (renamed from engines/sci/graphics/gui_helpers.h)38
-rw-r--r--engines/sci/graphics/menu.cpp (renamed from engines/sci/graphics/gui_menu.cpp)16
-rw-r--r--engines/sci/graphics/menu.h (renamed from engines/sci/graphics/gui_menu.h)20
-rw-r--r--engines/sci/graphics/palette.cpp (renamed from engines/sci/graphics/gui_palette.cpp)50
-rw-r--r--engines/sci/graphics/palette.h (renamed from engines/sci/graphics/gui_palette.h)30
-rw-r--r--engines/sci/graphics/picture.cpp (renamed from engines/sci/graphics/gui_picture.cpp)18
-rw-r--r--engines/sci/graphics/picture.h (renamed from engines/sci/graphics/gui_picture.h)12
-rw-r--r--engines/sci/graphics/portrait.cpp (renamed from engines/sci/graphics/gui_portrait.cpp)12
-rw-r--r--engines/sci/graphics/portrait.h (renamed from engines/sci/graphics/gui_portrait.h)14
-rw-r--r--engines/sci/graphics/screen.cpp (renamed from engines/sci/graphics/gui_screen.cpp)60
-rw-r--r--engines/sci/graphics/screen.h (renamed from engines/sci/graphics/gui_screen.h)14
-rw-r--r--engines/sci/graphics/text.cpp (renamed from engines/sci/graphics/gui_text.cpp)54
-rw-r--r--engines/sci/graphics/text.h (renamed from engines/sci/graphics/gui_text.h)26
-rw-r--r--engines/sci/graphics/transitions.cpp (renamed from engines/sci/graphics/gui_transitions.cpp)58
-rw-r--r--engines/sci/graphics/transitions.h (renamed from engines/sci/graphics/gui_transitions.h)18
-rw-r--r--engines/sci/graphics/view.cpp (renamed from engines/sci/graphics/gui_view.cpp)54
-rw-r--r--engines/sci/graphics/view.h (renamed from engines/sci/graphics/gui_view.h)44
-rw-r--r--engines/sci/graphics/windowmgr.cpp (renamed from engines/sci/graphics/gui_windowmgr.cpp)52
-rw-r--r--engines/sci/graphics/windowmgr.h (renamed from engines/sci/graphics/gui_windowmgr.h)40
-rw-r--r--engines/sci/module.mk28
-rw-r--r--engines/sci/resource.h2
-rw-r--r--engines/sci/sci.cpp12
42 files changed, 616 insertions, 616 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index dfd9a03e62..d29ea7126e 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -44,7 +44,7 @@
#include "sci/sound/softseq/mididriver.h"
#include "sci/vocabulary.h"
#include "sci/graphics/gui.h"
-#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/cursor.h"
#include "graphics/video/avi_decoder.h"
#include "sci/video/seq_decoder.h"
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 43451728f4..0b80871ce4 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -709,7 +709,7 @@ void kernel_sleep(SciEvent *event, uint32 msecs ) {
while (true) {
// let backend process events and update the screen
event->get(SCI_EVENT_PEEK);
- // TODO: we need to call SciGuiCursor::refreshPosition() before each screen update to limit the mouse cursor position
+ // TODO: we need to call Cursor::refreshPosition() before each screen update to limit the mouse cursor position
g_system->updateScreen();
time = g_system->getMillis();
if (time + 10 < wakeup_time) {
diff --git a/engines/sci/engine/kevent.cpp b/engines/sci/engine/kevent.cpp
index 8d04bc7354..e9ac8a3e45 100644
--- a/engines/sci/engine/kevent.cpp
+++ b/engines/sci/engine/kevent.cpp
@@ -30,7 +30,7 @@
#include "sci/debug.h" // for g_debug_simulated_key
#include "sci/event.h"
#include "sci/graphics/gui.h"
-#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/cursor.h"
namespace Sci {
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 3021aa6f5b..4cc0086de3 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -34,10 +34,10 @@
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
#include "sci/graphics/gui.h"
-#include "sci/graphics/gui_animate.h"
-#include "sci/graphics/gui_cursor.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_view.h"
+#include "sci/graphics/animate.h"
+#include "sci/graphics/cursor.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/view.h"
namespace Sci {
@@ -701,12 +701,12 @@ void _k_GenericDrawControl(EngineState *s, reg_t controlObject, bool hilite) {
reg_t textReference = GET_SEL32(s->_segMan, controlObject, text);
Common::String text;
Common::Rect rect;
- GuiTextAlignment alignment;
+ TextAlignment alignment;
int16 mode, maxChars, cursorPos, upperPos, listCount, i;
int16 upperOffset, cursorOffset;
GuiResourceId viewId;
- GuiViewLoopNo loopNo;
- GuiViewCelNo celNo;
+ LoopNo loopNo;
+ CelNo celNo;
reg_t listSeeker;
Common::String *listStrings = NULL;
const char **listEntries = NULL;
@@ -842,8 +842,8 @@ reg_t kEditControl(EngineState *s, int argc, reg_t *argv) {
reg_t kAddToPic(EngineState *s, int argc, reg_t *argv) {
GuiResourceId viewId;
- GuiViewLoopNo loopNo;
- GuiViewCelNo celNo;
+ LoopNo loopNo;
+ CelNo celNo;
int16 leftPos, topPos, priority, control;
switch (argc) {
@@ -909,8 +909,8 @@ reg_t kSetPort(EngineState *s, int argc, reg_t *argv) {
reg_t kDrawCel(EngineState *s, int argc, reg_t *argv) {
GuiResourceId viewId = argv[0].toSint16();
- GuiViewLoopNo loopNo = argv[1].toSint16();
- GuiViewCelNo celNo = argv[2].toSint16();
+ LoopNo loopNo = argv[1].toSint16();
+ CelNo celNo = argv[2].toSint16();
uint16 x = argv[3].toUint16();
uint16 y = argv[4].toUint16();
int16 priority = (argc > 5) ? argv[5].toSint16() : -1;
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index d426b9f8a1..90cd2adbe9 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -28,7 +28,7 @@
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
#include "sci/graphics/gui.h"
-#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/cursor.h"
namespace Sci {
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index da667037c6..1aef51a276 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -27,7 +27,7 @@
#include "sci/resource.h"
#include "sci/engine/state.h"
#include "sci/engine/kernel.h"
-#include "sci/graphics/gui_animate.h"
+#include "sci/graphics/animate.h"
namespace Sci {
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index da5ccdf73e..26e4893b27 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -52,7 +52,7 @@ namespace Sci {
class SciEvent;
class Menubar;
class SciGui;
-class SciGuiCursor;
+class Cursor;
class MessageState;
class SoundCommandParser;
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index b25c0bd486..455066a812 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -329,7 +329,7 @@ sciEvent SciEvent::get(unsigned int mask) {
//sci_event_t error_event = { SCI_EVT_ERROR, 0, 0, 0 };
sciEvent event = { 0, 0, 0, 0 };
- // TODO: we need to call SciGuiCursor::refreshPosition() before each screen update to limit the mouse cursor position
+ // TODO: we need to call Cursor::refreshPosition() before each screen update to limit the mouse cursor position
// Update the screen here, since it's called very often
g_system->updateScreen();
diff --git a/engines/sci/graphics/gui_animate.cpp b/engines/sci/graphics/animate.cpp
index ad9332e3a1..c82fcbf10e 100644
--- a/engines/sci/graphics/gui_animate.cpp
+++ b/engines/sci/graphics/animate.cpp
@@ -30,15 +30,15 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
#include "sci/engine/vm.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_view.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_transitions.h"
-#include "sci/graphics/gui_animate.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/view.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/transitions.h"
+#include "sci/graphics/animate.h"
namespace Sci {
-SciGuiAnimate::SciGuiAnimate(EngineState *state, SciGuiGfx *gfx, SciGuiScreen *screen, SciGuiPalette *palette)
+SciGuiAnimate::SciGuiAnimate(EngineState *state, Gfx *gfx, Screen *screen, SciPalette *palette)
: _s(state), _gfx(gfx), _screen(screen), _palette(palette) {
init();
}
@@ -101,7 +101,7 @@ bool SciGuiAnimate::invoke(List *list, int argc, reg_t *argv) {
return true;
}
-bool sortHelper(const GuiAnimateEntry* entry1, const GuiAnimateEntry* entry2) {
+bool sortHelper(const AnimateEntry* entry1, const AnimateEntry* entry2) {
return (entry1->y == entry2->y) ? (entry1->z < entry2->z) : (entry1->y < entry2->y);
}
@@ -109,7 +109,7 @@ void SciGuiAnimate::makeSortedList(List *list) {
reg_t curAddress = list->first;
Node *curNode = _s->_segMan->lookupNode(curAddress);
reg_t curObject;
- GuiAnimateEntry *listEntry;
+ AnimateEntry *listEntry;
int16 listNr, listCount = 0;
// Count the list entries
@@ -128,13 +128,13 @@ void SciGuiAnimate::makeSortedList(List *list) {
// Adjust list size, if needed
if ((_listData == NULL) || (_listCount < listCount)) {
free(_listData);
- _listData = (GuiAnimateEntry *)malloc(listCount * sizeof(GuiAnimateEntry));
+ _listData = (AnimateEntry *)malloc(listCount * sizeof(AnimateEntry));
if (!_listData)
error("Could not allocate memory for _listData");
_listCount = listCount;
free(_lastCastData);
- _lastCastData = (GuiAnimateEntry *)malloc(listCount * sizeof(GuiAnimateEntry));
+ _lastCastData = (AnimateEntry *)malloc(listCount * sizeof(AnimateEntry));
if (!_lastCastData)
error("Could not allocate memory for _lastCastData");
_lastCastCount = 0;
@@ -169,19 +169,19 @@ void SciGuiAnimate::makeSortedList(List *list) {
}
// Now sort the list according y and z (descending)
- GuiAnimateList::iterator listBegin = _list.begin();
- GuiAnimateList::iterator listEnd = _list.end();
+ AnimateList::iterator listBegin = _list.begin();
+ AnimateList::iterator listEnd = _list.end();
Common::sort(_list.begin(), _list.end(), sortHelper);
}
void SciGuiAnimate::fill(byte &old_picNotValid) {
reg_t curObject;
- GuiAnimateEntry *listEntry;
+ AnimateEntry *listEntry;
uint16 signal;
- SciGuiView *view = NULL;
- GuiAnimateList::iterator listIterator;
- GuiAnimateList::iterator listEnd = _list.end();
+ View *view = NULL;
+ AnimateList::iterator listIterator;
+ AnimateList::iterator listEnd = _list.end();
listIterator = _list.begin();
while (listIterator != listEnd) {
@@ -236,13 +236,13 @@ void SciGuiAnimate::fill(byte &old_picNotValid) {
void SciGuiAnimate::update() {
reg_t curObject;
- GuiAnimateEntry *listEntry;
+ AnimateEntry *listEntry;
uint16 signal;
reg_t bitsHandle;
Common::Rect rect;
- GuiAnimateList::iterator listIterator;
- GuiAnimateList::iterator listBegin = _list.begin();
- GuiAnimateList::iterator listEnd = _list.end();
+ AnimateList::iterator listIterator;
+ AnimateList::iterator listBegin = _list.begin();
+ AnimateList::iterator listEnd = _list.end();
// Remove all no-update cels, if requested
listIterator = _list.reverse_begin();
@@ -341,12 +341,12 @@ void SciGuiAnimate::update() {
void SciGuiAnimate::drawCels() {
reg_t curObject;
- GuiAnimateEntry *listEntry;
- GuiAnimateEntry *lastCastEntry = _lastCastData;
+ AnimateEntry *listEntry;
+ AnimateEntry *lastCastEntry = _lastCastData;
uint16 signal;
reg_t bitsHandle;
- GuiAnimateList::iterator listIterator;
- GuiAnimateList::iterator listEnd = _list.end();
+ AnimateList::iterator listIterator;
+ AnimateList::iterator listEnd = _list.end();
_lastCastCount = 0;
@@ -371,7 +371,7 @@ void SciGuiAnimate::drawCels() {
listEntry->signal = signal;
// Remember that entry in lastCast
- memcpy(lastCastEntry, listEntry, sizeof(GuiAnimateEntry));
+ memcpy(lastCastEntry, listEntry, sizeof(AnimateEntry));
lastCastEntry++; _lastCastCount++;
}
listIterator++;
@@ -380,10 +380,10 @@ void SciGuiAnimate::drawCels() {
void SciGuiAnimate::updateScreen(byte oldPicNotValid) {
reg_t curObject;
- GuiAnimateEntry *listEntry;
+ AnimateEntry *listEntry;
uint16 signal;
- GuiAnimateList::iterator listIterator;
- GuiAnimateList::iterator listEnd = _list.end();
+ AnimateList::iterator listIterator;
+ AnimateList::iterator listEnd = _list.end();
Common::Rect lsRect;
Common::Rect workerRect;
@@ -429,10 +429,10 @@ void SciGuiAnimate::updateScreen(byte oldPicNotValid) {
void SciGuiAnimate::restoreAndDelete(int argc, reg_t *argv) {
reg_t curObject;
- GuiAnimateEntry *listEntry;
+ AnimateEntry *listEntry;
uint16 signal;
- GuiAnimateList::iterator listIterator;
- GuiAnimateList::iterator listEnd = _list.end();
+ AnimateList::iterator listIterator;
+ AnimateList::iterator listEnd = _list.end();
// This has to be done in a separate loop. At least in sq1 some .dispose modifies FIXEDLOOP flag in signal for
@@ -469,7 +469,7 @@ void SciGuiAnimate::restoreAndDelete(int argc, reg_t *argv) {
}
void SciGuiAnimate::reAnimate(Common::Rect rect) {
- GuiAnimateEntry *lastCastEntry;
+ AnimateEntry *lastCastEntry;
uint16 lastCastCount;
if (_lastCastCount > 0) {
@@ -517,10 +517,10 @@ void SciGuiAnimate::reAnimate(Common::Rect rect) {
void SciGuiAnimate::addToPicDrawCels() {
reg_t curObject;
- GuiAnimateEntry *listEntry;
- SciGuiView *view = NULL;
- GuiAnimateList::iterator listIterator;
- GuiAnimateList::iterator listEnd = _list.end();
+ AnimateEntry *listEntry;
+ View *view = NULL;
+ AnimateList::iterator listIterator;
+ AnimateList::iterator listEnd = _list.end();
listIterator = _list.begin();
while (listIterator != listEnd) {
@@ -547,8 +547,8 @@ void SciGuiAnimate::addToPicDrawCels() {
}
}
-void SciGuiAnimate::addToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
- SciGuiView *view = _gfx->getView(viewId);
+void SciGuiAnimate::addToPicDrawView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
+ View *view = _gfx->getView(viewId);
Common::Rect celRect;
// Create rect according to coordinates and given cel
diff --git a/engines/sci/graphics/gui_animate.h b/engines/sci/graphics/animate.h
index 51204ef5ac..a71e0a769a 100644
--- a/engines/sci/graphics/gui_animate.h
+++ b/engines/sci/graphics/animate.h
@@ -23,10 +23,10 @@
*
*/
-#ifndef SCI_GUI_ANIMATE_H
-#define SCI_GUI_ANIMATE_H
+#ifndef SCI_GRAPHICS_ANIMATE_H
+#define SCI_GRAPHICS_ANIMATE_H
-#include "sci/graphics/gui_helpers.h"
+#include "sci/graphics/helpers.h"
namespace Sci {
@@ -52,13 +52,13 @@ enum ViewSignals {
kSignalStopUpdHack = 0x20000000 // View has been stop-updated (again???) - a hack used by the old GUI code only, for dynamic views
};
-class SciGuiGfx;
-class SciGuiScreen;
-class SciGuiPalette;
-class SciGuiTransitions;
+class Gfx;
+class Screen;
+class SciPalette;
+class Transitions;
class SciGuiAnimate {
public:
- SciGuiAnimate(EngineState *state, SciGuiGfx *gfx, SciGuiScreen *screen, SciGuiPalette *palette);
+ SciGuiAnimate(EngineState *state, Gfx *gfx, Screen *screen, SciPalette *palette);
~SciGuiAnimate();
// FIXME: Don't store EngineState
@@ -74,22 +74,22 @@ public:
void restoreAndDelete(int argc, reg_t *argv);
void reAnimate(Common::Rect rect);
void addToPicDrawCels();
- void addToPicDrawView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
+ void addToPicDrawView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
private:
void init();
EngineState *_s;
- SciGuiGfx *_gfx;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
+ Gfx *_gfx;
+ Screen *_screen;
+ SciPalette *_palette;
uint16 _listCount;
- GuiAnimateEntry *_listData;
- GuiAnimateList _list;
+ AnimateEntry *_listData;
+ AnimateList _list;
uint16 _lastCastCount;
- GuiAnimateEntry *_lastCastData;
+ AnimateEntry *_lastCastData;
bool _ignoreFastCast;
};
diff --git a/engines/sci/graphics/gui_controls.cpp b/engines/sci/graphics/controls.cpp
index 073819a654..ba6ded2936 100644
--- a/engines/sci/graphics/gui_controls.cpp
+++ b/engines/sci/graphics/controls.cpp
@@ -30,14 +30,14 @@
#include "sci/sci.h"
#include "sci/event.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_font.h"
-#include "sci/graphics/gui_text.h"
-#include "sci/graphics/gui_controls.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/font.h"
+#include "sci/graphics/text.h"
+#include "sci/graphics/controls.h"
namespace Sci {
-SciGuiControls::SciGuiControls(SegManager *segMan, SciGuiGfx *gfx, SciGuiText *text)
+SciGuiControls::SciGuiControls(SegManager *segMan, Gfx *gfx, Text *text)
: _segMan(segMan), _gfx(gfx), _text(text) {
init();
}
diff --git a/engines/sci/graphics/gui_controls.h b/engines/sci/graphics/controls.h
index a2d027d514..1d0b9e1ac6 100644
--- a/engines/sci/graphics/gui_controls.h
+++ b/engines/sci/graphics/controls.h
@@ -23,17 +23,17 @@
*
*/
-#ifndef SCI_GUI_CONTROLS_H
-#define SCI_GUI_CONTROLS_H
+#ifndef SCI_GRAPHICS_CONTROLS_H
+#define SCI_GRAPHICS_CONTROLS_H
namespace Sci {
-class SciGuiGfx;
-class SciGuiFont;
-class SciGuiText;
+class Gfx;
+class Font;
+class Text;
class SciGuiControls {
public:
- SciGuiControls(SegManager *segMan, SciGuiGfx *gfx, SciGuiText *text);
+ SciGuiControls(SegManager *segMan, Gfx *gfx, Text *text);
~SciGuiControls();
void drawListControl(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 upperPos, int16 cursorPos, bool isAlias);
@@ -46,8 +46,8 @@ private:
void TexteditSetBlinkTime();
SegManager *_segMan;
- SciGuiGfx *_gfx;
- SciGuiText *_text;
+ Gfx *_gfx;
+ Text *_text;
// Textedit-Control related
Common::Rect _texteditCursorRect;
diff --git a/engines/sci/graphics/gui_cursor.cpp b/engines/sci/graphics/cursor.cpp
index 603b3f589e..4682fd42a6 100644
--- a/engines/sci/graphics/gui_cursor.cpp
+++ b/engines/sci/graphics/cursor.cpp
@@ -29,14 +29,14 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_view.h"
-#include "sci/graphics/gui_cursor.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/view.h"
+#include "sci/graphics/cursor.h"
namespace Sci {
-SciGuiCursor::SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette, SciGuiScreen *screen)
+Cursor::Cursor(ResourceManager *resMan, SciPalette *palette, Screen *screen)
: _resMan(resMan), _palette(palette), _screen(screen) {
_upscaledHires = _screen->getUpscaledHires();
@@ -47,25 +47,25 @@ SciGuiCursor::SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette, SciG
_isVisible = true;
}
-SciGuiCursor::~SciGuiCursor() {
+Cursor::~Cursor() {
purgeCache();
}
-void SciGuiCursor::show() {
+void Cursor::show() {
CursorMan.showMouse(true);
_isVisible = true;
}
-void SciGuiCursor::hide() {
+void Cursor::hide() {
CursorMan.showMouse(false);
_isVisible = false;
}
-bool SciGuiCursor::isVisible() {
+bool Cursor::isVisible() {
return _isVisible;
}
-void SciGuiCursor::purgeCache() {
+void Cursor::purgeCache() {
for (CursorCache::iterator iter = _cachedCursors.begin(); iter != _cachedCursors.end(); ++iter) {
delete iter->_value;
iter->_value = 0;
@@ -74,7 +74,7 @@ void SciGuiCursor::purgeCache() {
_cachedCursors.clear();
}
-void SciGuiCursor::setShape(GuiResourceId resourceId) {
+void Cursor::setShape(GuiResourceId resourceId) {
Resource *resource;
byte *resourceData;
Common::Point hotspot = Common::Point(0, 0);
@@ -133,16 +133,16 @@ void SciGuiCursor::setShape(GuiResourceId resourceId) {
delete[] rawBitmap;
}
-void SciGuiCursor::setView(GuiResourceId viewNum, int loopNum, int celNum, Common::Point *hotspot) {
+void Cursor::setView(GuiResourceId viewNum, int loopNum, int celNum, Common::Point *hotspot) {
if (_cachedCursors.size() >= MAX_CACHED_CURSORS)
purgeCache();
if (!_cachedCursors.contains(viewNum))
- _cachedCursors[viewNum] = new SciGuiView(_resMan, _screen, _palette, viewNum);
+ _cachedCursors[viewNum] = new View(_resMan, _screen, _palette, viewNum);
- SciGuiView *cursorView = _cachedCursors[viewNum];
+ View *cursorView = _cachedCursors[viewNum];
- sciViewCelInfo *celInfo = cursorView->getCelInfo(loopNum, celNum);
+ CelInfo *celInfo = cursorView->getCelInfo(loopNum, celNum);
int16 width = celInfo->width;
int16 height = celInfo->height;
byte clearKey = celInfo->clearKey;
@@ -180,7 +180,7 @@ void SciGuiCursor::setView(GuiResourceId viewNum, int loopNum, int celNum, Commo
delete cursorHotspot;
}
-void SciGuiCursor::setPosition(Common::Point pos) {
+void Cursor::setPosition(Common::Point pos) {
if (!_upscaledHires) {
g_system->warpMouse(pos.x, pos.y);
} else {
@@ -188,7 +188,7 @@ void SciGuiCursor::setPosition(Common::Point pos) {
}
}
-Common::Point SciGuiCursor::getPosition() {
+Common::Point Cursor::getPosition() {
Common::Point mousePos = g_system->getEventManager()->getMousePos();
if (_upscaledHires) {
@@ -199,7 +199,7 @@ Common::Point SciGuiCursor::getPosition() {
return mousePos;
}
-void SciGuiCursor::refreshPosition() {
+void Cursor::refreshPosition() {
bool clipped = false;
Common::Point mousePoint = getPosition();
diff --git a/engines/sci/graphics/gui_cursor.h b/engines/sci/graphics/cursor.h
index 293c508bdb..c714faff87 100644
--- a/engines/sci/graphics/gui_cursor.h
+++ b/engines/sci/graphics/cursor.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef SCI_GUI_CURSOR_H
-#define SCI_GUI_CURSOR_H
+#ifndef SCI_GRAPHICS_CURSOR_H
+#define SCI_GRAPHICS_CURSOR_H
#include "common/hashmap.h"
@@ -37,15 +37,15 @@ namespace Sci {
#define MAX_CACHED_CURSORS 10
-class SciGuiView;
-class SciGuiPalette;
+class View;
+class SciPalette;
-typedef Common::HashMap<int, SciGuiView *> CursorCache;
+typedef Common::HashMap<int, View *> CursorCache;
-class SciGuiCursor {
+class Cursor {
public:
- SciGuiCursor(ResourceManager *resMan, SciGuiPalette *palette, SciGuiScreen *screen);
- ~SciGuiCursor();
+ Cursor(ResourceManager *resMan, SciPalette *palette, Screen *screen);
+ ~Cursor();
void show();
void hide();
@@ -67,8 +67,8 @@ private:
void purgeCache();
ResourceManager *_resMan;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
+ Screen *_screen;
+ SciPalette *_palette;
bool _upscaledHires;
diff --git a/engines/sci/graphics/gui_font.cpp b/engines/sci/graphics/font.cpp
index 7416a6a467..6b20899c26 100644
--- a/engines/sci/graphics/gui_font.cpp
+++ b/engines/sci/graphics/font.cpp
@@ -25,12 +25,12 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_font.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/font.h"
namespace Sci {
-SciGuiFont::SciGuiFont(ResourceManager *resMan, GuiResourceId resourceId)
+Font::Font(ResourceManager *resMan, GuiResourceId resourceId)
: _resourceId(resourceId), _resMan(resMan) {
assert(resourceId != -1);
@@ -56,29 +56,29 @@ SciGuiFont::SciGuiFont(ResourceManager *resMan, GuiResourceId resourceId)
}
}
-SciGuiFont::~SciGuiFont() {
+Font::~Font() {
delete []_chars;
_resMan->unlockResource(_resource);
}
-GuiResourceId SciGuiFont::getResourceId() {
+GuiResourceId Font::getResourceId() {
return _resourceId;
}
-byte SciGuiFont::getHeight() {
+byte Font::getHeight() {
return _fontHeight;
}
-byte SciGuiFont::getCharWidth(byte chr) {
+byte Font::getCharWidth(byte chr) {
return chr < _numChars ? _chars[chr].w : 0;
}
-byte SciGuiFont::getCharHeight(byte chr) {
+byte Font::getCharHeight(byte chr) {
return chr < _numChars ? _chars[chr].h : 0;
}
-byte *SciGuiFont::getCharData(byte chr) {
+byte *Font::getCharData(byte chr) {
return chr < _numChars ? _resourceData + _chars[chr].offset + 2 : 0;
}
-void SciGuiFont::draw(SciGuiScreen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
+void Font::draw(Screen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput) {
int charWidth = MIN<int>(getCharWidth(chr), screen->_width - left);
int charHeight = MIN<int>(getCharHeight(chr), 200 - top);
byte b = 0, mask = 0xFF;
diff --git a/engines/sci/graphics/gui_font.h b/engines/sci/graphics/font.h
index fa3909dad9..102b8ac92d 100644
--- a/engines/sci/graphics/gui_font.h
+++ b/engines/sci/graphics/font.h
@@ -23,24 +23,24 @@
*
*/
-#ifndef SCI_GUI_FONT_H
-#define SCI_GUI_FONT_H
+#ifndef SCI_GRAPHICS_FONT_H
+#define SCI_GRAPHICS_FONT_H
-#include "sci/graphics/gui_helpers.h"
+#include "sci/graphics/helpers.h"
namespace Sci {
-class SciGuiFont {
+class Font {
public:
- SciGuiFont(ResourceManager *resMan, GuiResourceId resourceId);
- ~SciGuiFont();
+ Font(ResourceManager *resMan, GuiResourceId resourceId);
+ ~Font();
GuiResourceId getResourceId();
byte getHeight();
byte getCharWidth(byte chr);
byte getCharHeight(byte chr);
byte *getCharData(byte chr);
- void draw(SciGuiScreen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput);
+ void draw(Screen *screen, int16 chr, int16 top, int16 left, byte color, bool greyedOutput);
private:
ResourceManager *_resMan;
diff --git a/engines/sci/graphics/gui_gfx.cpp b/engines/sci/graphics/gfx.cpp
index f6ccfc486e..be4c7d357d 100644
--- a/engines/sci/graphics/gui_gfx.cpp
+++ b/engines/sci/graphics/gfx.cpp
@@ -29,46 +29,46 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_animate.h"
-#include "sci/graphics/gui_font.h"
-#include "sci/graphics/gui_picture.h"
-#include "sci/graphics/gui_view.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_text.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/animate.h"
+#include "sci/graphics/font.h"
+#include "sci/graphics/picture.h"
+#include "sci/graphics/view.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/text.h"
namespace Sci {
-SciGuiGfx::SciGuiGfx(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, SciGuiScreen *screen, SciGuiPalette *palette)
+Gfx::Gfx(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, Screen *screen, SciPalette *palette)
: _resMan(resMan), _segMan(segMan), _kernel(kernel), _screen(screen), _palette(palette) {
}
-SciGuiGfx::~SciGuiGfx() {
+Gfx::~Gfx() {
purgeCache();
delete _mainPort;
delete _menuPort;
}
-void SciGuiGfx::init(SciGuiText *text) {
+void Gfx::init(Text *text) {
_text = text;
// _mainPort is not known to windowmanager, that's okay according to sierra sci
// its not even used currently in our engine
- _mainPort = new GuiPort(0);
+ _mainPort = new Port(0);
SetPort(_mainPort);
OpenPort(_mainPort);
// _menuPort has actually hardcoded id 0xFFFF. Its not meant to be known to windowmanager according to sierra sci
- _menuPort = new GuiPort(0xFFFF);
+ _menuPort = new Port(0xFFFF);
OpenPort(_menuPort);
_text->SetFont(0);
_menuPort->rect = Common::Rect(0, 0, _screen->_width, _screen->_height);
_menuBarRect = Common::Rect(0, 0, _screen->_width, 9);
}
-void SciGuiGfx::purgeCache() {
+void Gfx::purgeCache() {
for (ViewCache::iterator iter = _cachedViews.begin(); iter != _cachedViews.end(); ++iter) {
delete iter->_value;
iter->_value = 0;
@@ -77,46 +77,46 @@ void SciGuiGfx::purgeCache() {
_cachedViews.clear();
}
-SciGuiView *SciGuiGfx::getView(GuiResourceId viewNum) {
+View *Gfx::getView(GuiResourceId viewNum) {
if (_cachedViews.size() >= MAX_CACHED_VIEWS)
purgeCache();
if (!_cachedViews.contains(viewNum))
- _cachedViews[viewNum] = new SciGuiView(_resMan, _screen, _palette, viewNum);
+ _cachedViews[viewNum] = new View(_resMan, _screen, _palette, viewNum);
return _cachedViews[viewNum];
}
-GuiPort *SciGuiGfx::SetPort(GuiPort *newPort) {
- GuiPort *oldPort = _curPort;
+Port *Gfx::SetPort(Port *newPort) {
+ Port *oldPort = _curPort;
_curPort = newPort;
return oldPort;
}
-GuiPort *SciGuiGfx::GetPort() {
+Port *Gfx::GetPort() {
return _curPort;
}
-void SciGuiGfx::SetOrigin(int16 left, int16 top) {
+void Gfx::SetOrigin(int16 left, int16 top) {
_curPort->left = left;
_curPort->top = top;
}
-void SciGuiGfx::MoveTo(int16 left, int16 top) {
+void Gfx::MoveTo(int16 left, int16 top) {
_curPort->curTop = top;
_curPort->curLeft = left;
}
-void SciGuiGfx::Move(int16 left, int16 top) {
+void Gfx::Move(int16 left, int16 top) {
_curPort->curTop += top;
_curPort->curLeft += left;
}
-void SciGuiGfx::OpenPort(GuiPort *port) {
+void Gfx::OpenPort(Port *port) {
port->fontId = 0;
port->fontHeight = 8;
- GuiPort *tmp = _curPort;
+ Port *tmp = _curPort;
_curPort = port;
_text->SetFont(port->fontId);
_curPort = tmp;
@@ -130,46 +130,46 @@ void SciGuiGfx::OpenPort(GuiPort *port) {
port->rect = _bounds;
}
-void SciGuiGfx::PenColor(int16 color) {
+void Gfx::PenColor(int16 color) {
_curPort->penClr = color;
}
-void SciGuiGfx::BackColor(int16 color) {
+void Gfx::BackColor(int16 color) {
_curPort->backClr = color;
}
-void SciGuiGfx::PenMode(int16 mode) {
+void Gfx::PenMode(int16 mode) {
_curPort->penMode = mode;
}
-void SciGuiGfx::TextGreyedOutput(bool state) {
+void Gfx::TextGreyedOutput(bool state) {
_curPort->greyedOutput = state;
}
-int16 SciGuiGfx::GetPointSize() {
+int16 Gfx::GetPointSize() {
return _curPort->fontHeight;
}
-void SciGuiGfx::ClearScreen(byte color) {
+void Gfx::ClearScreen(byte color) {
FillRect(_curPort->rect, SCI_SCREEN_MASK_ALL, color, 0, 0);
}
-void SciGuiGfx::InvertRect(const Common::Rect &rect) {
+void Gfx::InvertRect(const Common::Rect &rect) {
int16 oldpenmode = _curPort->penMode;
_curPort->penMode = 2;
FillRect(rect, 1, _curPort->penClr, _curPort->backClr);
_curPort->penMode = oldpenmode;
}
-void SciGuiGfx::EraseRect(const Common::Rect &rect) {
+void Gfx::EraseRect(const Common::Rect &rect) {
FillRect(rect, 1, _curPort->backClr);
}
-void SciGuiGfx::PaintRect(const Common::Rect &rect) {
+void Gfx::PaintRect(const Common::Rect &rect) {
FillRect(rect, 1, _curPort->penClr);
}
-void SciGuiGfx::FillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen, byte clrBack, byte bControl) {
+void Gfx::FillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen, byte clrBack, byte bControl) {
Common::Rect r = rect;
r.clip(_curPort->rect);
if (r.isEmpty()) // nothing to fill
@@ -221,7 +221,7 @@ void SciGuiGfx::FillRect(const Common::Rect &rect, int16 drawFlags, byte clrPen,
}
}
-void SciGuiGfx::FrameRect(const Common::Rect &rect) {
+void Gfx::FrameRect(const Common::Rect &rect) {
Common::Rect r;
// left
r = rect;
@@ -241,21 +241,21 @@ void SciGuiGfx::FrameRect(const Common::Rect &rect) {
PaintRect(r);
}
-void SciGuiGfx::OffsetRect(Common::Rect &r) {
+void Gfx::OffsetRect(Common::Rect &r) {
r.top += _curPort->top;
r.bottom += _curPort->top;
r.left += _curPort->left;
r.right += _curPort->left;
}
-void SciGuiGfx::OffsetLine(Common::Point &start, Common::Point &end) {
+void Gfx::OffsetLine(Common::Point &start, Common::Point &end) {
start.x += _curPort->left;
start.y += _curPort->top;
end.x += _curPort->left;
end.y += _curPort->top;
}
-void SciGuiGfx::BitsShow(const Common::Rect &rect) {
+void Gfx::BitsShow(const Common::Rect &rect) {
Common::Rect workerRect(rect.left, rect.top, rect.right, rect.bottom);
workerRect.clip(_curPort->rect);
if (workerRect.isEmpty()) // nothing to show
@@ -265,8 +265,8 @@ void SciGuiGfx::BitsShow(const Common::Rect &rect) {
_screen->copyRectToScreen(workerRect);
}
-GuiMemoryHandle SciGuiGfx::BitsSave(const Common::Rect &rect, byte screenMask) {
- GuiMemoryHandle memoryId;
+MemoryHandle Gfx::BitsSave(const Common::Rect &rect, byte screenMask) {
+ MemoryHandle memoryId;
byte *memoryPtr;
int size;
@@ -286,7 +286,7 @@ GuiMemoryHandle SciGuiGfx::BitsSave(const Common::Rect &rect, byte screenMask) {
return memoryId;
}
-void SciGuiGfx::BitsGetRect(GuiMemoryHandle memoryHandle, Common::Rect *destRect) {
+void Gfx::BitsGetRect(MemoryHandle memoryHandle, Common::Rect *destRect) {
byte *memoryPtr = NULL;
if (!memoryHandle.isNull()) {
@@ -298,7 +298,7 @@ void SciGuiGfx::BitsGetRect(GuiMemoryHandle memoryHandle, Common::Rect *destRect
}
}
-void SciGuiGfx::BitsRestore(GuiMemoryHandle memoryHandle) {
+void Gfx::BitsRestore(MemoryHandle memoryHandle) {
byte *memoryPtr = NULL;
if (!memoryHandle.isNull()) {
@@ -311,13 +311,13 @@ void SciGuiGfx::BitsRestore(GuiMemoryHandle memoryHandle) {
}
}
-void SciGuiGfx::BitsFree(GuiMemoryHandle memoryHandle) {
+void Gfx::BitsFree(MemoryHandle memoryHandle) {
if (!memoryHandle.isNull()) {
kfree(_segMan, memoryHandle);
}
}
-void SciGuiGfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId) {
+void Gfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId) {
SciGuiPicture *picture = new SciGuiPicture(_resMan, this, _screen, _palette, pictureId);
// do we add to a picture? if not -> clear screen with white
@@ -329,8 +329,8 @@ void SciGuiGfx::drawPicture(GuiResourceId pictureId, int16 animationNr, bool mir
}
// This one is the only one that updates screen!
-void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight) {
- SciGuiView *view = getView(viewId);
+void Gfx::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight) {
+ View *view = getView(viewId);
Common::Rect rect;
Common::Rect clipRect;
if (view) {
@@ -358,8 +358,8 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo
}
// This version of drawCel is not supposed to call BitsShow()!
-void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) {
- SciGuiView *view = getView(viewId);
+void Gfx::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) {
+ View *view = getView(viewId);
Common::Rect clipRect;
if (view) {
clipRect = celRect;
@@ -375,7 +375,7 @@ void SciGuiGfx::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo
}
// This version of drawCel is not supposed to call BitsShow()!
-void SciGuiGfx::drawCel(SciGuiView *view, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) {
+void Gfx::drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo) {
Common::Rect clipRect;
clipRect = celRect;
clipRect.clip(_curPort->rect);
@@ -387,7 +387,7 @@ void SciGuiGfx::drawCel(SciGuiView *view, GuiViewLoopNo loopNo, GuiViewCelNo cel
view->draw(celRect, clipRect, clipRectTranslated, loopNo, celNo, priority, paletteNo);
}
-uint16 SciGuiGfx::onControl(uint16 screenMask, Common::Rect rect) {
+uint16 Gfx::onControl(uint16 screenMask, Common::Rect rect) {
Common::Rect outRect(rect.left, rect.top, rect.right, rect.bottom);
int16 x, y;
uint16 result = 0;
@@ -420,7 +420,7 @@ static inline int sign_extend_byte(int value) {
return value;
}
-void SciGuiGfx::PriorityBandsInit(int16 bandCount, int16 top, int16 bottom) {
+void Gfx::PriorityBandsInit(int16 bandCount, int16 top, int16 bottom) {
int16 y;
int32 bandSize;
@@ -449,7 +449,7 @@ void SciGuiGfx::PriorityBandsInit(int16 bandCount, int16 top, int16 bottom) {
_priorityBands[y] = _priorityBandCount;
}
-void SciGuiGfx::PriorityBandsInit(byte *data) {
+void Gfx::PriorityBandsInit(byte *data) {
int i = 0, inx;
byte priority = 0;
@@ -462,7 +462,7 @@ void SciGuiGfx::PriorityBandsInit(byte *data) {
_priorityBands[i++] = inx;
}
-byte SciGuiGfx::CoordinateToPriority(int16 y) {
+byte Gfx::CoordinateToPriority(int16 y) {
if (y < _priorityTop)
return _priorityBands[_priorityTop];
if (y > _priorityBottom)
@@ -470,7 +470,7 @@ byte SciGuiGfx::CoordinateToPriority(int16 y) {
return _priorityBands[y];
}
-int16 SciGuiGfx::PriorityToCoordinate(byte priority) {
+int16 Gfx::PriorityToCoordinate(byte priority) {
int16 y;
if (priority <= _priorityBandCount) {
for (y = 0; y <= _priorityBottom; y++)
@@ -480,7 +480,7 @@ int16 SciGuiGfx::PriorityToCoordinate(byte priority) {
return _priorityBottom;
}
-bool SciGuiGfx::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list) {
+bool Gfx::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect, List *list) {
reg_t curAddress = list->first;
Node *curNode = _segMan->lookupNode(curAddress);
reg_t curObject;
@@ -508,12 +508,12 @@ bool SciGuiGfx::CanBeHereCheckRectList(reg_t checkObject, Common::Rect checkRect
return true;
}
-void SciGuiGfx::SetNowSeen(reg_t objectReference) {
- SciGuiView *view = NULL;
+void Gfx::SetNowSeen(reg_t objectReference) {
+ View *view = NULL;
Common::Rect celRect(0, 0);
GuiResourceId viewId = (GuiResourceId)GET_SEL32V(_segMan, objectReference, view);
- GuiViewLoopNo loopNo = sign_extend_byte((GuiViewLoopNo)GET_SEL32V(_segMan, objectReference, loop));
- GuiViewCelNo celNo = sign_extend_byte((GuiViewCelNo)GET_SEL32V(_segMan, objectReference, cel));
+ LoopNo loopNo = sign_extend_byte((LoopNo)GET_SEL32V(_segMan, objectReference, loop));
+ CelNo celNo = sign_extend_byte((CelNo)GET_SEL32V(_segMan, objectReference, cel));
int16 x = (int16)GET_SEL32V(_segMan, objectReference, x);
int16 y = (int16)GET_SEL32V(_segMan, objectReference, y);
int16 z = 0;
diff --git a/engines/sci/graphics/gui_gfx.h b/engines/sci/graphics/gfx.h
index 75750544f1..c6edd36ec8 100644
--- a/engines/sci/graphics/gui_gfx.h
+++ b/engines/sci/graphics/gfx.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef SCI_GUI_GFX_H
-#define SCI_GUI_GFX_H
+#ifndef SCI_GRAPHICS_GFX_H
+#define SCI_GRAPHICS_GFX_H
#include "sci/graphics/gui.h"
@@ -38,30 +38,30 @@ namespace Sci {
#define MAX_CACHED_VIEWS 50
-class SciGuiScreen;
-class SciGuiPalette;
-class SciGuiFont;
+class Screen;
+class SciPalette;
+class Font;
class SciGuiPicture;
-class SciGuiView;
+class View;
-typedef Common::HashMap<int, SciGuiView *> ViewCache;
+typedef Common::HashMap<int, View *> ViewCache;
-class SciGuiGfx {
+class Gfx {
public:
- SciGuiGfx(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, SciGuiScreen *screen, SciGuiPalette *palette);
- ~SciGuiGfx();
+ Gfx(ResourceManager *resMan, SegManager *segMan, Kernel *kernel, Screen *screen, SciPalette *palette);
+ ~Gfx();
- void init(SciGuiText *text);
+ void init(Text *text);
byte *GetSegment(byte seg);
void ResetScreen();
- GuiPort *SetPort(GuiPort *port);
- GuiPort *GetPort();
+ Port *SetPort(Port *port);
+ Port *GetPort();
void SetOrigin(int16 left, int16 top);
void MoveTo(int16 left, int16 top);
void Move(int16 left, int16 top);
- void OpenPort(GuiPort *port);
+ void OpenPort(Port *port);
void PenColor(int16 color);
void BackColor(int16 color);
void PenMode(int16 mode);
@@ -78,15 +78,15 @@ public:
void OffsetLine(Common::Point &start, Common::Point &end);
void BitsShow(const Common::Rect &r);
- GuiMemoryHandle BitsSave(const Common::Rect &rect, byte screenFlags);
- void BitsGetRect(GuiMemoryHandle memoryHandle, Common::Rect *destRect);
- void BitsRestore(GuiMemoryHandle memoryHandle);
- void BitsFree(GuiMemoryHandle memoryHandle);
+ MemoryHandle BitsSave(const Common::Rect &rect, byte screenFlags);
+ void BitsGetRect(MemoryHandle memoryHandle, Common::Rect *destRect);
+ void BitsRestore(MemoryHandle memoryHandle);
+ void BitsFree(MemoryHandle memoryHandle);
void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
- void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight = -1);
- void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
- void drawCel(SciGuiView *view, GuiViewLoopNo loopNo, GuiViewCelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
+ void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight = -1);
+ void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
+ void drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo);
uint16 onControl(uint16 screenMask, Common::Rect rect);
@@ -99,11 +99,11 @@ public:
void SetNowSeen(reg_t objectReference);
- GuiPort *_menuPort;
+ Port *_menuPort;
Common::Rect _menuBarRect;
- GuiPort *_curPort;
+ Port *_curPort;
- SciGuiView *getView(GuiResourceId viewNum);
+ View *getView(GuiResourceId viewNum);
private:
void purgeCache();
@@ -111,12 +111,12 @@ private:
ResourceManager *_resMan;
SegManager *_segMan;
Kernel *_kernel;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
- SciGuiText *_text;
+ Screen *_screen;
+ SciPalette *_palette;
+ Text *_text;
Common::Rect _bounds;
- GuiPort *_mainPort;
+ Port *_mainPort;
// Priority Bands related variables
int16 _priorityTop, _priorityBottom, _priorityBandCount;
diff --git a/engines/sci/graphics/gui.cpp b/engines/sci/graphics/gui.cpp
index ee1543995b..8931459a26 100644
--- a/engines/sci/graphics/gui.cpp
+++ b/engines/sci/graphics/gui.cpp
@@ -31,35 +31,35 @@
#include "sci/event.h"
#include "sci/engine/state.h"
#include "sci/graphics/gui.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_cursor.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_windowmgr.h"
-#include "sci/graphics/gui_animate.h"
-#include "sci/graphics/gui_controls.h"
-#include "sci/graphics/gui_menu.h"
-#include "sci/graphics/gui_text.h"
-#include "sci/graphics/gui_transitions.h"
-#include "sci/graphics/gui_view.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/cursor.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/windowmgr.h"
+#include "sci/graphics/animate.h"
+#include "sci/graphics/controls.h"
+#include "sci/graphics/menu.h"
+#include "sci/graphics/text.h"
+#include "sci/graphics/transitions.h"
+#include "sci/graphics/view.h"
namespace Sci {
// for debug purposes
// class SciGui32 : public SciGui {
// public:
-// SciGui32(EngineState *s, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor);
+// SciGui32(EngineState *s, Screen *screen, SciPalette *palette, Cursor *cursor);
// ~SciGui32();
// };
-SciGui::SciGui(EngineState *state, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor)
+SciGui::SciGui(EngineState *state, Screen *screen, SciPalette *palette, Cursor *cursor)
: _s(state), _screen(screen), _palette(palette), _cursor(cursor) {
- _gfx = new SciGuiGfx(_s->resMan, _s->_segMan, _s->_kernel, _screen, _palette);
- _transitions = new SciGuiTransitions(this, _screen, _palette, _s->resMan->isVGA());
+ _gfx = new Gfx(_s->resMan, _s->_segMan, _s->_kernel, _screen, _palette);
+ _transitions = new Transitions(this, _screen, _palette, _s->resMan->isVGA());
_animate = new SciGuiAnimate(_s, _gfx, _screen, _palette);
- _text = new SciGuiText(_s->resMan, _gfx, _screen);
- _windowMgr = new SciGuiWindowMgr(this, _screen, _gfx, _text);
+ _text = new Text(_s->resMan, _gfx, _screen);
+ _windowMgr = new WindowMgr(this, _screen, _gfx, _text);
_controls = new SciGuiControls(_s->_segMan, _gfx, _text);
_menu = new SciGuiMenu(_s->_event, _s->_segMan, _gfx, _text, _screen, _cursor);
// _gui32 = new SciGui32(_s, _screen, _palette, _cursor); // for debug purposes
@@ -142,13 +142,13 @@ reg_t SciGui::getPort() {
}
void SciGui::globalToLocal(int16 *x, int16 *y) {
- GuiPort *curPort = _gfx->GetPort();
+ Port *curPort = _gfx->GetPort();
*x = *x - curPort->left;
*y = *y - curPort->top;
}
void SciGui::localToGlobal(int16 *x, int16 *y) {
- GuiPort *curPort = _gfx->GetPort();
+ Port *curPort = _gfx->GetPort();
*x = *x + curPort->left;
*y = *y + curPort->top;
}
@@ -162,7 +162,7 @@ int16 SciGui::priorityToCoordinate(int16 priority) {
}
reg_t SciGui::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 style, int16 priority, int16 colorPen, int16 colorBack, const char *title) {
- GuiWindow *wnd = NULL;
+ Window *wnd = NULL;
if (restoreRect.top != 0 && restoreRect.left != 0 && restoreRect.height() != 0 && restoreRect.width() != 0)
wnd = _windowMgr->NewWindow(dims, &restoreRect, title, style, priority, false);
@@ -176,7 +176,7 @@ reg_t SciGui::newWindow(Common::Rect dims, Common::Rect restoreRect, uint16 styl
}
void SciGui::disposeWindow(uint16 windowPtr, bool reanimate) {
- GuiWindow *wnd = (GuiWindow *)_windowMgr->getPortById(windowPtr);
+ Window *wnd = (Window *)_windowMgr->getPortById(windowPtr);
_windowMgr->DisposeWindow(wnd, reanimate);
}
@@ -193,13 +193,13 @@ void SciGui::disposeWindow(uint16 windowPtr, bool reanimate) {
void SciGui::display(const char *text, int argc, reg_t *argv) {
int displayArg;
- GuiTextAlignment alignment = SCI_TEXT_ALIGNMENT_LEFT;
+ TextAlignment alignment = SCI_TEXT_ALIGNMENT_LEFT;
int16 bgcolor = -1, width = -1, bRedraw = 1;
bool doSaveUnder = false;
Common::Rect rect;
// Make a "backup" of the port settings
- GuiPort oldPort = *_gfx->GetPort();
+ Port oldPort = *_gfx->GetPort();
// setting defaults
_gfx->PenMode(0);
@@ -274,7 +274,7 @@ void SciGui::display(const char *text, int argc, reg_t *argv) {
if (_screen->_picNotValid == 0 && bRedraw)
_gfx->BitsShow(rect);
// restoring port and cursor pos
- GuiPort *currport = _gfx->GetPort();
+ Port *currport = _gfx->GetPort();
uint16 tTop = currport->curTop;
uint16 tLeft = currport->curLeft;
*currport = oldPort;
@@ -300,7 +300,7 @@ void SciGui::textColors(int argc, reg_t *argv) {
}
void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) {
- GuiPort *oldPort = _gfx->SetPort(_gfx->_menuPort);
+ Port *oldPort = _gfx->SetPort(_gfx->_menuPort);
_gfx->FillRect(_gfx->_menuBarRect, 1, colorBack);
_gfx->PenColor(colorPen);
@@ -313,7 +313,7 @@ void SciGui::drawStatus(const char *text, int16 colorPen, int16 colorBack) {
void SciGui::drawMenuBar(bool clear) {
if (!clear) {
- GuiPort *oldPort = _gfx->SetPort(_gfx->_menuPort);
+ Port *oldPort = _gfx->SetPort(_gfx->_menuPort);
_menu->drawBar();
if (_screen->_picNotValid == 0)
_gfx->BitsShow(_gfx->_menuBarRect);
@@ -345,7 +345,7 @@ reg_t SciGui::menuSelect(reg_t eventObject) {
}
void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo) {
- GuiPort *oldPort = _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+ Port *oldPort = _gfx->SetPort((Port *)_windowMgr->_picWind);
if (_windowMgr->isFrontWindow(_windowMgr->_picWind)) {
_screen->_picNotValid = 1;
@@ -359,7 +359,7 @@ void SciGui::drawPicture(GuiResourceId pictureId, int16 animationNr, bool animat
_gfx->SetPort(oldPort);
}
-void SciGui::drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
+void SciGui::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
_gfx->drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, origHeight);
_palette->setOnScreen();
}
@@ -392,7 +392,7 @@ void SciGui::drawControlButton(Common::Rect rect, reg_t obj, const char *text, i
}
}
-void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, GuiTextAlignment alignment, int16 style, bool hilite) {
+void SciGui::drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, TextAlignment alignment, int16 style, bool hilite) {
if (!hilite) {
rect.grow(1);
_gfx->EraseRect(rect);
@@ -430,7 +430,7 @@ void SciGui::drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text,
_gfx->BitsShow(rect);
}
-void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool hilite) {
+void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 style, bool hilite) {
if (!hilite) {
_gfx->drawCel(viewId, loopNo, celNo, rect.left, rect.top, 255, 0);
if (style & 0x20) {
@@ -510,7 +510,7 @@ void SciGui::graphUpdateBox(Common::Rect rect) {
void SciGui::graphRedrawBox(Common::Rect rect) {
localToGlobal(&rect.left, &rect.top);
localToGlobal(&rect.right, &rect.bottom);
- GuiPort *oldPort = _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+ Port *oldPort = _gfx->SetPort((Port *)_windowMgr->_picWind);
globalToLocal(&rect.left, &rect.top);
globalToLocal(&rect.right, &rect.bottom);
@@ -596,7 +596,7 @@ void SciGui::shakeScreen(uint16 shakeCount, uint16 directions) {
}
uint16 SciGui::onControl(byte screenMask, Common::Rect rect) {
- GuiPort *oldPort = _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+ Port *oldPort = _gfx->SetPort((Port *)_windowMgr->_picWind);
uint16 result;
result = _gfx->onControl(screenMask, rect);
@@ -605,7 +605,7 @@ uint16 SciGui::onControl(byte screenMask, Common::Rect rect) {
}
void SciGui::animateShowPic() {
- GuiPort *picPort = _windowMgr->_picWind;
+ Port *picPort = _windowMgr->_picWind;
Common::Rect picRect = picPort->rect;
bool previousCursorState = _cursor->isVisible();
@@ -637,7 +637,7 @@ void SciGui::animate(reg_t listReference, bool cycle, int argc, reg_t *argv) {
return;
}
- GuiPort *oldPort = _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+ Port *oldPort = _gfx->SetPort((Port *)_windowMgr->_picWind);
_animate->disposeLastCast();
_animate->makeSortedList(list);
@@ -670,7 +670,7 @@ void SciGui::addToPicSetPicNotValid() {
void SciGui::addToPicList(reg_t listReference, int argc, reg_t *argv) {
List *list;
- _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+ _gfx->SetPort((Port *)_windowMgr->_picWind);
list = _s->_segMan->lookupList(listReference);
if (!list)
@@ -682,8 +682,8 @@ void SciGui::addToPicList(reg_t listReference, int argc, reg_t *argv) {
addToPicSetPicNotValid();
}
-void SciGui::addToPicView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
- _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+void SciGui::addToPicView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
+ _gfx->SetPort((Port *)_windowMgr->_picWind);
_animate->addToPicDrawView(viewId, loopNo, celNo, leftPos, topPos, priority, control);
addToPicSetPicNotValid();
}
@@ -693,7 +693,7 @@ void SciGui::setNowSeen(reg_t objectReference) {
}
bool SciGui::canBeHere(reg_t curObject, reg_t listReference) {
- GuiPort *oldPort = _gfx->SetPort((GuiPort *)_windowMgr->_picWind);
+ Port *oldPort = _gfx->SetPort((Port *)_windowMgr->_picWind);
Common::Rect checkRect;
uint16 signal, controlMask;
bool result;
@@ -717,8 +717,8 @@ bool SciGui::canBeHere(reg_t curObject, reg_t listReference) {
}
bool SciGui::isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position) {
- SciGuiView *tmpView = _gfx->getView(viewId);
- sciViewCelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
+ View *tmpView = _gfx->getView(viewId);
+ CelInfo *celInfo = tmpView->getCelInfo(loopNo, celNo);
position.x = CLIP<int>(position.x, 0, celInfo->width - 1);
position.y = CLIP<int>(position.y, 0, celInfo->height - 1);
byte *celData = tmpView->getBitmap(loopNo, celNo);
@@ -733,10 +733,10 @@ void SciGui::baseSetter(reg_t object) {
int16 z = (_s->_kernel->_selectorCache.z > -1) ? GET_SEL32V(_s->_segMan, object, z) : 0;
int16 yStep = GET_SEL32V(_s->_segMan, object, yStep);
GuiResourceId viewId = GET_SEL32V(_s->_segMan, object, view);
- GuiViewLoopNo loopNo = GET_SEL32V(_s->_segMan, object, loop);
- GuiViewCelNo celNo = GET_SEL32V(_s->_segMan, object, cel);
+ LoopNo loopNo = GET_SEL32V(_s->_segMan, object, loop);
+ CelNo celNo = GET_SEL32V(_s->_segMan, object, cel);
- SciGuiView *tmpView = _gfx->getView(viewId);
+ View *tmpView = _gfx->getView(viewId);
Common::Rect celRect;
tmpView->getCelRect(loopNo, celNo, x, y, z, &celRect);
diff --git a/engines/sci/graphics/gui.h b/engines/sci/graphics/gui.h
index 1411a2eac6..db25698fe1 100644
--- a/engines/sci/graphics/gui.h
+++ b/engines/sci/graphics/gui.h
@@ -23,10 +23,10 @@
*
*/
-#ifndef SCI_GUI_GUI_H
-#define SCI_GUI_GUI_H
+#ifndef SCI_GRAPHICS_GUI_H
+#define SCI_GRAPHICS_GUI_H
-#include "sci/graphics/gui_helpers.h"
+#include "sci/graphics/helpers.h"
namespace Sci {
@@ -41,21 +41,21 @@ enum {
SCI_CONTROLS_TYPE_DUMMY = 10
};
-class SciGuiScreen;
-class SciGuiPalette;
-class SciGuiCursor;
-class SciGuiGfx;
-class SciGuiWindowMgr;
+class Screen;
+class SciPalette;
+class Cursor;
+class Gfx;
+class WindowMgr;
class SciGuiAnimate;
class SciGuiControls;
class SciGuiMenu;
-class SciGuiText;
-class SciGuiTransitions;
+class Text;
+class Transitions;
class SciGui32; // for debug purposes
class SciGui {
public:
- SciGui(EngineState *s, SciGuiScreen *screen, SciGuiPalette *palette, SciGuiCursor *cursor);
+ SciGui(EngineState *s, Screen *screen, SciPalette *palette, Cursor *cursor);
SciGui();
virtual ~SciGui();
@@ -89,11 +89,11 @@ public:
virtual reg_t menuSelect(reg_t eventObject);
virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
- virtual void drawCel(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
+ virtual void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
virtual void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite);
virtual void drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite);
- virtual void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 style, bool hilite);
+ virtual void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 style, bool hilite);
virtual void drawControlList(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);
virtual void editControl(reg_t controlObject, reg_t eventObject);
@@ -125,7 +125,7 @@ public:
virtual void animateShowPic();
virtual void animate(reg_t listReference, bool cycle, int argc, reg_t *argv);
virtual void addToPicList(reg_t listReference, int argc, reg_t *argv);
- virtual void addToPicView(GuiResourceId viewId, GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
+ virtual void addToPicView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
virtual void setNowSeen(reg_t objectReference);
virtual bool canBeHere(reg_t curObject, reg_t listReference);
virtual bool isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);
@@ -170,23 +170,23 @@ public:
virtual void resetEngineState(EngineState *s);
protected:
- SciGuiCursor *_cursor;
+ Cursor *_cursor;
EngineState *_s;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
- SciGuiGfx *_gfx;
+ Screen *_screen;
+ SciPalette *_palette;
+ Gfx *_gfx;
private:
virtual void initPriorityBands();
virtual void addToPicSetPicNotValid();
virtual int getControlPicNotValid();
- SciGuiWindowMgr *_windowMgr;
+ WindowMgr *_windowMgr;
SciGuiAnimate *_animate;
SciGuiControls *_controls;
SciGuiMenu *_menu;
- SciGuiText *_text;
- SciGuiTransitions *_transitions;
+ Text *_text;
+ Transitions *_transitions;
// SciGui32 *_gui32; // for debug purposes
bool _usesOldGfxFunctions;
diff --git a/engines/sci/graphics/gui_helpers.h b/engines/sci/graphics/helpers.h
index 554282e312..27fa3f0b69 100644
--- a/engines/sci/graphics/gui_helpers.h
+++ b/engines/sci/graphics/helpers.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef SCI_GUI_HELPERS_H
-#define SCI_GUI_HELPERS_H
+#ifndef SCI_GRAPHICS_HELPERS_H
+#define SCI_GRAPHICS_HELPERS_H
#include "common/endian.h" // for READ_LE_UINT16
#include "common/rect.h"
@@ -36,13 +36,13 @@ namespace Sci {
#define SCI_SHAKE_DIRECTION_HORIZONTAL 2
typedef int GuiResourceId; // is a resource-number and -1 means no parameter given
-typedef reg_t GuiMemoryHandle;
-typedef int16 GuiViewLoopNo;
-typedef int16 GuiViewCelNo;
+typedef reg_t MemoryHandle;
+typedef int16 LoopNo;
+typedef int16 CelNo;
-typedef int16 GuiTextAlignment;
+typedef int16 TextAlignment;
-struct GuiPort {
+struct Port {
uint16 id;
int16 top, left;
Common::Rect rect;
@@ -53,14 +53,14 @@ struct GuiPort {
int16 penClr, backClr;
int16 penMode;
- GuiPort(uint16 theId) : id(theId), top(0), left(0),
+ Port(uint16 theId) : id(theId), top(0), left(0),
curTop(0), curLeft(0),
fontHeight(0), fontId(0), greyedOutput(false),
penClr(0), backClr(0xFF), penMode(0) {
}
};
-struct GuiWindow : public GuiPort {
+struct Window : public Port {
Common::Rect dims; // client area of window
Common::Rect restoreRect; // total area of window including borders
uint16 wndStyle;
@@ -70,41 +70,41 @@ struct GuiWindow : public GuiPort {
Common::String title;
bool bDrawn;
- GuiWindow(uint16 theId) : GuiPort(theId),
+ Window(uint16 theId) : Port(theId),
wndStyle(0), saveScreenMask(0),
hSaved1(NULL_REG), hSaved2(NULL_REG),
bDrawn(false) {
}
};
-struct GuiAnimateEntry {
+struct AnimateEntry {
reg_t object;
GuiResourceId viewId;
- GuiViewLoopNo loopNo;
- GuiViewCelNo celNo;
+ LoopNo loopNo;
+ CelNo celNo;
int16 paletteNo;
int16 x, y, z;
int16 priority;
uint16 signal;
Common::Rect celRect;
bool showBitsFlag;
- GuiMemoryHandle castHandle;
+ MemoryHandle castHandle;
};
-typedef Common::List<GuiAnimateEntry *> GuiAnimateList;
+typedef Common::List<AnimateEntry *> AnimateList;
-struct GuiColor {
+struct Color {
byte used;
byte r, g, b;
};
-struct GuiPalette {
+struct Palette {
byte mapping[256];
uint32 timestamp;
- GuiColor colors[256];
+ Color colors[256];
byte intensity[256];
};
-struct GuiPalSchedule {
+struct PalSchedule {
byte from;
uint32 schedule;
};
diff --git a/engines/sci/graphics/gui_menu.cpp b/engines/sci/graphics/menu.cpp
index e5ca8be68f..719b52fec1 100644
--- a/engines/sci/graphics/gui_menu.cpp
+++ b/engines/sci/graphics/menu.cpp
@@ -30,17 +30,17 @@
#include "sci/sci.h"
#include "sci/event.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_helpers.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_cursor.h"
-#include "sci/graphics/gui_font.h"
-#include "sci/graphics/gui_text.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_menu.h"
+#include "sci/graphics/helpers.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/cursor.h"
+#include "sci/graphics/font.h"
+#include "sci/graphics/text.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/menu.h"
namespace Sci {
-SciGuiMenu::SciGuiMenu(SciEvent *event, SegManager *segMan, SciGuiGfx *gfx, SciGuiText *text, SciGuiScreen *screen, SciGuiCursor *cursor)
+SciGuiMenu::SciGuiMenu(SciEvent *event, SegManager *segMan, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor)
: _event(event), _segMan(segMan), _gfx(gfx), _text(text), _screen(screen), _cursor(cursor) {
_listCount = 0;
diff --git a/engines/sci/graphics/gui_menu.h b/engines/sci/graphics/menu.h
index a396378dc0..590c40e2e4 100644
--- a/engines/sci/graphics/gui_menu.h
+++ b/engines/sci/graphics/menu.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef SCI_GUI_MENU_H
-#define SCI_GUI_MENU_H
+#ifndef SCI_GRAPHICS_MENU_H
+#define SCI_GRAPHICS_MENU_H
namespace Sci {
@@ -78,7 +78,7 @@ typedef Common::List<GuiMenuItemEntry *> GuiMenuItemList;
class SciGuiMenu {
public:
- SciGuiMenu(SciEvent *event, SegManager *segMan, SciGuiGfx *gfx, SciGuiText *text, SciGuiScreen *screen, SciGuiCursor *cursor);
+ SciGuiMenu(SciEvent *event, SegManager *segMan, Gfx *gfx, Text *text, Screen *screen, Cursor *cursor);
~SciGuiMenu();
void reset();
@@ -100,10 +100,10 @@ private:
SciEvent *_event;
SegManager *_segMan;
- SciGuiGfx *_gfx;
- SciGuiText *_text;
- SciGuiScreen *_screen;
- SciGuiCursor *_cursor;
+ Gfx *_gfx;
+ Text *_text;
+ Screen *_screen;
+ Cursor *_cursor;
uint16 _listCount;
GuiMenuList _list;
@@ -112,9 +112,9 @@ private:
uint16 _curMenuId;
uint16 _curItemId;
- GuiPort *_oldPort;
- GuiMemoryHandle _barSaveHandle;
- GuiMemoryHandle _menuSaveHandle;
+ Port *_oldPort;
+ MemoryHandle _barSaveHandle;
+ MemoryHandle _menuSaveHandle;
Common::Rect _menuRect;
};
diff --git a/engines/sci/graphics/gui_palette.cpp b/engines/sci/graphics/palette.cpp
index 8e1eea4409..ed2fa0c003 100644
--- a/engines/sci/graphics/gui_palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -28,12 +28,12 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_palette.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
namespace Sci {
-SciGuiPalette::SciGuiPalette(ResourceManager *resMan, SciGuiScreen *screen, bool autoSetPalette)
+SciPalette::SciPalette(ResourceManager *resMan, Screen *screen, bool autoSetPalette)
: _resMan(resMan), _screen(screen) {
int16 color;
@@ -63,20 +63,20 @@ SciGuiPalette::SciGuiPalette(ResourceManager *resMan, SciGuiScreen *screen, bool
}
}
-SciGuiPalette::~SciGuiPalette() {
+SciPalette::~SciPalette() {
}
#define SCI_PAL_FORMAT_CONSTANT 1
#define SCI_PAL_FORMAT_VARIABLE 0
-void SciGuiPalette::createFromData(byte *data, GuiPalette *paletteOut) {
+void SciPalette::createFromData(byte *data, Palette *paletteOut) {
int palFormat = 0;
int palOffset = 0;
int palColorStart = 0;
int palColorCount = 0;
int colorNo = 0;
- memset(paletteOut, 0, sizeof(GuiPalette));
+ memset(paletteOut, 0, sizeof(Palette));
// Setup default mapping
for (colorNo = 0; colorNo < 256; colorNo++) {
paletteOut->mapping[colorNo] = colorNo;
@@ -115,7 +115,7 @@ void SciGuiPalette::createFromData(byte *data, GuiPalette *paletteOut) {
// Will try to set amiga palette by using "spal" file. If not found, we return false
-bool SciGuiPalette::setAmiga() {
+bool SciPalette::setAmiga() {
Common::File file;
int curColor, byte1, byte2;
@@ -137,7 +137,7 @@ bool SciGuiPalette::setAmiga() {
return false;
}
-void SciGuiPalette::setEGA() {
+void SciPalette::setEGA() {
int i;
byte color1, color2;
_sysPalette.colors[1].r = 0x000; _sysPalette.colors[1].g = 0x000; _sysPalette.colors[1].b = 0x0AA;
@@ -170,9 +170,9 @@ void SciGuiPalette::setEGA() {
setOnScreen();
}
-bool SciGuiPalette::setFromResource(GuiResourceId resourceId, uint16 flag) {
+bool SciPalette::setFromResource(GuiResourceId resourceId, uint16 flag) {
Resource *palResource = _resMan->findResource(ResourceId(kResourceTypePalette, resourceId), 0);
- GuiPalette palette;
+ Palette palette;
if (palResource) {
createFromData(palResource->data, &palette);
@@ -182,7 +182,7 @@ bool SciGuiPalette::setFromResource(GuiResourceId resourceId, uint16 flag) {
return false;
}
-void SciGuiPalette::set(GuiPalette *sciPal, uint16 flag) {
+void SciPalette::set(Palette *sciPal, uint16 flag) {
uint32 systime = _sysPalette.timestamp;
if (flag == 2 || sciPal->timestamp != systime) {
merge(sciPal, &_sysPalette, flag);
@@ -192,7 +192,7 @@ void SciGuiPalette::set(GuiPalette *sciPal, uint16 flag) {
}
}
-void SciGuiPalette::merge(GuiPalette *pFrom, GuiPalette *pTo, uint16 flag) {
+void SciPalette::merge(Palette *pFrom, Palette *pTo, uint16 flag) {
uint16 res;
int i,j;
// colors 0 (black) and 255 (white) are not affected by merging
@@ -240,7 +240,7 @@ void SciGuiPalette::merge(GuiPalette *pFrom, GuiPalette *pTo, uint16 flag) {
pTo->timestamp = g_system->getMillis() * 60 / 1000;
}
-uint16 SciGuiPalette::matchColor(GuiPalette *pPal, byte r, byte g, byte b) {
+uint16 SciPalette::matchColor(Palette *pPal, byte r, byte g, byte b) {
byte found = 0xFF;
int diff = 0x2FFFF, cdiff;
int16 dr,dg,db;
@@ -265,40 +265,40 @@ uint16 SciGuiPalette::matchColor(GuiPalette *pPal, byte r, byte g, byte b) {
return found;
}
-void SciGuiPalette::getSys(GuiPalette *pal) {
+void SciPalette::getSys(Palette *pal) {
if (pal != &_sysPalette)
- memcpy(pal, &_sysPalette,sizeof(GuiPalette));
+ memcpy(pal, &_sysPalette,sizeof(Palette));
}
-void SciGuiPalette::setOnScreen() {
+void SciPalette::setOnScreen() {
// if (pal != &_sysPalette)
-// memcpy(&_sysPalette,pal,sizeof(GuiPalette));
+// memcpy(&_sysPalette,pal,sizeof(Palette));
_screen->setPalette(&_sysPalette);
}
-void SciGuiPalette::setFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
+void SciPalette::setFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
uint16 colorNr;
for (colorNr = fromColor; colorNr < toColor; colorNr++) {
_sysPalette.colors[colorNr].used |= flag;
}
}
-void SciGuiPalette::unsetFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
+void SciPalette::unsetFlag(uint16 fromColor, uint16 toColor, uint16 flag) {
uint16 colorNr;
for (colorNr = fromColor; colorNr < toColor; colorNr++) {
_sysPalette.colors[colorNr].used &= ~flag;
}
}
-void SciGuiPalette::setIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette) {
+void SciPalette::setIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette) {
memset(&_sysPalette.intensity[0] + fromColor, intensity, toColor - fromColor);
if (setPalette)
setOnScreen();
}
// Returns true, if palette got changed
-bool SciGuiPalette::animate(byte fromColor, byte toColor, int speed) {
- GuiColor col;
+bool SciPalette::animate(byte fromColor, byte toColor, int speed) {
+ Color col;
//byte colorNr;
int16 colorCount;
uint32 now = g_system->getMillis() * 60 / 1000;
@@ -313,7 +313,7 @@ bool SciGuiPalette::animate(byte fromColor, byte toColor, int speed) {
}
if (scheduleNr == scheduleCount) {
// adding a new schedule
- GuiPalSchedule newSchedule;
+ PalSchedule newSchedule;
newSchedule.from = fromColor;
newSchedule.schedule = now + ABS(speed);
_schedules.push_back(newSchedule);
@@ -328,14 +328,14 @@ bool SciGuiPalette::animate(byte fromColor, byte toColor, int speed) {
col = _sysPalette.colors[fromColor];
if (fromColor < toColor) {
colorCount = toColor - fromColor - 1;
- memmove(&_sysPalette.colors[fromColor], &_sysPalette.colors[fromColor + 1], colorCount * sizeof(GuiColor));
+ memmove(&_sysPalette.colors[fromColor], &_sysPalette.colors[fromColor + 1], colorCount * sizeof(Color));
}
_sysPalette.colors[toColor - 1] = col;
} else {
col = _sysPalette.colors[toColor - 1];
if (fromColor < toColor) {
colorCount = toColor - fromColor - 1;
- memmove(&_sysPalette.colors[fromColor + 1], &_sysPalette.colors[fromColor], colorCount * sizeof(GuiColor));
+ memmove(&_sysPalette.colors[fromColor + 1], &_sysPalette.colors[fromColor], colorCount * sizeof(Color));
}
_sysPalette.colors[fromColor] = col;
}
diff --git a/engines/sci/graphics/gui_palette.h b/engines/sci/graphics/palette.h
index d785e418e1..94f5007468 100644
--- a/engines/sci/graphics/gui_palette.h
+++ b/engines/sci/graphics/palette.h
@@ -23,27 +23,27 @@
*
*/
-#ifndef SCI_GUI_PALETTE_H
-#define SCI_GUI_PALETTE_H
+#ifndef SCI_GRAPHICS_PALETTE_H
+#define SCI_GRAPHICS_PALETTE_H
-#include "sci/graphics/gui_helpers.h"
+#include "sci/graphics/helpers.h"
namespace Sci {
-class SciGuiScreen;
-class SciGuiPalette {
+class Screen;
+class SciPalette {
public:
- SciGuiPalette(ResourceManager *resMan, SciGuiScreen *screen, bool autoSetPalette = true);
- ~SciGuiPalette();
+ SciPalette(ResourceManager *resMan, Screen *screen, bool autoSetPalette = true);
+ ~SciPalette();
- void createFromData(byte *data, GuiPalette *paletteOut);
+ void createFromData(byte *data, Palette *paletteOut);
bool setAmiga();
void setEGA();
bool setFromResource(GuiResourceId resourceId, uint16 flag);
- void set(GuiPalette *sciPal, uint16 flag);
- void merge(GuiPalette *pFrom, GuiPalette *pTo, uint16 flag);
- uint16 matchColor(GuiPalette *pPal, byte r, byte g, byte b);
- void getSys(GuiPalette *pal);
+ void set(Palette *sciPal, uint16 flag);
+ void merge(Palette *pFrom, Palette *pTo, uint16 flag);
+ uint16 matchColor(Palette *pPal, byte r, byte g, byte b);
+ void getSys(Palette *pal);
void setOnScreen();
@@ -52,13 +52,13 @@ public:
void setIntensity(uint16 fromColor, uint16 toColor, uint16 intensity, bool setPalette);
bool animate(byte fromColor, byte toColor, int speed);
- GuiPalette _sysPalette;
+ Palette _sysPalette;
private:
- SciGuiScreen *_screen;
+ Screen *_screen;
ResourceManager *_resMan;
- Common::Array<GuiPalSchedule> _schedules;
+ Common::Array<PalSchedule> _schedules;
};
} // End of namespace Sci
diff --git a/engines/sci/graphics/gui_picture.cpp b/engines/sci/graphics/picture.cpp
index 8505233a2c..a86fffcb0a 100644
--- a/engines/sci/graphics/gui_picture.cpp
+++ b/engines/sci/graphics/picture.cpp
@@ -26,14 +26,14 @@
#include "common/stack.h"
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_picture.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/picture.h"
namespace Sci {
-SciGuiPicture::SciGuiPicture(ResourceManager *resMan, SciGuiGfx *gfx, SciGuiScreen *screen, SciGuiPalette *palette, GuiResourceId resourceId)
+SciGuiPicture::SciGuiPicture(ResourceManager *resMan, Gfx *gfx, Screen *screen, SciPalette *palette, GuiResourceId resourceId)
: _resMan(resMan), _gfx(gfx), _screen(screen), _palette(palette), _resourceId(resourceId) {
assert(resourceId != -1);
initData(resourceId);
@@ -98,7 +98,7 @@ void SciGuiPicture::drawSci11Vga() {
int cel_headerPos = READ_LE_UINT16(inbuffer + 32);
int cel_RlePos = READ_LE_UINT16(inbuffer + cel_headerPos + 24);
int cel_LiteralPos = READ_LE_UINT16(inbuffer + cel_headerPos + 28);
- GuiPalette palette;
+ Palette palette;
// Create palette and set it
_palette->createFromData(inbuffer + palette_data_ptr, &palette);
@@ -122,7 +122,7 @@ void SciGuiPicture::drawSci32Vga() {
int cel_headerPos = header_size;
int cel_RlePos = READ_LE_UINT16(inbuffer + cel_headerPos + 24);
int cel_LiteralPos = READ_LE_UINT16(inbuffer + cel_headerPos + 28);
- GuiPalette palette;
+ Palette palette;
// Create palette and set it
_palette->createFromData(inbuffer + palette_data_ptr, &palette);
@@ -371,7 +371,7 @@ void SciGuiPicture::drawVectorData(byte *data, int dataSize) {
uint16 size;
byte pixel;
int i;
- GuiPalette palette;
+ Palette palette;
int16 pattern_Code = 0, pattern_Texture = 0;
memset(&palette, 0, sizeof(palette));
@@ -647,7 +647,7 @@ void SciGuiPicture::vectorGetPatternTexture(byte *data, int &curPos, int16 patte
// Do not replace w/ some generic code. This algo really needs to behave exactly as the one from sierra
void SciGuiPicture::vectorFloodFill(int16 x, int16 y, byte color, byte priority, byte control) {
- GuiPort *curPort = _gfx->GetPort();
+ Port *curPort = _gfx->GetPort();
Common::Stack<Common::Point> stack;
Common::Point p, p1;
byte screenMask = _screen->getDrawingMask(color, priority, control);
diff --git a/engines/sci/graphics/gui_picture.h b/engines/sci/graphics/picture.h
index 4c3283c53b..fcab244a36 100644
--- a/engines/sci/graphics/gui_picture.h
+++ b/engines/sci/graphics/picture.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef SCI_GUI_PICTURE_H
-#define SCI_GUI_PICTURE_H
+#ifndef SCI_GRAPHICS_PICTURE_H
+#define SCI_GRAPHICS_PICTURE_H
namespace Sci {
@@ -34,7 +34,7 @@ namespace Sci {
class SciGuiPicture {
public:
- SciGuiPicture(ResourceManager *resMan, SciGuiGfx *gfx, SciGuiScreen *screen, SciGuiPalette *palette, GuiResourceId resourceId);
+ SciGuiPicture(ResourceManager *resMan, Gfx *gfx, Screen *screen, SciPalette *palette, GuiResourceId resourceId);
~SciGuiPicture();
GuiResourceId getResourceId();
@@ -63,9 +63,9 @@ private:
void vectorPatternTexturedCircle(Common::Rect box, byte size, byte color, byte prio, byte control, byte texture);
ResourceManager *_resMan;
- SciGuiGfx *_gfx;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
+ Gfx *_gfx;
+ Screen *_screen;
+ SciPalette *_palette;
int16 _resourceId;
Resource *_resource;
diff --git a/engines/sci/graphics/gui_portrait.cpp b/engines/sci/graphics/portrait.cpp
index de3da9bc84..e348ec2dda 100644
--- a/engines/sci/graphics/gui_portrait.cpp
+++ b/engines/sci/graphics/portrait.cpp
@@ -29,21 +29,21 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_portrait.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/portrait.h"
namespace Sci {
-SciGuiPortrait::SciGuiPortrait(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, Common::String resourceName)
+Portrait::Portrait(ResourceManager *resMan, Screen *screen, SciPalette *palette, Common::String resourceName)
: _resMan(resMan), _screen(screen), _palette(palette), _resourceName(resourceName) {
init();
}
-SciGuiPortrait::~SciGuiPortrait() {
+Portrait::~Portrait() {
}
-void SciGuiPortrait::init() {
+void Portrait::init() {
// .BIN files are loaded from actors directory and from .\ directory
// header:
// 3 bytes "WIN"
diff --git a/engines/sci/graphics/gui_portrait.h b/engines/sci/graphics/portrait.h
index b97f3dd2a6..18a23ad189 100644
--- a/engines/sci/graphics/gui_portrait.h
+++ b/engines/sci/graphics/portrait.h
@@ -23,22 +23,22 @@
*
*/
-#ifndef SCI_GUI_PORTRAITS_H
-#define SCI_GUI_PORTRAITS_H
+#ifndef SCI_GRAPHICS_PORTRAITS_H
+#define SCI_GRAPHICS_PORTRAITS_H
namespace Sci {
-class SciGuiPortrait {
+class Portrait {
public:
- SciGuiPortrait(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, Common::String resourceName);
- ~SciGuiPortrait();
+ Portrait(ResourceManager *resMan, Screen *screen, SciPalette *palette, Common::String resourceName);
+ ~Portrait();
private:
void init();
ResourceManager *_resMan;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
+ Screen *_screen;
+ SciPalette *_palette;
Common::String _resourceName;
byte *_resourceData;
diff --git a/engines/sci/graphics/gui_screen.cpp b/engines/sci/graphics/screen.cpp
index 13f969e55f..fce6827d43 100644
--- a/engines/sci/graphics/gui_screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -29,11 +29,11 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/screen.h"
namespace Sci {
-SciGuiScreen::SciGuiScreen(ResourceManager *resMan, int16 width, int16 height, bool upscaledHires) :
+Screen::Screen(ResourceManager *resMan, int16 width, int16 height, bool upscaledHires) :
_resMan(resMan), _width(width), _height(height), _upscaledHires(upscaledHires) {
_pixels = _width * _height;
@@ -73,25 +73,25 @@ SciGuiScreen::SciGuiScreen(ResourceManager *resMan, int16 width, int16 height, b
initGraphics(_displayWidth, _displayHeight, _displayWidth > 320);
}
-SciGuiScreen::~SciGuiScreen() {
+Screen::~Screen() {
free(_visualScreen);
free(_priorityScreen);
free(_controlScreen);
free(_displayScreen);
}
-void SciGuiScreen::copyToScreen() {
+void Screen::copyToScreen() {
g_system->copyRectToScreen(_activeScreen, _displayWidth, 0, 0, _displayWidth, _displayHeight);
}
-void SciGuiScreen::copyFromScreen(byte *buffer) {
+void Screen::copyFromScreen(byte *buffer) {
Graphics::Surface *screen;
screen = g_system->lockScreen();
memcpy(buffer, screen->pixels, _displayWidth * _displayHeight);
g_system->unlockScreen();
}
-void SciGuiScreen::copyRectToScreen(const Common::Rect &rect) {
+void Screen::copyRectToScreen(const Common::Rect &rect) {
if (!_upscaledHires) {
g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, rect.left, rect.top, rect.width(), rect.height());
} else {
@@ -99,7 +99,7 @@ void SciGuiScreen::copyRectToScreen(const Common::Rect &rect) {
}
}
-void SciGuiScreen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y) {
+void Screen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y) {
if (!_upscaledHires) {
g_system->copyRectToScreen(_activeScreen + rect.top * _displayWidth + rect.left, _displayWidth, x, y, rect.width(), rect.height());
} else {
@@ -107,7 +107,7 @@ void SciGuiScreen::copyRectToScreen(const Common::Rect &rect, int16 x, int16 y)
}
}
-byte SciGuiScreen::getDrawingMask(byte color, byte prio, byte control) {
+byte Screen::getDrawingMask(byte color, byte prio, byte control) {
byte flag = 0;
if (color != 255)
flag |= SCI_SCREEN_MASK_VISUAL;
@@ -118,7 +118,7 @@ byte SciGuiScreen::getDrawingMask(byte color, byte prio, byte control) {
return flag;
}
-void SciGuiScreen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) {
+void Screen::putPixel(int x, int y, byte drawMask, byte color, byte priority, byte control) {
int offset = y * _width + x;
if (drawMask & SCI_SCREEN_MASK_VISUAL) {
@@ -141,14 +141,14 @@ void SciGuiScreen::putPixel(int x, int y, byte drawMask, byte color, byte priori
// This will just change a pixel directly on displayscreen. Its supposed to get only used on upscaled-Hires games where
// hires content needs to get drawn ONTO the upscaled display screen (like japanese fonts, hires portraits, etc.)
-void SciGuiScreen::putPixelOnDisplay(int x, int y, byte color) {
+void Screen::putPixelOnDisplay(int x, int y, byte color) {
int offset = y * _width + x;
_displayScreen[offset] = color;
}
// Sierra's Bresenham line drawing
// WARNING: Do not just blindly replace this with Graphics::drawLine(), as it seems to create issues with flood fill
-void SciGuiScreen::drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte priority, byte control) {
+void Screen::drawLine(Common::Point startPoint, Common::Point endPoint, byte color, byte priority, byte control) {
int16 left = startPoint.x;
int16 top = startPoint.y;
int16 right = endPoint.x;
@@ -210,19 +210,19 @@ void SciGuiScreen::drawLine(Common::Point startPoint, Common::Point endPoint, by
}
}
-byte SciGuiScreen::getVisual(int x, int y) {
+byte Screen::getVisual(int x, int y) {
return _visualScreen[y * _width + x];
}
-byte SciGuiScreen::getPriority(int x, int y) {
+byte Screen::getPriority(int x, int y) {
return _priorityScreen[y * _width + x];
}
-byte SciGuiScreen::getControl(int x, int y) {
+byte Screen::getControl(int x, int y) {
return _controlScreen[y * _width + x];
}
-byte SciGuiScreen::isFillMatch(int16 x, int16 y, byte screenMask, byte t_color, byte t_pri, byte t_con) {
+byte Screen::isFillMatch(int16 x, int16 y, byte screenMask, byte t_color, byte t_pri, byte t_con) {
int offset = y * _width + x;
byte match = 0;
@@ -235,7 +235,7 @@ byte SciGuiScreen::isFillMatch(int16 x, int16 y, byte screenMask, byte t_color,
return match;
}
-int SciGuiScreen::bitsGetDataSize(Common::Rect rect, byte mask) {
+int Screen::bitsGetDataSize(Common::Rect rect, byte mask) {
int byteCount = sizeof(rect) + sizeof(mask);
int pixels = rect.width() * rect.height();
if (mask & SCI_SCREEN_MASK_VISUAL) {
@@ -261,7 +261,7 @@ int SciGuiScreen::bitsGetDataSize(Common::Rect rect, byte mask) {
return byteCount;
}
-void SciGuiScreen::bitsSave(Common::Rect rect, byte mask, byte *memoryPtr) {
+void Screen::bitsSave(Common::Rect rect, byte mask, byte *memoryPtr) {
memcpy(memoryPtr, (void *)&rect, sizeof(rect)); memoryPtr += sizeof(rect);
memcpy(memoryPtr, (void *)&mask, sizeof(mask)); memoryPtr += sizeof(mask);
@@ -282,7 +282,7 @@ void SciGuiScreen::bitsSave(Common::Rect rect, byte mask, byte *memoryPtr) {
}
}
-void SciGuiScreen::bitsSaveScreen(Common::Rect rect, byte *screen, byte *&memoryPtr) {
+void Screen::bitsSaveScreen(Common::Rect rect, byte *screen, byte *&memoryPtr) {
int width = rect.width();
int y;
@@ -294,7 +294,7 @@ void SciGuiScreen::bitsSaveScreen(Common::Rect rect, byte *screen, byte *&memory
}
}
-void SciGuiScreen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
+void Screen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
byte *screen = _displayScreen;
int width = rect.width();
int y;
@@ -313,11 +313,11 @@ void SciGuiScreen::bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
}
}
-void SciGuiScreen::bitsGetRect(byte *memoryPtr, Common::Rect *destRect) {
+void Screen::bitsGetRect(byte *memoryPtr, Common::Rect *destRect) {
memcpy((void *)destRect, memoryPtr, sizeof(Common::Rect));
}
-void SciGuiScreen::bitsRestore(byte *memoryPtr) {
+void Screen::bitsRestore(byte *memoryPtr) {
Common::Rect rect;
byte mask;
@@ -341,7 +341,7 @@ void SciGuiScreen::bitsRestore(byte *memoryPtr) {
}
}
-void SciGuiScreen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *screen) {
+void Screen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *screen) {
int width = rect.width();
int y;
@@ -353,7 +353,7 @@ void SciGuiScreen::bitsRestoreScreen(Common::Rect rect, byte *&memoryPtr, byte *
}
}
-void SciGuiScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
+void Screen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) {
byte *screen = _displayScreen;
int width = rect.width();
int y;
@@ -372,7 +372,7 @@ void SciGuiScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr)
}
}
-void SciGuiScreen::setPalette(GuiPalette*pal) {
+void Screen::setPalette(Palette*pal) {
// just copy palette to system
byte bpal[4 * 256];
// Get current palette, update it and put back
@@ -388,14 +388,14 @@ void SciGuiScreen::setPalette(GuiPalette*pal) {
g_system->setPalette(bpal, 0, 256);
}
-void SciGuiScreen::setVerticalShakePos(uint16 shakePos) {
+void Screen::setVerticalShakePos(uint16 shakePos) {
if (!_upscaledHires)
g_system->setShakePos(shakePos);
else
g_system->setShakePos(shakePos * 2);
}
-void SciGuiScreen::dither(bool addToFlag) {
+void Screen::dither(bool addToFlag) {
int y, x;
byte color, ditheredColor;
byte *visualPtr = _visualScreen;
@@ -461,18 +461,18 @@ void SciGuiScreen::dither(bool addToFlag) {
}
}
-void SciGuiScreen::unditherSetState(bool flag) {
+void Screen::unditherSetState(bool flag) {
_unditherState = flag;
}
-int16 *SciGuiScreen::unditherGetMemorial() {
+int16 *Screen::unditherGetMemorial() {
if (_unditherState)
return (int16 *)&_unditherMemorial;
else
return NULL;
}
-void SciGuiScreen::debugShowMap(int mapNo) {
+void Screen::debugShowMap(int mapNo) {
// We cannot really support changing maps when in upscaledHires mode
if (_upscaledHires)
return;
@@ -494,7 +494,7 @@ void SciGuiScreen::debugShowMap(int mapNo) {
copyToScreen();
}
-void SciGuiScreen::scale2x(byte *src, byte *dst, int16 srcWidth, int16 srcHeight) {
+void Screen::scale2x(byte *src, byte *dst, int16 srcWidth, int16 srcHeight) {
int newWidth = srcWidth * 2;
byte *srcPtr = src;
diff --git a/engines/sci/graphics/gui_screen.h b/engines/sci/graphics/screen.h
index 8a54e88829..efcfa17e03 100644
--- a/engines/sci/graphics/gui_screen.h
+++ b/engines/sci/graphics/screen.h
@@ -23,11 +23,11 @@
*
*/
-#ifndef SCI_GUI_SCREEN_H
-#define SCI_GUI_SCREEN_H
+#ifndef SCI_GRAPHICS_SCREEN_H
+#define SCI_GRAPHICS_SCREEN_H
#include "sci/sci.h"
-#include "sci/graphics/gui_helpers.h"
+#include "sci/graphics/helpers.h"
namespace Sci {
@@ -41,10 +41,10 @@ namespace Sci {
#define SCI_SCREEN_UNDITHERMEMORIAL_SIZE 256
-class SciGuiScreen {
+class Screen {
public:
- SciGuiScreen(ResourceManager *resMan, int16 width = 320, int16 height = 200, bool upscaledHires = false);
- ~SciGuiScreen();
+ Screen(ResourceManager *resMan, int16 width = 320, int16 height = 200, bool upscaledHires = false);
+ ~Screen();
void copyToScreen();
void copyFromScreen(byte *buffer);
@@ -71,7 +71,7 @@ public:
void bitsGetRect(byte *memoryPtr, Common::Rect *destRect);
void bitsRestore(byte *memoryPtr);
- void setPalette(GuiPalette*pal);
+ void setPalette(Palette*pal);
void setVerticalShakePos(uint16 shakePos);
diff --git a/engines/sci/graphics/gui_text.cpp b/engines/sci/graphics/text.cpp
index 430877001e..c0bb8d8e00 100644
--- a/engines/sci/graphics/gui_text.cpp
+++ b/engines/sci/graphics/text.cpp
@@ -29,22 +29,22 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_font.h"
-#include "sci/graphics/gui_text.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/font.h"
+#include "sci/graphics/text.h"
namespace Sci {
-SciGuiText::SciGuiText(ResourceManager *resMan, SciGuiGfx *gfx, SciGuiScreen *screen)
+Text::Text(ResourceManager *resMan, Gfx *gfx, Screen *screen)
: _resMan(resMan), _gfx(gfx), _screen(screen) {
init();
}
-SciGuiText::~SciGuiText() {
+Text::~Text() {
delete _font;
}
-void SciGuiText::init() {
+void Text::init() {
_font = NULL;
_codeFonts = NULL;
_codeFontsCount = 0;
@@ -52,26 +52,26 @@ void SciGuiText::init() {
_codeColorsCount = 0;
}
-GuiResourceId SciGuiText::GetFontId() {
+GuiResourceId Text::GetFontId() {
return _gfx->_curPort->fontId;
}
-SciGuiFont *SciGuiText::GetFont() {
+Font *Text::GetFont() {
if ((_font == NULL) || (_font->getResourceId() != _gfx->_curPort->fontId))
- _font = new SciGuiFont(_resMan, _gfx->_curPort->fontId);
+ _font = new Font(_resMan, _gfx->_curPort->fontId);
return _font;
}
-void SciGuiText::SetFont(GuiResourceId fontId) {
+void Text::SetFont(GuiResourceId fontId) {
if ((_font == NULL) || (_font->getResourceId() != fontId))
- _font = new SciGuiFont(_resMan, fontId);
+ _font = new Font(_resMan, fontId);
_gfx->_curPort->fontId = _font->getResourceId();
_gfx->_curPort->fontHeight = _font->getHeight();
}
-void SciGuiText::CodeSetFonts(int argc, reg_t *argv) {
+void Text::CodeSetFonts(int argc, reg_t *argv) {
int i;
delete _codeFonts;
@@ -82,7 +82,7 @@ void SciGuiText::CodeSetFonts(int argc, reg_t *argv) {
}
}
-void SciGuiText::CodeSetColors(int argc, reg_t *argv) {
+void Text::CodeSetColors(int argc, reg_t *argv) {
int i;
delete _codeColors;
@@ -93,7 +93,7 @@ void SciGuiText::CodeSetColors(int argc, reg_t *argv) {
}
}
-void SciGuiText::ClearChar(int16 chr) {
+void Text::ClearChar(int16 chr) {
if (_gfx->_curPort->penMode != 1)
return;
Common::Rect rect;
@@ -104,14 +104,14 @@ void SciGuiText::ClearChar(int16 chr) {
_gfx->EraseRect(rect);
}
-void SciGuiText::DrawChar(int16 chr) {
+void Text::DrawChar(int16 chr) {
chr = chr & 0xFF;
ClearChar(chr);
StdChar(chr);
_gfx->_curPort->curLeft += GetFont()->getCharWidth(chr);
}
-void SciGuiText::StdChar(int16 chr) {
+void Text::StdChar(int16 chr) {
#if 0
CResFont*res = getResFont();
if (res)
@@ -125,7 +125,7 @@ void SciGuiText::StdChar(int16 chr) {
// It will process the encountered code and set new font/set color
// We only support one-digit codes currently, don't know if multi-digit codes are possible
// Returns textcode character count
-int16 SciGuiText::CodeProcessing(const char *&text, GuiResourceId orgFontId, int16 orgPenColor) {
+int16 Text::CodeProcessing(const char *&text, GuiResourceId orgFontId, int16 orgPenColor) {
const char *textCode = text;
int16 textCodeSize = 0;
char curCode;
@@ -168,7 +168,7 @@ int16 SciGuiText::CodeProcessing(const char *&text, GuiResourceId orgFontId, int
}
// return max # of chars to fit maxwidth with full words
-int16 SciGuiText::GetLongest(const char *text, int16 maxWidth, GuiResourceId orgFontId) {
+int16 Text::GetLongest(const char *text, int16 maxWidth, GuiResourceId orgFontId) {
char curChar;
int16 maxChars = 0, curCharCount = 0;
uint16 width = 0;
@@ -213,7 +213,7 @@ int16 SciGuiText::GetLongest(const char *text, int16 maxWidth, GuiResourceId org
return maxChars;
}
-void SciGuiText::Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) {
+void Text::Width(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) {
unsigned char curChar;
GuiResourceId oldFontId = GetFontId();
int16 oldPenColor = _gfx->_curPort->penClr;
@@ -246,18 +246,18 @@ void SciGuiText::Width(const char *text, int16 from, int16 len, GuiResourceId or
return;
}
-void SciGuiText::StringWidth(const char *str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) {
+void Text::StringWidth(const char *str, GuiResourceId orgFontId, int16 &textWidth, int16 &textHeight) {
Width(str, 0, (int16)strlen(str), orgFontId, textWidth, textHeight);
}
-void SciGuiText::ShowString(const char *str, GuiResourceId orgFontId, int16 orgPenColor) {
+void Text::ShowString(const char *str, GuiResourceId orgFontId, int16 orgPenColor) {
Show(str, 0, (int16)strlen(str), orgFontId, orgPenColor);
}
-void SciGuiText::DrawString(const char *str, GuiResourceId orgFontId, int16 orgPenColor) {
+void Text::DrawString(const char *str, GuiResourceId orgFontId, int16 orgPenColor) {
Draw(str, 0, (int16)strlen(str), orgFontId, orgPenColor);
}
-int16 SciGuiText::Size(Common::Rect &rect, const char *str, GuiResourceId fontId, int16 maxWidth) {
+int16 Text::Size(Common::Rect &rect, const char *str, GuiResourceId fontId, int16 maxWidth) {
GuiResourceId oldFontId = GetFontId();
int16 oldPenColor = _gfx->_curPort->penClr;
int16 charCount;
@@ -299,7 +299,7 @@ int16 SciGuiText::Size(Common::Rect &rect, const char *str, GuiResourceId fontId
}
// returns maximum font height used
-void SciGuiText::Draw(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor) {
+void Text::Draw(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor) {
int16 curChar, charWidth;
Common::Rect rect;
@@ -338,7 +338,7 @@ void SciGuiText::Draw(const char *text, int16 from, int16 len, GuiResourceId org
}
// returns maximum font height used
-void SciGuiText::Show(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor) {
+void Text::Show(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor) {
Common::Rect rect;
rect.top = _gfx->_curPort->curTop;
@@ -350,7 +350,7 @@ void SciGuiText::Show(const char *text, int16 from, int16 len, GuiResourceId org
}
// Draws a text in rect.
-void SciGuiText::Box(const char *text, int16 bshow, const Common::Rect &rect, GuiTextAlignment alignment, GuiResourceId fontId) {
+void Text::Box(const char *text, int16 bshow, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId) {
int16 textWidth, textHeight, charCount;
int16 offset = 0;
int16 hline = 0;
@@ -398,7 +398,7 @@ void SciGuiText::Box(const char *text, int16 bshow, const Common::Rect &rect, Gu
_gfx->PenColor(orgPenColor);
}
-void SciGuiText::Draw_String(const char *text) {
+void Text::Draw_String(const char *text) {
GuiResourceId orgFontId = GetFontId();
int16 orgPenColor = _gfx->_curPort->penClr;
diff --git a/engines/sci/graphics/gui_text.h b/engines/sci/graphics/text.h
index 8002cdcf0c..56f789598c 100644
--- a/engines/sci/graphics/gui_text.h
+++ b/engines/sci/graphics/text.h
@@ -23,8 +23,8 @@
*
*/
-#ifndef SCI_GUI_TEXT_H
-#define SCI_GUI_TEXT_H
+#ifndef SCI_GRAPHICS_TEXT_H
+#define SCI_GRAPHICS_TEXT_H
namespace Sci {
@@ -32,16 +32,16 @@ namespace Sci {
#define SCI_TEXT_ALIGNMENT_CENTER 1
#define SCI_TEXT_ALIGNMENT_LEFT 0
-class SciGuiGfx;
-class SciGuiScreen;
-class SciGuiFont;
-class SciGuiText {
+class Gfx;
+class Screen;
+class Font;
+class Text {
public:
- SciGuiText(ResourceManager *_resMan, SciGuiGfx *gfx, SciGuiScreen *screen);
- ~SciGuiText();
+ Text(ResourceManager *_resMan, Gfx *gfx, Screen *screen);
+ ~Text();
GuiResourceId GetFontId();
- SciGuiFont *GetFont();
+ Font *GetFont();
void SetFont(GuiResourceId fontId);
void CodeSetFonts(int argc, reg_t *argv);
@@ -60,17 +60,17 @@ public:
int16 Size(Common::Rect &rect, const char *str, GuiResourceId fontId, int16 maxWidth);
void Draw(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor);
void Show(const char *text, int16 from, int16 len, GuiResourceId orgFontId, int16 orgPenColor);
- void Box(const char *text, int16 bshow, const Common::Rect &rect, GuiTextAlignment alignment, GuiResourceId fontId);
+ void Box(const char *text, int16 bshow, const Common::Rect &rect, TextAlignment alignment, GuiResourceId fontId);
void Draw_String(const char *text);
- SciGuiFont *_font;
+ Font *_font;
private:
void init();
ResourceManager *_resMan;
- SciGuiGfx *_gfx;
- SciGuiScreen *_screen;
+ Gfx *_gfx;
+ Screen *_screen;
int _codeFontsCount;
GuiResourceId *_codeFonts;
diff --git a/engines/sci/graphics/gui_transitions.cpp b/engines/sci/graphics/transitions.cpp
index 063f497d71..565d628a67 100644
--- a/engines/sci/graphics/gui_transitions.cpp
+++ b/engines/sci/graphics/transitions.cpp
@@ -31,18 +31,18 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
#include "sci/graphics/gui.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_transitions.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/transitions.h"
namespace Sci {
-SciGuiTransitions::SciGuiTransitions(SciGui *gui, SciGuiScreen *screen, SciGuiPalette *palette, bool isVGA)
+Transitions::Transitions(SciGui *gui, Screen *screen, SciPalette *palette, bool isVGA)
: _gui(gui), _screen(screen), _palette(palette), _isVGA(isVGA) {
init();
}
-SciGuiTransitions::~SciGuiTransitions() {
+Transitions::~Transitions() {
delete[] _oldScreen;
}
@@ -101,7 +101,7 @@ static const GuiTransitionTranslateEntry blackoutTransitionIDs[] = {
{ 255, 255, true }
};
-void SciGuiTransitions::init() {
+void Transitions::init() {
_oldScreen = new byte[_screen->_displayHeight * _screen->_displayWidth];
if (getSciVersion() >= SCI_VERSION_1_LATE)
@@ -114,14 +114,14 @@ void SciGuiTransitions::init() {
_blackoutFlag = false;
}
-void SciGuiTransitions::setup(int16 number, bool blackoutFlag) {
+void Transitions::setup(int16 number, bool blackoutFlag) {
if (number != -1) {
_number = number;
_blackoutFlag = blackoutFlag;
}
}
-void SciGuiTransitions::updateScreenAndWait(int msec) {
+void Transitions::updateScreenAndWait(int msec) {
Common::Event ev;
g_system->updateScreen();
g_system->delayMillis(msec);
@@ -129,7 +129,7 @@ void SciGuiTransitions::updateScreenAndWait(int msec) {
}
// will translate a number and return corresponding translationEntry
-const GuiTransitionTranslateEntry *SciGuiTransitions::translateNumber (int16 number, const GuiTransitionTranslateEntry *tablePtr) {
+const GuiTransitionTranslateEntry *Transitions::translateNumber (int16 number, const GuiTransitionTranslateEntry *tablePtr) {
while (1) {
if (tablePtr->orgId == 255)
return NULL;
@@ -139,7 +139,7 @@ const GuiTransitionTranslateEntry *SciGuiTransitions::translateNumber (int16 num
}
}
-void SciGuiTransitions::doit(Common::Rect picRect) {
+void Transitions::doit(Common::Rect picRect) {
const GuiTransitionTranslateEntry *translationEntry = _translationTable;
_picRect = picRect;
@@ -151,7 +151,7 @@ void SciGuiTransitions::doit(Common::Rect picRect) {
_number = translationEntry->newId;
_blackoutFlag = translationEntry->blackoutFlag;
} else {
- warning("SciGuiTransitions: old ID %d not supported", _number);
+ warning("Transitions: old ID %d not supported", _number);
_number = SCI_TRANSITIONS_NONE;
_blackoutFlag = false;
}
@@ -163,7 +163,7 @@ void SciGuiTransitions::doit(Common::Rect picRect) {
if (translationEntry) {
doTransition(translationEntry->newId, true);
} else {
- warning("SciGuiTransitions: ID %d not listed in blackoutTransitionIDs", _number);
+ warning("Transitions: ID %d not listed in blackoutTransitionIDs", _number);
}
}
@@ -182,7 +182,7 @@ void SciGuiTransitions::doit(Common::Rect picRect) {
// This may get called twice, if blackoutFlag is set. It will get once called with blackoutFlag set and another time
// with no blackoutFlag.
-void SciGuiTransitions::doTransition(int16 number, bool blackoutFlag) {
+void Transitions::doTransition(int16 number, bool blackoutFlag) {
if (number != SCI_TRANSITIONS_FADEPALETTE) {
setNewPalette(blackoutFlag);
}
@@ -241,25 +241,25 @@ void SciGuiTransitions::doTransition(int16 number, bool blackoutFlag) {
break;
default:
- warning("SciGuiTransitions: ID %d not implemented", number);
+ warning("Transitions: ID %d not implemented", number);
setNewScreen(blackoutFlag);
}
}
-void SciGuiTransitions::setNewPalette(bool blackoutFlag) {
+void Transitions::setNewPalette(bool blackoutFlag) {
if (!blackoutFlag)
if (_isVGA)
_palette->setOnScreen();
}
-void SciGuiTransitions::setNewScreen(bool blackoutFlag) {
+void Transitions::setNewScreen(bool blackoutFlag) {
if (!blackoutFlag) {
_screen->copyRectToScreen(_picRect);
g_system->updateScreen();
}
}
-void SciGuiTransitions::copyRectToScreen(const Common::Rect rect, bool blackoutFlag) {
+void Transitions::copyRectToScreen(const Common::Rect rect, bool blackoutFlag) {
if (!blackoutFlag) {
_screen->copyRectToScreen(rect);
} else {
@@ -270,7 +270,7 @@ void SciGuiTransitions::copyRectToScreen(const Common::Rect rect, bool blackoutF
}
// Note: dont do too many steps in here, otherwise cpu will crap out because of the load
-void SciGuiTransitions::fadeOut() {
+void Transitions::fadeOut() {
byte oldPalette[4 * 256], workPalette[4 * 256];
int16 stepNr, colorNr;
@@ -288,7 +288,7 @@ void SciGuiTransitions::fadeOut() {
}
// Note: dont do too many steps in here, otherwise cpu will crap out because of the load
-void SciGuiTransitions::fadeIn() {
+void Transitions::fadeIn() {
int16 stepNr;
for (stepNr = 0; stepNr <= 100; stepNr += 10) {
@@ -299,7 +299,7 @@ void SciGuiTransitions::fadeIn() {
// pixelates the new picture over the old one - works against the whole screen
// TODO: it seems this needs to get applied on _picRect only if possible
-void SciGuiTransitions::pixelation (bool blackoutFlag) {
+void Transitions::pixelation (bool blackoutFlag) {
uint16 mask = 0x40, stepNr = 0;
Common::Rect pixelRect;
@@ -321,7 +321,7 @@ void SciGuiTransitions::pixelation (bool blackoutFlag) {
// like pixelation but uses 8x8 blocks - works against the whole screen
// TODO: it seems this needs to get applied on _picRect only if possible
-void SciGuiTransitions::blocks(bool blackoutFlag) {
+void Transitions::blocks(bool blackoutFlag) {
uint16 mask = 0x40, stepNr = 0;
Common::Rect blockRect;
@@ -342,7 +342,7 @@ void SciGuiTransitions::blocks(bool blackoutFlag) {
}
// directly shows new screen starting up/down/left/right and going to the opposite direction - works on _picRect area only
-void SciGuiTransitions::straight(int16 number, bool blackoutFlag) {
+void Transitions::straight(int16 number, bool blackoutFlag) {
int16 stepNr = 0;
Common::Rect newScreenRect = _picRect;
@@ -394,7 +394,7 @@ void SciGuiTransitions::straight(int16 number, bool blackoutFlag) {
}
// scroll old screen (up/down/left/right) and insert new screen that way - works on _picRect area only
-void SciGuiTransitions::scroll(int16 number) {
+void Transitions::scroll(int16 number) {
int16 screenWidth, screenHeight;
byte *oldScreenPtr;
int16 stepNr = 0;
@@ -471,7 +471,7 @@ void SciGuiTransitions::scroll(int16 number) {
}
// vertically displays new screen starting from center - works on _picRect area only
-void SciGuiTransitions::verticalRollFromCenter(bool blackoutFlag) {
+void Transitions::verticalRollFromCenter(bool blackoutFlag) {
Common::Rect leftRect = Common::Rect(_picRect.left + (_picRect.width() / 2) -1, _picRect.top, _picRect.left + (_picRect.width() / 2), _picRect.bottom);
Common::Rect rightRect = Common::Rect(leftRect.right, _picRect.top, leftRect.right + 1, _picRect.bottom);
@@ -487,7 +487,7 @@ void SciGuiTransitions::verticalRollFromCenter(bool blackoutFlag) {
}
// vertically displays new screen starting from edges - works on _picRect area only
-void SciGuiTransitions::verticalRollToCenter(bool blackoutFlag) {
+void Transitions::verticalRollToCenter(bool blackoutFlag) {
Common::Rect leftRect = Common::Rect(_picRect.left, _picRect.top, _picRect.left + 1, _picRect.bottom);
Common::Rect rightRect = Common::Rect(leftRect.right - 1, _picRect.top, leftRect.right, _picRect.bottom);
@@ -499,7 +499,7 @@ void SciGuiTransitions::verticalRollToCenter(bool blackoutFlag) {
}
// horizontally displays new screen starting from center - works on _picRect area only
-void SciGuiTransitions::horizontalRollFromCenter(bool blackoutFlag) {
+void Transitions::horizontalRollFromCenter(bool blackoutFlag) {
Common::Rect upperRect = Common::Rect(_picRect.left, _picRect.top + (_picRect.height() / 2) - 1, _picRect.right, _picRect.top + (_picRect.height() / 2));
Common::Rect lowerRect = Common::Rect(upperRect.left, upperRect.bottom, upperRect.right, upperRect.bottom + 1);
@@ -515,7 +515,7 @@ void SciGuiTransitions::horizontalRollFromCenter(bool blackoutFlag) {
}
// horizontally displays new screen starting from upper and lower edge - works on _picRect area only
-void SciGuiTransitions::horizontalRollToCenter(bool blackoutFlag) {
+void Transitions::horizontalRollToCenter(bool blackoutFlag) {
Common::Rect upperRect = Common::Rect(_picRect.left, _picRect.top, _picRect.right, _picRect.top + 1);
Common::Rect lowerRect = Common::Rect(upperRect.left, _picRect.bottom - 1, upperRect.right, _picRect.bottom);
@@ -528,7 +528,7 @@ void SciGuiTransitions::horizontalRollToCenter(bool blackoutFlag) {
// diagonally displays new screen starting from center - works on _picRect area only
// assumes that height of rect is larger than width
-void SciGuiTransitions::diagonalRollFromCenter(bool blackoutFlag) {
+void Transitions::diagonalRollFromCenter(bool blackoutFlag) {
int16 halfHeight = _picRect.height() / 2;
Common::Rect upperRect(_picRect.left + halfHeight - 2, _picRect.top + halfHeight, _picRect.right - halfHeight + 1, _picRect.top + halfHeight + 1);
Common::Rect lowerRect(upperRect.left, upperRect.top, upperRect.right, upperRect.bottom);
@@ -558,7 +558,7 @@ void SciGuiTransitions::diagonalRollFromCenter(bool blackoutFlag) {
// diagonally displays new screen starting from edges - works on _picRect area only
// assumes that height of rect is larger than width
-void SciGuiTransitions::diagonalRollToCenter(bool blackoutFlag) {
+void Transitions::diagonalRollToCenter(bool blackoutFlag) {
Common::Rect upperRect(_picRect.left, _picRect.top, _picRect.right, _picRect.top + 1);
Common::Rect lowerRect(_picRect.left, _picRect.bottom - 1, _picRect.right, _picRect.bottom);
Common::Rect leftRect(_picRect.left, _picRect.top, _picRect.left + 1, _picRect.bottom);
diff --git a/engines/sci/graphics/gui_transitions.h b/engines/sci/graphics/transitions.h
index 691a71af91..43d94dec9e 100644
--- a/engines/sci/graphics/gui_transitions.h
+++ b/engines/sci/graphics/transitions.h
@@ -23,10 +23,10 @@
*
*/
-#ifndef SCI_GUI_TRANSITIONS_H
-#define SCI_GUI_TRANSITIONS_H
+#ifndef SCI_GRAPHICS_TRANSITIONS_H
+#define SCI_GRAPHICS_TRANSITIONS_H
-#include "sci/graphics/gui_helpers.h"
+#include "sci/graphics/helpers.h"
namespace Sci {
@@ -59,11 +59,11 @@ enum {
SCI_TRANSITIONS_HORIZONTALROLL_TOCENTER = 301
};
-class SciGuiScreen;
-class SciGuiTransitions {
+class Screen;
+class Transitions {
public:
- SciGuiTransitions(SciGui *gui, SciGuiScreen *screen, SciGuiPalette *palette, bool isVGA);
- ~SciGuiTransitions();
+ Transitions(SciGui *gui, Screen *screen, SciPalette *palette, bool isVGA);
+ ~Transitions();
void setup(int16 number, bool blackoutFlag);
void doit(Common::Rect picRect);
@@ -90,8 +90,8 @@ private:
void updateScreenAndWait(int msec);
SciGui *_gui;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
+ Screen *_screen;
+ SciPalette *_palette;
bool _isVGA;
const GuiTransitionTranslateEntry *_translationTable;
diff --git a/engines/sci/graphics/gui_view.cpp b/engines/sci/graphics/view.cpp
index 0aeaeb3d96..068ff24b02 100644
--- a/engines/sci/graphics/gui_view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -25,20 +25,20 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_view.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/view.h"
namespace Sci {
-SciGuiView::SciGuiView(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, GuiResourceId resourceId)
+View::View(ResourceManager *resMan, Screen *screen, SciPalette *palette, GuiResourceId resourceId)
: _resMan(resMan), _screen(screen), _palette(palette), _resourceId(resourceId) {
assert(resourceId != -1);
initData(resourceId);
}
-SciGuiView::~SciGuiView() {
+View::~View() {
// Iterate through the loops
for (uint16 loopNum = 0; loopNum < _loopCount; loopNum++) {
// and through the cells of each loop
@@ -56,7 +56,7 @@ static const byte EGAmappingStraight[SCI_VIEW_EGAMAPPING_SIZE] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
};
-void SciGuiView::initData(GuiResourceId resourceId) {
+void View::initData(GuiResourceId resourceId) {
_resource = _resMan->findResource(ResourceId(kResourceTypeView, resourceId), true);
if (!_resource) {
error("view resource %d not found", resourceId);
@@ -65,7 +65,7 @@ void SciGuiView::initData(GuiResourceId resourceId) {
byte *celData, *loopData;
uint16 celOffset;
- sciViewCelInfo *cel;
+ CelInfo *cel;
uint16 celCount = 0;
uint16 mirrorBits = 0;
uint16 palOffset = 0;
@@ -120,7 +120,7 @@ void SciGuiView::initData(GuiResourceId resourceId) {
}
}
- _loop = new sciViewLoopInfo[_loopCount];
+ _loop = new LoopInfo[_loopCount];
for (loopNo = 0; loopNo < _loopCount; loopNo++) {
loopData = _resourceData + READ_LE_UINT16(_resourceData + 8 + loopNo * 2);
// CelCount:WORD Unknown:WORD CelOffset0:WORD CelOffset1:WORD...
@@ -131,7 +131,7 @@ void SciGuiView::initData(GuiResourceId resourceId) {
mirrorBits >>= 1;
// read cel info
- _loop[loopNo].cel = new sciViewCelInfo[celCount];
+ _loop[loopNo].cel = new CelInfo[celCount];
for (celNo = 0; celNo < celCount; celNo++) {
celOffset = READ_LE_UINT16(loopData + 4 + celNo * 2);
celData = _resourceData + celOffset;
@@ -184,7 +184,7 @@ void SciGuiView::initData(GuiResourceId resourceId) {
_embeddedPal = true;
}
- _loop = new sciViewLoopInfo[_loopCount];
+ _loop = new LoopInfo[_loopCount];
for (loopNo = 0; loopNo < _loopCount; loopNo++) {
loopData = _resourceData + headerSize + (loopNo * loopSize);
@@ -204,7 +204,7 @@ void SciGuiView::initData(GuiResourceId resourceId) {
celData = _resourceData + READ_LE_UINT16(loopData + 14);
// read cel info
- _loop[loopNo].cel = new sciViewCelInfo[celCount];
+ _loop[loopNo].cel = new CelInfo[celCount];
for (celNo = 0; celNo < celCount; celNo++) {
cel = &_loop[loopNo].cel[celNo];
cel->width = READ_LE_UINT16(celData);
@@ -229,35 +229,35 @@ void SciGuiView::initData(GuiResourceId resourceId) {
}
}
-GuiResourceId SciGuiView::getResourceId() {
+GuiResourceId View::getResourceId() {
return _resourceId;
}
-int16 SciGuiView::getWidth(GuiViewLoopNo loopNo, GuiViewCelNo celNo) {
+int16 View::getWidth(LoopNo loopNo, CelNo celNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
return _loopCount ? _loop[loopNo].cel[celNo].width : 0;
}
-int16 SciGuiView::getHeight(GuiViewLoopNo loopNo, GuiViewCelNo celNo) {
+int16 View::getHeight(LoopNo loopNo, CelNo celNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
return _loopCount ? _loop[loopNo].cel[celNo].height : 0;
}
-sciViewCelInfo *SciGuiView::getCelInfo(GuiViewLoopNo loopNo, GuiViewCelNo celNo) {
+CelInfo *View::getCelInfo(LoopNo loopNo, CelNo celNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
return _loopCount ? &_loop[loopNo].cel[celNo] : NULL;
}
-sciViewLoopInfo *SciGuiView::getLoopInfo(GuiViewLoopNo loopNo) {
+LoopInfo *View::getLoopInfo(LoopNo loopNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
return _loopCount ? &_loop[loopNo] : NULL;
}
-void SciGuiView::getCelRect(GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect) {
- sciViewCelInfo *celInfo = getCelInfo(loopNo, celNo);
+void View::getCelRect(LoopNo loopNo, CelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect) {
+ CelInfo *celInfo = getCelInfo(loopNo, celNo);
if (celInfo) {
outRect->left = x + celInfo->displaceX - (celInfo->width >> 1);
outRect->right = outRect->left + celInfo->width;
@@ -266,8 +266,8 @@ void SciGuiView::getCelRect(GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 x, i
}
}
-void SciGuiView::unpackCel(GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte *outPtr, uint16 pixelCount) {
- sciViewCelInfo *celInfo = getCelInfo(loopNo, celNo);
+void View::unpackCel(LoopNo loopNo, CelNo celNo, byte *outPtr, uint16 pixelCount) {
+ CelInfo *celInfo = getCelInfo(loopNo, celNo);
byte *rlePtr;
byte *literalPtr;
uint16 pixelNo = 0, runLength;
@@ -354,7 +354,7 @@ void SciGuiView::unpackCel(GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte *outPt
error("Unable to decompress view");
}
-byte *SciGuiView::getBitmap(GuiViewLoopNo loopNo, GuiViewCelNo celNo) {
+byte *View::getBitmap(LoopNo loopNo, CelNo celNo) {
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
if (_loop[loopNo].cel[celNo].rawBitmap)
@@ -388,7 +388,7 @@ byte *SciGuiView::getBitmap(GuiViewLoopNo loopNo, GuiViewCelNo celNo) {
// Called after unpacking an EGA cel, this will try to undither (parts) of the cel if the dithering in here
// matches dithering used by the current picture
-void SciGuiView::unditherBitmap(byte *bitmapPtr, int16 width, int16 height, byte clearKey) {
+void View::unditherBitmap(byte *bitmapPtr, int16 width, int16 height, byte clearKey) {
int16 *unditherMemorial = _screen->unditherGetMemorial();
// It makes no sense to go further, if no memorial data from current picture is available
@@ -461,9 +461,9 @@ void SciGuiView::unditherBitmap(byte *bitmapPtr, int16 width, int16 height, byte
}
}
-void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight) {
- GuiPalette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
- sciViewCelInfo *celInfo = getCelInfo(loopNo, celNo);
+void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, LoopNo loopNo, CelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight) {
+ Palette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
+ CelInfo *celInfo = getCelInfo(loopNo, celNo);
byte *bitmap = getBitmap(loopNo, celNo);
int16 celHeight = celInfo->height, celWidth = celInfo->width;
int16 width, height;
@@ -506,7 +506,7 @@ void SciGuiView::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect cli
}
}
-GuiPalette *SciGuiView::getPalette() {
+Palette *View::getPalette() {
return _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
}
diff --git a/engines/sci/graphics/gui_view.h b/engines/sci/graphics/view.h
index c4ed3db2b0..109a37f065 100644
--- a/engines/sci/graphics/gui_view.h
+++ b/engines/sci/graphics/view.h
@@ -23,12 +23,12 @@
*
*/
-#ifndef SCI_GUI_VIEW_H
-#define SCI_GUI_VIEW_H
+#ifndef SCI_GRAPHICS_VIEW_H
+#define SCI_GRAPHICS_VIEW_H
namespace Sci {
-struct sciViewCelInfo {
+struct CelInfo {
int16 width, height;
char displaceX;
byte displaceY;
@@ -39,49 +39,49 @@ struct sciViewCelInfo {
byte *rawBitmap;
};
-struct sciViewLoopInfo {
+struct LoopInfo {
bool mirrorFlag;
uint16 celCount;
- sciViewCelInfo *cel;
+ CelInfo *cel;
};
#define SCI_VIEW_EGAMAPPING_SIZE 16
#define SCI_VIEW_EGAMAPPING_COUNT 8
-class SciGuiView {
+class View {
public:
- SciGuiView(ResourceManager *resMan, SciGuiScreen *screen, SciGuiPalette *palette, GuiResourceId resourceId);
- ~SciGuiView();
+ View(ResourceManager *resMan, Screen *screen, SciPalette *palette, GuiResourceId resourceId);
+ ~View();
GuiResourceId getResourceId();
- int16 getWidth(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
- int16 getHeight(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
- sciViewCelInfo *getCelInfo(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
- sciViewLoopInfo *getLoopInfo(GuiViewLoopNo loopNo);
- void getCelRect(GuiViewLoopNo loopNo, GuiViewCelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
- byte *getBitmap(GuiViewLoopNo loopNo, GuiViewCelNo celNo);
- void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight = -1);
+ int16 getWidth(LoopNo loopNo, CelNo celNo);
+ int16 getHeight(LoopNo loopNo, CelNo celNo);
+ CelInfo *getCelInfo(LoopNo loopNo, CelNo celNo);
+ LoopInfo *getLoopInfo(LoopNo loopNo);
+ void getCelRect(LoopNo loopNo, CelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
+ byte *getBitmap(LoopNo loopNo, CelNo celNo);
+ void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, LoopNo loopNo, CelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight = -1);
uint16 getLoopCount() const { return _loopCount; }
- uint16 getCelCount(GuiViewLoopNo loopNo) { return _loop[loopNo].celCount; }
- GuiPalette *getPalette();
+ uint16 getCelCount(LoopNo loopNo) { return _loop[loopNo].celCount; }
+ Palette *getPalette();
private:
void initData(GuiResourceId resourceId);
- void unpackCel(GuiViewLoopNo loopNo, GuiViewCelNo celNo, byte *outPtr, uint16 pixelCount);
+ void unpackCel(LoopNo loopNo, CelNo celNo, byte *outPtr, uint16 pixelCount);
void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey);
ResourceManager *_resMan;
- SciGuiScreen *_screen;
- SciGuiPalette *_palette;
+ Screen *_screen;
+ SciPalette *_palette;
GuiResourceId _resourceId;
Resource *_resource;
byte *_resourceData;
uint16 _loopCount;
- sciViewLoopInfo *_loop;
+ LoopInfo *_loop;
bool _embeddedPal;
- GuiPalette _viewPalette;
+ Palette _viewPalette;
byte *_EGAmapping;
};
diff --git a/engines/sci/graphics/gui_windowmgr.cpp b/engines/sci/graphics/windowmgr.cpp
index a77b5c3944..6e599ae0a4 100644
--- a/engines/sci/graphics/gui_windowmgr.cpp
+++ b/engines/sci/graphics/windowmgr.cpp
@@ -27,11 +27,11 @@
#include "sci/sci.h"
#include "sci/engine/state.h"
-#include "sci/graphics/gui_screen.h"
-#include "sci/graphics/gui_gfx.h"
-#include "sci/graphics/gui_animate.h"
-#include "sci/graphics/gui_text.h"
-#include "sci/graphics/gui_windowmgr.h"
+#include "sci/graphics/screen.h"
+#include "sci/graphics/gfx.h"
+#include "sci/graphics/animate.h"
+#include "sci/graphics/text.h"
+#include "sci/graphics/windowmgr.h"
namespace Sci {
@@ -44,18 +44,18 @@ enum {
SCI_WINDOWMGR_STYLE_USER = (1 << 7)
};
-SciGuiWindowMgr::SciGuiWindowMgr(SciGui *gui, SciGuiScreen *screen, SciGuiGfx *gfx, SciGuiText *text)
+WindowMgr::WindowMgr(SciGui *gui, Screen *screen, Gfx *gfx, Text *text)
: _gui(gui), _screen(screen), _gfx(gfx), _text(text) {
}
-SciGuiWindowMgr::~SciGuiWindowMgr() {
+WindowMgr::~WindowMgr() {
// TODO: Clear _windowList and delete all stuff in it?
}
-void SciGuiWindowMgr::init(Common::String gameId) {
+void WindowMgr::init(Common::String gameId) {
int16 offTop = 10;
- _wmgrPort = new GuiPort(1);
+ _wmgrPort = new Port(1);
_windowsById.resize(2);
_windowsById[0] = _wmgrPort; // wmgrPort is supposed to be accessible via id 0
_windowsById[1] = _wmgrPort; // but wmgrPort may not actually have id 0, so we assign id 1 (as well)
@@ -81,25 +81,25 @@ void SciGuiWindowMgr::init(Common::String gameId) {
_picWind = NewWindow(Common::Rect(0, offTop, _screen->_width, _screen->_height), 0, 0, SCI_WINDOWMGR_STYLE_TRANSPARENT | SCI_WINDOWMGR_STYLE_NOFRAME, 0, true);
}
-int16 SciGuiWindowMgr::isFrontWindow(GuiWindow *pWnd) {
+int16 WindowMgr::isFrontWindow(Window *pWnd) {
return _windowList.back() == pWnd;
}
-void SciGuiWindowMgr::BeginUpdate(GuiWindow *wnd) {
- GuiPort *oldPort = _gfx->SetPort(_wmgrPort);
+void WindowMgr::BeginUpdate(Window *wnd) {
+ Port *oldPort = _gfx->SetPort(_wmgrPort);
PortList::iterator it = _windowList.reverse_begin();
const PortList::iterator end = Common::find(_windowList.begin(), _windowList.end(), wnd);
while (it != end) {
- // FIXME: We also store GuiPort objects in the window list.
+ // FIXME: We also store Port objects in the window list.
// We should add a check that we really only pass windows here...
- UpdateWindow((GuiWindow *)*it);
+ UpdateWindow((Window *)*it);
--it;
}
_gfx->SetPort(oldPort);
}
-void SciGuiWindowMgr::EndUpdate(GuiWindow *wnd) {
- GuiPort *oldPort = _gfx->SetPort(_wmgrPort);
+void WindowMgr::EndUpdate(Window *wnd) {
+ Port *oldPort = _gfx->SetPort(_wmgrPort);
const PortList::iterator end = _windowList.end();
PortList::iterator it = Common::find(_windowList.begin(), end, wnd);
@@ -107,15 +107,15 @@ void SciGuiWindowMgr::EndUpdate(GuiWindow *wnd) {
assert(it != end);
while (++it != end) {
- // FIXME: We also store GuiPort objects in the window list.
+ // FIXME: We also store Port objects in the window list.
// We should add a check that we really only pass windows here...
- UpdateWindow((GuiWindow *)*it);
+ UpdateWindow((Window *)*it);
}
_gfx->SetPort(oldPort);
}
-GuiWindow *SciGuiWindowMgr::NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, int16 priority, bool draw) {
+Window *WindowMgr::NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, int16 priority, bool draw) {
// Find an unused window/port id
uint id = 1;
while (id < _windowsById.size() && _windowsById[id]) {
@@ -125,7 +125,7 @@ GuiWindow *SciGuiWindowMgr::NewWindow(const Common::Rect &dims, const Common::Re
_windowsById.push_back(0);
assert(0 < id && id < 0xFFFF);
- GuiWindow *pwnd = new GuiWindow(id);
+ Window *pwnd = new Window(id);
Common::Rect r;
if (!pwnd) {
@@ -195,20 +195,20 @@ GuiWindow *SciGuiWindowMgr::NewWindow(const Common::Rect &dims, const Common::Re
if (draw)
DrawWindow(pwnd);
- _gfx->SetPort((GuiPort *)pwnd);
+ _gfx->SetPort((Port *)pwnd);
_gfx->SetOrigin(pwnd->rect.left, pwnd->rect.top + _wmgrPort->top);
pwnd->rect.moveTo(0, 0);
return pwnd;
}
-void SciGuiWindowMgr::DrawWindow(GuiWindow *pWnd) {
+void WindowMgr::DrawWindow(Window *pWnd) {
if (pWnd->bDrawn)
return;
Common::Rect r;
int16 wndStyle = pWnd->wndStyle;
pWnd->bDrawn = true;
- GuiPort *oldport = _gfx->SetPort(_wmgrPort);
+ Port *oldport = _gfx->SetPort(_wmgrPort);
_gfx->PenColor(0);
if ((wndStyle & SCI_WINDOWMGR_STYLE_TRANSPARENT) == 0) {
pWnd->hSaved1 = _gfx->BitsSave(pWnd->restoreRect, SCI_SCREEN_MASK_VISUAL);
@@ -254,7 +254,7 @@ void SciGuiWindowMgr::DrawWindow(GuiWindow *pWnd) {
_gfx->SetPort(oldport);
}
-void SciGuiWindowMgr::DisposeWindow(GuiWindow *pWnd, bool reanimate) {
+void WindowMgr::DisposeWindow(Window *pWnd, bool reanimate) {
_gfx->SetPort(_wmgrPort);
_gfx->BitsRestore(pWnd->hSaved1);
_gfx->BitsRestore(pWnd->hSaved2);
@@ -268,8 +268,8 @@ void SciGuiWindowMgr::DisposeWindow(GuiWindow *pWnd, bool reanimate) {
delete pWnd;
}
-void SciGuiWindowMgr::UpdateWindow(GuiWindow *wnd) {
- GuiMemoryHandle handle;
+void WindowMgr::UpdateWindow(Window *wnd) {
+ MemoryHandle handle;
if (wnd->saveScreenMask && wnd->bDrawn) {
handle = _gfx->BitsSave(wnd->restoreRect, SCI_SCREEN_MASK_VISUAL);
diff --git a/engines/sci/graphics/gui_windowmgr.h b/engines/sci/graphics/windowmgr.h
index 483df9efc5..30d854c518 100644
--- a/engines/sci/graphics/gui_windowmgr.h
+++ b/engines/sci/graphics/windowmgr.h
@@ -23,47 +23,47 @@
*
*/
-#ifndef SCI_GUI_WINDOWMGR_H
-#define SCI_GUI_WINDOWMGR_H
+#ifndef SCI_GRAPHICS_WINDOWMGR_H
+#define SCI_GRAPHICS_WINDOWMGR_H
#include "common/list.h"
#include "common/array.h"
namespace Sci {
-class SciGuiWindowMgr {
+class WindowMgr {
public:
- SciGuiWindowMgr(SciGui *gui, SciGuiScreen *screen, SciGuiGfx *gfx, SciGuiText *text);
- ~SciGuiWindowMgr();
+ WindowMgr(SciGui *gui, Screen *screen, Gfx *gfx, Text *text);
+ ~WindowMgr();
void init(Common::String gameId);
- int16 isFrontWindow(GuiWindow *wnd);
- void BeginUpdate(GuiWindow *wnd);
- void EndUpdate(GuiWindow *wnd);
- GuiWindow *NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, int16 priority, bool draw);
- void DrawWindow(GuiWindow *wnd);
- void DisposeWindow(GuiWindow *pWnd, bool reanimate);
- void UpdateWindow(GuiWindow *wnd);
+ int16 isFrontWindow(Window *wnd);
+ void BeginUpdate(Window *wnd);
+ void EndUpdate(Window *wnd);
+ Window *NewWindow(const Common::Rect &dims, const Common::Rect *restoreRect, const char *title, uint16 style, int16 priority, bool draw);
+ void DrawWindow(Window *wnd);
+ void DisposeWindow(Window *pWnd, bool reanimate);
+ void UpdateWindow(Window *wnd);
- GuiPort *getPortById(uint16 id) const { return _windowsById[id]; }
+ Port *getPortById(uint16 id) const { return _windowsById[id]; }
- GuiPort *_wmgrPort;
- GuiWindow *_picWind;
+ Port *_wmgrPort;
+ Window *_picWind;
private:
- typedef Common::List<GuiPort *> PortList;
+ typedef Common::List<Port *> PortList;
SciGui *_gui;
- SciGuiScreen *_screen;
- SciGuiGfx *_gfx;
- SciGuiText *_text;
+ Screen *_screen;
+ Gfx *_gfx;
+ Text *_text;
/** The list of open 'windows' (and ports), in visual order. */
PortList _windowList;
/** The list of all open 'windows' (and ports), ordered by their id. */
- Common::Array<GuiPort *> _windowsById;
+ Common::Array<Port *> _windowsById;
};
} // End of namespace Sci
diff --git a/engines/sci/module.mk b/engines/sci/module.mk
index bb2a2eea1e..c607703089 100644
--- a/engines/sci/module.mk
+++ b/engines/sci/module.mk
@@ -36,20 +36,20 @@ MODULE_OBJS := \
engine/state.o \
engine/vm.o \
graphics/gui.o \
- graphics/gui_animate.o \
- graphics/gui_controls.o \
- graphics/gui_cursor.o \
- graphics/gui_font.o \
- graphics/gui_gfx.o \
- graphics/gui_menu.o \
- graphics/gui_palette.o \
- graphics/gui_picture.o \
- graphics/gui_portrait.o \
- graphics/gui_screen.o \
- graphics/gui_text.o \
- graphics/gui_transitions.o \
- graphics/gui_view.o \
- graphics/gui_windowmgr.o \
+ graphics/animate.o \
+ graphics/controls.o \
+ graphics/cursor.o \
+ graphics/font.o \
+ graphics/gfx.o \
+ graphics/menu.o \
+ graphics/palette.o \
+ graphics/picture.o \
+ graphics/portrait.o \
+ graphics/screen.o \
+ graphics/text.o \
+ graphics/transitions.o \
+ graphics/view.o \
+ graphics/windowmgr.o \
sound/audio.o \
sound/midiparser_sci.o \
sound/music.o \
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index dac5c0a634..ab3363db0f 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -34,7 +34,7 @@
#include "sound/audiostream.h"
#include "sound/mixer.h" // for SoundHandle
-#include "graphics/gui_helpers.h" // for ViewType
+#include "graphics/helpers.h" // for ViewType
#include "sci/decompressor.h"
#include "sci/sci.h"
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 914ea52a1d..8ae054655b 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -39,9 +39,9 @@
#include "sci/sound/audio.h"
#include "sci/sound/soundcmd.h"
#include "sci/graphics/gui.h"
-#include "sci/graphics/gui_palette.h"
-#include "sci/graphics/gui_cursor.h"
-#include "sci/graphics/gui_screen.h"
+#include "sci/graphics/palette.h"
+#include "sci/graphics/cursor.h"
+#include "sci/graphics/screen.h"
namespace Sci {
@@ -118,9 +118,9 @@ Common::Error SciEngine::run() {
// TODO: Possibly look at first picture resource and determine if its hires or not
// Initialize graphics-related parts
- SciGuiScreen *screen = new SciGuiScreen(_resMan, 320, 200, upscaledHires); // invokes initGraphics()
- SciGuiPalette *palette = new SciGuiPalette(_resMan, screen);
- SciGuiCursor *cursor = new SciGuiCursor(_resMan, palette, screen);
+ Screen *screen = new Screen(_resMan, 320, 200, upscaledHires); // invokes initGraphics()
+ SciPalette *palette = new SciPalette(_resMan, screen);
+ Cursor *cursor = new Cursor(_resMan, palette, screen);
// Create debugger console. It requires GFX to be initialized
_console = new Console(this);