aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute/base
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-21 21:01:47 +0200
committerEinar Johan Trøan Sømåen2012-07-21 21:01:47 +0200
commitb5a07fef8ebf29f7f44b15d9b34799c7e115fdad (patch)
tree76599c7b51aa6ad0447cb6ff6847f9eba54a679a /engines/wintermute/base
parent2e82471240804df65acdf51c43ea044cbb81ae68 (diff)
downloadscummvm-rg350-b5a07fef8ebf29f7f44b15d9b34799c7e115fdad.tar.gz
scummvm-rg350-b5a07fef8ebf29f7f44b15d9b34799c7e115fdad.tar.bz2
scummvm-rg350-b5a07fef8ebf29f7f44b15d9b34799c7e115fdad.zip
WINTERMUTE: Get rid of the C-prefix for class-definitions.
Diffstat (limited to 'engines/wintermute/base')
-rw-r--r--engines/wintermute/base/base.cpp16
-rw-r--r--engines/wintermute/base/base.h18
-rw-r--r--engines/wintermute/base/base_active_rect.cpp22
-rw-r--r--engines/wintermute/base/base_active_rect.h22
-rw-r--r--engines/wintermute/base/base_debugger.cpp66
-rw-r--r--engines/wintermute/base/base_debugger.h34
-rw-r--r--engines/wintermute/base/base_dynamic_buffer.cpp34
-rw-r--r--engines/wintermute/base/base_dynamic_buffer.h6
-rw-r--r--engines/wintermute/base/base_fader.cpp28
-rw-r--r--engines/wintermute/base/base_fader.h8
-rw-r--r--engines/wintermute/base/base_file_manager.cpp78
-rw-r--r--engines/wintermute/base/base_file_manager.h16
-rw-r--r--engines/wintermute/base/base_frame.cpp70
-rw-r--r--engines/wintermute/base/base_frame.h36
-rw-r--r--engines/wintermute/base/base_game.cpp468
-rw-r--r--engines/wintermute/base/base_game.h138
-rw-r--r--engines/wintermute/base/base_keyboard_state.cpp42
-rw-r--r--engines/wintermute/base/base_keyboard_state.h14
-rw-r--r--engines/wintermute/base/base_named_object.cpp10
-rw-r--r--engines/wintermute/base/base_named_object.h10
-rw-r--r--engines/wintermute/base/base_object.cpp94
-rw-r--r--engines/wintermute/base/base_object.h40
-rw-r--r--engines/wintermute/base/base_parser.cpp26
-rw-r--r--engines/wintermute/base/base_parser.h8
-rw-r--r--engines/wintermute/base/base_persistence_manager.cpp86
-rw-r--r--engines/wintermute/base/base_persistence_manager.h6
-rw-r--r--engines/wintermute/base/base_point.cpp10
-rw-r--r--engines/wintermute/base/base_point.h10
-rw-r--r--engines/wintermute/base/base_quick_msg.cpp6
-rw-r--r--engines/wintermute/base/base_quick_msg.h6
-rw-r--r--engines/wintermute/base/base_region.cpp66
-rw-r--r--engines/wintermute/base/base_region.h20
-rw-r--r--engines/wintermute/base/base_registry.cpp34
-rw-r--r--engines/wintermute/base/base_registry.h6
-rw-r--r--engines/wintermute/base/base_save_thumb_helper.cpp10
-rw-r--r--engines/wintermute/base/base_save_thumb_helper.h12
-rw-r--r--engines/wintermute/base/base_script_holder.cpp70
-rw-r--r--engines/wintermute/base/base_script_holder.h24
-rw-r--r--engines/wintermute/base/base_scriptable.cpp50
-rw-r--r--engines/wintermute/base/base_scriptable.h44
-rw-r--r--engines/wintermute/base/base_sprite.cpp92
-rw-r--r--engines/wintermute/base/base_sprite.h32
-rw-r--r--engines/wintermute/base/base_string_table.cpp22
-rw-r--r--engines/wintermute/base/base_string_table.h6
-rw-r--r--engines/wintermute/base/base_sub_frame.cpp68
-rw-r--r--engines/wintermute/base/base_sub_frame.h26
-rw-r--r--engines/wintermute/base/base_surface_storage.cpp34
-rw-r--r--engines/wintermute/base/base_surface_storage.h16
-rw-r--r--engines/wintermute/base/base_transition_manager.cpp18
-rw-r--r--engines/wintermute/base/base_transition_manager.h6
-rw-r--r--engines/wintermute/base/base_viewport.cpp20
-rw-r--r--engines/wintermute/base/base_viewport.h12
-rw-r--r--engines/wintermute/base/file/BPkgFile.cpp7
-rw-r--r--engines/wintermute/base/file/BPkgFile.h4
-rw-r--r--engines/wintermute/base/file/base_disk_file.cpp2
-rw-r--r--engines/wintermute/base/file/base_disk_file.h2
-rw-r--r--engines/wintermute/base/file/base_file.cpp8
-rw-r--r--engines/wintermute/base/file/base_file.h6
-rw-r--r--engines/wintermute/base/file/base_file_entry.cpp4
-rw-r--r--engines/wintermute/base/file/base_file_entry.h10
-rw-r--r--engines/wintermute/base/file/base_package.cpp14
-rw-r--r--engines/wintermute/base/file/base_package.h6
-rw-r--r--engines/wintermute/base/file/base_resources.cpp2
-rw-r--r--engines/wintermute/base/file/base_resources.h2
-rw-r--r--engines/wintermute/base/file/base_save_thumb_file.cpp14
-rw-r--r--engines/wintermute/base/file/base_save_thumb_file.h6
-rw-r--r--engines/wintermute/base/font/base_font.cpp36
-rw-r--r--engines/wintermute/base/font/base_font.h12
-rw-r--r--engines/wintermute/base/font/base_font_bitmap.cpp44
-rw-r--r--engines/wintermute/base/font/base_font_bitmap.h14
-rw-r--r--engines/wintermute/base/font/base_font_storage.cpp20
-rw-r--r--engines/wintermute/base/font/base_font_storage.h16
-rw-r--r--engines/wintermute/base/font/base_font_truetype.cpp78
-rw-r--r--engines/wintermute/base/font/base_font_truetype.h30
-rw-r--r--engines/wintermute/base/gfx/base_image.cpp20
-rw-r--r--engines/wintermute/base/gfx/base_image.h10
-rw-r--r--engines/wintermute/base/gfx/base_renderer.cpp54
-rw-r--r--engines/wintermute/base/gfx/base_renderer.h24
-rw-r--r--engines/wintermute/base/gfx/base_surface.cpp34
-rw-r--r--engines/wintermute/base/gfx/base_surface.h6
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.cpp78
-rw-r--r--engines/wintermute/base/gfx/osystem/base_render_osystem.h20
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp72
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.h8
-rw-r--r--engines/wintermute/base/particles/part_emitter.cpp112
-rw-r--r--engines/wintermute/base/particles/part_emitter.h34
-rw-r--r--engines/wintermute/base/particles/part_force.cpp6
-rw-r--r--engines/wintermute/base/particles/part_force.h8
-rw-r--r--engines/wintermute/base/particles/part_particle.cpp42
-rw-r--r--engines/wintermute/base/particles/part_particle.h20
-rw-r--r--engines/wintermute/base/scriptables/script.cpp158
-rw-r--r--engines/wintermute/base/scriptables/script.h62
-rw-r--r--engines/wintermute/base/scriptables/script_engine.cpp110
-rw-r--r--engines/wintermute/base/scriptables/script_engine.h38
-rw-r--r--engines/wintermute/base/scriptables/script_ext_array.cpp34
-rw-r--r--engines/wintermute/base/scriptables/script_ext_array.h20
-rw-r--r--engines/wintermute/base/scriptables/script_ext_date.cpp28
-rw-r--r--engines/wintermute/base/scriptables/script_ext_date.h16
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.cpp56
-rw-r--r--engines/wintermute/base/scriptables/script_ext_file.h16
-rw-r--r--engines/wintermute/base/scriptables/script_ext_math.cpp22
-rw-r--r--engines/wintermute/base/scriptables/script_ext_math.h12
-rw-r--r--engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp42
-rw-r--r--engines/wintermute/base/scriptables/script_ext_mem_buffer.h20
-rw-r--r--engines/wintermute/base/scriptables/script_ext_object.cpp14
-rw-r--r--engines/wintermute/base/scriptables/script_ext_object.h8
-rw-r--r--engines/wintermute/base/scriptables/script_ext_string.cpp44
-rw-r--r--engines/wintermute/base/scriptables/script_ext_string.h16
-rw-r--r--engines/wintermute/base/scriptables/script_stack.cpp50
-rw-r--r--engines/wintermute/base/scriptables/script_stack.h26
-rw-r--r--engines/wintermute/base/scriptables/script_value.cpp158
-rw-r--r--engines/wintermute/base/scriptables/script_value.h50
-rw-r--r--engines/wintermute/base/sound/base_sound.cpp46
-rw-r--r--engines/wintermute/base/sound/base_sound.h12
-rw-r--r--engines/wintermute/base/sound/base_sound_buffer.cpp62
-rw-r--r--engines/wintermute/base/sound/base_sound_buffer.h8
-rw-r--r--engines/wintermute/base/sound/base_sound_manager.cpp44
-rw-r--r--engines/wintermute/base/sound/base_sound_manager.h18
118 files changed, 2097 insertions, 2094 deletions
diff --git a/engines/wintermute/base/base.cpp b/engines/wintermute/base/base.cpp
index 5fabe94312..4b62a7553a 100644
--- a/engines/wintermute/base/base.cpp
+++ b/engines/wintermute/base/base.cpp
@@ -35,27 +35,27 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-CBBase::CBBase(CBGame *gameOwner) {
+BaseClass::BaseClass(BaseGame *gameOwner) {
_gameRef = gameOwner;
_persistable = true;
}
//////////////////////////////////////////////////////////////////////////
-CBBase::CBBase() {
+BaseClass::BaseClass() {
_gameRef = NULL;
_persistable = true;
}
//////////////////////////////////////////////////////////////////////
-CBBase::~CBBase() {
+BaseClass::~BaseClass() {
_editorProps.clear();
}
//////////////////////////////////////////////////////////////////////////
-const char *CBBase::getEditorProp(const char *propName, const char *initVal) {
+const char *BaseClass::getEditorProp(const char *propName, const char *initVal) {
_editorPropsIter = _editorProps.find(propName);
if (_editorPropsIter != _editorProps.end())
return _editorPropsIter->_value.c_str();
@@ -65,7 +65,7 @@ const char *CBBase::getEditorProp(const char *propName, const char *initVal) {
//////////////////////////////////////////////////////////////////////////
-bool CBBase::setEditorProp(const char *propName, const char *propValue) {
+bool BaseClass::setEditorProp(const char *propName, const char *propValue) {
if (propName == NULL) return STATUS_FAILED;
if (propValue == NULL) {
@@ -84,7 +84,7 @@ TOKEN_DEF(NAME)
TOKEN_DEF(VALUE)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-bool CBBase::parseEditorProperty(byte *buffer, bool complete) {
+bool BaseClass::parseEditorProperty(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(EDITOR_PROPERTY)
TOKEN_TABLE(NAME)
@@ -98,7 +98,7 @@ bool CBBase::parseEditorProperty(byte *buffer, bool complete) {
byte *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if (complete) {
if (parser.getCommand((char **)&buffer, commands, (char **)&params) != TOKEN_EDITOR_PROPERTY) {
@@ -159,7 +159,7 @@ bool CBBase::parseEditorProperty(byte *buffer, bool complete) {
//////////////////////////////////////////////////////////////////////////
-bool CBBase::saveAsText(CBDynBuffer *buffer, int indent) {
+bool BaseClass::saveAsText(BaseDynamicBuffer *buffer, int indent) {
_editorPropsIter = _editorProps.begin();
while (_editorPropsIter != _editorProps.end()) {
buffer->putTextIndent(indent, "EDITOR_PROPERTY\n");
diff --git a/engines/wintermute/base/base.h b/engines/wintermute/base/base.h
index e8c87f1f9e..0265ce97d5 100644
--- a/engines/wintermute/base/base.h
+++ b/engines/wintermute/base/base.h
@@ -37,21 +37,21 @@
namespace WinterMute {
-class CBGame;
-class CBDynBuffer;
+class BaseGame;
+class BaseDynamicBuffer;
-class CBBase {
+class BaseClass {
public:
bool _persistable;
bool setEditorProp(const char *propName, const char *propValue);
const char *getEditorProp(const char *propName, const char *initVal = NULL);
- CBBase(TDynamicConstructor, TDynamicConstructor) {};
+ BaseClass(TDynamicConstructor, TDynamicConstructor) {};
bool parseEditorProperty(byte *buffer, bool complete = true);
- virtual bool saveAsText(CBDynBuffer *buffer, int indent = 0);
- CBBase();
- CBGame *_gameRef;
- CBBase(CBGame *GameOwner);
- virtual ~CBBase();
+ virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent = 0);
+ BaseClass();
+ BaseGame *_gameRef;
+ BaseClass(BaseGame *GameOwner);
+ virtual ~BaseClass();
Common::HashMap<Common::String, Common::String> _editorProps;
Common::HashMap<Common::String, Common::String>::iterator _editorPropsIter;
diff --git a/engines/wintermute/base/base_active_rect.cpp b/engines/wintermute/base/base_active_rect.cpp
index 5895b1acd5..493b35bf12 100644
--- a/engines/wintermute/base/base_active_rect.cpp
+++ b/engines/wintermute/base/base_active_rect.cpp
@@ -35,8 +35,8 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-CBActiveRect::CBActiveRect(CBGame *inGame): CBBase(inGame) {
- CBPlatform::setRectEmpty(&_rect);
+BaseActiveRect::BaseActiveRect(BaseGame *inGame): BaseClass(inGame) {
+ BasePlatform::setRectEmpty(&_rect);
_owner = NULL;
_frame = NULL;
_region = NULL;
@@ -48,10 +48,10 @@ CBActiveRect::CBActiveRect(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////
-CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *owner, CBSubFrame *frame, int x, int y, int width, int height, float zoomX, float zoomY, bool precise): CBBase(inGame) {
+BaseActiveRect::BaseActiveRect(BaseGame *inGame, BaseObject *owner, BaseSubFrame *frame, int x, int y, int width, int height, float zoomX, float zoomY, bool precise): BaseClass(inGame) {
_owner = owner;
_frame = frame;
- CBPlatform::setRect(&_rect, x, y, x + width, y + height);
+ BasePlatform::setRect(&_rect, x, y, x + width, y + height);
_zoomX = zoomX;
_zoomY = zoomY;
_precise = precise;
@@ -61,11 +61,11 @@ CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *owner, CBSubFrame *frame, i
}
//////////////////////////////////////////////////////////////////////
-CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *owner, CBRegion *region, int offsetX, int offsetY): CBBase(inGame) {
+BaseActiveRect::BaseActiveRect(BaseGame *inGame, BaseObject *owner, BaseRegion *region, int offsetX, int offsetY): BaseClass(inGame) {
_owner = owner;
_region = region;
- CBPlatform::copyRect(&_rect, &region->_rect);
- CBPlatform::offsetRect(&_rect, -offsetX, -offsetY);
+ BasePlatform::copyRect(&_rect, &region->_rect);
+ BasePlatform::offsetRect(&_rect, -offsetX, -offsetY);
_zoomX = 100;
_zoomY = 100;
_precise = true;
@@ -77,7 +77,7 @@ CBActiveRect::CBActiveRect(CBGame *inGame, CBObject *owner, CBRegion *region, in
//////////////////////////////////////////////////////////////////////
-CBActiveRect::~CBActiveRect() {
+BaseActiveRect::~BaseActiveRect() {
_owner = NULL;
_frame = NULL;
_region = NULL;
@@ -85,11 +85,11 @@ CBActiveRect::~CBActiveRect() {
//////////////////////////////////////////////////////////////////////////
-void CBActiveRect::clipRect() {
+void BaseActiveRect::clipRect() {
Rect32 rc;
bool customViewport;
_gameRef->getCurrentViewportRect(&rc, &customViewport);
- CBRenderer *Rend = _gameRef->_renderer;
+ BaseRenderer *Rend = _gameRef->_renderer;
if (!customViewport) {
rc.left -= Rend->_drawOffsetX;
@@ -101,7 +101,7 @@ void CBActiveRect::clipRect() {
if (rc.left > _rect.left) _offsetX = rc.left - _rect.left;
if (rc.top > _rect.top) _offsetY = rc.top - _rect.top;
- CBPlatform::intersectRect(&_rect, &_rect, &rc);
+ BasePlatform::intersectRect(&_rect, &_rect, &rc);
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/base_active_rect.h b/engines/wintermute/base/base_active_rect.h
index 7c9e8d4a39..0885b0e13e 100644
--- a/engines/wintermute/base/base_active_rect.h
+++ b/engines/wintermute/base/base_active_rect.h
@@ -33,25 +33,25 @@
#include "engines/wintermute/base/base.h"
namespace WinterMute {
-class CBRegion;
-class CBSubFrame;
-class CBObject;
-class CBActiveRect: CBBase {
+class BaseRegion;
+class BaseSubFrame;
+class BaseObject;
+class BaseActiveRect: BaseClass {
public:
void clipRect();
bool _precise;
float _zoomX;
float _zoomY;
- CBSubFrame *_frame;
- CBObject *_owner;
- CBRegion *_region;
+ BaseSubFrame *_frame;
+ BaseObject *_owner;
+ BaseRegion *_region;
int _offsetX;
int _offsetY;
Rect32 _rect;
- CBActiveRect(CBGame *inGameOwner = NULL);
- CBActiveRect(CBGame *inGameOwner, CBObject *owner, CBSubFrame *frame, int x, int y, int width, int height, float zoomX = 100, float zoomY = 100, bool precise = true);
- CBActiveRect(CBGame *inGame, CBObject *owner, CBRegion *region, int offsetX, int offsetY);
- virtual ~CBActiveRect();
+ BaseActiveRect(BaseGame *inGameOwner = NULL);
+ BaseActiveRect(BaseGame *inGameOwner, BaseObject *owner, BaseSubFrame *frame, int x, int y, int width, int height, float zoomX = 100, float zoomY = 100, bool precise = true);
+ BaseActiveRect(BaseGame *inGame, BaseObject *owner, BaseRegion *region, int offsetX, int offsetY);
+ virtual ~BaseActiveRect();
};
diff --git a/engines/wintermute/base/base_debugger.cpp b/engines/wintermute/base/base_debugger.cpp
index 8adeea2b1f..ef4f1ce686 100644
--- a/engines/wintermute/base/base_debugger.cpp
+++ b/engines/wintermute/base/base_debugger.cpp
@@ -31,172 +31,172 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBDebugger::CBDebugger(CBGame *inGame) : CBBase(inGame) {
+BaseDebugger::BaseDebugger(BaseGame *inGame) : BaseClass(inGame) {
_enabled = false;
}
//////////////////////////////////////////////////////////////////////////
-CBDebugger::~CBDebugger(void) {
+BaseDebugger::~BaseDebugger(void) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::initialize() {
+bool BaseDebugger::initialize() {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::shutdown() {
+bool BaseDebugger::shutdown() {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onGameInit() {
+bool BaseDebugger::onGameInit() {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onGameShutdown() {
+bool BaseDebugger::onGameShutdown() {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onGameTick() {
+bool BaseDebugger::onGameTick() {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onLog(unsigned int errorCode, const char *text) {
+bool BaseDebugger::onLog(unsigned int errorCode, const char *text) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptInit(CScScript *script) {
+bool BaseDebugger::onScriptInit(ScScript *script) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptEventThreadInit(CScScript *script, CScScript *parentScript, const char *name) {
+bool BaseDebugger::onScriptEventThreadInit(ScScript *script, ScScript *parentScript, const char *name) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptMethodThreadInit(CScScript *script, CScScript *parentScript, const char *name) {
+bool BaseDebugger::onScriptMethodThreadInit(ScScript *script, ScScript *parentScript, const char *name) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptShutdown(CScScript *script) {
+bool BaseDebugger::onScriptShutdown(ScScript *script) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptChangeLine(CScScript *script, int Line) {
+bool BaseDebugger::onScriptChangeLine(ScScript *script, int Line) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptChangeScope(CScScript *script, CScValue *scope) {
+bool BaseDebugger::onScriptChangeScope(ScScript *script, ScValue *scope) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptShutdownScope(CScScript *script, CScValue *scope) {
+bool BaseDebugger::onScriptShutdownScope(ScScript *script, ScValue *scope) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onVariableInit(EWmeDebuggerVariableType type, CScScript *script, CScValue *scope, CScValue *var, const char *variableName) {
+bool BaseDebugger::onVariableInit(EWmeDebuggerVariableType type, ScScript *script, ScValue *scope, ScValue *var, const char *variableName) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onVariableChangeValue(CScValue *var, CScValue *value) {
+bool BaseDebugger::onVariableChangeValue(ScValue *var, ScValue *value) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::onScriptHitBreakpoint(CScScript *script) {
+bool BaseDebugger::onScriptHitBreakpoint(ScScript *script) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
// IWmeDebugServer interface implementation
-bool CBDebugger::attachClient(IWmeDebugClient *client) {
+bool BaseDebugger::attachClient(IWmeDebugClient *client) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::detachClient(IWmeDebugClient *client) {
+bool BaseDebugger::detachClient(IWmeDebugClient *client) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::queryData(IWmeDebugClient *client) {
+bool BaseDebugger::queryData(IWmeDebugClient *client) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-int CBDebugger::getPropInt(const char *propName) {
+int BaseDebugger::getPropInt(const char *propName) {
return 0;
}
//////////////////////////////////////////////////////////////////////////
-double CBDebugger::getPropFloat(const char *propName) {
+double BaseDebugger::getPropFloat(const char *propName) {
return 0.0;
}
//////////////////////////////////////////////////////////////////////////
-const char *CBDebugger::getPropString(const char *propName) {
+const char *BaseDebugger::getPropString(const char *propName) {
return "";
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::getPropBool(const char *propName) {
+bool BaseDebugger::getPropBool(const char *propName) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::setProp(const char *propName, int propValue) {
+bool BaseDebugger::setProp(const char *propName, int propValue) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::setProp(const char *propName, double propValue) {
+bool BaseDebugger::setProp(const char *propName, double propValue) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::setProp(const char *propName, const char *propValue) {
+bool BaseDebugger::setProp(const char *propName, const char *propValue) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::setProp(const char *propName, bool propValue) {
+bool BaseDebugger::setProp(const char *propName, bool propValue) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::resolveFilename(const char *relativeFilename, char *absFilenameBuf, int absBufSize) {
+bool BaseDebugger::resolveFilename(const char *relativeFilename, char *absFilenameBuf, int absBufSize) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::addBreakpoint(const char *scriptFilename, int line) {
+bool BaseDebugger::addBreakpoint(const char *scriptFilename, int line) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::removeBreakpoint(const char *scriptFilename, int line) {
+bool BaseDebugger::removeBreakpoint(const char *scriptFilename, int line) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDebugger::continueExecution() {
+bool BaseDebugger::continueExecution() {
return false;
}
diff --git a/engines/wintermute/base/base_debugger.h b/engines/wintermute/base/base_debugger.h
index 35ea56eafe..7266e073d8 100644
--- a/engines/wintermute/base/base_debugger.h
+++ b/engines/wintermute/base/base_debugger.h
@@ -36,12 +36,12 @@
// TODO: The entire debugger should possibly be removed
namespace WinterMute {
-class CScScript;
-class CScValue;
-class CBDebugger : public CBBase, public IWmeDebugServer {
+class ScScript;
+class ScValue;
+class BaseDebugger : public BaseClass, public IWmeDebugServer {
public:
- CBDebugger(CBGame *inGame);
- virtual ~CBDebugger(void);
+ BaseDebugger(BaseGame *inGame);
+ virtual ~BaseDebugger(void);
// initialization
bool _enabled;
@@ -53,18 +53,18 @@ public:
bool onGameShutdown();
bool onGameTick();
bool onLog(unsigned int errorCode, const char *text);
- bool onScriptInit(CScScript *script);
- bool onScriptEventThreadInit(CScScript *script, CScScript *parentScript, const char *name);
- bool onScriptMethodThreadInit(CScScript *script, CScScript *parentScript, const char *name);
-
- bool onScriptShutdown(CScScript *script);
- bool onScriptChangeLine(CScScript *script, int line);
- bool onScriptChangeScope(CScScript *script, CScValue *scope);
- bool onScriptShutdownScope(CScScript *script, CScValue *scope);
- bool onVariableInit(EWmeDebuggerVariableType type, CScScript *script, CScValue *scope, CScValue *var, const char *variableName);
- bool onVariableChangeValue(CScValue *var, CScValue *value);
-
- bool onScriptHitBreakpoint(CScScript *script);
+ bool onScriptInit(ScScript *script);
+ bool onScriptEventThreadInit(ScScript *script, ScScript *parentScript, const char *name);
+ bool onScriptMethodThreadInit(ScScript *script, ScScript *parentScript, const char *name);
+
+ bool onScriptShutdown(ScScript *script);
+ bool onScriptChangeLine(ScScript *script, int line);
+ bool onScriptChangeScope(ScScript *script, ScValue *scope);
+ bool onScriptShutdownScope(ScScript *script, ScValue *scope);
+ bool onVariableInit(EWmeDebuggerVariableType type, ScScript *script, ScValue *scope, ScValue *var, const char *variableName);
+ bool onVariableChangeValue(ScValue *var, ScValue *value);
+
+ bool onScriptHitBreakpoint(ScScript *script);
// IWmeDebugServer interface
virtual bool attachClient(IWmeDebugClient *client);
diff --git a/engines/wintermute/base/base_dynamic_buffer.cpp b/engines/wintermute/base/base_dynamic_buffer.cpp
index 7453838219..8d6f88c9fe 100644
--- a/engines/wintermute/base/base_dynamic_buffer.cpp
+++ b/engines/wintermute/base/base_dynamic_buffer.cpp
@@ -32,7 +32,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBDynBuffer::CBDynBuffer(CBGame *inGame, uint32 initSize, uint32 growBy): CBBase(inGame) {
+BaseDynamicBuffer::BaseDynamicBuffer(BaseGame *inGame, uint32 initSize, uint32 growBy): BaseClass(inGame) {
_buffer = NULL;
_size = 0;
_realSize = 0;
@@ -46,13 +46,13 @@ CBDynBuffer::CBDynBuffer(CBGame *inGame, uint32 initSize, uint32 growBy): CBBase
//////////////////////////////////////////////////////////////////////////
-CBDynBuffer::~CBDynBuffer() {
+BaseDynamicBuffer::~BaseDynamicBuffer() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::cleanup() {
+void BaseDynamicBuffer::cleanup() {
if (_buffer) free(_buffer);
_buffer = NULL;
_size = 0;
@@ -63,20 +63,20 @@ void CBDynBuffer::cleanup() {
//////////////////////////////////////////////////////////////////////////
-uint32 CBDynBuffer::getSize() {
+uint32 BaseDynamicBuffer::getSize() {
return _size;
}
//////////////////////////////////////////////////////////////////////////
-bool CBDynBuffer::init(uint32 initSize) {
+bool BaseDynamicBuffer::init(uint32 initSize) {
cleanup();
if (initSize == 0) initSize = _initSize;
_buffer = (byte *)malloc(initSize);
if (!_buffer) {
- _gameRef->LOG(0, "CBDynBuffer::Init - Error allocating %d bytes", initSize);
+ _gameRef->LOG(0, "BaseDynamicBuffer::Init - Error allocating %d bytes", initSize);
return STATUS_FAILED;
}
@@ -88,14 +88,14 @@ bool CBDynBuffer::init(uint32 initSize) {
//////////////////////////////////////////////////////////////////////////
-bool CBDynBuffer::putBytes(byte *buffer, uint32 size) {
+bool BaseDynamicBuffer::putBytes(byte *buffer, uint32 size) {
if (!_initialized) init();
while (_offset + size > _realSize) {
_realSize += _growBy;
_buffer = (byte *)realloc(_buffer, _realSize);
if (!_buffer) {
- _gameRef->LOG(0, "CBDynBuffer::PutBytes - Error reallocating buffer to %d bytes", _realSize);
+ _gameRef->LOG(0, "BaseDynamicBuffer::PutBytes - Error reallocating buffer to %d bytes", _realSize);
return STATUS_FAILED;
}
}
@@ -109,11 +109,11 @@ bool CBDynBuffer::putBytes(byte *buffer, uint32 size) {
//////////////////////////////////////////////////////////////////////////
-bool CBDynBuffer::getBytes(byte *buffer, uint32 size) {
+bool BaseDynamicBuffer::getBytes(byte *buffer, uint32 size) {
if (!_initialized) init();
if (_offset + size > _size) {
- _gameRef->LOG(0, "CBDynBuffer::GetBytes - Buffer underflow");
+ _gameRef->LOG(0, "BaseDynamicBuffer::GetBytes - Buffer underflow");
return STATUS_FAILED;
}
@@ -125,13 +125,13 @@ bool CBDynBuffer::getBytes(byte *buffer, uint32 size) {
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::putDWORD(uint32 val) {
+void BaseDynamicBuffer::putDWORD(uint32 val) {
putBytes((byte *)&val, sizeof(uint32));
}
//////////////////////////////////////////////////////////////////////////
-uint32 CBDynBuffer::getDWORD() {
+uint32 BaseDynamicBuffer::getDWORD() {
uint32 ret;
getBytes((byte *)&ret, sizeof(uint32));
return ret;
@@ -139,7 +139,7 @@ uint32 CBDynBuffer::getDWORD() {
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::putString(const char *val) {
+void BaseDynamicBuffer::putString(const char *val) {
if (!val) putString("(null)");
else {
putDWORD(strlen(val) + 1);
@@ -149,7 +149,7 @@ void CBDynBuffer::putString(const char *val) {
//////////////////////////////////////////////////////////////////////////
-char *CBDynBuffer::getString() {
+char *BaseDynamicBuffer::getString() {
uint32 len = getDWORD();
char *ret = (char *)(_buffer + _offset);
_offset += len;
@@ -160,7 +160,7 @@ char *CBDynBuffer::getString() {
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::putText(const char *fmt, ...) {
+void BaseDynamicBuffer::putText(const char *fmt, ...) {
va_list va;
va_start(va, fmt);
@@ -171,7 +171,7 @@ void CBDynBuffer::putText(const char *fmt, ...) {
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::putTextIndent(int indent, const char *fmt, ...) {
+void BaseDynamicBuffer::putTextIndent(int indent, const char *fmt, ...) {
va_list va;
putText("%*s", indent, "");
@@ -183,7 +183,7 @@ void CBDynBuffer::putTextIndent(int indent, const char *fmt, ...) {
//////////////////////////////////////////////////////////////////////////
-void CBDynBuffer::putTextForm(const char *format, va_list argptr) {
+void BaseDynamicBuffer::putTextForm(const char *format, va_list argptr) {
char buff[32768];
vsprintf(buff, format, argptr);
putBytes((byte *)buff, strlen(buff));
diff --git a/engines/wintermute/base/base_dynamic_buffer.h b/engines/wintermute/base/base_dynamic_buffer.h
index 5795fe5bd1..0567f874df 100644
--- a/engines/wintermute/base/base_dynamic_buffer.h
+++ b/engines/wintermute/base/base_dynamic_buffer.h
@@ -34,7 +34,7 @@
namespace WinterMute {
-class CBDynBuffer : public CBBase {
+class BaseDynamicBuffer : public BaseClass {
public:
bool _initialized;
void putText(const char *fmt, ...);
@@ -50,8 +50,8 @@ public:
void cleanup();
uint32 _size;
byte *_buffer;
- CBDynBuffer(CBGame *inGame, uint32 initSize = 1000, uint32 growBy = 1000);
- virtual ~CBDynBuffer();
+ BaseDynamicBuffer(BaseGame *inGame, uint32 initSize = 1000, uint32 growBy = 1000);
+ virtual ~BaseDynamicBuffer();
private:
uint32 _realSize;
diff --git a/engines/wintermute/base/base_fader.cpp b/engines/wintermute/base/base_fader.cpp
index b34e89e41a..4dcdf82347 100644
--- a/engines/wintermute/base/base_fader.cpp
+++ b/engines/wintermute/base/base_fader.cpp
@@ -38,10 +38,10 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CBFader, false)
+IMPLEMENT_PERSISTENT(BaseFader, false)
//////////////////////////////////////////////////////////////////////////
-CBFader::CBFader(CBGame *inGame): CBObject(inGame) {
+BaseFader::BaseFader(BaseGame *inGame): BaseObject(inGame) {
_active = false;
_red = _green = _blue = 0;
_currentAlpha = 0x00;
@@ -54,20 +54,20 @@ CBFader::CBFader(CBGame *inGame): CBObject(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBFader::~CBFader() {
+BaseFader::~BaseFader() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBFader::update() {
+bool BaseFader::update() {
if (!_active) return STATUS_OK;
int alphaDelta = _targetAlpha - _sourceAlpha;
uint32 time;
- if (_system) time = CBPlatform::getTime() - _startTime;
+ if (_system) time = BasePlatform::getTime() - _startTime;
else time = _gameRef->_timer - _startTime;
if (time >= _duration) _currentAlpha = _targetAlpha;
@@ -84,7 +84,7 @@ bool CBFader::update() {
//////////////////////////////////////////////////////////////////////////
-bool CBFader::display() {
+bool BaseFader::display() {
if (!_active) return STATUS_OK;
if (_currentAlpha > 0x00) return _gameRef->_renderer->fadeToColor(BYTETORGBA(_red, _green, _blue, _currentAlpha));
@@ -93,7 +93,7 @@ bool CBFader::display() {
//////////////////////////////////////////////////////////////////////////
-bool CBFader::deactivate() {
+bool BaseFader::deactivate() {
_active = false;
_ready = true;
return STATUS_OK;
@@ -101,7 +101,7 @@ bool CBFader::deactivate() {
//////////////////////////////////////////////////////////////////////////
-bool CBFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
+bool BaseFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
_ready = false;
_active = true;
@@ -115,7 +115,7 @@ bool CBFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
_duration = duration;
_system = system;
- if (_system) _startTime = CBPlatform::getTime();
+ if (_system) _startTime = BasePlatform::getTime();
else _startTime = _gameRef->_timer;
return STATUS_OK;
@@ -123,7 +123,7 @@ bool CBFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
//////////////////////////////////////////////////////////////////////////
-bool CBFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
+bool BaseFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
_ready = false;
_active = true;
@@ -138,7 +138,7 @@ bool CBFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
_duration = duration;
_system = system;
- if (_system) _startTime = CBPlatform::getTime();
+ if (_system) _startTime = BasePlatform::getTime();
else _startTime = _gameRef->_timer;
@@ -147,15 +147,15 @@ bool CBFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
//////////////////////////////////////////////////////////////////////////
-uint32 CBFader::getCurrentColor() {
+uint32 BaseFader::getCurrentColor() {
return BYTETORGBA(_red, _green, _blue, _currentAlpha);
}
//////////////////////////////////////////////////////////////////////////
-bool CBFader::persist(CBPersistMgr *persistMgr) {
- CBObject::persist(persistMgr);
+bool BaseFader::persist(BasePersistenceManager *persistMgr) {
+ BaseObject::persist(persistMgr);
persistMgr->transfer(TMEMBER(_active));
persistMgr->transfer(TMEMBER(_blue));
diff --git a/engines/wintermute/base/base_fader.h b/engines/wintermute/base/base_fader.h
index 679f5d0903..36dd8a1d53 100644
--- a/engines/wintermute/base/base_fader.h
+++ b/engines/wintermute/base/base_fader.h
@@ -34,7 +34,7 @@
namespace WinterMute {
-class CBFader : public CBObject {
+class BaseFader : public BaseObject {
public:
bool _system;
uint32 getCurrentColor();
@@ -43,9 +43,9 @@ public:
bool deactivate();
bool display();
bool update();
- DECLARE_PERSISTENT(CBFader, CBObject)
- CBFader(CBGame *inGame);
- virtual ~CBFader();
+ DECLARE_PERSISTENT(BaseFader, BaseObject)
+ BaseFader(BaseGame *inGame);
+ virtual ~BaseFader();
bool _active;
byte _red;
byte _green;
diff --git a/engines/wintermute/base/base_file_manager.cpp b/engines/wintermute/base/base_file_manager.cpp
index 1cb0464a1f..a2c81b8a8c 100644
--- a/engines/wintermute/base/base_file_manager.cpp
+++ b/engines/wintermute/base/base_file_manager.cpp
@@ -58,7 +58,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
-CBFileManager::CBFileManager(CBGame *inGame): CBBase(inGame) {
+BaseFileManager::BaseFileManager(BaseGame *inGame): BaseClass(inGame) {
_basePath = NULL;
initPaths();
@@ -67,13 +67,13 @@ CBFileManager::CBFileManager(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////
-CBFileManager::~CBFileManager() {
+BaseFileManager::~BaseFileManager() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::cleanup() {
+bool BaseFileManager::cleanup() {
// delete registered paths
for (uint32 i = 0; i < _singlePaths.size(); i++)
delete [] _singlePaths[i];
@@ -114,7 +114,7 @@ bool CBFileManager::cleanup() {
#define MAX_FILE_SIZE 10000000
//////////////////////////////////////////////////////////////////////
-byte *CBFileManager::readWholeFile(const Common::String &filename, uint32 *size, bool mustExist) {
+byte *BaseFileManager::readWholeFile(const Common::String &filename, uint32 *size, bool mustExist) {
byte *buffer = NULL;
Common::SeekableReadStream *file = openFile(filename);
@@ -153,14 +153,14 @@ byte *CBFileManager::readWholeFile(const Common::String &filename, uint32 *size,
return buffer;
}
-Common::SeekableReadStream *CBFileManager::loadSaveGame(const Common::String &filename) {
+Common::SeekableReadStream *BaseFileManager::loadSaveGame(const Common::String &filename) {
Common::SaveFileManager *saveMan = g_wintermute->getSaveFileMan();
Common::InSaveFile *file = saveMan->openForLoading(filename);
return file;
}
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::saveFile(const Common::String &filename, byte *buffer, uint32 bufferSize, bool compressed, byte *prefixBuffer, uint32 prefixSize) {
+bool BaseFileManager::saveFile(const Common::String &filename, byte *buffer, uint32 bufferSize, bool compressed, byte *prefixBuffer, uint32 prefixSize) {
// TODO
warning("Implement SaveFile");
@@ -173,7 +173,7 @@ bool CBFileManager::saveFile(const Common::String &filename, byte *buffer, uint3
#if 0
RestoreCurrentDir();
- CBUtils::CreatePath(filename, false);
+ BaseUtils::CreatePath(filename, false);
FILE *f = fopen(filename, "wb");
if (!f) {
@@ -223,7 +223,7 @@ bool CBFileManager::saveFile(const Common::String &filename, byte *buffer, uint3
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::requestCD(int cd, char *packageFile, const char *filename) {
+bool BaseFileManager::requestCD(int cd, char *packageFile, const char *filename) {
// unmount all non-local packages
for (uint32 i = 0; i < _packages.size(); i++) {
if (_packages[i]->_cD > 0) _packages[i]->close();
@@ -235,7 +235,7 @@ bool CBFileManager::requestCD(int cd, char *packageFile, const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::addPath(TPathType type, const Common::String &path) {
+bool BaseFileManager::addPath(TPathType type, const Common::String &path) {
if (path.c_str() == NULL || strlen(path.c_str()) < 1) return STATUS_FAILED;
bool slashed = (path[path.size() - 1] == '\\' || path[path.size() - 1] == '/');
@@ -245,7 +245,7 @@ bool CBFileManager::addPath(TPathType type, const Common::String &path) {
strcpy(buffer, path.c_str());
if (!slashed) strcat(buffer, "\\");
- //CBPlatform::strlwr(buffer);
+ //BasePlatform::strlwr(buffer);
switch (type) {
case PATH_SINGLE:
@@ -260,7 +260,7 @@ bool CBFileManager::addPath(TPathType type, const Common::String &path) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::reloadPaths() {
+bool BaseFileManager::reloadPaths() {
// delete registered paths
for (uint32 i = 0; i < _singlePaths.size(); i++)
delete [] _singlePaths[i];
@@ -276,7 +276,7 @@ bool CBFileManager::reloadPaths() {
#define TEMP_BUFFER_SIZE 32768
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::initPaths() {
+bool BaseFileManager::initPaths() {
restoreCurrentDir();
AnsiString pathList;
@@ -284,10 +284,10 @@ bool CBFileManager::initPaths() {
// single files paths
pathList = _gameRef->_registry->readString("Resource", "CustomPaths", "");
- numPaths = CBUtils::strNumEntries(pathList.c_str(), ';');
+ numPaths = BaseUtils::strNumEntries(pathList.c_str(), ';');
for (int i = 0; i < numPaths; i++) {
- char *path = CBUtils::strEntry(i, pathList.c_str(), ';');
+ char *path = BaseUtils::strEntry(i, pathList.c_str(), ';');
if (path && strlen(path) > 0) {
addPath(PATH_SINGLE, path);
}
@@ -301,10 +301,10 @@ bool CBFileManager::initPaths() {
addPath(PATH_PACKAGE, "./");
pathList = _gameRef->_registry->readString("Resource", "PackagePaths", "");
- numPaths = CBUtils::strNumEntries(pathList.c_str(), ';');
+ numPaths = BaseUtils::strNumEntries(pathList.c_str(), ';');
for (int i = 0; i < numPaths; i++) {
- char *path = CBUtils::strEntry(i, pathList.c_str(), ';');
+ char *path = BaseUtils::strEntry(i, pathList.c_str(), ';');
if (path && strlen(path) > 0) {
addPath(PATH_PACKAGE, path);
}
@@ -318,7 +318,7 @@ bool CBFileManager::initPaths() {
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::registerPackages() {
+bool BaseFileManager::registerPackages() {
restoreCurrentDir();
_gameRef->LOG(0, "Scanning packages...");
@@ -365,7 +365,7 @@ bool CBFileManager::registerPackages() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::registerPackage(const Common::String &filename , bool searchSignature) {
+bool BaseFileManager::registerPackage(const Common::String &filename , bool searchSignature) {
// FILE *f = fopen(filename, "rb");
Common::File *package = new Common::File();
package->open(filename);
@@ -411,7 +411,7 @@ bool CBFileManager::registerPackage(const Common::String &filename , bool search
}
for (uint32 i = 0; i < hdr.NumDirs; i++) {
- CBPackage *pkg = new CBPackage(_gameRef);
+ BasePackage *pkg = new BasePackage(_gameRef);
if (!pkg) return STATUS_FAILED;
pkg->_boundToExe = boundToExe;
@@ -450,7 +450,7 @@ bool CBFileManager::registerPackage(const Common::String &filename , bool search
name[nameLength - 1] = '\0';
- CBPlatform::strupr(name);
+ BasePlatform::strupr(name);
offset = package->readUint32LE();
offset += absoluteOffset;
@@ -464,7 +464,7 @@ bool CBFileManager::registerPackage(const Common::String &filename , bool search
}
_filesIter = _files.find(name);
if (_filesIter == _files.end()) {
- CBFileEntry *file = new CBFileEntry(_gameRef);
+ BaseFileEntry *file = new BaseFileEntry(_gameRef);
file->_package = pkg;
file->_offset = offset;
file->_length = length;
@@ -492,7 +492,7 @@ bool CBFileManager::registerPackage(const Common::String &filename , bool search
}
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::isValidPackage(const AnsiString &fileName) const {
+bool BaseFileManager::isValidPackage(const AnsiString &fileName) const {
AnsiString plainName = PathUtil::getFileNameWithoutExtension(fileName);
// check for device-type specific packages
@@ -503,7 +503,7 @@ bool CBFileManager::isValidPackage(const AnsiString &fileName) const {
}
//////////////////////////////////////////////////////////////////////////
-Common::File *CBFileManager::openPackage(const Common::String &name) {
+Common::File *BaseFileManager::openPackage(const Common::String &name) {
//TODO: Is it really necessary to do this when we have the ScummVM-system?
//RestoreCurrentDir();
@@ -524,14 +524,14 @@ Common::File *CBFileManager::openPackage(const Common::String &name) {
if (ret->isOpen()) {
return ret;
}
- warning("CBFileManager::OpenPackage - Couldn't load file %s", name.c_str());
+ warning("BaseFileManager::OpenPackage - Couldn't load file %s", name.c_str());
delete ret;
return NULL;
}
//////////////////////////////////////////////////////////////////////////
-Common::File *CBFileManager::openSingleFile(const Common::String &name) {
+Common::File *BaseFileManager::openSingleFile(const Common::String &name) {
restoreCurrentDir();
Common::File *ret = NULL;
@@ -556,7 +556,7 @@ Common::File *CBFileManager::openSingleFile(const Common::String &name) {
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::getFullPath(const Common::String &filename, char *fullname) {
+bool BaseFileManager::getFullPath(const Common::String &filename, char *fullname) {
restoreCurrentDir();
Common::File f;
@@ -586,12 +586,12 @@ bool CBFileManager::getFullPath(const Common::String &filename, char *fullname)
//////////////////////////////////////////////////////////////////////////
-CBFileEntry *CBFileManager::getPackageEntry(const Common::String &filename) {
+BaseFileEntry *BaseFileManager::getPackageEntry(const Common::String &filename) {
char *upc_name = new char[strlen(filename.c_str()) + 1];
strcpy(upc_name, filename.c_str());
- CBPlatform::strupr(upc_name);
+ BasePlatform::strupr(upc_name);
- CBFileEntry *ret = NULL;
+ BaseFileEntry *ret = NULL;
_filesIter = _files.find(upc_name);
if (_filesIter != _files.end()) ret = _filesIter->_value;
@@ -600,7 +600,7 @@ CBFileEntry *CBFileManager::getPackageEntry(const Common::String &filename) {
return ret;
}
-bool CBFileManager::hasFile(const Common::String &filename) {
+bool BaseFileManager::hasFile(const Common::String &filename) {
//TODO: Do this in a much simpler fashion
Common::SeekableReadStream *stream = openFile(filename, true, false);
if (!stream) {
@@ -611,7 +611,7 @@ bool CBFileManager::hasFile(const Common::String &filename) {
}
//////////////////////////////////////////////////////////////////////////
-Common::SeekableReadStream *CBFileManager::openFile(const Common::String &filename, bool absPathWarning, bool keepTrackOf) {
+Common::SeekableReadStream *BaseFileManager::openFile(const Common::String &filename, bool absPathWarning, bool keepTrackOf) {
if (strcmp(filename.c_str(), "") == 0) return NULL;
//_gameRef->LOG(0, "open file: %s", filename);
/*#ifdef __WIN32__
@@ -631,7 +631,7 @@ Common::SeekableReadStream *CBFileManager::openFile(const Common::String &filena
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::closeFile(Common::SeekableReadStream *File) {
+bool BaseFileManager::closeFile(Common::SeekableReadStream *File) {
for (uint32 i = 0; i < _openFiles.size(); i++) {
if (_openFiles[i] == File) {
delete _openFiles[i];
@@ -644,13 +644,13 @@ bool CBFileManager::closeFile(Common::SeekableReadStream *File) {
//////////////////////////////////////////////////////////////////////////
-Common::SeekableReadStream *CBFileManager::openFileRaw(const Common::String &filename) {
+Common::SeekableReadStream *BaseFileManager::openFileRaw(const Common::String &filename) {
restoreCurrentDir();
Common::SeekableReadStream *ret = NULL;
if (scumm_strnicmp(filename.c_str(), "savegame:", 9) == 0) {
- CBSaveThumbFile *SaveThumbFile = new CBSaveThumbFile(_gameRef);
+ BaseSaveThumbFile *SaveThumbFile = new BaseSaveThumbFile(_gameRef);
if (DID_SUCCEED(SaveThumbFile->open(filename))) {
ret = SaveThumbFile->getMemStream();
}
@@ -666,7 +666,7 @@ Common::SeekableReadStream *CBFileManager::openFileRaw(const Common::String &fil
ret = openPkgFile(filename, this);
if (ret) return ret;
- ret = CBResources::getFile(filename);
+ ret = BaseResources::getFile(filename);
if (ret) return ret;
warning("BFileManager::OpenFileRaw - Failed to open %s", filename.c_str());
@@ -675,19 +675,19 @@ Common::SeekableReadStream *CBFileManager::openFileRaw(const Common::String &fil
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::restoreCurrentDir() {
+bool BaseFileManager::restoreCurrentDir() {
if (!_basePath) return STATUS_OK;
else {
/*if (!chdir(_basePath)) return STATUS_OK;
else return STATUS_FAILED;*/
- warning("CBFileManager::RestoreCurrentDir - ignored");
+ warning("BaseFileManager::RestoreCurrentDir - ignored");
return STATUS_OK;
}
}
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::setBasePath(const Common::String &path) {
+bool BaseFileManager::setBasePath(const Common::String &path) {
cleanup();
if (path.c_str()) {
@@ -703,7 +703,7 @@ bool CBFileManager::setBasePath(const Common::String &path) {
//////////////////////////////////////////////////////////////////////////
-bool CBFileManager::findPackageSignature(Common::File *f, uint32 *offset) {
+bool BaseFileManager::findPackageSignature(Common::File *f, uint32 *offset) {
byte buf[32768];
byte signature[8];
diff --git a/engines/wintermute/base/base_file_manager.h b/engines/wintermute/base/base_file_manager.h
index 1bf3156ebe..469108bee8 100644
--- a/engines/wintermute/base/base_file_manager.h
+++ b/engines/wintermute/base/base_file_manager.h
@@ -38,8 +38,8 @@ class File;
}
namespace WinterMute {
-class CBFile;
-class CBFileManager: CBBase {
+class BaseFile;
+class BaseFileManager: BaseClass {
public:
bool findPackageSignature(Common::File *f, uint32 *offset);
bool cleanup();
@@ -51,7 +51,7 @@ public:
bool closeFile(Common::SeekableReadStream *File);
bool hasFile(const Common::String &filename);
Common::SeekableReadStream *openFile(const Common::String &filename, bool absPathWarning = true, bool keepTrackOf = true);
- CBFileEntry *getPackageEntry(const Common::String &filename);
+ BaseFileEntry *getPackageEntry(const Common::String &filename);
Common::File *openSingleFile(const Common::String &name);
Common::File *openPackage(const Common::String &name);
bool registerPackages();
@@ -65,17 +65,17 @@ public:
Common::SeekableReadStream *loadSaveGame(const Common::String &filename);
bool saveFile(const Common::String &filename, byte *buffer, uint32 bufferSize, bool compressed = false, byte *prefixBuffer = NULL, uint32 prefixSize = 0);
byte *readWholeFile(const Common::String &filename, uint32 *size = NULL, bool mustExist = true);
- CBFileManager(CBGame *inGame = NULL);
- virtual ~CBFileManager();
+ BaseFileManager(BaseGame *inGame = NULL);
+ virtual ~BaseFileManager();
Common::Array<char *> _singlePaths;
Common::Array<char * > _packagePaths;
- Common::Array<CBPackage *> _packages;
+ Common::Array<BasePackage *> _packages;
Common::Array<Common::SeekableReadStream *> _openFiles;
- Common::HashMap<Common::String, CBFileEntry *> _files;
+ Common::HashMap<Common::String, BaseFileEntry *> _files;
private:
bool registerPackage(const Common::String &filename, bool searchSignature = false);
- Common::HashMap<Common::String, CBFileEntry *>::iterator _filesIter;
+ Common::HashMap<Common::String, BaseFileEntry *>::iterator _filesIter;
bool isValidPackage(const AnsiString &fileName) const;
};
diff --git a/engines/wintermute/base/base_frame.cpp b/engines/wintermute/base/base_frame.cpp
index 468ad29858..2a729a882a 100644
--- a/engines/wintermute/base/base_frame.cpp
+++ b/engines/wintermute/base/base_frame.cpp
@@ -42,10 +42,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBFrame, false)
+IMPLEMENT_PERSISTENT(BaseFrame, false)
//////////////////////////////////////////////////////////////////////
-CBFrame::CBFrame(CBGame *inGame): CBScriptable(inGame, true) {
+BaseFrame::BaseFrame(BaseGame *inGame): BaseScriptable(inGame, true) {
_delay = 0;
_moveX = _moveY = 0;
@@ -58,7 +58,7 @@ CBFrame::CBFrame(CBGame *inGame): CBScriptable(inGame, true) {
//////////////////////////////////////////////////////////////////////
-CBFrame::~CBFrame() {
+BaseFrame::~BaseFrame() {
delete _sound;
_sound = NULL;
@@ -75,7 +75,7 @@ CBFrame::~CBFrame() {
//////////////////////////////////////////////////////////////////////
-bool CBFrame::draw(int x, int y, CBObject *registerOwner, float zoomX, float zoomY, bool precise, uint32 alpha, bool allFrames, float rotate, TSpriteBlendMode blendMode) {
+bool BaseFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, float zoomY, bool precise, uint32 alpha, bool allFrames, float rotate, TSpriteBlendMode blendMode) {
bool res;
for (int i = 0; i < _subframes.getSize(); i++) {
@@ -87,7 +87,7 @@ bool CBFrame::draw(int x, int y, CBObject *registerOwner, float zoomX, float zoo
//////////////////////////////////////////////////////////////////////////
-bool CBFrame::oneTimeDisplay(CBObject *owner, bool muted) {
+bool BaseFrame::oneTimeDisplay(BaseObject *owner, bool muted) {
if (_sound && !muted) {
if (owner) owner->updateOneSound(_sound);
_sound->play();
@@ -131,7 +131,7 @@ TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF(KILL_SOUND)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
-bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
+bool BaseFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(DELAY)
TOKEN_TABLE(IMAGE)
@@ -158,7 +158,7 @@ bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
char *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
Rect32 rect;
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
@@ -170,7 +170,7 @@ bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
bool decoration = false;
bool mirrorX = false;
bool mirrorY = false;
- CBPlatform::setRectEmpty(&rect);
+ BasePlatform::setRectEmpty(&rect);
char *surface_file = NULL;
while ((cmd = parser.getCommand((char **)&buffer, commands, &params)) > 0) {
@@ -237,7 +237,7 @@ bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
break;
case TOKEN_SUBFRAME: {
- CBSubFrame *subframe = new CBSubFrame(_gameRef);
+ BaseSubFrame *subframe = new BaseSubFrame(_gameRef);
if (!subframe || DID_FAIL(subframe->loadBuffer((byte *)params, lifeTime, keepLoaded))) {
delete subframe;
cmd = PARSERR_GENERIC;
@@ -250,7 +250,7 @@ bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
delete _sound;
_sound = NULL;
}
- _sound = new CBSound(_gameRef);
+ _sound = new BaseSound(_gameRef);
if (!_sound || DID_FAIL(_sound->setSound(params, Audio::Mixer::kSFXSoundType, false))) {
if (_gameRef->_soundMgr->_soundAvailable) _gameRef->LOG(0, "Error loading sound '%s'.", params);
delete _sound;
@@ -290,7 +290,7 @@ bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
}
- CBSubFrame *sub = new CBSubFrame(_gameRef);
+ BaseSubFrame *sub = new BaseSubFrame(_gameRef);
if (surface_file != NULL) {
if (custoTrans) sub->setSurface(surface_file, false, r, g, b, lifeTime, keepLoaded);
else sub->setSurface(surface_file, true, 0, 0, 0, lifeTime, keepLoaded);
@@ -305,7 +305,7 @@ bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
if (custoTrans) sub->_transparent = BYTETORGBA(r, g, b, 0xFF);
}
- if (CBPlatform::isRectEmpty(&rect)) sub->setDefaultRect();
+ if (BasePlatform::isRectEmpty(&rect)) sub->setDefaultRect();
else sub->_rect = rect;
sub->_hotspotX = hotspotX;
@@ -325,15 +325,15 @@ bool CBFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
//////////////////////////////////////////////////////////////////////////
-bool CBFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
+bool BaseFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
- CBPlatform::setRectEmpty(rect);
+ BasePlatform::setRectEmpty(rect);
Rect32 subRect;
for (int i = 0; i < _subframes.getSize(); i++) {
_subframes[i]->getBoundingRect(&subRect, x, y, scaleX, scaleY);
- CBPlatform::unionRect(rect, rect, &subRect);
+ BasePlatform::unionRect(rect, rect, &subRect);
}
return true;
}
@@ -341,7 +341,7 @@ bool CBFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float sc
//////////////////////////////////////////////////////////////////////////
-bool CBFrame::saveAsText(CBDynBuffer *buffer, int indent) {
+bool BaseFrame::saveAsText(BaseDynamicBuffer *buffer, int indent) {
buffer->putTextIndent(indent, "FRAME {\n");
buffer->putTextIndent(indent + 2, "DELAY = %d\n", _delay);
@@ -369,7 +369,7 @@ bool CBFrame::saveAsText(CBDynBuffer *buffer, int indent) {
buffer->putTextIndent(indent + 2, "APPLY_EVENT=\"%s\"\n", _applyEvent[i]);
}
- CBBase::saveAsText(buffer, indent + 2);
+ BaseClass::saveAsText(buffer, indent + 2);
buffer->putTextIndent(indent, "}\n\n");
@@ -379,8 +379,8 @@ bool CBFrame::saveAsText(CBDynBuffer *buffer, int indent) {
//////////////////////////////////////////////////////////////////////////
-bool CBFrame::persist(CBPersistMgr *persistMgr) {
- CBScriptable::persist(persistMgr);
+bool BaseFrame::persist(BasePersistenceManager *persistMgr) {
+ BaseScriptable::persist(persistMgr);
_applyEvent.persist(persistMgr);
persistMgr->transfer(TMEMBER(_delay));
@@ -399,7 +399,7 @@ bool CBFrame::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseFrame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetSound
@@ -417,12 +417,12 @@ bool CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "SetSound") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
delete _sound;
_sound = NULL;
if (!val->isNULL()) {
- _sound = new CBSound(_gameRef);
+ _sound = new BaseSound(_gameRef);
if (!_sound || DID_FAIL(_sound->setSound(val->getString(), Audio::Mixer::kSFXSoundType, false))) {
stack->pushBool(false);
delete _sound;
@@ -451,14 +451,14 @@ bool CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "DeleteSubframe") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
if (val->isInt()) {
int index = val->getInt(-1);
if (index < 0 || index >= _subframes.getSize()) {
script->runtimeError("Frame.DeleteSubframe: Subframe index %d is out of range.", index);
}
} else {
- CBSubFrame *sub = (CBSubFrame *)val->getNative();
+ BaseSubFrame *sub = (BaseSubFrame *)val->getNative();
for (int i = 0; i < _subframes.getSize(); i++) {
if (_subframes[i] == sub) {
delete _subframes[i];
@@ -476,11 +476,11 @@ bool CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "AddSubframe") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
const char *filename = NULL;
if (!val->isNULL()) filename = val->getString();
- CBSubFrame *sub = new CBSubFrame(_gameRef);
+ BaseSubFrame *sub = new BaseSubFrame(_gameRef);
if (filename != NULL) {
sub->setSurface(filename);
sub->setDefaultRect();
@@ -499,11 +499,11 @@ bool CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
int index = stack->pop()->getInt();
if (index < 0) index = 0;
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
const char *filename = NULL;
if (!val->isNULL()) filename = val->getString();
- CBSubFrame *sub = new CBSubFrame(_gameRef);
+ BaseSubFrame *sub = new BaseSubFrame(_gameRef);
if (filename != NULL) {
sub->setSurface(filename);
}
@@ -565,14 +565,14 @@ bool CBFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
//////////////////////////////////////////////////////////////////////////
else {
if (_subframes.getSize() == 1) return _subframes[0]->scCallMethod(script, stack, thisStack, name);
- else return CBScriptable::scCallMethod(script, stack, thisStack, name);
+ else return BaseScriptable::scCallMethod(script, stack, thisStack, name);
}
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBFrame::scGetProperty(const char *name) {
- if (!_scValue) _scValue = new CScValue(_gameRef);
+ScValue *BaseFrame::scGetProperty(const char *name) {
+ if (!_scValue) _scValue = new ScValue(_gameRef);
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -642,13 +642,13 @@ CScValue *CBFrame::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
else {
if (_subframes.getSize() == 1) return _subframes[0]->scGetProperty(name);
- else return CBScriptable::scGetProperty(name);
+ else return BaseScriptable::scGetProperty(name);
}
}
//////////////////////////////////////////////////////////////////////////
-bool CBFrame::scSetProperty(const char *name, CScValue *value) {
+bool BaseFrame::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Delay
//////////////////////////////////////////////////////////////////////////
@@ -692,13 +692,13 @@ bool CBFrame::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
else {
if (_subframes.getSize() == 1) return _subframes[0]->scSetProperty(name, value);
- else return CBScriptable::scSetProperty(name, value);
+ else return BaseScriptable::scSetProperty(name, value);
}
}
//////////////////////////////////////////////////////////////////////////
-const char *CBFrame::scToString() {
+const char *BaseFrame::scToString() {
return "[frame]";
}
diff --git a/engines/wintermute/base/base_frame.h b/engines/wintermute/base/base_frame.h
index f3dec4e16f..dcbf74bc47 100644
--- a/engines/wintermute/base/base_frame.h
+++ b/engines/wintermute/base/base_frame.h
@@ -33,37 +33,37 @@
#include "engines/wintermute/coll_templ.h"
namespace WinterMute {
-class CBSound;
-class CBSubFrame;
-class CBObject;
-class CScScript;
-class CScStack;
-class CBFrame: public CBScriptable {
+class BaseSound;
+class BaseSubFrame;
+class BaseObject;
+class ScScript;
+class ScStack;
+class BaseFrame: public BaseScriptable {
public:
bool _killSound;
bool _keyframe;
- bool oneTimeDisplay(CBObject *owner, bool muted = false);
- DECLARE_PERSISTENT(CBFrame, CBScriptable)
- CBSound *_sound;
+ bool oneTimeDisplay(BaseObject *owner, bool muted = false);
+ DECLARE_PERSISTENT(BaseFrame, BaseScriptable)
+ BaseSound *_sound;
bool _editorExpanded;
bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
- bool saveAsText(CBDynBuffer *buffer, int indent);
+ bool saveAsText(BaseDynamicBuffer *buffer, int indent);
int _moveY;
int _moveX;
uint32 _delay;
- CBArray<CBSubFrame *, CBSubFrame *> _subframes;
- bool draw(int x, int y, CBObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, bool precise = true, uint32 Alpha = 0xFFFFFFFF, bool allFrames = false, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
+ BaseArray<BaseSubFrame *, BaseSubFrame *> _subframes;
+ bool draw(int x, int y, BaseObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, bool precise = true, uint32 Alpha = 0xFFFFFFFF, bool allFrames = false, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
bool loadBuffer(byte *buffer, int lifeTime, bool keepLoaded);
- CBFrame(CBGame *inGame);
- virtual ~CBFrame();
+ BaseFrame(BaseGame *inGame);
+ virtual ~BaseFrame();
- CBArray<const char *, const char *> _applyEvent;
+ BaseArray<const char *, const char *> _applyEvent;
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index 00c852e02d..0adc938895 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -74,11 +74,11 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CBGame, true)
+IMPLEMENT_PERSISTENT(BaseGame, true)
//////////////////////////////////////////////////////////////////////
-CBGame::CBGame(): CBObject(this) {
+BaseGame::BaseGame(): BaseObject(this) {
_shuttingDown = false;
_state = GAME_RUNNING;
@@ -143,8 +143,8 @@ CBGame::CBGame(): CBObject(this) {
_useD3D = false;
- _registry = new CBRegistry(this);
- _stringTable = new CBStringTable(this);
+ _registry = new BaseRegistry(this);
+ _stringTable = new BaseStringTable(this);
for (int i = 0; i < NUM_MUSIC_CHANNELS; i++) {
_music[i] = NULL;
@@ -205,7 +205,7 @@ CBGame::CBGame(): CBObject(this) {
_indicatorHeight = 8;
_richSavedGames = false;
_savedGameExt = NULL;
- CBUtils::setString(&_savedGameExt, "dsv");
+ BaseUtils::setString(&_savedGameExt, "dsv");
_musicCrossfadeRunning = false;
_musicCrossfadeStartTime = 0;
@@ -222,7 +222,7 @@ CBGame::CBGame(): CBObject(this) {
_loadImageX = _loadImageY = 0;
_localSaveDir = NULL;
- CBUtils::setString(&_localSaveDir, "saves");
+ BaseUtils::setString(&_localSaveDir, "saves");
_saveDirChecked = false;
_loadingIcon = NULL;
@@ -238,7 +238,7 @@ CBGame::CBGame(): CBObject(this) {
_lastCursor = NULL;
- CBPlatform::setRectEmpty(&_mouseLockRect);
+ BasePlatform::setRectEmpty(&_mouseLockRect);
_suppressScriptErrors = false;
_lastMiniUpdate = 0;
@@ -270,7 +270,7 @@ CBGame::CBGame(): CBObject(this) {
//////////////////////////////////////////////////////////////////////
-CBGame::~CBGame() {
+BaseGame::~BaseGame() {
_shuttingDown = true;
LOG(0, "");
@@ -330,12 +330,12 @@ CBGame::~CBGame() {
_stringTable = NULL;
DEBUG_DebugDisable();
- CBPlatform::outputDebugString("--- shutting down normally ---\n");
+ BasePlatform::outputDebugString("--- shutting down normally ---\n");
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::cleanup() {
+bool BaseGame::cleanup() {
delete _loadingIcon;
_loadingIcon = NULL;
@@ -414,50 +414,50 @@ bool CBGame::cleanup() {
//////////////////////////////////////////////////////////////////////
-bool CBGame::initialize1() {
+bool BaseGame::initialize1() {
bool loaded = false; // Not really a loop, but a goto-replacement.
while (!loaded) {
- _surfaceStorage = new CBSurfaceStorage(this);
+ _surfaceStorage = new BaseSurfaceStorage(this);
if (_surfaceStorage == NULL)
break;
- _fontStorage = new CBFontStorage(this);
+ _fontStorage = new BaseFontStorage(this);
if (_fontStorage == NULL)
break;
- _fileManager = new CBFileManager(this);
+ _fileManager = new BaseFileManager(this);
if (_fileManager == NULL)
break;
- _soundMgr = new CBSoundMgr(this);
+ _soundMgr = new BaseSoundMgr(this);
if (_soundMgr == NULL)
break;
- _debugMgr = new CBDebugger(this);
+ _debugMgr = new BaseDebugger(this);
if (_debugMgr == NULL)
break;
- _mathClass = new CSXMath(this);
+ _mathClass = new SXMath(this);
if (_mathClass == NULL)
break;
- _scEngine = new CScEngine(this);
+ _scEngine = new ScEngine(this);
if (_scEngine == NULL)
break;
- _videoPlayer = new CVidPlayer(this);
+ _videoPlayer = new VideoPlayer(this);
if (_videoPlayer == NULL)
break;
- _transMgr = new CBTransitionMgr(this);
+ _transMgr = new BaseTransitionMgr(this);
if (_transMgr == NULL)
break;
- _keyboardState = new CBKeyboardState(this);
+ _keyboardState = new BaseKeyboardState(this);
if (_keyboardState == NULL)
break;
- _fader = new CBFader(this);
+ _fader = new BaseFader(this);
if (_fader == NULL)
break;
registerObject(_fader);
@@ -483,7 +483,7 @@ bool CBGame::initialize1() {
//////////////////////////////////////////////////////////////////////
-bool CBGame::initialize2() { // we know whether we are going to be accelerated
+bool BaseGame::initialize2() { // we know whether we are going to be accelerated
_renderer = makeOSystemRenderer(this);
if (_renderer == NULL) return STATUS_FAILED;
@@ -492,7 +492,7 @@ bool CBGame::initialize2() { // we know whether we are going to be accelerated
//////////////////////////////////////////////////////////////////////
-bool CBGame::initialize3() { // renderer is initialized
+bool BaseGame::initialize3() { // renderer is initialized
_posX = _renderer->_width / 2;
_posY = _renderer->_height / 2;
@@ -505,7 +505,7 @@ bool CBGame::initialize3() { // renderer is initialized
//////////////////////////////////////////////////////////////////////
-void CBGame::DEBUG_DebugEnable(const char *filename) {
+void BaseGame::DEBUG_DebugEnable(const char *filename) {
_debugDebugMode = true;
/* time_t timeNow;
@@ -532,14 +532,14 @@ void CBGame::DEBUG_DebugEnable(const char *filename) {
LOG(0, "%s ver %d.%d.%d%s, Compiled on " __DATE__ ", " __TIME__, DCGF_NAME, DCGF_VER_MAJOR, DCGF_VER_MINOR, DCGF_VER_BUILD, DCGF_VER_SUFFIX);
//LOG(0, "Extensions: %s ver %d.%02d", EXT_NAME, EXT_VER_MAJOR, EXT_VER_MINOR);
- AnsiString platform = CBPlatform::getPlatformName();
+ AnsiString platform = BasePlatform::getPlatformName();
LOG(0, "Platform: %s", platform.c_str());
LOG(0, "");
}
//////////////////////////////////////////////////////////////////////
-void CBGame::DEBUG_DebugDisable() {
+void BaseGame::DEBUG_DebugDisable() {
if (_debugLogFile != NULL) {
LOG(0, "********** DEBUG LOG CLOSED ********************************************");
//fclose((FILE *)_debugLogFile);
@@ -550,7 +550,7 @@ void CBGame::DEBUG_DebugDisable() {
//////////////////////////////////////////////////////////////////////
-void CBGame::LOG(bool res, const char *fmt, ...) {
+void BaseGame::LOG(bool res, const char *fmt, ...) {
uint32 secs = g_system->getMillis() / 1000;
uint32 hours = secs / 3600;
secs = secs % 3600;
@@ -580,17 +580,17 @@ void CBGame::LOG(bool res, const char *fmt, ...) {
//////////////////////////////////////////////////////////////////////////
-void CBGame::setEngineLogCallback(ENGINE_LOG_CALLBACK callback, void *data) {
+void BaseGame::setEngineLogCallback(ENGINE_LOG_CALLBACK callback, void *data) {
_engineLogCallback = callback;
_engineLogCallbackData = data;
}
//////////////////////////////////////////////////////////////////////
-bool CBGame::initLoop() {
+bool BaseGame::initLoop() {
_viewportSP = -1;
- _currentTime = CBPlatform::getTime();
+ _currentTime = BasePlatform::getTime();
getDebugMgr()->onGameTick();
_renderer->initLoop();
@@ -645,35 +645,35 @@ bool CBGame::initLoop() {
//////////////////////////////////////////////////////////////////////
-bool CBGame::initInput() {
+bool BaseGame::initInput() {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-int CBGame::getSequence() {
+int BaseGame::getSequence() {
return ++_sequence;
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::setOffset(int offsetX, int offsetY) {
+void BaseGame::setOffset(int offsetX, int offsetY) {
_offsetX = offsetX;
_offsetY = offsetY;
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::getOffset(int *offsetX, int *offsetY) {
+void BaseGame::getOffset(int *offsetX, int *offsetY) {
if (offsetX != NULL) *offsetX = _offsetX;
if (offsetY != NULL) *offsetY = _offsetY;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::loadFile(const char *filename) {
+bool BaseGame::loadFile(const char *filename) {
byte *buffer = _gameRef->_fileManager->readWholeFile(filename);
if (buffer == NULL) {
- _gameRef->LOG(0, "CBGame::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseGame::LoadFile failed for file '%s'", filename);
return STATUS_FAILED;
}
@@ -740,7 +740,7 @@ TOKEN_DEF(GUID)
TOKEN_DEF(COMPAT_KILL_METHOD_THREADS)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-bool CBGame::loadBuffer(byte *buffer, bool complete) {
+bool BaseGame::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(GAME)
TOKEN_TABLE(TEMPLATE)
@@ -778,7 +778,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
byte *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if (complete) {
if (parser.getCommand((char **)&buffer, commands, (char **)&params) != TOKEN_GAME) {
@@ -819,7 +819,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
case TOKEN_CURSOR:
delete _cursor;
- _cursor = new CBSprite(_gameRef);
+ _cursor = new BaseSprite(_gameRef);
if (!_cursor || DID_FAIL(_cursor->loadFile((char *)params))) {
delete _cursor;
_cursor = NULL;
@@ -830,7 +830,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
case TOKEN_ACTIVE_CURSOR:
delete _activeCursor;
_activeCursor = NULL;
- _activeCursor = new CBSprite(_gameRef);
+ _activeCursor = new BaseSprite(_gameRef);
if (!_activeCursor || DID_FAIL(_activeCursor->loadFile((char *)params))) {
delete _activeCursor;
_activeCursor = NULL;
@@ -840,7 +840,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
case TOKEN_NONINTERACTIVE_CURSOR:
delete _cursorNoninteractive;
- _cursorNoninteractive = new CBSprite(_gameRef);
+ _cursorNoninteractive = new BaseSprite(_gameRef);
if (!_cursorNoninteractive || DID_FAIL(_cursorNoninteractive->loadFile((char *)params))) {
delete _cursorNoninteractive;
_cursorNoninteractive = NULL;
@@ -908,7 +908,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_SAVE_IMAGE:
- CBUtils::setString(&_saveImageName, (char *)params);
+ BaseUtils::setString(&_saveImageName, (char *)params);
break;
case TOKEN_SAVE_IMAGE_X:
@@ -920,7 +920,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_LOAD_IMAGE:
- CBUtils::setString(&_loadImageName, (char *)params);
+ BaseUtils::setString(&_loadImageName, (char *)params);
break;
case TOKEN_LOAD_IMAGE_X:
@@ -932,7 +932,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
break;
case TOKEN_LOCAL_SAVE_DIR:
- CBUtils::setString(&_localSaveDir, (char *)params);
+ BaseUtils::setString(&_localSaveDir, (char *)params);
break;
case TOKEN_COMPAT_KILL_METHOD_THREADS:
@@ -960,7 +960,7 @@ bool CBGame::loadBuffer(byte *buffer, bool complete) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// LOG
//////////////////////////////////////////////////////////////////////////
@@ -975,7 +975,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
// Caption
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Caption") == 0) {
- bool res = CBObject::scCallMethod(script, stack, thisStack, name);
+ bool res = BaseObject::scCallMethod(script, stack, thisStack, name);
setWindowTitle();
return res;
}
@@ -1010,7 +1010,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
else if (strcmp(name, "LoadStringTable") == 0) {
stack->correctParams(2);
const char *filename = stack->pop()->getString();
- CScValue *Val = stack->pop();
+ ScValue *Val = stack->pop();
bool ClearOld;
if (Val->isNULL()) ClearOld = true;
@@ -1029,8 +1029,8 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ValidObject") == 0) {
stack->correctParams(1);
- CBScriptable *obj = stack->pop()->getNative();
- if (validObject((CBObject *) obj)) stack->pushBool(true);
+ BaseScriptable *obj = stack->pop()->getNative();
+ if (validObject((BaseObject *) obj)) stack->pushBool(true);
else stack->pushBool(false);
return STATUS_OK;
@@ -1053,8 +1053,8 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "UnloadObject") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
- CBObject *obj = (CBObject *)val->getNative();
+ ScValue *val = stack->pop();
+ BaseObject *obj = (BaseObject *)val->getNative();
unregisterObject(obj);
if (val->getType() == VAL_VARIABLE_REF) val->setNULL();
@@ -1067,7 +1067,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "LoadWindow") == 0) {
stack->correctParams(1);
- CUIWindow *win = new CUIWindow(_gameRef);
+ UIWindow *win = new UIWindow(_gameRef);
if (win && DID_SUCCEED(win->loadFile(stack->pop()->getString()))) {
_windows.add(win);
registerObject(win);
@@ -1085,7 +1085,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ExpandString") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
char *str = new char[strlen(val->getString()) + 1];
strcpy(str, val->getString());
_stringTable->expand(&str);
@@ -1106,10 +1106,10 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
}
const char *filename = stack->pop()->getString();
- CScValue *valLooping = stack->pop();
+ ScValue *valLooping = stack->pop();
bool looping = valLooping->isNULL() ? true : valLooping->getBool();
- CScValue *valLoopStart = stack->pop();
+ ScValue *valLoopStart = stack->pop();
uint32 loopStart = (uint32)(valLoopStart->isNULL() ? 0 : valLoopStart->getInt());
@@ -1311,7 +1311,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
int length = 0;
const char *filename = stack->pop()->getString();
- CBSound *sound = new CBSound(_gameRef);
+ BaseSound *sound = new BaseSound(_gameRef);
if (sound && DID_SUCCEED(sound->setSound(filename, Audio::Mixer::kMusicSoundType, true))) {
length = sound->getLength();
delete sound;
@@ -1336,7 +1336,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
p.x = x + _renderer->_drawOffsetX;
p.y = y + _renderer->_drawOffsetY;
- CBPlatform::setCursorPos(p.x, p.y);
+ BasePlatform::setCursorPos(p.x, p.y);
stack->pushNULL();
return STATUS_OK;
@@ -1352,10 +1352,10 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
int right = stack->pop()->getInt();
int bottom = stack->pop()->getInt();
- if (right < left) CBUtils::swap(&left, &right);
- if (bottom < top) CBUtils::swap(&top, &bottom);
+ if (right < left) BaseUtils::swap(&left, &right);
+ if (bottom < top) BaseUtils::swap(&top, &bottom);
- CBPlatform::setRect(&_mouseLockRect, left, top, right, bottom);
+ BasePlatform::setRect(&_mouseLockRect, left, top, right, bottom);
stack->pushNULL();
return STATUS_OK;
@@ -1377,7 +1377,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
stack->correctParams(6);
const char *filename = stack->pop()->getString();
warning("PlayVideo: %s - not implemented yet", filename);
- CScValue *valType = stack->pop();
+ ScValue *valType = stack->pop();
int Type;
if (valType->isNULL()) Type = (int)VID_PLAY_STRETCH;
else Type = valType->getInt();
@@ -1386,7 +1386,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
int yVal = stack->pop()->getInt();
bool FreezeMusic = stack->pop()->getBool(true);
- CScValue *valSub = stack->pop();
+ ScValue *valSub = stack->pop();
const char *SubtitleFile = valSub->isNULL() ? NULL : valSub->getString();
if (Type < (int)VID_PLAY_POS || Type > (int)VID_PLAY_CENTER)
@@ -1414,7 +1414,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
stack->correctParams(7);
const char *filename = stack->pop()->getString();
- CScValue *valType = stack->pop();
+ ScValue *valType = stack->pop();
int type;
if (valType->isNULL())
type = (int)VID_PLAY_STRETCH;
@@ -1425,13 +1425,13 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
bool freezeMusic = stack->pop()->getBool(true);
bool dropFrames = stack->pop()->getBool(true);
- CScValue *valSub = stack->pop();
+ ScValue *valSub = stack->pop();
const char *SubtitleFile = valSub->isNULL() ? NULL : valSub->getString();
if (type < (int)VID_PLAY_POS || type > (int)VID_PLAY_CENTER) type = (int)VID_PLAY_STRETCH;
delete _theoraPlayer;
- _theoraPlayer = new CVidTheoraPlayer(this);
+ _theoraPlayer = new VideoTheoraPlayer(this);
if (_theoraPlayer && DID_SUCCEED(_theoraPlayer->initialize(filename, SubtitleFile))) {
_theoraPlayer->_dontDropFrames = !dropFrames;
if (DID_SUCCEED(_theoraPlayer->play((TVideoPlayback)type, xVal, yVal, true, freezeMusic))) {
@@ -1776,7 +1776,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
stack->correctParams(1);
char filename[MAX_PATH_LENGTH];
- CScValue *Val = stack->pop();
+ ScValue *Val = stack->pop();
warning("BGame::ScCallMethod - Screenshot not reimplemented"); //TODO
int fileNum = 0;
@@ -1789,7 +1789,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
}
bool ret = false;
- CBImage *image = _gameRef->_renderer->takeScreenshot();
+ BaseImage *image = _gameRef->_renderer->takeScreenshot();
if (image) {
ret = DID_SUCCEED(image->saveBMPFile(filename));
delete image;
@@ -1809,7 +1809,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
int sizeY = stack->pop()->getInt(_renderer->_height);
bool ret = false;
- CBImage *image = _gameRef->_renderer->takeScreenshot();
+ BaseImage *image = _gameRef->_renderer->takeScreenshot();
if (image) {
ret = DID_SUCCEED(image->resize(sizeX, sizeY));
if (ret) ret = DID_SUCCEED(image->saveBMPFile(filename));
@@ -1825,9 +1825,9 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "CreateWindow") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
- CUIWindow *win = new CUIWindow(_gameRef);
+ UIWindow *win = new UIWindow(_gameRef);
_windows.add(win);
registerObject(win);
if (!val->isNULL()) win->setName(val->getString());
@@ -1840,7 +1840,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "DeleteWindow") == 0) {
stack->correctParams(1);
- CBObject *obj = (CBObject *)stack->pop()->getNative();
+ BaseObject *obj = (BaseObject *)stack->pop()->getNative();
for (int i = 0; i < _windows.getSize(); i++) {
if (_windows[i] == obj) {
unregisterObject(_windows[i]);
@@ -1876,7 +1876,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetLoadingScreen") == 0) {
stack->correctParams(3);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
_loadImageX = stack->pop()->getInt();
_loadImageY = stack->pop()->getInt();
@@ -1884,7 +1884,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
delete[] _loadImageName;
_loadImageName = NULL;
} else {
- CBUtils::setString(&_loadImageName, val->getString());
+ BaseUtils::setString(&_loadImageName, val->getString());
}
stack->pushNULL();
return STATUS_OK;
@@ -1895,7 +1895,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetSavingScreen") == 0) {
stack->correctParams(3);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
_saveImageX = stack->pop()->getInt();
_saveImageY = stack->pop()->getInt();
@@ -1903,7 +1903,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
delete[] _saveImageName;
_saveImageName = NULL;
} else {
- CBUtils::setString(&_saveImageName, val->getString());
+ BaseUtils::setString(&_saveImageName, val->getString());
}
stack->pushNULL();
return STATUS_OK;
@@ -1976,7 +1976,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
_loadingIconPersistent = stack->pop()->getBool();
delete _loadingIcon;
- _loadingIcon = new CBSprite(this);
+ _loadingIcon = new BaseSprite(this);
if (!_loadingIcon || DID_FAIL(_loadingIcon->loadFile(filename))) {
delete _loadingIcon;
_loadingIcon = NULL;
@@ -2035,7 +2035,7 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
else if (strcmp(name, "StoreSaveThumbnail") == 0) {
stack->correctParams(0);
delete _cachedThumbnail;
- _cachedThumbnail = new CBSaveThumbHelper(this);
+ _cachedThumbnail = new BaseSaveThumbHelper(this);
if (DID_FAIL(_cachedThumbnail->storeThumbnail())) {
delete _cachedThumbnail;
_cachedThumbnail = NULL;
@@ -2143,12 +2143,12 @@ bool CBGame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStac
return STATUS_OK;
}
- else return CBObject::scCallMethod(script, stack, thisStack, name);
+ else return BaseObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBGame::scGetProperty(const char *name) {
+ScValue *BaseGame::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -2185,7 +2185,7 @@ CScValue *CBGame::scGetProperty(const char *name) {
// WindowsTime (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WindowsTime") == 0) {
- _scValue->setInt((int)CBPlatform::getTime());
+ _scValue->setInt((int)BasePlatform::getTime());
return _scValue;
}
@@ -2504,7 +2504,7 @@ CScValue *CBGame::scGetProperty(const char *name) {
// Platform (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Platform") == 0) {
- _scValue->setString(CBPlatform::getPlatformName().c_str());
+ _scValue->setString(BasePlatform::getPlatformName().c_str());
return _scValue;
}
@@ -2534,12 +2534,12 @@ CScValue *CBGame::scGetProperty(const char *name) {
return _scValue;
}
- else return CBObject::scGetProperty(name);
+ else return BaseObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::scSetProperty(const char *name, CScValue *value) {
+bool BaseGame::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
@@ -2571,7 +2571,7 @@ bool CBGame::scSetProperty(const char *name, CScValue *value) {
// Caption
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Name") == 0) {
- bool res = CBObject::scSetProperty(name, value);
+ bool res = BaseObject::scSetProperty(name, value);
setWindowTitle();
return res;
}
@@ -2580,8 +2580,8 @@ bool CBGame::scSetProperty(const char *name, CScValue *value) {
// MainObject
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "MainObject") == 0) {
- CBScriptable *obj = value->getNative();
- if (obj == NULL || validObject((CBObject *)obj)) _mainObject = (CBObject *)obj;
+ BaseScriptable *obj = value->getNative();
+ if (obj == NULL || validObject((BaseObject *)obj)) _mainObject = (BaseObject *)obj;
return STATUS_OK;
}
@@ -2729,12 +2729,12 @@ bool CBGame::scSetProperty(const char *name, CScValue *value) {
return STATUS_OK;
}
- else return CBObject::scSetProperty(name, value);
+ else return BaseObject::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CBGame::scToString() {
+const char *BaseGame::scToString() {
return "[game object]";
}
@@ -2742,7 +2742,7 @@ const char *CBGame::scToString() {
#define QUICK_MSG_DURATION 3000
//////////////////////////////////////////////////////////////////////////
-bool CBGame::displayQuickMsg() {
+bool BaseGame::displayQuickMsg() {
if (_quickMessages.getSize() == 0 || !_systemFont) return STATUS_OK;
// update
@@ -2767,17 +2767,17 @@ bool CBGame::displayQuickMsg() {
#define MAX_QUICK_MSG 5
//////////////////////////////////////////////////////////////////////////
-void CBGame::quickMessage(const char *text) {
+void BaseGame::quickMessage(const char *text) {
if (_quickMessages.getSize() >= MAX_QUICK_MSG) {
delete _quickMessages[0];
_quickMessages.removeAt(0);
}
- _quickMessages.add(new CBQuickMsg(_gameRef, text));
+ _quickMessages.add(new BaseQuickMsg(_gameRef, text));
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::quickMessageForm(char *fmt, ...) {
+void BaseGame::quickMessageForm(char *fmt, ...) {
char buff[256];
va_list va;
@@ -2790,19 +2790,19 @@ void CBGame::quickMessageForm(char *fmt, ...) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::registerObject(CBObject *object) {
+bool BaseGame::registerObject(BaseObject *object) {
_regObjects.add(object);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::unregisterObject(CBObject *object) {
+bool BaseGame::unregisterObject(BaseObject *object) {
if (!object) return STATUS_OK;
// is it a window?
for (int i = 0; i < _windows.getSize(); i++) {
- if ((CBObject *)_windows[i] == object) {
+ if ((BaseObject *)_windows[i] == object) {
_windows.removeAt(i);
// get new focused window
@@ -2822,7 +2822,7 @@ bool CBGame::unregisterObject(CBObject *object) {
for (int i = 0; i < _regObjects.getSize(); i++) {
if (_regObjects[i] == object) {
_regObjects.removeAt(i);
- if (!_loadInProgress) CSysClassRegistry::getInstance()->enumInstances(invalidateValues, "CScValue", (void *)object);
+ if (!_loadInProgress) SystemClassRegistry::getInstance()->enumInstances(invalidateValues, "ScValue", (void *)object);
delete object;
return STATUS_OK;
}
@@ -2833,11 +2833,11 @@ bool CBGame::unregisterObject(CBObject *object) {
//////////////////////////////////////////////////////////////////////////
-void CBGame::invalidateValues(void *value, void *data) {
- CScValue *val = (CScValue *)value;
+void BaseGame::invalidateValues(void *value, void *data) {
+ ScValue *val = (ScValue *)value;
if (val->isNative() && val->getNative() == data) {
- if (!val->_persistent && ((CBScriptable *)data)->_refCount == 1) {
- ((CBScriptable *)data)->_refCount++;
+ if (!val->_persistent && ((BaseScriptable *)data)->_refCount == 1) {
+ ((BaseScriptable *)data)->_refCount++;
}
val->setNative(NULL);
val->setNULL();
@@ -2847,7 +2847,7 @@ void CBGame::invalidateValues(void *value, void *data) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::validObject(CBObject *object) {
+bool BaseGame::validObject(BaseObject *object) {
if (!object) return false;
if (object == this) return true;
@@ -2859,8 +2859,8 @@ bool CBGame::validObject(CBObject *object) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStack, char *name) {
- CScValue *thisObj;
+bool BaseGame::ExternalCall(ScScript *script, ScStack *stack, ScStack *thisStack, char *name) {
+ ScValue *thisObj;
//////////////////////////////////////////////////////////////////////////
// LOG
@@ -2947,8 +2947,8 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
else if (strcmp(name, "WaitFor") == 0) {
stack->correctParams(1);
- CBScriptable *obj = stack->pop()->getNative();
- if (validObject((CBObject *)obj)) script->waitForExclusive((CBObject *)obj);
+ BaseScriptable *obj = stack->pop()->getNative();
+ if (validObject((BaseObject *)obj)) script->waitForExclusive((BaseObject *)obj);
stack->pushNULL();
}
@@ -2961,7 +2961,7 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
int from = stack->pop()->getInt();
int to = stack->pop()->getInt();
- stack->pushInt(CBUtils::randomInt(from, to));
+ stack->pushInt(BaseUtils::randomInt(from, to));
}
//////////////////////////////////////////////////////////////////////////
@@ -2983,7 +2983,7 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
int g = stack->pop()->getInt();
int b = stack->pop()->getInt();
int a;
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
if (val->isNULL()) a = 255;
else a = val->getInt();
@@ -2999,7 +2999,7 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
int s = stack->pop()->getInt();
int l = stack->pop()->getInt();
- stack->pushInt(CBUtils::HSLtoRGB(h, s, l));
+ stack->pushInt(BaseUtils::HSLtoRGB(h, s, l));
}
//////////////////////////////////////////////////////////////////////////
@@ -3050,7 +3050,7 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
uint32 rgb = (uint32)stack->pop()->getInt();
byte H, S, L;
- CBUtils::RGBtoHSL(rgb, &H, &S, &L);
+ BaseUtils::RGBtoHSL(rgb, &H, &S, &L);
stack->pushInt(H);
}
@@ -3062,7 +3062,7 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
uint32 rgb = (uint32)stack->pop()->getInt();
byte H, S, L;
- CBUtils::RGBtoHSL(rgb, &H, &S, &L);
+ BaseUtils::RGBtoHSL(rgb, &H, &S, &L);
stack->pushInt(S);
}
@@ -3074,7 +3074,7 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
uint32 rgb = (uint32)stack->pop()->getInt();
byte H, S, L;
- CBUtils::RGBtoHSL(rgb, &H, &S, &L);
+ BaseUtils::RGBtoHSL(rgb, &H, &S, &L);
stack->pushInt(L);
}
@@ -3143,7 +3143,7 @@ bool CBGame::ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStac
//////////////////////////////////////////////////////////////////////////
-bool CBGame::showCursor() {
+bool BaseGame::showCursor() {
if (_cursorHidden) return STATUS_OK;
if (!_interactive && _gameRef->_state == GAME_RUNNING) {
@@ -3160,7 +3160,7 @@ bool CBGame::showCursor() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::SaveGame(int slot, const char *desc, bool quickSave) {
+bool BaseGame::SaveGame(int slot, const char *desc, bool quickSave) {
char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
@@ -3172,7 +3172,7 @@ bool CBGame::SaveGame(int slot, const char *desc, bool quickSave) {
_indicatorDisplay = true;
_indicatorProgress = 0;
- CBPersistMgr *pm = new CBPersistMgr(_gameRef);
+ BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
if (DID_FAIL(ret = pm->initSave(desc))) goto save_finish;
if (!quickSave) {
@@ -3188,8 +3188,8 @@ bool CBGame::SaveGame(int slot, const char *desc, bool quickSave) {
}
}
- if (DID_FAIL(ret = CSysClassRegistry::getInstance()->saveTable(_gameRef, pm, quickSave))) goto save_finish;
- if (DID_FAIL(ret = CSysClassRegistry::getInstance()->saveInstances(_gameRef, pm, quickSave))) goto save_finish;
+ if (DID_FAIL(ret = SystemClassRegistry::getInstance()->saveTable(_gameRef, pm, quickSave))) goto save_finish;
+ if (DID_FAIL(ret = SystemClassRegistry::getInstance()->saveInstances(_gameRef, pm, quickSave))) goto save_finish;
if (DID_FAIL(ret = pm->saveFile(filename))) goto save_finish;
_registry->writeInt("System", "MostRecentSaveSlot", slot);
@@ -3206,8 +3206,8 @@ save_finish: // TODO: Remove gotos
//////////////////////////////////////////////////////////////////////////
-bool CBGame::loadGame(int slot) {
- //_gameRef->LOG(0, "Load start %d", CBUtils::GetUsedMemMB());
+bool BaseGame::loadGame(int slot) {
+ //_gameRef->LOG(0, "Load start %d", BaseUtils::GetUsedMemMB());
_loading = false;
_scheduledLoadSlot = -1;
@@ -3220,7 +3220,7 @@ bool CBGame::loadGame(int slot) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::loadGame(const char *filename) {
+bool BaseGame::loadGame(const char *filename) {
LOG(0, "Loading game '%s'...", filename);
getDebugMgr()->onGameShutdown();
@@ -3241,13 +3241,13 @@ bool CBGame::loadGame(const char *filename) {
_loadInProgress = true;
_indicatorDisplay = true;
_indicatorProgress = 0;
- CBPersistMgr *pm = new CBPersistMgr(_gameRef);
+ BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
_debugAbsolutePathWarning = false;
if (DID_FAIL(ret = pm->initLoad(filename))) goto load_finish;
//if(DID_FAIL(ret = cleanup())) goto load_finish;
- if (DID_FAIL(ret = CSysClassRegistry::getInstance()->loadTable(_gameRef, pm))) goto load_finish;
- if (DID_FAIL(ret = CSysClassRegistry::getInstance()->loadInstances(_gameRef, pm))) goto load_finish;
+ if (DID_FAIL(ret = SystemClassRegistry::getInstance()->loadTable(_gameRef, pm))) goto load_finish;
+ if (DID_FAIL(ret = SystemClassRegistry::getInstance()->loadInstances(_gameRef, pm))) goto load_finish;
// data initialization after load
initAfterLoad();
@@ -3269,19 +3269,19 @@ load_finish:
delete _saveLoadImage;
_saveLoadImage = NULL;
- //_gameRef->LOG(0, "Load end %d", CBUtils::GetUsedMemMB());
+ //_gameRef->LOG(0, "Load end %d", BaseUtils::GetUsedMemMB());
return ret;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::initAfterLoad() {
- CSysClassRegistry::getInstance()->enumInstances(afterLoadRegion, "CBRegion", NULL);
- CSysClassRegistry::getInstance()->enumInstances(afterLoadSubFrame, "CBSubFrame", NULL);
- CSysClassRegistry::getInstance()->enumInstances(afterLoadSound, "CBSound", NULL);
- CSysClassRegistry::getInstance()->enumInstances(afterLoadFont, "CBFontTT", NULL);
- CSysClassRegistry::getInstance()->enumInstances(afterLoadScript, "CScScript", NULL);
+bool BaseGame::initAfterLoad() {
+ SystemClassRegistry::getInstance()->enumInstances(afterLoadRegion, "BaseRegion", NULL);
+ SystemClassRegistry::getInstance()->enumInstances(afterLoadSubFrame, "BaseSubFrame", NULL);
+ SystemClassRegistry::getInstance()->enumInstances(afterLoadSound, "BaseSound", NULL);
+ SystemClassRegistry::getInstance()->enumInstances(afterLoadFont, "BaseFontTT", NULL);
+ SystemClassRegistry::getInstance()->enumInstances(afterLoadScript, "ScScript", NULL);
_scEngine->refreshScriptBreakpoints();
@@ -3289,35 +3289,35 @@ bool CBGame::initAfterLoad() {
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::afterLoadRegion(void *region, void *data) {
- ((CBRegion *)region)->createRegion();
+void BaseGame::afterLoadRegion(void *region, void *data) {
+ ((BaseRegion *)region)->createRegion();
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::afterLoadSubFrame(void *subframe, void *data) {
- ((CBSubFrame *)subframe)->setSurfaceSimple();
+void BaseGame::afterLoadSubFrame(void *subframe, void *data) {
+ ((BaseSubFrame *)subframe)->setSurfaceSimple();
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::afterLoadSound(void *sound, void *data) {
- ((CBSound *)sound)->setSoundSimple();
+void BaseGame::afterLoadSound(void *sound, void *data) {
+ ((BaseSound *)sound)->setSoundSimple();
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::afterLoadFont(void *font, void *data) {
- ((CBFont *)font)->afterLoad();
+void BaseGame::afterLoadFont(void *font, void *data) {
+ ((BaseFont *)font)->afterLoad();
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::afterLoadScript(void *script, void *data) {
- ((CScScript *)script)->afterLoad();
+void BaseGame::afterLoadScript(void *script, void *data) {
+ ((ScScript *)script)->afterLoad();
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::displayWindows(bool inGame) {
+bool BaseGame::displayWindows(bool inGame) {
bool res;
// did we lose focus? focus topmost window
@@ -3345,7 +3345,7 @@ bool CBGame::displayWindows(bool inGame) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::playMusic(int channel, const char *filename, bool looping, uint32 loopStart) {
+bool BaseGame::playMusic(int channel, const char *filename, bool looping, uint32 loopStart) {
if (channel >= NUM_MUSIC_CHANNELS) {
_gameRef->LOG(0, "**Error** Attempting to use music channel %d (max num channels: %d)", channel, NUM_MUSIC_CHANNELS);
return STATUS_FAILED;
@@ -3354,7 +3354,7 @@ bool CBGame::playMusic(int channel, const char *filename, bool looping, uint32 l
delete _music[channel];
_music[channel] = NULL;
- _music[channel] = new CBSound(_gameRef);
+ _music[channel] = new BaseSound(_gameRef);
if (_music[channel] && DID_SUCCEED(_music[channel]->setSound(filename, Audio::Mixer::kMusicSoundType, true))) {
if (_musicStartTime[channel]) {
_music[channel]->setPositionTime(_musicStartTime[channel]);
@@ -3371,7 +3371,7 @@ bool CBGame::playMusic(int channel, const char *filename, bool looping, uint32 l
//////////////////////////////////////////////////////////////////////////
-bool CBGame::stopMusic(int channel) {
+bool BaseGame::stopMusic(int channel) {
if (channel >= NUM_MUSIC_CHANNELS) {
_gameRef->LOG(0, "**Error** Attempting to use music channel %d (max num channels: %d)", channel, NUM_MUSIC_CHANNELS);
return STATUS_FAILED;
@@ -3387,7 +3387,7 @@ bool CBGame::stopMusic(int channel) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::pauseMusic(int channel) {
+bool BaseGame::pauseMusic(int channel) {
if (channel >= NUM_MUSIC_CHANNELS) {
_gameRef->LOG(0, "**Error** Attempting to use music channel %d (max num channels: %d)", channel, NUM_MUSIC_CHANNELS);
return STATUS_FAILED;
@@ -3399,7 +3399,7 @@ bool CBGame::pauseMusic(int channel) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::resumeMusic(int channel) {
+bool BaseGame::resumeMusic(int channel) {
if (channel >= NUM_MUSIC_CHANNELS) {
_gameRef->LOG(0, "**Error** Attempting to use music channel %d (max num channels: %d)", channel, NUM_MUSIC_CHANNELS);
return STATUS_FAILED;
@@ -3411,7 +3411,7 @@ bool CBGame::resumeMusic(int channel) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::setMusicStartTime(int channel, uint32 time) {
+bool BaseGame::setMusicStartTime(int channel, uint32 time) {
if (channel >= NUM_MUSIC_CHANNELS) {
_gameRef->LOG(0, "**Error** Attempting to use music channel %d (max num channels: %d)", channel, NUM_MUSIC_CHANNELS);
return STATUS_FAILED;
@@ -3424,7 +3424,7 @@ bool CBGame::setMusicStartTime(int channel, uint32 time) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::loadSettings(const char *filename) {
+bool BaseGame::loadSettings(const char *filename) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(SETTINGS)
TOKEN_TABLE(GAME)
@@ -3447,7 +3447,7 @@ bool CBGame::loadSettings(const char *filename) {
byte *origBuffer = _gameRef->_fileManager->readWholeFile(filename);
if (origBuffer == NULL) {
- _gameRef->LOG(0, "CBGame::LoadSettings failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseGame::LoadSettings failed for file '%s'", filename);
return STATUS_FAILED;
}
@@ -3456,7 +3456,7 @@ bool CBGame::loadSettings(const char *filename) {
byte *buffer = origBuffer;
byte *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if (parser.getCommand((char **)&buffer, commands, (char **)&params) != TOKEN_SETTINGS) {
_gameRef->LOG(0, "'SETTINGS' keyword expected in game settings file.");
@@ -3520,7 +3520,7 @@ bool CBGame::loadSettings(const char *filename) {
break;
case TOKEN_SAVED_GAME_EXT:
- CBUtils::setString(&_savedGameExt, (char *)params);
+ BaseUtils::setString(&_savedGameExt, (char *)params);
break;
case TOKEN_GUID:
@@ -3547,11 +3547,11 @@ bool CBGame::loadSettings(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::persist(CBPersistMgr *persistMgr) {
+bool BaseGame::persist(BasePersistenceManager *persistMgr) {
if (!persistMgr->_saving)
cleanup();
- CBObject::persist(persistMgr);
+ BaseObject::persist(persistMgr);
persistMgr->transfer(TMEMBER(_activeObject));
persistMgr->transfer(TMEMBER(_capturedObject));
@@ -3640,8 +3640,8 @@ bool CBGame::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::focusWindow(CUIWindow *Window) {
- CUIWindow *Prev = _focusedWindow;
+bool BaseGame::focusWindow(UIWindow *Window) {
+ UIWindow *Prev = _focusedWindow;
for (int i = 0; i < _windows.getSize(); i++) {
if (_windows[i] == Window) {
@@ -3662,7 +3662,7 @@ bool CBGame::focusWindow(CUIWindow *Window) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::freeze(bool includingMusic) {
+bool BaseGame::freeze(bool includingMusic) {
if (_freezeLevel == 0) {
_scEngine->pauseAll();
_soundMgr->pauseAll(includingMusic);
@@ -3678,7 +3678,7 @@ bool CBGame::freeze(bool includingMusic) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::unfreeze() {
+bool BaseGame::unfreeze() {
if (_freezeLevel == 0) return STATUS_OK;
_freezeLevel--;
@@ -3694,7 +3694,7 @@ bool CBGame::unfreeze() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::handleKeypress(Common::Event *event, bool printable) {
+bool BaseGame::handleKeypress(Common::Event *event, bool printable) {
if (isVideoPlaying()) {
if (event->kbd.keycode == Common::KEYCODE_ESCAPE)
stopVideo();
@@ -3735,13 +3735,13 @@ bool CBGame::handleKeypress(Common::Event *event, bool printable) {
return false;
}
-void CBGame::handleKeyRelease(Common::Event *event) {
+void BaseGame::handleKeyRelease(Common::Event *event) {
_keyboardState->handleKeyRelease(event);
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::handleMouseWheel(int Delta) {
+bool BaseGame::handleMouseWheel(int Delta) {
bool handled = false;
if (_focusedWindow) {
handled = _gameRef->_focusedWindow->handleMouseWheel(Delta);
@@ -3771,7 +3771,7 @@ bool CBGame::handleMouseWheel(int Delta) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) {
+bool BaseGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *extMinor) {
if (verMajor) *verMajor = DCGF_VER_MAJOR;
if (verMinor) *verMinor = DCGF_VER_MINOR;
@@ -3783,7 +3783,7 @@ bool CBGame::getVersion(byte *verMajor, byte *verMinor, byte *extMajor, byte *ex
//////////////////////////////////////////////////////////////////////////
-void CBGame::setWindowTitle() {
+void BaseGame::setWindowTitle() {
if (_renderer) {
char title[512];
strcpy(title, _caption[0]);
@@ -3795,13 +3795,13 @@ void CBGame::setWindowTitle() {
if (_textEncoding == TEXT_UTF8) {
utf8Title = Utf8String(title);
} else {
- warning("CBGame::SetWindowTitle -Ignoring textencoding");
+ warning("BaseGame::SetWindowTitle -Ignoring textencoding");
utf8Title = Utf8String(title);
/* WideString wstr = StringUtil::AnsiToWide(Title);
title = StringUtil::WideToUtf8(wstr);*/
}
#if 0
- CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_renderer);
+ BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_renderer);
// TODO
SDL_SetWindowTitle(renderer->GetSdlWindow(), title.c_str());
@@ -3811,10 +3811,10 @@ void CBGame::setWindowTitle() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::getSaveSlotFilename(int slot, char *buffer) {
+bool BaseGame::getSaveSlotFilename(int slot, char *buffer) {
AnsiString dataDir = getDataDir();
//sprintf(Buffer, "%s/save%03d.%s", dataDir.c_str(), Slot, _savedGameExt);
- CBPersistMgr *pm = new CBPersistMgr(_gameRef);
+ BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
Common::String filename = pm->getFilenameForSlot(slot);
delete pm;
strcpy(buffer, filename.c_str());
@@ -3823,7 +3823,7 @@ bool CBGame::getSaveSlotFilename(int slot, char *buffer) {
}
//////////////////////////////////////////////////////////////////////////
-AnsiString CBGame::getDataDir() {
+AnsiString BaseGame::getDataDir() {
AnsiString userDir = PathUtil::getUserDirectory();
AnsiString baseDir = _registry->getBasePath();
return PathUtil::combine(userDir, baseDir);
@@ -3831,12 +3831,12 @@ AnsiString CBGame::getDataDir() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::getSaveSlotDescription(int slot, char *buffer) {
+bool BaseGame::getSaveSlotDescription(int slot, char *buffer) {
buffer[0] = '\0';
char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
- CBPersistMgr *pm = new CBPersistMgr(_gameRef);
+ BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
if (!pm) return STATUS_FAILED;
_debugAbsolutePathWarning = false;
@@ -3855,11 +3855,11 @@ bool CBGame::getSaveSlotDescription(int slot, char *buffer) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::isSaveSlotUsed(int slot) {
+bool BaseGame::isSaveSlotUsed(int slot) {
char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
- warning("CBGame::IsSaveSlotUsed(%d) - FIXME, ugly solution", slot);
+ warning("BaseGame::IsSaveSlotUsed(%d) - FIXME, ugly solution", slot);
Common::SeekableReadStream *File = g_wintermute->getSaveFileMan()->openForLoading(filename);
if (!File) return false;
delete File;
@@ -3868,10 +3868,10 @@ bool CBGame::isSaveSlotUsed(int slot) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::emptySaveSlot(int slot) {
+bool BaseGame::emptySaveSlot(int slot) {
char filename[MAX_PATH_LENGTH + 1];
getSaveSlotFilename(slot, filename);
- CBPersistMgr *pm = new CBPersistMgr(this);
+ BasePersistenceManager *pm = new BasePersistenceManager(this);
g_wintermute->getSaveFileMan()->removeSavefile(pm->getFilenameForSlot(slot));
delete pm;
return STATUS_OK;
@@ -3879,7 +3879,7 @@ bool CBGame::emptySaveSlot(int slot) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::setActiveObject(CBObject *obj) {
+bool BaseGame::setActiveObject(BaseObject *obj) {
// not-active when game is frozen
if (obj && !_gameRef->_interactive && !obj->_nonIntMouseEvents) {
obj = NULL;
@@ -3899,7 +3899,7 @@ bool CBGame::setActiveObject(CBObject *obj) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::pushViewport(CBViewport *viewport) {
+bool BaseGame::pushViewport(BaseViewport *viewport) {
_viewportSP++;
if (_viewportSP >= _viewportStack.getSize()) _viewportStack.add(viewport);
else _viewportStack[_viewportSP] = viewport;
@@ -3911,7 +3911,7 @@ bool CBGame::pushViewport(CBViewport *viewport) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::popViewport() {
+bool BaseGame::popViewport() {
_viewportSP--;
if (_viewportSP < -1) _gameRef->LOG(0, "Fatal: Viewport stack underflow!");
@@ -3926,14 +3926,14 @@ bool CBGame::popViewport() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::getCurrentViewportRect(Rect32 *rect, bool *custom) {
+bool BaseGame::getCurrentViewportRect(Rect32 *rect, bool *custom) {
if (rect == NULL) return STATUS_FAILED;
else {
if (_viewportSP >= 0) {
- CBPlatform::copyRect(rect, _viewportStack[_viewportSP]->getRect());
+ BasePlatform::copyRect(rect, _viewportStack[_viewportSP]->getRect());
if (custom) *custom = true;
} else {
- CBPlatform::setRect(rect, _renderer->_drawOffsetX,
+ BasePlatform::setRect(rect, _renderer->_drawOffsetX,
_renderer->_drawOffsetY,
_renderer->_width + _renderer->_drawOffsetX,
_renderer->_height + _renderer->_drawOffsetY);
@@ -3946,7 +3946,7 @@ bool CBGame::getCurrentViewportRect(Rect32 *rect, bool *custom) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::getCurrentViewportOffset(int *offsetX, int *offsetY) {
+bool BaseGame::getCurrentViewportOffset(int *offsetX, int *offsetY) {
if (_viewportSP >= 0) {
if (offsetX) *offsetX = _viewportStack[_viewportSP]->_offsetX;
if (offsetY) *offsetY = _viewportStack[_viewportSP]->_offsetY;
@@ -3960,42 +3960,42 @@ bool CBGame::getCurrentViewportOffset(int *offsetX, int *offsetY) {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::windowLoadHook(CUIWindow *win, char **buf, char **params) {
+bool BaseGame::windowLoadHook(UIWindow *win, char **buf, char **params) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::windowScriptMethodHook(CUIWindow *win, CScScript *script, CScStack *stack, const char *name) {
+bool BaseGame::windowScriptMethodHook(UIWindow *win, ScScript *script, ScStack *stack, const char *name) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::setInteractive(bool state) {
+void BaseGame::setInteractive(bool state) {
_interactive = state;
if (_transMgr) _transMgr->_origInteractive = state;
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::resetMousePos() {
+void BaseGame::resetMousePos() {
Common::Point p;
p.x = _mousePos.x + _renderer->_drawOffsetX;
p.y = _mousePos.y + _renderer->_drawOffsetY;
- CBPlatform::setCursorPos(p.x, p.y);
+ BasePlatform::setCursorPos(p.x, p.y);
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::displayContent(bool doUpdate, bool displayAll) {
+bool BaseGame::displayContent(bool doUpdate, bool displayAll) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::displayContentSimple() {
+bool BaseGame::displayContentSimple() {
// fill black
_renderer->fill(0, 0, 0);
if (_indicatorDisplay) displayIndicator();
@@ -4005,10 +4005,10 @@ bool CBGame::displayContentSimple() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::displayIndicator() {
+bool BaseGame::displayIndicator() {
if (_saveLoadImage) {
Rect32 rc;
- CBPlatform::setRect(&rc, 0, 0, _saveLoadImage->getWidth(), _saveLoadImage->getHeight());
+ BasePlatform::setRect(&rc, 0, 0, _saveLoadImage->getWidth(), _saveLoadImage->getHeight());
if (_loadInProgress) _saveLoadImage->displayTrans(_loadImageX, _loadImageY, rc);
else _saveLoadImage->displayTrans(_saveImageX, _saveImageY, rc);
}
@@ -4023,7 +4023,7 @@ bool CBGame::displayIndicator() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::updateMusicCrossfade() {
+bool BaseGame::updateMusicCrossfade() {
/* byte GlobMusicVol = _soundMgr->getVolumePercent(SOUND_MUSIC); */
if (!_musicCrossfadeRunning) return STATUS_OK;
@@ -4055,7 +4055,7 @@ bool CBGame::updateMusicCrossfade() {
if (_musicCrossfadeSwap) {
// swap channels
- CBSound *dummy = _music[_musicCrossfadeChannel1];
+ BaseSound *dummy = _music[_musicCrossfadeChannel1];
int dummyInt = _musicStartTime[_musicCrossfadeChannel1];
_music[_musicCrossfadeChannel1] = _music[_musicCrossfadeChannel2];
@@ -4078,7 +4078,7 @@ bool CBGame::updateMusicCrossfade() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::resetContent() {
+bool BaseGame::resetContent() {
_scEngine->clearGlobals();
//_timer = 0;
//_liveTimer = 0;
@@ -4087,12 +4087,12 @@ bool CBGame::resetContent() {
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::DEBUG_DumpClassRegistry() {
+void BaseGame::DEBUG_DumpClassRegistry() {
warning("DEBUG_DumpClassRegistry - untested");
Common::DumpFile *f = new Common::DumpFile;
f->open("zz_class_reg_dump.log");
- CSysClassRegistry::getInstance()->dumpClasses(f);
+ SystemClassRegistry::getInstance()->dumpClasses(f);
f->close();
delete f;
@@ -4101,7 +4101,7 @@ void CBGame::DEBUG_DumpClassRegistry() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::invalidateDeviceObjects() {
+bool BaseGame::invalidateDeviceObjects() {
for (int i = 0; i < _regObjects.getSize(); i++) {
_regObjects[i]->invalidateDeviceObjects();
}
@@ -4110,7 +4110,7 @@ bool CBGame::invalidateDeviceObjects() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::restoreDeviceObjects() {
+bool BaseGame::restoreDeviceObjects() {
for (int i = 0; i < _regObjects.getSize(); i++) {
_regObjects[i]->restoreDeviceObjects();
}
@@ -4118,11 +4118,11 @@ bool CBGame::restoreDeviceObjects() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::setWaitCursor(const char *filename) {
+bool BaseGame::setWaitCursor(const char *filename) {
delete _cursorNoninteractive;
_cursorNoninteractive = NULL;
- _cursorNoninteractive = new CBSprite(_gameRef);
+ _cursorNoninteractive = new BaseSprite(_gameRef);
if (!_cursorNoninteractive || DID_FAIL(_cursorNoninteractive->loadFile(filename))) {
delete _cursorNoninteractive;
_cursorNoninteractive = NULL;
@@ -4131,14 +4131,14 @@ bool CBGame::setWaitCursor(const char *filename) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::isVideoPlaying() {
+bool BaseGame::isVideoPlaying() {
if (_videoPlayer->isPlaying()) return true;
if (_theoraPlayer && _theoraPlayer->isPlaying()) return true;
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::stopVideo() {
+bool BaseGame::stopVideo() {
if (_videoPlayer->isPlaying()) _videoPlayer->stop();
if (_theoraPlayer && _theoraPlayer->isPlaying()) {
_theoraPlayer->stop();
@@ -4150,7 +4150,7 @@ bool CBGame::stopVideo() {
//////////////////////////////////////////////////////////////////////////
-bool CBGame::drawCursor(CBSprite *cursor) {
+bool BaseGame::drawCursor(BaseSprite *cursor) {
if (!cursor) return STATUS_FAILED;
if (cursor != _lastCursor) {
cursor->reset();
@@ -4162,7 +4162,7 @@ bool CBGame::drawCursor(CBSprite *cursor) {
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onActivate(bool activate, bool refreshMouse) {
+bool BaseGame::onActivate(bool activate, bool refreshMouse) {
if (_shuttingDown || !_renderer) return STATUS_OK;
_renderer->_active = activate;
@@ -4180,7 +4180,7 @@ bool CBGame::onActivate(bool activate, bool refreshMouse) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseLeftDown() {
+bool BaseGame::onMouseLeftDown() {
if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_LEFT);
bool handled = _state == GAME_RUNNING && DID_SUCCEED(applyEvent("LeftClick"));
@@ -4192,16 +4192,16 @@ bool CBGame::onMouseLeftDown() {
if (_activeObject != NULL) _capturedObject = _activeObject;
_mouseLeftDown = true;
- CBPlatform::setCapture(/*_renderer->_window*/);
+ BasePlatform::setCapture(/*_renderer->_window*/);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseLeftUp() {
+bool BaseGame::onMouseLeftUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_LEFT);
- CBPlatform::releaseCapture();
+ BasePlatform::releaseCapture();
_capturedObject = NULL;
_mouseLeftDown = false;
@@ -4215,7 +4215,7 @@ bool CBGame::onMouseLeftUp() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseLeftDblClick() {
+bool BaseGame::onMouseLeftDblClick() {
if (_state == GAME_RUNNING && !_interactive) return STATUS_OK;
if (_activeObject) _activeObject->handleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_LEFT);
@@ -4230,7 +4230,7 @@ bool CBGame::onMouseLeftDblClick() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseRightDblClick() {
+bool BaseGame::onMouseRightDblClick() {
if (_state == GAME_RUNNING && !_interactive) return STATUS_OK;
if (_activeObject) _activeObject->handleMouse(MOUSE_DBLCLICK, MOUSE_BUTTON_RIGHT);
@@ -4245,7 +4245,7 @@ bool CBGame::onMouseRightDblClick() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseRightDown() {
+bool BaseGame::onMouseRightDown() {
if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_RIGHT);
bool handled = _state == GAME_RUNNING && DID_SUCCEED(applyEvent("RightClick"));
@@ -4258,7 +4258,7 @@ bool CBGame::onMouseRightDown() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseRightUp() {
+bool BaseGame::onMouseRightUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_RIGHT);
bool handled = _state == GAME_RUNNING && DID_SUCCEED(applyEvent("RightRelease"));
@@ -4271,7 +4271,7 @@ bool CBGame::onMouseRightUp() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseMiddleDown() {
+bool BaseGame::onMouseMiddleDown() {
if (_state == GAME_RUNNING && !_interactive) return STATUS_OK;
if (_activeObject) _activeObject->handleMouse(MOUSE_CLICK, MOUSE_BUTTON_MIDDLE);
@@ -4286,7 +4286,7 @@ bool CBGame::onMouseMiddleDown() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onMouseMiddleUp() {
+bool BaseGame::onMouseMiddleUp() {
if (_activeObject) _activeObject->handleMouse(MOUSE_RELEASE, MOUSE_BUTTON_MIDDLE);
bool handled = _state == GAME_RUNNING && DID_SUCCEED(applyEvent("MiddleRelease"));
@@ -4299,7 +4299,7 @@ bool CBGame::onMouseMiddleUp() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onPaint() {
+bool BaseGame::onPaint() {
if (_renderer && _renderer->_windowed && _renderer->_ready) {
_renderer->initLoop();
displayContent(false, true);
@@ -4310,7 +4310,7 @@ bool CBGame::onPaint() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onWindowClose() {
+bool BaseGame::onWindowClose() {
if (canHandleEvent("QuitGame")) {
if (_state != GAME_FROZEN) _gameRef->applyEvent("QuitGame");
return STATUS_OK;
@@ -4318,7 +4318,7 @@ bool CBGame::onWindowClose() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::displayDebugInfo() {
+bool BaseGame::displayDebugInfo() {
char str[100];
if (_debugShowFPS) {
@@ -4359,15 +4359,15 @@ bool CBGame::displayDebugInfo() {
}
//////////////////////////////////////////////////////////////////////////
-CBDebugger *CBGame::getDebugMgr() {
- if (!_debugMgr) _debugMgr = new CBDebugger(this);
+BaseDebugger *BaseGame::getDebugMgr() {
+ if (!_debugMgr) _debugMgr = new BaseDebugger(this);
return _debugMgr;
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::getMousePos(Point32 *pos) {
- CBPlatform::getCursorPos(pos);
+void BaseGame::getMousePos(Point32 *pos) {
+ BasePlatform::getCursorPos(pos);
pos->x -= _renderer->_drawOffsetX;
pos->y -= _renderer->_drawOffsetY;
@@ -4386,7 +4386,7 @@ void CBGame::getMousePos(Point32 *pos) {
*/
if (_mouseLockRect.left != 0 && _mouseLockRect.right != 0 && _mouseLockRect.top != 0 && _mouseLockRect.bottom != 0) {
- if (!CBPlatform::ptInRect(&_mouseLockRect, *pos)) {
+ if (!BasePlatform::ptInRect(&_mouseLockRect, *pos)) {
pos->x = MAX(_mouseLockRect.left, pos->x);
pos->y = MAX(_mouseLockRect.top, pos->y);
@@ -4398,52 +4398,52 @@ void CBGame::getMousePos(Point32 *pos) {
newPos.x += _renderer->_drawOffsetX;
newPos.y += _renderer->_drawOffsetY;
- CBPlatform::setCursorPos(newPos.x, newPos.y);
+ BasePlatform::setCursorPos(newPos.x, newPos.y);
}
}
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::miniUpdate() {
+bool BaseGame::miniUpdate() {
if (!_miniUpdateEnabled) return STATUS_OK;
- if (CBPlatform::getTime() - _lastMiniUpdate > 200) {
+ if (BasePlatform::getTime() - _lastMiniUpdate > 200) {
if (_soundMgr) _soundMgr->initLoop();
- _lastMiniUpdate = CBPlatform::getTime();
+ _lastMiniUpdate = BasePlatform::getTime();
}
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::onScriptShutdown(CScScript *script) {
+bool BaseGame::onScriptShutdown(ScScript *script) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::isLeftDoubleClick() {
+bool BaseGame::isLeftDoubleClick() {
return isDoubleClick(0);
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::isRightDoubleClick() {
+bool BaseGame::isRightDoubleClick() {
return isDoubleClick(1);
}
//////////////////////////////////////////////////////////////////////////
-bool CBGame::isDoubleClick(int buttonIndex) {
+bool BaseGame::isDoubleClick(int buttonIndex) {
uint32 maxDoubleCLickTime = 500;
int maxMoveX = 4;
int maxMoveY = 4;
Point32 pos;
- CBPlatform::getCursorPos(&pos);
+ BasePlatform::getCursorPos(&pos);
int moveX = abs(pos.x - _lastClick[buttonIndex].posX);
int moveY = abs(pos.y - _lastClick[buttonIndex].posY);
- if (_lastClick[buttonIndex].time == 0 || CBPlatform::getTime() - _lastClick[buttonIndex].time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
- _lastClick[buttonIndex].time = CBPlatform::getTime();
+ if (_lastClick[buttonIndex].time == 0 || BasePlatform::getTime() - _lastClick[buttonIndex].time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
+ _lastClick[buttonIndex].time = BasePlatform::getTime();
_lastClick[buttonIndex].posX = pos.x;
_lastClick[buttonIndex].posY = pos.y;
return false;
@@ -4454,7 +4454,7 @@ bool CBGame::isDoubleClick(int buttonIndex) {
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::autoSaveOnExit() {
+void BaseGame::autoSaveOnExit() {
_soundMgr->saveSettings();
_registry->saveValues();
@@ -4465,12 +4465,12 @@ void CBGame::autoSaveOnExit() {
}
//////////////////////////////////////////////////////////////////////////
-void CBGame::addMem(int bytes) {
+void BaseGame::addMem(int bytes) {
_usedMem += bytes;
}
//////////////////////////////////////////////////////////////////////////
-AnsiString CBGame::getDeviceType() const {
+AnsiString BaseGame::getDeviceType() const {
return "computer";
}
diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h
index 711eebfc98..77fa6b3a8b 100644
--- a/engines/wintermute/base/base_game.h
+++ b/engines/wintermute/base/base_game.h
@@ -41,33 +41,33 @@ namespace WinterMute {
typedef void (*ENGINE_LOG_CALLBACK)(char *Text, bool Result, void *Data);
-class CBSoundMgr;
-class CBFader;
-class CBFont;
-class CBFileManager;
-class CBTransitionMgr;
-class CScEngine;
-class CBFontStorage;
-class CBStringTable;
-class CBQuickMsg;
-class CUIWindow;
-class CBViewport;
-class CBRenderer;
-class CBRegistry;
-class CBSaveThumbHelper;
-class CBSurfaceStorage;
-class CSXMath;
-class CBKeyboardState;
-class CVidPlayer;
-class CVidTheoraPlayer;
+class BaseSoundMgr;
+class BaseFader;
+class BaseFont;
+class BaseFileManager;
+class BaseTransitionMgr;
+class ScEngine;
+class BaseFontStorage;
+class BaseStringTable;
+class BaseQuickMsg;
+class UIWindow;
+class BaseViewport;
+class BaseRenderer;
+class BaseRegistry;
+class BaseSaveThumbHelper;
+class BaseSurfaceStorage;
+class SXMath;
+class BaseKeyboardState;
+class VideoPlayer;
+class VideoTheoraPlayer;
#define NUM_MUSIC_CHANNELS 5
-class CBGame: public CBObject {
+class BaseGame: public BaseObject {
public:
- DECLARE_PERSISTENT(CBGame, CBObject)
+ DECLARE_PERSISTENT(BaseGame, BaseObject)
- virtual bool onScriptShutdown(CScScript *script);
+ virtual bool onScriptShutdown(ScScript *script);
virtual bool onActivate(bool activate, bool refreshMouse);
virtual bool onMouseLeftDown();
@@ -105,7 +105,7 @@ public:
TTextEncoding _textEncoding;
bool _textRTL;
- CBSprite *_loadingIcon;
+ BaseSprite *_loadingIcon;
int _loadingIconX;
int _loadingIconY;
int _loadingIconPersistent;
@@ -136,7 +136,7 @@ protected:
int _loadImageX;
int _loadImageY;
- CBSurface *_saveLoadImage;
+ BaseSurface *_saveLoadImage;
bool displayIndicator();
bool _reportTextureFormat;
@@ -157,32 +157,32 @@ public:
int _offsetX;
float _offsetPercentX;
float _offsetPercentY;
- CBObject *_mainObject;
+ BaseObject *_mainObject;
bool initInput();
bool initLoop();
uint32 _currentTime;
uint32 _deltaTime;
- CBFont *_systemFont;
- CBFont *_videoFont;
+ BaseFont *_systemFont;
+ BaseFont *_videoFont;
bool initialize1();
bool initialize2();
bool initialize3();
- CBFileManager *_fileManager;
- CBTransitionMgr *_transMgr;
- CBDebugger *getDebugMgr();
+ BaseFileManager *_fileManager;
+ BaseTransitionMgr *_transMgr;
+ BaseDebugger *getDebugMgr();
void LOG(bool res, const char *fmt, ...);
- CBRenderer *_renderer;
- CBSoundMgr *_soundMgr;
- CScEngine *_scEngine;
- CSXMath *_mathClass;
- CBSurfaceStorage *_surfaceStorage;
- CBFontStorage *_fontStorage;
- CBGame();
+ BaseRenderer *_renderer;
+ BaseSoundMgr *_soundMgr;
+ ScEngine *_scEngine;
+ SXMath *_mathClass;
+ BaseSurfaceStorage *_surfaceStorage;
+ BaseFontStorage *_fontStorage;
+ BaseGame();
- virtual ~CBGame();
+ virtual ~BaseGame();
void DEBUG_DebugDisable();
void DEBUG_DebugEnable(const char *filename = NULL);
bool _debugDebugMode;
@@ -192,13 +192,13 @@ public:
int _sequence;
virtual bool loadFile(const char *filename);
virtual bool loadBuffer(byte *buffer, bool complete = true);
- CBArray<CBQuickMsg *, CBQuickMsg *> _quickMessages;
- CBArray<CUIWindow *, CUIWindow *> _windows;
- CBArray<CBViewport *, CBViewport *> _viewportStack;
+ BaseArray<BaseQuickMsg *, BaseQuickMsg *> _quickMessages;
+ BaseArray<UIWindow *, UIWindow *> _windows;
+ BaseArray<BaseViewport *, BaseViewport *> _viewportStack;
int _viewportSP;
- CBStringTable *_stringTable;
+ BaseStringTable *_stringTable;
int _settingsResWidth;
int _settingsResHeight;
char *_settingsGameFile;
@@ -215,15 +215,15 @@ protected:
bool _settingsRequireSound;
bool _settingsAllowDesktopRes;
int _settingsTLMode;
- CBFader *_fader;
+ BaseFader *_fader;
virtual bool invalidateDeviceObjects();
virtual bool restoreDeviceObjects();
public:
- virtual bool ExternalCall(CScScript *script, CScStack *stack, CScStack *thisStack, char *name);
+ virtual bool ExternalCall(ScScript *script, ScStack *stack, ScStack *thisStack, char *name);
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
// compatibility bits
bool _compatKillMethodThreads;
@@ -262,11 +262,11 @@ protected:
public:
bool unfreeze();
bool freeze(bool includingMusic = true);
- bool focusWindow(CUIWindow *window);
- CVidPlayer *_videoPlayer;
- CVidTheoraPlayer *_theoraPlayer;
+ bool focusWindow(UIWindow *window);
+ VideoPlayer *_videoPlayer;
+ VideoTheoraPlayer *_theoraPlayer;
bool _loadInProgress;
- CUIWindow *_focusedWindow;
+ UIWindow *_focusedWindow;
bool _editorForceScripts;
protected:
static void afterLoadRegion(void *region, void *data);
@@ -283,7 +283,7 @@ public:
bool pauseMusic(int channel);
bool stopMusic(int channel);
bool playMusic(int channel, const char *filename, bool looping = true, uint32 loopStart = 0);
- CBSound *_music[NUM_MUSIC_CHANNELS];
+ BaseSound *_music[NUM_MUSIC_CHANNELS];
bool _musicCrossfadeRunning;
bool _musicCrossfadeSwap;
uint32 _musicCrossfadeStartTime;
@@ -291,7 +291,7 @@ public:
int _musicCrossfadeChannel1;
int _musicCrossfadeChannel2;
bool displayWindows(bool inGame = false);
- CBRegistry *_registry;
+ BaseRegistry *_registry;
bool _useD3D;
virtual bool cleanup();
virtual bool loadGame(int slot);
@@ -299,9 +299,9 @@ public:
virtual bool SaveGame(int slot, const char *desc, bool quickSave = false);
virtual bool showCursor();
- CBSprite *_cursorNoninteractive;
- CBObject *_activeObject;
- CBKeyboardState *_keyboardState;
+ BaseSprite *_cursorNoninteractive;
+ BaseObject *_activeObject;
+ BaseKeyboardState *_keyboardState;
bool _interactive;
TGameState _state;
TGameState _origState;
@@ -314,11 +314,11 @@ public:
uint32 _liveTimerDelta;
uint32 _liveTimerLast;
- CBObject *_capturedObject;
+ BaseObject *_capturedObject;
Point32 _mousePos;
- bool validObject(CBObject *object);
- bool unregisterObject(CBObject *object);
- bool registerObject(CBObject *object);
+ bool validObject(BaseObject *object);
+ bool unregisterObject(BaseObject *object);
+ bool registerObject(BaseObject *object);
void quickMessage(const char *text);
void quickMessageForm(char *fmt, ...);
bool displayQuickMsg();
@@ -328,7 +328,7 @@ public:
bool isVideoPlaying();
bool stopVideo();
- CBArray<CBObject *, CBObject *> _regObjects;
+ BaseArray<BaseObject *, BaseObject *> _regObjects;
public:
virtual bool displayContent(bool update = true, bool displayAll = false);
virtual bool displayContentSimple();
@@ -336,18 +336,18 @@ public:
void resetMousePos();
int _subtitlesSpeed;
void setInteractive(bool state);
- virtual bool windowLoadHook(CUIWindow *win, char **buf, char **params);
- virtual bool windowScriptMethodHook(CUIWindow *win, CScScript *script, CScStack *stack, const char *name);
+ virtual bool windowLoadHook(UIWindow *win, char **buf, char **params);
+ virtual bool windowScriptMethodHook(UIWindow *win, ScScript *script, ScStack *stack, const char *name);
bool getCurrentViewportOffset(int *offsetX = NULL, int *offsetY = NULL);
bool getCurrentViewportRect(Rect32 *rect, bool *custom = NULL);
bool popViewport();
- bool pushViewport(CBViewport *Viewport);
- bool setActiveObject(CBObject *Obj);
- CBSprite *_lastCursor;
- bool drawCursor(CBSprite *Cursor);
+ bool pushViewport(BaseViewport *Viewport);
+ bool setActiveObject(BaseObject *Obj);
+ BaseSprite *_lastCursor;
+ bool drawCursor(BaseSprite *Cursor);
virtual bool initAfterLoad();
- CBSaveThumbHelper *_cachedThumbnail;
+ BaseSaveThumbHelper *_cachedThumbnail;
AnsiString getDataDir();
void addMem(int bytes);
@@ -356,7 +356,7 @@ public:
AnsiString getDeviceType() const;
private:
- CBDebugger *_debugMgr;
+ BaseDebugger *_debugMgr;
struct LastClickInfo {
LastClickInfo() {
diff --git a/engines/wintermute/base/base_keyboard_state.cpp b/engines/wintermute/base/base_keyboard_state.cpp
index 240f642b7f..ad014762d4 100644
--- a/engines/wintermute/base/base_keyboard_state.cpp
+++ b/engines/wintermute/base/base_keyboard_state.cpp
@@ -35,10 +35,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBKeyboardState, false)
+IMPLEMENT_PERSISTENT(BaseKeyboardState, false)
//////////////////////////////////////////////////////////////////////////
-CBKeyboardState::CBKeyboardState(CBGame *inGame): CBScriptable(inGame) {
+BaseKeyboardState::BaseKeyboardState(BaseGame *inGame): BaseScriptable(inGame) {
_currentPrintable = false;
_currentCharCode = 0;
_currentKeyData = 0;
@@ -54,17 +54,17 @@ CBKeyboardState::CBKeyboardState(CBGame *inGame): CBScriptable(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CBKeyboardState::~CBKeyboardState() {
+BaseKeyboardState::~BaseKeyboardState() {
delete[] _keyStates;
}
-void CBKeyboardState::handleKeyPress(Common::Event *event) {
+void BaseKeyboardState::handleKeyPress(Common::Event *event) {
if (event->type == Common::EVENT_KEYDOWN) {
_keyStates[event->kbd.keycode] = true;
}
}
-void CBKeyboardState::handleKeyRelease(Common::Event *event) {
+void BaseKeyboardState::handleKeyRelease(Common::Event *event) {
if (event->type == Common::EVENT_KEYUP) {
_keyStates[event->kbd.keycode] = false;
}
@@ -73,13 +73,13 @@ void CBKeyboardState::handleKeyRelease(Common::Event *event) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBKeyboardState::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseKeyboardState::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// IsKeyDown
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "IsKeyDown") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
int vKey;
if (val->_type == VAL_STRING && strlen(val->getString()) > 0) {
@@ -98,12 +98,12 @@ bool CBKeyboardState::scCallMethod(CScScript *script, CScStack *stack, CScStack
return STATUS_OK;
}
- else return CBScriptable::scCallMethod(script, stack, thisStack, name);
+ else return BaseScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBKeyboardState::scGetProperty(const char *name) {
+ScValue *BaseKeyboardState::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -168,12 +168,12 @@ CScValue *CBKeyboardState::scGetProperty(const char *name) {
return _scValue;
}
- else return CBScriptable::scGetProperty(name);
+ else return BaseScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CBKeyboardState::scSetProperty(const char *name, CScValue *value) {
+bool BaseKeyboardState::scSetProperty(const char *name, ScValue *value) {
/*
//////////////////////////////////////////////////////////////////////////
// Name
@@ -184,18 +184,18 @@ bool CBKeyboardState::scSetProperty(const char *name, CScValue *value) {
return STATUS_OK;
}
- else*/ return CBScriptable::scSetProperty(name, value);
+ else*/ return BaseScriptable::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CBKeyboardState::scToString() {
+const char *BaseKeyboardState::scToString() {
return "[keyboard state]";
}
//////////////////////////////////////////////////////////////////////////
-bool CBKeyboardState::readKey(Common::Event *event) {
+bool BaseKeyboardState::readKey(Common::Event *event) {
//_currentPrintable = (event->type == SDL_TEXTINPUT); // TODO
_currentCharCode = keyCodeToVKey(event);
if ((_currentCharCode <= Common::KEYCODE_z && _currentCharCode >= Common::KEYCODE_a) ||
@@ -215,9 +215,9 @@ bool CBKeyboardState::readKey(Common::Event *event) {
//////////////////////////////////////////////////////////////////////////
-bool CBKeyboardState::persist(CBPersistMgr *persistMgr) {
+bool BaseKeyboardState::persist(BasePersistenceManager *persistMgr) {
//if(!persistMgr->_saving) cleanup();
- CBScriptable::persist(persistMgr);
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_currentAlt));
persistMgr->transfer(TMEMBER(_currentCharCode));
@@ -237,25 +237,25 @@ bool CBKeyboardState::persist(CBPersistMgr *persistMgr) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBKeyboardState::isShiftDown() {
+bool BaseKeyboardState::isShiftDown() {
int mod = g_system->getEventManager()->getModifierState();
return (mod & Common::KBD_SHIFT);
}
//////////////////////////////////////////////////////////////////////////
-bool CBKeyboardState::isControlDown() {
+bool BaseKeyboardState::isControlDown() {
int mod = g_system->getEventManager()->getModifierState();
return (mod & Common::KBD_CTRL);
}
//////////////////////////////////////////////////////////////////////////
-bool CBKeyboardState::isAltDown() {
+bool BaseKeyboardState::isAltDown() {
int mod = g_system->getEventManager()->getModifierState();
return (mod & Common::KBD_ALT);
}
//////////////////////////////////////////////////////////////////////////
-uint32 CBKeyboardState::keyCodeToVKey(Common::Event *event) {
+uint32 BaseKeyboardState::keyCodeToVKey(Common::Event *event) {
if (event->type != Common::EVENT_KEYDOWN) return 0;
switch (event->kbd.keycode) {
@@ -275,7 +275,7 @@ enum VKeyCodes {
};
//////////////////////////////////////////////////////////////////////////
-Common::KeyCode CBKeyboardState::vKeyToKeyCode(uint32 vkey) {
+Common::KeyCode BaseKeyboardState::vKeyToKeyCode(uint32 vkey) {
// todo
switch (vkey) {
case VK_SPACE:
diff --git a/engines/wintermute/base/base_keyboard_state.h b/engines/wintermute/base/base_keyboard_state.h
index bdf268c601..8c4b1afb59 100644
--- a/engines/wintermute/base/base_keyboard_state.h
+++ b/engines/wintermute/base/base_keyboard_state.h
@@ -37,7 +37,7 @@
namespace WinterMute {
-class CBKeyboardState : public CBScriptable {
+class BaseKeyboardState : public BaseScriptable {
public:
uint32 _currentKeyData;
uint32 _currentCharCode;
@@ -47,9 +47,9 @@ public:
bool _currentAlt;
bool _currentControl;
- DECLARE_PERSISTENT(CBKeyboardState, CBScriptable)
- CBKeyboardState(CBGame *inGame);
- virtual ~CBKeyboardState();
+ DECLARE_PERSISTENT(BaseKeyboardState, BaseScriptable)
+ BaseKeyboardState(BaseGame *inGame);
+ virtual ~BaseKeyboardState();
bool readKey(Common::Event *event);
void handleKeyPress(Common::Event *event);
@@ -59,9 +59,9 @@ public:
static bool isAltDown();
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
private:
diff --git a/engines/wintermute/base/base_named_object.cpp b/engines/wintermute/base/base_named_object.cpp
index da76fb2047..97b9f53353 100644
--- a/engines/wintermute/base/base_named_object.cpp
+++ b/engines/wintermute/base/base_named_object.cpp
@@ -32,30 +32,30 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBNamedObject::CBNamedObject(CBGame *inGame) : CBBase(inGame) {
+BaseNamedObject::BaseNamedObject(BaseGame *inGame) : BaseClass(inGame) {
_name = NULL;
}
//////////////////////////////////////////////////////////////////////////
-CBNamedObject::CBNamedObject() : CBBase() {
+BaseNamedObject::BaseNamedObject() : BaseClass() {
_name = NULL;
}
//////////////////////////////////////////////////////////////////////////
-CBNamedObject::CBNamedObject(TDynamicConstructor, TDynamicConstructor) {
+BaseNamedObject::BaseNamedObject(TDynamicConstructor, TDynamicConstructor) {
_name = NULL;
}
//////////////////////////////////////////////////////////////////////////
-CBNamedObject::~CBNamedObject(void) {
+BaseNamedObject::~BaseNamedObject(void) {
delete[] _name;
_name = NULL;
}
//////////////////////////////////////////////////////////////////////
-void CBNamedObject::setName(const char *name) {
+void BaseNamedObject::setName(const char *name) {
delete[] _name;
_name = new char [strlen(name) + 1];
diff --git a/engines/wintermute/base/base_named_object.h b/engines/wintermute/base/base_named_object.h
index c03d1417a3..f7b496ead8 100644
--- a/engines/wintermute/base/base_named_object.h
+++ b/engines/wintermute/base/base_named_object.h
@@ -34,12 +34,12 @@
namespace WinterMute {
-class CBNamedObject : public CBBase {
+class BaseNamedObject : public BaseClass {
public:
- CBNamedObject(CBGame *inGame);
- CBNamedObject();
- virtual ~CBNamedObject(void);
- CBNamedObject(TDynamicConstructor, TDynamicConstructor);
+ BaseNamedObject(BaseGame *inGame);
+ BaseNamedObject();
+ virtual ~BaseNamedObject(void);
+ BaseNamedObject(TDynamicConstructor, TDynamicConstructor);
char *_name;
void setName(const char *name);
diff --git a/engines/wintermute/base/base_object.cpp b/engines/wintermute/base/base_object.cpp
index 0a4a0638f0..4ab121ded9 100644
--- a/engines/wintermute/base/base_object.cpp
+++ b/engines/wintermute/base/base_object.cpp
@@ -40,10 +40,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBObject, false)
+IMPLEMENT_PERSISTENT(BaseObject, false)
//////////////////////////////////////////////////////////////////////
-CBObject::CBObject(CBGame *inGame): CBScriptHolder(inGame) {
+BaseObject::BaseObject(BaseGame *inGame): BaseScriptHolder(inGame) {
_posX = _posY = 0;
_movable = true;
_zoomable = true;
@@ -65,7 +65,7 @@ CBObject::CBObject(CBGame *inGame): CBScriptHolder(inGame) {
_iD = _gameRef->getSequence();
- CBPlatform::setRectEmpty(&_rect);
+ BasePlatform::setRectEmpty(&_rect);
_rectSet = false;
_cursor = NULL;
@@ -101,17 +101,17 @@ CBObject::CBObject(CBGame *inGame): CBScriptHolder(inGame) {
//////////////////////////////////////////////////////////////////////
-CBObject::~CBObject() {
+BaseObject::~BaseObject() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::cleanup() {
+bool BaseObject::cleanup() {
if (_gameRef && _gameRef->_activeObject == this)
_gameRef->_activeObject = NULL;
- CBScriptHolder::cleanup();
+ BaseScriptHolder::cleanup();
delete[] _soundEvent;
_soundEvent = NULL;
@@ -137,7 +137,7 @@ bool CBObject::cleanup() {
//////////////////////////////////////////////////////////////////////////
-void CBObject::setCaption(const char *caption, int caseVal) { // TODO: rename Case to something usefull
+void BaseObject::setCaption(const char *caption, int caseVal) { // TODO: rename Case to something usefull
if (caseVal == 0) caseVal = 1;
if (caseVal < 1 || caseVal > 7)
return;
@@ -152,7 +152,7 @@ void CBObject::setCaption(const char *caption, int caseVal) { // TODO: rename Ca
//////////////////////////////////////////////////////////////////////////
-const char *CBObject::getCaption(int caseVal) {
+const char *BaseObject::getCaption(int caseVal) {
if (caseVal == 0) caseVal = 1;
if (caseVal < 1 || caseVal > 7 || _caption[caseVal - 1] == NULL)
return "";
@@ -161,7 +161,7 @@ const char *CBObject::getCaption(int caseVal) {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::listen(CBScriptHolder *param1, uint32 param2) {
+bool BaseObject::listen(BaseScriptHolder *param1, uint32 param2) {
return STATUS_FAILED;
}
@@ -169,7 +169,7 @@ bool CBObject::listen(CBScriptHolder *param1, uint32 param2) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseObject::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SkipTo
@@ -291,9 +291,9 @@ bool CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
bool looping;
uint32 loopStart;
- CScValue *val1 = stack->pop();
- CScValue *val2 = stack->pop();
- CScValue *val3 = stack->pop();
+ ScValue *val1 = stack->pop();
+ ScValue *val2 = stack->pop();
+ ScValue *val3 = stack->pop();
if (val1->_type == VAL_BOOL) {
filename = NULL;
@@ -321,8 +321,8 @@ bool CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
const char *filename;
const char *eventName;
- CScValue *val1 = stack->pop();
- CScValue *val2 = stack->pop();
+ ScValue *val1 = stack->pop();
+ ScValue *val2 = stack->pop();
if (val2->isNULL()) {
filename = NULL;
@@ -473,12 +473,12 @@ bool CBObject::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
return STATUS_OK;
}
- else return CBScriptHolder::scCallMethod(script, stack, thisStack, name);
+ else return BaseScriptHolder::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBObject::scGetProperty(const char *name) {
+ScValue *BaseObject::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -666,12 +666,12 @@ CScValue *CBObject::scGetProperty(const char *name) {
return _scValue;
}
- else return CBScriptHolder::scGetProperty(name);
+ else return BaseScriptHolder::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::scSetProperty(const char *name, CScValue *value) {
+bool BaseObject::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Caption
//////////////////////////////////////////////////////////////////////////
@@ -845,32 +845,32 @@ bool CBObject::scSetProperty(const char *name, CScValue *value) {
return STATUS_OK;
}
- else return CBScriptHolder::scSetProperty(name, value);
+ else return BaseScriptHolder::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CBObject::scToString() {
+const char *BaseObject::scToString() {
return "[object]";
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::showCursor() {
+bool BaseObject::showCursor() {
if (_cursor) return _gameRef->drawCursor(_cursor);
else return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::saveAsText(CBDynBuffer *buffer, int indent) {
+bool BaseObject::saveAsText(BaseDynamicBuffer *buffer, int indent) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::persist(CBPersistMgr *persistMgr) {
- CBScriptHolder::persist(persistMgr);
+bool BaseObject::persist(BasePersistenceManager *persistMgr) {
+ BaseScriptHolder::persist(persistMgr);
for (int i = 0; i < 7; i++)
persistMgr->transfer(TMEMBER(_caption[i]));
@@ -925,14 +925,14 @@ bool CBObject::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::setCursor(const char *filename) {
+bool BaseObject::setCursor(const char *filename) {
if (!_sharedCursors) {
delete _cursor;
_cursor = NULL;
}
_sharedCursors = false;
- _cursor = new CBSprite(_gameRef);
+ _cursor = new BaseSprite(_gameRef);
if (!_cursor || DID_FAIL(_cursor->loadFile(filename))) {
delete _cursor;
_cursor = NULL;
@@ -942,9 +942,9 @@ bool CBObject::setCursor(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::setActiveCursor(const char *filename) {
+bool BaseObject::setActiveCursor(const char *filename) {
delete _activeCursor;
- _activeCursor = new CBSprite(_gameRef);
+ _activeCursor = new BaseSprite(_gameRef);
if (!_activeCursor || DID_FAIL(_activeCursor->loadFile(filename))) {
delete _activeCursor;
_activeCursor = NULL;
@@ -954,31 +954,31 @@ bool CBObject::setActiveCursor(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-int CBObject::getHeight() {
+int BaseObject::getHeight() {
return 0;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::handleMouse(TMouseEvent event, TMouseButton button) {
+bool BaseObject::handleMouse(TMouseEvent event, TMouseButton button) {
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::handleKeypress(Common::Event *event, bool printable) {
+bool BaseObject::handleKeypress(Common::Event *event, bool printable) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::handleMouseWheel(int delta) {
+bool BaseObject::handleMouseWheel(int delta) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::playSFX(const char *filename, bool looping, bool playNow, const char *eventName, uint32 loopStart) {
+bool BaseObject::playSFX(const char *filename, bool looping, bool playNow, const char *eventName, uint32 loopStart) {
// just play loaded sound
if (filename == NULL && _sFX) {
if (_gameRef->_editorMode || _sFXStart) {
@@ -998,7 +998,7 @@ bool CBObject::playSFX(const char *filename, bool looping, bool playNow, const c
// create new sound
delete _sFX;
- _sFX = new CBSound(_gameRef);
+ _sFX = new BaseSound(_gameRef);
if (_sFX && DID_SUCCEED(_sFX->setSound(filename, Audio::Mixer::kSFXSoundType, true))) {
_sFX->setVolumePercent(_sFXVolume);
if (_sFXStart) {
@@ -1020,7 +1020,7 @@ bool CBObject::playSFX(const char *filename, bool looping, bool playNow, const c
//////////////////////////////////////////////////////////////////////////
-bool CBObject::stopSFX(bool deleteSound) {
+bool BaseObject::stopSFX(bool deleteSound) {
if (_sFX) {
_sFX->stop();
if (deleteSound) {
@@ -1033,21 +1033,21 @@ bool CBObject::stopSFX(bool deleteSound) {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::pauseSFX() {
+bool BaseObject::pauseSFX() {
if (_sFX) return _sFX->pause();
else return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::resumeSFX() {
+bool BaseObject::resumeSFX() {
if (_sFX) return _sFX->resume();
else return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::setSFXTime(uint32 time) {
+bool BaseObject::setSFXTime(uint32 time) {
_sFXStart = time;
if (_sFX && _sFX->isPlaying()) return _sFX->setPositionTime(time);
else return STATUS_OK;
@@ -1055,7 +1055,7 @@ bool CBObject::setSFXTime(uint32 time) {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::setSFXVolume(int volume) {
+bool BaseObject::setSFXVolume(int volume) {
_sFXVolume = volume;
if (_sFX) return _sFX->setVolumePercent(volume);
else return STATUS_OK;
@@ -1063,7 +1063,7 @@ bool CBObject::setSFXVolume(int volume) {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::updateSounds() {
+bool BaseObject::updateSounds() {
if (_soundEvent) {
if (_sFX && !_sFX->isPlaying()) {
applyEvent(_soundEvent);
@@ -1077,7 +1077,7 @@ bool CBObject::updateSounds() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::updateOneSound(CBSound *sound) {
+bool BaseObject::updateOneSound(BaseSound *sound) {
bool Ret = STATUS_OK;
if (sound) {
@@ -1090,7 +1090,7 @@ bool CBObject::updateOneSound(CBSound *sound) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::resetSoundPan() {
+bool BaseObject::resetSoundPan() {
if (!_sFX) return STATUS_OK;
else {
return _sFX->setPan(0.0f);
@@ -1099,19 +1099,19 @@ bool CBObject::resetSoundPan() {
//////////////////////////////////////////////////////////////////////////
-bool CBObject::getExtendedFlag(const char *flagName) {
+bool BaseObject::getExtendedFlag(const char *flagName) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::isReady() {
+bool BaseObject::isReady() {
return _ready;
}
//////////////////////////////////////////////////////////////////////////
-void CBObject::setSoundEvent(const char *eventName) {
+void BaseObject::setSoundEvent(const char *eventName) {
delete[] _soundEvent;
_soundEvent = NULL;
if (eventName) {
@@ -1121,7 +1121,7 @@ void CBObject::setSoundEvent(const char *eventName) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBObject::afterMove() {
+bool BaseObject::afterMove() {
return STATUS_OK;
}
diff --git a/engines/wintermute/base/base_object.h b/engines/wintermute/base/base_object.h
index 70dc69f53d..c05501b145 100644
--- a/engines/wintermute/base/base_object.h
+++ b/engines/wintermute/base/base_object.h
@@ -36,14 +36,14 @@
namespace WinterMute {
-class CBSprite;
-class CBSound;
-class CBSurface;
-class CBScriptHolder;
-class CScValue;
-class CScStack;
-class CScScript;
-class CBObject : public CBScriptHolder {
+class BaseSprite;
+class BaseSound;
+class BaseSurface;
+class BaseScriptHolder;
+class ScValue;
+class ScStack;
+class ScScript;
+class BaseObject : public BaseScriptHolder {
public:
TSpriteBlendMode _blendMode;
virtual bool afterMove();
@@ -61,7 +61,7 @@ public:
virtual bool getExtendedFlag(const char *flagName);
virtual bool resetSoundPan();
virtual bool updateSounds();
- bool updateOneSound(CBSound *sound);
+ bool updateOneSound(BaseSound *sound);
bool _autoSoundPanning;
uint32 _sFXStart;
int _sFXVolume;
@@ -71,7 +71,7 @@ public:
bool pauseSFX();
bool stopSFX(bool deleteSound = true);
bool playSFX(const char *filename, bool looping = false, bool playNow = true, const char *eventName = NULL, uint32 loopStart = 0);
- CBSound *_sFX;
+ BaseSound *_sFX;
TSFXType _sFXType;
float _sFXParam1;
@@ -92,13 +92,13 @@ public:
bool _editorAlwaysRegister;
bool _editorOnly;
bool _is3D;
- DECLARE_PERSISTENT(CBObject, CBScriptHolder)
+ DECLARE_PERSISTENT(BaseObject, BaseScriptHolder)
virtual bool showCursor();
- CBSprite *_cursor;
+ BaseSprite *_cursor;
bool _sharedCursors;
- CBSprite *_activeCursor;
- virtual bool saveAsText(CBDynBuffer *buffer, int indent);
- virtual bool listen(CBScriptHolder *param1, uint32 param2);
+ BaseSprite *_activeCursor;
+ virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent);
+ virtual bool listen(BaseScriptHolder *param1, uint32 param2);
bool _ready;
bool _registrable;
bool _zoomable;
@@ -107,8 +107,8 @@ public:
bool _rectSet;
int _iD;
bool _movable;
- CBObject(CBGame *inGame);
- virtual ~CBObject();
+ BaseObject(BaseGame *inGame);
+ virtual ~BaseObject();
char *_caption[7];
char *_soundEvent;
int _posY;
@@ -133,9 +133,9 @@ public:
public:
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/base/base_parser.cpp b/engines/wintermute/base/base_parser.cpp
index 0f185636aa..b07d98eca8 100644
--- a/engines/wintermute/base/base_parser.cpp
+++ b/engines/wintermute/base/base_parser.cpp
@@ -43,26 +43,26 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-CBParser::CBParser(CBGame *inGame): CBBase(inGame) {
+BaseParser::BaseParser(BaseGame *inGame): BaseClass(inGame) {
_whiteSpace = new char [strlen(WHITESPACE) + 1];
strcpy(_whiteSpace, WHITESPACE);
}
//////////////////////////////////////////////////////////////////////
-CBParser::~CBParser() {
+BaseParser::~BaseParser() {
if (_whiteSpace != NULL) delete [] _whiteSpace;
}
//////////////////////////////////////////////////////////////////////
-char *CBParser::getLastOffender() {
+char *BaseParser::getLastOffender() {
return _lastOffender;
}
//////////////////////////////////////////////////////////////////////
-int32 CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data) {
+int32 BaseParser::getObject(char **buf, TokenDesc *tokens, char **name, char **data) {
skipCharacters(buf, _whiteSpace);
// skip comment lines.
@@ -113,7 +113,7 @@ int32 CBParser::getObject(char **buf, TokenDesc *tokens, char **name, char **dat
//////////////////////////////////////////////////////////////////////
-int32 CBParser::getCommand(char **buf, TokenDesc *tokens, char **params) {
+int32 BaseParser::getCommand(char **buf, TokenDesc *tokens, char **params) {
if (!*buf) return PARSERR_TOKENNOTFOUND;
_gameRef->miniUpdate();
char *name;
@@ -122,7 +122,7 @@ int32 CBParser::getCommand(char **buf, TokenDesc *tokens, char **params) {
//////////////////////////////////////////////////////////////////////
-void CBParser::skipCharacters(char **buf, const char *toSkip) {
+void BaseParser::skipCharacters(char **buf, const char *toSkip) {
char ch;
while ((ch = **buf) != 0) {
if (ch == '\n') _parserLine++;
@@ -135,7 +135,7 @@ void CBParser::skipCharacters(char **buf, const char *toSkip) {
//////////////////////////////////////////////////////////////////////
-char *CBParser::getSubText(char **buf, char open, char close) {
+char *BaseParser::getSubText(char **buf, char open, char close) {
if (**buf == 0 || **buf != open)
return 0;
++*buf; // skip opening delimiter
@@ -164,7 +164,7 @@ char *CBParser::getSubText(char **buf, char open, char close) {
//////////////////////////////////////////////////////////////////////
-char *CBParser::getAssignmentText(char **buf) {
+char *BaseParser::getAssignmentText(char **buf) {
++*buf; // skip the '='
skipCharacters(buf, _whiteSpace);
char *result = *buf;
@@ -192,7 +192,7 @@ char *CBParser::getAssignmentText(char **buf) {
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
-char *CBParser::getToken(char **buf) {
+char *BaseParser::getToken(char **buf) {
static char token[100];
char *b = *buf, * t = token;
while (true) {
@@ -240,7 +240,7 @@ char *CBParser::getToken(char **buf) {
//////////////////////////////////////////////////////////////////////
-float CBParser::getTokenFloat(char **buf) {
+float BaseParser::getTokenFloat(char **buf) {
char *t = getToken(buf);
if (!((*t >= '0' && *t <= '9') || *t == '-' || *t == '.')) {
// Error situation. We handle this by return 0.
@@ -252,7 +252,7 @@ float CBParser::getTokenFloat(char **buf) {
//////////////////////////////////////////////////////////////////////
-int CBParser::getTokenInt(char **buf) {
+int BaseParser::getTokenInt(char **buf) {
char *t = getToken(buf);
if (!((*t >= '0' && *t <= '9') || *t == '-')) {
// Error situation. We handle this by return 0.
@@ -264,14 +264,14 @@ int CBParser::getTokenInt(char **buf) {
//////////////////////////////////////////////////////////////////////
-void CBParser::skipToken(char **buf, char *tok, char * /*msg*/) {
+void BaseParser::skipToken(char **buf, char *tok, char * /*msg*/) {
char *t = getToken(buf);
if (strcmp(t, tok)) return; // Error
}
//////////////////////////////////////////////////////////////////////
-int CBParser::scanStr(const char *in, const char *format, ...) {
+int BaseParser::scanStr(const char *in, const char *format, ...) {
va_list arg;
va_start(arg, format);
diff --git a/engines/wintermute/base/base_parser.h b/engines/wintermute/base/base_parser.h
index 53a02c0f68..a5c55ceb41 100644
--- a/engines/wintermute/base/base_parser.h
+++ b/engines/wintermute/base/base_parser.h
@@ -40,7 +40,7 @@
TOKEN_TOTAL_COUNT \
};
#define TOKEN_TABLE_START(name) \
- static CBParser::TokenDesc name [] = \
+ static BaseParser::TokenDesc name [] = \
{
#define TOKEN_TABLE(name) \
{ TOKEN_ ## name, #name },
@@ -57,7 +57,7 @@
namespace WinterMute {
-class CBParser : public CBBase {
+class BaseParser : public BaseClass {
public:
struct TokenDesc {
int32 id;
@@ -67,8 +67,8 @@ public:
public:
int scanStr(const char *in, const char *format, ...);
int32 getCommand(char **buf, TokenDesc *tokens, char **params);
- CBParser(CBGame *inGame = NULL);
- virtual ~CBParser();
+ BaseParser(BaseGame *inGame = NULL);
+ virtual ~BaseParser();
private:
char *getLastOffender();
void skipToken(char **buf, char *tok, char *msg = NULL);
diff --git a/engines/wintermute/base/base_persistence_manager.cpp b/engines/wintermute/base/base_persistence_manager.cpp
index 743eaf355b..18dc8ed11c 100644
--- a/engines/wintermute/base/base_persistence_manager.cpp
+++ b/engines/wintermute/base/base_persistence_manager.cpp
@@ -51,7 +51,7 @@ namespace WinterMute {
#define SAVE_MAGIC_2 0x32564153
//////////////////////////////////////////////////////////////////////////
-CBPersistMgr::CBPersistMgr(CBGame *inGame, const char *savePrefix): CBBase(inGame) {
+BasePersistenceManager::BasePersistenceManager(BaseGame *inGame, const char *savePrefix): BaseClass(inGame) {
_saving = false;
// _buffer = NULL;
// _bufferSize = 0;
@@ -80,13 +80,13 @@ CBPersistMgr::CBPersistMgr(CBGame *inGame, const char *savePrefix): CBBase(inGam
//////////////////////////////////////////////////////////////////////////
-CBPersistMgr::~CBPersistMgr() {
+BasePersistenceManager::~BasePersistenceManager() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-void CBPersistMgr::cleanup() {
+void BasePersistenceManager::cleanup() {
/* if (_buffer) {
if (_saving) free(_buffer);
else delete [] _buffer; // allocated by file manager
@@ -118,12 +118,12 @@ void CBPersistMgr::cleanup() {
_saveStream = NULL;
}
-Common::String CBPersistMgr::getFilenameForSlot(int slot) const {
+Common::String BasePersistenceManager::getFilenameForSlot(int slot) const {
// 3 Digits, to allow for one save-slot for autosave + slot 1 - 100 (which will be numbered 0-99 filename-wise)
return Common::String::format("%s-save%03d.wsv", _savePrefix.c_str(), slot);
}
-void CBPersistMgr::getSaveStateDesc(int slot, SaveStateDescriptor &desc) {
+void BasePersistenceManager::getSaveStateDesc(int slot, SaveStateDescriptor &desc) {
Common::String filename = getFilenameForSlot(slot);
warning("Trying to list savegame %s in slot %d", filename.c_str(), slot);
if (DID_FAIL(readHeader(filename))) {
@@ -150,12 +150,12 @@ void CBPersistMgr::getSaveStateDesc(int slot, SaveStateDescriptor &desc) {
desc.setPlayTime(0);
}
-void CBPersistMgr::deleteSaveSlot(int slot) {
+void BasePersistenceManager::deleteSaveSlot(int slot) {
Common::String filename = getFilenameForSlot(slot);
g_system->getSavefileManager()->removeSavefile(filename);
}
-uint32 CBPersistMgr::getMaxUsedSlot() {
+uint32 BasePersistenceManager::getMaxUsedSlot() {
Common::String saveMask = Common::String::format("%s-save???.wsv", _savePrefix.c_str());
Common::StringArray saves = g_system->getSavefileManager()->listSavefiles(saveMask);
Common::StringArray::iterator it = saves.begin();
@@ -168,7 +168,7 @@ uint32 CBPersistMgr::getMaxUsedSlot() {
return ret;
}
-bool CBPersistMgr::getSaveExists(int slot) {
+bool BasePersistenceManager::getSaveExists(int slot) {
Common::String filename = getFilenameForSlot(slot);
warning("Trying to list savegame %s in slot %d", filename.c_str(), slot);
if (DID_FAIL(readHeader(filename))) {
@@ -178,7 +178,7 @@ bool CBPersistMgr::getSaveExists(int slot) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPersistMgr::initSave(const char *desc) {
+bool BasePersistenceManager::initSave(const char *desc) {
if (!desc) return STATUS_FAILED;
cleanup();
@@ -189,7 +189,7 @@ bool CBPersistMgr::initSave(const char *desc) {
if (_saveStream) {
// get thumbnails
if (!_gameRef->_cachedThumbnail) {
- _gameRef->_cachedThumbnail = new CBSaveThumbHelper(_gameRef);
+ _gameRef->_cachedThumbnail = new BaseSaveThumbHelper(_gameRef);
if (DID_FAIL(_gameRef->_cachedThumbnail->storeThumbnail(true))) {
delete _gameRef->_cachedThumbnail;
_gameRef->_cachedThumbnail = NULL;
@@ -252,7 +252,7 @@ bool CBPersistMgr::initSave(const char *desc) {
return STATUS_OK;
}
-bool CBPersistMgr::readHeader(const Common::String &filename) {
+bool BasePersistenceManager::readHeader(const Common::String &filename) {
cleanup();
_saving = false;
@@ -307,7 +307,7 @@ bool CBPersistMgr::readHeader(const Common::String &filename) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPersistMgr::initLoad(const char *filename) {
+bool BasePersistenceManager::initLoad(const char *filename) {
if (DID_FAIL(readHeader(filename))) {
cleanup();
return STATUS_FAILED;
@@ -356,13 +356,13 @@ bool CBPersistMgr::initLoad(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBPersistMgr::saveFile(const char *filename) {
+bool BasePersistenceManager::saveFile(const char *filename) {
return _gameRef->_fileManager->saveFile(filename, ((Common::MemoryWriteStreamDynamic *)_saveStream)->getData(), ((Common::MemoryWriteStreamDynamic *)_saveStream)->size(), _gameRef->_compressedSavegames, _richBuffer, _richBufferSize);
}
//////////////////////////////////////////////////////////////////////////
-bool CBPersistMgr::putBytes(byte *buffer, uint32 size) {
+bool BasePersistenceManager::putBytes(byte *buffer, uint32 size) {
_saveStream->write(buffer, size);
if (_saveStream->err())
return STATUS_FAILED;
@@ -370,7 +370,7 @@ bool CBPersistMgr::putBytes(byte *buffer, uint32 size) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPersistMgr::getBytes(byte *buffer, uint32 size) {
+bool BasePersistenceManager::getBytes(byte *buffer, uint32 size) {
_loadStream->read(buffer, size);
if (_loadStream->err())
return STATUS_FAILED;
@@ -378,20 +378,20 @@ bool CBPersistMgr::getBytes(byte *buffer, uint32 size) {
}
//////////////////////////////////////////////////////////////////////////
-void CBPersistMgr::putDWORD(uint32 val) {
+void BasePersistenceManager::putDWORD(uint32 val) {
_saveStream->writeUint32LE(val);
}
//////////////////////////////////////////////////////////////////////////
-uint32 CBPersistMgr::getDWORD() {
+uint32 BasePersistenceManager::getDWORD() {
uint32 ret = _loadStream->readUint32LE();
return ret;
}
//////////////////////////////////////////////////////////////////////////
-void CBPersistMgr::putString(const Common::String &val) {
+void BasePersistenceManager::putString(const Common::String &val) {
if (!val.size()) putString("(null)");
else {
_saveStream->writeUint32LE(val.size());
@@ -399,7 +399,7 @@ void CBPersistMgr::putString(const Common::String &val) {
}
}
-Common::String CBPersistMgr::getStringObj() {
+Common::String BasePersistenceManager::getStringObj() {
uint32 len = _loadStream->readUint32LE();
char *ret = new char[len + 1];
_loadStream->read(ret, len);
@@ -416,7 +416,7 @@ Common::String CBPersistMgr::getStringObj() {
}
//////////////////////////////////////////////////////////////////////////
-char *CBPersistMgr::getString() {
+char *BasePersistenceManager::getString() {
uint32 len = _loadStream->readUint32LE();
char *ret = new char[len + 1];
_loadStream->read(ret, len);
@@ -428,7 +428,7 @@ char *CBPersistMgr::getString() {
} else return ret;
}
-bool CBPersistMgr::putTimeDate(const TimeDate &t) {
+bool BasePersistenceManager::putTimeDate(const TimeDate &t) {
_saveStream->writeSint32LE(t.tm_sec);
_saveStream->writeSint32LE(t.tm_min);
_saveStream->writeSint32LE(t.tm_hour);
@@ -443,7 +443,7 @@ bool CBPersistMgr::putTimeDate(const TimeDate &t) {
return STATUS_OK;
}
-TimeDate CBPersistMgr::getTimeDate() {
+TimeDate BasePersistenceManager::getTimeDate() {
TimeDate t;
t.tm_sec = _loadStream->readSint32LE();
t.tm_min = _loadStream->readSint32LE();
@@ -455,13 +455,13 @@ TimeDate CBPersistMgr::getTimeDate() {
return t;
}
-void CBPersistMgr::putFloat(float val) {
+void BasePersistenceManager::putFloat(float val) {
Common::String str = Common::String::format("F%f", val);
_saveStream->writeUint32LE(str.size());
_saveStream->writeString(str);
}
-float CBPersistMgr::getFloat() {
+float BasePersistenceManager::getFloat() {
char *str = getString();
float value = 0.0f;
int ret = sscanf(str, "F%f", &value);
@@ -472,14 +472,14 @@ float CBPersistMgr::getFloat() {
return value;
}
-void CBPersistMgr::putDouble(double val) {
+void BasePersistenceManager::putDouble(double val) {
Common::String str = Common::String::format("F%f", val);
str.format("D%f", val);
_saveStream->writeUint32LE(str.size());
_saveStream->writeString(str);
}
-double CBPersistMgr::getDouble() {
+double BasePersistenceManager::getDouble() {
char *str = getString();
double value = 0.0f;
int ret = sscanf(str, "F%f", &value);
@@ -492,7 +492,7 @@ double CBPersistMgr::getDouble() {
//////////////////////////////////////////////////////////////////////////
// bool
-bool CBPersistMgr::transfer(const char *name, bool *val) {
+bool BasePersistenceManager::transfer(const char *name, bool *val) {
if (_saving) {
_saveStream->writeByte(*val);
if (_saveStream->err())
@@ -509,7 +509,7 @@ bool CBPersistMgr::transfer(const char *name, bool *val) {
//////////////////////////////////////////////////////////////////////////
// int
-bool CBPersistMgr::transfer(const char *name, int *val) {
+bool BasePersistenceManager::transfer(const char *name, int *val) {
if (_saving) {
_saveStream->writeSint32LE(*val);
if (_saveStream->err())
@@ -526,7 +526,7 @@ bool CBPersistMgr::transfer(const char *name, int *val) {
//////////////////////////////////////////////////////////////////////////
// DWORD
-bool CBPersistMgr::transfer(const char *name, uint32 *val) {
+bool BasePersistenceManager::transfer(const char *name, uint32 *val) {
if (_saving) {
_saveStream->writeUint32LE(*val);
if (_saveStream->err())
@@ -543,7 +543,7 @@ bool CBPersistMgr::transfer(const char *name, uint32 *val) {
//////////////////////////////////////////////////////////////////////////
// float
-bool CBPersistMgr::transfer(const char *name, float *val) {
+bool BasePersistenceManager::transfer(const char *name, float *val) {
if (_saving) {
putFloat(*val);
if (_saveStream->err())
@@ -560,7 +560,7 @@ bool CBPersistMgr::transfer(const char *name, float *val) {
//////////////////////////////////////////////////////////////////////////
// double
-bool CBPersistMgr::transfer(const char *name, double *val) {
+bool BasePersistenceManager::transfer(const char *name, double *val) {
if (_saving) {
putDouble(*val);
if (_saveStream->err())
@@ -577,7 +577,7 @@ bool CBPersistMgr::transfer(const char *name, double *val) {
//////////////////////////////////////////////////////////////////////////
// char*
-bool CBPersistMgr::transfer(const char *name, char **val) {
+bool BasePersistenceManager::transfer(const char *name, char **val) {
if (_saving) {
putString(*val);
return STATUS_OK;
@@ -594,7 +594,7 @@ bool CBPersistMgr::transfer(const char *name, char **val) {
//////////////////////////////////////////////////////////////////////////
// const char*
-bool CBPersistMgr::transfer(const char *name, const char **val) {
+bool BasePersistenceManager::transfer(const char *name, const char **val) {
if (_saving) {
putString(*val);
return STATUS_OK;
@@ -611,7 +611,7 @@ bool CBPersistMgr::transfer(const char *name, const char **val) {
//////////////////////////////////////////////////////////////////////////
// Common::String
-bool CBPersistMgr::transfer(const char *name, Common::String *val) {
+bool BasePersistenceManager::transfer(const char *name, Common::String *val) {
if (_saving) {
putString(*val);
return STATUS_OK;
@@ -632,7 +632,7 @@ bool CBPersistMgr::transfer(const char *name, Common::String *val) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBPersistMgr::transfer(const char *name, AnsiStringArray &val) {
+bool BasePersistenceManager::transfer(const char *name, AnsiStringArray &val) {
size_t size;
if (_saving) {
@@ -662,7 +662,7 @@ bool CBPersistMgr::transfer(const char *name, AnsiStringArray &val) {
//////////////////////////////////////////////////////////////////////////
// BYTE
-bool CBPersistMgr::transfer(const char *name, byte *val) {
+bool BasePersistenceManager::transfer(const char *name, byte *val) {
if (_saving) {
_saveStream->writeByte(*val);
if (_saveStream->err())
@@ -679,7 +679,7 @@ bool CBPersistMgr::transfer(const char *name, byte *val) {
//////////////////////////////////////////////////////////////////////////
// RECT
-bool CBPersistMgr::transfer(const char *name, Rect32 *val) {
+bool BasePersistenceManager::transfer(const char *name, Rect32 *val) {
if (_saving) {
_saveStream->writeSint32LE(val->left);
_saveStream->writeSint32LE(val->top);
@@ -702,7 +702,7 @@ bool CBPersistMgr::transfer(const char *name, Rect32 *val) {
//////////////////////////////////////////////////////////////////////////
// POINT
-bool CBPersistMgr::transfer(const char *name, Point32 *val) {
+bool BasePersistenceManager::transfer(const char *name, Point32 *val) {
if (_saving) {
_saveStream->writeSint32LE(val->x);
_saveStream->writeSint32LE(val->y);
@@ -721,7 +721,7 @@ bool CBPersistMgr::transfer(const char *name, Point32 *val) {
//////////////////////////////////////////////////////////////////////////
// Vector2
-bool CBPersistMgr::transfer(const char *name, Vector2 *val) {
+bool BasePersistenceManager::transfer(const char *name, Vector2 *val) {
if (_saving) {
putFloat(val->x);
putFloat(val->y);
@@ -740,11 +740,11 @@ bool CBPersistMgr::transfer(const char *name, Vector2 *val) {
//////////////////////////////////////////////////////////////////////////
// generic pointer
-bool CBPersistMgr::transfer(const char *name, void *val) {
+bool BasePersistenceManager::transfer(const char *name, void *val) {
int classID = -1, instanceID = -1;
if (_saving) {
- CSysClassRegistry::getInstance()->getPointerID(*(void **)val, &classID, &instanceID);
+ SystemClassRegistry::getInstance()->getPointerID(*(void **)val, &classID, &instanceID);
if (*(void **)val != NULL && (classID == -1 || instanceID == -1)) {
_gameRef->LOG(0, "Warning: invalid instance '%s'", name);
}
@@ -755,7 +755,7 @@ bool CBPersistMgr::transfer(const char *name, void *val) {
classID = _loadStream->readUint32LE();
instanceID = _loadStream->readUint32LE();
- *(void **)val = CSysClassRegistry::getInstance()->idToPointer(classID, instanceID);
+ *(void **)val = SystemClassRegistry::getInstance()->idToPointer(classID, instanceID);
}
return STATUS_OK;
@@ -763,7 +763,7 @@ bool CBPersistMgr::transfer(const char *name, void *val) {
//////////////////////////////////////////////////////////////////////////
-bool CBPersistMgr::checkVersion(byte verMajor, byte verMinor, byte verBuild) {
+bool BasePersistenceManager::checkVersion(byte verMajor, byte verMinor, byte verBuild) {
if (_saving) return true;
// it's ok if we are same or newer than the saved game
diff --git a/engines/wintermute/base/base_persistence_manager.h b/engines/wintermute/base/base_persistence_manager.h
index f2fd42ceca..a400c612dc 100644
--- a/engines/wintermute/base/base_persistence_manager.h
+++ b/engines/wintermute/base/base_persistence_manager.h
@@ -42,7 +42,7 @@ namespace WinterMute {
class Vector2;
-class CBPersistMgr : public CBBase {
+class BasePersistenceManager : public BaseClass {
public:
char *_savedDescription;
TimeDate _savedTimestamp;
@@ -94,8 +94,8 @@ public:
bool transfer(const char *name, Common::String *val);
bool transfer(const char *name, Vector2 *val);
bool transfer(const char *name, AnsiStringArray &Val);
- CBPersistMgr(CBGame *inGame = NULL, const char *savePrefix = NULL);
- virtual ~CBPersistMgr();
+ BasePersistenceManager(BaseGame *inGame = NULL, const char *savePrefix = NULL);
+ virtual ~BasePersistenceManager();
bool checkVersion(byte verMajor, byte verMinor, byte verBuild);
uint32 _thumbnailDataSize;
diff --git a/engines/wintermute/base/base_point.cpp b/engines/wintermute/base/base_point.cpp
index e878f34387..76d8d85c70 100644
--- a/engines/wintermute/base/base_point.cpp
+++ b/engines/wintermute/base/base_point.cpp
@@ -32,28 +32,28 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBPoint, false)
+IMPLEMENT_PERSISTENT(BasePoint, false)
//////////////////////////////////////////////////////////////////////////
-CBPoint::CBPoint() {
+BasePoint::BasePoint() {
x = y = 0;
}
//////////////////////////////////////////////////////////////////////////
-CBPoint::~CBPoint() {
+BasePoint::~BasePoint() {
}
//////////////////////////////////////////////////////////////////////////
-CBPoint::CBPoint(int initX, int initY) {
+BasePoint::BasePoint(int initX, int initY) {
x = initX;
y = initY;
}
//////////////////////////////////////////////////////////////////////////
-bool CBPoint::persist(CBPersistMgr *persistMgr) {
+bool BasePoint::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(x));
persistMgr->transfer(TMEMBER(y));
diff --git a/engines/wintermute/base/base_point.h b/engines/wintermute/base/base_point.h
index 363ab1f919..35d310b8d9 100644
--- a/engines/wintermute/base/base_point.h
+++ b/engines/wintermute/base/base_point.h
@@ -34,14 +34,14 @@
namespace WinterMute {
-class CBPoint: public CBBase {
+class BasePoint: public BaseClass {
public:
- DECLARE_PERSISTENT(CBPoint, CBBase)
- CBPoint();
- CBPoint(int initX, int initY);
+ DECLARE_PERSISTENT(BasePoint, BaseClass)
+ BasePoint();
+ BasePoint(int initX, int initY);
int y;
int x;
- virtual ~CBPoint();
+ virtual ~BasePoint();
};
diff --git a/engines/wintermute/base/base_quick_msg.cpp b/engines/wintermute/base/base_quick_msg.cpp
index ac1001a2fe..856a214f80 100644
--- a/engines/wintermute/base/base_quick_msg.cpp
+++ b/engines/wintermute/base/base_quick_msg.cpp
@@ -33,7 +33,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBQuickMsg::CBQuickMsg(CBGame *inGame, const char *text): CBBase(inGame) {
+BaseQuickMsg::BaseQuickMsg(BaseGame *inGame, const char *text): BaseClass(inGame) {
_text = new char [strlen(text) + 1];
if (_text) strcpy(_text, text);
_startTime = _gameRef->_currentTime;
@@ -41,13 +41,13 @@ CBQuickMsg::CBQuickMsg(CBGame *inGame, const char *text): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBQuickMsg::~CBQuickMsg() {
+BaseQuickMsg::~BaseQuickMsg() {
if (_text) delete [] _text;
}
//////////////////////////////////////////////////////////////////////////
-char *CBQuickMsg::getText() {
+char *BaseQuickMsg::getText() {
return _text;
}
diff --git a/engines/wintermute/base/base_quick_msg.h b/engines/wintermute/base/base_quick_msg.h
index 9a68929932..f2f9144bc0 100644
--- a/engines/wintermute/base/base_quick_msg.h
+++ b/engines/wintermute/base/base_quick_msg.h
@@ -33,13 +33,13 @@
namespace WinterMute {
-class CBQuickMsg : public CBBase {
+class BaseQuickMsg : public BaseClass {
public:
char *getText();
uint32 _startTime;
char *_text;
- CBQuickMsg(CBGame *inGame, const char *Text);
- virtual ~CBQuickMsg();
+ BaseQuickMsg(BaseGame *inGame, const char *Text);
+ virtual ~BaseQuickMsg();
};
diff --git a/engines/wintermute/base/base_region.cpp b/engines/wintermute/base/base_region.cpp
index 3e513f9fb8..e336b92789 100644
--- a/engines/wintermute/base/base_region.cpp
+++ b/engines/wintermute/base/base_region.cpp
@@ -40,43 +40,43 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBRegion, false)
+IMPLEMENT_PERSISTENT(BaseRegion, false)
//////////////////////////////////////////////////////////////////////////
-CBRegion::CBRegion(CBGame *inGame): CBObject(inGame) {
+BaseRegion::BaseRegion(BaseGame *inGame): BaseObject(inGame) {
_active = true;
_editorSelectedPoint = -1;
_lastMimicScale = -1;
_lastMimicX = _lastMimicY = INT_MIN;
- CBPlatform::setRectEmpty(&_rect);
+ BasePlatform::setRectEmpty(&_rect);
}
//////////////////////////////////////////////////////////////////////////
-CBRegion::~CBRegion() {
+BaseRegion::~BaseRegion() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-void CBRegion::cleanup() {
+void BaseRegion::cleanup() {
for (int i = 0; i < _points.getSize(); i++) delete _points[i];
_points.removeAll();
- CBPlatform::setRectEmpty(&_rect);
+ BasePlatform::setRectEmpty(&_rect);
_editorSelectedPoint = -1;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::createRegion() {
+bool BaseRegion::createRegion() {
return DID_SUCCEED(getBoundingRect(&_rect));
}
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::pointInRegion(int x, int y) {
+bool BaseRegion::pointInRegion(int x, int y) {
if (_points.getSize() < 3) return false;
Point32 pt;
@@ -89,16 +89,16 @@ bool CBRegion::pointInRegion(int x, int y) {
rect.top = y - 1;
rect.bottom = y + 2;
- if (CBPlatform::ptInRect(&_rect, pt)) return ptInPolygon(x, y);
+ if (BasePlatform::ptInRect(&_rect, pt)) return ptInPolygon(x, y);
else return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::loadFile(const char *filename) {
+bool BaseRegion::loadFile(const char *filename) {
byte *buffer = _gameRef->_fileManager->readWholeFile(filename);
if (buffer == NULL) {
- _gameRef->LOG(0, "CBRegion::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseRegion::LoadFile failed for file '%s'", filename);
return STATUS_FAILED;
}
@@ -128,7 +128,7 @@ TOKEN_DEF(EDITOR_SELECTED_POINT)
TOKEN_DEF(PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::loadBuffer(byte *buffer, bool complete) {
+bool BaseRegion::loadBuffer(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(REGION)
TOKEN_TABLE(TEMPLATE)
@@ -143,7 +143,7 @@ bool CBRegion::loadBuffer(byte *buffer, bool complete) {
byte *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if (complete) {
if (parser.getCommand((char **)&buffer, commands, (char **)&params) != TOKEN_REGION) {
@@ -179,7 +179,7 @@ bool CBRegion::loadBuffer(byte *buffer, bool complete) {
case TOKEN_POINT: {
int x, y;
parser.scanStr((char *)params, "%d,%d", &x, &y);
- _points.add(new CBPoint(x, y));
+ _points.add(new BasePoint(x, y));
}
break;
@@ -210,7 +210,7 @@ bool CBRegion::loadBuffer(byte *buffer, bool complete) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseRegion::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// AddPoint
@@ -220,7 +220,7 @@ bool CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
int x = stack->pop()->getInt();
int y = stack->pop()->getInt();
- _points.add(new CBPoint(x, y));
+ _points.add(new BasePoint(x, y));
createRegion();
stack->pushBool(true);
@@ -238,7 +238,7 @@ bool CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
int y = stack->pop()->getInt();
if (Index >= 0 && Index < _points.getSize()) {
- _points.insertAt(Index, new CBPoint(x, y));
+ _points.insertAt(Index, new BasePoint(x, y));
createRegion();
stack->pushBool(true);
@@ -295,7 +295,7 @@ bool CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
int index = stack->pop()->getInt();
if (index >= 0 && index < _points.getSize()) {
- CScValue *val = stack->getPushValue();
+ ScValue *val = stack->getPushValue();
if (val) {
val->setProperty("X", _points[index]->x);
val->setProperty("Y", _points[index]->y);
@@ -305,12 +305,12 @@ bool CBRegion::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
return STATUS_OK;
}
- else return CBObject::scCallMethod(script, stack, thisStack, name);
+ else return BaseObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBRegion::scGetProperty(const char *name) {
+ScValue *BaseRegion::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -345,12 +345,12 @@ CScValue *CBRegion::scGetProperty(const char *name) {
return _scValue;
}
- else return CBObject::scGetProperty(name);
+ else return BaseObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::scSetProperty(const char *name, CScValue *value) {
+bool BaseRegion::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
@@ -367,18 +367,18 @@ bool CBRegion::scSetProperty(const char *name, CScValue *value) {
return STATUS_OK;
}
- else return CBObject::scSetProperty(name, value);
+ else return BaseObject::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CBRegion::scToString() {
+const char *BaseRegion::scToString() {
return "[region]";
}
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::saveAsText(CBDynBuffer *buffer, int indent, const char *nameOverride) {
+bool BaseRegion::saveAsText(BaseDynamicBuffer *buffer, int indent, const char *nameOverride) {
if (!nameOverride) buffer->putTextIndent(indent, "REGION {\n");
else buffer->putTextIndent(indent, "%s {\n", nameOverride);
@@ -406,9 +406,9 @@ bool CBRegion::saveAsText(CBDynBuffer *buffer, int indent, const char *nameOverr
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::persist(CBPersistMgr *persistMgr) {
+bool BaseRegion::persist(BasePersistenceManager *persistMgr) {
- CBObject::persist(persistMgr);
+ BaseObject::persist(persistMgr);
persistMgr->transfer(TMEMBER(_active));
persistMgr->transfer(TMEMBER(_editorSelectedPoint));
@@ -426,7 +426,7 @@ typedef struct {
} dPoint;
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::ptInPolygon(int x, int y) {
+bool BaseRegion::ptInPolygon(int x, int y) {
if (_points.getSize() < 3) return false;
int counter = 0;
@@ -465,8 +465,8 @@ bool CBRegion::ptInPolygon(int x, int y) {
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::getBoundingRect(Rect32 *rect) {
- if (_points.getSize() == 0) CBPlatform::setRectEmpty(rect);
+bool BaseRegion::getBoundingRect(Rect32 *rect) {
+ if (_points.getSize() == 0) BasePlatform::setRectEmpty(rect);
else {
int MinX = INT_MAX, MinY = INT_MAX, MaxX = INT_MIN, MaxY = INT_MIN;
@@ -477,14 +477,14 @@ bool CBRegion::getBoundingRect(Rect32 *rect) {
MaxX = MAX(MaxX, _points[i]->x);
MaxY = MAX(MaxY, _points[i]->y);
}
- CBPlatform::setRect(rect, MinX, MinY, MaxX, MaxY);
+ BasePlatform::setRect(rect, MinX, MinY, MaxX, MaxY);
}
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRegion::mimic(CBRegion *region, float scale, int x, int y) {
+bool BaseRegion::mimic(BaseRegion *region, float scale, int x, int y) {
if (scale == _lastMimicScale && x == _lastMimicX && y == _lastMimicY) return STATUS_OK;
cleanup();
@@ -495,7 +495,7 @@ bool CBRegion::mimic(CBRegion *region, float scale, int x, int y) {
xVal = (int)((float)region->_points[i]->x * scale / 100.0f);
yVal = (int)((float)region->_points[i]->y * scale / 100.0f);
- _points.add(new CBPoint(xVal + x, yVal + y));
+ _points.add(new BasePoint(xVal + x, yVal + y));
}
_lastMimicScale = scale;
diff --git a/engines/wintermute/base/base_region.h b/engines/wintermute/base/base_region.h
index 0c35d99bd9..a15e0cca2a 100644
--- a/engines/wintermute/base/base_region.h
+++ b/engines/wintermute/base/base_region.h
@@ -34,32 +34,32 @@
namespace WinterMute {
-class CBRegion : public CBObject {
+class BaseRegion : public BaseObject {
public:
float _lastMimicScale;
int _lastMimicX;
int _lastMimicY;
void cleanup();
- bool mimic(CBRegion *region, float scale = 100.0f, int x = 0, int y = 0);
+ bool mimic(BaseRegion *region, float scale = 100.0f, int x = 0, int y = 0);
bool getBoundingRect(Rect32 *rect);
bool ptInPolygon(int x, int y);
- DECLARE_PERSISTENT(CBRegion, CBObject)
+ DECLARE_PERSISTENT(BaseRegion, BaseObject)
bool _active;
int _editorSelectedPoint;
- CBRegion(CBGame *inGame);
- virtual ~CBRegion();
+ BaseRegion(BaseGame *inGame);
+ virtual ~BaseRegion();
bool pointInRegion(int x, int y);
bool createRegion();
bool loadFile(const char *filename);
bool loadBuffer(byte *buffer, bool complete = true);
Rect32 _rect;
- CBArray<CBPoint *, CBPoint *> _points;
- virtual bool saveAsText(CBDynBuffer *buffer, int indent, const char *nameOverride = NULL);
+ BaseArray<BasePoint *, BasePoint *> _points;
+ virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent, const char *nameOverride = NULL);
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/base/base_registry.cpp b/engines/wintermute/base/base_registry.cpp
index 350a34b61e..dfab1b5076 100644
--- a/engines/wintermute/base/base_registry.cpp
+++ b/engines/wintermute/base/base_registry.cpp
@@ -38,7 +38,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBRegistry::CBRegistry(CBGame *inGame): CBBase(inGame) {
+BaseRegistry::BaseRegistry(BaseGame *inGame): BaseClass(inGame) {
_iniName = NULL;
setIniName("./wme.ini");
@@ -47,7 +47,7 @@ CBRegistry::CBRegistry(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBRegistry::~CBRegistry() {
+BaseRegistry::~BaseRegistry() {
saveValues();
delete[] _iniName;
_iniName = NULL;
@@ -56,7 +56,7 @@ CBRegistry::~CBRegistry() {
//////////////////////////////////////////////////////////////////////////
-AnsiString CBRegistry::readString(const AnsiString &subKey, const AnsiString &key, const AnsiString &init) {
+AnsiString BaseRegistry::readString(const AnsiString &subKey, const AnsiString &key, const AnsiString &init) {
AnsiString ret = "";
bool found = false;
@@ -69,14 +69,14 @@ AnsiString CBRegistry::readString(const AnsiString &subKey, const AnsiString &ke
//////////////////////////////////////////////////////////////////////////
-bool CBRegistry::writeString(const AnsiString &subKey, const AnsiString &key, const AnsiString &value) {
+bool BaseRegistry::writeString(const AnsiString &subKey, const AnsiString &key, const AnsiString &value) {
_values[subKey][key] = value;
return true;
}
//////////////////////////////////////////////////////////////////////////
-int CBRegistry::readInt(const AnsiString &subKey, const AnsiString &key, int init) {
+int BaseRegistry::readInt(const AnsiString &subKey, const AnsiString &key, int init) {
if (subKey == "Audio") {
if (key == "MasterVolume") {
if (ConfMan.hasKey("master_volume")) {
@@ -111,7 +111,7 @@ int CBRegistry::readInt(const AnsiString &subKey, const AnsiString &key, int ini
//////////////////////////////////////////////////////////////////////////
-bool CBRegistry::writeInt(const AnsiString &subKey, const AnsiString &key, int value) {
+bool BaseRegistry::writeInt(const AnsiString &subKey, const AnsiString &key, int value) {
if (subKey == "Audio") {
if (key == "MasterVolume") {
ConfMan.setInt("master_volume", value);
@@ -133,19 +133,19 @@ bool CBRegistry::writeInt(const AnsiString &subKey, const AnsiString &key, int v
//////////////////////////////////////////////////////////////////////////
-bool CBRegistry::readBool(const AnsiString &subKey, const AnsiString &key, bool init) {
+bool BaseRegistry::readBool(const AnsiString &subKey, const AnsiString &key, bool init) {
return (readInt(subKey, key, (int)init) != 0);
}
//////////////////////////////////////////////////////////////////////////
-bool CBRegistry::writeBool(const AnsiString &subKey, const AnsiString &key, bool value) {
+bool BaseRegistry::writeBool(const AnsiString &subKey, const AnsiString &key, bool value) {
return writeInt(subKey, key, (int)value);
}
//////////////////////////////////////////////////////////////////////////
-void CBRegistry::setIniName(const char *name) {
+void BaseRegistry::setIniName(const char *name) {
delete[] _iniName;
_iniName = NULL;
@@ -160,30 +160,30 @@ void CBRegistry::setIniName(const char *name) {
//////////////////////////////////////////////////////////////////////////
-char *CBRegistry::getIniName() {
+char *BaseRegistry::getIniName() {
return _iniName;
}
//////////////////////////////////////////////////////////////////////////
-void CBRegistry::loadValues(bool local) {
+void BaseRegistry::loadValues(bool local) {
if (local) loadXml("settings.xml", _localValues);
else loadXml(PathUtil::combine(_gameRef->getDataDir(), "settings.xml"), _values);
}
//////////////////////////////////////////////////////////////////////////
-void CBRegistry::saveValues() {
+void BaseRegistry::saveValues() {
saveXml(PathUtil::combine(_gameRef->getDataDir(), "settings.xml"), _values);
}
//////////////////////////////////////////////////////////////////////////
-void CBRegistry::setBasePath(const char *basePath) {
+void BaseRegistry::setBasePath(const char *basePath) {
_basePath = PathUtil::getFileNameWithoutExtension(basePath);
loadValues(false);
}
//////////////////////////////////////////////////////////////////////////
-AnsiString CBRegistry::getValue(PathValueMap &values, const AnsiString path, const AnsiString &key, bool &found) {
+AnsiString BaseRegistry::getValue(PathValueMap &values, const AnsiString path, const AnsiString &key, bool &found) {
found = false;
PathValueMap::iterator it = values.find(path);
if (it == values.end()) return "";
@@ -198,7 +198,7 @@ AnsiString CBRegistry::getValue(PathValueMap &values, const AnsiString path, con
}
//////////////////////////////////////////////////////////////////////////
-void CBRegistry::loadXml(const AnsiString fileName, PathValueMap &values) {
+void BaseRegistry::loadXml(const AnsiString fileName, PathValueMap &values) {
TiXmlDocument doc(fileName.c_str());
if (!doc.LoadFile()) return;
@@ -215,8 +215,8 @@ void CBRegistry::loadXml(const AnsiString fileName, PathValueMap &values) {
//////////////////////////////////////////////////////////////////////////
-void CBRegistry::saveXml(const AnsiString fileName, PathValueMap &values) {
- CBUtils::createPath(fileName.c_str());
+void BaseRegistry::saveXml(const AnsiString fileName, PathValueMap &values) {
+ BaseUtils::createPath(fileName.c_str());
TiXmlDocument doc;
doc.LinkEndChild(new TiXmlDeclaration("1.0", "utf-8", ""));
diff --git a/engines/wintermute/base/base_registry.h b/engines/wintermute/base/base_registry.h
index 06e052cd03..1d67c18e85 100644
--- a/engines/wintermute/base/base_registry.h
+++ b/engines/wintermute/base/base_registry.h
@@ -33,7 +33,7 @@
namespace WinterMute {
-class CBRegistry : public CBBase {
+class BaseRegistry : public BaseClass {
public:
void setIniName(const char *name);
char *getIniName();
@@ -43,8 +43,8 @@ public:
int readInt(const AnsiString &subKey, const AnsiString &key, int init = 0);
bool writeString(const AnsiString &subKey, const AnsiString &key, const AnsiString &value);
AnsiString readString(const AnsiString &subKey, const AnsiString &key, const AnsiString &init = "");
- CBRegistry(CBGame *inGame);
- virtual ~CBRegistry();
+ BaseRegistry(BaseGame *inGame);
+ virtual ~BaseRegistry();
void setBasePath(const char *basePath);
AnsiString getBasePath() const {
diff --git a/engines/wintermute/base/base_save_thumb_helper.cpp b/engines/wintermute/base/base_save_thumb_helper.cpp
index bee63aa307..68cfb8a7ea 100644
--- a/engines/wintermute/base/base_save_thumb_helper.cpp
+++ b/engines/wintermute/base/base_save_thumb_helper.cpp
@@ -34,18 +34,18 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBSaveThumbHelper::CBSaveThumbHelper(CBGame *inGame): CBBase(inGame) {
+BaseSaveThumbHelper::BaseSaveThumbHelper(BaseGame *inGame): BaseClass(inGame) {
_thumbnail = NULL;
}
//////////////////////////////////////////////////////////////////////////
-CBSaveThumbHelper::~CBSaveThumbHelper(void) {
+BaseSaveThumbHelper::~BaseSaveThumbHelper(void) {
delete _thumbnail;
_thumbnail = NULL;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSaveThumbHelper::storeThumbnail(bool doFlip) {
+bool BaseSaveThumbHelper::storeThumbnail(bool doFlip) {
delete _thumbnail;
_thumbnail = NULL;
@@ -60,12 +60,12 @@ bool CBSaveThumbHelper::storeThumbnail(bool doFlip) {
_gameRef->_renderer->flip();
}
- CBImage *screenshot = _gameRef->_renderer->takeScreenshot();
+ BaseImage *screenshot = _gameRef->_renderer->takeScreenshot();
if (!screenshot) return STATUS_FAILED;
// normal thumbnail
if (_gameRef->_thumbnailWidth > 0 && _gameRef->_thumbnailHeight > 0) {
- _thumbnail = new CBImage(_gameRef);
+ _thumbnail = new BaseImage(_gameRef);
_thumbnail->copyFrom(screenshot, _gameRef->_thumbnailWidth, _gameRef->_thumbnailHeight);
}
diff --git a/engines/wintermute/base/base_save_thumb_helper.h b/engines/wintermute/base/base_save_thumb_helper.h
index e8cdbdc00d..ef2615a668 100644
--- a/engines/wintermute/base/base_save_thumb_helper.h
+++ b/engines/wintermute/base/base_save_thumb_helper.h
@@ -33,16 +33,16 @@
namespace WinterMute {
-class CBImage;
+class BaseImage;
-class CBSaveThumbHelper : public CBBase {
+class BaseSaveThumbHelper : public BaseClass {
public:
- CBSaveThumbHelper(CBGame *inGame);
- virtual ~CBSaveThumbHelper(void);
+ BaseSaveThumbHelper(BaseGame *inGame);
+ virtual ~BaseSaveThumbHelper(void);
bool storeThumbnail(bool doFlip = false);
- CBImage *_thumbnail;
- CBImage *_richThumbnail;
+ BaseImage *_thumbnail;
+ BaseImage *_richThumbnail;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/base_script_holder.cpp b/engines/wintermute/base/base_script_holder.cpp
index 5192f76f6e..f803a9191f 100644
--- a/engines/wintermute/base/base_script_holder.cpp
+++ b/engines/wintermute/base/base_script_holder.cpp
@@ -37,10 +37,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBScriptHolder, false)
+IMPLEMENT_PERSISTENT(BaseScriptHolder, false)
//////////////////////////////////////////////////////////////////////
-CBScriptHolder::CBScriptHolder(CBGame *inGame): CBScriptable(inGame) {
+BaseScriptHolder::BaseScriptHolder(BaseGame *inGame): BaseScriptable(inGame) {
setName("<unnamed>");
_freezable = true;
@@ -49,13 +49,13 @@ CBScriptHolder::CBScriptHolder(CBGame *inGame): CBScriptable(inGame) {
//////////////////////////////////////////////////////////////////////
-CBScriptHolder::~CBScriptHolder() {
+BaseScriptHolder::~BaseScriptHolder() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::cleanup() {
+bool BaseScriptHolder::cleanup() {
delete[] _filename;
_filename = NULL;
@@ -71,7 +71,7 @@ bool CBScriptHolder::cleanup() {
}
//////////////////////////////////////////////////////////////////////
-void CBScriptHolder::setFilename(const char *filename) {
+void BaseScriptHolder::setFilename(const char *filename) {
if (_filename != NULL) delete [] _filename;
_filename = new char [strlen(filename) + 1];
@@ -80,13 +80,13 @@ void CBScriptHolder::setFilename(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::applyEvent(const char *eventName, bool unbreakable) {
+bool BaseScriptHolder::applyEvent(const char *eventName, bool unbreakable) {
int numHandlers = 0;
bool ret = STATUS_FAILED;
for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread) {
- CScScript *handler = _scripts[i]->invokeEventHandler(eventName, unbreakable);
+ ScScript *handler = _scripts[i]->invokeEventHandler(eventName, unbreakable);
if (handler) {
//_scripts.add(handler);
numHandlers++;
@@ -101,7 +101,7 @@ bool CBScriptHolder::applyEvent(const char *eventName, bool unbreakable) {
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::listen(CBScriptHolder *param1, uint32 param2) {
+bool BaseScriptHolder::listen(BaseScriptHolder *param1, uint32 param2) {
return STATUS_FAILED;
}
@@ -109,7 +109,7 @@ bool CBScriptHolder::listen(CBScriptHolder *param1, uint32 param2) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseScriptHolder::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// DEBUG_CrashMe
//////////////////////////////////////////////////////////////////////////
@@ -127,7 +127,7 @@ bool CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack *
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "ApplyEvent") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
bool ret;
ret = applyEvent(val->getString());
@@ -203,12 +203,12 @@ bool CBScriptHolder::scCallMethod(CScScript *script, CScStack *stack, CScStack *
stack->pushBool(ret);
return STATUS_OK;
- } else return CBScriptable::scCallMethod(script, stack, thisStack, name);
+ } else return BaseScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBScriptHolder::scGetProperty(const char *name) {
+ScValue *BaseScriptHolder::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -235,36 +235,36 @@ CScValue *CBScriptHolder::scGetProperty(const char *name) {
return _scValue;
}
- else return CBScriptable::scGetProperty(name);
+ else return BaseScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::scSetProperty(const char *name, CScValue *value) {
+bool BaseScriptHolder::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Name
//////////////////////////////////////////////////////////////////////////
if (strcmp(name, "Name") == 0) {
setName(value->getString());
return STATUS_OK;
- } else return CBScriptable::scSetProperty(name, value);
+ } else return BaseScriptable::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CBScriptHolder::scToString() {
+const char *BaseScriptHolder::scToString() {
return "[script_holder]";
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::saveAsText(CBDynBuffer *buffer, int indent) {
- return CBBase::saveAsText(buffer, indent);
+bool BaseScriptHolder::saveAsText(BaseDynamicBuffer *buffer, int indent) {
+ return BaseClass::saveAsText(buffer, indent);
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::persist(CBPersistMgr *persistMgr) {
- CBScriptable::persist(persistMgr);
+bool BaseScriptHolder::persist(BasePersistenceManager *persistMgr) {
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_filename));
persistMgr->transfer(TMEMBER(_freezable));
@@ -276,21 +276,21 @@ bool CBScriptHolder::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::addScript(const char *filename) {
+bool BaseScriptHolder::addScript(const char *filename) {
for (int i = 0; i < _scripts.getSize(); i++) {
if (scumm_stricmp(_scripts[i]->_filename, filename) == 0) {
if (_scripts[i]->_state != SCRIPT_FINISHED) {
- _gameRef->LOG(0, "CBScriptHolder::AddScript - trying to add script '%s' mutiple times (obj: '%s')", filename, _name);
+ _gameRef->LOG(0, "BaseScriptHolder::AddScript - trying to add script '%s' mutiple times (obj: '%s')", filename, _name);
return STATUS_OK;
}
}
}
- CScScript *scr = _gameRef->_scEngine->runScript(filename, this);
+ ScScript *scr = _gameRef->_scEngine->runScript(filename, this);
if (!scr) {
if (_gameRef->_editorForceScripts) {
// editor hack
- scr = new CScScript(_gameRef, _gameRef->_scEngine);
+ scr = new ScScript(_gameRef, _gameRef->_scEngine);
scr->_filename = new char[strlen(filename) + 1];
strcpy(scr->_filename, filename);
scr->_state = SCRIPT_ERROR;
@@ -311,7 +311,7 @@ bool CBScriptHolder::addScript(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::removeScript(CScScript *script) {
+bool BaseScriptHolder::removeScript(ScScript *script) {
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i] == script) {
_scripts.removeAt(i);
@@ -322,7 +322,7 @@ bool CBScriptHolder::removeScript(CScScript *script) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::canHandleEvent(const char *EventName) {
+bool BaseScriptHolder::canHandleEvent(const char *EventName) {
for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread && _scripts[i]->canHandleEvent(EventName)) return true;
}
@@ -331,7 +331,7 @@ bool CBScriptHolder::canHandleEvent(const char *EventName) {
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::canHandleMethod(const char *MethodName) {
+bool BaseScriptHolder::canHandleMethod(const char *MethodName) {
for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread && _scripts[i]->canHandleMethod(MethodName)) return true;
}
@@ -345,7 +345,7 @@ TOKEN_DEF(NAME)
TOKEN_DEF(VALUE)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::parseProperty(byte *buffer, bool complete) {
+bool BaseScriptHolder::parseProperty(byte *buffer, bool complete) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(PROPERTY)
TOKEN_TABLE(NAME)
@@ -354,7 +354,7 @@ bool CBScriptHolder::parseProperty(byte *buffer, bool complete) {
byte *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if (complete) {
if (parser.getCommand((char **)&buffer, commands, (char **)&params) != TOKEN_PROPERTY) {
@@ -403,7 +403,7 @@ bool CBScriptHolder::parseProperty(byte *buffer, bool complete) {
}
- CScValue *val = new CScValue(_gameRef);
+ ScValue *val = new ScValue(_gameRef);
val->setString(propValue);
scSetProperty(propName, val);
@@ -418,7 +418,7 @@ bool CBScriptHolder::parseProperty(byte *buffer, bool complete) {
//////////////////////////////////////////////////////////////////////////
-void CBScriptHolder::makeFreezable(bool freezable) {
+void BaseScriptHolder::makeFreezable(bool freezable) {
_freezable = freezable;
for (int i = 0; i < _scripts.getSize(); i++)
_scripts[i]->_freezable = freezable;
@@ -427,11 +427,11 @@ void CBScriptHolder::makeFreezable(bool freezable) {
//////////////////////////////////////////////////////////////////////////
-CScScript *CBScriptHolder::invokeMethodThread(const char *methodName) {
+ScScript *BaseScriptHolder::invokeMethodThread(const char *methodName) {
for (int i = _scripts.getSize() - 1; i >= 0; i--) {
if (_scripts[i]->canHandleMethod(methodName)) {
- CScScript *thread = new CScScript(_gameRef, _scripts[i]->_engine);
+ ScScript *thread = new ScScript(_gameRef, _scripts[i]->_engine);
if (thread) {
bool ret = thread->createMethodThread(_scripts[i], methodName);
if (DID_SUCCEED(ret)) {
@@ -450,7 +450,7 @@ CScScript *CBScriptHolder::invokeMethodThread(const char *methodName) {
//////////////////////////////////////////////////////////////////////////
-void CBScriptHolder::scDebuggerDesc(char *buf, int bufSize) {
+void BaseScriptHolder::scDebuggerDesc(char *buf, int bufSize) {
strcpy(buf, scToString());
if (_name && strcmp(_name, "<unnamed>") != 0) {
strcat(buf, " Name: ");
@@ -466,7 +466,7 @@ void CBScriptHolder::scDebuggerDesc(char *buf, int bufSize) {
//////////////////////////////////////////////////////////////////////////
// IWmeObject
//////////////////////////////////////////////////////////////////////////
-bool CBScriptHolder::sendEvent(const char *eventName) {
+bool BaseScriptHolder::sendEvent(const char *eventName) {
return DID_SUCCEED(applyEvent(eventName));
}
diff --git a/engines/wintermute/base/base_script_holder.h b/engines/wintermute/base/base_script_holder.h
index 0e5bc1b7ec..52711572c1 100644
--- a/engines/wintermute/base/base_script_holder.h
+++ b/engines/wintermute/base/base_script_holder.h
@@ -35,21 +35,21 @@
namespace WinterMute {
-class CBScriptHolder : public CBScriptable {
+class BaseScriptHolder : public BaseScriptable {
public:
- DECLARE_PERSISTENT(CBScriptHolder, CBScriptable)
+ DECLARE_PERSISTENT(BaseScriptHolder, BaseScriptable)
- CBScriptHolder(CBGame *inGame);
- virtual ~CBScriptHolder();
- virtual CScScript *invokeMethodThread(const char *methodName);
+ BaseScriptHolder(BaseGame *inGame);
+ virtual ~BaseScriptHolder();
+ virtual ScScript *invokeMethodThread(const char *methodName);
virtual void makeFreezable(bool freezable);
bool canHandleEvent(const char *eventName);
virtual bool canHandleMethod(const char *eventMethod);
bool cleanup();
- bool removeScript(CScScript *script);
+ bool removeScript(ScScript *script);
bool addScript(const char *filename);
- virtual bool saveAsText(CBDynBuffer *buffer, int indent);
- virtual bool listen(CBScriptHolder *param1, uint32 param2);
+ virtual bool saveAsText(BaseDynamicBuffer *buffer, int indent);
+ virtual bool listen(BaseScriptHolder *param1, uint32 param2);
bool applyEvent(const char *eventName, bool unbreakable = false);
void setFilename(const char *filename);
bool parseProperty(byte *buffer, bool complete = true);
@@ -57,11 +57,11 @@ public:
bool _freezable;
bool _ready;
- CBArray<CScScript *, CScScript *> _scripts;
+ BaseArray<ScScript *, ScScript *> _scripts;
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
virtual void scDebuggerDesc(char *buf, int bufSize);
// IWmeObject
diff --git a/engines/wintermute/base/base_scriptable.cpp b/engines/wintermute/base/base_scriptable.cpp
index e9489fa407..6da67db3fb 100644
--- a/engines/wintermute/base/base_scriptable.cpp
+++ b/engines/wintermute/base/base_scriptable.cpp
@@ -33,14 +33,14 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBScriptable, false)
+IMPLEMENT_PERSISTENT(BaseScriptable, false)
//////////////////////////////////////////////////////////////////////////
-CBScriptable::CBScriptable(CBGame *inGame, bool noValue, bool persistable): CBNamedObject(inGame) {
+BaseScriptable::BaseScriptable(BaseGame *inGame, bool noValue, bool persistable): BaseNamedObject(inGame) {
_refCount = 0;
if (noValue) _scValue = NULL;
- else _scValue = new CScValue(_gameRef);
+ else _scValue = new ScValue(_gameRef);
_persistable = persistable;
@@ -49,7 +49,7 @@ CBScriptable::CBScriptable(CBGame *inGame, bool noValue, bool persistable): CBNa
//////////////////////////////////////////////////////////////////////////
-CBScriptable::~CBScriptable() {
+BaseScriptable::~BaseScriptable() {
//if(_refCount>0) _gameRef->LOG(0, "Warning: Destroying object, _refCount=%d", _refCount);
delete _scValue;
delete _scProp;
@@ -61,7 +61,7 @@ CBScriptable::~CBScriptable() {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBScriptable::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseScriptable::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
/*
stack->correctParams(0);
stack->pushNULL();
@@ -74,72 +74,72 @@ bool CBScriptable::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
//////////////////////////////////////////////////////////////////////////
-CScValue *CBScriptable::scGetProperty(const char *name) {
- if (!_scProp) _scProp = new CScValue(_gameRef);
+ScValue *BaseScriptable::scGetProperty(const char *name) {
+ if (!_scProp) _scProp = new ScValue(_gameRef);
if (_scProp) return _scProp->getProp(name);
else return NULL;
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptable::scSetProperty(const char *name, CScValue *value) {
- if (!_scProp) _scProp = new CScValue(_gameRef);
+bool BaseScriptable::scSetProperty(const char *name, ScValue *value) {
+ if (!_scProp) _scProp = new ScValue(_gameRef);
if (_scProp) return _scProp->setProp(name, value);
else return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-const char *CBScriptable::scToString() {
+const char *BaseScriptable::scToString() {
return "[native object]";
}
//////////////////////////////////////////////////////////////////////////
-void *CBScriptable::scToMemBuffer() {
+void *BaseScriptable::scToMemBuffer() {
return (void *)NULL;
}
//////////////////////////////////////////////////////////////////////////
-int CBScriptable::scToInt() {
+int BaseScriptable::scToInt() {
return 0;
}
//////////////////////////////////////////////////////////////////////////
-double CBScriptable::scToFloat() {
+double BaseScriptable::scToFloat() {
return 0.0f;
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptable::scToBool() {
+bool BaseScriptable::scToBool() {
return false;
}
//////////////////////////////////////////////////////////////////////////
-void CBScriptable::scSetString(const char *val) {
+void BaseScriptable::scSetString(const char *val) {
}
//////////////////////////////////////////////////////////////////////////
-void CBScriptable::scSetInt(int val) {
+void BaseScriptable::scSetInt(int val) {
}
//////////////////////////////////////////////////////////////////////////
-void CBScriptable::scSetFloat(double val) {
+void BaseScriptable::scSetFloat(double val) {
}
//////////////////////////////////////////////////////////////////////////
-void CBScriptable::scSetBool(bool val) {
+void BaseScriptable::scSetBool(bool val) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptable::persist(CBPersistMgr *persistMgr) {
+bool BaseScriptable::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_gameRef));
persistMgr->transfer(TMEMBER(_refCount));
persistMgr->transfer(TMEMBER(_scProp));
@@ -150,25 +150,25 @@ bool CBScriptable::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-int CBScriptable::scCompare(CBScriptable *val) {
+int BaseScriptable::scCompare(BaseScriptable *val) {
if (this < val) return -1;
else if (this > val) return 1;
else return 0;
}
//////////////////////////////////////////////////////////////////////////
-void CBScriptable::scDebuggerDesc(char *buf, int bufSize) {
+void BaseScriptable::scDebuggerDesc(char *buf, int bufSize) {
strcpy(buf, scToString());
}
//////////////////////////////////////////////////////////////////////////
-bool CBScriptable::canHandleMethod(const char *eventMethod) {
+bool BaseScriptable::canHandleMethod(const char *eventMethod) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-CScScript *CBScriptable::invokeMethodThread(const char *methodName) {
+ScScript *BaseScriptable::invokeMethodThread(const char *methodName) {
return NULL;
}
@@ -176,12 +176,12 @@ CScScript *CBScriptable::invokeMethodThread(const char *methodName) {
//////////////////////////////////////////////////////////////////////////
// IWmeDebugObject
//////////////////////////////////////////////////////////////////////////
-const char *CBScriptable::dbgGetNativeClass() {
+const char *BaseScriptable::dbgGetNativeClass() {
return getClassName();
}
//////////////////////////////////////////////////////////////////////////
-IWmeDebugProp *CBScriptable::dbgGetProperty(const char *name) {
+IWmeDebugProp *BaseScriptable::dbgGetProperty(const char *name) {
return scGetProperty(name);
}
diff --git a/engines/wintermute/base/base_scriptable.h b/engines/wintermute/base/base_scriptable.h
index 166f3c0bd1..b9283ed349 100644
--- a/engines/wintermute/base/base_scriptable.h
+++ b/engines/wintermute/base/base_scriptable.h
@@ -36,23 +36,23 @@
namespace WinterMute {
-class CScValue;
-class CScStack;
-class CScScript;
+class ScValue;
+class ScStack;
+class ScScript;
-class CBScriptable : public CBNamedObject, public IWmeDebugObject {
+class BaseScriptable : public BaseNamedObject, public IWmeDebugObject {
public:
- virtual CScScript *invokeMethodThread(const char *methodName);
- DECLARE_PERSISTENT(CBScriptable, CBNamedObject)
+ virtual ScScript *invokeMethodThread(const char *methodName);
+ DECLARE_PERSISTENT(BaseScriptable, BaseNamedObject)
- CBScriptable(CBGame *inGame, bool noValue = false, bool persistable = true);
- virtual ~CBScriptable();
+ BaseScriptable(BaseGame *inGame, bool noValue = false, bool persistable = true);
+ virtual ~BaseScriptable();
// high level scripting interface
virtual bool canHandleMethod(const char *eventMethod);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
virtual void *scToMemBuffer();
virtual int scToInt();
@@ -62,11 +62,11 @@ public:
virtual void scSetInt(int val);
virtual void scSetFloat(double val);
virtual void scSetBool(bool val);
- virtual int scCompare(CBScriptable *val);
+ virtual int scCompare(BaseScriptable *val);
virtual void scDebuggerDesc(char *buf, int bufSize);
int _refCount;
- CScValue *_scValue;
- CScValue *_scProp;
+ ScValue *_scValue;
+ ScValue *_scProp;
public:
// IWmeDebugObject
@@ -76,14 +76,14 @@ public:
};
// Implemented in their respective .cpp-files
-CBScriptable *makeSXArray(CBGame *inGame, CScStack *stack);
-CBScriptable *makeSXDate(CBGame *inGame, CScStack *stack);
-CBScriptable *makeSXFile(CBGame *inGame, CScStack *stack);
-CBScriptable *makeSXMath(CBGame *inGame);
-CBScriptable *makeSXMemBuffer(CBGame *inGame, CScStack *stack);
-CBScriptable *makeSXObject(CBGame *inGame, CScStack *stack);
-CBScriptable *makeSXStore(CBGame *inGame);
-CBScriptable *makeSXString(CBGame *inGame, CScStack *stack);
+BaseScriptable *makeSXArray(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXDate(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXFile(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXMath(BaseGame *inGame);
+BaseScriptable *makeSXMemBuffer(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXObject(BaseGame *inGame, ScStack *stack);
+BaseScriptable *makeSXStore(BaseGame *inGame);
+BaseScriptable *makeSXString(BaseGame *inGame, ScStack *stack);
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/base_sprite.cpp b/engines/wintermute/base/base_sprite.cpp
index ba55d1b88b..046a40bacf 100644
--- a/engines/wintermute/base/base_sprite.cpp
+++ b/engines/wintermute/base/base_sprite.cpp
@@ -45,10 +45,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBSprite, false)
+IMPLEMENT_PERSISTENT(BaseSprite, false)
//////////////////////////////////////////////////////////////////////
-CBSprite::CBSprite(CBGame *inGame, CBObject *Owner): CBScriptHolder(inGame) {
+BaseSprite::BaseSprite(BaseGame *inGame, BaseObject *Owner): BaseScriptHolder(inGame) {
_editorAllFrames = false;
_owner = Owner;
setDefaults();
@@ -56,13 +56,13 @@ CBSprite::CBSprite(CBGame *inGame, CBObject *Owner): CBScriptHolder(inGame) {
//////////////////////////////////////////////////////////////////////
-CBSprite::~CBSprite() {
+BaseSprite::~BaseSprite() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-void CBSprite::setDefaults() {
+void BaseSprite::setDefaults() {
_currentFrame = -1;
_looping = false;
_lastFrameTime = 0;
@@ -87,8 +87,8 @@ void CBSprite::setDefaults() {
//////////////////////////////////////////////////////////////////////////
-void CBSprite::cleanup() {
- CBScriptHolder::cleanup();
+void BaseSprite::cleanup() {
+ BaseScriptHolder::cleanup();
for (int i = 0; i < _frames.getSize(); i++)
delete _frames[i];
@@ -102,7 +102,7 @@ void CBSprite::cleanup() {
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::draw(int x, int y, CBObject *registerOwner, float zoomX, float zoomY, uint32 alpha) {
+bool BaseSprite::draw(int x, int y, BaseObject *registerOwner, float zoomX, float zoomY, uint32 alpha) {
GetCurrentFrame(zoomX, zoomY);
if (_currentFrame < 0 || _currentFrame >= _frames.getSize()) return STATUS_OK;
@@ -122,10 +122,10 @@ bool CBSprite::draw(int x, int y, CBObject *registerOwner, float zoomX, float zo
//////////////////////////////////////////////////////////////////////
-bool CBSprite::loadFile(const char *filename, int lifeTime, TSpriteCacheType cacheType) {
+bool BaseSprite::loadFile(const char *filename, int lifeTime, TSpriteCacheType cacheType) {
Common::SeekableReadStream *file = _gameRef->_fileManager->openFile(filename);
if (!file) {
- _gameRef->LOG(0, "CBSprite::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseSprite::LoadFile failed for file '%s'", filename);
if (_gameRef->_debugDebugMode) return loadFile("invalid_debug.bmp", lifeTime, cacheType);
else return loadFile("invalid.bmp", lifeTime, cacheType);
} else {
@@ -137,8 +137,8 @@ bool CBSprite::loadFile(const char *filename, int lifeTime, TSpriteCacheType cac
AnsiString ext = PathUtil::getExtension(filename);
if (StringUtil::startsWith(filename, "savegame:", true) || StringUtil::compareNoCase(ext, "bmp") || StringUtil::compareNoCase(ext, "tga") || StringUtil::compareNoCase(ext, "png") || StringUtil::compareNoCase(ext, "jpg")) {
- CBFrame *frame = new CBFrame(_gameRef);
- CBSubFrame *subframe = new CBSubFrame(_gameRef);
+ BaseFrame *frame = new BaseFrame(_gameRef);
+ BaseSubFrame *subframe = new BaseSubFrame(_gameRef);
subframe->setSurface(filename, true, 0, 0, 0, lifeTime, true);
if (subframe->_surface == NULL) {
_gameRef->LOG(0, "Error loading simple sprite '%s'", filename);
@@ -146,7 +146,7 @@ bool CBSprite::loadFile(const char *filename, int lifeTime, TSpriteCacheType cac
delete frame;
delete subframe;
} else {
- CBPlatform::setRect(&subframe->_rect, 0, 0, subframe->_surface->getWidth(), subframe->_surface->getHeight());
+ BasePlatform::setRect(&subframe->_rect, 0, 0, subframe->_surface->getWidth(), subframe->_surface->getHeight());
frame->_subframes.add(subframe);
_frames.add(frame);
_currentFrame = 0;
@@ -187,7 +187,7 @@ TOKEN_DEF(EDITOR_BG_ALPHA)
TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
-bool CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCacheType cacheType) {
+bool BaseSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCacheType cacheType) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(CONTINUOUS)
TOKEN_TABLE(SPRITE)
@@ -208,7 +208,7 @@ bool CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCach
byte *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
cleanup();
@@ -222,7 +222,7 @@ bool CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCach
}
int frameCount = 1;
- CBFrame *frame;
+ BaseFrame *frame;
while ((cmd = parser.getCommand((char **)&buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
case TOKEN_CONTINUOUS:
@@ -287,7 +287,7 @@ bool CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCach
int FrameLifeTime = lifeTime;
if (cacheType == CACHE_HALF && frameCount % 2 != 1) FrameLifeTime = -1;
- frame = new CBFrame(_gameRef);
+ frame = new BaseFrame(_gameRef);
if (DID_FAIL(frame->loadBuffer(params, FrameLifeTime, _streamedKeepLoaded))) {
delete frame;
@@ -318,7 +318,7 @@ bool CBSprite::loadBuffer(byte *buffer, bool complete, int lifeTime, TSpriteCach
//////////////////////////////////////////////////////////////////////
-void CBSprite::reset() {
+void BaseSprite::reset() {
if (_frames.getSize() > 0) _currentFrame = 0;
else _currentFrame = -1;
@@ -331,7 +331,7 @@ void CBSprite::reset() {
//////////////////////////////////////////////////////////////////////
-bool CBSprite::GetCurrentFrame(float zoomX, float zoomY) {
+bool BaseSprite::GetCurrentFrame(float zoomX, float zoomY) {
//if(_owner && _owner->_freezable && _gameRef->_state == GAME_FROZEN) return true;
if (_currentFrame == -1) return false;
@@ -383,7 +383,7 @@ bool CBSprite::GetCurrentFrame(float zoomX, float zoomY) {
//////////////////////////////////////////////////////////////////////
-bool CBSprite::display(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, uint32 Alpha, float Rotate, TSpriteBlendMode BlendMode) {
+bool BaseSprite::display(int X, int Y, BaseObject *Register, float ZoomX, float ZoomY, uint32 Alpha, float Rotate, TSpriteBlendMode BlendMode) {
if (_currentFrame < 0 || _currentFrame >= _frames.getSize()) return STATUS_OK;
// on change...
@@ -401,34 +401,34 @@ bool CBSprite::display(int X, int Y, CBObject *Register, float ZoomX, float Zoom
//////////////////////////////////////////////////////////////////////////
-CBSurface *CBSprite::getSurface() {
+BaseSurface *BaseSprite::getSurface() {
// only used for animated textures for 3D models
if (_currentFrame < 0 || _currentFrame >= _frames.getSize()) return NULL;
- CBFrame *Frame = _frames[_currentFrame];
+ BaseFrame *Frame = _frames[_currentFrame];
if (Frame && Frame->_subframes.getSize() > 0) {
- CBSubFrame *Subframe = Frame->_subframes[0];
+ BaseSubFrame *Subframe = Frame->_subframes[0];
if (Subframe) return Subframe->_surface;
else return NULL;
} else return NULL;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
+bool BaseSprite::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
- CBPlatform::setRectEmpty(rect);
+ BasePlatform::setRectEmpty(rect);
for (int i = 0; i < _frames.getSize(); i++) {
Rect32 frame;
Rect32 temp;
- CBPlatform::copyRect(&temp, rect);
+ BasePlatform::copyRect(&temp, rect);
_frames[i]->getBoundingRect(&frame, x, y, scaleX, scaleY);
- CBPlatform::unionRect(rect, &temp, &frame);
+ BasePlatform::unionRect(rect, &temp, &frame);
}
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::saveAsText(CBDynBuffer *buffer, int indent) {
+bool BaseSprite::saveAsText(BaseDynamicBuffer *buffer, int indent) {
buffer->putTextIndent(indent, "SPRITE {\n");
buffer->putTextIndent(indent + 2, "NAME=\"%s\"\n", _name);
buffer->putTextIndent(indent + 2, "LOOPING=%s\n", _looping ? "TRUE" : "FALSE");
@@ -451,7 +451,7 @@ bool CBSprite::saveAsText(CBDynBuffer *buffer, int indent) {
buffer->putTextIndent(indent + 2, "EDITOR_BG_ALPHA=%d\n", _editorBgAlpha);
}
- CBScriptHolder::saveAsText(buffer, indent + 2);
+ BaseScriptHolder::saveAsText(buffer, indent + 2);
int i;
@@ -472,8 +472,8 @@ bool CBSprite::saveAsText(CBDynBuffer *buffer, int indent) {
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::persist(CBPersistMgr *persistMgr) {
- CBScriptHolder::persist(persistMgr);
+bool BaseSprite::persist(BasePersistenceManager *persistMgr) {
+ BaseScriptHolder::persist(persistMgr);
persistMgr->transfer(TMEMBER(_canBreak));
persistMgr->transfer(TMEMBER(_changed));
@@ -507,7 +507,7 @@ bool CBSprite::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseSprite::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetFrame
//////////////////////////////////////////////////////////////////////////
@@ -526,14 +526,14 @@ bool CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "DeleteFrame") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ ScValue *Val = stack->pop();
if (Val->isInt()) {
int Index = Val->getInt(-1);
if (Index < 0 || Index >= _frames.getSize()) {
script->runtimeError("Sprite.DeleteFrame: Frame index %d is out of range.", Index);
}
} else {
- CBFrame *Frame = (CBFrame *)Val->getNative();
+ BaseFrame *Frame = (BaseFrame *)Val->getNative();
for (int i = 0; i < _frames.getSize(); i++) {
if (_frames[i] == Frame) {
if (i == _currentFrame) _lastFrameTime = 0;
@@ -562,13 +562,13 @@ bool CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "AddFrame") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
const char *filename = NULL;
if (!val->isNULL()) filename = val->getString();
- CBFrame *frame = new CBFrame(_gameRef);
+ BaseFrame *frame = new BaseFrame(_gameRef);
if (filename != NULL) {
- CBSubFrame *sub = new CBSubFrame(_gameRef);
+ BaseSubFrame *sub = new BaseSubFrame(_gameRef);
if (DID_SUCCEED(sub->setSurface(filename))) {
sub->setDefaultRect();
frame->_subframes.add(sub);
@@ -589,14 +589,14 @@ bool CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
if (index < 0)
index = 0;
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
const char *filename = NULL;
if (!val->isNULL())
filename = val->getString();
- CBFrame *frame = new CBFrame(_gameRef);
+ BaseFrame *frame = new BaseFrame(_gameRef);
if (filename != NULL) {
- CBSubFrame *sub = new CBSubFrame(_gameRef);
+ BaseSubFrame *sub = new BaseSubFrame(_gameRef);
if (DID_SUCCEED(sub->setSurface(filename))) frame->_subframes.add(sub);
else delete sub;
}
@@ -629,12 +629,12 @@ bool CBSprite::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
return STATUS_OK;
}
- else return CBScriptHolder::scCallMethod(script, stack, thisStack, name);
+ else return BaseScriptHolder::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBSprite::scGetProperty(const char *name) {
+ScValue *BaseSprite::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -702,12 +702,12 @@ CScValue *CBSprite::scGetProperty(const char *name) {
return _scValue;
}
- else return CBScriptHolder::scGetProperty(name);
+ else return BaseScriptHolder::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::scSetProperty(const char *name, CScValue *value) {
+bool BaseSprite::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// CurrentFrame
//////////////////////////////////////////////////////////////////////////
@@ -736,18 +736,18 @@ bool CBSprite::scSetProperty(const char *name, CScValue *value) {
return STATUS_OK;
}
- else return CBScriptHolder::scSetProperty(name, value);
+ else return BaseScriptHolder::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CBSprite::scToString() {
+const char *BaseSprite::scToString() {
return "[sprite]";
}
//////////////////////////////////////////////////////////////////////////
-bool CBSprite::killAllSounds() {
+bool BaseSprite::killAllSounds() {
for (int i = 0; i < _frames.getSize(); i++) {
if (_frames[i]->_sound)
_frames[i]->_sound->stop();
diff --git a/engines/wintermute/base/base_sprite.h b/engines/wintermute/base/base_sprite.h
index 8f3ce84eb4..6ddec287d6 100644
--- a/engines/wintermute/base/base_sprite.h
+++ b/engines/wintermute/base/base_sprite.h
@@ -34,13 +34,13 @@
#include "engines/wintermute/base/base_script_holder.h"
namespace WinterMute {
-class CBFrame;
-class CBSurface;
-class CBObject;
-class CBSprite: public CBScriptHolder {
+class BaseFrame;
+class BaseSurface;
+class BaseObject;
+class BaseSprite: public BaseScriptHolder {
public:
bool killAllSounds();
- CBSurface *getSurface();
+ BaseSurface *getSurface();
char *_editorBgFile;
int _editorBgOffsetX;
int _editorBgOffsetY;
@@ -50,38 +50,38 @@ public:
void cleanup();
void setDefaults();
bool _precise;
- DECLARE_PERSISTENT(CBSprite, CBScriptHolder)
+ DECLARE_PERSISTENT(BaseSprite, BaseScriptHolder)
bool _editorAllFrames;
bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
int _moveY;
int _moveX;
- bool display(int x, int y, CBObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
+ bool display(int x, int y, BaseObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
bool GetCurrentFrame(float zoomX = 100, float zoomY = 100);
bool _canBreak;
bool _editorMuted;
bool _continuous;
void reset();
- CBObject *_owner;
+ BaseObject *_owner;
bool _changed;
bool _paused;
bool _finished;
bool loadBuffer(byte *buffer, bool compete = true, int lifeTime = -1, TSpriteCacheType cacheType = CACHE_ALL);
bool loadFile(const char *filename, int lifeTime = -1, TSpriteCacheType cacheType = CACHE_ALL);
uint32 _lastFrameTime;
- bool draw(int x, int y, CBObject *Register = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF);
+ bool draw(int x, int y, BaseObject *Register = NULL, float zoomX = 100, float zoomY = 100, uint32 alpha = 0xFFFFFFFF);
bool _looping;
int _currentFrame;
bool addFrame(const char *filename, uint32 delay = 0, int hotspotX = 0, int hotspotY = 0, Rect32 *rect = NULL);
- CBSprite(CBGame *inGame, CBObject *owner = NULL);
- virtual ~CBSprite();
- CBArray<CBFrame *, CBFrame *> _frames;
- bool saveAsText(CBDynBuffer *buffer, int indent);
+ BaseSprite(BaseGame *inGame, BaseObject *owner = NULL);
+ virtual ~BaseSprite();
+ BaseArray<BaseFrame *, BaseFrame *> _frames;
+ bool saveAsText(BaseDynamicBuffer *buffer, int indent);
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/base/base_string_table.cpp b/engines/wintermute/base/base_string_table.cpp
index c7789add9d..7ac79d4745 100644
--- a/engines/wintermute/base/base_string_table.cpp
+++ b/engines/wintermute/base/base_string_table.cpp
@@ -36,13 +36,13 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBStringTable::CBStringTable(CBGame *inGame): CBBase(inGame) {
+BaseStringTable::BaseStringTable(BaseGame *inGame): BaseClass(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CBStringTable::~CBStringTable() {
+BaseStringTable::~BaseStringTable() {
// delete strings
_strings.clear();
@@ -50,7 +50,7 @@ CBStringTable::~CBStringTable() {
//////////////////////////////////////////////////////////////////////////
-bool CBStringTable::addString(const char *key, const char *val, bool reportDuplicities) {
+bool BaseStringTable::addString(const char *key, const char *val, bool reportDuplicities) {
if (key == NULL || val == NULL) return STATUS_FAILED;
if (scumm_stricmp(key, "@right-to-left") == 0) {
@@ -70,7 +70,7 @@ bool CBStringTable::addString(const char *key, const char *val, bool reportDupli
}
//////////////////////////////////////////////////////////////////////////
-char *CBStringTable::getKey(const char *str) {
+char *BaseStringTable::getKey(const char *str) {
if (str == NULL || str[0] != '/') return NULL;
const char *value = strchr(str + 1, '/');
@@ -79,7 +79,7 @@ char *CBStringTable::getKey(const char *str) {
char *key = new char[value - str];
strncpy(key, str + 1, value - str - 1);
key[value - str - 1] = '\0';
- CBPlatform::strlwr(key);
+ BasePlatform::strlwr(key);
char *new_str;
@@ -102,7 +102,7 @@ char *CBStringTable::getKey(const char *str) {
}
//////////////////////////////////////////////////////////////////////////
-void CBStringTable::expand(char **str, bool forceExpand) {
+void BaseStringTable::expand(char **str, bool forceExpand) {
if (_gameRef->_doNotExpandStrings && !forceExpand) return;
if (str == NULL || *str == NULL || *str[0] != '/') return;
@@ -113,7 +113,7 @@ void CBStringTable::expand(char **str, bool forceExpand) {
char *key = new char[value - *str];
strncpy(key, *str + 1, value - *str - 1);
key[value - *str - 1] = '\0';
- CBPlatform::strlwr(key);
+ BasePlatform::strlwr(key);
value++;
@@ -137,7 +137,7 @@ void CBStringTable::expand(char **str, bool forceExpand) {
//////////////////////////////////////////////////////////////////////////
-const char *CBStringTable::expandStatic(const char *string, bool forceExpand) {
+const char *BaseStringTable::expandStatic(const char *string, bool forceExpand) {
if (_gameRef->_doNotExpandStrings && !forceExpand) return string;
if (string == NULL || string[0] == '\0' || string[0] != '/') return string;
@@ -148,7 +148,7 @@ const char *CBStringTable::expandStatic(const char *string, bool forceExpand) {
char *key = new char[value - string];
strncpy(key, string + 1, value - string - 1);
key[value - string - 1] = '\0';
- CBPlatform::strlwr(key);
+ BasePlatform::strlwr(key);
value++;
@@ -169,7 +169,7 @@ const char *CBStringTable::expandStatic(const char *string, bool forceExpand) {
//////////////////////////////////////////////////////////////////////////
-bool CBStringTable::loadFile(const char *filename, bool clearOld) {
+bool BaseStringTable::loadFile(const char *filename, bool clearOld) {
_gameRef->LOG(0, "Loading string table...");
if (clearOld) _strings.clear();
@@ -177,7 +177,7 @@ bool CBStringTable::loadFile(const char *filename, bool clearOld) {
uint32 size;
byte *buffer = _gameRef->_fileManager->readWholeFile(filename, &size);
if (buffer == NULL) {
- _gameRef->LOG(0, "CBStringTable::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseStringTable::LoadFile failed for file '%s'", filename);
return STATUS_FAILED;
}
diff --git a/engines/wintermute/base/base_string_table.h b/engines/wintermute/base/base_string_table.h
index c612c33a41..ac46aaee43 100644
--- a/engines/wintermute/base/base_string_table.h
+++ b/engines/wintermute/base/base_string_table.h
@@ -35,14 +35,14 @@
namespace WinterMute {
-class CBStringTable : public CBBase {
+class BaseStringTable : public BaseClass {
public:
const char *expandStatic(const char *string, bool forceExpand = false);
bool loadFile(const char *filename, bool deleteAll = true);
void expand(char **str, bool forceExpand = false);
bool addString(const char *key, const char *val, bool reportDuplicities = true);
- CBStringTable(CBGame *inGame);
- virtual ~CBStringTable();
+ BaseStringTable(BaseGame *inGame);
+ virtual ~BaseStringTable();
Common::HashMap<Common::String, Common::String> _strings;
char *getKey(const char *str);
private:
diff --git a/engines/wintermute/base/base_sub_frame.cpp b/engines/wintermute/base/base_sub_frame.cpp
index adce6c6b75..d6a8c2490f 100644
--- a/engines/wintermute/base/base_sub_frame.cpp
+++ b/engines/wintermute/base/base_sub_frame.cpp
@@ -40,16 +40,16 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBSubFrame, false)
+IMPLEMENT_PERSISTENT(BaseSubFrame, false)
//////////////////////////////////////////////////////////////////////////
-CBSubFrame::CBSubFrame(CBGame *inGame): CBScriptable(inGame, true) {
+BaseSubFrame::BaseSubFrame(BaseGame *inGame): BaseScriptable(inGame, true) {
_surface = NULL;
_hotspotX = _hotspotY = 0;
_alpha = 0xFFFFFFFF;
_transparent = 0xFFFF00FF;
- CBPlatform::setRectEmpty(&_rect);
+ BasePlatform::setRectEmpty(&_rect);
_editorSelected = false;
@@ -67,7 +67,7 @@ CBSubFrame::CBSubFrame(CBGame *inGame): CBScriptable(inGame, true) {
//////////////////////////////////////////////////////////////////////////
-CBSubFrame::~CBSubFrame() {
+BaseSubFrame::~BaseSubFrame() {
if (_surface) _gameRef->_surfaceStorage->removeSurface(_surface);
delete[] _surfaceFilename;
_surfaceFilename = NULL;
@@ -90,7 +90,7 @@ TOKEN_DEF(EDITOR_SELECTED)
TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
-bool CBSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
+bool BaseSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(IMAGE)
TOKEN_TABLE(TRANSPARENT)
@@ -109,12 +109,12 @@ bool CBSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
char *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
Rect32 rect;
int r = 255, g = 255, b = 255;
int ar = 255, ag = 255, ab = 255, alpha = 255;
bool custoTrans = false;
- CBPlatform::setRectEmpty(&rect);
+ BasePlatform::setRectEmpty(&rect);
char *surfaceFile = NULL;
delete _surface;
@@ -196,7 +196,7 @@ bool CBSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
return STATUS_FAILED;
}
*/
- if (CBPlatform::isRectEmpty(&rect)) setDefaultRect();
+ if (BasePlatform::isRectEmpty(&rect)) setDefaultRect();
else _rect = rect;
return STATUS_OK;
@@ -204,14 +204,14 @@ bool CBSubFrame::loadBuffer(byte *buffer, int lifeTime, bool keepLoaded) {
//////////////////////////////////////////////////////////////////////
-bool CBSubFrame::draw(int x, int y, CBObject *registerOwner, float zoomX, float zoomY, bool precise, uint32 alpha, float rotate, TSpriteBlendMode blendMode) {
+bool BaseSubFrame::draw(int x, int y, BaseObject *registerOwner, float zoomX, float zoomY, bool precise, uint32 alpha, float rotate, TSpriteBlendMode blendMode) {
if (!_surface) return STATUS_OK;
if (registerOwner != NULL && !_decoration) {
if (zoomX == 100 && zoomY == 100) {
- _gameRef->_renderer->_rectList.add(new CBActiveRect(_gameRef, registerOwner, this, x - _hotspotX + _rect.left, y - _hotspotY + _rect.top, _rect.right - _rect.left, _rect.bottom - _rect.top, zoomX, zoomY, precise));
+ _gameRef->_renderer->_rectList.add(new BaseActiveRect(_gameRef, registerOwner, this, x - _hotspotX + _rect.left, y - _hotspotY + _rect.top, _rect.right - _rect.left, _rect.bottom - _rect.top, zoomX, zoomY, precise));
} else {
- _gameRef->_renderer->_rectList.add(new CBActiveRect(_gameRef, registerOwner, this, (int)(x - (_hotspotX + _rect.left) * (zoomX / 100)), (int)(y - (_hotspotY + _rect.top) * (zoomY / 100)), (int)((_rect.right - _rect.left) * (zoomX / 100)), (int)((_rect.bottom - _rect.top) * (zoomY / 100)), zoomX, zoomY, precise));
+ _gameRef->_renderer->_rectList.add(new BaseActiveRect(_gameRef, registerOwner, this, (int)(x - (_hotspotX + _rect.left) * (zoomX / 100)), (int)(y - (_hotspotY + _rect.top) * (zoomY / 100)), (int)((_rect.right - _rect.left) * (zoomX / 100)), (int)((_rect.bottom - _rect.top) * (zoomY / 100)), zoomX, zoomY, precise));
}
}
if (_gameRef->_suspendedRendering) return STATUS_OK;
@@ -233,13 +233,13 @@ bool CBSubFrame::draw(int x, int y, CBObject *registerOwner, float zoomX, float
//////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
+bool BaseSubFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float scaleY) {
if (!rect) return false;
float ratioX = scaleX / 100.0f;
float ratioY = scaleY / 100.0f;
- CBPlatform::setRect(rect,
+ BasePlatform::setRect(rect,
(int)(x - _hotspotX * ratioX),
(int)(y - _hotspotY * ratioY),
(int)(x - _hotspotX * ratioX + (_rect.right - _rect.left) * ratioX),
@@ -249,7 +249,7 @@ bool CBSubFrame::getBoundingRect(Rect32 *rect, int x, int y, float scaleX, float
//////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) {
+bool BaseSubFrame::saveAsText(BaseDynamicBuffer *buffer, int indent, bool complete) {
if (complete)
buffer->putTextIndent(indent, "SUBFRAME {\n");
@@ -260,9 +260,9 @@ bool CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) {
buffer->putTextIndent(indent + 2, "TRANSPARENT { %d,%d,%d }\n", RGBCOLGetR(_transparent), RGBCOLGetG(_transparent), RGBCOLGetB(_transparent));
Rect32 rect;
- CBPlatform::setRectEmpty(&rect);
- if (_surface) CBPlatform::setRect(&rect, 0, 0, _surface->getWidth(), _surface->getHeight());
- if (!CBPlatform::equalRect(&rect, &_rect))
+ BasePlatform::setRectEmpty(&rect);
+ if (_surface) BasePlatform::setRect(&rect, 0, 0, _surface->getWidth(), _surface->getHeight());
+ if (!BasePlatform::equalRect(&rect, &_rect))
buffer->putTextIndent(indent + 2, "RECT { %d,%d,%d,%d }\n", _rect.left, _rect.top, _rect.right, _rect.bottom);
if (_hotspotX != 0 || _hotspotY != 0)
@@ -291,7 +291,7 @@ bool CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) {
if (_editorSelected)
buffer->putTextIndent(indent + 2, "EDITOR_SELECTED=%s\n", _editorSelected ? "TRUE" : "FALSE");
- CBBase::saveAsText(buffer, indent + 2);
+ BaseClass::saveAsText(buffer, indent + 2);
if (complete)
@@ -302,17 +302,17 @@ bool CBSubFrame::saveAsText(CBDynBuffer *buffer, int indent, bool complete) {
//////////////////////////////////////////////////////////////////////////
-void CBSubFrame::setDefaultRect() {
+void BaseSubFrame::setDefaultRect() {
if (_surface) {
- CBPlatform::setRect(&_rect, 0, 0, _surface->getWidth(), _surface->getHeight());
- } else CBPlatform::setRectEmpty(&_rect);
+ BasePlatform::setRect(&_rect, 0, 0, _surface->getWidth(), _surface->getHeight());
+ } else BasePlatform::setRectEmpty(&_rect);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::persist(CBPersistMgr *persistMgr) {
+bool BaseSubFrame::persist(BasePersistenceManager *persistMgr) {
- CBScriptable::persist(persistMgr);
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_2DOnly));
persistMgr->transfer(TMEMBER(_3DOnly));
@@ -342,7 +342,7 @@ bool CBSubFrame::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool BaseSubFrame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetImage
@@ -360,7 +360,7 @@ bool CBSubFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "SetImage") == 0) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ ScValue *Val = stack->pop();
if (Val->isNULL()) {
if (_surface) _gameRef->_surfaceStorage->removeSurface(_surface);
@@ -378,13 +378,13 @@ bool CBSubFrame::scCallMethod(CScScript *script, CScStack *stack, CScStack *this
return STATUS_OK;
}
- else return CBScriptable::scCallMethod(script, stack, thisStack, name);
+ else return BaseScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CBSubFrame::scGetProperty(const char *name) {
- if (!_scValue) _scValue = new CScValue(_gameRef);
+ScValue *BaseSubFrame::scGetProperty(const char *name) {
+ if (!_scValue) _scValue = new ScValue(_gameRef);
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -468,12 +468,12 @@ CScValue *CBSubFrame::scGetProperty(const char *name) {
return _scValue;
}
- else return CBScriptable::scGetProperty(name);
+ else return BaseScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::scSetProperty(const char *name, CScValue *value) {
+bool BaseSubFrame::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// AlphaColor
//////////////////////////////////////////////////////////////////////////
@@ -538,18 +538,18 @@ bool CBSubFrame::scSetProperty(const char *name, CScValue *value) {
return STATUS_OK;
}
- else return CBScriptable::scSetProperty(name, value);
+ else return BaseScriptable::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CBSubFrame::scToString() {
+const char *BaseSubFrame::scToString() {
return "[subframe]";
}
//////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::setSurface(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
+bool BaseSubFrame::setSurface(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
if (_surface) {
_gameRef->_surfaceStorage->removeSurface(_surface);
_surface = NULL;
@@ -576,7 +576,7 @@ bool CBSubFrame::setSurface(const char *filename, bool defaultCK, byte ckRed, by
//////////////////////////////////////////////////////////////////////////
-bool CBSubFrame::setSurfaceSimple() {
+bool BaseSubFrame::setSurfaceSimple() {
if (!_surfaceFilename) {
_surface = NULL;
return STATUS_OK;
diff --git a/engines/wintermute/base/base_sub_frame.h b/engines/wintermute/base/base_sub_frame.h
index 6fb24c0e4f..52b1d76c01 100644
--- a/engines/wintermute/base/base_sub_frame.h
+++ b/engines/wintermute/base/base_sub_frame.h
@@ -34,25 +34,25 @@
#include "engines/wintermute/base/base_scriptable.h"
namespace WinterMute {
-class CBObject;
-class CBSurface;
-class CBSubFrame : public CBScriptable {
+class BaseObject;
+class BaseSurface;
+class BaseSubFrame : public BaseScriptable {
public:
bool _mirrorX;
bool _mirrorY;
bool _decoration;
bool setSurface(const char *filename, bool defaultCK = true, byte ckRed = 0, byte ckGreen = 0, byte ckBlue = 0, int lifeTime = -1, bool keepLoaded = false);
bool setSurfaceSimple();
- DECLARE_PERSISTENT(CBSubFrame, CBScriptable)
+ DECLARE_PERSISTENT(BaseSubFrame, BaseScriptable)
void setDefaultRect();
uint32 _transparent;
- bool saveAsText(CBDynBuffer *buffer, int indent) { return saveAsText(buffer, indent, true); }
- bool saveAsText(CBDynBuffer *buffer, int indent, bool complete);
+ bool saveAsText(BaseDynamicBuffer *buffer, int indent) { return saveAsText(buffer, indent, true); }
+ bool saveAsText(BaseDynamicBuffer *buffer, int indent, bool complete);
bool _editorSelected;
- CBSubFrame(CBGame *inGame);
- virtual ~CBSubFrame();
+ BaseSubFrame(BaseGame *inGame);
+ virtual ~BaseSubFrame();
bool loadBuffer(byte *buffer, int lifeTime, bool keepLoaded);
- bool draw(int x, int y, CBObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, bool precise = true, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
+ bool draw(int x, int y, BaseObject *registerOwner = NULL, float zoomX = 100, float zoomY = 100, bool precise = true, uint32 alpha = 0xFFFFFFFF, float rotate = 0.0f, TSpriteBlendMode blendMode = BLEND_NORMAL);
bool getBoundingRect(Rect32 *rect, int x, int y, float scaleX = 100, float scaleY = 100);
int _hotspotX;
@@ -71,12 +71,12 @@ public:
bool _2DOnly;
bool _3DOnly;
- CBSurface *_surface;
+ BaseSurface *_surface;
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
};
diff --git a/engines/wintermute/base/base_surface_storage.cpp b/engines/wintermute/base/base_surface_storage.cpp
index 06c2f1b0cc..7067c2a607 100644
--- a/engines/wintermute/base/base_surface_storage.cpp
+++ b/engines/wintermute/base/base_surface_storage.cpp
@@ -36,24 +36,24 @@
namespace WinterMute {
-//IMPLEMENT_PERSISTENT(CBSurfaceStorage, true);
+//IMPLEMENT_PERSISTENT(BaseSurfaceStorage, true);
//////////////////////////////////////////////////////////////////////
-CBSurfaceStorage::CBSurfaceStorage(CBGame *inGame): CBBase(inGame) {
+BaseSurfaceStorage::BaseSurfaceStorage(BaseGame *inGame): BaseClass(inGame) {
_lastCleanupTime = 0;
}
//////////////////////////////////////////////////////////////////////
-CBSurfaceStorage::~CBSurfaceStorage() {
+BaseSurfaceStorage::~BaseSurfaceStorage() {
cleanup(true);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceStorage::cleanup(bool warn) {
+bool BaseSurfaceStorage::cleanup(bool warn) {
for (uint32 i = 0; i < _surfaces.size(); i++) {
- if (warn) _gameRef->LOG(0, "CBSurfaceStorage warning: purging surface '%s', usage:%d", _surfaces[i]->getFileName(), _surfaces[i]->_referenceCount);
+ if (warn) _gameRef->LOG(0, "BaseSurfaceStorage warning: purging surface '%s', usage:%d", _surfaces[i]->getFileName(), _surfaces[i]->_referenceCount);
delete _surfaces[i];
}
_surfaces.clear();
@@ -63,7 +63,7 @@ bool CBSurfaceStorage::cleanup(bool warn) {
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceStorage::initLoop() {
+bool BaseSurfaceStorage::initLoop() {
if (_gameRef->_smartCache && _gameRef->_liveTimer - _lastCleanupTime >= _gameRef->_surfaceGCCycleTime) {
_lastCleanupTime = _gameRef->_liveTimer;
sortSurfaces();
@@ -81,7 +81,7 @@ bool CBSurfaceStorage::initLoop() {
//////////////////////////////////////////////////////////////////////
-bool CBSurfaceStorage::removeSurface(CBSurface *surface) {
+bool BaseSurfaceStorage::removeSurface(BaseSurface *surface) {
for (uint32 i = 0; i < _surfaces.size(); i++) {
if (_surfaces[i] == surface) {
_surfaces[i]->_referenceCount--;
@@ -97,7 +97,7 @@ bool CBSurfaceStorage::removeSurface(CBSurface *surface) {
//////////////////////////////////////////////////////////////////////
-CBSurface *CBSurfaceStorage::addSurface(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
+BaseSurface *BaseSurfaceStorage::addSurface(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
for (uint32 i = 0; i < _surfaces.size(); i++) {
if (scumm_stricmp(_surfaces[i]->getFileName(), filename) == 0) {
_surfaces[i]->_referenceCount++;
@@ -113,7 +113,7 @@ CBSurface *CBSurfaceStorage::addSurface(const char *filename, bool defaultCK, by
return addSurface("invalid.bmp", defaultCK, ckRed, ckGreen, ckBlue, lifeTime, keepLoaded);
}
- CBSurface *surface;
+ BaseSurface *surface;
surface = _gameRef->_renderer->createSurface();
if (!surface) return NULL;
@@ -130,12 +130,12 @@ CBSurface *CBSurfaceStorage::addSurface(const char *filename, bool defaultCK, by
//////////////////////////////////////////////////////////////////////
-bool CBSurfaceStorage::restoreAll() {
+bool BaseSurfaceStorage::restoreAll() {
bool ret;
for (uint32 i = 0; i < _surfaces.size(); i++) {
ret = _surfaces[i]->restore();
if (ret != STATUS_OK) {
- _gameRef->LOG(0, "CBSurfaceStorage::RestoreAll failed");
+ _gameRef->LOG(0, "BaseSurfaceStorage::RestoreAll failed");
return ret;
}
}
@@ -145,7 +145,7 @@ bool CBSurfaceStorage::restoreAll() {
/*
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceStorage::persist(CBPersistMgr *persistMgr)
+bool BaseSurfaceStorage::persist(BasePersistenceManager *persistMgr)
{
if(!persistMgr->_saving) cleanup(false);
@@ -160,16 +160,16 @@ bool CBSurfaceStorage::persist(CBPersistMgr *persistMgr)
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceStorage::sortSurfaces() {
- qsort(&_surfaces[0], _surfaces.size(), sizeof(CBSurface *), surfaceSortCB);
+bool BaseSurfaceStorage::sortSurfaces() {
+ qsort(&_surfaces[0], _surfaces.size(), sizeof(BaseSurface *), surfaceSortCB);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-int CBSurfaceStorage::surfaceSortCB(const void *arg1, const void *arg2) {
- CBSurface *s1 = *((CBSurface **)arg1);
- CBSurface *s2 = *((CBSurface **)arg2);
+int BaseSurfaceStorage::surfaceSortCB(const void *arg1, const void *arg2) {
+ BaseSurface *s1 = *((BaseSurface **)arg1);
+ BaseSurface *s2 = *((BaseSurface **)arg2);
// sort by life time
if (s1->_lifeTime <= 0 && s2->_lifeTime > 0) return 1;
diff --git a/engines/wintermute/base/base_surface_storage.h b/engines/wintermute/base/base_surface_storage.h
index 58f25e6875..350210b95e 100644
--- a/engines/wintermute/base/base_surface_storage.h
+++ b/engines/wintermute/base/base_surface_storage.h
@@ -33,23 +33,23 @@
#include "common/array.h"
namespace WinterMute {
-class CBSurface;
-class CBSurfaceStorage : public CBBase {
+class BaseSurface;
+class BaseSurfaceStorage : public BaseClass {
public:
uint32 _lastCleanupTime;
bool initLoop();
bool sortSurfaces();
static int surfaceSortCB(const void *arg1, const void *arg2);
bool cleanup(bool Warn = false);
- //DECLARE_PERSISTENT(CBSurfaceStorage, CBBase);
+ //DECLARE_PERSISTENT(BaseSurfaceStorage, BaseClass);
bool restoreAll();
- CBSurface *addSurface(const char *filename, bool defaultCK = true, byte ckRed = 0, byte ckGreen = 0, byte ckBlue = 0, int lifeTime = -1, bool keepLoaded = false);
- bool removeSurface(CBSurface *surface);
- CBSurfaceStorage(CBGame *inGame);
- virtual ~CBSurfaceStorage();
+ BaseSurface *addSurface(const char *filename, bool defaultCK = true, byte ckRed = 0, byte ckGreen = 0, byte ckBlue = 0, int lifeTime = -1, bool keepLoaded = false);
+ bool removeSurface(BaseSurface *surface);
+ BaseSurfaceStorage(BaseGame *inGame);
+ virtual ~BaseSurfaceStorage();
- Common::Array<CBSurface *> _surfaces;
+ Common::Array<BaseSurface *> _surfaces;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/base_transition_manager.cpp b/engines/wintermute/base/base_transition_manager.cpp
index 30a1a32e6a..b524636af7 100644
--- a/engines/wintermute/base/base_transition_manager.cpp
+++ b/engines/wintermute/base/base_transition_manager.cpp
@@ -34,7 +34,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBTransitionMgr::CBTransitionMgr(CBGame *inGame): CBBase(inGame) {
+BaseTransitionMgr::BaseTransitionMgr(BaseGame *inGame): BaseClass(inGame) {
_state = TRANS_MGR_READY;
_type = TRANSITION_NONE;
_origInteractive = false;
@@ -46,19 +46,19 @@ CBTransitionMgr::CBTransitionMgr(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBTransitionMgr::~CBTransitionMgr() {
+BaseTransitionMgr::~BaseTransitionMgr() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBTransitionMgr::isReady() {
+bool BaseTransitionMgr::isReady() {
return (_state == TRANS_MGR_READY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBTransitionMgr::start(TTransitionType type, bool nonInteractive) {
+bool BaseTransitionMgr::start(TTransitionType type, bool nonInteractive) {
if (_state != TRANS_MGR_READY) return STATUS_OK;
if (type == TRANSITION_NONE || type >= NUM_TRANSITION_TYPES) {
@@ -83,12 +83,12 @@ bool CBTransitionMgr::start(TTransitionType type, bool nonInteractive) {
#define FADE_DURATION 200
//////////////////////////////////////////////////////////////////////////
-bool CBTransitionMgr::update() {
+bool BaseTransitionMgr::update() {
if (isReady()) return STATUS_OK;
if (!_started) {
_started = true;
- _lastTime = CBPlatform::getTime();
+ _lastTime = BasePlatform::getTime();
}
switch (_type) {
@@ -97,7 +97,7 @@ bool CBTransitionMgr::update() {
break;
case TRANSITION_FADE_OUT: {
- uint32 time = CBPlatform::getTime() - _lastTime;
+ uint32 time = BasePlatform::getTime() - _lastTime;
int alpha = (int)(255 - (float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
_gameRef->_renderer->fade((uint16)alpha);
@@ -108,7 +108,7 @@ bool CBTransitionMgr::update() {
break;
case TRANSITION_FADE_IN: {
- uint32 time = CBPlatform::getTime() - _lastTime;
+ uint32 time = BasePlatform::getTime() - _lastTime;
int alpha = (int)((float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
_gameRef->_renderer->fade((uint16)alpha);
@@ -118,7 +118,7 @@ bool CBTransitionMgr::update() {
}
break;
default:
- error("CBTransitionMgr::Update - unhandled enum NUM_TRANSITION_TYPES");
+ error("BaseTransitionMgr::Update - unhandled enum NUM_TRANSITION_TYPES");
}
if (isReady()) {
diff --git a/engines/wintermute/base/base_transition_manager.h b/engines/wintermute/base/base_transition_manager.h
index 9b84c653e9..104f327fb8 100644
--- a/engines/wintermute/base/base_transition_manager.h
+++ b/engines/wintermute/base/base_transition_manager.h
@@ -33,7 +33,7 @@
namespace WinterMute {
-class CBTransitionMgr : public CBBase {
+class BaseTransitionMgr : public BaseClass {
public:
bool _started;
uint32 _lastTime;
@@ -43,8 +43,8 @@ public:
bool start(TTransitionType type, bool nonInteractive = false);
bool isReady();
TTransMgrState _state;
- CBTransitionMgr(CBGame *inGame);
- virtual ~CBTransitionMgr();
+ BaseTransitionMgr(BaseGame *inGame);
+ virtual ~BaseTransitionMgr();
TTransitionType _type;
};
diff --git a/engines/wintermute/base/base_viewport.cpp b/engines/wintermute/base/base_viewport.cpp
index 83cbc5b0f0..ad875ec00d 100644
--- a/engines/wintermute/base/base_viewport.cpp
+++ b/engines/wintermute/base/base_viewport.cpp
@@ -32,24 +32,24 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBViewport, false)
+IMPLEMENT_PERSISTENT(BaseViewport, false)
//////////////////////////////////////////////////////////////////////////
-CBViewport::CBViewport(CBGame *inGame): CBBase(inGame) {
- CBPlatform::setRectEmpty(&_rect);
+BaseViewport::BaseViewport(BaseGame *inGame): BaseClass(inGame) {
+ BasePlatform::setRectEmpty(&_rect);
_mainObject = NULL;
_offsetX = _offsetY = 0;
}
//////////////////////////////////////////////////////////////////////////
-CBViewport::~CBViewport() {
+BaseViewport::~BaseViewport() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBViewport::persist(CBPersistMgr *persistMgr) {
+bool BaseViewport::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_gameRef));
@@ -63,7 +63,7 @@ bool CBViewport::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-bool CBViewport::setRect(int left, int top, int right, int bottom, bool noCheck) {
+bool BaseViewport::setRect(int left, int top, int right, int bottom, bool noCheck) {
if (!noCheck) {
left = MAX(left, 0);
top = MAX(top, 0);
@@ -71,7 +71,7 @@ bool CBViewport::setRect(int left, int top, int right, int bottom, bool noCheck)
bottom = MIN(bottom, _gameRef->_renderer->_height);
}
- CBPlatform::setRect(&_rect, left, top, right, bottom);
+ BasePlatform::setRect(&_rect, left, top, right, bottom);
_offsetX = left;
_offsetY = top;
return STATUS_OK;
@@ -79,19 +79,19 @@ bool CBViewport::setRect(int left, int top, int right, int bottom, bool noCheck)
//////////////////////////////////////////////////////////////////////////
-Rect32 *CBViewport::getRect() {
+Rect32 *BaseViewport::getRect() {
return &_rect;
}
//////////////////////////////////////////////////////////////////////////
-int CBViewport::getWidth() {
+int BaseViewport::getWidth() {
return _rect.right - _rect.left;
}
//////////////////////////////////////////////////////////////////////////
-int CBViewport::getHeight() {
+int BaseViewport::getHeight() {
return _rect.bottom - _rect.top;
}
diff --git a/engines/wintermute/base/base_viewport.h b/engines/wintermute/base/base_viewport.h
index 795e6f404f..33e9448082 100644
--- a/engines/wintermute/base/base_viewport.h
+++ b/engines/wintermute/base/base_viewport.h
@@ -33,19 +33,19 @@
#include "engines/wintermute/base/base.h"
namespace WinterMute {
-class CBObject;
-class CBViewport : public CBBase {
+class BaseObject;
+class BaseViewport : public BaseClass {
public:
int getHeight();
int getWidth();
Rect32 *getRect();
bool setRect(int left, int top, int right, int bottom, bool noCheck = false);
- DECLARE_PERSISTENT(CBViewport, CBBase)
+ DECLARE_PERSISTENT(BaseViewport, BaseClass)
int _offsetY;
int _offsetX;
- CBObject *_mainObject;
- CBViewport(CBGame *inGame = NULL);
- virtual ~CBViewport();
+ BaseObject *_mainObject;
+ BaseViewport(BaseGame *inGame = NULL);
+ virtual ~BaseViewport();
private:
Rect32 _rect;
};
diff --git a/engines/wintermute/base/file/BPkgFile.cpp b/engines/wintermute/base/file/BPkgFile.cpp
index 3acde9c1ff..5e1ebc5922 100644
--- a/engines/wintermute/base/file/BPkgFile.cpp
+++ b/engines/wintermute/base/file/BPkgFile.cpp
@@ -39,6 +39,9 @@
namespace WinterMute {
+// This file is only needed until the next merge/rebase, as wrapCompressedStream now can set a known size
+// as such it is not renamed to follow the convention of the rest of the files.
+
// HACK: wrapCompressedStream might set the size to 0, so we need a way to override it.
class CBPkgFile : public Common::SeekableReadStream {
uint32 _size;
@@ -65,8 +68,8 @@ public:
}
};
-Common::SeekableReadStream *openPkgFile(const Common::String &filename, CBFileManager *fileManager) {
- CBFileEntry *fileEntry;
+Common::SeekableReadStream *openPkgFile(const Common::String &filename, BaseFileManager *fileManager) {
+ BaseFileEntry *fileEntry;
Common::SeekableReadStream *file = NULL;
char fileName[MAX_PATH_LENGTH];
strcpy(fileName, filename.c_str());
diff --git a/engines/wintermute/base/file/BPkgFile.h b/engines/wintermute/base/file/BPkgFile.h
index 4356ae5519..ca1b1f837d 100644
--- a/engines/wintermute/base/file/BPkgFile.h
+++ b/engines/wintermute/base/file/BPkgFile.h
@@ -41,8 +41,8 @@ class File;
namespace WinterMute {
-class CBFileManager;
-Common::SeekableReadStream *openPkgFile(const Common::String &filename, CBFileManager *fileManager);
+class BaseFileManager;
+Common::SeekableReadStream *openPkgFile(const Common::String &filename, BaseFileManager *fileManager);
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/base_disk_file.cpp b/engines/wintermute/base/file/base_disk_file.cpp
index 99bf9cff3f..6c89fc22f1 100644
--- a/engines/wintermute/base/file/base_disk_file.cpp
+++ b/engines/wintermute/base/file/base_disk_file.cpp
@@ -45,7 +45,7 @@ void correctSlashes(char *fileName) {
}
}
-Common::SeekableReadStream *openDiskFile(const Common::String &filename, CBFileManager *fileManager) {
+Common::SeekableReadStream *openDiskFile(const Common::String &filename, BaseFileManager *fileManager) {
char fullPath[MAX_PATH_LENGTH];
uint32 prefixSize = 0;
Common::SeekableReadStream *file = NULL;
diff --git a/engines/wintermute/base/file/base_disk_file.h b/engines/wintermute/base/file/base_disk_file.h
index 23e1a0a315..e688a12b50 100644
--- a/engines/wintermute/base/file/base_disk_file.h
+++ b/engines/wintermute/base/file/base_disk_file.h
@@ -35,7 +35,7 @@ class SeekableReadStream;
namespace WinterMute {
-Common::SeekableReadStream *openDiskFile(const Common::String &filename, CBFileManager *fileManager);
+Common::SeekableReadStream *openDiskFile(const Common::String &filename, BaseFileManager *fileManager);
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/file/base_file.cpp b/engines/wintermute/base/file/base_file.cpp
index 88a64cb147..d4109bb259 100644
--- a/engines/wintermute/base/file/base_file.cpp
+++ b/engines/wintermute/base/file/base_file.cpp
@@ -38,24 +38,24 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBFile::CBFile(CBGame *inGame): CBBase(inGame) {
+BaseFile::BaseFile(BaseGame *inGame): BaseClass(inGame) {
_pos = 0;
_size = 0;
}
//////////////////////////////////////////////////////////////////////////
-CBFile::~CBFile() {
+BaseFile::~BaseFile() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBFile::isEOF() {
+bool BaseFile::isEOF() {
return _pos == _size;
}
-Common::SeekableReadStream *CBFile::getMemStream() {
+Common::SeekableReadStream *BaseFile::getMemStream() {
uint32 oldPos = getPos();
seek(0);
byte *data = new byte[getSize()];
diff --git a/engines/wintermute/base/file/base_file.h b/engines/wintermute/base/file/base_file.h
index b29fc41299..1a144414fc 100644
--- a/engines/wintermute/base/file/base_file.h
+++ b/engines/wintermute/base/file/base_file.h
@@ -40,7 +40,7 @@ class SeekableReadStream;
namespace WinterMute {
-class CBFile : public CBBase {
+class BaseFile : public BaseClass {
protected:
uint32 _pos;
uint32 _size;
@@ -56,8 +56,8 @@ public:
virtual bool close() = 0;
virtual bool open(const Common::String &filename) = 0;
virtual bool isEOF();
- CBFile(CBGame *inGame);
- virtual ~CBFile();
+ BaseFile(BaseGame *inGame);
+ virtual ~BaseFile();
// Temporary solution to allow usage in ScummVM-code:
virtual Common::SeekableReadStream *getMemStream();
};
diff --git a/engines/wintermute/base/file/base_file_entry.cpp b/engines/wintermute/base/file/base_file_entry.cpp
index 3b6f4c7c16..d3e0fee7b0 100644
--- a/engines/wintermute/base/file/base_file_entry.cpp
+++ b/engines/wintermute/base/file/base_file_entry.cpp
@@ -31,7 +31,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBFileEntry::CBFileEntry(CBGame *inGame): CBBase(inGame) {
+BaseFileEntry::BaseFileEntry(BaseGame *inGame): BaseClass(inGame) {
_package = NULL;
_length = _compressedLength = _offset = _flags = 0;
_filename = "";
@@ -43,7 +43,7 @@ CBFileEntry::CBFileEntry(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBFileEntry::~CBFileEntry() {
+BaseFileEntry::~BaseFileEntry() {
_package = NULL; // ref only
}
diff --git a/engines/wintermute/base/file/base_file_entry.h b/engines/wintermute/base/file/base_file_entry.h
index ed80821004..0e0375e42d 100644
--- a/engines/wintermute/base/file/base_file_entry.h
+++ b/engines/wintermute/base/file/base_file_entry.h
@@ -34,9 +34,9 @@
namespace WinterMute {
-class CBPackage;
+class BasePackage;
-class CBFileEntry : public CBBase {
+class BaseFileEntry : public BaseClass {
public:
uint32 _timeDate2;
uint32 _timeDate1;
@@ -46,9 +46,9 @@ public:
uint32 _compressedLength;
uint32 _length;
uint32 _offset;
- CBPackage *_package;
- CBFileEntry(CBGame *inGame);
- virtual ~CBFileEntry();
+ BasePackage *_package;
+ BaseFileEntry(BaseGame *inGame);
+ virtual ~BaseFileEntry();
};
diff --git a/engines/wintermute/base/file/base_package.cpp b/engines/wintermute/base/file/base_package.cpp
index fab6409c00..03a80f3d8d 100644
--- a/engines/wintermute/base/file/base_package.cpp
+++ b/engines/wintermute/base/file/base_package.cpp
@@ -40,7 +40,7 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBPackage::CBPackage(CBGame *inGame): CBBase(inGame) {
+BasePackage::BasePackage(BaseGame *inGame): BaseClass(inGame) {
_file = NULL;
_name = NULL;
_cD = 0;
@@ -50,14 +50,14 @@ CBPackage::CBPackage(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBPackage::~CBPackage() {
+BasePackage::~BasePackage() {
if (_name) delete [] _name;
closeFilePointer(_file);
}
//////////////////////////////////////////////////////////////////////////
-bool CBPackage::open() {
+bool BasePackage::open() {
if (_file) return STATUS_OK;
else {
_file = getFilePointer();
@@ -67,7 +67,7 @@ bool CBPackage::open() {
//////////////////////////////////////////////////////////////////////////
-bool CBPackage::close() {
+bool BasePackage::close() {
delete _file;
_file = NULL;
return STATUS_OK;
@@ -75,7 +75,7 @@ bool CBPackage::close() {
//////////////////////////////////////////////////////////////////////////
-bool CBPackage::read(Common::SeekableReadStream *file, uint32 offset, byte *buffer, uint32 size) {
+bool BasePackage::read(Common::SeekableReadStream *file, uint32 offset, byte *buffer, uint32 size) {
bool ret;
if (DID_FAIL(ret = open())) return ret;
else {
@@ -86,7 +86,7 @@ bool CBPackage::read(Common::SeekableReadStream *file, uint32 offset, byte *buff
}
//////////////////////////////////////////////////////////////////////////
-Common::SeekableReadStream *CBPackage::getFilePointer() {
+Common::SeekableReadStream *BasePackage::getFilePointer() {
Common::File *file = _gameRef->_fileManager->openPackage(_name);
if (!file) {
_gameRef->_fileManager->requestCD(_cD, _name, "");
@@ -96,7 +96,7 @@ Common::SeekableReadStream *CBPackage::getFilePointer() {
}
//////////////////////////////////////////////////////////////////////////
-void CBPackage::closeFilePointer(Common::SeekableReadStream *&file) {
+void BasePackage::closeFilePointer(Common::SeekableReadStream *&file) {
delete file;
file = NULL;
}
diff --git a/engines/wintermute/base/file/base_package.h b/engines/wintermute/base/file/base_package.h
index 52fc4f9677..bf45087f91 100644
--- a/engines/wintermute/base/file/base_package.h
+++ b/engines/wintermute/base/file/base_package.h
@@ -38,7 +38,7 @@ class SeekableReadStream;
namespace WinterMute {
-class CBPackage : public CBBase {
+class BasePackage : public BaseClass {
public:
Common::SeekableReadStream *getFilePointer();
void closeFilePointer(Common::SeekableReadStream *&file);
@@ -51,8 +51,8 @@ public:
char *_name;
int _cD;
Common::SeekableReadStream *_file;
- CBPackage(CBGame *inGame);
- virtual ~CBPackage();
+ BasePackage(BaseGame *inGame);
+ virtual ~BasePackage();
};
diff --git a/engines/wintermute/base/file/base_resources.cpp b/engines/wintermute/base/file/base_resources.cpp
index 09cbae88fe..9b1c9fee04 100644
--- a/engines/wintermute/base/file/base_resources.cpp
+++ b/engines/wintermute/base/file/base_resources.cpp
@@ -2806,7 +2806,7 @@ unsigned char systemfont[] = {
0x01, 0x01, 0x01, 0x01, 0x01, 0x01
} ;
-Common::SeekableReadStream *CBResources::getFile(const Common::String &fileName) {
+Common::SeekableReadStream *BaseResources::getFile(const Common::String &fileName) {
if (scumm_stricmp(fileName.c_str(), "invalid.bmp") == 0) {
return new Common::MemoryReadStream(invalid, sizeof(invalid), DisposeAfterUse::NO);
} else if (scumm_stricmp(fileName.c_str(), "invalid_debug.bmp") == 0) {
diff --git a/engines/wintermute/base/file/base_resources.h b/engines/wintermute/base/file/base_resources.h
index 6ec0541b5c..6316cecd15 100644
--- a/engines/wintermute/base/file/base_resources.h
+++ b/engines/wintermute/base/file/base_resources.h
@@ -34,7 +34,7 @@
namespace WinterMute {
-class CBResources {
+class BaseResources {
public:
static Common::SeekableReadStream *getFile(const Common::String &fileName);
};
diff --git a/engines/wintermute/base/file/base_save_thumb_file.cpp b/engines/wintermute/base/file/base_save_thumb_file.cpp
index 68200d3fc6..a2295b70a5 100644
--- a/engines/wintermute/base/file/base_save_thumb_file.cpp
+++ b/engines/wintermute/base/file/base_save_thumb_file.cpp
@@ -39,19 +39,19 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBSaveThumbFile::CBSaveThumbFile(CBGame *inGame): CBFile(inGame) {
+BaseSaveThumbFile::BaseSaveThumbFile(BaseGame *inGame): BaseFile(inGame) {
_data = NULL;
}
//////////////////////////////////////////////////////////////////////////
-CBSaveThumbFile::~CBSaveThumbFile() {
+BaseSaveThumbFile::~BaseSaveThumbFile() {
close();
}
//////////////////////////////////////////////////////////////////////////
-bool CBSaveThumbFile::open(const Common::String &filename) {
+bool BaseSaveThumbFile::open(const Common::String &filename) {
close();
if (scumm_strnicmp(filename.c_str(), "savegame:", 9) != 0) return STATUS_FAILED;
@@ -71,7 +71,7 @@ bool CBSaveThumbFile::open(const Common::String &filename) {
char slotFilename[MAX_PATH_LENGTH + 1];
_gameRef->getSaveSlotFilename(slot, slotFilename);
- CBPersistMgr *pm = new CBPersistMgr(_gameRef);
+ BasePersistenceManager *pm = new BasePersistenceManager(_gameRef);
if (!pm) return STATUS_FAILED;
_gameRef->_debugAbsolutePathWarning = false;
@@ -97,7 +97,7 @@ bool CBSaveThumbFile::open(const Common::String &filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBSaveThumbFile::close() {
+bool BaseSaveThumbFile::close() {
delete[] _data;
_data = NULL;
@@ -109,7 +109,7 @@ bool CBSaveThumbFile::close() {
//////////////////////////////////////////////////////////////////////////
-bool CBSaveThumbFile::read(void *buffer, uint32 size) {
+bool BaseSaveThumbFile::read(void *buffer, uint32 size) {
if (!_data || _pos + size > _size) return STATUS_FAILED;
memcpy(buffer, (byte *)_data + _pos, size);
@@ -120,7 +120,7 @@ bool CBSaveThumbFile::read(void *buffer, uint32 size) {
//////////////////////////////////////////////////////////////////////////
-bool CBSaveThumbFile::seek(uint32 pos, int whence) {
+bool BaseSaveThumbFile::seek(uint32 pos, int whence) {
if (!_data) return STATUS_FAILED;
uint32 newPos = 0;
diff --git a/engines/wintermute/base/file/base_save_thumb_file.h b/engines/wintermute/base/file/base_save_thumb_file.h
index 42566581e2..6065f10f81 100644
--- a/engines/wintermute/base/file/base_save_thumb_file.h
+++ b/engines/wintermute/base/file/base_save_thumb_file.h
@@ -35,10 +35,10 @@
namespace WinterMute {
//TODO: Get rid of this
-class CBSaveThumbFile : public CBFile {
+class BaseSaveThumbFile : public BaseFile {
public:
- CBSaveThumbFile(CBGame *Game);
- virtual ~CBSaveThumbFile();
+ BaseSaveThumbFile(BaseGame *Game);
+ virtual ~BaseSaveThumbFile();
virtual bool seek(uint32 pos, int whence = SEEK_SET);
virtual bool read(void *buffer, uint32 size);
virtual bool close();
diff --git a/engines/wintermute/base/font/base_font.cpp b/engines/wintermute/base/font/base_font.cpp
index 8976cfdabd..0c86517fc7 100644
--- a/engines/wintermute/base/font/base_font.cpp
+++ b/engines/wintermute/base/font/base_font.cpp
@@ -40,42 +40,42 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CBFont, false)
+IMPLEMENT_PERSISTENT(BaseFont, false)
//////////////////////////////////////////////////////////////////////
-CBFont::CBFont(CBGame *inGame): CBObject(inGame) {
+BaseFont::BaseFont(BaseGame *inGame): BaseObject(inGame) {
}
//////////////////////////////////////////////////////////////////////
-CBFont::~CBFont() {
+BaseFont::~BaseFont() {
}
//////////////////////////////////////////////////////////////////////
-void CBFont::drawText(byte *text, int x, int y, int width, TTextAlign align, int max_height, int maxLength) {
+void BaseFont::drawText(byte *text, int x, int y, int width, TTextAlign align, int max_height, int maxLength) {
}
//////////////////////////////////////////////////////////////////////
-int CBFont::getTextHeight(byte *text, int width) {
+int BaseFont::getTextHeight(byte *text, int width) {
return 0;
}
//////////////////////////////////////////////////////////////////////
-int CBFont::getTextWidth(byte *text, int maxLength) {
+int BaseFont::getTextWidth(byte *text, int maxLength) {
return 0;
}
/*
//////////////////////////////////////////////////////////////////////
-bool CBFont::loadFile(const char * Filename)
+bool BaseFont::loadFile(const char * Filename)
{
BYTE* Buffer = _gameRef->_fileManager->readWholeFile(filename);
if(Buffer==NULL){
- _gameRef->LOG(0, "CBFont::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseFont::LoadFile failed for file '%s'", filename);
return STATUS_FAILED;
}
@@ -96,7 +96,7 @@ TOKEN_DEF_START
TOKEN_DEF (FONT)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
-bool CBFont::loadBuffer(byte * Buffer)
+bool BaseFont::loadBuffer(byte * Buffer)
{
TOKEN_TABLE_START(commands)
TOKEN_TABLE (FONT)
@@ -104,7 +104,7 @@ bool CBFont::loadBuffer(byte * Buffer)
char* params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if(parser.GetCommand ((char**)&Buffer, commands, (char**)&params)!=TOKEN_FONT){
_gameRef->LOG(0, "'FONT' keyword expected.");
@@ -138,23 +138,23 @@ bool CBFont::loadBuffer(byte * Buffer)
*/
//////////////////////////////////////////////////////////////////////////
-int CBFont::getLetterHeight() {
+int BaseFont::getLetterHeight() {
return 0;
}
//////////////////////////////////////////////////////////////////////////
-bool CBFont::persist(CBPersistMgr *persistMgr) {
+bool BaseFont::persist(BasePersistenceManager *persistMgr) {
- CBObject::persist(persistMgr);
+ BaseObject::persist(persistMgr);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-CBFont *CBFont::createFromFile(CBGame *gameRef, const char *filename) {
+BaseFont *BaseFont::createFromFile(BaseGame *gameRef, const char *filename) {
if (isTrueType(gameRef, filename)) {
- CBFontTT *font = new CBFontTT(gameRef);
+ BaseFontTT *font = new BaseFontTT(gameRef);
if (font) {
if (DID_FAIL(font->loadFile(filename))) {
delete font;
@@ -163,7 +163,7 @@ CBFont *CBFont::createFromFile(CBGame *gameRef, const char *filename) {
}
return font;
} else {
- CBFontBitmap *font = new CBFontBitmap(gameRef);
+ BaseFontBitmap *font = new BaseFontBitmap(gameRef);
if (font) {
if (DID_FAIL(font->loadFile(filename))) {
delete font;
@@ -180,7 +180,7 @@ TOKEN_DEF(FONT)
TOKEN_DEF(TTFONT)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////////
-bool CBFont::isTrueType(CBGame *gameRef, const char *filename) {
+bool BaseFont::isTrueType(BaseGame *gameRef, const char *filename) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(FONT)
TOKEN_TABLE(TTFONT)
@@ -193,7 +193,7 @@ bool CBFont::isTrueType(CBGame *gameRef, const char *filename) {
byte *WorkBuffer = buffer;
char *params;
- CBParser parser(gameRef);
+ BaseParser parser(gameRef);
bool ret = false;
if (parser.getCommand((char **)&WorkBuffer, commands, (char **)&params) == TOKEN_TTFONT)
diff --git a/engines/wintermute/base/font/base_font.h b/engines/wintermute/base/font/base_font.h
index 3df3090bb9..695bce2af3 100644
--- a/engines/wintermute/base/font/base_font.h
+++ b/engines/wintermute/base/font/base_font.h
@@ -35,9 +35,9 @@
namespace WinterMute {
-class CBFont: public CBObject {
+class BaseFont: public BaseObject {
public:
- DECLARE_PERSISTENT(CBFont, CBObject)
+ DECLARE_PERSISTENT(BaseFont, BaseObject)
virtual int getTextWidth(byte *text, int maxLength = -1);
virtual int getTextHeight(byte *text, int width);
virtual void drawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLength = -1);
@@ -45,15 +45,15 @@ public:
virtual void initLoop() {};
virtual void afterLoad() {};
- CBFont(CBGame *inGame);
- virtual ~CBFont();
+ BaseFont(BaseGame *inGame);
+ virtual ~BaseFont();
- static CBFont *createFromFile(CBGame *game, const char *filename);
+ static BaseFont *createFromFile(BaseGame *game, const char *filename);
private:
//bool loadBuffer(byte * Buffer);
//bool loadFile(const char* Filename);
- static bool isTrueType(CBGame *game, const char *filename);
+ static bool isTrueType(BaseGame *game, const char *filename);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/font/base_font_bitmap.cpp b/engines/wintermute/base/font/base_font_bitmap.cpp
index ef730afb0a..a913cc52ba 100644
--- a/engines/wintermute/base/font/base_font_bitmap.cpp
+++ b/engines/wintermute/base/font/base_font_bitmap.cpp
@@ -45,10 +45,10 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CBFontBitmap, false)
+IMPLEMENT_PERSISTENT(BaseFontBitmap, false)
//////////////////////////////////////////////////////////////////////
-CBFontBitmap::CBFontBitmap(CBGame *inGame): CBFont(inGame) {
+BaseFontBitmap::BaseFontBitmap(BaseGame *inGame): BaseFont(inGame) {
_subframe = NULL;
_sprite = NULL;
_widthsFrame = 0;
@@ -61,7 +61,7 @@ CBFontBitmap::CBFontBitmap(CBGame *inGame): CBFont(inGame) {
//////////////////////////////////////////////////////////////////////
-CBFontBitmap::~CBFontBitmap() {
+BaseFontBitmap::~BaseFontBitmap() {
delete _subframe;
delete _sprite;
_subframe = NULL;
@@ -70,19 +70,19 @@ CBFontBitmap::~CBFontBitmap() {
//////////////////////////////////////////////////////////////////////
-void CBFontBitmap::drawText(byte *text, int x, int y, int width, TTextAlign align, int max_height, int maxLength) {
+void BaseFontBitmap::drawText(byte *text, int x, int y, int width, TTextAlign align, int max_height, int maxLength) {
textHeightDraw(text, x, y, width, align, true, max_height, maxLength);
}
//////////////////////////////////////////////////////////////////////
-int CBFontBitmap::getTextHeight(byte *text, int width) {
+int BaseFontBitmap::getTextHeight(byte *text, int width) {
return textHeightDraw(text, 0, 0, width, TAL_LEFT, false);
}
//////////////////////////////////////////////////////////////////////
-int CBFontBitmap::getTextWidth(byte *text, int maxLength) {
+int BaseFontBitmap::getTextWidth(byte *text, int maxLength) {
AnsiString str;
if (_gameRef->_textEncoding == TEXT_UTF8) {
@@ -106,7 +106,7 @@ int CBFontBitmap::getTextWidth(byte *text, int maxLength) {
//////////////////////////////////////////////////////////////////////
-int CBFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAlign align, bool draw, int maxHeight, int maxLength) {
+int BaseFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAlign align, bool draw, int maxHeight, int maxLength) {
if (maxLength == 0) return 0;
if (text == NULL || text[0] == '\0') return _tileHeight;
@@ -187,7 +187,7 @@ int CBFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAlign
StartX = x;
break;
default:
- error("CBFontBitmap::TextHeightDraw - Unhandled enum");
+ error("BaseFontBitmap::TextHeightDraw - Unhandled enum");
break;
}
for (i = start; i < end + 1; i++) {
@@ -213,7 +213,7 @@ int CBFontBitmap::textHeightDraw(byte *text, int x, int y, int width, TTextAlign
//////////////////////////////////////////////////////////////////////
-void CBFontBitmap::drawChar(byte c, int x, int y) {
+void BaseFontBitmap::drawChar(byte c, int x, int y) {
if (_fontextFix) c--;
int row, col;
@@ -227,7 +227,7 @@ void CBFontBitmap::drawChar(byte c, int x, int y) {
if (_wholeCell) tileWidth = _tileWidth;
else tileWidth = _widths[c];
- CBPlatform::setRect(&rect, col * _tileWidth, row * _tileHeight, col * _tileWidth + tileWidth, (row + 1)*_tileHeight);
+ BasePlatform::setRect(&rect, col * _tileWidth, row * _tileHeight, col * _tileWidth + tileWidth, (row + 1)*_tileHeight);
bool handled = false;
if (_sprite) {
_sprite->GetCurrentFrame();
@@ -243,10 +243,10 @@ void CBFontBitmap::drawChar(byte c, int x, int y) {
//////////////////////////////////////////////////////////////////////
-bool CBFontBitmap::loadFile(const char *filename) {
+bool BaseFontBitmap::loadFile(const char *filename) {
byte *buffer = _gameRef->_fileManager->readWholeFile(filename);
if (buffer == NULL) {
- _gameRef->LOG(0, "CBFontBitmap::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseFontBitmap::LoadFile failed for file '%s'", filename);
return STATUS_FAILED;
}
@@ -282,7 +282,7 @@ TOKEN_DEF(WIDTHS_FRAME)
TOKEN_DEF(PAINT_WHOLE_CELL)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
-bool CBFontBitmap::loadBuffer(byte *buffer) {
+bool BaseFontBitmap::loadBuffer(byte *buffer) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(FONTEXT_FIX)
TOKEN_TABLE(FONT)
@@ -304,7 +304,7 @@ bool CBFontBitmap::loadBuffer(byte *buffer) {
char *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if (parser.getCommand((char **)&buffer, commands, (char **)&params) != TOKEN_FONT) {
_gameRef->LOG(0, "'FONT' keyword expected.");
@@ -401,7 +401,7 @@ bool CBFontBitmap::loadBuffer(byte *buffer) {
if (spriteFile != NULL) {
delete _sprite;
- _sprite = new CBSprite(_gameRef, this);
+ _sprite = new BaseSprite(_gameRef, this);
if (!_sprite || DID_FAIL(_sprite->loadFile(spriteFile))) {
delete _sprite;
_sprite = NULL;
@@ -409,7 +409,7 @@ bool CBFontBitmap::loadBuffer(byte *buffer) {
}
if (surfaceFile != NULL && !_sprite) {
- _subframe = new CBSubFrame(_gameRef);
+ _subframe = new BaseSubFrame(_gameRef);
if (custoTrans) _subframe->setSurface(surfaceFile, false, r, g, b);
else _subframe->setSurface(surfaceFile);
}
@@ -454,9 +454,9 @@ bool CBFontBitmap::loadBuffer(byte *buffer) {
//////////////////////////////////////////////////////////////////////////
-bool CBFontBitmap::persist(CBPersistMgr *persistMgr) {
+bool BaseFontBitmap::persist(BasePersistenceManager *persistMgr) {
- CBFont::persist(persistMgr);
+ BaseFont::persist(persistMgr);
persistMgr->transfer(TMEMBER(_numColumns));
persistMgr->transfer(TMEMBER(_subframe));
@@ -480,15 +480,15 @@ bool CBFontBitmap::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-int CBFontBitmap::getCharWidth(byte index) {
+int BaseFontBitmap::getCharWidth(byte index) {
if (_fontextFix) index--;
return _widths[index];
}
//////////////////////////////////////////////////////////////////////////
-bool CBFontBitmap::getWidths() {
- CBSurface *surf = NULL;
+bool BaseFontBitmap::getWidths() {
+ BaseSurface *surf = NULL;
if (_sprite) {
if (_widthsFrame >= 0 && _widthsFrame < _sprite->_frames.getSize()) {
@@ -533,7 +533,7 @@ bool CBFontBitmap::getWidths() {
}
//////////////////////////////////////////////////////////////////////////
-int CBFontBitmap::getLetterHeight() {
+int BaseFontBitmap::getLetterHeight() {
return _tileHeight;
}
diff --git a/engines/wintermute/base/font/base_font_bitmap.h b/engines/wintermute/base/font/base_font_bitmap.h
index 8af530cbc9..8a4f5af570 100644
--- a/engines/wintermute/base/font/base_font_bitmap.h
+++ b/engines/wintermute/base/font/base_font_bitmap.h
@@ -33,10 +33,10 @@
#include "engines/wintermute/base/font/base_font.h"
namespace WinterMute {
-class CBSubFrame;
-class CBFontBitmap : public CBFont {
+class BaseSubFrame;
+class BaseFontBitmap : public BaseFont {
public:
- DECLARE_PERSISTENT(CBFontBitmap, CBFont)
+ DECLARE_PERSISTENT(BaseFontBitmap, BaseFont)
bool loadBuffer(byte *Buffer);
bool loadFile(const char *filename);
virtual int getTextWidth(byte *text, int maxLength = -1);
@@ -44,19 +44,19 @@ public:
virtual void drawText(byte *text, int x, int y, int width, TTextAlign align = TAL_LEFT, int max_height = -1, int maxLength = -1);
virtual int getLetterHeight();
- CBFontBitmap(CBGame *inGame);
- virtual ~CBFontBitmap();
+ BaseFontBitmap(BaseGame *inGame);
+ virtual ~BaseFontBitmap();
bool getWidths();
- CBSprite *_sprite;
+ BaseSprite *_sprite;
int _widthsFrame;
bool _fontextFix;
int _numColumns;
int _tileHeight;
int _tileWidth;
byte _widths[NUM_CHARACTERS];
- CBSubFrame *_subframe;
+ BaseSubFrame *_subframe;
bool _wholeCell;
private:
diff --git a/engines/wintermute/base/font/base_font_storage.cpp b/engines/wintermute/base/font/base_font_storage.cpp
index 13f779f2cb..220a16e14f 100644
--- a/engines/wintermute/base/font/base_font_storage.cpp
+++ b/engines/wintermute/base/font/base_font_storage.cpp
@@ -39,19 +39,19 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CBFontStorage, true)
+IMPLEMENT_PERSISTENT(BaseFontStorage, true)
//////////////////////////////////////////////////////////////////////////
-CBFontStorage::CBFontStorage(CBGame *inGame): CBBase(inGame) {
+BaseFontStorage::BaseFontStorage(BaseGame *inGame): BaseClass(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CBFontStorage::~CBFontStorage() {
+BaseFontStorage::~BaseFontStorage() {
cleanup(true);
}
//////////////////////////////////////////////////////////////////////////
-bool CBFontStorage::cleanup(bool warn) {
+bool BaseFontStorage::cleanup(bool warn) {
for (int i = 0; i < _fonts.getSize(); i++) {
if (warn) _gameRef->LOG(0, "Removing orphan font '%s'", _fonts[i]->_filename);
delete _fonts[i];
@@ -62,7 +62,7 @@ bool CBFontStorage::cleanup(bool warn) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBFontStorage::initLoop() {
+bool BaseFontStorage::initLoop() {
for (int i = 0; i < _fonts.getSize(); i++) {
_fonts[i]->initLoop();
}
@@ -70,7 +70,7 @@ bool CBFontStorage::initLoop() {
}
//////////////////////////////////////////////////////////////////////////
-CBFont *CBFontStorage::addFont(const char *filename) {
+BaseFont *BaseFontStorage::addFont(const char *filename) {
if (!filename) return NULL;
for (int i = 0; i < _fonts.getSize(); i++) {
@@ -81,7 +81,7 @@ CBFont *CBFontStorage::addFont(const char *filename) {
}
/*
- CBFont* font = new CBFont(_gameRef);
+ BaseFont* font = new BaseFont(_gameRef);
if (!font) return NULL;
if (DID_FAIL(font->loadFile(filename))) {
@@ -94,7 +94,7 @@ CBFont *CBFontStorage::addFont(const char *filename) {
return font;
}
*/
- CBFont *font = CBFont::createFromFile(_gameRef, filename);
+ BaseFont *font = BaseFont::createFromFile(_gameRef, filename);
if (font) {
font->_refCount = 1;
_fonts.add(font);
@@ -104,7 +104,7 @@ CBFont *CBFontStorage::addFont(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBFontStorage::removeFont(CBFont *font) {
+bool BaseFontStorage::removeFont(BaseFont *font) {
if (!font) return STATUS_FAILED;
for (int i = 0; i < _fonts.getSize(); i++) {
@@ -122,7 +122,7 @@ bool CBFontStorage::removeFont(CBFont *font) {
//////////////////////////////////////////////////////////////////////////
-bool CBFontStorage::persist(CBPersistMgr *persistMgr) {
+bool BaseFontStorage::persist(BasePersistenceManager *persistMgr) {
if (!persistMgr->_saving) cleanup(false);
diff --git a/engines/wintermute/base/font/base_font_storage.h b/engines/wintermute/base/font/base_font_storage.h
index 7c88e9a2f4..2c9c6817c3 100644
--- a/engines/wintermute/base/font/base_font_storage.h
+++ b/engines/wintermute/base/font/base_font_storage.h
@@ -36,17 +36,17 @@
namespace WinterMute {
-class CBFont;
+class BaseFont;
-class CBFontStorage : public CBBase {
+class BaseFontStorage : public BaseClass {
public:
- DECLARE_PERSISTENT(CBFontStorage, CBBase)
+ DECLARE_PERSISTENT(BaseFontStorage, BaseClass)
bool cleanup(bool warn = false);
- bool removeFont(CBFont *font);
- CBFont *addFont(const char *filename);
- CBFontStorage(CBGame *inGame);
- virtual ~CBFontStorage();
- CBArray<CBFont *, CBFont *> _fonts;
+ bool removeFont(BaseFont *font);
+ BaseFont *addFont(const char *filename);
+ BaseFontStorage(BaseGame *inGame);
+ virtual ~BaseFontStorage();
+ BaseArray<BaseFont *, BaseFont *> _fonts;
bool initLoop();
};
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index a52922fb76..bcf8621a40 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -46,10 +46,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBFontTT, false)
+IMPLEMENT_PERSISTENT(BaseFontTT, false)
//////////////////////////////////////////////////////////////////////////
-CBFontTT::CBFontTT(CBGame *inGame): CBFont(inGame) {
+BaseFontTT::BaseFontTT(BaseGame *inGame): BaseFont(inGame) {
_fontHeight = 12;
_isBold = _isItalic = _isUnderline = _isStriked = false;
@@ -71,7 +71,7 @@ CBFontTT::CBFontTT(CBGame *inGame): CBFont(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CBFontTT::~CBFontTT(void) {
+BaseFontTT::~BaseFontTT(void) {
clearCache();
for (int i = 0; i < _layers.getSize(); i++) {
@@ -97,7 +97,7 @@ CBFontTT::~CBFontTT(void) {
//////////////////////////////////////////////////////////////////////////
-void CBFontTT::clearCache() {
+void BaseFontTT::clearCache() {
for (int i = 0; i < NUM_CACHED_TEXTS; i++) {
if (_cachedTexts[i]) delete _cachedTexts[i];
_cachedTexts[i] = NULL;
@@ -105,7 +105,7 @@ void CBFontTT::clearCache() {
}
//////////////////////////////////////////////////////////////////////////
-void CBFontTT::initLoop() {
+void BaseFontTT::initLoop() {
// we need more aggressive cache management on iOS not to waste too much memory on fonts
if (_gameRef->_constrainedMemory) {
// purge all cached images not used in the last frame
@@ -121,7 +121,7 @@ void CBFontTT::initLoop() {
}
//////////////////////////////////////////////////////////////////////////
-int CBFontTT::getTextWidth(byte *text, int maxLength) {
+int BaseFontTT::getTextWidth(byte *text, int maxLength) {
WideString textStr;
if (_gameRef->_textEncoding == TEXT_UTF8) textStr = StringUtil::utf8ToWide((char *)text);
@@ -138,7 +138,7 @@ int CBFontTT::getTextWidth(byte *text, int maxLength) {
}
//////////////////////////////////////////////////////////////////////////
-int CBFontTT::getTextHeight(byte *text, int width) {
+int BaseFontTT::getTextHeight(byte *text, int width) {
WideString textStr;
if (_gameRef->_textEncoding == TEXT_UTF8) textStr = StringUtil::utf8ToWide((char *)text);
@@ -153,7 +153,7 @@ int CBFontTT::getTextHeight(byte *text, int width) {
//////////////////////////////////////////////////////////////////////////
-void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, int maxHeight, int maxLength) {
+void BaseFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, int maxHeight, int maxLength) {
if (text == NULL || strcmp((char *)text, "") == 0) return;
WideString textStr = (char *)text;
@@ -166,12 +166,12 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
textStr = Common::String(textStr.c_str(), (uint32)maxLength);
//text = text.substr(0, MaxLength); // TODO: Remove
- CBRenderer *renderer = _gameRef->_renderer;
+ BaseRenderer *renderer = _gameRef->_renderer;
// find cached surface, if exists
int minPriority = INT_MAX;
int minIndex = -1;
- CBSurface *surface = NULL;
+ BaseSurface *surface = NULL;
int textOffset = 0;
for (int i = 0; i < NUM_CACHED_TEXTS; i++) {
@@ -201,7 +201,7 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
if (surface) {
// write surface to cache
if (_cachedTexts[minIndex] != NULL) delete _cachedTexts[minIndex];
- _cachedTexts[minIndex] = new CBCachedTTFontText;
+ _cachedTexts[minIndex] = new BaseCachedTTFontText;
_cachedTexts[minIndex]->_surface = surface;
_cachedTexts[minIndex]->_align = align;
@@ -219,7 +219,7 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
// and paint it
if (surface) {
Rect32 rc;
- CBPlatform::setRect(&rc, 0, 0, surface->getWidth(), surface->getHeight());
+ BasePlatform::setRect(&rc, 0, 0, surface->getWidth(), surface->getHeight());
for (int i = 0; i < _layers.getSize(); i++) {
uint32 color = _layers[i]->_color;
uint32 origForceAlpha = renderer->_forceAlphaColor;
@@ -237,7 +237,7 @@ void CBFontTT::drawText(byte *text, int x, int y, int width, TTextAlign align, i
}
//////////////////////////////////////////////////////////////////////////
-CBSurface *CBFontTT::renderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset) {
+BaseSurface *BaseFontTT::renderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset) {
//TextLineList lines;
// TODO
//WrapText(text, width, maxHeight, lines);
@@ -256,7 +256,7 @@ CBSurface *CBFontTT::renderTextToTexture(const WideString &text, int width, TTex
static bool hasWarned = false;
if (!hasWarned) {
hasWarned = true;
- warning("CBFontTT::RenderTextToTexture - Not fully ported yet");
+ warning("BaseFontTT::RenderTextToTexture - Not fully ported yet");
}
debugC(kWinterMuteDebugFont, "%s %d %d %d %d", text.c_str(), RGBCOLGetR(_layers[0]->_color), RGBCOLGetG(_layers[0]->_color), RGBCOLGetB(_layers[0]->_color), RGBCOLGetA(_layers[0]->_color));
@@ -274,7 +274,7 @@ CBSurface *CBFontTT::renderTextToTexture(const WideString &text, int width, TTex
heightOffset += (int)_lineHeight;
}
- CBSurface *retSurface = _gameRef->_renderer->createSurface();
+ BaseSurface *retSurface = _gameRef->_renderer->createSurface();
Graphics::Surface *convertedSurface = surface->convertTo(Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8 , 0));
retSurface->putSurface(*convertedSurface, true);
convertedSurface->free();
@@ -363,7 +363,7 @@ CBSurface *CBFontTT::renderTextToTexture(const WideString &text, int width, TTex
posY += GetLineHeight();
}
- CBSurfaceOSystem *wmeSurface = new CBSurfaceOSystem(_gameRef);
+ BaseSurfaceOSystem *wmeSurface = new BaseSurfaceOSystem(_gameRef);
if (DID_SUCCEED(wmeSurface->CreateFromSDLSurface(surface))) {
SDL_FreeSurface(surface);
return wmeSurface;
@@ -377,9 +377,9 @@ CBSurface *CBFontTT::renderTextToTexture(const WideString &text, int width, TTex
}
//////////////////////////////////////////////////////////////////////////
-void CBFontTT::blitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect) {
+void BaseFontTT::blitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect) {
//SDL_BlitSurface(src, NULL, target, targetRect);
- warning("CBFontTT::BlitSurface - not ported yet");
+ warning("BaseFontTT::BlitSurface - not ported yet");
#if 0
for (int y = 0; y < src->h; y++) {
if (targetRect->y + y < 0 || targetRect->y + y >= target->h) continue;
@@ -401,16 +401,16 @@ void CBFontTT::blitSurface(Graphics::Surface *src, Graphics::Surface *target, Co
}
//////////////////////////////////////////////////////////////////////////
-int CBFontTT::getLetterHeight() {
+int BaseFontTT::getLetterHeight() {
return (int)getLineHeight();
}
//////////////////////////////////////////////////////////////////////
-bool CBFontTT::loadFile(const char *filename) {
+bool BaseFontTT::loadFile(const char *filename) {
byte *buffer = _gameRef->_fileManager->readWholeFile(filename);
if (buffer == NULL) {
- _gameRef->LOG(0, "CBFontTT::LoadFile failed for file '%s'", filename);
+ _gameRef->LOG(0, "BaseFontTT::LoadFile failed for file '%s'", filename);
return STATUS_FAILED;
}
@@ -444,7 +444,7 @@ TOKEN_DEF(OFFSET_X)
TOKEN_DEF(OFFSET_Y)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
-bool CBFontTT::loadBuffer(byte *buffer) {
+bool BaseFontTT::loadBuffer(byte *buffer) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(TTFONT)
TOKEN_TABLE(SIZE)
@@ -462,7 +462,7 @@ bool CBFontTT::loadBuffer(byte *buffer) {
char *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
if (parser.getCommand((char **)&buffer, commands, (char **)&params) != TOKEN_TTFONT) {
_gameRef->LOG(0, "'TTFONT' keyword expected.");
@@ -483,7 +483,7 @@ bool CBFontTT::loadBuffer(byte *buffer) {
break;
case TOKEN_FILENAME:
- CBUtils::setString(&_fontFile, params);
+ BaseUtils::setString(&_fontFile, params);
break;
case TOKEN_BOLD:
@@ -521,7 +521,7 @@ bool CBFontTT::loadBuffer(byte *buffer) {
break;
case TOKEN_LAYER: {
- CBTTFontLayer *Layer = new CBTTFontLayer;
+ BaseTTFontLayer *Layer = new BaseTTFontLayer;
if (Layer && DID_SUCCEED(parseLayer(Layer, (byte *)params))) _layers.add(Layer);
else {
delete Layer;
@@ -540,19 +540,19 @@ bool CBFontTT::loadBuffer(byte *buffer) {
// create at least one layer
if (_layers.getSize() == 0) {
- CBTTFontLayer *Layer = new CBTTFontLayer;
+ BaseTTFontLayer *Layer = new BaseTTFontLayer;
Layer->_color = BaseColor;
_layers.add(Layer);
}
- if (!_fontFile) CBUtils::setString(&_fontFile, "arial.ttf");
+ if (!_fontFile) BaseUtils::setString(&_fontFile, "arial.ttf");
return initFont();
}
//////////////////////////////////////////////////////////////////////////
-bool CBFontTT::parseLayer(CBTTFontLayer *layer, byte *buffer) {
+bool BaseFontTT::parseLayer(BaseTTFontLayer *layer, byte *buffer) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(OFFSET_X)
TOKEN_TABLE(OFFSET_Y)
@@ -562,7 +562,7 @@ bool CBFontTT::parseLayer(CBTTFontLayer *layer, byte *buffer) {
char *params;
int cmd;
- CBParser parser(_gameRef);
+ BaseParser parser(_gameRef);
while ((cmd = parser.getCommand((char **)&buffer, commands, (char **)&params)) > 0) {
switch (cmd) {
@@ -595,8 +595,8 @@ bool CBFontTT::parseLayer(CBTTFontLayer *layer, byte *buffer) {
//////////////////////////////////////////////////////////////////////////
-bool CBFontTT::persist(CBPersistMgr *persistMgr) {
- CBFont::persist(persistMgr);
+bool BaseFontTT::persist(BasePersistenceManager *persistMgr) {
+ BaseFont::persist(persistMgr);
persistMgr->transfer(TMEMBER(_isBold));
persistMgr->transfer(TMEMBER(_isItalic));
@@ -616,7 +616,7 @@ bool CBFontTT::persist(CBPersistMgr *persistMgr) {
numLayers = _layers.getSize();
persistMgr->transfer(TMEMBER(numLayers));
for (int i = 0; i < numLayers; i++) {
- CBTTFontLayer *layer = new CBTTFontLayer;
+ BaseTTFontLayer *layer = new BaseTTFontLayer;
layer->persist(persistMgr);
_layers.add(layer);
}
@@ -632,18 +632,18 @@ bool CBFontTT::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-void CBFontTT::afterLoad() {
+void BaseFontTT::afterLoad() {
initFont();
}
//////////////////////////////////////////////////////////////////////////
-bool CBFontTT::initFont() {
+bool BaseFontTT::initFont() {
if (!_fontFile) return STATUS_FAILED;
Common::SeekableReadStream *file = _gameRef->_fileManager->openFile(_fontFile);
if (!file) {
// the requested font file is not in wme file space; try loading a system font
- AnsiString fontFileName = PathUtil::combine(CBPlatform::getSystemFontPath(), PathUtil::getFileName(_fontFile));
+ AnsiString fontFileName = PathUtil::combine(BasePlatform::getSystemFontPath(), PathUtil::getFileName(_fontFile));
file = _gameRef->_fileManager->openFile(fontFileName.c_str(), false);
if (!file) {
_gameRef->LOG(0, "Error loading TrueType font '%s'", _fontFile);
@@ -659,7 +659,7 @@ bool CBFontTT::initFont() {
}
if (!_font) {
_font = _fallbackFont = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
- warning("BFontTT::InitFont - Couldn't load %s", _fontFile);
+ warning("BaseFontTT::InitFont - Couldn't load %s", _fontFile);
}
_lineHeight = _font->getFontHeight();
return STATUS_OK;
@@ -673,8 +673,8 @@ bool CBFontTT::initFont() {
_fTStream = (FT_Stream)new byte[sizeof(*_fTStream)];
memset(_fTStream, 0, sizeof(*_fTStream));
- _fTStream->read = CBFontTT::FTReadSeekProc;
- _fTStream->close = CBFontTT::FTCloseProc;
+ _fTStream->read = BaseFontTT::FTReadSeekProc;
+ _fTStream->close = BaseFontTT::FTCloseProc;
_fTStream->descriptor.pointer = file;
_fTStream->size = file->GetSize();
@@ -725,7 +725,7 @@ bool CBFontTT::initFont() {
}
//////////////////////////////////////////////////////////////////////////
-void CBFontTT::measureText(const WideString &text, int maxWidth, int maxHeight, int &textWidth, int &textHeight) {
+void BaseFontTT::measureText(const WideString &text, int maxWidth, int maxHeight, int &textWidth, int &textHeight) {
//TextLineList lines;
// TODO: This function gets called a lot, so warnings like these drown out the usefull information
static bool hasWarned = false;
diff --git a/engines/wintermute/base/font/base_font_truetype.h b/engines/wintermute/base/font/base_font_truetype.h
index 4d8e71a3ff..8a8459b070 100644
--- a/engines/wintermute/base/font/base_font_truetype.h
+++ b/engines/wintermute/base/font/base_font_truetype.h
@@ -40,22 +40,22 @@
namespace WinterMute {
-class CBFontTT : public CBFont {
+class BaseFontTT : public BaseFont {
private:
//////////////////////////////////////////////////////////////////////////
- class CBCachedTTFontText {
+ class BaseCachedTTFontText {
public:
WideString _text;
int _width;
TTextAlign _align;
int _maxHeight;
int _maxLength;
- CBSurface *_surface;
+ BaseSurface *_surface;
int _priority;
int _textOffset;
bool _marked;
- CBCachedTTFontText() {
+ BaseCachedTTFontText() {
//_text = L"";
_text = "";
_width = _maxHeight = _maxLength = -1;
@@ -66,21 +66,21 @@ private:
_marked = false;
}
- virtual ~CBCachedTTFontText() {
+ virtual ~BaseCachedTTFontText() {
if (_surface) delete _surface;
}
};
public:
//////////////////////////////////////////////////////////////////////////
- class CBTTFontLayer {
+ class BaseTTFontLayer {
public:
- CBTTFontLayer() {
+ BaseTTFontLayer() {
_offsetX = _offsetY = 0;
_color = 0x00000000;
}
- bool persist(CBPersistMgr *persistMgr) {
+ bool persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_offsetX));
persistMgr->transfer(TMEMBER(_offsetY));
persistMgr->transfer(TMEMBER(_color));
@@ -114,9 +114,9 @@ public:
public:
- DECLARE_PERSISTENT(CBFontTT, CBFont)
- CBFontTT(CBGame *inGame);
- virtual ~CBFontTT(void);
+ DECLARE_PERSISTENT(BaseFontTT, BaseFont)
+ BaseFontTT(BaseGame *inGame);
+ virtual ~BaseFontTT(void);
virtual int getTextWidth(byte *text, int maxLength = -1);
virtual int getTextHeight(byte *text, int width);
@@ -134,16 +134,16 @@ public:
void initLoop();
private:
- bool parseLayer(CBTTFontLayer *layer, byte *buffer);
+ bool parseLayer(BaseTTFontLayer *layer, byte *buffer);
void wrapText(const WideString &text, int maxWidth, int maxHeight, TextLineList &lines);
void measureText(const WideString &text, int maxWidth, int maxHeight, int &textWidth, int &textHeight);
- CBSurface *renderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset);
+ BaseSurface *renderTextToTexture(const WideString &text, int width, TTextAlign align, int maxHeight, int &textOffset);
void blitSurface(Graphics::Surface *src, Graphics::Surface *target, Common::Rect *targetRect);
- CBCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
+ BaseCachedTTFontText *_cachedTexts[NUM_CACHED_TEXTS];
bool initFont();
@@ -170,7 +170,7 @@ public:
int _fontHeight;
char *_fontFile;
- CBArray<CBTTFontLayer *, CBTTFontLayer *> _layers;
+ BaseArray<BaseTTFontLayer *, BaseTTFontLayer *> _layers;
void clearCache();
};
diff --git a/engines/wintermute/base/gfx/base_image.cpp b/engines/wintermute/base/gfx/base_image.cpp
index fb6b23db2b..533c3a866e 100644
--- a/engines/wintermute/base/gfx/base_image.cpp
+++ b/engines/wintermute/base/gfx/base_image.cpp
@@ -44,7 +44,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-CBImage::CBImage(CBGame *inGame, FIBITMAP *bitmap): CBBase(inGame) {
+BaseImage::BaseImage(BaseGame *inGame, FIBITMAP *bitmap): BaseClass(inGame) {
#if 0
_bitmap = bitmap;
#endif
@@ -57,7 +57,7 @@ CBImage::CBImage(CBGame *inGame, FIBITMAP *bitmap): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////
-CBImage::~CBImage() {
+BaseImage::~BaseImage() {
/* delete _bitmap; */
delete _decoder;
if (_deletableSurface) {
@@ -69,7 +69,7 @@ CBImage::~CBImage() {
#endif
}
-bool CBImage::loadFile(const Common::String &filename) {
+bool BaseImage::loadFile(const Common::String &filename) {
_filename = filename;
_filename.toLowercase();
if (StringUtil::startsWith(filename, "savegame:", true)) {
@@ -83,7 +83,7 @@ bool CBImage::loadFile(const Common::String &filename) {
} else if (_filename.hasSuffix(".jpg")) {
_decoder = new Graphics::JPEGDecoder();
} else {
- error("CBImage::loadFile : Unsupported fileformat %s", filename.c_str());
+ error("BaseImage::loadFile : Unsupported fileformat %s", filename.c_str());
}
_filename = filename;
Common::SeekableReadStream *file = _gameRef->_fileManager->openFile(filename.c_str());
@@ -97,7 +97,7 @@ bool CBImage::loadFile(const Common::String &filename) {
return STATUS_OK;
}
-byte CBImage::getAlphaAt(int x, int y) {
+byte BaseImage::getAlphaAt(int x, int y) {
if (!_surface) return 0xFF;
uint32 color = *(uint32 *)_surface->getBasePtr(x, y);
byte r, g, b, a;
@@ -105,13 +105,13 @@ byte CBImage::getAlphaAt(int x, int y) {
return a;
}
-void CBImage::copyFrom(Graphics::Surface *surface) {
+void BaseImage::copyFrom(Graphics::Surface *surface) {
_surface = _deletableSurface = new Graphics::Surface();
_deletableSurface->copyFrom(*surface);
}
//////////////////////////////////////////////////////////////////////////
-bool CBImage::saveBMPFile(const char *filename) {
+bool BaseImage::saveBMPFile(const char *filename) {
#if 0
if (!_bitmap) return STATUS_FAILED;
@@ -123,7 +123,7 @@ bool CBImage::saveBMPFile(const char *filename) {
//////////////////////////////////////////////////////////////////////////
-bool CBImage::resize(int newWidth, int newHeight) {
+bool BaseImage::resize(int newWidth, int newHeight) {
#if 0
if (!_bitmap) return STATUS_FAILED;
@@ -143,7 +143,7 @@ bool CBImage::resize(int newWidth, int newHeight) {
//////////////////////////////////////////////////////////////////////////
-bool CBImage::writeBMPToStream(Common::WriteStream *stream) {
+bool BaseImage::writeBMPToStream(Common::WriteStream *stream) {
if (!_surface) return false;
/* The following is just copied over and inverted to write-ops from the BMP-decoder */
@@ -247,7 +247,7 @@ bool CBImage::writeBMPToStream(Common::WriteStream *stream) {
//////////////////////////////////////////////////////////////////////////
-bool CBImage::copyFrom(CBImage *origImage, int newWidth, int newHeight) {
+bool BaseImage::copyFrom(BaseImage *origImage, int newWidth, int newHeight) {
#if 0
if (_bitmap) FreeImage_Unload(_bitmap);
diff --git a/engines/wintermute/base/gfx/base_image.h b/engines/wintermute/base/gfx/base_image.h
index 6cda3e6b46..4b43e36a6d 100644
--- a/engines/wintermute/base/gfx/base_image.h
+++ b/engines/wintermute/base/gfx/base_image.h
@@ -40,12 +40,12 @@
struct FIBITMAP;
namespace WinterMute {
-class CBSurface;
-class CBImage: CBBase {
+class BaseSurface;
+class BaseImage: BaseClass {
public:
- CBImage(CBGame *inGame, FIBITMAP *bitmap = NULL);
- ~CBImage();
+ BaseImage(BaseGame *inGame, FIBITMAP *bitmap = NULL);
+ ~BaseImage();
bool loadFile(const Common::String &filename);
const Graphics::Surface *getSurface() const {
@@ -58,7 +58,7 @@ public:
bool writeBMPToStream(Common::WriteStream *stream);
bool resize(int newWidth, int newHeight);
bool saveBMPFile(const char *filename);
- bool copyFrom(CBImage *origImage, int newWidth = 0, int newHeight = 0);
+ bool copyFrom(BaseImage *origImage, int newWidth = 0, int newHeight = 0);
void copyFrom(Graphics::Surface *surface);
private:
Common::String _filename;
diff --git a/engines/wintermute/base/gfx/base_renderer.cpp b/engines/wintermute/base/gfx/base_renderer.cpp
index a8c19362f6..c46115d70a 100644
--- a/engines/wintermute/base/gfx/base_renderer.cpp
+++ b/engines/wintermute/base/gfx/base_renderer.cpp
@@ -37,7 +37,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-CBRenderer::CBRenderer(CBGame *inGame): CBBase(inGame) {
+BaseRenderer::BaseRenderer(BaseGame *inGame): BaseClass(inGame) {
_window = 0;
_clipperWindow = 0;
_active = false;
@@ -46,7 +46,7 @@ CBRenderer::CBRenderer(CBGame *inGame): CBBase(inGame) {
_forceAlphaColor = 0x00;
_width = _height = _bPP = 0;
- CBPlatform::setRectEmpty(&_monitorRect);
+ BasePlatform::setRectEmpty(&_monitorRect);
_realWidth = _realHeight = 0;
_drawOffsetX = _drawOffsetY = 0;
@@ -54,26 +54,26 @@ CBRenderer::CBRenderer(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////
-CBRenderer::~CBRenderer() {
+BaseRenderer::~BaseRenderer() {
deleteRectList();
unclipCursor();
}
//////////////////////////////////////////////////////////////////////
-void CBRenderer::initLoop() {
+void BaseRenderer::initLoop() {
deleteRectList();
}
//////////////////////////////////////////////////////////////////////
-CBObject *CBRenderer::getObjectAt(int x, int y) {
+BaseObject *BaseRenderer::getObjectAt(int x, int y) {
Point32 point;
point.x = x;
point.y = y;
for (int i = _rectList.getSize() - 1; i >= 0; i--) {
- if (CBPlatform::ptInRect(&_rectList[i]->_rect, point)) {
+ if (BasePlatform::ptInRect(&_rectList[i]->_rect, point)) {
if (_rectList[i]->_precise) {
// frame
if (_rectList[i]->_frame) {
@@ -100,12 +100,12 @@ CBObject *CBRenderer::getObjectAt(int x, int y) {
}
}
- return (CBObject *)NULL;
+ return (BaseObject *)NULL;
}
//////////////////////////////////////////////////////////////////////////
-void CBRenderer::deleteRectList() {
+void BaseRenderer::deleteRectList() {
for (int i = 0; i < _rectList.getSize(); i++) {
delete _rectList[i];
}
@@ -115,58 +115,58 @@ void CBRenderer::deleteRectList() {
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
-bool CBRenderer::switchFullscreen() {
+bool BaseRenderer::switchFullscreen() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////
-bool CBRenderer::flip() {
+bool BaseRenderer::flip() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////
-bool CBRenderer::initRenderer(int width, int height, bool windowed) {
+bool BaseRenderer::initRenderer(int width, int height, bool windowed) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////
-void CBRenderer::onWindowChange() {
+void BaseRenderer::onWindowChange() {
}
//////////////////////////////////////////////////////////////////////
-bool CBRenderer::fill(byte r, byte g, byte b, Common::Rect *rect) {
+bool BaseRenderer::fill(byte r, byte g, byte b, Common::Rect *rect) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::windowedBlt() {
+bool BaseRenderer::windowedBlt() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::setup2D(bool Force) {
+bool BaseRenderer::setup2D(bool Force) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::setupLines() {
+bool BaseRenderer::setupLines() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::drawLine(int x1, int y1, int x2, int y2, uint32 color) {
+bool BaseRenderer::drawLine(int x1, int y1, int x2, int y2, uint32 color) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::drawRect(int x1, int y1, int x2, int y2, uint32 color, int width) {
+bool BaseRenderer::drawRect(int x1, int y1, int x2, int y2, uint32 color, int width) {
for (int i = 0; i < width; i++) {
drawLine(x1 + i, y1 + i, x2 - i, y1 + i, color); // up
drawLine(x1 + i, y2 - i, x2 - i + 1, y2 - i, color); // down
@@ -179,31 +179,31 @@ bool CBRenderer::drawRect(int x1, int y1, int x2, int y2, uint32 color, int widt
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::fade(uint16 alpha) {
+bool BaseRenderer::fade(uint16 alpha) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::fadeToColor(uint32 color, Common::Rect *rect) {
+bool BaseRenderer::fadeToColor(uint32 color, Common::Rect *rect) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::setViewport(int left, int top, int right, int bottom) {
+bool BaseRenderer::setViewport(int left, int top, int right, int bottom) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::setScreenViewport() {
+bool BaseRenderer::setScreenViewport() {
return setViewport(_drawOffsetX, _drawOffsetY, _width + _drawOffsetX, _height + _drawOffsetY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::setViewport(Rect32 *rect) {
+bool BaseRenderer::setViewport(Rect32 *rect) {
return setViewport(rect->left + _drawOffsetX,
rect->top + _drawOffsetY,
rect->right + _drawOffsetX,
@@ -212,13 +212,13 @@ bool CBRenderer::setViewport(Rect32 *rect) {
//////////////////////////////////////////////////////////////////////////
-CBImage *CBRenderer::takeScreenshot() {
+BaseImage *BaseRenderer::takeScreenshot() {
return NULL;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::clipCursor() {
+bool BaseRenderer::clipCursor() {
/*
if (!_windowed) {
Rect32 rc;
@@ -237,7 +237,7 @@ bool CBRenderer::clipCursor() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::unclipCursor() {
+bool BaseRenderer::unclipCursor() {
/*
if (!_windowed) ::ClipCursor(NULL);
*/
@@ -245,7 +245,7 @@ bool CBRenderer::unclipCursor() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderer::pointInViewport(Point32 *p) {
+bool BaseRenderer::pointInViewport(Point32 *p) {
if (p->x < _drawOffsetX) return false;
if (p->y < _drawOffsetY) return false;
if (p->x > _drawOffsetX + _width) return false;
diff --git a/engines/wintermute/base/gfx/base_renderer.h b/engines/wintermute/base/gfx/base_renderer.h
index d743f19791..118cda0ec6 100644
--- a/engines/wintermute/base/gfx/base_renderer.h
+++ b/engines/wintermute/base/gfx/base_renderer.h
@@ -36,11 +36,11 @@
namespace WinterMute {
-class CBImage;
-class CBActiveRect;
-class CBObject;
-class CBSurface;
-class CBRenderer: public CBBase {
+class BaseImage;
+class BaseActiveRect;
+class BaseObject;
+class BaseSurface;
+class BaseRenderer: public BaseClass {
public:
int _realWidth;
int _realHeight;
@@ -48,7 +48,7 @@ public:
int _drawOffsetY;
virtual void dumpData(const char *filename) {};
- virtual CBImage *takeScreenshot();
+ virtual BaseImage *takeScreenshot();
virtual bool setViewport(int left, int top, int right, int bottom);
virtual bool setViewport(Rect32 *Rect);
virtual bool setScreenViewport();
@@ -56,8 +56,8 @@ public:
virtual bool fadeToColor(uint32 Color, Common::Rect *rect = NULL);
virtual bool drawLine(int x1, int y1, int x2, int y2, uint32 color);
virtual bool drawRect(int x1, int y1, int x2, int y2, uint32 color, int width = 1);
- CBRenderer(CBGame *inGame = NULL);
- virtual ~CBRenderer();
+ BaseRenderer(BaseGame *inGame = NULL);
+ virtual ~BaseRenderer();
virtual bool setProjection() {
return STATUS_OK;
};
@@ -89,12 +89,12 @@ public:
return 1.0f;
}
- virtual CBSurface *createSurface() = 0;
+ virtual BaseSurface *createSurface() = 0;
bool clipCursor();
bool unclipCursor();
- CBObject *getObjectAt(int x, int y);
+ BaseObject *getObjectAt(int x, int y);
void deleteRectList();
virtual bool startSpriteBatch() {
@@ -118,10 +118,10 @@ public:
int _height;
int _width;
- CBArray<CBActiveRect *, CBActiveRect *> _rectList;
+ BaseArray<BaseActiveRect *, BaseActiveRect *> _rectList;
};
-CBRenderer *makeOSystemRenderer(CBGame *inGame); // Implemented in BRenderSDL.cpp
+BaseRenderer *makeOSystemRenderer(BaseGame *inGame); // Implemented in BRenderSDL.cpp
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/gfx/base_surface.cpp b/engines/wintermute/base/gfx/base_surface.cpp
index 73b385d180..684236ac7f 100644
--- a/engines/wintermute/base/gfx/base_surface.cpp
+++ b/engines/wintermute/base/gfx/base_surface.cpp
@@ -33,7 +33,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-CBSurface::CBSurface(CBGame *inGame): CBBase(inGame) {
+BaseSurface::BaseSurface(BaseGame *inGame): BaseClass(inGame) {
_referenceCount = 0;
_width = _height = 0;
@@ -53,87 +53,87 @@ CBSurface::CBSurface(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////
-CBSurface::~CBSurface() {
+BaseSurface::~BaseSurface() {
if (_pixelOpReady) endPixelOp();
}
//////////////////////////////////////////////////////////////////////
-bool CBSurface::create(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
+bool BaseSurface::create(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////
-bool CBSurface::restore() {
+bool BaseSurface::restore() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////
-bool CBSurface::isTransparentAt(int x, int y) {
+bool BaseSurface::isTransparentAt(int x, int y) {
return false;
}
//////////////////////////////////////////////////////////////////////
-bool CBSurface::displayHalfTrans(int x, int y, Rect32 rect) {
+bool BaseSurface::displayHalfTrans(int x, int y, Rect32 rect) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::displayTransform(int x, int y, int hotX, int hotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+bool BaseSurface::displayTransform(int x, int y, int hotX, int hotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return displayTransZoom(x, y, rect, zoomX, zoomY, alpha, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::create(int Width, int Height) {
+bool BaseSurface::create(int Width, int Height) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::startPixelOp() {
+bool BaseSurface::startPixelOp() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::endPixelOp() {
+bool BaseSurface::endPixelOp() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a) {
+bool BaseSurface::getPixel(int x, int y, byte *r, byte *g, byte *b, byte *a) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::putPixel(int x, int y, byte r, byte g, byte b, int a) {
+bool BaseSurface::putPixel(int x, int y, byte r, byte g, byte b, int a) {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::comparePixel(int x, int y, byte r, byte g, byte b, int a) {
+bool BaseSurface::comparePixel(int x, int y, byte r, byte g, byte b, int a) {
return false;
}
//////////////////////////////////////////////////////////////////////
-bool CBSurface::isTransparentAtLite(int x, int y) {
+bool BaseSurface::isTransparentAtLite(int x, int y) {
return false;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::invalidate() {
+bool BaseSurface::invalidate() {
return STATUS_FAILED;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurface::prepareToDraw() {
+bool BaseSurface::prepareToDraw() {
_lastUsedTime = _gameRef->_liveTimer;
if (!_valid) {
@@ -144,7 +144,7 @@ bool CBSurface::prepareToDraw() {
//////////////////////////////////////////////////////////////////////////
-void CBSurface::setSize(int width, int height) {
+void BaseSurface::setSize(int width, int height) {
_width = width;
_height = height;
}
diff --git a/engines/wintermute/base/gfx/base_surface.h b/engines/wintermute/base/gfx/base_surface.h
index 22c1fb83b8..9a72cbb236 100644
--- a/engines/wintermute/base/gfx/base_surface.h
+++ b/engines/wintermute/base/gfx/base_surface.h
@@ -35,7 +35,7 @@
namespace WinterMute {
-class CBSurface: public CBBase {
+class BaseSurface: public BaseClass {
public:
virtual bool invalidate();
virtual bool prepareToDraw();
@@ -50,8 +50,8 @@ public:
bool _keepLoaded;
bool _pixelOpReady;
- CBSurface(CBGame *inGame);
- virtual ~CBSurface();
+ BaseSurface(BaseGame *inGame);
+ virtual ~BaseSurface();
virtual bool displayHalfTrans(int x, int y, Rect32 rect);
virtual bool isTransparentAt(int x, int y);
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
index dbd2511928..ec69a80095 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.cpp
@@ -41,7 +41,7 @@
namespace WinterMute {
-RenderTicket::RenderTicket(CBSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY) : _owner(owner),
+RenderTicket::RenderTicket(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY) : _owner(owner),
_srcRect(*srcRect), _dstRect(*dstRect), _drawNum(0), _isValid(true), _wantsDraw(true), _hasAlpha(true) {
_colorMod = 0;
_mirror = TransparentSurface::FLIP_NONE;
@@ -89,14 +89,14 @@ bool RenderTicket::operator==(RenderTicket &t) {
return true;
}
-CBRenderer *makeOSystemRenderer(CBGame *inGame) {
- return new CBRenderOSystem(inGame);
+BaseRenderer *makeOSystemRenderer(BaseGame *inGame) {
+ return new BaseRenderOSystem(inGame);
}
// TODO: Redo everything here.
//////////////////////////////////////////////////////////////////////////
-CBRenderOSystem::CBRenderOSystem(CBGame *inGame) : CBRenderer(inGame) {
+BaseRenderOSystem::BaseRenderOSystem(BaseGame *inGame) : BaseRenderer(inGame) {
_renderSurface = new Graphics::Surface();
_drawNum = 1;
_needsFlip = true;
@@ -110,7 +110,7 @@ CBRenderOSystem::CBRenderOSystem(CBGame *inGame) : CBRenderer(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CBRenderOSystem::~CBRenderOSystem() {
+BaseRenderOSystem::~BaseRenderOSystem() {
_renderSurface->free();
delete _renderSurface;
#if 0
@@ -121,7 +121,7 @@ CBRenderOSystem::~CBRenderOSystem() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::initRenderer(int width, int height, bool windowed) {
+bool BaseRenderOSystem::initRenderer(int width, int height, bool windowed) {
//if (SDL_Init(SDL_INIT_VIDEO) < 0) return STATUS_FAILED;
#if 0
@@ -237,20 +237,20 @@ bool CBRenderOSystem::initRenderer(int width, int height, bool windowed) {
return STATUS_OK;
}
-void CBRenderOSystem::setAlphaMod(byte alpha) {
+void BaseRenderOSystem::setAlphaMod(byte alpha) {
byte r = RGBCOLGetR(_colorMod);
byte g = RGBCOLGetB(_colorMod);
byte b = RGBCOLGetB(_colorMod);
_colorMod = BS_ARGB(alpha, r, g, b);
}
-void CBRenderOSystem::setColorMod(byte r, byte g, byte b) {
+void BaseRenderOSystem::setColorMod(byte r, byte g, byte b) {
byte alpha = RGBCOLGetA(_colorMod);
_colorMod = BS_ARGB(alpha, r, g, b);
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::flip() {
+bool BaseRenderOSystem::flip() {
if (!_disableDirtyRects) {
drawTickets();
}
@@ -270,7 +270,7 @@ bool CBRenderOSystem::flip() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::fill(byte r, byte g, byte b, Common::Rect *rect) {
+bool BaseRenderOSystem::fill(byte r, byte g, byte b, Common::Rect *rect) {
//SDL_SetRenderDrawColor(_renderer, r, g, b, 0xFF);
//SDL_RenderClear(_renderer);
_clearColor = _renderSurface->format.ARGBToColor(0xFF, r, g, b);
@@ -285,20 +285,20 @@ bool CBRenderOSystem::fill(byte r, byte g, byte b, Common::Rect *rect) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::fade(uint16 Alpha) {
+bool BaseRenderOSystem::fade(uint16 Alpha) {
uint32 dwAlpha = 255 - Alpha;
return fadeToColor(dwAlpha << 24);
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::fadeToColor(uint32 Color, Common::Rect *rect) {
+bool BaseRenderOSystem::fadeToColor(uint32 Color, Common::Rect *rect) {
// This particular warning is rather messy, as this function is called a ton,
// thus we avoid printing it more than once.
static bool hasWarned = false;
if (!hasWarned) {
- warning("CBRenderOSystem::FadeToColor - Breaks when using dirty rects");
- warning("Implement CBRenderOSystem::FadeToColor"); // TODO.
+ warning("BaseRenderOSystem::FadeToColor - Breaks when using dirty rects");
+ warning("Implement BaseRenderOSystem::FadeToColor"); // TODO.
hasWarned = true;
}
@@ -347,7 +347,7 @@ bool CBRenderOSystem::fadeToColor(uint32 Color, Common::Rect *rect) {
return STATUS_OK;
}
-void CBRenderOSystem::drawSurface(CBSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY) {
+void BaseRenderOSystem::drawSurface(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY) {
if (_disableDirtyRects) {
RenderTicket renderTicket(owner, surf, srcRect, dstRect, mirrorX, mirrorY);
// HINT: The surface-data contains other info than it should.
@@ -375,13 +375,13 @@ void CBRenderOSystem::drawSurface(CBSurfaceOSystem *owner, const Graphics::Surfa
drawFromTicket(ticket);
}
-void CBRenderOSystem::invalidateTicket(RenderTicket *renderTicket) {
+void BaseRenderOSystem::invalidateTicket(RenderTicket *renderTicket) {
addDirtyRect(renderTicket->_dstRect);
renderTicket->_isValid = false;
// renderTicket->_canDelete = true; // TODO: Maybe readd this, to avoid even more duplicates.
}
-void CBRenderOSystem::invalidateTicketsFromSurface(CBSurfaceOSystem *surf) {
+void BaseRenderOSystem::invalidateTicketsFromSurface(BaseSurfaceOSystem *surf) {
RenderQueueIterator it;
for (it = _renderQueue.begin(); it != _renderQueue.end(); it++) {
if ((*it)->_owner == surf) {
@@ -390,7 +390,7 @@ void CBRenderOSystem::invalidateTicketsFromSurface(CBSurfaceOSystem *surf) {
}
}
-void CBRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
+void BaseRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
renderTicket->_wantsDraw = true;
// A new item always has _drawNum == 0
if (renderTicket->_drawNum == 0) {
@@ -445,7 +445,7 @@ void CBRenderOSystem::drawFromTicket(RenderTicket *renderTicket) {
}
}
-void CBRenderOSystem::addDirtyRect(const Common::Rect &rect) {
+void BaseRenderOSystem::addDirtyRect(const Common::Rect &rect) {
if (!_dirtyRect) {
_dirtyRect = new Common::Rect(rect);
} else {
@@ -455,7 +455,7 @@ void CBRenderOSystem::addDirtyRect(const Common::Rect &rect) {
// warning("AddDirtyRect: %d %d %d %d", rect.left, rect.top, rect.right, rect.bottom);
}
-void CBRenderOSystem::drawTickets() {
+void BaseRenderOSystem::drawTickets() {
RenderQueueIterator it = _renderQueue.begin();
// Clean out the old tickets
int decrement = 0;
@@ -511,7 +511,7 @@ void CBRenderOSystem::drawTickets() {
}
// Replacement for SDL2's SDL_RenderCopy
-void CBRenderOSystem::drawFromSurface(const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect, uint32 mirror) {
+void BaseRenderOSystem::drawFromSurface(const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, Common::Rect *clipRect, uint32 mirror) {
TransparentSurface src(*surf, false);
bool doDelete = false;
if (!clipRect) {
@@ -527,10 +527,10 @@ void CBRenderOSystem::drawFromSurface(const Graphics::Surface *surf, Common::Rec
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::drawLine(int x1, int y1, int x2, int y2, uint32 color) {
+bool BaseRenderOSystem::drawLine(int x1, int y1, int x2, int y2, uint32 color) {
static bool hasWarned = false;
if (!hasWarned) {
- warning("CBRenderOSystem::DrawLine - not fully ported yet");
+ warning("BaseRenderOSystem::DrawLine - not fully ported yet");
hasWarned = true;
}
byte r = RGBCOLGetR(color);
@@ -558,10 +558,10 @@ bool CBRenderOSystem::drawLine(int x1, int y1, int x2, int y2, uint32 color) {
}
//////////////////////////////////////////////////////////////////////////
-CBImage *CBRenderOSystem::takeScreenshot() {
+BaseImage *BaseRenderOSystem::takeScreenshot() {
// TODO: Fix this
- warning("CBRenderOSystem::TakeScreenshot() - not ported yet");
- CBImage *screenshot = new CBImage(_gameRef);
+ warning("BaseRenderOSystem::TakeScreenshot() - not ported yet");
+ BaseImage *screenshot = new BaseImage(_gameRef);
screenshot->copyFrom(_renderSurface);
return screenshot;
#if 0
@@ -584,13 +584,13 @@ CBImage *CBRenderOSystem::takeScreenshot() {
memcpy(bits, src, bytespp * viewport.w);
}
- return new CBImage(_gameRef, dib);
+ return new BaseImage(_gameRef, dib);
#endif
return NULL;
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::switchFullscreen() {
+bool BaseRenderOSystem::switchFullscreen() {
/*if (_windowed) SDL_SetWindowFullscreen(_win, SDL_TRUE);
else SDL_SetWindowFullscreen(_win, SDL_FALSE);
@@ -602,7 +602,7 @@ bool CBRenderOSystem::switchFullscreen() {
}
//////////////////////////////////////////////////////////////////////////
-const char *CBRenderOSystem::getName() {
+const char *BaseRenderOSystem::getName() {
if (_name.empty()) {
#if 0
if (_renderer) {
@@ -616,7 +616,7 @@ const char *CBRenderOSystem::getName() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBRenderOSystem::setViewport(int left, int top, int right, int bottom) {
+bool BaseRenderOSystem::setViewport(int left, int top, int right, int bottom) {
Common::Rect rect;
// TODO: Hopefully this is the same logic that ScummVM uses.
rect.left = (int16)(left + _borderLeft);
@@ -632,7 +632,7 @@ bool CBRenderOSystem::setViewport(int left, int top, int right, int bottom) {
}
//////////////////////////////////////////////////////////////////////////
-void CBRenderOSystem::modTargetRect(Common::Rect *rect) {
+void BaseRenderOSystem::modTargetRect(Common::Rect *rect) {
#if 0
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
@@ -645,7 +645,7 @@ void CBRenderOSystem::modTargetRect(Common::Rect *rect) {
}
//////////////////////////////////////////////////////////////////////////
-void CBRenderOSystem::pointFromScreen(Point32 *point) {
+void BaseRenderOSystem::pointFromScreen(Point32 *point) {
#if 0
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
@@ -657,7 +657,7 @@ void CBRenderOSystem::pointFromScreen(Point32 *point) {
//////////////////////////////////////////////////////////////////////////
-void CBRenderOSystem::pointToScreen(Point32 *point) {
+void BaseRenderOSystem::pointToScreen(Point32 *point) {
#if 0
SDL_Rect viewportRect;
SDL_RenderGetViewport(GetSdlRenderer(), &viewportRect);
@@ -668,19 +668,19 @@ void CBRenderOSystem::pointToScreen(Point32 *point) {
}
//////////////////////////////////////////////////////////////////////////
-void CBRenderOSystem::dumpData(const char *filename) {
- warning("CBRenderOSystem::DumpData(%s) - not reimplemented yet", filename); // TODO
+void BaseRenderOSystem::dumpData(const char *filename) {
+ warning("BaseRenderOSystem::DumpData(%s) - not reimplemented yet", filename); // TODO
#if 0
FILE *f = fopen(filename, "wt");
if (!f) return;
- CBSurfaceStorage *Mgr = _gameRef->_surfaceStorage;
+ BaseSurfaceStorage *Mgr = _gameRef->_surfaceStorage;
int TotalKB = 0;
int TotalLoss = 0;
fprintf(f, "Filename;Usage;Size;KBytes\n");
for (int i = 0; i < Mgr->_surfaces.getSize(); i++) {
- CBSurfaceOSystem *Surf = (CBSurfaceOSystem *)Mgr->_surfaces[i];
+ BaseSurfaceOSystem *Surf = (BaseSurfaceOSystem *)Mgr->_surfaces[i];
if (!Surf->_filename) continue;
if (!Surf->_valid) continue;
@@ -702,8 +702,8 @@ void CBRenderOSystem::dumpData(const char *filename) {
#endif
}
-CBSurface *CBRenderOSystem::createSurface() {
- return new CBSurfaceOSystem(_gameRef);
+BaseSurface *BaseRenderOSystem::createSurface() {
+ return new BaseSurfaceOSystem(_gameRef);
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/gfx/osystem/base_render_osystem.h b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
index 8a8eb88ede..75c745ecf7 100644
--- a/engines/wintermute/base/gfx/osystem/base_render_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_render_osystem.h
@@ -35,11 +35,11 @@
#include "common/list.h"
namespace WinterMute {
-class CBSurfaceOSystem;
+class BaseSurfaceOSystem;
class RenderTicket {
Graphics::Surface *_surface;
public:
- RenderTicket(CBSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRest, bool mirrorX = false, bool mirrorY = false);
+ RenderTicket(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRest, bool mirrorX = false, bool mirrorY = false);
RenderTicket() : _isValid(true), _wantsDraw(false), _drawNum(0) {}
~RenderTicket();
const Graphics::Surface *getSurface() { return _surface; }
@@ -53,14 +53,14 @@ public:
uint32 _drawNum;
uint32 _colorMod;
- CBSurfaceOSystem *_owner;
+ BaseSurfaceOSystem *_owner;
bool operator==(RenderTicket &a);
};
-class CBRenderOSystem : public CBRenderer {
+class BaseRenderOSystem : public BaseRenderer {
public:
- CBRenderOSystem(CBGame *inGame);
- ~CBRenderOSystem();
+ BaseRenderOSystem(BaseGame *inGame);
+ ~BaseRenderOSystem();
const char *getName();
@@ -75,12 +75,12 @@ public:
bool drawLine(int x1, int y1, int x2, int y2, uint32 color);
- CBImage *takeScreenshot();
+ BaseImage *takeScreenshot();
void setAlphaMod(byte alpha);
void setColorMod(byte r, byte g, byte b);
void invalidateTicket(RenderTicket *renderTicket);
- void invalidateTicketsFromSurface(CBSurfaceOSystem *surf);
+ void invalidateTicketsFromSurface(BaseSurfaceOSystem *surf);
void drawFromTicket(RenderTicket *renderTicket);
bool setViewport(int left, int top, int right, int bottom);
@@ -98,8 +98,8 @@ public:
return _ratioY;
}
- void drawSurface(CBSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY);
- CBSurface *createSurface();
+ void drawSurface(BaseSurfaceOSystem *owner, const Graphics::Surface *surf, Common::Rect *srcRect, Common::Rect *dstRect, bool mirrorX, bool mirrorY);
+ BaseSurface *createSurface();
private:
void addDirtyRect(const Common::Rect &rect);
void drawTickets();
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
index 87c5731b49..0de31349fd 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
@@ -46,7 +46,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CBSurfaceOSystem::CBSurfaceOSystem(CBGame *inGame) : CBSurface(inGame) {
+BaseSurfaceOSystem::BaseSurfaceOSystem(BaseGame *inGame) : BaseSurface(inGame) {
_surface = new Graphics::Surface();
_alphaMask = NULL;
_hasAlpha = true;
@@ -56,7 +56,7 @@ CBSurfaceOSystem::CBSurfaceOSystem(CBGame *inGame) : CBSurface(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CBSurfaceOSystem::~CBSurfaceOSystem() {
+BaseSurfaceOSystem::~BaseSurfaceOSystem() {
//TODO
if (_surface) {
_surface->free();
@@ -68,7 +68,7 @@ CBSurfaceOSystem::~CBSurfaceOSystem() {
_alphaMask = NULL;
_gameRef->addMem(-_width * _height * 4);
- CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_gameRef->_renderer);
+ BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
renderer->invalidateTicketsFromSurface(this);
}
@@ -91,8 +91,8 @@ bool hasTransparency(Graphics::Surface *surf) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::create(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
- /* CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_gameRef->_renderer); */
+bool BaseSurfaceOSystem::create(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime, bool keepLoaded) {
+ /* BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer); */
_filename = filename;
// const Graphics::Surface *surface = image->getSurface();
@@ -116,8 +116,8 @@ bool CBSurfaceOSystem::create(const char *filename, bool defaultCK, byte ckRed,
return STATUS_OK;
}
-void CBSurfaceOSystem::finishLoad() {
- CBImage *image = new CBImage(_gameRef);
+void BaseSurfaceOSystem::finishLoad() {
+ BaseImage *image = new BaseImage(_gameRef);
image->loadFile(_filename);
_width = image->getSurface()->w;
@@ -191,8 +191,8 @@ void CBSurfaceOSystem::finishLoad() {
}
//////////////////////////////////////////////////////////////////////////
-void CBSurfaceOSystem::genAlphaMask(Graphics::Surface *surface) {
- warning("CBSurfaceOSystem::GenAlphaMask - Not ported yet");
+void BaseSurfaceOSystem::genAlphaMask(Graphics::Surface *surface) {
+ warning("BaseSurfaceOSystem::GenAlphaMask - Not ported yet");
return;
delete[] _alphaMask;
@@ -237,8 +237,8 @@ void CBSurfaceOSystem::genAlphaMask(Graphics::Surface *surface) {
}
//////////////////////////////////////////////////////////////////////////
-uint32 CBSurfaceOSystem::getPixel(Graphics::Surface *surface, int x, int y) {
- warning("CBSurfaceOSystem::GetPixel - Not ported yet");
+uint32 BaseSurfaceOSystem::getPixel(Graphics::Surface *surface, int x, int y) {
+ warning("BaseSurfaceOSystem::GetPixel - Not ported yet");
int bpp = surface->format.bytesPerPixel;
/* Here p is the address to the pixel we want to retrieve */
uint8 *p = (uint8 *)surface->pixels + y * surface->pitch + x * bpp;
@@ -273,10 +273,10 @@ uint32 CBSurfaceOSystem::getPixel(Graphics::Surface *surface, int x, int y) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::create(int width, int height) {
- warning("CBSurfaceOSystem::Create not ported yet"); //TODO
+bool BaseSurfaceOSystem::create(int width, int height) {
+ warning("BaseSurfaceOSystem::Create not ported yet"); //TODO
#if 0
- CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_gameRef->_renderer);
+ BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
_texture = SDL_CreateTexture(renderer->GetSdlRenderer(), SDL_PIXELFORMAT_ARGB8888, SDL_TEXTUREACCESS_STREAMING, Width, Height);
#endif
_width = width;
@@ -290,10 +290,10 @@ bool CBSurfaceOSystem::create(int width, int height) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::createFromSDLSurface(Graphics::Surface *surface) {
- warning("CBSurfaceOSystem::CreateFromSDLSurface not ported yet"); //TODO
+bool BaseSurfaceOSystem::createFromSDLSurface(Graphics::Surface *surface) {
+ warning("BaseSurfaceOSystem::CreateFromSDLSurface not ported yet"); //TODO
#if 0
- CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_gameRef->_renderer);
+ BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
_texture = SDL_CreateTextureFromSurface(renderer->GetSdlRenderer(), surface);
#endif
if (_surface) {
@@ -314,12 +314,12 @@ bool CBSurfaceOSystem::createFromSDLSurface(Graphics::Surface *surface) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::isTransparentAt(int x, int y) {
+bool BaseSurfaceOSystem::isTransparentAt(int x, int y) {
// This particular warning is rather messy, as this function is called a ton,
// thus we avoid printing it more than once.
static bool hasWarned = false;
if (!hasWarned) {
- warning("CBSurfaceOSystem::IsTransparentAt not ported yet");
+ warning("BaseSurfaceOSystem::IsTransparentAt not ported yet");
hasWarned = true;
}
#if 0
@@ -340,14 +340,14 @@ bool CBSurfaceOSystem::isTransparentAt(int x, int y) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::isTransparentAtLite(int x, int y) {
+bool BaseSurfaceOSystem::isTransparentAtLite(int x, int y) {
//if (!_lockPixels) return false;
// This particular warning is rather messy, as this function is called a ton,
// thus we avoid printing it more than once.
static bool hasWarned = false;
if (!hasWarned) {
- warning("CBSurfaceOSystem::IsTransparentAtLite not ported yet");
+ warning("BaseSurfaceOSystem::IsTransparentAtLite not ported yet");
hasWarned = true;
}
if (_surface->format.bytesPerPixel == 4) {
@@ -387,57 +387,57 @@ bool CBSurfaceOSystem::isTransparentAtLite(int x, int y) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::startPixelOp() {
+bool BaseSurfaceOSystem::startPixelOp() {
//SDL_LockTexture(_texture, NULL, &_lockPixels, &_lockPitch);
// Any pixel-op makes the caching useless:
- CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_gameRef->_renderer);
+ BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
renderer->invalidateTicketsFromSurface(this);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::endPixelOp() {
+bool BaseSurfaceOSystem::endPixelOp() {
//SDL_UnlockTexture(_texture);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::display(int x, int y, Rect32 rect, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+bool BaseSurfaceOSystem::display(int x, int y, Rect32 rect, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, 100, 100, 0xFFFFFFFF, true, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::displayTrans(int x, int y, Rect32 rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+bool BaseSurfaceOSystem::displayTrans(int x, int y, Rect32 rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, 100, 100, alpha, false, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::displayTransOffset(int x, int y, Rect32 rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
+bool BaseSurfaceOSystem::displayTransOffset(int x, int y, Rect32 rect, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
return drawSprite(x, y, &rect, 100, 100, alpha, false, blendMode, mirrorX, mirrorY, offsetX, offsetY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+bool BaseSurfaceOSystem::displayTransZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, zoomX, zoomY, alpha, false, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, bool Transparent, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+bool BaseSurfaceOSystem::displayZoom(int x, int y, Rect32 rect, float zoomX, float zoomY, uint32 alpha, bool Transparent, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, zoomX, zoomY, alpha, !Transparent, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::displayTransform(int x, int y, int hotX, int hotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
+bool BaseSurfaceOSystem::displayTransform(int x, int y, int hotX, int hotY, Rect32 rect, float zoomX, float zoomY, uint32 alpha, float rotate, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY) {
return drawSprite(x, y, &rect, zoomX, zoomY, alpha, false, blendMode, mirrorX, mirrorY);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, float zoomX, float zoomY, uint32 alpha, bool alphaDisable, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
- CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_gameRef->_renderer);
+bool BaseSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, float zoomX, float zoomY, uint32 alpha, bool alphaDisable, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX, int offsetY) {
+ BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
if (!_loaded) {
finishLoad();
@@ -450,7 +450,7 @@ bool CBSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, float zoomX, float
// thus we avoid printing it more than once.
static bool hasWarned = false;
if (!hasWarned) {
- warning("CBSurfaceOSystem::DrawSprite not fully ported yet"); // TODO.
+ warning("BaseSurfaceOSystem::DrawSprite not fully ported yet"); // TODO.
hasWarned = true;
}
@@ -508,7 +508,7 @@ bool CBSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, float zoomX, float
hasAlpha = false;
}
if (alphaDisable) {
- warning("CBSurfaceOSystem::drawSprite - AlphaDisable ignored");
+ warning("BaseSurfaceOSystem::drawSprite - AlphaDisable ignored");
}
renderer->drawSurface(this, _surface, &srcRect, &position, mirrorX, mirrorY);
@@ -519,11 +519,11 @@ bool CBSurfaceOSystem::drawSprite(int x, int y, Rect32 *rect, float zoomX, float
return STATUS_OK;
}
-bool CBSurfaceOSystem::putSurface(const Graphics::Surface &surface, bool hasAlpha) {
+bool BaseSurfaceOSystem::putSurface(const Graphics::Surface &surface, bool hasAlpha) {
_loaded = true;
_surface->copyFrom(surface);
_hasAlpha = hasAlpha;
- CBRenderOSystem *renderer = static_cast<CBRenderOSystem *>(_gameRef->_renderer);
+ BaseRenderOSystem *renderer = static_cast<BaseRenderOSystem *>(_gameRef->_renderer);
renderer->invalidateTicketsFromSurface(this);
return STATUS_OK;
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
index 091e8ccba8..bece031fe7 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
@@ -35,11 +35,11 @@
namespace WinterMute {
struct TransparentSurface;
-class CBImage;
-class CBSurfaceOSystem : public CBSurface {
+class BaseImage;
+class BaseSurfaceOSystem : public BaseSurface {
public:
- CBSurfaceOSystem(CBGame *inGame);
- ~CBSurfaceOSystem();
+ BaseSurfaceOSystem(BaseGame *inGame);
+ ~BaseSurfaceOSystem();
bool create(const char *filename, bool defaultCK, byte ckRed, byte ckGreen, byte ckBlue, int lifeTime = -1, bool keepLoaded = false);
bool create(int width, int height);
diff --git a/engines/wintermute/base/particles/part_emitter.cpp b/engines/wintermute/base/particles/part_emitter.cpp
index b3b05b6e65..212f11d2f6 100644
--- a/engines/wintermute/base/particles/part_emitter.cpp
+++ b/engines/wintermute/base/particles/part_emitter.cpp
@@ -43,13 +43,13 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CPartEmitter, false)
+IMPLEMENT_PERSISTENT(PartEmitter, false)
//////////////////////////////////////////////////////////////////////////
-CPartEmitter::CPartEmitter(CBGame *inGame, CBScriptHolder *Owner) : CBObject(inGame) {
+PartEmitter::PartEmitter(BaseGame *inGame, BaseScriptHolder *Owner) : BaseObject(inGame) {
_width = _height = 0;
- CBPlatform::setRectEmpty(&_border);
+ BasePlatform::setRectEmpty(&_border);
_borderThicknessLeft = _borderThicknessRight = _borderThicknessTop = _borderThicknessBottom = 0;
_angle1 = _angle2 = 0;
@@ -94,7 +94,7 @@ CPartEmitter::CPartEmitter(CBGame *inGame, CBScriptHolder *Owner) : CBObject(inG
//////////////////////////////////////////////////////////////////////////
-CPartEmitter::~CPartEmitter(void) {
+PartEmitter::~PartEmitter(void) {
for (int i = 0; i < _particles.getSize(); i++) {
delete _particles[i];
}
@@ -116,7 +116,7 @@ CPartEmitter::~CPartEmitter(void) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::addSprite(const char *filename) {
+bool PartEmitter::addSprite(const char *filename) {
if (!filename) return STATUS_FAILED;
// do we already have the file?
@@ -139,7 +139,7 @@ bool CPartEmitter::addSprite(const char *filename) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::removeSprite(const char *filename) {
+bool PartEmitter::removeSprite(const char *filename) {
for (int i = 0; i < _sprites.getSize(); i++) {
if (scumm_stricmp(filename, _sprites[i]) == 0) {
delete [] _sprites[i];
@@ -151,34 +151,34 @@ bool CPartEmitter::removeSprite(const char *filename) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::initParticle(CPartParticle *particle, uint32 currentTime, uint32 timerDelta) {
+bool PartEmitter::initParticle(PartParticle *particle, uint32 currentTime, uint32 timerDelta) {
if (!particle) return STATUS_FAILED;
if (_sprites.getSize() == 0) return STATUS_FAILED;
- int posX = CBUtils::randomInt(_posX, _posX + _width);
- int posY = CBUtils::randomInt(_posY, _posY + _height);
- float posZ = CBUtils::randomFloat(0.0f, 100.0f);
+ int posX = BaseUtils::randomInt(_posX, _posX + _width);
+ int posY = BaseUtils::randomInt(_posY, _posY + _height);
+ float posZ = BaseUtils::randomFloat(0.0f, 100.0f);
float velocity;
if (_velocityZBased) velocity = _velocity1 + posZ * (_velocity2 - _velocity1) / 100;
- else velocity = CBUtils::randomFloat(_velocity1, _velocity2);
+ else velocity = BaseUtils::randomFloat(_velocity1, _velocity2);
float scale;
if (_scaleZBased) scale = _scale1 + posZ * (_scale2 - _scale1) / 100;
- else scale = CBUtils::randomFloat(_scale1, _scale2);
+ else scale = BaseUtils::randomFloat(_scale1, _scale2);
int lifeTime;
if (_lifeTimeZBased) lifeTime = _lifeTime2 - posZ * (_lifeTime2 - _lifeTime1) / 100;
- else lifeTime = CBUtils::randomInt(_lifeTime1, _lifeTime2);
+ else lifeTime = BaseUtils::randomInt(_lifeTime1, _lifeTime2);
- float angle = CBUtils::randomAngle(_angle1, _angle2);
- int spriteIndex = CBUtils::randomInt(0, _sprites.getSize() - 1);
+ float angle = BaseUtils::randomAngle(_angle1, _angle2);
+ int spriteIndex = BaseUtils::randomInt(0, _sprites.getSize() - 1);
- float rotation = CBUtils::randomAngle(_rotation1, _rotation2);
- float angVelocity = CBUtils::randomFloat(_angVelocity1, _angVelocity2);
- float growthRate = CBUtils::randomFloat(_growthRate1, _growthRate2);
+ float rotation = BaseUtils::randomAngle(_rotation1, _rotation2);
+ float angVelocity = BaseUtils::randomFloat(_angVelocity1, _angVelocity2);
+ float growthRate = BaseUtils::randomFloat(_growthRate1, _growthRate2);
- if (!CBPlatform::isRectEmpty(&_border)) {
+ if (!BasePlatform::isRectEmpty(&_border)) {
int thicknessLeft = (int)(_borderThicknessLeft - (float)_borderThicknessLeft * posZ / 100.0f);
int thicknessRight = (int)(_borderThicknessRight - (float)_borderThicknessRight * posZ / 100.0f);
int thicknessTop = (int)(_borderThicknessTop - (float)_borderThicknessTop * posZ / 100.0f);
@@ -195,14 +195,14 @@ bool CPartEmitter::initParticle(CPartParticle *particle, uint32 currentTime, uin
Vector2 vecVel(0, velocity);
Matrix4 matRot;
- matRot.rotationZ(Common::deg2rad(CBUtils::normalizeAngle(angle - 180)));
+ matRot.rotationZ(Common::deg2rad(BaseUtils::normalizeAngle(angle - 180)));
matRot.transformVector2(vecVel);
if (_alphaTimeBased) {
particle->_alpha1 = _alpha1;
particle->_alpha2 = _alpha2;
} else {
- int alpha = CBUtils::randomInt(_alpha1, _alpha2);
+ int alpha = BaseUtils::randomInt(_alpha1, _alpha2);
particle->_alpha1 = alpha;
particle->_alpha2 = alpha;
}
@@ -226,13 +226,13 @@ bool CPartEmitter::initParticle(CPartParticle *particle, uint32 currentTime, uin
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::update() {
+bool PartEmitter::update() {
if (!_running) return STATUS_OK;
else return updateInternal(_gameRef->_timer, _gameRef->_timerDelta);
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
+bool PartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
int numLive = 0;
for (int i = 0; i < _particles.getSize(); i++) {
@@ -263,10 +263,10 @@ bool CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
}
}
- CPartParticle *particle;
+ PartParticle *particle;
if (firstDeadIndex >= 0) particle = _particles[firstDeadIndex];
else {
- particle = new CPartParticle(_gameRef);
+ particle = new PartParticle(_gameRef);
_particles.add(particle);
}
initParticle(particle, currentTime, timerDelta);
@@ -288,7 +288,7 @@ bool CPartEmitter::updateInternal(uint32 currentTime, uint32 timerDelta) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::display(CBRegion *region) {
+bool PartEmitter::display(BaseRegion *region) {
if (_sprites.getSize() <= 1) _gameRef->_renderer->startSpriteBatch();
for (int i = 0; i < _particles.getSize(); i++) {
@@ -305,7 +305,7 @@ bool CPartEmitter::display(CBRegion *region) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::start() {
+bool PartEmitter::start() {
for (int i = 0; i < _particles.getSize(); i++) {
_particles[i]->_isDead = true;
}
@@ -329,16 +329,16 @@ bool CPartEmitter::start() {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::sortParticlesByZ() {
+bool PartEmitter::sortParticlesByZ() {
// sort particles by _posY
- qsort(_particles.getData(), _particles.getSize(), sizeof(CPartParticle *), CPartEmitter::compareZ);
+ qsort(_particles.getData(), _particles.getSize(), sizeof(PartParticle *), PartEmitter::compareZ);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-int CPartEmitter::compareZ(const void *obj1, const void *obj2) {
- CPartParticle *p1 = *(CPartParticle **)obj1;
- CPartParticle *p2 = *(CPartParticle **)obj2;
+int PartEmitter::compareZ(const void *obj1, const void *obj2) {
+ PartParticle *p1 = *(PartParticle **)obj1;
+ PartParticle *p2 = *(PartParticle **)obj2;
if (p1->_posZ < p2->_posZ) return -1;
else if (p1->_posZ > p2->_posZ) return 1;
@@ -346,14 +346,14 @@ int CPartEmitter::compareZ(const void *obj1, const void *obj2) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::setBorder(int x, int y, int width, int height) {
- CBPlatform::setRect(&_border, x, y, x + width, y + height);
+bool PartEmitter::setBorder(int x, int y, int width, int height) {
+ BasePlatform::setRect(&_border, x, y, x + width, y + height);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::setBorderThickness(int thicknessLeft, int thicknessRight, int thicknessTop, int thicknessBottom) {
+bool PartEmitter::setBorderThickness(int thicknessLeft, int thicknessRight, int thicknessTop, int thicknessBottom) {
_borderThicknessLeft = thicknessLeft;
_borderThicknessRight = thicknessRight;
_borderThicknessTop = thicknessTop;
@@ -363,8 +363,8 @@ bool CPartEmitter::setBorderThickness(int thicknessLeft, int thicknessRight, int
}
//////////////////////////////////////////////////////////////////////////
-CPartForce *CPartEmitter::addForceByName(const char *name) {
- CPartForce *force = NULL;
+PartForce *PartEmitter::addForceByName(const char *name) {
+ PartForce *force = NULL;
for (int i = 0; i < _forces.getSize(); i++) {
if (scumm_stricmp(name, _forces[i]->_name) == 0) {
@@ -373,7 +373,7 @@ CPartForce *CPartEmitter::addForceByName(const char *name) {
}
}
if (!force) {
- force = new CPartForce(_gameRef);
+ force = new PartForce(_gameRef);
if (force) {
force->setName(name);
_forces.add(force);
@@ -384,8 +384,8 @@ CPartForce *CPartEmitter::addForceByName(const char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::addForce(const char *name, CPartForce::TForceType type, int posX, int posY, float angle, float strength) {
- CPartForce *force = addForceByName(name);
+bool PartEmitter::addForce(const char *name, PartForce::TForceType type, int posX, int posY, float angle, float strength) {
+ PartForce *force = addForceByName(name);
if (!force) return STATUS_FAILED;
force->_type = type;
@@ -393,14 +393,14 @@ bool CPartEmitter::addForce(const char *name, CPartForce::TForceType type, int p
force->_direction = Vector2(0, strength);
Matrix4 matRot;
- matRot.rotationZ(Common::deg2rad(CBUtils::normalizeAngle(angle - 180)));
+ matRot.rotationZ(Common::deg2rad(BaseUtils::normalizeAngle(angle - 180)));
matRot.transformVector2(force->_direction);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::removeForce(const char *name) {
+bool PartEmitter::removeForce(const char *name) {
for (int i = 0; i < _forces.getSize(); i++) {
if (scumm_stricmp(name, _forces[i]->_name) == 0) {
delete _forces[i];
@@ -415,7 +415,7 @@ bool CPartEmitter::removeForce(const char *name) {
//////////////////////////////////////////////////////////////////////////
// high level scripting interface
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool PartEmitter::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetBorder
//////////////////////////////////////////////////////////////////////////
@@ -524,7 +524,7 @@ bool CPartEmitter::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
float angle = stack->pop()->getFloat();
float strength = stack->pop()->getFloat();
- stack->pushBool(DID_SUCCEED(addForce(forceName, CPartForce::FORCE_GLOBAL, 0, 0, angle, strength)));
+ stack->pushBool(DID_SUCCEED(addForce(forceName, PartForce::FORCE_GLOBAL, 0, 0, angle, strength)));
return STATUS_OK;
}
@@ -540,7 +540,7 @@ bool CPartEmitter::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
float angle = stack->pop()->getFloat();
float strength = stack->pop()->getFloat();
- stack->pushBool(DID_SUCCEED(addForce(forceName, CPartForce::FORCE_GLOBAL, posX, posY, angle, strength)));
+ stack->pushBool(DID_SUCCEED(addForce(forceName, PartForce::FORCE_GLOBAL, posX, posY, angle, strength)));
return STATUS_OK;
}
@@ -557,11 +557,11 @@ bool CPartEmitter::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
return STATUS_OK;
}
- else return CBObject::scCallMethod(script, stack, thisStack, name);
+ else return BaseObject::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CPartEmitter::scGetProperty(const char *name) {
+ScValue *PartEmitter::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -828,12 +828,12 @@ CScValue *CPartEmitter::scGetProperty(const char *name) {
return _scValue;
}
- else return CBObject::scGetProperty(name);
+ else return BaseObject::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::scSetProperty(const char *name, CScValue *value) {
+bool PartEmitter::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// X
//////////////////////////////////////////////////////////////////////////
@@ -1081,16 +1081,16 @@ bool CPartEmitter::scSetProperty(const char *name, CScValue *value) {
else if (strcmp(name, "EmitEvent") == 0) {
delete[] _emitEvent;
_emitEvent = NULL;
- if (!value->isNULL()) CBUtils::setString(&_emitEvent, value->getString());
+ if (!value->isNULL()) BaseUtils::setString(&_emitEvent, value->getString());
return STATUS_OK;
}
- else return CBObject::scSetProperty(name, value);
+ else return BaseObject::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-const char *CPartEmitter::scToString() {
+const char *PartEmitter::scToString() {
return "[particle emitter]";
}
@@ -1098,8 +1098,8 @@ const char *CPartEmitter::scToString() {
//////////////////////////////////////////////////////////////////////////
-bool CPartEmitter::persist(CBPersistMgr *persistMgr) {
- CBObject::persist(persistMgr);
+bool PartEmitter::persist(BasePersistenceManager *persistMgr) {
+ BaseObject::persist(persistMgr);
persistMgr->transfer(TMEMBER(_width));
persistMgr->transfer(TMEMBER(_height));
@@ -1171,7 +1171,7 @@ bool CPartEmitter::persist(CBPersistMgr *persistMgr) {
} else {
persistMgr->transfer(TMEMBER(numForces));
for (int i = 0; i < numForces; i++) {
- CPartForce *force = new CPartForce(_gameRef);
+ PartForce *force = new PartForce(_gameRef);
force->persist(persistMgr);
_forces.add(force);
}
@@ -1187,7 +1187,7 @@ bool CPartEmitter::persist(CBPersistMgr *persistMgr) {
} else {
persistMgr->transfer(TMEMBER(numParticles));
for (int i = 0; i < numParticles; i++) {
- CPartParticle *particle = new CPartParticle(_gameRef);
+ PartParticle *particle = new PartParticle(_gameRef);
particle->persist(persistMgr);
_particles.add(particle);
}
diff --git a/engines/wintermute/base/particles/part_emitter.h b/engines/wintermute/base/particles/part_emitter.h
index cff0a1ec83..6575544db0 100644
--- a/engines/wintermute/base/particles/part_emitter.h
+++ b/engines/wintermute/base/particles/part_emitter.h
@@ -34,14 +34,14 @@
#include "engines/wintermute/base/particles/part_force.h"
namespace WinterMute {
-class CBRegion;
-class CPartParticle;
-class CPartEmitter : public CBObject {
+class BaseRegion;
+class PartParticle;
+class PartEmitter : public BaseObject {
public:
- DECLARE_PERSISTENT(CPartEmitter, CBObject)
+ DECLARE_PERSISTENT(PartEmitter, BaseObject)
- CPartEmitter(CBGame *inGame, CBScriptHolder *Owner);
- virtual ~CPartEmitter(void);
+ PartEmitter(BaseGame *inGame, BaseScriptHolder *Owner);
+ virtual ~PartEmitter(void);
int _width;
int _height;
@@ -98,13 +98,13 @@ public:
bool _useRegion;
char *_emitEvent;
- CBScriptHolder *_owner;
+ BaseScriptHolder *_owner;
bool start();
bool update();
bool display() { return display(NULL); } // To avoid shadowing the inherited display-function.
- bool display(CBRegion *region);
+ bool display(BaseRegion *region);
bool sortParticlesByZ();
bool addSprite(const char *filename);
@@ -112,26 +112,26 @@ public:
bool setBorder(int x, int y, int width, int height);
bool setBorderThickness(int thicknessLeft, int thicknessRight, int thicknessTop, int thicknessBottom);
- bool addForce(const char *name, CPartForce::TForceType type, int posX, int posY, float angle, float strength);
+ bool addForce(const char *name, PartForce::TForceType type, int posX, int posY, float angle, float strength);
bool removeForce(const char *name);
- CBArray<CPartForce *, CPartForce *> _forces;
+ BaseArray<PartForce *, PartForce *> _forces;
// scripting interface
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scSetProperty(const char *name, CScValue *value);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scSetProperty(const char *name, ScValue *value);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
virtual const char *scToString();
private:
- CPartForce *addForceByName(const char *name);
+ PartForce *addForceByName(const char *name);
int static compareZ(const void *obj1, const void *obj2);
- bool initParticle(CPartParticle *particle, uint32 currentTime, uint32 timerDelta);
+ bool initParticle(PartParticle *particle, uint32 currentTime, uint32 timerDelta);
bool updateInternal(uint32 currentTime, uint32 timerDelta);
uint32 _lastGenTime;
- CBArray<CPartParticle *, CPartParticle *> _particles;
- CBArray<char *, char *> _sprites;
+ BaseArray<PartParticle *, PartParticle *> _particles;
+ BaseArray<char *, char *> _sprites;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/particles/part_force.cpp b/engines/wintermute/base/particles/part_force.cpp
index 2f330c21b0..ba60e8b41c 100644
--- a/engines/wintermute/base/particles/part_force.cpp
+++ b/engines/wintermute/base/particles/part_force.cpp
@@ -34,7 +34,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CPartForce::CPartForce(CBGame *inGame) : CBNamedObject(inGame) {
+PartForce::PartForce(BaseGame *inGame) : BaseNamedObject(inGame) {
_pos = Vector2(0.0f, 0.0f);
_direction = Vector2(0.0f, 0.0f);
_type = FORCE_POINT;
@@ -42,12 +42,12 @@ CPartForce::CPartForce(CBGame *inGame) : CBNamedObject(inGame) {
//////////////////////////////////////////////////////////////////////////
-CPartForce::~CPartForce(void) {
+PartForce::~PartForce(void) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartForce::persist(CBPersistMgr *persistMgr) {
+bool PartForce::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_name));
persistMgr->transfer(TMEMBER(_pos));
persistMgr->transfer(TMEMBER(_direction));
diff --git a/engines/wintermute/base/particles/part_force.h b/engines/wintermute/base/particles/part_force.h
index f0a6d66c43..ec79ab7238 100644
--- a/engines/wintermute/base/particles/part_force.h
+++ b/engines/wintermute/base/particles/part_force.h
@@ -36,20 +36,20 @@
namespace WinterMute {
-class CPartForce : public CBNamedObject {
+class PartForce : public BaseNamedObject {
public:
enum TForceType {
FORCE_POINT, FORCE_GLOBAL
};
- CPartForce(CBGame *inGame);
- virtual ~CPartForce(void);
+ PartForce(BaseGame *inGame);
+ virtual ~PartForce(void);
Vector2 _pos;
Vector2 _direction;
TForceType _type;
- bool persist(CBPersistMgr *PersistMgr);
+ bool persist(BasePersistenceManager *PersistMgr);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/particles/part_particle.cpp b/engines/wintermute/base/particles/part_particle.cpp
index 931f7558c7..93b9f3659d 100644
--- a/engines/wintermute/base/particles/part_particle.cpp
+++ b/engines/wintermute/base/particles/part_particle.cpp
@@ -39,7 +39,7 @@
namespace WinterMute {
//////////////////////////////////////////////////////////////////////////
-CPartParticle::CPartParticle(CBGame *inGame) : CBBase(inGame) {
+PartParticle::PartParticle(BaseGame *inGame) : BaseClass(inGame) {
_pos = Vector2(0.0f, 0.0f);
_posZ = 0.0f;
_velocity = Vector2(0.0f, 0.0f);
@@ -48,7 +48,7 @@ CPartParticle::CPartParticle(CBGame *inGame) : CBBase(inGame) {
_creationTime = 0;
_lifeTime = 0;
_isDead = true;
- CBPlatform::setRectEmpty(&_border);
+ BasePlatform::setRectEmpty(&_border);
_state = PARTICLE_NORMAL;
_fadeStart = 0;
@@ -66,13 +66,13 @@ CPartParticle::CPartParticle(CBGame *inGame) : CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CPartParticle::~CPartParticle(void) {
+PartParticle::~PartParticle(void) {
delete _sprite;
_sprite = NULL;
}
//////////////////////////////////////////////////////////////////////////
-bool CPartParticle::setSprite(const char *filename) {
+bool PartParticle::setSprite(const char *filename) {
if (_sprite && _sprite->_filename && scumm_stricmp(filename, _sprite->_filename) == 0) {
_sprite->reset();
return STATUS_OK;
@@ -81,22 +81,22 @@ bool CPartParticle::setSprite(const char *filename) {
delete _sprite;
_sprite = NULL;
- CSysClassRegistry::getInstance()->_disabled = true;
- _sprite = new CBSprite(_gameRef, _gameRef);
+ SystemClassRegistry::getInstance()->_disabled = true;
+ _sprite = new BaseSprite(_gameRef, _gameRef);
if (_sprite && DID_SUCCEED(_sprite->loadFile(filename))) {
- CSysClassRegistry::getInstance()->_disabled = false;
+ SystemClassRegistry::getInstance()->_disabled = false;
return STATUS_OK;
} else {
delete _sprite;
_sprite = NULL;
- CSysClassRegistry::getInstance()->_disabled = false;
+ SystemClassRegistry::getInstance()->_disabled = false;
return STATUS_FAILED;
}
}
//////////////////////////////////////////////////////////////////////////
-bool CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32 timerDelta) {
+bool PartParticle::update(PartEmitter *emitter, uint32 currentTime, uint32 timerDelta) {
if (_state == PARTICLE_FADEIN) {
if (currentTime - _fadeStart >= (uint32)_fadeTime) {
_state = PARTICLE_NORMAL;
@@ -123,11 +123,11 @@ bool CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32 tim
}
// particle hit the border
- if (!_isDead && !CBPlatform::isRectEmpty(&_border)) {
+ if (!_isDead && !BasePlatform::isRectEmpty(&_border)) {
Point32 p;
p.x = (int32)_pos.x;
p.y = (int32)_pos.y;
- if (!CBPlatform::ptInRect(&_border, p))
+ if (!BasePlatform::ptInRect(&_border, p))
fadeOut(currentTime, emitter->_fadeOutTime);
}
if (_state != PARTICLE_NORMAL) return STATUS_OK;
@@ -144,13 +144,13 @@ bool CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32 tim
float elapsedTime = (float)timerDelta / 1000.f;
for (int i = 0; i < emitter->_forces.getSize(); i++) {
- CPartForce *force = emitter->_forces[i];
+ PartForce *force = emitter->_forces[i];
switch (force->_type) {
- case CPartForce::FORCE_GLOBAL:
+ case PartForce::FORCE_GLOBAL:
_velocity += force->_direction * elapsedTime;
break;
- case CPartForce::FORCE_POINT: {
+ case PartForce::FORCE_POINT: {
Vector2 vecDist = force->_pos - _pos;
float dist = fabs(vecDist.length());
@@ -165,7 +165,7 @@ bool CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32 tim
// update rotation
_rotation += _angVelocity * elapsedTime;
- _rotation = CBUtils::normalizeAngle(_rotation);
+ _rotation = BaseUtils::normalizeAngle(_rotation);
// update scale
if (_exponentialGrowth)
@@ -182,7 +182,7 @@ bool CPartParticle::update(CPartEmitter *emitter, uint32 currentTime, uint32 tim
}
//////////////////////////////////////////////////////////////////////////
-bool CPartParticle::display(CPartEmitter *emitter) {
+bool PartParticle::display(PartEmitter *emitter) {
if (!_sprite) return STATUS_FAILED;
if (_isDead) return STATUS_OK;
@@ -197,7 +197,7 @@ bool CPartParticle::display(CPartEmitter *emitter) {
//////////////////////////////////////////////////////////////////////////
-bool CPartParticle::fadeIn(uint32 currentTime, int fadeTime) {
+bool PartParticle::fadeIn(uint32 currentTime, int fadeTime) {
_currentAlpha = 0;
_fadeStart = currentTime;
_fadeTime = fadeTime;
@@ -207,7 +207,7 @@ bool CPartParticle::fadeIn(uint32 currentTime, int fadeTime) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartParticle::fadeOut(uint32 currentTime, int fadeTime) {
+bool PartParticle::fadeOut(uint32 currentTime, int fadeTime) {
//_currentAlpha = 255;
_fadeStartAlpha = _currentAlpha;
_fadeStart = currentTime;
@@ -218,7 +218,7 @@ bool CPartParticle::fadeOut(uint32 currentTime, int fadeTime) {
}
//////////////////////////////////////////////////////////////////////////
-bool CPartParticle::persist(CBPersistMgr *persistMgr) {
+bool PartParticle::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_alpha1));
persistMgr->transfer(TMEMBER(_alpha2));
persistMgr->transfer(TMEMBER(_border));
@@ -244,9 +244,9 @@ bool CPartParticle::persist(CBPersistMgr *persistMgr) {
} else {
char *filename;
persistMgr->transfer(TMEMBER(filename));
- CSysClassRegistry::getInstance()->_disabled = true;
+ SystemClassRegistry::getInstance()->_disabled = true;
setSprite(filename);
- CSysClassRegistry::getInstance()->_disabled = false;
+ SystemClassRegistry::getInstance()->_disabled = false;
delete[] filename;
filename = NULL;
}
diff --git a/engines/wintermute/base/particles/part_particle.h b/engines/wintermute/base/particles/part_particle.h
index 0b256d44ec..8b0c6eea36 100644
--- a/engines/wintermute/base/particles/part_particle.h
+++ b/engines/wintermute/base/particles/part_particle.h
@@ -36,18 +36,18 @@
namespace WinterMute {
-class CPartEmitter;
-class CBSprite;
-class CBPersistMgr;
+class PartEmitter;
+class BaseSprite;
+class BasePersistenceManager;
-class CPartParticle : public CBBase {
+class PartParticle : public BaseClass {
public:
enum TParticleState {
PARTICLE_NORMAL, PARTICLE_FADEIN, PARTICLE_FADEOUT
};
- CPartParticle(CBGame *inGame);
- virtual ~CPartParticle(void);
+ PartParticle(BaseGame *inGame);
+ virtual ~PartParticle(void);
float _growthRate;
bool _exponentialGrowth;
@@ -63,21 +63,21 @@ public:
float _posZ;
Vector2 _velocity;
float _scale;
- CBSprite *_sprite;
+ BaseSprite *_sprite;
uint32 _creationTime;
int _lifeTime;
bool _isDead;
TParticleState _state;
- bool update(CPartEmitter *emitter, uint32 currentTime, uint32 timerDelta);
- bool display(CPartEmitter *emitter);
+ bool update(PartEmitter *emitter, uint32 currentTime, uint32 timerDelta);
+ bool display(PartEmitter *emitter);
bool setSprite(const char *filename);
bool fadeIn(uint32 currentTime, int fadeTime);
bool fadeOut(uint32 currentTime, int fadeTime);
- bool persist(CBPersistMgr *PersistMgr);
+ bool persist(BasePersistenceManager *PersistMgr);
private:
uint32 _fadeStart;
int _fadeTime;
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp
index a9646e0045..45544831e3 100644
--- a/engines/wintermute/base/scriptables/script.cpp
+++ b/engines/wintermute/base/scriptables/script.cpp
@@ -36,10 +36,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CScScript, false)
+IMPLEMENT_PERSISTENT(ScScript, false)
//////////////////////////////////////////////////////////////////////////
-CScScript::CScScript(CBGame *inGame, CScEngine *Engine): CBBase(inGame) {
+ScScript::ScScript(BaseGame *inGame, ScEngine *Engine): BaseClass(inGame) {
_buffer = NULL;
_bufferSize = _iP = 0;
_scriptStream = NULL;
@@ -98,11 +98,11 @@ CScScript::CScScript(CBGame *inGame, CScEngine *Engine): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScScript::~CScScript() {
+ScScript::~ScScript() {
cleanup();
}
-void CScScript::readHeader() {
+void ScScript::readHeader() {
uint32 oldPos = _scriptStream->pos();
_scriptStream->seek(0);
_header.magic = _scriptStream->readUint32LE();
@@ -118,7 +118,7 @@ void CScScript::readHeader() {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::initScript() {
+bool ScScript::initScript() {
if (!_scriptStream) {
_scriptStream = new Common::MemoryReadStream(_buffer, _bufferSize);
}
@@ -139,13 +139,13 @@ bool CScScript::initScript() {
initTables();
// init stacks
- _scopeStack = new CScStack(_gameRef);
- _callStack = new CScStack(_gameRef);
- _thisStack = new CScStack(_gameRef);
- _stack = new CScStack(_gameRef);
+ _scopeStack = new ScStack(_gameRef);
+ _callStack = new ScStack(_gameRef);
+ _thisStack = new ScStack(_gameRef);
+ _stack = new ScStack(_gameRef);
- _operand = new CScValue(_gameRef);
- _reg1 = new CScValue(_gameRef);
+ _operand = new ScValue(_gameRef);
+ _reg1 = new ScValue(_gameRef);
// skip to the beginning
@@ -165,7 +165,7 @@ bool CScScript::initScript() {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::initTables() {
+bool ScScript::initTables() {
uint32 OrigIP = _iP;
readHeader();
@@ -240,7 +240,7 @@ bool CScScript::initTables() {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::create(const char *filename, byte *buffer, uint32 size, CBScriptHolder *owner) {
+bool ScScript::create(const char *filename, byte *buffer, uint32 size, BaseScriptHolder *owner) {
cleanup();
_thread = false;
@@ -263,7 +263,7 @@ bool CScScript::create(const char *filename, byte *buffer, uint32 size, CBScript
if (DID_FAIL(res)) return res;
// establish global variables table
- _globals = new CScValue(_gameRef);
+ _globals = new ScValue(_gameRef);
_owner = owner;
@@ -272,7 +272,7 @@ bool CScScript::create(const char *filename, byte *buffer, uint32 size, CBScript
//////////////////////////////////////////////////////////////////////////
-bool CScScript::createThread(CScScript *original, uint32 initIP, const char *eventName) {
+bool ScScript::createThread(ScScript *original, uint32 initIP, const char *eventName) {
cleanup();
_thread = true;
@@ -316,7 +316,7 @@ bool CScScript::createThread(CScScript *original, uint32 initIP, const char *eve
//////////////////////////////////////////////////////////////////////////
-bool CScScript::createMethodThread(CScScript *original, const char *methodName) {
+bool ScScript::createMethodThread(ScScript *original, const char *methodName) {
uint32 ip = original->getMethodPos(methodName);
if (ip == 0) return STATUS_FAILED;
@@ -360,7 +360,7 @@ bool CScScript::createMethodThread(CScScript *original, const char *methodName)
//////////////////////////////////////////////////////////////////////////
-void CScScript::cleanup() {
+void ScScript::cleanup() {
if (_buffer) delete [] _buffer;
_buffer = NULL;
@@ -430,7 +430,7 @@ void CScScript::cleanup() {
//////////////////////////////////////////////////////////////////////////
-uint32 CScScript::getDWORD() {
+uint32 ScScript::getDWORD() {
_scriptStream->seek((int32)_iP);
uint32 ret = _scriptStream->readUint32LE();
_iP += sizeof(uint32);
@@ -439,7 +439,7 @@ uint32 CScScript::getDWORD() {
}
//////////////////////////////////////////////////////////////////////////
-double CScScript::getFloat() {
+double ScScript::getFloat() {
_scriptStream->seek((int32)_iP);
byte buffer[8];
_scriptStream->read(buffer, 8);
@@ -459,7 +459,7 @@ double CScScript::getFloat() {
//////////////////////////////////////////////////////////////////////////
-char *CScScript::getString() {
+char *ScScript::getString() {
char *ret = (char *)(_buffer + _iP);
while (*(char *)(_buffer + _iP) != '\0') _iP++;
_iP++; // string terminator
@@ -470,17 +470,17 @@ char *CScScript::getString() {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::executeInstruction() {
+bool ScScript::executeInstruction() {
bool ret = STATUS_OK;
uint32 dw;
const char *str = NULL;
- //CScValue* op = new CScValue(_gameRef);
+ //ScValue* op = new ScValue(_gameRef);
_operand->cleanup();
- CScValue *op1;
- CScValue *op2;
+ ScValue *op1;
+ ScValue *op2;
uint32 inst = getDWORD();
switch (inst) {
@@ -557,7 +557,7 @@ bool CScScript::executeInstruction() {
char *MethodName = new char[strlen(str) + 1];
strcpy(MethodName, str);
- CScValue *var = _stack->pop();
+ ScValue *var = _stack->pop();
if (var->_type == VAL_VARIABLE_REF) var = var->_valRef;
bool res = STATUS_FAILED;
@@ -591,7 +591,7 @@ bool CScScript::executeInstruction() {
break;
}
/*
- CScValue* val = var->getProp(MethodName);
+ ScValue* val = var->getProp(MethodName);
if(val){
dw = GetFuncPos(val->getString());
if(dw==0){
@@ -660,7 +660,7 @@ bool CScScript::executeInstruction() {
break;
case II_PUSH_VAR: {
- CScValue *var = getVar(_symbols[getDWORD()]);
+ ScValue *var = getVar(_symbols[getDWORD()]);
if (false && /*var->_type==VAL_OBJECT ||*/ var->_type == VAL_NATIVE) {
_operand->setReference(var);
_stack->push(_operand);
@@ -669,7 +669,7 @@ bool CScScript::executeInstruction() {
}
case II_PUSH_VAR_REF: {
- CScValue *var = getVar(_symbols[getDWORD()]);
+ ScValue *var = getVar(_symbols[getDWORD()]);
_operand->setReference(var);
_stack->push(_operand);
break;
@@ -677,9 +677,9 @@ bool CScScript::executeInstruction() {
case II_POP_VAR: {
char *VarName = _symbols[getDWORD()];
- CScValue *var = getVar(VarName);
+ ScValue *var = getVar(VarName);
if (var) {
- CScValue *val = _stack->pop();
+ ScValue *val = _stack->pop();
if (!val) {
runtimeError("Script stack corruption detected. Please report this script at WME bug reports forum.");
var->setNULL();
@@ -740,7 +740,7 @@ bool CScScript::executeInstruction() {
case II_PUSH_BY_EXP: {
str = _stack->pop()->getString();
- CScValue *val = _stack->pop()->getProp(str);
+ ScValue *val = _stack->pop()->getProp(str);
if (val) _stack->push(val);
else _stack->pushNULL();
@@ -749,8 +749,8 @@ bool CScScript::executeInstruction() {
case II_POP_BY_EXP: {
str = _stack->pop()->getString();
- CScValue *var = _stack->pop();
- CScValue *val = _stack->pop();
+ ScValue *var = _stack->pop();
+ ScValue *val = _stack->pop();
if (val == NULL) {
runtimeError("Script stack corruption detected. Please report this script at WME bug reports forum.");
@@ -778,7 +778,7 @@ bool CScScript::executeInstruction() {
case II_JMP_FALSE: {
dw = getDWORD();
//if(!_stack->pop()->getBool()) _iP = dw;
- CScValue *val = _stack->pop();
+ ScValue *val = _stack->pop();
if (!val) {
runtimeError("Script corruption detected. Did you use '=' instead of '==' for comparison?");
} else {
@@ -916,7 +916,7 @@ bool CScScript::executeInstruction() {
}
*/
- _operand->setBool(CScValue::compare(op1, op2) == 0);
+ _operand->setBool(ScValue::compare(op1, op2) == 0);
_stack->push(_operand);
break;
@@ -940,7 +940,7 @@ bool CScScript::executeInstruction() {
}
*/
- _operand->setBool(CScValue::compare(op1, op2) != 0);
+ _operand->setBool(ScValue::compare(op1, op2) != 0);
_stack->push(_operand);
break;
@@ -955,7 +955,7 @@ bool CScScript::executeInstruction() {
else _operand->setBool(op1->getInt() < op2->getInt());
*/
- _operand->setBool(CScValue::compare(op1, op2) < 0);
+ _operand->setBool(ScValue::compare(op1, op2) < 0);
_stack->push(_operand);
break;
@@ -970,7 +970,7 @@ bool CScScript::executeInstruction() {
else _operand->setBool(op1->getInt() > op2->getInt());
*/
- _operand->setBool(CScValue::compare(op1, op2) > 0);
+ _operand->setBool(ScValue::compare(op1, op2) > 0);
_stack->push(_operand);
break;
@@ -985,7 +985,7 @@ bool CScScript::executeInstruction() {
else _operand->setBool(op1->getInt() <= op2->getInt());
*/
- _operand->setBool(CScValue::compare(op1, op2) <= 0);
+ _operand->setBool(ScValue::compare(op1, op2) <= 0);
_stack->push(_operand);
break;
@@ -1000,7 +1000,7 @@ bool CScScript::executeInstruction() {
else _operand->setBool(op1->getInt() >= op2->getInt());
*/
- _operand->setBool(CScValue::compare(op1, op2) >= 0);
+ _operand->setBool(ScValue::compare(op1, op2) >= 0);
_stack->push(_operand);
break;
@@ -1009,7 +1009,7 @@ bool CScScript::executeInstruction() {
op1 = _stack->pop();
//_operand->setBool(op1->getType()==op2->getType() && op1->getFloat()==op2->getFloat());
- _operand->setBool(CScValue::compareStrict(op1, op2) == 0);
+ _operand->setBool(ScValue::compareStrict(op1, op2) == 0);
_stack->push(_operand);
break;
@@ -1019,7 +1019,7 @@ bool CScScript::executeInstruction() {
op1 = _stack->pop();
//_operand->setBool(op1->getType()!=op2->getType() || op1->getFloat()!=op2->getFloat());
- _operand->setBool(CScValue::compareStrict(op1, op2) != 0);
+ _operand->setBool(ScValue::compareStrict(op1, op2) != 0);
_stack->push(_operand);
break;
@@ -1059,7 +1059,7 @@ bool CScScript::executeInstruction() {
//////////////////////////////////////////////////////////////////////////
-uint32 CScScript::getFuncPos(const char *name) {
+uint32 ScScript::getFuncPos(const char *name) {
for (uint32 i = 0; i < _numFunctions; i++) {
if (strcmp(name, _functions[i].name) == 0)
return _functions[i].pos;
@@ -1069,7 +1069,7 @@ uint32 CScScript::getFuncPos(const char *name) {
//////////////////////////////////////////////////////////////////////////
-uint32 CScScript::getMethodPos(const char *name) {
+uint32 ScScript::getMethodPos(const char *name) {
for (uint32 i = 0; i < _numMethods; i++) {
if (strcmp(name, _methods[i].name) == 0)
return _methods[i].pos;
@@ -1079,8 +1079,8 @@ uint32 CScScript::getMethodPos(const char *name) {
//////////////////////////////////////////////////////////////////////////
-CScValue *CScScript::getVar(char *name) {
- CScValue *ret = NULL;
+ScValue *ScScript::getVar(char *name) {
+ ScValue *ret = NULL;
// scope locals
if (_scopeStack->_sP >= 0) {
@@ -1103,8 +1103,8 @@ CScValue *CScScript::getVar(char *name) {
if (ret == NULL) {
//RuntimeError("Variable '%s' is inaccessible in the current block. Consider changing the script.", name);
_gameRef->LOG(0, "Warning: variable '%s' is inaccessible in the current block. Consider changing the script (script:%s, line:%d)", name, _filename, _currentLine);
- CScValue *val = new CScValue(_gameRef);
- CScValue *scope = _scopeStack->getTop();
+ ScValue *val = new ScValue(_gameRef);
+ ScValue *scope = _scopeStack->getTop();
if (scope) {
scope->setProp(name, val);
ret = _scopeStack->getTop()->getProp(name);
@@ -1120,7 +1120,7 @@ CScValue *CScScript::getVar(char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::waitFor(CBObject *object) {
+bool ScScript::waitFor(BaseObject *object) {
if (_unbreakable) {
runtimeError("Script cannot be interrupted.");
return STATUS_OK;
@@ -1133,14 +1133,14 @@ bool CScScript::waitFor(CBObject *object) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::waitForExclusive(CBObject *object) {
+bool ScScript::waitForExclusive(BaseObject *object) {
_engine->resetObject(object);
return waitFor(object);
}
//////////////////////////////////////////////////////////////////////////
-bool CScScript::sleep(uint32 duration) {
+bool ScScript::sleep(uint32 duration) {
if (_unbreakable) {
runtimeError("Script cannot be interrupted.");
return STATUS_OK;
@@ -1148,7 +1148,7 @@ bool CScScript::sleep(uint32 duration) {
_state = SCRIPT_SLEEPING;
if (_gameRef->_state == GAME_FROZEN) {
- _waitTime = CBPlatform::getTime() + duration;
+ _waitTime = BasePlatform::getTime() + duration;
_waitFrozen = true;
} else {
_waitTime = _gameRef->_timer + duration;
@@ -1159,7 +1159,7 @@ bool CScScript::sleep(uint32 duration) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::finish(bool includingThreads) {
+bool ScScript::finish(bool includingThreads) {
if (_state != SCRIPT_FINISHED && includingThreads) {
_state = SCRIPT_FINISHED;
finishThreads();
@@ -1171,14 +1171,14 @@ bool CScScript::finish(bool includingThreads) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::run() {
+bool ScScript::run() {
_state = SCRIPT_RUNNING;
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////
-void CScScript::runtimeError(const char *fmt, ...) {
+void ScScript::runtimeError(const char *fmt, ...) {
char buff[256];
va_list va;
@@ -1195,7 +1195,7 @@ void CScScript::runtimeError(const char *fmt, ...) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::persist(CBPersistMgr *persistMgr) {
+bool ScScript::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_gameRef));
@@ -1257,13 +1257,13 @@ bool CScScript::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-CScScript *CScScript::invokeEventHandler(const char *eventName, bool unbreakable) {
+ScScript *ScScript::invokeEventHandler(const char *eventName, bool unbreakable) {
//if(_state!=SCRIPT_PERSISTENT) return NULL;
uint32 pos = getEventPos(eventName);
if (!pos) return NULL;
- CScScript *thread = new CScScript(_gameRef, _engine);
+ ScScript *thread = new ScScript(_gameRef, _engine);
if (thread) {
bool ret = thread->createThread(this, pos, eventName);
if (DID_SUCCEED(ret)) {
@@ -1281,7 +1281,7 @@ CScScript *CScScript::invokeEventHandler(const char *eventName, bool unbreakable
//////////////////////////////////////////////////////////////////////////
-uint32 CScScript::getEventPos(const char *name) {
+uint32 ScScript::getEventPos(const char *name) {
for (int i = _numEvents - 1; i >= 0; i--) {
if (scumm_stricmp(name, _events[i].name) == 0) return _events[i].pos;
}
@@ -1290,19 +1290,19 @@ uint32 CScScript::getEventPos(const char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::canHandleEvent(const char *eventName) {
+bool ScScript::canHandleEvent(const char *eventName) {
return getEventPos(eventName) != 0;
}
//////////////////////////////////////////////////////////////////////////
-bool CScScript::canHandleMethod(const char *methodName) {
+bool ScScript::canHandleMethod(const char *methodName) {
return getMethodPos(methodName) != 0;
}
//////////////////////////////////////////////////////////////////////////
-bool CScScript::pause() {
+bool ScScript::pause() {
if (_state == SCRIPT_PAUSED) {
_gameRef->LOG(0, "Attempting to pause a paused script ('%s', line %d)", _filename, _currentLine);
return STATUS_FAILED;
@@ -1318,7 +1318,7 @@ bool CScScript::pause() {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::resume() {
+bool ScScript::resume() {
if (_state != SCRIPT_PAUSED) return STATUS_OK;
_state = _origState;
@@ -1327,7 +1327,7 @@ bool CScScript::resume() {
//////////////////////////////////////////////////////////////////////////
-CScScript::TExternalFunction *CScScript::getExternal(char *name) {
+ScScript::TExternalFunction *ScScript::getExternal(char *name) {
for (uint32 i = 0; i < _numExternals; i++) {
if (strcmp(name, _externals[i].name) == 0)
return &_externals[i];
@@ -1337,7 +1337,7 @@ CScScript::TExternalFunction *CScScript::getExternal(char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::externalCall(CScStack *stack, CScStack *thisStack, CScScript::TExternalFunction *function) {
+bool ScScript::externalCall(ScStack *stack, ScStack *thisStack, ScScript::TExternalFunction *function) {
_gameRef->LOG(0, "External functions are not supported on this platform.");
stack->correctParams(0);
@@ -1347,7 +1347,7 @@ bool CScScript::externalCall(CScStack *stack, CScStack *thisStack, CScScript::TE
//////////////////////////////////////////////////////////////////////////
-bool CScScript::copyParameters(CScStack *stack) {
+bool ScScript::copyParameters(ScStack *stack) {
int i;
int NumParams = stack->pop()->getInt();
for (i = NumParams - 1; i >= 0; i--) {
@@ -1362,9 +1362,9 @@ bool CScScript::copyParameters(CScStack *stack) {
//////////////////////////////////////////////////////////////////////////
-bool CScScript::finishThreads() {
+bool ScScript::finishThreads() {
for (int i = 0; i < _engine->_scripts.getSize(); i++) {
- CScScript *scr = _engine->_scripts[i];
+ ScScript *scr = _engine->_scripts[i];
if (scr->_thread && scr->_state != SCRIPT_FINISHED && scr->_owner == _owner && scumm_stricmp(scr->_filename, _filename) == 0)
scr->finish(true);
}
@@ -1374,18 +1374,18 @@ bool CScScript::finishThreads() {
//////////////////////////////////////////////////////////////////////////
// IWmeDebugScript interface implementation
-int CScScript::dbgGetLine() {
+int ScScript::dbgGetLine() {
return _currentLine;
}
//////////////////////////////////////////////////////////////////////////
-const char *CScScript::dbgGetFilename() {
+const char *ScScript::dbgGetFilename() {
return _filename;
}
//////////////////////////////////////////////////////////////////////////
-bool CScScript::dbgSendScript(IWmeDebugClient *client) {
+bool ScScript::dbgSendScript(IWmeDebugClient *client) {
if (_methodThread) client->onScriptMethodThreadInit(this, _parentScript, _threadEvent);
else if (_thread) client->onScriptEventThreadInit(this, _parentScript, _threadEvent);
else client->onScriptInit(this);
@@ -1395,14 +1395,14 @@ bool CScScript::dbgSendScript(IWmeDebugClient *client) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScScript::dbgSendVariables(IWmeDebugClient *client) {
+bool ScScript::dbgSendVariables(IWmeDebugClient *client) {
// send script globals
_globals->dbgSendVariables(client, WME_DBGVAR_SCRIPT, this, 0);
// send scope variables
if (_scopeStack->_sP >= 0) {
for (int i = 0; i <= _scopeStack->_sP; i++) {
- // CScValue *Scope = _scopeStack->GetAt(i);
+ // ScValue *Scope = _scopeStack->GetAt(i);
//Scope->DbgSendVariables(Client, WME_DBGVAR_SCOPE, this, (unsigned int)Scope);
}
}
@@ -1411,35 +1411,35 @@ bool CScScript::dbgSendVariables(IWmeDebugClient *client) {
//////////////////////////////////////////////////////////////////////////
-TScriptState CScScript::dbgGetState() {
+TScriptState ScScript::dbgGetState() {
return _state;
}
//////////////////////////////////////////////////////////////////////////
-int CScScript::dbgGetNumBreakpoints() {
+int ScScript::dbgGetNumBreakpoints() {
return _breakpoints.getSize();
}
//////////////////////////////////////////////////////////////////////////
-int CScScript::dbgGetBreakpoint(int index) {
+int ScScript::dbgGetBreakpoint(int index) {
if (index >= 0 && index < _breakpoints.getSize()) return _breakpoints[index];
else return -1;
}
//////////////////////////////////////////////////////////////////////////
-bool CScScript::dbgSetTracingMode(bool isTracing) {
+bool ScScript::dbgSetTracingMode(bool isTracing) {
_tracingMode = isTracing;
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScScript::dbgGetTracingMode() {
+bool ScScript::dbgGetTracingMode() {
return _tracingMode;
}
//////////////////////////////////////////////////////////////////////////
-void CScScript::afterLoad() {
+void ScScript::afterLoad() {
if (_buffer == NULL) {
byte *buffer = _engine->getCompiledScript(_filename, &_bufferSize);
if (!buffer) {
diff --git a/engines/wintermute/base/scriptables/script.h b/engines/wintermute/base/scriptables/script.h
index 899e1f3098..3bb4bc48a7 100644
--- a/engines/wintermute/base/scriptables/script.h
+++ b/engines/wintermute/base/scriptables/script.h
@@ -37,50 +37,50 @@
#include "engines/wintermute/wme_debugger.h"
namespace WinterMute {
-class CBScriptHolder;
-class CBObject;
-class CScEngine;
-class CScStack;
-class CScScript : public CBBase, public IWmeDebugScript {
+class BaseScriptHolder;
+class BaseObject;
+class ScEngine;
+class ScStack;
+class ScScript : public BaseClass, public IWmeDebugScript {
public:
bool dbgSendScript(IWmeDebugClient *client);
bool dbgSendVariables(IWmeDebugClient *client);
- CBArray<int, int> _breakpoints;
+ BaseArray<int, int> _breakpoints;
bool _tracingMode;
- CScScript *_parentScript;
+ ScScript *_parentScript;
bool _unbreakable;
bool finishThreads();
- bool copyParameters(CScStack *stack);
+ bool copyParameters(ScStack *stack);
void afterLoad();
- CScValue *_operand;
- CScValue *_reg1;
+ ScValue *_operand;
+ ScValue *_reg1;
bool _freezable;
bool resume();
bool pause();
bool canHandleEvent(const char *eventName);
bool canHandleMethod(const char *methodName);
- bool createThread(CScScript *original, uint32 initIP, const char *eventName);
- bool createMethodThread(CScScript *original, const char *methodName);
- CScScript *invokeEventHandler(const char *eventName, bool unbreakable = false);
+ bool createThread(ScScript *original, uint32 initIP, const char *eventName);
+ bool createMethodThread(ScScript *original, const char *methodName);
+ ScScript *invokeEventHandler(const char *eventName, bool unbreakable = false);
uint32 _timeSlice;
- DECLARE_PERSISTENT(CScScript, CBBase)
+ DECLARE_PERSISTENT(ScScript, BaseClass)
void runtimeError(const char *fmt, ...);
bool run();
bool finish(bool includingThreads = false);
bool sleep(uint32 duration);
- bool waitForExclusive(CBObject *object);
- bool waitFor(CBObject *object);
+ bool waitForExclusive(BaseObject *object);
+ bool waitFor(BaseObject *object);
uint32 _waitTime;
bool _waitFrozen;
- CBObject *_waitObject;
- CScScript *_waitScript;
+ BaseObject *_waitObject;
+ ScScript *_waitScript;
TScriptState _state;
TScriptState _origState;
- CScValue *getVar(char *name);
+ ScValue *getVar(char *name);
uint32 getFuncPos(const char *name);
uint32 getEventPos(const char *name);
uint32 getMethodPos(const char *name);
@@ -122,19 +122,19 @@ public:
} TExternalFunction;
- CScStack *_callStack;
- CScStack *_thisStack;
- CScStack *_scopeStack;
- CScStack *_stack;
- CScValue *_globals;
- CScEngine *_engine;
+ ScStack *_callStack;
+ ScStack *_thisStack;
+ ScStack *_scopeStack;
+ ScStack *_stack;
+ ScValue *_globals;
+ ScEngine *_engine;
int _currentLine;
bool executeInstruction();
char *getString();
uint32 getDWORD();
double getFloat();
void cleanup();
- bool create(const char *filename, byte *buffer, uint32 size, CBScriptHolder *owner);
+ bool create(const char *filename, byte *buffer, uint32 size, BaseScriptHolder *owner);
uint32 _iP;
private:
void readHeader();
@@ -142,8 +142,8 @@ private:
byte *_buffer;
public:
Common::SeekableReadStream *_scriptStream;
- CScScript(CBGame *inGame, CScEngine *Engine);
- virtual ~CScScript();
+ ScScript(BaseGame *inGame, ScEngine *Engine);
+ virtual ~ScScript();
char *_filename;
char **_symbols;
uint32 _numSymbols;
@@ -158,9 +158,9 @@ public:
bool _thread;
bool _methodThread;
char *_threadEvent;
- CBScriptHolder *_owner;
- CScScript::TExternalFunction *getExternal(char *name);
- bool externalCall(CScStack *stack, CScStack *thisStack, CScScript::TExternalFunction *function);
+ BaseScriptHolder *_owner;
+ ScScript::TExternalFunction *getExternal(char *name);
+ bool externalCall(ScStack *stack, ScStack *thisStack, ScScript::TExternalFunction *function);
private:
bool initScript();
bool initTables();
diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp
index 387093ac4a..44add054c5 100644
--- a/engines/wintermute/base/scriptables/script_engine.cpp
+++ b/engines/wintermute/base/scriptables/script_engine.cpp
@@ -41,29 +41,29 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CScEngine, true)
+IMPLEMENT_PERSISTENT(ScEngine, true)
#define COMPILER_DLL "dcscomp.dll"
//////////////////////////////////////////////////////////////////////////
-CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
+ScEngine::ScEngine(BaseGame *inGame): BaseClass(inGame) {
_gameRef->LOG(0, "Initializing scripting engine...");
if (_compilerAvailable) _gameRef->LOG(0, " Script compiler bound successfuly");
else _gameRef->LOG(0, " Script compiler is NOT available");
- _globals = new CScValue(_gameRef);
+ _globals = new ScValue(_gameRef);
// register 'Game' as global variable
if (!_globals->propExists("Game")) {
- CScValue val(_gameRef);
+ ScValue val(_gameRef);
val.setNative(_gameRef, true);
_globals->setProp("Game", &val);
}
// register 'Math' as global variable
if (!_globals->propExists("Math")) {
- CScValue val(_gameRef);
+ ScValue val(_gameRef);
val.setNative(_gameRef->_mathClass, true);
_globals->setProp("Math", &val);
}
@@ -81,7 +81,7 @@ CScEngine::CScEngine(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScEngine::~CScEngine() {
+ScEngine::~ScEngine() {
_gameRef->LOG(0, "Shutting down scripting engine");
saveBreakpoints();
@@ -98,7 +98,7 @@ CScEngine::~CScEngine() {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::cleanup() {
+bool ScEngine::cleanup() {
for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_thread && _scripts[i]->_owner) _scripts[i]->_owner->removeScript(_scripts[i]);
delete _scripts[i];
@@ -120,25 +120,25 @@ bool CScEngine::cleanup() {
//////////////////////////////////////////////////////////////////////////
-byte *CScEngine::loadFile(void *data, char *filename, uint32 *size) {
- CBGame *gameRef = (CBGame *)data;
+byte *ScEngine::loadFile(void *data, char *filename, uint32 *size) {
+ BaseGame *gameRef = (BaseGame *)data;
return gameRef->_fileManager->readWholeFile(filename, size);
}
//////////////////////////////////////////////////////////////////////////
-void CScEngine::closeFile(void *data, byte *buffer) {
+void ScEngine::closeFile(void *data, byte *buffer) {
delete [] buffer;
}
//////////////////////////////////////////////////////////////////////////
-void CScEngine::parseElement(void *data, int line, int type, void *elementData) {
+void ScEngine::parseElement(void *data, int line, int type, void *elementData) {
}
//////////////////////////////////////////////////////////////////////////
-CScScript *CScEngine::runScript(const char *filename, CBScriptHolder *owner) {
+ScScript *ScEngine::runScript(const char *filename, BaseScriptHolder *owner) {
byte *compBuffer;
uint32 compSize;
@@ -147,7 +147,7 @@ CScScript *CScEngine::runScript(const char *filename, CBScriptHolder *owner) {
if (!compBuffer) return NULL;
// add new script
- CScScript *script = new CScScript(_gameRef, this);
+ ScScript *script = new ScScript(_gameRef, this);
bool ret = script->create(filename, compBuffer, compSize, owner);
if (DID_FAIL(ret)) {
_gameRef->LOG(ret, "Error running script '%s'...", filename);
@@ -155,7 +155,7 @@ CScScript *CScEngine::runScript(const char *filename, CBScriptHolder *owner) {
return NULL;
} else {
// publish the "self" pseudo-variable
- CScValue val(_gameRef);
+ ScValue val(_gameRef);
if (owner)val.setNative(owner, true);
else val.setNULL();
@@ -171,12 +171,12 @@ CScScript *CScEngine::runScript(const char *filename, CBScriptHolder *owner) {
//////////////////////////////////////////////////////////////////////////
-byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool ignoreCache) {
+byte *ScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool ignoreCache) {
// is script in cache?
if (!ignoreCache) {
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] && scumm_stricmp(_cachedScripts[i]->_filename.c_str(), filename) == 0) {
- _cachedScripts[i]->_timestamp = CBPlatform::getTime();
+ _cachedScripts[i]->_timestamp = BasePlatform::getTime();
*outSize = _cachedScripts[i]->_size;
return _cachedScripts[i]->_buffer;
}
@@ -191,7 +191,7 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
byte *buffer = _gameRef->_fileManager->readWholeFile(filename, &size);
if (!buffer) {
- _gameRef->LOG(0, "CScEngine::GetCompiledScript - error opening script '%s'", filename);
+ _gameRef->LOG(0, "ScEngine::GetCompiledScript - error opening script '%s'", filename);
return NULL;
}
@@ -201,7 +201,7 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
compSize = size;
} else {
if (!_compilerAvailable) {
- _gameRef->LOG(0, "CScEngine::GetCompiledScript - script '%s' needs to be compiled but compiler is not available", filename);
+ _gameRef->LOG(0, "ScEngine::GetCompiledScript - script '%s' needs to be compiled but compiler is not available", filename);
delete [] buffer;
return NULL;
}
@@ -216,7 +216,7 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
CScCachedScript *cachedScript = new CScCachedScript(filename, compBuffer, compSize);
if (cachedScript) {
int index = 0;
- uint32 MinTime = CBPlatform::getTime();
+ uint32 MinTime = BasePlatform::getTime();
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] == NULL) {
index = i;
@@ -244,7 +244,7 @@ byte *CScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool i
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::tick() {
+bool ScEngine::tick() {
if (_scripts.getSize() == 0)
return STATUS_OK;
@@ -275,7 +275,7 @@ bool CScEngine::tick() {
case SCRIPT_SLEEPING: {
if (_scripts[i]->_waitFrozen) {
- if (_scripts[i]->_waitTime <= CBPlatform::getTime()) _scripts[i]->run();
+ if (_scripts[i]->_waitTime <= BasePlatform::getTime()) _scripts[i]->run();
} else {
if (_scripts[i]->_waitTime <= _gameRef->_timer) _scripts[i]->run();
}
@@ -300,7 +300,7 @@ bool CScEngine::tick() {
break;
}
default:
- //warning("CScEngine::Tick - Unhandled enum");
+ //warning("ScEngine::Tick - Unhandled enum");
break;
} // switch
} // for each script
@@ -314,25 +314,25 @@ bool CScEngine::tick() {
// time sliced script
if (_scripts[i]->_timeSlice > 0) {
- uint32 StartTime = CBPlatform::getTime();
- while (_scripts[i]->_state == SCRIPT_RUNNING && CBPlatform::getTime() - StartTime < _scripts[i]->_timeSlice) {
+ uint32 StartTime = BasePlatform::getTime();
+ while (_scripts[i]->_state == SCRIPT_RUNNING && BasePlatform::getTime() - StartTime < _scripts[i]->_timeSlice) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
- if (_isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - StartTime);
+ if (_isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, BasePlatform::getTime() - StartTime);
}
// normal script
else {
uint32 startTime = 0;
bool isProfiling = _isProfiling;
- if (isProfiling) startTime = CBPlatform::getTime();
+ if (isProfiling) startTime = BasePlatform::getTime();
while (_scripts[i]->_state == SCRIPT_RUNNING) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
- if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, CBPlatform::getTime() - startTime);
+ if (isProfiling && _scripts[i]->_filename) addScriptTime(_scripts[i]->_filename, BasePlatform::getTime() - startTime);
}
_currentScript = NULL;
}
@@ -344,7 +344,7 @@ bool CScEngine::tick() {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::tickUnbreakable() {
+bool ScEngine::tickUnbreakable() {
// execute unbreakable scripts
for (int i = 0; i < _scripts.getSize(); i++) {
if (!_scripts[i]->_unbreakable) continue;
@@ -363,7 +363,7 @@ bool CScEngine::tickUnbreakable() {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::removeFinishedScripts() {
+bool ScEngine::removeFinishedScripts() {
// remove finished scripts
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_state == SCRIPT_FINISHED || _scripts[i]->_state == SCRIPT_ERROR) {
@@ -379,7 +379,7 @@ bool CScEngine::removeFinishedScripts() {
//////////////////////////////////////////////////////////////////////////
-int CScEngine::getNumScripts(int *running, int *waiting, int *persistent) {
+int ScEngine::getNumScripts(int *running, int *waiting, int *persistent) {
int numRunning = 0, numWaiting = 0, numPersistent = 0, numTotal = 0;
for (int i = 0; i < _scripts.getSize(); i++) {
@@ -397,7 +397,7 @@ int CScEngine::getNumScripts(int *running, int *waiting, int *persistent) {
numPersistent++;
break;
default:
- warning("CScEngine::GetNumScripts - unhandled enum");
+ warning("ScEngine::GetNumScripts - unhandled enum");
break;
}
numTotal++;
@@ -411,7 +411,7 @@ int CScEngine::getNumScripts(int *running, int *waiting, int *persistent) {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::emptyScriptCache() {
+bool ScEngine::emptyScriptCache() {
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i]) {
delete _cachedScripts[i];
@@ -423,7 +423,7 @@ bool CScEngine::emptyScriptCache() {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::resetObject(CBObject *Object) {
+bool ScEngine::resetObject(BaseObject *Object) {
// terminate all scripts waiting for this object
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_state == SCRIPT_WAITING && _scripts[i]->_waitObject == Object) {
@@ -437,7 +437,7 @@ bool CScEngine::resetObject(CBObject *Object) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::resetScript(CScScript *script) {
+bool ScEngine::resetScript(ScScript *script) {
// terminate all scripts waiting for this script
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_state == SCRIPT_WAITING_SCRIPT && _scripts[i]->_waitScript == script) {
@@ -448,7 +448,7 @@ bool CScEngine::resetScript(CScScript *script) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::persist(CBPersistMgr *persistMgr) {
+bool ScEngine::persist(BasePersistenceManager *persistMgr) {
if (!persistMgr->_saving) cleanup();
persistMgr->transfer(TMEMBER(_gameRef));
@@ -461,7 +461,7 @@ bool CScEngine::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-void CScEngine::editorCleanup() {
+void ScEngine::editorCleanup() {
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i]->_owner == NULL && (_scripts[i]->_state == SCRIPT_FINISHED || _scripts[i]->_state == SCRIPT_ERROR)) {
delete _scripts[i];
@@ -473,7 +473,7 @@ void CScEngine::editorCleanup() {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::pauseAll() {
+bool ScEngine::pauseAll() {
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i] != _currentScript) _scripts[i]->pause();
}
@@ -483,7 +483,7 @@ bool CScEngine::pauseAll() {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::resumeAll() {
+bool ScEngine::resumeAll() {
for (int i = 0; i < _scripts.getSize(); i++)
_scripts[i]->resume();
@@ -492,7 +492,7 @@ bool CScEngine::resumeAll() {
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::isValidScript(CScScript *script) {
+bool ScEngine::isValidScript(ScScript *script) {
for (int i = 0; i < _scripts.getSize(); i++) {
if (_scripts[i] == script) return true;
}
@@ -500,13 +500,13 @@ bool CScEngine::isValidScript(CScScript *script) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::clearGlobals(bool includingNatives) {
+bool ScEngine::clearGlobals(bool includingNatives) {
_globals->CleanProps(includingNatives);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::dbgSendScripts(IWmeDebugClient *client) {
+bool ScEngine::dbgSendScripts(IWmeDebugClient *client) {
// send global variables
_globals->dbgSendVariables(client, WME_DBGVAR_GLOBAL, NULL, 0);
@@ -526,7 +526,7 @@ bool CScEngine::dbgSendScripts(IWmeDebugClient *client) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::addBreakpoint(const char *scriptFilename, int line) {
+bool ScEngine::addBreakpoint(const char *scriptFilename, int line) {
if (!_gameRef->getDebugMgr()->_enabled) return STATUS_OK;
CScBreakpoint *bp = NULL;
@@ -553,7 +553,7 @@ bool CScEngine::addBreakpoint(const char *scriptFilename, int line) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::removeBreakpoint(const char *scriptFilename, int line) {
+bool ScEngine::removeBreakpoint(const char *scriptFilename, int line) {
if (!_gameRef->getDebugMgr()->_enabled) return STATUS_OK;
for (int i = 0; i < _breakpoints.getSize(); i++) {
@@ -578,7 +578,7 @@ bool CScEngine::removeBreakpoint(const char *scriptFilename, int line) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::refreshScriptBreakpoints() {
+bool ScEngine::refreshScriptBreakpoints() {
if (!_gameRef->getDebugMgr()->_enabled) return STATUS_OK;
for (int i = 0; i < _scripts.getSize(); i++) {
@@ -588,7 +588,7 @@ bool CScEngine::refreshScriptBreakpoints() {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::refreshScriptBreakpoints(CScScript *script) {
+bool ScEngine::refreshScriptBreakpoints(ScScript *script) {
if (!_gameRef->getDebugMgr()->_enabled) return STATUS_OK;
if (!script || !script->_filename) return STATUS_FAILED;
@@ -605,7 +605,7 @@ bool CScEngine::refreshScriptBreakpoints(CScScript *script) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::saveBreakpoints() {
+bool ScEngine::saveBreakpoints() {
if (!_gameRef->getDebugMgr()->_enabled) return STATUS_OK;
@@ -628,7 +628,7 @@ bool CScEngine::saveBreakpoints() {
}
//////////////////////////////////////////////////////////////////////////
-bool CScEngine::loadBreakpoints() {
+bool ScEngine::loadBreakpoints() {
if (!_gameRef->getDebugMgr()->_enabled) return STATUS_OK;
char key[100];
@@ -639,8 +639,8 @@ bool CScEngine::loadBreakpoints() {
sprintf(key, "Breakpoint%d", i);
AnsiString breakpoint = _gameRef->_registry->readString("Debug", key, "");
- char *path = CBUtils::strEntry(0, breakpoint.c_str(), ':');
- char *line = CBUtils::strEntry(1, breakpoint.c_str(), ':');
+ char *path = BaseUtils::strEntry(0, breakpoint.c_str(), ':');
+ char *line = BaseUtils::strEntry(1, breakpoint.c_str(), ':');
if (path != NULL && line != NULL) addBreakpoint(path, atoi(line));
delete[] path;
@@ -654,7 +654,7 @@ bool CScEngine::loadBreakpoints() {
//////////////////////////////////////////////////////////////////////////
-void CScEngine::addScriptTime(const char *filename, uint32 time) {
+void ScEngine::addScriptTime(const char *filename, uint32 time) {
if (!_isProfiling) return;
AnsiString fileName = filename;
@@ -664,19 +664,19 @@ void CScEngine::addScriptTime(const char *filename, uint32 time) {
//////////////////////////////////////////////////////////////////////////
-void CScEngine::enableProfiling() {
+void ScEngine::enableProfiling() {
if (_isProfiling) return;
// destroy old data, if any
_scriptTimes.clear();
- _profilingStartTime = CBPlatform::getTime();
+ _profilingStartTime = BasePlatform::getTime();
_isProfiling = true;
}
//////////////////////////////////////////////////////////////////////////
-void CScEngine::disableProfiling() {
+void ScEngine::disableProfiling() {
if (!_isProfiling) return;
dumpStats();
@@ -685,9 +685,9 @@ void CScEngine::disableProfiling() {
//////////////////////////////////////////////////////////////////////////
-void CScEngine::dumpStats() {
+void ScEngine::dumpStats() {
error("DumpStats not ported to ScummVM yet");
- /* uint32 totalTime = CBPlatform::getTime() - _profilingStartTime;
+ /* uint32 totalTime = BasePlatform::getTime() - _profilingStartTime;
typedef std::vector <std::pair<uint32, std::string> > TimeVector;
TimeVector times;
diff --git a/engines/wintermute/base/scriptables/script_engine.h b/engines/wintermute/base/scriptables/script_engine.h
index 81dc13a73c..06d61b4156 100644
--- a/engines/wintermute/base/scriptables/script_engine.h
+++ b/engines/wintermute/base/scriptables/script_engine.h
@@ -39,16 +39,16 @@
namespace WinterMute {
#define MAX_CACHED_SCRIPTS 20
-class CScScript;
-class CScValue;
-class CBObject;
-class CBScriptHolder;
-class CScEngine : public CBBase {
+class ScScript;
+class ScValue;
+class BaseObject;
+class BaseScriptHolder;
+class ScEngine : public BaseClass {
public:
class CScCachedScript {
public:
CScCachedScript(const char *filename, byte *buffer, uint32 size) {
- _timestamp = CBPlatform::getTime();
+ _timestamp = BasePlatform::getTime();
_buffer = new byte[size];
if (_buffer) memcpy(_buffer, buffer, size);
_size = size;
@@ -76,7 +76,7 @@ public:
}
Common::String _filename;
- CBArray<int, int> _lines;
+ BaseArray<int, int> _lines;
};
@@ -85,42 +85,42 @@ public:
public:
bool dbgSendScripts(IWmeDebugClient *client);
- CBArray<CScBreakpoint *, CScBreakpoint *> _breakpoints;
+ BaseArray<CScBreakpoint *, CScBreakpoint *> _breakpoints;
bool addBreakpoint(const char *scriptFilename, int line);
bool removeBreakpoint(const char *scriptFilename, int line);
bool refreshScriptBreakpoints();
- bool refreshScriptBreakpoints(CScScript *script);
+ bool refreshScriptBreakpoints(ScScript *script);
bool saveBreakpoints();
bool loadBreakpoints();
bool clearGlobals(bool includingNatives = false);
bool tickUnbreakable();
bool removeFinishedScripts();
- bool isValidScript(CScScript *script);
+ bool isValidScript(ScScript *script);
- CScScript *_currentScript;
+ ScScript *_currentScript;
bool resumeAll();
bool pauseAll();
void editorCleanup();
- bool resetObject(CBObject *Object);
- bool resetScript(CScScript *script);
+ bool resetObject(BaseObject *Object);
+ bool resetScript(ScScript *script);
bool emptyScriptCache();
byte *getCompiledScript(const char *filename, uint32 *outSize, bool ignoreCache = false);
- DECLARE_PERSISTENT(CScEngine, CBBase)
+ DECLARE_PERSISTENT(ScEngine, BaseClass)
bool cleanup();
int getNumScripts(int *running = NULL, int *waiting = NULL, int *persistent = NULL);
bool tick();
- CScValue *_globals;
- CScScript *runScript(const char *filename, CBScriptHolder *owner = NULL);
+ ScValue *_globals;
+ ScScript *runScript(const char *filename, BaseScriptHolder *owner = NULL);
static const bool _compilerAvailable = false;
- CScEngine(CBGame *inGame);
- virtual ~CScEngine();
+ ScEngine(BaseGame *inGame);
+ virtual ~ScEngine();
static byte *loadFile(void *data, char *filename, uint32 *size);
static void closeFile(void *data, byte *buffer);
static void parseElement(void *data, int line, int type, void *elementData);
- CBArray<CScScript *, CScScript *> _scripts;
+ BaseArray<ScScript *, ScScript *> _scripts;
void enableProfiling();
void disableProfiling();
diff --git a/engines/wintermute/base/scriptables/script_ext_array.cpp b/engines/wintermute/base/scriptables/script_ext_array.cpp
index a1b8249cb1..41059b2d80 100644
--- a/engines/wintermute/base/scriptables/script_ext_array.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_array.cpp
@@ -34,16 +34,16 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CSXArray, false)
+IMPLEMENT_PERSISTENT(SXArray, false)
-CBScriptable *makeSXArray(CBGame *inGame, CScStack *stack) {
- return new CSXArray(inGame, stack);
+BaseScriptable *makeSXArray(BaseGame *inGame, ScStack *stack) {
+ return new SXArray(inGame, stack);
}
//////////////////////////////////////////////////////////////////////////
-CSXArray::CSXArray(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+SXArray::SXArray(BaseGame *inGame, ScStack *stack): BaseScriptable(inGame) {
_length = 0;
- _values = new CScValue(_gameRef);
+ _values = new ScValue(_gameRef);
int numParams = stack->pop()->getInt(0);
@@ -59,27 +59,27 @@ CSXArray::CSXArray(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CSXArray::CSXArray(CBGame *inGame): CBScriptable(inGame) {
+SXArray::SXArray(BaseGame *inGame): BaseScriptable(inGame) {
_length = 0;
- _values = new CScValue(_gameRef);
+ _values = new ScValue(_gameRef);
}
//////////////////////////////////////////////////////////////////////////
-CSXArray::~CSXArray() {
+SXArray::~SXArray() {
delete _values;
_values = NULL;
}
//////////////////////////////////////////////////////////////////////////
-const char *CSXArray::scToString() {
+const char *SXArray::scToString() {
static char dummy[32768]; // TODO: Get rid of static.
strcpy(dummy, "");
char propName[20];
for (int i = 0; i < _length; i++) {
sprintf(propName, "%d", i);
- CScValue *val = _values->getProp(propName);
+ ScValue *val = _values->getProp(propName);
if (val) {
if (strlen(dummy) + strlen(val->getString()) < 32768) {
strcat(dummy, val->getString());
@@ -93,7 +93,7 @@ const char *CSXArray::scToString() {
//////////////////////////////////////////////////////////////////////////
-bool CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool SXArray::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// Push
//////////////////////////////////////////////////////////////////////////
@@ -134,7 +134,7 @@ bool CSXArray::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSt
//////////////////////////////////////////////////////////////////////////
-CScValue *CSXArray::scGetProperty(const char *name) {
+ScValue *SXArray::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -166,7 +166,7 @@ CScValue *CSXArray::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CSXArray::scSetProperty(const char *name, CScValue *value) {
+bool SXArray::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Length
//////////////////////////////////////////////////////////////////////////
@@ -199,8 +199,8 @@ bool CSXArray::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
-bool CSXArray::persist(CBPersistMgr *persistMgr) {
- CBScriptable::persist(persistMgr);
+bool SXArray::persist(BasePersistenceManager *persistMgr) {
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_length));
persistMgr->transfer(TMEMBER(_values));
@@ -210,7 +210,7 @@ bool CSXArray::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-bool CSXArray::validNumber(const char *origStr, char *outStr) {
+bool SXArray::validNumber(const char *origStr, char *outStr) {
bool isNumber = true;
for (uint32 i = 0; i < strlen(origStr); i++) {
if (!(origStr[i] >= '0' && origStr[i] <= '9')) {
@@ -227,7 +227,7 @@ bool CSXArray::validNumber(const char *origStr, char *outStr) {
}
//////////////////////////////////////////////////////////////////////////
-bool CSXArray::push(CScValue *val) {
+bool SXArray::push(ScValue *val) {
char paramName[20];
_length++;
sprintf(paramName, "%d", _length - 1);
diff --git a/engines/wintermute/base/scriptables/script_ext_array.h b/engines/wintermute/base/scriptables/script_ext_array.h
index b873416572..3f8d703f85 100644
--- a/engines/wintermute/base/scriptables/script_ext_array.h
+++ b/engines/wintermute/base/scriptables/script_ext_array.h
@@ -33,20 +33,20 @@
namespace WinterMute {
-class CSXArray : public CBScriptable {
+class SXArray : public BaseScriptable {
public:
- bool push(CScValue *Val);
+ bool push(ScValue *Val);
bool validNumber(const char *origStr, char *outStr);
- DECLARE_PERSISTENT(CSXArray, CBScriptable)
- CSXArray(CBGame *inGame, CScStack *stack);
- CSXArray(CBGame *inGame);
- virtual ~CSXArray();
- CScValue *scGetProperty(const char *name);
- bool scSetProperty(const char *name, CScValue *value);
- bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ DECLARE_PERSISTENT(SXArray, BaseScriptable)
+ SXArray(BaseGame *inGame, ScStack *stack);
+ SXArray(BaseGame *inGame);
+ virtual ~SXArray();
+ ScValue *scGetProperty(const char *name);
+ bool scSetProperty(const char *name, ScValue *value);
+ bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
int _length;
- CScValue *_values;
+ ScValue *_values;
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/scriptables/script_ext_date.cpp b/engines/wintermute/base/scriptables/script_ext_date.cpp
index 211c0d34f0..322fb9bc5b 100644
--- a/engines/wintermute/base/scriptables/script_ext_date.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_date.cpp
@@ -32,19 +32,19 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CSXDate, false)
+IMPLEMENT_PERSISTENT(SXDate, false)
-CBScriptable *makeSXDate(CBGame *inGame, CScStack *stack) {
- return new CSXDate(inGame, stack);
+BaseScriptable *makeSXDate(BaseGame *inGame, ScStack *stack) {
+ return new SXDate(inGame, stack);
}
//////////////////////////////////////////////////////////////////////////
-CSXDate::CSXDate(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+SXDate::SXDate(BaseGame *inGame, ScStack *stack): BaseScriptable(inGame) {
stack->correctParams(6);
memset(&_tm, 0, sizeof(_tm));
- CScValue *valYear = stack->pop();
+ ScValue *valYear = stack->pop();
_tm.tm_year = valYear->getInt() - 1900;
_tm.tm_mon = stack->pop()->getInt() - 1;
_tm.tm_mday = stack->pop()->getInt();
@@ -59,12 +59,12 @@ CSXDate::CSXDate(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
//////////////////////////////////////////////////////////////////////////
-CSXDate::~CSXDate() {
+SXDate::~SXDate() {
}
//////////////////////////////////////////////////////////////////////////
-const char *CSXDate::scToString() {
+const char *SXDate::scToString() {
// TODO: Make this more stringy, and less ISO 8601-like
_strRep.format("%04d-%02d-%02d - %02d:%02d:%02d", _tm.tm_year, _tm.tm_mon, _tm.tm_mday, _tm.tm_hour, _tm.tm_min, _tm.tm_sec);
return _strRep.c_str();
@@ -75,7 +75,7 @@ const char *CSXDate::scToString() {
//////////////////////////////////////////////////////////////////////////
-bool CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool SXDate::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// GetYear
//////////////////////////////////////////////////////////////////////////
@@ -207,7 +207,7 @@ bool CSXDate::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
//////////////////////////////////////////////////////////////////////////
-CScValue *CSXDate::scGetProperty(const char *name) {
+ScValue *SXDate::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -223,7 +223,7 @@ CScValue *CSXDate::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CSXDate::scSetProperty(const char *name, CScValue *value) {
+bool SXDate::scSetProperty(const char *name, ScValue *value) {
/*
//////////////////////////////////////////////////////////////////////////
// Name
@@ -238,9 +238,9 @@ bool CSXDate::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
-bool CSXDate::persist(CBPersistMgr *persistMgr) {
+bool SXDate::persist(BasePersistenceManager *persistMgr) {
- CBScriptable::persist(persistMgr);
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_tm.tm_year));
persistMgr->transfer(TMEMBER(_tm.tm_mon));
persistMgr->transfer(TMEMBER(_tm.tm_mday));
@@ -251,9 +251,9 @@ bool CSXDate::persist(CBPersistMgr *persistMgr) {
}
//////////////////////////////////////////////////////////////////////////
-int CSXDate::scCompare(CBScriptable *Value) {
+int SXDate::scCompare(BaseScriptable *Value) {
TimeDate time1 = _tm;
- TimeDate time2 = ((CSXDate *)Value)->_tm;
+ TimeDate time2 = ((SXDate *)Value)->_tm;
if (time1.tm_year < time2.tm_year) {
return -1;
diff --git a/engines/wintermute/base/scriptables/script_ext_date.h b/engines/wintermute/base/scriptables/script_ext_date.h
index 82f6af1f1d..b2df4abe94 100644
--- a/engines/wintermute/base/scriptables/script_ext_date.h
+++ b/engines/wintermute/base/scriptables/script_ext_date.h
@@ -34,15 +34,15 @@
namespace WinterMute {
-class CSXDate : public CBScriptable {
+class SXDate : public BaseScriptable {
public:
- int scCompare(CBScriptable *Value);
- DECLARE_PERSISTENT(CSXDate, CBScriptable)
- CSXDate(CBGame *inGame, CScStack *Stack);
- virtual ~CSXDate();
- CScValue *scGetProperty(const char *name);
- bool scSetProperty(const char *name, CScValue *value);
- bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ int scCompare(BaseScriptable *Value);
+ DECLARE_PERSISTENT(SXDate, BaseScriptable)
+ SXDate(BaseGame *inGame, ScStack *Stack);
+ virtual ~SXDate();
+ ScValue *scGetProperty(const char *name);
+ bool scSetProperty(const char *name, ScValue *value);
+ bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
char *_string;
TimeDate _tm;
diff --git a/engines/wintermute/base/scriptables/script_ext_file.cpp b/engines/wintermute/base/scriptables/script_ext_file.cpp
index 58c0416b43..ffa362a938 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_file.cpp
@@ -42,19 +42,19 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CSXFile, false)
+IMPLEMENT_PERSISTENT(SXFile, false)
-CBScriptable *makeSXFile(CBGame *inGame, CScStack *stack) {
- return new CSXFile(inGame, stack);
+BaseScriptable *makeSXFile(BaseGame *inGame, ScStack *stack) {
+ return new SXFile(inGame, stack);
}
//////////////////////////////////////////////////////////////////////////
-CSXFile::CSXFile(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+SXFile::SXFile(BaseGame *inGame, ScStack *stack): BaseScriptable(inGame) {
stack->correctParams(1);
- CScValue *Val = stack->pop();
+ ScValue *Val = stack->pop();
_filename = NULL;
- if (!Val->isNULL()) CBUtils::setString(&_filename, Val->getString());
+ if (!Val->isNULL()) BaseUtils::setString(&_filename, Val->getString());
_readFile = NULL;
_writeFile = NULL;
@@ -65,12 +65,12 @@ CSXFile::CSXFile(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
//////////////////////////////////////////////////////////////////////////
-CSXFile::~CSXFile() {
+SXFile::~SXFile() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-void CSXFile::cleanup() {
+void SXFile::cleanup() {
delete[] _filename;
_filename = NULL;
close();
@@ -78,7 +78,7 @@ void CSXFile::cleanup() {
//////////////////////////////////////////////////////////////////////////
-void CSXFile::close() {
+void SXFile::close() {
if (_readFile) {
_gameRef->_fileManager->closeFile(_readFile);
_readFile = NULL;
@@ -93,14 +93,14 @@ void CSXFile::close() {
}
//////////////////////////////////////////////////////////////////////////
-const char *CSXFile::scToString() {
+const char *SXFile::scToString() {
if (_filename) return _filename;
else return "[file object]";
}
#define FILE_BUFFER_SIZE 32768
//////////////////////////////////////////////////////////////////////////
-bool CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool SXFile::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetFilename
//////////////////////////////////////////////////////////////////////////
@@ -108,7 +108,7 @@ bool CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
stack->correctParams(1);
const char *filename = stack->pop()->getString();
cleanup();
- CBUtils::setString(&_filename, filename);
+ BaseUtils::setString(&_filename, filename);
stack->pushNULL();
return STATUS_OK;
}
@@ -182,7 +182,7 @@ bool CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
else if (strcmp(name, "Delete") == 0) {
stack->correctParams(0);
close();
- stack->pushBool(CBPlatform::deleteFile(_filename) != false);
+ stack->pushBool(BasePlatform::deleteFile(_filename) != false);
return STATUS_OK;
}
@@ -195,7 +195,7 @@ bool CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
bool Overwrite = stack->pop()->getBool(true);
close();
- stack->pushBool(CBPlatform::copyFile(_filename, Dest, !Overwrite) != false);
+ stack->pushBool(BasePlatform::copyFile(_filename, Dest, !Overwrite) != false);
return STATUS_OK;
}
@@ -593,12 +593,12 @@ bool CSXFile::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
}
- else return CBScriptable::scCallMethod(script, stack, thisStack, name);
+ else return BaseScriptable::scCallMethod(script, stack, thisStack, name);
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CSXFile::scGetProperty(const char *name) {
+ScValue *SXFile::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -649,12 +649,12 @@ CScValue *CSXFile::scGetProperty(const char *name) {
return _scValue;
}
- else return CBScriptable::scGetProperty(name);
+ else return BaseScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CSXFile::scSetProperty(const char *name, CScValue *value) {
+bool SXFile::scSetProperty(const char *name, ScValue *value) {
/*
//////////////////////////////////////////////////////////////////////////
// Length
@@ -672,11 +672,11 @@ bool CSXFile::scSetProperty(const char *name, CScValue *value) {
}
return STATUS_OK;
}
- else*/ return CBScriptable::scSetProperty(name, value);
+ else*/ return BaseScriptable::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-uint32 CSXFile::getPos() {
+uint32 SXFile::getPos() {
if (_mode == 1 && _readFile)
return _readFile->pos();
else if ((_mode == 2 || _mode == 3) && _writeFile) {
@@ -689,11 +689,11 @@ uint32 CSXFile::getPos() {
}
//////////////////////////////////////////////////////////////////////////
-bool CSXFile::setPos(uint32 pos, int whence) {
+bool SXFile::setPos(uint32 pos, int whence) {
if (_mode == 1 && _readFile)
return _readFile->seek(pos, whence);
else if ((_mode == 2 || _mode == 3) && _writeFile) {
- error("CSXFile - seeking in WriteFile not supported");
+ error("SXFile - seeking in WriteFile not supported");
return false;
// return fseek((FILE *)_writeFile, pos, (int)origin) == 0;
}
@@ -701,11 +701,11 @@ bool CSXFile::setPos(uint32 pos, int whence) {
}
//////////////////////////////////////////////////////////////////////////
-uint32 CSXFile::getLength() {
+uint32 SXFile::getLength() {
if (_mode == 1 && _readFile)
return _readFile->size();
else if ((_mode == 2 || _mode == 3) && _writeFile) {
- error("CSXFile - reading length for WriteFile not supported");
+ error("SXFile - reading length for WriteFile not supported");
return 0;
/*
uint32 currentPos = ftell((FILE *)_writeFile);
@@ -717,9 +717,9 @@ uint32 CSXFile::getLength() {
}
//////////////////////////////////////////////////////////////////////////
-bool CSXFile::persist(CBPersistMgr *persistMgr) {
+bool SXFile::persist(BasePersistenceManager *persistMgr) {
- CBScriptable::persist(persistMgr);
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_filename));
persistMgr->transfer(TMEMBER(_mode));
@@ -767,12 +767,12 @@ bool CSXFile::persist(CBPersistMgr *persistMgr) {
}
// Should replace fopen(..., "wb+") and fopen(..., "w+")
-Common::WriteStream *CSXFile::openForWrite(const Common::String &filename, bool binary) {
+Common::WriteStream *SXFile::openForWrite(const Common::String &filename, bool binary) {
error("SXFile::openForWrite - WriteFiles not supported");
}
// Should replace fopen(..., "ab+") and fopen(..., "a+")
-Common::WriteStream *CSXFile::openForAppend(const Common::String &filename, bool binary) {
+Common::WriteStream *SXFile::openForAppend(const Common::String &filename, bool binary) {
error("SXFile::openForAppend - WriteFiles not supported");
}
diff --git a/engines/wintermute/base/scriptables/script_ext_file.h b/engines/wintermute/base/scriptables/script_ext_file.h
index 5a6811fe57..4d78feb044 100644
--- a/engines/wintermute/base/scriptables/script_ext_file.h
+++ b/engines/wintermute/base/scriptables/script_ext_file.h
@@ -35,17 +35,17 @@
namespace WinterMute {
-class CBFile;
+class BaseFile;
-class CSXFile : public CBScriptable {
+class SXFile : public BaseScriptable {
public:
- DECLARE_PERSISTENT(CSXFile, CBScriptable)
- CScValue *scGetProperty(const char *name);
- bool scSetProperty(const char *name, CScValue *value);
- bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ DECLARE_PERSISTENT(SXFile, BaseScriptable)
+ ScValue *scGetProperty(const char *name);
+ bool scSetProperty(const char *name, ScValue *value);
+ bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
- CSXFile(CBGame *inGame, CScStack *Stack);
- virtual ~CSXFile();
+ SXFile(BaseGame *inGame, ScStack *Stack);
+ virtual ~SXFile();
private:
Common::SeekableReadStream *_readFile;
Common::WriteStream *_writeFile;
diff --git a/engines/wintermute/base/scriptables/script_ext_math.cpp b/engines/wintermute/base/scriptables/script_ext_math.cpp
index 22b08087b7..1c37a15aa9 100644
--- a/engines/wintermute/base/scriptables/script_ext_math.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_math.cpp
@@ -40,26 +40,26 @@ namespace WinterMute {
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CSXMath, true)
+IMPLEMENT_PERSISTENT(SXMath, true)
-CBScriptable *makeSXMath(CBGame *inGame) {
- return new CSXMath(inGame);
+BaseScriptable *makeSXMath(BaseGame *inGame) {
+ return new SXMath(inGame);
}
//////////////////////////////////////////////////////////////////////////
-CSXMath::CSXMath(CBGame *inGame): CBScriptable(inGame) {
+SXMath::SXMath(BaseGame *inGame): BaseScriptable(inGame) {
}
//////////////////////////////////////////////////////////////////////////
-CSXMath::~CSXMath() {
+SXMath::~SXMath() {
}
//////////////////////////////////////////////////////////////////////////
-bool CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool SXMath::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// Abs
//////////////////////////////////////////////////////////////////////////
@@ -250,7 +250,7 @@ bool CSXMath::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisSta
//////////////////////////////////////////////////////////////////////////
-CScValue *CSXMath::scGetProperty(const char *name) {
+ScValue *SXMath::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -274,21 +274,21 @@ CScValue *CSXMath::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
-double CSXMath::degreeToRadian(double value) {
+double SXMath::degreeToRadian(double value) {
return value * (M_PI / 180.0f);
}
//////////////////////////////////////////////////////////////////////////
-double CSXMath::radianToDegree(double value) {
+double SXMath::radianToDegree(double value) {
return value * (180.0f / M_PI);
}
//////////////////////////////////////////////////////////////////////////
-bool CSXMath::persist(CBPersistMgr *persistMgr) {
+bool SXMath::persist(BasePersistenceManager *persistMgr) {
- CBScriptable::persist(persistMgr);
+ BaseScriptable::persist(persistMgr);
return STATUS_OK;
}
diff --git a/engines/wintermute/base/scriptables/script_ext_math.h b/engines/wintermute/base/scriptables/script_ext_math.h
index 422521233f..393342e5ca 100644
--- a/engines/wintermute/base/scriptables/script_ext_math.h
+++ b/engines/wintermute/base/scriptables/script_ext_math.h
@@ -34,13 +34,13 @@
namespace WinterMute {
-class CSXMath : public CBScriptable {
+class SXMath : public BaseScriptable {
public:
- DECLARE_PERSISTENT(CSXMath, CBScriptable)
- CSXMath(CBGame *inGame);
- virtual ~CSXMath();
- virtual CScValue *scGetProperty(const char *name);
- virtual bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ DECLARE_PERSISTENT(SXMath, BaseScriptable)
+ SXMath(BaseGame *inGame);
+ virtual ~SXMath();
+ virtual ScValue *scGetProperty(const char *name);
+ virtual bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
private:
double degreeToRadian(double value);
diff --git a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
index df2bf188ff..79ba978002 100644
--- a/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_mem_buffer.cpp
@@ -35,14 +35,14 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CSXMemBuffer, false)
+IMPLEMENT_PERSISTENT(SXMemBuffer, false)
-CBScriptable *makeSXMemBuffer(CBGame *inGame, CScStack *stack) {
- return new CSXMemBuffer(inGame, stack);
+BaseScriptable *makeSXMemBuffer(BaseGame *inGame, ScStack *stack) {
+ return new SXMemBuffer(inGame, stack);
}
//////////////////////////////////////////////////////////////////////////
-CSXMemBuffer::CSXMemBuffer(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+SXMemBuffer::SXMemBuffer(BaseGame *inGame, ScStack *stack): BaseScriptable(inGame) {
stack->correctParams(1);
_buffer = NULL;
_size = 0;
@@ -52,31 +52,31 @@ CSXMemBuffer::CSXMemBuffer(CBGame *inGame, CScStack *stack): CBScriptable(inGame
}
//////////////////////////////////////////////////////////////////////////
-CSXMemBuffer::CSXMemBuffer(CBGame *inGame, void *Buffer): CBScriptable(inGame) {
+SXMemBuffer::SXMemBuffer(BaseGame *inGame, void *Buffer): BaseScriptable(inGame) {
_size = 0;
_buffer = Buffer;
}
//////////////////////////////////////////////////////////////////////////
-CSXMemBuffer::~CSXMemBuffer() {
+SXMemBuffer::~SXMemBuffer() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-void *CSXMemBuffer::scToMemBuffer() {
+void *SXMemBuffer::scToMemBuffer() {
return _buffer;
}
//////////////////////////////////////////////////////////////////////////
-void CSXMemBuffer::cleanup() {
+void SXMemBuffer::cleanup() {
if (_size) free(_buffer);
_buffer = NULL;
_size = 0;
}
//////////////////////////////////////////////////////////////////////////
-bool CSXMemBuffer::resize(int newSize) {
+bool SXMemBuffer::resize(int newSize) {
int oldSize = _size;
if (_size == 0) {
@@ -102,7 +102,7 @@ bool CSXMemBuffer::resize(int newSize) {
}
//////////////////////////////////////////////////////////////////////////
-bool CSXMemBuffer::checkBounds(CScScript *script, int start, int length) {
+bool SXMemBuffer::checkBounds(ScScript *script, int start, int length) {
if (_buffer == NULL) {
script->runtimeError("Cannot use Set/Get methods on an uninitialized memory buffer");
return false;
@@ -118,13 +118,13 @@ bool CSXMemBuffer::checkBounds(CScScript *script, int start, int length) {
}
//////////////////////////////////////////////////////////////////////////
-const char *CSXMemBuffer::scToString() {
+const char *SXMemBuffer::scToString() {
return "[membuffer object]";
}
//////////////////////////////////////////////////////////////////////////
-bool CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool SXMemBuffer::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// SetSize
//////////////////////////////////////////////////////////////////////////
@@ -264,7 +264,7 @@ bool CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
stack->pushNULL();
else {
void *pointer = *(void **)((byte *)_buffer + start);
- CSXMemBuffer *buf = new CSXMemBuffer(_gameRef, pointer);
+ SXMemBuffer *buf = new SXMemBuffer(_gameRef, pointer);
stack->pushNative(buf, false);
}
return STATUS_OK;
@@ -395,7 +395,7 @@ bool CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
else if (strcmp(name, "SetPointer") == 0) {
stack->correctParams(2);
int start = stack->pop()->getInt();
- /* CScValue *Val = */ stack->pop();
+ /* ScValue *Val = */ stack->pop();
if (!checkBounds(script, start, sizeof(void *)))
stack->pushBool(false);
@@ -433,7 +433,7 @@ bool CSXMemBuffer::scCallMethod(CScScript *script, CScStack *stack, CScStack *th
//////////////////////////////////////////////////////////////////////////
-CScValue *CSXMemBuffer::scGetProperty(const char *name) {
+ScValue *SXMemBuffer::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -452,12 +452,12 @@ CScValue *CSXMemBuffer::scGetProperty(const char *name) {
return _scValue;
}
- else return CBScriptable::scGetProperty(name);
+ else return BaseScriptable::scGetProperty(name);
}
//////////////////////////////////////////////////////////////////////////
-bool CSXMemBuffer::scSetProperty(const char *name, CScValue *value) {
+bool SXMemBuffer::scSetProperty(const char *name, ScValue *value) {
/*
//////////////////////////////////////////////////////////////////////////
// Length
@@ -475,14 +475,14 @@ bool CSXMemBuffer::scSetProperty(const char *name, CScValue *value) {
}
return STATUS_OK;
}
- else*/ return CBScriptable::scSetProperty(name, value);
+ else*/ return BaseScriptable::scSetProperty(name, value);
}
//////////////////////////////////////////////////////////////////////////
-bool CSXMemBuffer::persist(CBPersistMgr *persistMgr) {
+bool SXMemBuffer::persist(BasePersistenceManager *persistMgr) {
- CBScriptable::persist(persistMgr);
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_size));
@@ -500,7 +500,7 @@ bool CSXMemBuffer::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-int CSXMemBuffer::scCompare(CBScriptable *val) {
+int SXMemBuffer::scCompare(BaseScriptable *val) {
if (_buffer == val->scToMemBuffer()) return 0;
else return 1;
}
diff --git a/engines/wintermute/base/scriptables/script_ext_mem_buffer.h b/engines/wintermute/base/scriptables/script_ext_mem_buffer.h
index a9d78e50e4..c325181e3f 100644
--- a/engines/wintermute/base/scriptables/script_ext_mem_buffer.h
+++ b/engines/wintermute/base/scriptables/script_ext_mem_buffer.h
@@ -34,24 +34,24 @@
namespace WinterMute {
-class CSXMemBuffer : public CBScriptable {
+class SXMemBuffer : public BaseScriptable {
public:
- virtual int scCompare(CBScriptable *Val);
- DECLARE_PERSISTENT(CSXMemBuffer, CBScriptable)
- CScValue *scGetProperty(const char *name);
- bool scSetProperty(const char *name, CScValue *value);
- bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual int scCompare(BaseScriptable *Val);
+ DECLARE_PERSISTENT(SXMemBuffer, BaseScriptable)
+ ScValue *scGetProperty(const char *name);
+ bool scSetProperty(const char *name, ScValue *value);
+ bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
const char *scToString();
- CSXMemBuffer(CBGame *inGame, CScStack *stack);
- CSXMemBuffer(CBGame *inGame, void *buffer);
- virtual ~CSXMemBuffer();
+ SXMemBuffer(BaseGame *inGame, ScStack *stack);
+ SXMemBuffer(BaseGame *inGame, void *buffer);
+ virtual ~SXMemBuffer();
virtual void *scToMemBuffer();
int _size;
private:
bool resize(int newSize);
void *_buffer;
void cleanup();
- bool checkBounds(CScScript *script, int start, int length);
+ bool checkBounds(ScScript *script, int start, int length);
};
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/scriptables/script_ext_object.cpp b/engines/wintermute/base/scriptables/script_ext_object.cpp
index cb0d32d1a3..b72e3e4b97 100644
--- a/engines/wintermute/base/scriptables/script_ext_object.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_object.cpp
@@ -36,14 +36,14 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CSXObject, false)
+IMPLEMENT_PERSISTENT(SXObject, false)
-CBScriptable *makeSXObject(CBGame *inGame, CScStack *stack) {
- return new CSXObject(inGame, stack);
+BaseScriptable *makeSXObject(BaseGame *inGame, ScStack *stack) {
+ return new SXObject(inGame, stack);
}
//////////////////////////////////////////////////////////////////////////
-CSXObject::CSXObject(CBGame *inGame, CScStack *stack): CBObject(inGame) {
+SXObject::SXObject(BaseGame *inGame, ScStack *stack): BaseObject(inGame) {
int numParams = stack->pop()->getInt(0);
for (int i = 0; i < numParams; i++) {
addScript(stack->pop()->getString());
@@ -52,14 +52,14 @@ CSXObject::CSXObject(CBGame *inGame, CScStack *stack): CBObject(inGame) {
//////////////////////////////////////////////////////////////////////////
-CSXObject::~CSXObject() {
+SXObject::~SXObject() {
}
//////////////////////////////////////////////////////////////////////////
-bool CSXObject::persist(CBPersistMgr *persistMgr) {
- CBObject::persist(persistMgr);
+bool SXObject::persist(BasePersistenceManager *persistMgr) {
+ BaseObject::persist(persistMgr);
return STATUS_OK;
}
diff --git a/engines/wintermute/base/scriptables/script_ext_object.h b/engines/wintermute/base/scriptables/script_ext_object.h
index b4e869d5b3..d744c58042 100644
--- a/engines/wintermute/base/scriptables/script_ext_object.h
+++ b/engines/wintermute/base/scriptables/script_ext_object.h
@@ -34,11 +34,11 @@
namespace WinterMute {
-class CSXObject : public CBObject {
+class SXObject : public BaseObject {
public:
- DECLARE_PERSISTENT(CSXObject, CBObject)
- CSXObject(CBGame *inGame, CScStack *Stack);
- virtual ~CSXObject();
+ DECLARE_PERSISTENT(SXObject, BaseObject)
+ SXObject(BaseGame *inGame, ScStack *Stack);
+ virtual ~SXObject();
};
diff --git a/engines/wintermute/base/scriptables/script_ext_string.cpp b/engines/wintermute/base/scriptables/script_ext_string.cpp
index bd7541fadd..e645772b6f 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.cpp
+++ b/engines/wintermute/base/scriptables/script_ext_string.cpp
@@ -37,19 +37,19 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CSXString, false)
+IMPLEMENT_PERSISTENT(SXString, false)
-CBScriptable *makeSXString(CBGame *inGame, CScStack *stack) {
- return new CSXString(inGame, stack);
+BaseScriptable *makeSXString(BaseGame *inGame, ScStack *stack) {
+ return new SXString(inGame, stack);
}
//////////////////////////////////////////////////////////////////////////
-CSXString::CSXString(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
+SXString::SXString(BaseGame *inGame, ScStack *stack): BaseScriptable(inGame) {
_string = NULL;
_capacity = 0;
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
if (val->isInt()) {
_capacity = MAX(0, val->getInt());
@@ -66,13 +66,13 @@ CSXString::CSXString(CBGame *inGame, CScStack *stack): CBScriptable(inGame) {
//////////////////////////////////////////////////////////////////////////
-CSXString::~CSXString() {
+SXString::~SXString() {
if (_string) delete [] _string;
}
//////////////////////////////////////////////////////////////////////////
-void CSXString::setStringVal(const char *val) {
+void SXString::setStringVal(const char *val) {
int len = strlen(val);
if (len >= _capacity) {
_capacity = len + 1;
@@ -86,20 +86,20 @@ void CSXString::setStringVal(const char *val) {
//////////////////////////////////////////////////////////////////////////
-const char *CSXString::scToString() {
+const char *SXString::scToString() {
if (_string) return _string;
else return "[null string]";
}
//////////////////////////////////////////////////////////////////////////
-void CSXString::scSetString(const char *val) {
+void SXString::scSetString(const char *val) {
setStringVal(val);
}
//////////////////////////////////////////////////////////////////////////
-bool CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name) {
+bool SXString::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name) {
//////////////////////////////////////////////////////////////////////////
// Substring
//////////////////////////////////////////////////////////////////////////
@@ -108,7 +108,7 @@ bool CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
int start = stack->pop()->getInt();
int end = stack->pop()->getInt();
- if (end < start) CBUtils::swap(&start, &end);
+ if (end < start) BaseUtils::swap(&start, &end);
//try {
WideString str;
@@ -138,7 +138,7 @@ bool CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
stack->correctParams(2);
int start = stack->pop()->getInt();
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
int len = val->getInt();
if (!val->isNULL() && len <= 0) {
@@ -245,11 +245,11 @@ bool CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "Split") == 0) {
stack->correctParams(1);
- CScValue *val = stack->pop();
+ ScValue *val = stack->pop();
char separators[MAX_PATH_LENGTH] = ",";
if (!val->isNULL()) strcpy(separators, val->getString());
- CSXArray *array = new CSXArray(_gameRef);
+ SXArray *array = new SXArray(_gameRef);
if (!array) {
stack->pushNULL();
return STATUS_OK;
@@ -299,9 +299,9 @@ bool CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
WideString &part = (*it);
if (_gameRef->_textEncoding == TEXT_UTF8)
- val = new CScValue(_gameRef, StringUtil::wideToUtf8(part).c_str());
+ val = new ScValue(_gameRef, StringUtil::wideToUtf8(part).c_str());
else
- val = new CScValue(_gameRef, StringUtil::wideToAnsi(part).c_str());
+ val = new ScValue(_gameRef, StringUtil::wideToAnsi(part).c_str());
array->push(val);
delete val;
@@ -317,7 +317,7 @@ bool CSXString::scCallMethod(CScScript *script, CScStack *stack, CScStack *thisS
//////////////////////////////////////////////////////////////////////////
-CScValue *CSXString::scGetProperty(const char *name) {
+ScValue *SXString::scGetProperty(const char *name) {
_scValue->setNULL();
//////////////////////////////////////////////////////////////////////////
@@ -352,7 +352,7 @@ CScValue *CSXString::scGetProperty(const char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CSXString::scSetProperty(const char *name, CScValue *value) {
+bool SXString::scSetProperty(const char *name, ScValue *value) {
//////////////////////////////////////////////////////////////////////////
// Capacity
//////////////////////////////////////////////////////////////////////////
@@ -377,9 +377,9 @@ bool CSXString::scSetProperty(const char *name, CScValue *value) {
//////////////////////////////////////////////////////////////////////////
-bool CSXString::persist(CBPersistMgr *persistMgr) {
+bool SXString::persist(BasePersistenceManager *persistMgr) {
- CBScriptable::persist(persistMgr);
+ BaseScriptable::persist(persistMgr);
persistMgr->transfer(TMEMBER(_capacity));
@@ -397,8 +397,8 @@ bool CSXString::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-int CSXString::scCompare(CBScriptable *val) {
- return strcmp(_string, ((CSXString *)val)->_string);
+int SXString::scCompare(BaseScriptable *val) {
+ return strcmp(_string, ((SXString *)val)->_string);
}
} // end of namespace WinterMute
diff --git a/engines/wintermute/base/scriptables/script_ext_string.h b/engines/wintermute/base/scriptables/script_ext_string.h
index 52a1524dde..9a3bbfc80b 100644
--- a/engines/wintermute/base/scriptables/script_ext_string.h
+++ b/engines/wintermute/base/scriptables/script_ext_string.h
@@ -34,19 +34,19 @@
namespace WinterMute {
-class CSXString : public CBScriptable {
+class SXString : public BaseScriptable {
public:
- virtual int scCompare(CBScriptable *Val);
- DECLARE_PERSISTENT(CSXString, CBScriptable)
- CScValue *scGetProperty(const char *name);
- bool scSetProperty(const char *name, CScValue *value);
- bool scCallMethod(CScScript *script, CScStack *stack, CScStack *thisStack, const char *name);
+ virtual int scCompare(BaseScriptable *Val);
+ DECLARE_PERSISTENT(SXString, BaseScriptable)
+ ScValue *scGetProperty(const char *name);
+ bool scSetProperty(const char *name, ScValue *value);
+ bool scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack, const char *name);
void scSetString(const char *val);
const char *scToString();
void setStringVal(const char *val);
- CSXString(CBGame *inGame, CScStack *Stack);
- virtual ~CSXString();
+ SXString(BaseGame *inGame, ScStack *Stack);
+ virtual ~SXString();
private:
char *_string;
diff --git a/engines/wintermute/base/scriptables/script_stack.cpp b/engines/wintermute/base/scriptables/script_stack.cpp
index 188cb2d15c..74cc7a57ee 100644
--- a/engines/wintermute/base/scriptables/script_stack.cpp
+++ b/engines/wintermute/base/scriptables/script_stack.cpp
@@ -32,16 +32,16 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CScStack, false)
+IMPLEMENT_PERSISTENT(ScStack, false)
//////////////////////////////////////////////////////////////////////////
-CScStack::CScStack(CBGame *inGame): CBBase(inGame) {
+ScStack::ScStack(BaseGame *inGame): BaseClass(inGame) {
_sP = -1;
}
//////////////////////////////////////////////////////////////////////////
-CScStack::~CScStack() {
+ScStack::~ScStack() {
#if _DEBUG
//_gameRef->LOG(0, "STAT: Stack size: %d, SP=%d", _values.getSize(), _sP);
@@ -55,7 +55,7 @@ CScStack::~CScStack() {
//////////////////////////////////////////////////////////////////////////
-CScValue *CScStack::pop() {
+ScValue *ScStack::pop() {
if (_sP < 0) {
_gameRef->LOG(0, "Fatal: Stack underflow");
return NULL;
@@ -66,14 +66,14 @@ CScValue *CScStack::pop() {
//////////////////////////////////////////////////////////////////////////
-void CScStack::push(CScValue *val) {
+void ScStack::push(ScValue *val) {
_sP++;
if (_sP < _values.getSize()) {
_values[_sP]->cleanup();
_values[_sP]->copy(val);
} else {
- CScValue *copyVal = new CScValue(_gameRef);
+ ScValue *copyVal = new ScValue(_gameRef);
copyVal->copy(val);
_values.add(copyVal);
}
@@ -81,11 +81,11 @@ void CScStack::push(CScValue *val) {
//////////////////////////////////////////////////////////////////////////
-CScValue *CScStack::getPushValue() {
+ScValue *ScStack::getPushValue() {
_sP++;
if (_sP >= _values.getSize()) {
- CScValue *val = new CScValue(_gameRef);
+ ScValue *val = new ScValue(_gameRef);
_values.add(val);
}
_values[_sP]->cleanup();
@@ -95,14 +95,14 @@ CScValue *CScStack::getPushValue() {
//////////////////////////////////////////////////////////////////////////
-CScValue *CScStack::getTop() {
+ScValue *ScStack::getTop() {
if (_sP < 0 || _sP >= _values.getSize()) return NULL;
else return _values[_sP];
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CScStack::getAt(int index) {
+ScValue *ScStack::getAt(int index) {
index = _sP - index;
if (index < 0 || index >= _values.getSize()) return NULL;
else return _values[index];
@@ -110,7 +110,7 @@ CScValue *CScStack::getAt(int index) {
//////////////////////////////////////////////////////////////////////////
-void CScStack::correctParams(uint32 expectedParams) {
+void ScStack::correctParams(uint32 expectedParams) {
uint32 nuParams = (uint32)pop()->getInt();
if (expectedParams < nuParams) { // too many params
@@ -124,7 +124,7 @@ void CScStack::correctParams(uint32 expectedParams) {
} else if (expectedParams > nuParams) { // need more params
while (expectedParams > nuParams) {
//Push(null_val);
- CScValue *nullVal = new CScValue(_gameRef);
+ ScValue *nullVal = new ScValue(_gameRef);
nullVal->setNULL();
_values.insertAt(_sP - nuParams + 1, nullVal);
nuParams++;
@@ -140,9 +140,9 @@ void CScStack::correctParams(uint32 expectedParams) {
//////////////////////////////////////////////////////////////////////////
-void CScStack::pushNULL() {
+void ScStack::pushNULL() {
/*
- CScValue* val = new CScValue(_gameRef);
+ ScValue* val = new ScValue(_gameRef);
val->setNULL();
Push(val);
delete val;
@@ -152,9 +152,9 @@ void CScStack::pushNULL() {
//////////////////////////////////////////////////////////////////////////
-void CScStack::pushInt(int val) {
+void ScStack::pushInt(int val) {
/*
- CScValue* val = new CScValue(_gameRef);
+ ScValue* val = new ScValue(_gameRef);
val->setInt(Val);
Push(val);
delete val;
@@ -164,9 +164,9 @@ void CScStack::pushInt(int val) {
//////////////////////////////////////////////////////////////////////////
-void CScStack::pushFloat(double val) {
+void ScStack::pushFloat(double val) {
/*
- CScValue* val = new CScValue(_gameRef);
+ ScValue* val = new ScValue(_gameRef);
val->setFloat(Val);
Push(val);
delete val;
@@ -176,9 +176,9 @@ void CScStack::pushFloat(double val) {
//////////////////////////////////////////////////////////////////////////
-void CScStack::pushBool(bool val) {
+void ScStack::pushBool(bool val) {
/*
- CScValue* val = new CScValue(_gameRef);
+ ScValue* val = new ScValue(_gameRef);
val->setBool(Val);
Push(val);
delete val;
@@ -188,9 +188,9 @@ void CScStack::pushBool(bool val) {
//////////////////////////////////////////////////////////////////////////
-void CScStack::pushString(const char *val) {
+void ScStack::pushString(const char *val) {
/*
- CScValue* val = new CScValue(_gameRef);
+ ScValue* val = new ScValue(_gameRef);
val->setString(Val);
Push(val);
delete val;
@@ -200,9 +200,9 @@ void CScStack::pushString(const char *val) {
//////////////////////////////////////////////////////////////////////////
-void CScStack::pushNative(CBScriptable *val, bool persistent) {
+void ScStack::pushNative(BaseScriptable *val, bool persistent) {
/*
- CScValue* val = new CScValue(_gameRef);
+ ScValue* val = new ScValue(_gameRef);
val->setNative(Val, Persistent);
Push(val);
delete val;
@@ -213,7 +213,7 @@ void CScStack::pushNative(CBScriptable *val, bool persistent) {
//////////////////////////////////////////////////////////////////////////
-bool CScStack::persist(CBPersistMgr *persistMgr) {
+bool ScStack::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_gameRef));
diff --git a/engines/wintermute/base/scriptables/script_stack.h b/engines/wintermute/base/scriptables/script_stack.h
index 6460f901fe..3aacad0765 100644
--- a/engines/wintermute/base/scriptables/script_stack.h
+++ b/engines/wintermute/base/scriptables/script_stack.h
@@ -36,27 +36,27 @@
namespace WinterMute {
-class CScValue;
-class CBScriptable;
+class ScValue;
+class BaseScriptable;
-class CScStack : public CBBase {
+class ScStack : public BaseClass {
public:
- CScValue *getAt(int Index);
- CScValue *getPushValue();
- DECLARE_PERSISTENT(CScStack, CBBase)
- void pushNative(CBScriptable *val, bool persistent);
+ ScValue *getAt(int Index);
+ ScValue *getPushValue();
+ DECLARE_PERSISTENT(ScStack, BaseClass)
+ void pushNative(BaseScriptable *val, bool persistent);
void pushString(const char *val);
void pushBool(bool val);
void pushInt(int val);
void pushFloat(double val);
void pushNULL();
void correctParams(uint32 expectedParams);
- CScValue *getTop();
- void push(CScValue *val);
- CScValue *pop();
- CScStack(CBGame *inGame);
- virtual ~CScStack();
- CBArray<CScValue *, CScValue *> _values;
+ ScValue *getTop();
+ void push(ScValue *val);
+ ScValue *pop();
+ ScStack(BaseGame *inGame);
+ virtual ~ScStack();
+ BaseArray<ScValue *, ScValue *> _values;
int _sP;
};
diff --git a/engines/wintermute/base/scriptables/script_value.cpp b/engines/wintermute/base/scriptables/script_value.cpp
index da47ed299f..0d8c34e719 100644
--- a/engines/wintermute/base/scriptables/script_value.cpp
+++ b/engines/wintermute/base/scriptables/script_value.cpp
@@ -40,10 +40,10 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-IMPLEMENT_PERSISTENT(CScValue, false)
+IMPLEMENT_PERSISTENT(ScValue, false)
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame): CBBase(inGame) {
+ScValue::ScValue(BaseGame *inGame): BaseClass(inGame) {
_type = VAL_NULL;
_valBool = false;
@@ -58,7 +58,7 @@ CScValue::CScValue(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, bool val): CBBase(inGame) {
+ScValue::ScValue(BaseGame *inGame, bool val): BaseClass(inGame) {
_type = VAL_BOOL;
_valBool = val;
@@ -73,7 +73,7 @@ CScValue::CScValue(CBGame *inGame, bool val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, int val): CBBase(inGame) {
+ScValue::ScValue(BaseGame *inGame, int val): BaseClass(inGame) {
_type = VAL_INT;
_valInt = val;
@@ -88,7 +88,7 @@ CScValue::CScValue(CBGame *inGame, int val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, double val): CBBase(inGame) {
+ScValue::ScValue(BaseGame *inGame, double val): BaseClass(inGame) {
_type = VAL_FLOAT;
_valFloat = val;
@@ -103,7 +103,7 @@ CScValue::CScValue(CBGame *inGame, double val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CScValue::CScValue(CBGame *inGame, const char *val): CBBase(inGame) {
+ScValue::ScValue(BaseGame *inGame, const char *val): BaseClass(inGame) {
_type = VAL_STRING;
_valString = NULL;
setStringVal(val);
@@ -119,7 +119,7 @@ CScValue::CScValue(CBGame *inGame, const char *val): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::cleanup(bool ignoreNatives) {
+void ScValue::cleanup(bool ignoreNatives) {
deleteProps();
if (_valString) delete [] _valString;
@@ -150,13 +150,13 @@ void CScValue::cleanup(bool ignoreNatives) {
//////////////////////////////////////////////////////////////////////////
-CScValue::~CScValue() {
+ScValue::~ScValue() {
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-CScValue *CScValue::getProp(const char *name) {
+ScValue *ScValue::getProp(const char *name) {
if (_type == VAL_VARIABLE_REF) return _valRef->getProp(name);
if (_type == VAL_STRING && strcmp(name, "Length") == 0) {
@@ -176,7 +176,7 @@ CScValue *CScValue::getProp(const char *name) {
return _gameRef->_scValue;
}
- CScValue *ret = NULL;
+ ScValue *ret = NULL;
if (_type == VAL_NATIVE && _valNative) ret = _valNative->scGetProperty(name);
@@ -188,7 +188,7 @@ CScValue *CScValue::getProp(const char *name) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::deleteProp(const char *name) {
+bool ScValue::deleteProp(const char *name) {
if (_type == VAL_VARIABLE_REF) return _valRef->deleteProp(name);
_valIter = _valObject.find(name);
@@ -203,7 +203,7 @@ bool CScValue::deleteProp(const char *name) {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::setProp(const char *name, CScValue *val, bool copyWhole, bool setAsConst) {
+bool ScValue::setProp(const char *name, ScValue *val, bool copyWhole, bool setAsConst) {
if (_type == VAL_VARIABLE_REF)
return _valRef->setProp(name, val);
@@ -213,14 +213,14 @@ bool CScValue::setProp(const char *name, CScValue *val, bool copyWhole, bool set
}
if (DID_FAIL(ret)) {
- CScValue *newVal = NULL;
+ ScValue *newVal = NULL;
_valIter = _valObject.find(name);
if (_valIter != _valObject.end()) {
newVal = _valIter->_value;
}
if (!newVal)
- newVal = new CScValue(_gameRef);
+ newVal = new ScValue(_gameRef);
else newVal->cleanup();
newVal->copy(val, copyWhole);
@@ -235,7 +235,7 @@ bool CScValue::setProp(const char *name, CScValue *val, bool copyWhole, bool set
delete _valIter->_value;
_valIter->_value = NULL;
}
- CScValue* val = new CScValue(_gameRef);
+ ScValue* val = new ScValue(_gameRef);
val->Copy(Val, CopyWhole);
val->_isConstVar = SetAsConst;
_valObject[Name] = val;
@@ -249,7 +249,7 @@ bool CScValue::setProp(const char *name, CScValue *val, bool copyWhole, bool set
//////////////////////////////////////////////////////////////////////////
-bool CScValue::propExists(const char *name) {
+bool ScValue::propExists(const char *name) {
if (_type == VAL_VARIABLE_REF)
return _valRef->propExists(name);
_valIter = _valObject.find(name);
@@ -259,10 +259,10 @@ bool CScValue::propExists(const char *name) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::deleteProps() {
+void ScValue::deleteProps() {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
- delete(CScValue *)_valIter->_value;
+ delete(ScValue *)_valIter->_value;
_valIter++;
}
_valObject.clear();
@@ -270,7 +270,7 @@ void CScValue::deleteProps() {
//////////////////////////////////////////////////////////////////////////
-void CScValue::CleanProps(bool includingNatives) {
+void ScValue::CleanProps(bool includingNatives) {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
if (!_valIter->_value->_isConstVar && (!_valIter->_value->isNative() || includingNatives)) _valIter->_value->setNULL();
@@ -279,7 +279,7 @@ void CScValue::CleanProps(bool includingNatives) {
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::isNULL() {
+bool ScValue::isNULL() {
if (_type == VAL_VARIABLE_REF)
return _valRef->isNULL();
@@ -288,7 +288,7 @@ bool CScValue::isNULL() {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::isNative() {
+bool ScValue::isNative() {
if (_type == VAL_VARIABLE_REF)
return _valRef->isNative();
@@ -297,7 +297,7 @@ bool CScValue::isNative() {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::isString() {
+bool ScValue::isString() {
if (_type == VAL_VARIABLE_REF)
return _valRef->isString();
@@ -306,7 +306,7 @@ bool CScValue::isString() {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::isFloat() {
+bool ScValue::isFloat() {
if (_type == VAL_VARIABLE_REF)
return _valRef->isFloat();
@@ -315,7 +315,7 @@ bool CScValue::isFloat() {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::isInt() {
+bool ScValue::isInt() {
if (_type == VAL_VARIABLE_REF)
return _valRef->isInt();
@@ -324,7 +324,7 @@ bool CScValue::isInt() {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::isBool() {
+bool ScValue::isBool() {
if (_type == VAL_VARIABLE_REF)
return _valRef->isBool();
@@ -333,7 +333,7 @@ bool CScValue::isBool() {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::isObject() {
+bool ScValue::isObject() {
if (_type == VAL_VARIABLE_REF)
return _valRef->isObject();
@@ -342,7 +342,7 @@ bool CScValue::isObject() {
//////////////////////////////////////////////////////////////////////////
-TValType CScValue::getTypeTolerant() {
+TValType ScValue::getTypeTolerant() {
if (_type == VAL_VARIABLE_REF)
return _valRef->getType();
@@ -351,7 +351,7 @@ TValType CScValue::getTypeTolerant() {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setBool(bool val) {
+void ScValue::setBool(bool val) {
if (_type == VAL_VARIABLE_REF) {
_valRef->setBool(val);
return;
@@ -368,7 +368,7 @@ void CScValue::setBool(bool val) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setInt(int val) {
+void ScValue::setInt(int val) {
if (_type == VAL_VARIABLE_REF) {
_valRef->setInt(val);
return;
@@ -385,7 +385,7 @@ void CScValue::setInt(int val) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setFloat(double val) {
+void ScValue::setFloat(double val) {
if (_type == VAL_VARIABLE_REF) {
_valRef->setFloat(val);
return;
@@ -402,7 +402,7 @@ void CScValue::setFloat(double val) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setString(const char *val) {
+void ScValue::setString(const char *val) {
if (_type == VAL_VARIABLE_REF) {
_valRef->setString(val);
return;
@@ -418,12 +418,12 @@ void CScValue::setString(const char *val) {
else _type = VAL_NULL;
}
-void CScValue::setString(const Common::String &val) {
+void ScValue::setString(const Common::String &val) {
setString(val.c_str());
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::setStringVal(const char *val) {
+void ScValue::setStringVal(const char *val) {
if (_valString) {
delete [] _valString;
_valString = NULL;
@@ -442,7 +442,7 @@ void CScValue::setStringVal(const char *val) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setNULL() {
+void ScValue::setNULL() {
if (_type == VAL_VARIABLE_REF) {
_valRef->setNULL();
return;
@@ -460,7 +460,7 @@ void CScValue::setNULL() {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setNative(CBScriptable *val, bool persistent) {
+void ScValue::setNative(BaseScriptable *val, bool persistent) {
if (_type == VAL_VARIABLE_REF) {
_valRef->setNative(val, persistent);
return;
@@ -487,7 +487,7 @@ void CScValue::setNative(CBScriptable *val, bool persistent) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setObject() {
+void ScValue::setObject() {
if (_type == VAL_VARIABLE_REF) {
_valRef->setObject();
return;
@@ -499,14 +499,14 @@ void CScValue::setObject() {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setReference(CScValue *val) {
+void ScValue::setReference(ScValue *val) {
_valRef = val;
_type = VAL_VARIABLE_REF;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::getBool(bool defaultVal) {
+bool ScValue::getBool(bool defaultVal) {
if (_type == VAL_VARIABLE_REF)
return _valRef->getBool();
@@ -533,7 +533,7 @@ bool CScValue::getBool(bool defaultVal) {
//////////////////////////////////////////////////////////////////////////
-int CScValue::getInt(int defaultVal) {
+int ScValue::getInt(int defaultVal) {
if (_type == VAL_VARIABLE_REF) return _valRef->getInt();
switch (_type) {
@@ -559,7 +559,7 @@ int CScValue::getInt(int defaultVal) {
//////////////////////////////////////////////////////////////////////////
-double CScValue::getFloat(double defaultVal) {
+double ScValue::getFloat(double defaultVal) {
if (_type == VAL_VARIABLE_REF)
return _valRef->getFloat();
@@ -585,7 +585,7 @@ double CScValue::getFloat(double defaultVal) {
}
//////////////////////////////////////////////////////////////////////////
-void *CScValue::getMemBuffer() {
+void *ScValue::getMemBuffer() {
if (_type == VAL_VARIABLE_REF)
return _valRef->getMemBuffer();
@@ -596,7 +596,7 @@ void *CScValue::getMemBuffer() {
//////////////////////////////////////////////////////////////////////////
-const char *CScValue::getString() {
+const char *ScValue::getString() {
if (_type == VAL_VARIABLE_REF)
return _valRef->getString();
@@ -646,7 +646,7 @@ const char *CScValue::getString() {
//////////////////////////////////////////////////////////////////////////
-CBScriptable *CScValue::getNative() {
+BaseScriptable *ScValue::getNative() {
if (_type == VAL_VARIABLE_REF)
return _valRef->getNative();
@@ -656,13 +656,13 @@ CBScriptable *CScValue::getNative() {
//////////////////////////////////////////////////////////////////////////
-TValType CScValue::getType() {
+TValType ScValue::getType() {
return _type;
}
//////////////////////////////////////////////////////////////////////////
-void CScValue::copy(CScValue *orig, bool copyWhole) {
+void ScValue::copy(ScValue *orig, bool copyWhole) {
_gameRef = orig->_gameRef;
if (_valNative && !_persistent) {
@@ -694,7 +694,7 @@ void CScValue::copy(CScValue *orig, bool copyWhole) {
if (orig->_type == VAL_OBJECT && orig->_valObject.size() > 0) {
orig->_valIter = orig->_valObject.begin();
while (orig->_valIter != orig->_valObject.end()) {
- _valObject[orig->_valIter->_key] = new CScValue(_gameRef);
+ _valObject[orig->_valIter->_key] = new ScValue(_gameRef);
_valObject[orig->_valIter->_key]->copy(orig->_valIter->_value);
orig->_valIter++;
}
@@ -703,7 +703,7 @@ void CScValue::copy(CScValue *orig, bool copyWhole) {
//////////////////////////////////////////////////////////////////////////
-void CScValue::setValue(CScValue *val) {
+void ScValue::setValue(ScValue *val) {
if (val->_type == VAL_VARIABLE_REF) {
setValue(val->_valRef);
return;
@@ -725,7 +725,7 @@ void CScValue::setValue(CScValue *val) {
_valNative->scSetString(val->getString());
break;
default:
- warning("CScValue::setValue - unhandled enum");
+ warning("ScValue::setValue - unhandled enum");
break;
}
}
@@ -735,7 +735,7 @@ void CScValue::setValue(CScValue *val) {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::persist(CBPersistMgr *persistMgr) {
+bool ScValue::persist(BasePersistenceManager *persistMgr) {
persistMgr->transfer(TMEMBER(_gameRef));
persistMgr->transfer(TMEMBER(_persistent));
@@ -760,7 +760,7 @@ bool CScValue::persist(CBPersistMgr *persistMgr) {
_valIter++;
}
} else {
- CScValue *val;
+ ScValue *val;
persistMgr->transfer("", &size);
for (int i = 0; i < size; i++) {
persistMgr->transfer("", &str);
@@ -819,7 +819,7 @@ bool CScValue::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::saveAsText(CBDynBuffer *buffer, int indent) {
+bool ScValue::saveAsText(BaseDynamicBuffer *buffer, int indent) {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
buffer->putTextIndent(indent, "PROPERTY {\n");
@@ -835,7 +835,7 @@ bool CScValue::saveAsText(CBDynBuffer *buffer, int indent) {
//////////////////////////////////////////////////////////////////////////
// -1 ... left is less, 0 ... equals, 1 ... left is greater
-int CScValue::compare(CScValue *val1, CScValue *val2) {
+int ScValue::compare(ScValue *val1, ScValue *val2) {
// both natives?
if (val1->isNative() && val2->isNative()) {
// same class?
@@ -871,14 +871,14 @@ int CScValue::compare(CScValue *val1, CScValue *val2) {
//////////////////////////////////////////////////////////////////////////
-int CScValue::compareStrict(CScValue *val1, CScValue *val2) {
+int ScValue::compareStrict(ScValue *val1, ScValue *val2) {
if (val1->getTypeTolerant() != val2->getTypeTolerant()) return -1;
- else return CScValue::compare(val1, val2);
+ else return ScValue::compare(val1, val2);
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableType type, CScScript *script, unsigned int scopeID) {
+bool ScValue::dbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableType type, ScScript *script, unsigned int scopeID) {
_valIter = _valObject.begin();
while (_valIter != _valObject.end()) {
client->onVariableInit(type, script, scopeID, _valIter->_value, _valIter->_key.c_str());
@@ -889,24 +889,24 @@ bool CScValue::dbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableTyp
//////////////////////////////////////////////////////////////////////////
-bool CScValue::setProperty(const char *propName, int value) {
- CScValue *val = new CScValue(_gameRef, value);
+bool ScValue::setProperty(const char *propName, int value) {
+ ScValue *val = new ScValue(_gameRef, value);
bool ret = DID_SUCCEED(setProp(propName, val));
delete val;
return ret;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::setProperty(const char *propName, const char *value) {
- CScValue *val = new CScValue(_gameRef, value);
+bool ScValue::setProperty(const char *propName, const char *value) {
+ ScValue *val = new ScValue(_gameRef, value);
bool ret = DID_SUCCEED(setProp(propName, val));
delete val;
return ret;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::setProperty(const char *propName, double value) {
- CScValue *val = new CScValue(_gameRef, value);
+bool ScValue::setProperty(const char *propName, double value) {
+ ScValue *val = new ScValue(_gameRef, value);
bool ret = DID_SUCCEED(setProp(propName, val));
delete val;
return ret;
@@ -914,8 +914,8 @@ bool CScValue::setProperty(const char *propName, double value) {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::setProperty(const char *propName, bool value) {
- CScValue *val = new CScValue(_gameRef, value);
+bool ScValue::setProperty(const char *propName, bool value) {
+ ScValue *val = new ScValue(_gameRef, value);
bool ret = DID_SUCCEED(setProp(propName, val));
delete val;
return ret;
@@ -923,8 +923,8 @@ bool CScValue::setProperty(const char *propName, bool value) {
//////////////////////////////////////////////////////////////////////////
-bool CScValue::setProperty(const char *propName) {
- CScValue *val = new CScValue(_gameRef);
+bool ScValue::setProperty(const char *propName) {
+ ScValue *val = new ScValue(_gameRef);
bool ret = DID_SUCCEED(setProp(propName, val));
delete val;
return ret;
@@ -934,7 +934,7 @@ bool CScValue::setProperty(const char *propName) {
//////////////////////////////////////////////////////////////////////////
// IWmeDebugProp
//////////////////////////////////////////////////////////////////////////
-EWmeDebuggerPropType CScValue::dbgGetType() {
+EWmeDebuggerPropType ScValue::dbgGetType() {
switch (getType()) {
case VAL_NULL:
return WME_DBGPROP_NULL;
@@ -956,70 +956,70 @@ EWmeDebuggerPropType CScValue::dbgGetType() {
}
//////////////////////////////////////////////////////////////////////////
-int CScValue::dbgGetValInt() {
+int ScValue::dbgGetValInt() {
return getInt();
}
//////////////////////////////////////////////////////////////////////////
-double CScValue::dbgGetValFloat() {
+double ScValue::dbgGetValFloat() {
return getFloat();
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgGetValBool() {
+bool ScValue::dbgGetValBool() {
return getBool();
}
//////////////////////////////////////////////////////////////////////////
-const char *CScValue::dbgGetValString() {
+const char *ScValue::dbgGetValString() {
return getString();
}
//////////////////////////////////////////////////////////////////////////
-IWmeDebugObject *CScValue::dbgGetValNative() {
+IWmeDebugObject *ScValue::dbgGetValNative() {
return getNative();
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgSetVal(int value) {
+bool ScValue::dbgSetVal(int value) {
setInt(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgSetVal(double value) {
+bool ScValue::dbgSetVal(double value) {
setFloat(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgSetVal(bool value) {
+bool ScValue::dbgSetVal(bool value) {
setBool(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgSetVal(const char *value) {
+bool ScValue::dbgSetVal(const char *value) {
setString(value);
return true;
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgSetVal() {
+bool ScValue::dbgSetVal() {
setNULL();
return true;
}
//////////////////////////////////////////////////////////////////////////
-int CScValue::dbgGetNumProperties() {
+int ScValue::dbgGetNumProperties() {
if (_valNative && _valNative->_scProp)
return _valNative->_scProp->dbgGetNumProperties();
else return _valObject.size();
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgGetProperty(int index, const char **name, IWmeDebugProp **value) {
+bool ScValue::dbgGetProperty(int index, const char **name, IWmeDebugProp **value) {
if (_valNative && _valNative->_scProp)
return _valNative->_scProp->dbgGetProperty(index, name, value);
else {
@@ -1039,7 +1039,7 @@ bool CScValue::dbgGetProperty(int index, const char **name, IWmeDebugProp **valu
}
//////////////////////////////////////////////////////////////////////////
-bool CScValue::dbgGetDescription(char *buf, int bufSize) {
+bool ScValue::dbgGetDescription(char *buf, int bufSize) {
if (_type == VAL_VARIABLE_REF)
return _valRef->dbgGetDescription(buf, bufSize);
diff --git a/engines/wintermute/base/scriptables/script_value.h b/engines/wintermute/base/scriptables/script_value.h
index eaee3ed773..7a684d2334 100644
--- a/engines/wintermute/base/scriptables/script_value.h
+++ b/engines/wintermute/base/scriptables/script_value.h
@@ -38,25 +38,25 @@
namespace WinterMute {
-class CScScript;
-class CBScriptable;
+class ScScript;
+class BaseScriptable;
-class CScValue : public CBBase, public IWmeDebugProp {
+class ScValue : public BaseClass, public IWmeDebugProp {
public:
- bool dbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableType type, CScScript *script, unsigned int scopeID);
+ bool dbgSendVariables(IWmeDebugClient *client, EWmeDebuggerVariableType type, ScScript *script, unsigned int scopeID);
- static int compare(CScValue *val1, CScValue *val2);
- static int compareStrict(CScValue *val1, CScValue *val2);
+ static int compare(ScValue *val1, ScValue *val2);
+ static int compareStrict(ScValue *val1, ScValue *val2);
TValType getTypeTolerant();
void cleanup(bool ignoreNatives = false);
- DECLARE_PERSISTENT(CScValue, CBBase)
+ DECLARE_PERSISTENT(ScValue, BaseClass)
bool _isConstVar;
- bool saveAsText(CBDynBuffer *buffer, int indent);
- void setValue(CScValue *val);
+ bool saveAsText(BaseDynamicBuffer *buffer, int indent);
+ void setValue(ScValue *val);
bool _persistent;
bool propExists(const char *name);
- void copy(CScValue *orig, bool copyWhole = false);
+ void copy(ScValue *orig, bool copyWhole = false);
void setStringVal(const char *val);
TValType getType();
bool getBool(bool defaultVal = false);
@@ -64,7 +64,7 @@ public:
double getFloat(double defaultVal = 0.0f);
const char *getString();
void *getMemBuffer();
- CBScriptable *getNative();
+ BaseScriptable *getNative();
bool deleteProp(const char *name);
void deleteProps();
void CleanProps(bool includingNatives);
@@ -74,9 +74,9 @@ public:
void setString(const char *val);
void setString(const Common::String &val);
void setNULL();
- void setNative(CBScriptable *val, bool persistent = false);
+ void setNative(BaseScriptable *val, bool persistent = false);
void setObject();
- void setReference(CScValue *val);
+ void setReference(ScValue *val);
bool isNULL();
bool isNative();
bool isString();
@@ -84,10 +84,10 @@ public:
bool isFloat();
bool isInt();
bool isObject();
- bool setProp(const char *name, CScValue *val, bool copyWhole = false, bool setAsConst = false);
- CScValue *getProp(const char *name);
- CBScriptable *_valNative;
- CScValue *_valRef;
+ bool setProp(const char *name, ScValue *val, bool copyWhole = false, bool setAsConst = false);
+ ScValue *getProp(const char *name);
+ BaseScriptable *_valNative;
+ ScValue *_valRef;
protected:
bool _valBool;
int _valInt;
@@ -95,14 +95,14 @@ protected:
char *_valString;
public:
TValType _type;
- CScValue(CBGame *inGame);
- CScValue(CBGame *inGame, bool Val);
- CScValue(CBGame *inGame, int Val);
- CScValue(CBGame *inGame, double Val);
- CScValue(CBGame *inGame, const char *Val);
- virtual ~CScValue();
- Common::HashMap<Common::String, CScValue *> _valObject;
- Common::HashMap<Common::String, CScValue *>::iterator _valIter;
+ ScValue(BaseGame *inGame);
+ ScValue(BaseGame *inGame, bool Val);
+ ScValue(BaseGame *inGame, int Val);
+ ScValue(BaseGame *inGame, double Val);
+ ScValue(BaseGame *inGame, const char *Val);
+ virtual ~ScValue();
+ Common::HashMap<Common::String, ScValue *> _valObject;
+ Common::HashMap<Common::String, ScValue *>::iterator _valIter;
bool setProperty(const char *propName, int value);
bool setProperty(const char *propName, const char *value);
diff --git a/engines/wintermute/base/sound/base_sound.cpp b/engines/wintermute/base/sound/base_sound.cpp
index e1819e3c65..06421e8632 100644
--- a/engines/wintermute/base/sound/base_sound.cpp
+++ b/engines/wintermute/base/sound/base_sound.cpp
@@ -33,10 +33,10 @@
namespace WinterMute {
-IMPLEMENT_PERSISTENT(CBSound, false)
+IMPLEMENT_PERSISTENT(BaseSound, false)
//////////////////////////////////////////////////////////////////////////
-CBSound::CBSound(CBGame *inGame): CBBase(inGame) {
+BaseSound::BaseSound(BaseGame *inGame): BaseClass(inGame) {
_sound = NULL;
_soundFilename = NULL;
@@ -56,7 +56,7 @@ CBSound::CBSound(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBSound::~CBSound() {
+BaseSound::~BaseSound() {
if (_sound) _gameRef->_soundMgr->removeSound(_sound);
_sound = NULL;
@@ -66,7 +66,7 @@ CBSound::~CBSound() {
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setSound(const char *filename, Audio::Mixer::SoundType type, bool streamed) {
+bool BaseSound::setSound(const char *filename, Audio::Mixer::SoundType type, bool streamed) {
if (_sound) {
_gameRef->_soundMgr->removeSound(_sound);
_sound = NULL;
@@ -88,7 +88,7 @@ bool CBSound::setSound(const char *filename, Audio::Mixer::SoundType type, bool
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setSoundSimple() {
+bool BaseSound::setSoundSimple() {
_sound = _gameRef->_soundMgr->addSound(_soundFilename, _soundType, _soundStreamed);
if (_sound) {
if (_soundPosition) _sound->setPosition(_soundPosition);
@@ -104,14 +104,14 @@ bool CBSound::setSoundSimple() {
//////////////////////////////////////////////////////////////////////////
-uint32 CBSound::getLength() {
+uint32 BaseSound::getLength() {
if (_sound) return _sound->getLength();
else return 0;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::play(bool looping) {
+bool BaseSound::play(bool looping) {
if (_sound) {
_soundPaused = false;
return _sound->play(looping, _soundPosition);
@@ -120,7 +120,7 @@ bool CBSound::play(bool looping) {
//////////////////////////////////////////////////////////////////////////
-bool CBSound::stop() {
+bool BaseSound::stop() {
if (_sound) {
_soundPaused = false;
return _sound->stop();
@@ -129,7 +129,7 @@ bool CBSound::stop() {
//////////////////////////////////////////////////////////////////////////
-bool CBSound::pause(bool freezePaused) {
+bool BaseSound::pause(bool freezePaused) {
if (_sound) {
_soundPaused = true;
if (freezePaused) _sound->_freezePaused = true;
@@ -139,7 +139,7 @@ bool CBSound::pause(bool freezePaused) {
//////////////////////////////////////////////////////////////////////////
-bool CBSound::resume() {
+bool BaseSound::resume() {
if (_sound && _soundPaused) {
_soundPaused = false;
return _sound->resume();
@@ -148,7 +148,7 @@ bool CBSound::resume() {
//////////////////////////////////////////////////////////////////////////
-bool CBSound::persist(CBPersistMgr *persistMgr) {
+bool BaseSound::persist(BasePersistenceManager *persistMgr) {
if (persistMgr->_saving && _sound) {
_soundPlaying = _sound->isPlaying();
_soundLooping = _sound->_looping;
@@ -182,19 +182,19 @@ bool CBSound::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
-bool CBSound::isPlaying() {
+bool BaseSound::isPlaying() {
return _sound && _sound->isPlaying();
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::isPaused() {
+bool BaseSound::isPaused() {
return _sound && _soundPaused;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setPositionTime(uint32 time) {
+bool BaseSound::setPositionTime(uint32 time) {
if (!_sound) return STATUS_FAILED;
_soundPosition = time;
bool ret = _sound->setPosition(_soundPosition);
@@ -205,7 +205,7 @@ bool CBSound::setPositionTime(uint32 time) {
//////////////////////////////////////////////////////////////////////////
-uint32 CBSound::getPositionTime() {
+uint32 BaseSound::getPositionTime() {
if (!_sound) return 0;
if (!_sound->isPlaying())
@@ -214,42 +214,42 @@ uint32 CBSound::getPositionTime() {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setVolumePercent(int percent) {
+bool BaseSound::setVolumePercent(int percent) {
if (!_sound)
return STATUS_FAILED;
else return _sound->setPrivateVolume(percent * 255 / 100);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setVolume(int volume) {
+bool BaseSound::setVolume(int volume) {
if (!_sound)
return STATUS_FAILED;
else return _sound->setPrivateVolume(volume);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setPrivateVolume(int volume) {
+bool BaseSound::setPrivateVolume(int volume) {
if (!_sound)
return STATUS_FAILED;
else return _sound->_privateVolume = volume;
}
//////////////////////////////////////////////////////////////////////////
-int CBSound::getVolumePercent() {
+int BaseSound::getVolumePercent() {
if (!_sound)
return 0;
else return _sound->_privateVolume * 100 / 255;
}
//////////////////////////////////////////////////////////////////////////
-int CBSound::getVolume() {
+int BaseSound::getVolume() {
if (!_sound)
return 0;
else return _sound->_privateVolume;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setLoopStart(uint32 pos) {
+bool BaseSound::setLoopStart(uint32 pos) {
if (!_sound)
return STATUS_FAILED;
else {
@@ -259,7 +259,7 @@ bool CBSound::setLoopStart(uint32 pos) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSound::setPan(float pan) {
+bool BaseSound::setPan(float pan) {
if (_sound)
return _sound->setPan(pan);
else return STATUS_FAILED;
@@ -267,7 +267,7 @@ bool CBSound::setPan(float pan) {
//////////////////////////////////////////////////////////////////////////
-bool CBSound::ApplyFX(TSFXType type, float param1, float param2, float param3, float param4) {
+bool BaseSound::ApplyFX(TSFXType type, float param1, float param2, float param3, float param4) {
if (!_sound)
return STATUS_OK;
diff --git a/engines/wintermute/base/sound/base_sound.h b/engines/wintermute/base/sound/base_sound.h
index ef52194090..0b033de47d 100644
--- a/engines/wintermute/base/sound/base_sound.h
+++ b/engines/wintermute/base/sound/base_sound.h
@@ -36,8 +36,8 @@
namespace WinterMute {
-class CBSoundBuffer;
-class CBSound : public CBBase {
+class BaseSoundBuffer;
+class BaseSound : public BaseClass {
public:
bool setPan(float pan);
int _soundPrivateVolume;
@@ -57,7 +57,7 @@ public:
bool _soundLooping;
uint32 _soundLoopStart;
uint32 _soundPosition;
- DECLARE_PERSISTENT(CBSound, CBBase)
+ DECLARE_PERSISTENT(BaseSound, BaseClass)
bool resume();
bool pause(bool freezePaused = false);
bool stop();
@@ -68,8 +68,8 @@ public:
char *_soundFilename;
bool setSoundSimple();
bool setSound(const char *filename, Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType, bool streamed = false);
- CBSound(CBGame *inGame);
- virtual ~CBSound();
+ BaseSound(BaseGame *inGame);
+ virtual ~BaseSound();
bool ApplyFX(TSFXType type = SFX_NONE, float param1 = 0, float param2 = 0, float param3 = 0, float param4 = 0);
@@ -79,7 +79,7 @@ private:
float _sFXParam2;
float _sFXParam3;
float _sFXParam4;
- CBSoundBuffer *_sound;
+ BaseSoundBuffer *_sound;
};
diff --git a/engines/wintermute/base/sound/base_sound_buffer.cpp b/engines/wintermute/base/sound/base_sound_buffer.cpp
index a868f99823..b8c19c2985 100644
--- a/engines/wintermute/base/sound/base_sound_buffer.cpp
+++ b/engines/wintermute/base/sound/base_sound_buffer.cpp
@@ -50,7 +50,7 @@ namespace WinterMute {
#define MAX_NONSTREAMED_FILE_SIZE 1024*1024
//////////////////////////////////////////////////////////////////////////
-CBSoundBuffer::CBSoundBuffer(CBGame *inGame): CBBase(inGame) {
+BaseSoundBuffer::BaseSoundBuffer(BaseGame *inGame): BaseClass(inGame) {
_stream = NULL;
_handle = NULL;
// _sync = NULL;
@@ -71,7 +71,7 @@ CBSoundBuffer::CBSoundBuffer(CBGame *inGame): CBBase(inGame) {
//////////////////////////////////////////////////////////////////////////
-CBSoundBuffer::~CBSoundBuffer() {
+BaseSoundBuffer::~BaseSoundBuffer() {
stop();
if (_handle) {
@@ -88,13 +88,13 @@ CBSoundBuffer::~CBSoundBuffer() {
//////////////////////////////////////////////////////////////////////////
-void CBSoundBuffer::setStreaming(bool Streamed, uint32 NumBlocks, uint32 BlockSize) {
+void BaseSoundBuffer::setStreaming(bool Streamed, uint32 NumBlocks, uint32 BlockSize) {
_streamed = Streamed;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
+bool BaseSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
warning("BSoundBuffer::LoadFromFile(%s,%d)", filename, forceReload);
#if 0
if (_stream) {
@@ -132,15 +132,15 @@ bool CBSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
if (!_stream) {
return STATUS_FAILED;
}
- CBUtils::setString(&_filename, filename);
+ BaseUtils::setString(&_filename, filename);
return STATUS_OK;
#if 0
BASS_FILEPROCS fileProc;
- fileProc.close = CBSoundBuffer::FileCloseProc;
- fileProc.read = CBSoundBuffer::FileReadProc;
- fileProc.seek = CBSoundBuffer::FileSeekProc;
- fileProc.length = CBSoundBuffer::FileLenProc;
+ fileProc.close = BaseSoundBuffer::FileCloseProc;
+ fileProc.read = BaseSoundBuffer::FileReadProc;
+ fileProc.seek = BaseSoundBuffer::FileSeekProc;
+ fileProc.length = BaseSoundBuffer::FileLenProc;
_stream = BASS_StreamCreateFileUser(STREAMFILE_NOBUFFER, 0, &fileProc, (void *)_file);
if (!_stream) {
@@ -148,7 +148,7 @@ bool CBSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
return STATUS_FAILED;
}
- CBUtils::setString(&_filename, filename);
+ BaseUtils::setString(&_filename, filename);
/*
bool res;
@@ -196,7 +196,7 @@ bool CBSoundBuffer::loadFromFile(const char *filename, bool forceReload) {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::play(bool looping, uint32 startSample) {
+bool BaseSoundBuffer::play(bool looping, uint32 startSample) {
if (startSample != 0) {
warning("BSoundBuffer::Play - Should start playback at %d, but currently we don't", startSample);
}
@@ -220,7 +220,7 @@ bool CBSoundBuffer::play(bool looping, uint32 startSample) {
}
//////////////////////////////////////////////////////////////////////////
-void CBSoundBuffer::setLooping(bool looping) {
+void BaseSoundBuffer::setLooping(bool looping) {
warning("BSoundBuffer::SetLooping(%d) - won't change a playing sound", looping);
_looping = looping;
#if 0
@@ -233,7 +233,7 @@ void CBSoundBuffer::setLooping(bool looping) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::resume() {
+bool BaseSoundBuffer::resume() {
if (_stream && _handle) {
g_system->getMixer()->pauseHandle(*_handle, false);
}
@@ -242,7 +242,7 @@ bool CBSoundBuffer::resume() {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::stop() {
+bool BaseSoundBuffer::stop() {
if (_stream && _handle) {
g_system->getMixer()->stopHandle(*_handle);
}
@@ -251,7 +251,7 @@ bool CBSoundBuffer::stop() {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::pause() {
+bool BaseSoundBuffer::pause() {
if (_stream && _handle) {
g_system->getMixer()->pauseHandle(*_handle, true);
}
@@ -260,7 +260,7 @@ bool CBSoundBuffer::pause() {
}
//////////////////////////////////////////////////////////////////////////
-uint32 CBSoundBuffer::getLength() {
+uint32 BaseSoundBuffer::getLength() {
if (_stream) {
uint32 len = _stream->getLength().msecs();
return len * 1000;
@@ -270,17 +270,17 @@ uint32 CBSoundBuffer::getLength() {
//////////////////////////////////////////////////////////////////////////
-void CBSoundBuffer::setType(Audio::Mixer::SoundType type) {
+void BaseSoundBuffer::setType(Audio::Mixer::SoundType type) {
_type = type;
}
//////////////////////////////////////////////////////////////////////////
-void CBSoundBuffer::updateVolume() {
+void BaseSoundBuffer::updateVolume() {
setVolume(_privateVolume);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::setVolume(int volume) {
+bool BaseSoundBuffer::setVolume(int volume) {
_volume = volume * _gameRef->_soundMgr->getMasterVolume() / 255;
if (_stream && _handle) {
byte vol = (byte)(_volume);
@@ -291,14 +291,14 @@ bool CBSoundBuffer::setVolume(int volume) {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::setPrivateVolume(int volume) {
+bool BaseSoundBuffer::setPrivateVolume(int volume) {
_privateVolume = volume;
return setVolume(_privateVolume);
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::isPlaying() {
+bool BaseSoundBuffer::isPlaying() {
if (_stream && _handle) {
return _freezePaused || g_system->getMixer()->isSoundHandleActive(*_handle);
} else {
@@ -308,7 +308,7 @@ bool CBSoundBuffer::isPlaying() {
//////////////////////////////////////////////////////////////////////////
-uint32 CBSoundBuffer::getPosition() {
+uint32 BaseSoundBuffer::getPosition() {
if (_stream && _handle) {
uint32 pos = g_system->getMixer()->getSoundElapsedTime(*_handle);
return pos;
@@ -318,8 +318,8 @@ uint32 CBSoundBuffer::getPosition() {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::setPosition(uint32 pos) {
- warning("CBSoundBuffer::SetPosition - not implemented yet");
+bool BaseSoundBuffer::setPosition(uint32 pos) {
+ warning("BaseSoundBuffer::SetPosition - not implemented yet");
#if 0
if (_stream) {
QWORD pos = BASS_ChannelSeconds2Bytes(_stream, (float)Pos / 1000.0f);
@@ -330,7 +330,7 @@ bool CBSoundBuffer::setPosition(uint32 pos) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::setLoopStart(uint32 pos) {
+bool BaseSoundBuffer::setLoopStart(uint32 pos) {
_loopStart = pos;
#if 0
if (_stream) {
@@ -340,7 +340,7 @@ bool CBSoundBuffer::setLoopStart(uint32 pos) {
}
if (_loopStart > 0) {
QWORD len = BASS_ChannelGetLength(_stream, BASS_POS_BYTE);
- _sync = BASS_ChannelSetSync(_stream, BASS_SYNC_POS | BASS_SYNC_MIXTIME, len, CBSoundBuffer::LoopSyncProc, (void *)this);
+ _sync = BASS_ChannelSetSync(_stream, BASS_SYNC_POS | BASS_SYNC_MIXTIME, len, BaseSoundBuffer::LoopSyncProc, (void *)this);
}
}
#endif
@@ -348,8 +348,8 @@ bool CBSoundBuffer::setLoopStart(uint32 pos) {
}
#if 0
//////////////////////////////////////////////////////////////////////////
-void CBSoundBuffer::LoopSyncProc(HSYNC handle, uint32 channel, uint32 data, void *user) {
- CBSoundBuffer *soundBuf = static_cast<CBSoundBuffer *>(user);
+void BaseSoundBuffer::LoopSyncProc(HSYNC handle, uint32 channel, uint32 data, void *user) {
+ BaseSoundBuffer *soundBuf = static_cast<BaseSoundBuffer *>(user);
QWORD pos = BASS_ChannelSeconds2Bytes(channel, (float)soundBuf->GetLoopStart() / 1000.0f);
if (!BASS_ChannelSetPosition(channel, pos, BASS_POS_BYTE))
@@ -357,7 +357,7 @@ void CBSoundBuffer::LoopSyncProc(HSYNC handle, uint32 channel, uint32 data, void
}
#endif
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::setPan(float pan) {
+bool BaseSoundBuffer::setPan(float pan) {
if (_handle) {
g_system->getMixer()->setChannelBalance(*_handle, (int8)(pan * 127));
}
@@ -365,8 +365,8 @@ bool CBSoundBuffer::setPan(float pan) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundBuffer::applyFX(TSFXType type, float param1, float param2, float param3, float param4) {
- warning("CBSoundBuffer::ApplyFX - not implemented yet");
+bool BaseSoundBuffer::applyFX(TSFXType type, float param1, float param2, float param3, float param4) {
+ warning("BaseSoundBuffer::ApplyFX - not implemented yet");
switch (type) {
case SFX_ECHO:
break;
diff --git a/engines/wintermute/base/sound/base_sound_buffer.h b/engines/wintermute/base/sound/base_sound_buffer.h
index a491bd49ad..9c85a02b39 100644
--- a/engines/wintermute/base/sound/base_sound_buffer.h
+++ b/engines/wintermute/base/sound/base_sound_buffer.h
@@ -41,12 +41,12 @@ class SoundHandle;
namespace WinterMute {
-class CBFile;
-class CBSoundBuffer : public CBBase {
+class BaseFile;
+class BaseSoundBuffer : public BaseClass {
public:
- CBSoundBuffer(CBGame *inGame);
- virtual ~CBSoundBuffer();
+ BaseSoundBuffer(BaseGame *inGame);
+ virtual ~BaseSoundBuffer();
bool pause();
diff --git a/engines/wintermute/base/sound/base_sound_manager.cpp b/engines/wintermute/base/sound/base_sound_manager.cpp
index c2174dea6a..22b22a5db6 100644
--- a/engines/wintermute/base/sound/base_sound_manager.cpp
+++ b/engines/wintermute/base/sound/base_sound_manager.cpp
@@ -44,24 +44,24 @@ namespace WinterMute {
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
-//IMPLEMENT_PERSISTENT(CBSoundMgr, true);
+//IMPLEMENT_PERSISTENT(BaseSoundMgr, true);
//////////////////////////////////////////////////////////////////////////
-CBSoundMgr::CBSoundMgr(CBGame *inGame): CBBase(inGame) {
+BaseSoundMgr::BaseSoundMgr(BaseGame *inGame): BaseClass(inGame) {
_soundAvailable = false;
_volumeMaster = 255;
}
//////////////////////////////////////////////////////////////////////////
-CBSoundMgr::~CBSoundMgr() {
+BaseSoundMgr::~BaseSoundMgr() {
saveSettings();
cleanup();
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::cleanup() {
+bool BaseSoundMgr::cleanup() {
for (uint32 i = 0; i < _sounds.size(); i++)
delete _sounds[i];
_sounds.clear();
@@ -72,14 +72,14 @@ bool CBSoundMgr::cleanup() {
}
//////////////////////////////////////////////////////////////////////////
-void CBSoundMgr::saveSettings() {
+void BaseSoundMgr::saveSettings() {
if (_soundAvailable) {
_gameRef->_registry->writeInt("Audio", "MasterVolume", _volumeMaster);
}
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::initialize() {
+bool BaseSoundMgr::initialize() {
_soundAvailable = false;
if (!g_system->getMixer()->isReady()) {
@@ -93,7 +93,7 @@ bool CBSoundMgr::initialize() {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::initLoop() {
+bool BaseSoundMgr::initLoop() {
if (!_soundAvailable)
return STATUS_OK;
#if 0
@@ -105,11 +105,11 @@ bool CBSoundMgr::initLoop() {
//////////////////////////////////////////////////////////////////////////
-CBSoundBuffer *CBSoundMgr::addSound(const char *filename, Audio::Mixer::SoundType type, bool streamed) {
+BaseSoundBuffer *BaseSoundMgr::addSound(const char *filename, Audio::Mixer::SoundType type, bool streamed) {
if (!_soundAvailable)
return NULL;
- CBSoundBuffer *sound;
+ BaseSoundBuffer *sound;
// try to switch WAV to OGG file (if available)
AnsiString ext = PathUtil::getExtension(filename);
@@ -123,7 +123,7 @@ CBSoundBuffer *CBSoundMgr::addSound(const char *filename, Audio::Mixer::SoundTyp
}
}
- sound = new CBSoundBuffer(_gameRef);
+ sound = new BaseSoundBuffer(_gameRef);
if (!sound) return NULL;
sound->setStreaming(streamed);
@@ -149,7 +149,7 @@ CBSoundBuffer *CBSoundMgr::addSound(const char *filename, Audio::Mixer::SoundTyp
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::addSound(CBSoundBuffer *sound, Audio::Mixer::SoundType type) {
+bool BaseSoundMgr::addSound(BaseSoundBuffer *sound, Audio::Mixer::SoundType type) {
if (!sound)
return STATUS_FAILED;
@@ -163,7 +163,7 @@ bool CBSoundMgr::addSound(CBSoundBuffer *sound, Audio::Mixer::SoundType type) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::removeSound(CBSoundBuffer *sound) {
+bool BaseSoundMgr::removeSound(BaseSoundBuffer *sound) {
for (uint32 i = 0; i < _sounds.size(); i++) {
if (_sounds[i] == sound) {
delete _sounds[i];
@@ -177,7 +177,7 @@ bool CBSoundMgr::removeSound(CBSoundBuffer *sound) {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::setVolume(Audio::Mixer::SoundType type, int volume) {
+bool BaseSoundMgr::setVolume(Audio::Mixer::SoundType type, int volume) {
if (!_soundAvailable)
return STATUS_OK;
@@ -200,13 +200,13 @@ bool CBSoundMgr::setVolume(Audio::Mixer::SoundType type, int volume) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::setVolumePercent(Audio::Mixer::SoundType type, byte percent) {
+bool BaseSoundMgr::setVolumePercent(Audio::Mixer::SoundType type, byte percent) {
return setVolume(type, percent * 255 / 100);
}
//////////////////////////////////////////////////////////////////////////
-byte CBSoundMgr::getVolumePercent(Audio::Mixer::SoundType type) {
+byte BaseSoundMgr::getVolumePercent(Audio::Mixer::SoundType type) {
int volume = 0;
switch (type) {
@@ -225,7 +225,7 @@ byte CBSoundMgr::getVolumePercent(Audio::Mixer::SoundType type) {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::setMasterVolume(byte value) {
+bool BaseSoundMgr::setMasterVolume(byte value) {
_volumeMaster = value;
for (uint32 i = 0; i < _sounds.size(); i++) {
_sounds[i]->updateVolume();
@@ -234,25 +234,25 @@ bool CBSoundMgr::setMasterVolume(byte value) {
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::setMasterVolumePercent(byte percent) {
+bool BaseSoundMgr::setMasterVolumePercent(byte percent) {
setMasterVolume(percent * 255 / 100);
return STATUS_OK;
}
//////////////////////////////////////////////////////////////////////////
-byte CBSoundMgr::getMasterVolumePercent() {
+byte BaseSoundMgr::getMasterVolumePercent() {
return getMasterVolume() * 100 / 255;
}
//////////////////////////////////////////////////////////////////////////
-byte CBSoundMgr::getMasterVolume() {
+byte BaseSoundMgr::getMasterVolume() {
return (byte)_volumeMaster;
}
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::pauseAll(bool includingMusic) {
+bool BaseSoundMgr::pauseAll(bool includingMusic) {
for (uint32 i = 0; i < _sounds.size(); i++) {
if (_sounds[i]->isPlaying() && (_sounds[i]->_type != Audio::Mixer::kMusicSoundType || includingMusic)) {
@@ -266,7 +266,7 @@ bool CBSoundMgr::pauseAll(bool includingMusic) {
//////////////////////////////////////////////////////////////////////////
-bool CBSoundMgr::resumeAll() {
+bool BaseSoundMgr::resumeAll() {
for (uint32 i = 0; i < _sounds.size(); i++) {
if (_sounds[i]->_freezePaused) {
@@ -280,7 +280,7 @@ bool CBSoundMgr::resumeAll() {
//////////////////////////////////////////////////////////////////////////
-float CBSoundMgr::posToPan(int x, int y) {
+float BaseSoundMgr::posToPan(int x, int y) {
float relPos = (float)x / ((float)_gameRef->_renderer->_width);
float minPan = -0.7f;
diff --git a/engines/wintermute/base/sound/base_sound_manager.h b/engines/wintermute/base/sound/base_sound_manager.h
index 2c05bbfcb8..53caffbe61 100644
--- a/engines/wintermute/base/sound/base_sound_manager.h
+++ b/engines/wintermute/base/sound/base_sound_manager.h
@@ -35,14 +35,14 @@
#include "common/array.h"
namespace WinterMute {
-class CBSoundBuffer;
-class CBSoundMgr : public CBBase {
+class BaseSoundBuffer;
+class BaseSoundMgr : public BaseClass {
public:
float posToPan(int x, int y);
bool resumeAll();
bool pauseAll(bool includingMusic = true);
bool cleanup();
- //DECLARE_PERSISTENT(CBSoundMgr, CBBase);
+ //DECLARE_PERSISTENT(BaseSoundMgr, BaseClass);
byte getMasterVolumePercent();
byte getMasterVolume();
bool setMasterVolume(byte percent);
@@ -52,15 +52,15 @@ public:
bool setVolume(Audio::Mixer::SoundType type, int volume);
uint32 _volumeOriginal;
int _volumeMaster;
- bool removeSound(CBSoundBuffer *sound);
- CBSoundBuffer *addSound(const char *filename, Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType, bool streamed = false);
- bool addSound(CBSoundBuffer *sound, Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType);
+ bool removeSound(BaseSoundBuffer *sound);
+ BaseSoundBuffer *addSound(const char *filename, Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType, bool streamed = false);
+ bool addSound(BaseSoundBuffer *sound, Audio::Mixer::SoundType type = Audio::Mixer::kSFXSoundType);
bool initLoop();
bool initialize();
bool _soundAvailable;
- CBSoundMgr(CBGame *inGame);
- virtual ~CBSoundMgr();
- Common::Array<CBSoundBuffer *> _sounds;
+ BaseSoundMgr(BaseGame *inGame);
+ virtual ~BaseSoundMgr();
+ Common::Array<BaseSoundBuffer *> _sounds;
void saveSettings();
};