WINTERMUTE: Rename FuncName->funcName in BSubFrame, BSurfaceStorage and BTransitionMgr

This commit is contained in:
Einar Johan Trøan Sømåen 2012-06-26 02:00:10 +02:00
parent 1d2653e2b0
commit 95983fa2ea
16 changed files with 82 additions and 81 deletions

View File

@ -280,7 +280,7 @@ HRESULT CAdGame::ChangeScene(const char *Filename, bool FadeIn) {
_scene->LoadState();
}
if (FadeIn) Game->_transMgr->Start(TRANSITION_FADE_IN);
if (FadeIn) Game->_transMgr->start(TRANSITION_FADE_IN);
return ret;
} else return E_FAIL;
}
@ -330,7 +330,7 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
bool TransIn = valFadeIn->IsNULL() ? true : valFadeIn->GetBool();
ScheduleChangeScene(Filename, TransIn);
if (TransOut) _transMgr->Start(TRANSITION_FADE_OUT, true);
if (TransOut) _transMgr->start(TRANSITION_FADE_OUT, true);
Stack->PushNULL();
@ -785,7 +785,7 @@ HRESULT CAdGame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
if (Height <= 0) Height = _renderer->_height;
if (!_sceneViewport) _sceneViewport = new CBViewport(Game);
if (_sceneViewport) _sceneViewport->SetRect(X, Y, X + Width, Y + Height);
if (_sceneViewport) _sceneViewport->setRect(X, Y, X + Width, Y + Height);
Stack->PushBool(true);
@ -1224,7 +1224,7 @@ HRESULT CAdGame::LoadBuffer(byte *Buffer, bool Complete) {
RECT rc;
parser.ScanStr((char *)params2, "%d,%d,%d,%d", &rc.left, &rc.top, &rc.right, &rc.bottom);
if (!_sceneViewport) _sceneViewport = new CBViewport(Game);
if (_sceneViewport) _sceneViewport->SetRect(rc.left, rc.top, rc.right, rc.bottom);
if (_sceneViewport) _sceneViewport->setRect(rc.left, rc.top, rc.right, rc.bottom);
}
break;

View File

@ -824,7 +824,7 @@ HRESULT CAdScene::LoadBuffer(byte *Buffer, bool Complete) {
RECT rc;
parser.ScanStr((char *)params, "%d,%d,%d,%d", &rc.left, &rc.top, &rc.right, &rc.bottom);
if (!_viewport) _viewport = new CBViewport(Game);
if (_viewport) _viewport->SetRect(rc.left, rc.top, rc.right, rc.bottom, true);
if (_viewport) _viewport->setRect(rc.left, rc.top, rc.right, rc.bottom, true);
}
case TOKEN_PERSISTENT_STATE:
@ -1579,7 +1579,7 @@ HRESULT CAdScene::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
if (Height <= 0) Height = Game->_renderer->_height;
if (!_viewport) _viewport = new CBViewport(Game);
if (_viewport) _viewport->SetRect(X, Y, X + Width, Y + Height);
if (_viewport) _viewport->setRect(X, Y, X + Width, Y + Height);
Stack->PushBool(true);
@ -1996,7 +1996,7 @@ HRESULT CAdScene::saveAsText(CBDynBuffer *Buffer, int Indent) {
// viewport
if (_viewport) {
RECT *rc = _viewport->GetRect();
RECT *rc = _viewport->getRect();
Buffer->PutTextIndent(Indent + 2, "VIEWPORT { %d, %d, %d, %d }\n", rc->left, rc->top, rc->right, rc->bottom);
}
@ -2378,10 +2378,10 @@ HRESULT CAdScene::GetViewportOffset(int *OffsetX, int *OffsetY) {
HRESULT CAdScene::GetViewportSize(int *Width, int *Height) {
CAdGame *AdGame = (CAdGame *)Game;
if (_viewport && !Game->_editorMode) {
if (Width) *Width = _viewport->GetWidth();
if (Width) *Width = _viewport->getWidth();
if (Height) *Height = _viewport->getHeight();
} else if (AdGame->_sceneViewport && !Game->_editorMode) {
if (Width) *Width = AdGame->_sceneViewport->GetWidth();
if (Width) *Width = AdGame->_sceneViewport->getWidth();
if (Height) *Height = AdGame->_sceneViewport->getHeight();
} else {
if (Width) *Width = Game->_renderer->_width;

View File

@ -412,8 +412,8 @@ HRESULT CBFontBitmap::LoadBuffer(byte *Buffer) {
if (surface_file != NULL && !_sprite) {
_subframe = new CBSubFrame(Game);
if (custo_trans) _subframe->SetSurface(surface_file, false, r, g, b);
else _subframe->SetSurface(surface_file);
if (custo_trans) _subframe->setSurface(surface_file, false, r, g, b);
else _subframe->setSurface(surface_file);
}

View File

@ -80,7 +80,7 @@ HRESULT CBFrame::Draw(int X, int Y, CBObject *Register, float ZoomX, float ZoomY
HRESULT res;
for (int i = 0; i < _subframes.GetSize(); i++) {
res = _subframes[i]->Draw(X, Y, Register, ZoomX, ZoomY, Precise, Alpha, Rotate, BlendMode);
res = _subframes[i]->draw(X, Y, Register, ZoomX, ZoomY, Precise, Alpha, Rotate, BlendMode);
if (FAILED(res)) return res;
}
return S_OK;
@ -239,7 +239,7 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
case TOKEN_SUBFRAME: {
CBSubFrame *subframe = new CBSubFrame(Game);
if (!subframe || FAILED(subframe->LoadBuffer((byte *)params, LifeTime, KeepLoaded))) {
if (!subframe || FAILED(subframe->loadBuffer((byte *)params, LifeTime, KeepLoaded))) {
delete subframe;
cmd = PARSERR_GENERIC;
} else _subframes.Add(subframe);
@ -293,8 +293,8 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
CBSubFrame *sub = new CBSubFrame(Game);
if (surface_file != NULL) {
if (custo_trans) sub->SetSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
else sub->SetSurface(surface_file, true, 0, 0, 0, LifeTime, KeepLoaded);
if (custo_trans) sub->setSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
else sub->setSurface(surface_file, true, 0, 0, 0, LifeTime, KeepLoaded);
if (!sub->_surface) {
delete sub;
@ -306,7 +306,7 @@ HRESULT CBFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
if (custo_trans) sub->_transparent = DRGBA(r, g, b, 0xFF);
}
if (CBPlatform::IsRectEmpty(&rect)) sub->SetDefaultRect();
if (CBPlatform::IsRectEmpty(&rect)) sub->setDefaultRect();
else sub->_rect = rect;
sub->_hotspotX = HotspotX;
@ -333,7 +333,7 @@ bool CBFrame::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float Sca
RECT SubRect;
for (int i = 0; i < _subframes.GetSize(); i++) {
_subframes[i]->GetBoundingRect(&SubRect, X, Y, ScaleX, ScaleY);
_subframes[i]->getBoundingRect(&SubRect, X, Y, ScaleX, ScaleY);
CBPlatform::UnionRect(Rect, Rect, &SubRect);
}
return true;
@ -484,8 +484,8 @@ HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
CBSubFrame *Sub = new CBSubFrame(Game);
if (Filename != NULL) {
Sub->SetSurface(Filename);
Sub->SetDefaultRect();
Sub->setSurface(Filename);
Sub->setDefaultRect();
}
_subframes.Add(Sub);
@ -507,7 +507,7 @@ HRESULT CBFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *This
CBSubFrame *Sub = new CBSubFrame(Game);
if (Filename != NULL) {
Sub->SetSurface(Filename);
Sub->setSurface(Filename);
}
if (Index >= _subframes.GetSize()) _subframes.Add(Sub);

View File

@ -614,7 +614,7 @@ HRESULT CBGame::InitLoop() {
_soundMgr->initLoop();
UpdateMusicCrossfade();
_surfaceStorage->InitLoop();
_surfaceStorage->initLoop();
_fontStorage->InitLoop();
@ -3363,7 +3363,7 @@ void CBGame::AfterLoadRegion(void *Region, void *Data) {
//////////////////////////////////////////////////////////////////////////
void CBGame::AfterLoadSubFrame(void *Subframe, void *Data) {
((CBSubFrame *)Subframe)->SetSurfaceSimple();
((CBSubFrame *)Subframe)->setSurfaceSimple();
}
@ -3983,7 +3983,7 @@ HRESULT CBGame::PushViewport(CBViewport *Viewport) {
if (_viewportSP >= _viewportStack.GetSize()) _viewportStack.Add(Viewport);
else _viewportStack[_viewportSP] = Viewport;
_renderer->SetViewport(Viewport->GetRect());
_renderer->SetViewport(Viewport->getRect());
return S_OK;
}
@ -3994,7 +3994,7 @@ HRESULT CBGame::PopViewport() {
_viewportSP--;
if (_viewportSP < -1) Game->LOG(0, "Fatal: Viewport stack underflow!");
if (_viewportSP >= 0 && _viewportSP < _viewportStack.GetSize()) _renderer->SetViewport(_viewportStack[_viewportSP]->GetRect());
if (_viewportSP >= 0 && _viewportSP < _viewportStack.GetSize()) _renderer->SetViewport(_viewportStack[_viewportSP]->getRect());
else _renderer->SetViewport(_renderer->_drawOffsetX,
_renderer->_drawOffsetY,
_renderer->_width + _renderer->_drawOffsetX,
@ -4009,7 +4009,7 @@ HRESULT CBGame::GetCurrentViewportRect(RECT *Rect, bool *Custom) {
if (Rect == NULL) return E_FAIL;
else {
if (_viewportSP >= 0) {
CBPlatform::CopyRect(Rect, _viewportStack[_viewportSP]->GetRect());
CBPlatform::CopyRect(Rect, _viewportStack[_viewportSP]->getRect());
if (Custom) *Custom = true;
} else {
CBPlatform::SetRect(Rect, _renderer->_drawOffsetX,

View File

@ -139,7 +139,7 @@ HRESULT CBSprite::LoadFile(const char *Filename, int LifeTime, TSpriteCacheType
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(Game);
CBSubFrame *subframe = new CBSubFrame(Game);
subframe->SetSurface(Filename, true, 0, 0, 0, LifeTime, true);
subframe->setSurface(Filename, true, 0, 0, 0, LifeTime, true);
if (subframe->_surface == NULL) {
Game->LOG(0, "Error loading simple sprite '%s'", Filename);
ret = E_FAIL;
@ -569,8 +569,8 @@ HRESULT CBSprite::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CBFrame *Frame = new CBFrame(Game);
if (Filename != NULL) {
CBSubFrame *Sub = new CBSubFrame(Game);
if (SUCCEEDED(Sub->SetSurface(Filename))) {
Sub->SetDefaultRect();
if (SUCCEEDED(Sub->setSurface(Filename))) {
Sub->setDefaultRect();
Frame->_subframes.Add(Sub);
} else delete Sub;
}
@ -595,7 +595,7 @@ HRESULT CBSprite::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *Thi
CBFrame *Frame = new CBFrame(Game);
if (Filename != NULL) {
CBSubFrame *Sub = new CBSubFrame(Game);
if (SUCCEEDED(Sub->SetSurface(Filename))) Frame->_subframes.Add(Sub);
if (SUCCEEDED(Sub->setSurface(Filename))) Frame->_subframes.Add(Sub);
else delete Sub;
}

View File

@ -68,7 +68,7 @@ CBSubFrame::CBSubFrame(CBGame *inGame): CBScriptable(inGame, true) {
//////////////////////////////////////////////////////////////////////////
CBSubFrame::~CBSubFrame() {
if (_surface) Game->_surfaceStorage->RemoveSurface(_surface);
if (_surface) Game->_surfaceStorage->removeSurface(_surface);
delete[] _surfaceFilename;
_surfaceFilename = NULL;
}
@ -90,7 +90,7 @@ TOKEN_DEF(EDITOR_SELECTED)
TOKEN_DEF(EDITOR_PROPERTY)
TOKEN_DEF_END
//////////////////////////////////////////////////////////////////////
HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
HRESULT CBSubFrame::loadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
TOKEN_TABLE_START(commands)
TOKEN_TABLE(IMAGE)
TOKEN_TABLE(TRANSPARENT)
@ -182,8 +182,8 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
}
if (surface_file != NULL) {
if (custo_trans) SetSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
else SetSurface(surface_file, true, 0, 0, 0, LifeTime, KeepLoaded);
if (custo_trans) setSurface(surface_file, false, r, g, b, LifeTime, KeepLoaded);
else setSurface(surface_file, true, 0, 0, 0, LifeTime, KeepLoaded);
}
_alpha = DRGBA(ar, ag, ab, alpha);
@ -196,7 +196,7 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
return E_FAIL;
}
*/
if (CBPlatform::IsRectEmpty(&rect)) SetDefaultRect();
if (CBPlatform::IsRectEmpty(&rect)) setDefaultRect();
else _rect = rect;
return S_OK;
@ -204,7 +204,7 @@ HRESULT CBSubFrame::LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded) {
//////////////////////////////////////////////////////////////////////
HRESULT CBSubFrame::Draw(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, bool Precise, uint32 Alpha, float Rotate, TSpriteBlendMode BlendMode) {
HRESULT CBSubFrame::draw(int X, int Y, CBObject *Register, float ZoomX, float ZoomY, bool Precise, uint32 Alpha, float Rotate, TSpriteBlendMode BlendMode) {
if (!_surface) return S_OK;
if (Register != NULL && !_decoration) {
@ -233,7 +233,7 @@ HRESULT CBSubFrame::Draw(int X, int Y, CBObject *Register, float ZoomX, float Zo
//////////////////////////////////////////////////////////////////////////
bool CBSubFrame::GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float ScaleY) {
bool CBSubFrame::getBoundingRect(LPRECT Rect, int X, int Y, float ScaleX, float ScaleY) {
if (!Rect) return false;
float RatioX = ScaleX / 100.0f;
@ -302,7 +302,7 @@ HRESULT CBSubFrame::saveAsText(CBDynBuffer *Buffer, int Indent, bool Complete) {
//////////////////////////////////////////////////////////////////////////
void CBSubFrame::SetDefaultRect() {
void CBSubFrame::setDefaultRect() {
if (_surface) {
CBPlatform::SetRect(&_rect, 0, 0, _surface->getWidth(), _surface->getHeight());
} else CBPlatform::SetRectEmpty(&_rect);
@ -363,14 +363,14 @@ HRESULT CBSubFrame::scCallMethod(CScScript *Script, CScStack *Stack, CScStack *T
CScValue *Val = Stack->Pop();
if (Val->IsNULL()) {
if (_surface) Game->_surfaceStorage->RemoveSurface(_surface);
if (_surface) Game->_surfaceStorage->removeSurface(_surface);
delete[] _surfaceFilename;
_surfaceFilename = NULL;
Stack->PushBool(true);
} else {
const char *Filename = Val->GetString();
if (SUCCEEDED(SetSurface(Filename))) {
SetDefaultRect();
if (SUCCEEDED(setSurface(Filename))) {
setDefaultRect();
Stack->PushBool(true);
} else Stack->PushBool(false);
}
@ -549,16 +549,16 @@ const char *CBSubFrame::scToString() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSubFrame::SetSurface(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
HRESULT CBSubFrame::setSurface(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
if (_surface) {
Game->_surfaceStorage->RemoveSurface(_surface);
Game->_surfaceStorage->removeSurface(_surface);
_surface = NULL;
}
delete[] _surfaceFilename;
_surfaceFilename = NULL;
_surface = Game->_surfaceStorage->AddSurface(Filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
_surface = Game->_surfaceStorage->addSurface(Filename, default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
if (_surface) {
_surfaceFilename = new char[strlen(Filename) + 1];
strcpy(_surfaceFilename, Filename);
@ -576,12 +576,12 @@ HRESULT CBSubFrame::SetSurface(const char *Filename, bool default_ck, byte ck_re
//////////////////////////////////////////////////////////////////////////
HRESULT CBSubFrame::SetSurfaceSimple() {
HRESULT CBSubFrame::setSurfaceSimple() {
if (!_surfaceFilename) {
_surface = NULL;
return S_OK;
}
_surface = Game->_surfaceStorage->AddSurface(_surfaceFilename, _cKDefault, _cKRed, _cKGreen, _cKBlue, _lifeTime, _keepLoaded);
_surface = Game->_surfaceStorage->addSurface(_surfaceFilename, _cKDefault, _cKRed, _cKGreen, _cKBlue, _lifeTime, _keepLoaded);
if (_surface) return S_OK;
else return E_FAIL;
}

View File

@ -41,18 +41,19 @@ public:
bool _mirrorX;
bool _mirrorY;
bool _decoration;
HRESULT SetSurface(const char *Filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool KeepLoaded = false);
HRESULT SetSurfaceSimple();
HRESULT setSurface(const char *Filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool KeepLoaded = false);
HRESULT setSurfaceSimple();
DECLARE_PERSISTENT(CBSubFrame, CBScriptable)
void SetDefaultRect();
void setDefaultRect();
uint32 _transparent;
HRESULT saveAsText(CBDynBuffer *Buffer, int Indent, bool Complete = true);
HRESULT saveAsText(CBDynBuffer *buffer, int indent) { return saveAsText(buffer, indent, true); }
HRESULT saveAsText(CBDynBuffer *buffer, int indent, bool complete);
bool _editorSelected;
CBSubFrame(CBGame *inGame);
virtual ~CBSubFrame();
HRESULT LoadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded);
HRESULT Draw(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, bool Precise = true, uint32 Alpha = 0xFFFFFFFF, float Rotate = 0.0f, TSpriteBlendMode BlendMode = BLEND_NORMAL);
bool GetBoundingRect(LPRECT Rect, int X, int Y, float ScaleX = 100, float ScaleY = 100);
HRESULT loadBuffer(byte *Buffer, int LifeTime, bool KeepLoaded);
HRESULT draw(int X, int Y, CBObject *Register = NULL, float ZoomX = 100, float ZoomY = 100, bool Precise = true, uint32 Alpha = 0xFFFFFFFF, float Rotate = 0.0f, TSpriteBlendMode BlendMode = BLEND_NORMAL);
bool getBoundingRect(LPRECT Rect, int X, int Y, float ScaleX = 100, float ScaleY = 100);
int _hotspotX;
int _hotspotY;

View File

@ -63,10 +63,10 @@ HRESULT CBSurfaceStorage::cleanup(bool Warn) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::InitLoop() {
HRESULT CBSurfaceStorage::initLoop() {
if (Game->_smartCache && Game->_liveTimer - _lastCleanupTime >= Game->_surfaceGCCycleTime) {
_lastCleanupTime = Game->_liveTimer;
SortSurfaces();
sortSurfaces();
for (int i = 0; i < _surfaces.GetSize(); i++) {
if (_surfaces[i]->_lifeTime <= 0) break;
@ -81,7 +81,7 @@ HRESULT CBSurfaceStorage::InitLoop() {
//////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::RemoveSurface(CBSurface *surface) {
HRESULT CBSurfaceStorage::removeSurface(CBSurface *surface) {
for (int i = 0; i < _surfaces.GetSize(); i++) {
if (_surfaces[i] == surface) {
_surfaces[i]->_referenceCount--;
@ -97,7 +97,7 @@ HRESULT CBSurfaceStorage::RemoveSurface(CBSurface *surface) {
//////////////////////////////////////////////////////////////////////
CBSurface *CBSurfaceStorage::AddSurface(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
CBSurface *CBSurfaceStorage::addSurface(const char *Filename, bool default_ck, byte ck_red, byte ck_green, byte ck_blue, int LifeTime, bool KeepLoaded) {
for (int i = 0; i < _surfaces.GetSize(); i++) {
if (scumm_stricmp(_surfaces[i]->_filename, Filename) == 0) {
_surfaces[i]->_referenceCount++;
@ -109,9 +109,9 @@ CBSurface *CBSurfaceStorage::AddSurface(const char *Filename, bool default_ck, b
if (!File) {
if (Filename) Game->LOG(0, "Missing image: '%s'", Filename);
if (Game->_dEBUG_DebugMode)
return AddSurface("invalid_debug.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
return addSurface("invalid_debug.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
else
return AddSurface("invalid.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
return addSurface("invalid.bmp", default_ck, ck_red, ck_green, ck_blue, LifeTime, KeepLoaded);
} else Game->_fileManager->CloseFile(File);
@ -133,7 +133,7 @@ CBSurface *CBSurfaceStorage::AddSurface(const char *Filename, bool default_ck, b
//////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::RestoreAll() {
HRESULT CBSurfaceStorage::restoreAll() {
HRESULT ret;
for (int i = 0; i < _surfaces.GetSize(); i++) {
ret = _surfaces[i]->restore();
@ -163,14 +163,14 @@ HRESULT CBSurfaceStorage::persist(CBPersistMgr *persistMgr)
//////////////////////////////////////////////////////////////////////////
HRESULT CBSurfaceStorage::SortSurfaces() {
qsort(_surfaces.GetData(), _surfaces.GetSize(), sizeof(CBSurface *), SurfaceSortCB);
HRESULT CBSurfaceStorage::sortSurfaces() {
qsort(_surfaces.GetData(), _surfaces.GetSize(), sizeof(CBSurface *), surfaceSortCB);
return S_OK;
}
//////////////////////////////////////////////////////////////////////////
int CBSurfaceStorage::SurfaceSortCB(const void *arg1, const void *arg2) {
int CBSurfaceStorage::surfaceSortCB(const void *arg1, const void *arg2) {
CBSurface *s1 = *((CBSurface **)arg1);
CBSurface *s2 = *((CBSurface **)arg2);

View File

@ -38,15 +38,15 @@ class CBSurface;
class CBSurfaceStorage : public CBBase {
public:
uint32 _lastCleanupTime;
HRESULT InitLoop();
HRESULT SortSurfaces();
static int SurfaceSortCB(const void *arg1, const void *arg2);
HRESULT initLoop();
HRESULT sortSurfaces();
static int surfaceSortCB(const void *arg1, const void *arg2);
HRESULT cleanup(bool Warn = false);
//DECLARE_PERSISTENT(CBSurfaceStorage, CBBase);
HRESULT RestoreAll();
CBSurface *AddSurface(const char *Filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool KeepLoaded = false);
HRESULT RemoveSurface(CBSurface *surface);
HRESULT restoreAll();
CBSurface *addSurface(const char *Filename, bool default_ck = true, byte ck_red = 0, byte ck_green = 0, byte ck_blue = 0, int LifeTime = -1, bool keepLoaded = false);
HRESULT removeSurface(CBSurface *surface);
CBSurfaceStorage(CBGame *inGame);
virtual ~CBSurfaceStorage();

View File

@ -58,21 +58,21 @@ bool CBTransitionMgr::isReady() {
//////////////////////////////////////////////////////////////////////////
HRESULT CBTransitionMgr::Start(TTransitionType Type, bool NonInteractive) {
HRESULT CBTransitionMgr::start(TTransitionType type, bool nonInteractive) {
if (_state != TRANS_MGR_READY) return S_OK;
if (Type == TRANSITION_NONE || Type >= NUM_TRANSITION_TYPES) {
if (type == TRANSITION_NONE || type >= NUM_TRANSITION_TYPES) {
_state = TRANS_MGR_READY;
return S_OK;
}
if (NonInteractive) {
if (nonInteractive) {
_preserveInteractive = true;
_origInteractive = Game->_interactive;
Game->_interactive = false;
} else _preserveInteractive;
_type = Type;
_type = type;
_state = TRANS_MGR_RUNNING;
_started = false;

View File

@ -40,7 +40,7 @@ public:
bool _origInteractive;
bool _preserveInteractive;
HRESULT update();
HRESULT Start(TTransitionType Type, bool NonInteractive = false);
HRESULT start(TTransitionType Type, bool NonInteractive = false);
bool isReady();
TTransMgrState _state;
CBTransitionMgr(CBGame *inGame);

View File

@ -63,7 +63,7 @@ HRESULT CBViewport::persist(CBPersistMgr *persistMgr) {
//////////////////////////////////////////////////////////////////////////
HRESULT CBViewport::SetRect(int left, int top, int right, int bottom, bool NoCheck) {
HRESULT CBViewport::setRect(int left, int top, int right, int bottom, bool NoCheck) {
if (!NoCheck) {
left = MAX(left, 0);
top = MAX(top, 0);
@ -79,13 +79,13 @@ HRESULT CBViewport::SetRect(int left, int top, int right, int bottom, bool NoChe
//////////////////////////////////////////////////////////////////////////
RECT *CBViewport::GetRect() {
RECT *CBViewport::getRect() {
return &_rect;
}
//////////////////////////////////////////////////////////////////////////
int CBViewport::GetWidth() {
int CBViewport::getWidth() {
return _rect.right - _rect.left;
}

View File

@ -37,9 +37,9 @@ class CBObject;
class CBViewport : public CBBase {
public:
int getHeight();
int GetWidth();
RECT *GetRect();
HRESULT SetRect(int left, int top, int right, int bottom, bool NoCheck = false);
int getWidth();
RECT *getRect();
HRESULT setRect(int left, int top, int right, int bottom, bool NoCheck = false);
DECLARE_PERSISTENT(CBViewport, CBBase)
int _offsetY;
int _offsetX;

View File

@ -201,7 +201,7 @@ HRESULT CUITiledImage::LoadBuffer(byte *Buffer, bool Complete) {
case TOKEN_IMAGE:
delete _image;
_image = new CBSubFrame(Game);
if (!_image || FAILED(_image->SetSurface((char *)params))) {
if (!_image || FAILED(_image->setSurface((char *)params))) {
delete _image;
_image = NULL;
cmd = PARSERR_GENERIC;

View File

@ -160,7 +160,7 @@ HRESULT CUIWindow::display(int OffsetX, int OffsetY) {
if (_clipContents) {
if (!_viewport) _viewport = new CBViewport(Game);
if (_viewport) {
_viewport->SetRect(_posX + OffsetX, _posY + OffsetY, _posX + _width + OffsetX, _posY + _height + OffsetY);
_viewport->setRect(_posX + OffsetX, _posY + OffsetY, _posX + _width + OffsetX, _posY + _height + OffsetY);
Game->PushViewport(_viewport);
PopViewport = true;
}