[Scummvm-cvs-logs] SF.net SVN: scummvm:[53310] scummvm/trunk/engines/sword25
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Oct 13 01:32:32 CEST 2010
Revision: 53310
http://scummvm.svn.sourceforge.net/scummvm/?rev=53310&view=rev
Author: sev
Date: 2010-10-12 23:32:32 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
SWORD25: Comply to the code conventions for several classes
Modified Paths:
--------------
scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
scummvm/trunk/engines/sword25/gfx/animation.cpp
scummvm/trunk/engines/sword25/gfx/animation.h
scummvm/trunk/engines/sword25/gfx/animationdescription.cpp
scummvm/trunk/engines/sword25/gfx/animationdescription.h
scummvm/trunk/engines/sword25/gfx/animationresource.cpp
scummvm/trunk/engines/sword25/gfx/animationresource.h
scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp
scummvm/trunk/engines/sword25/gfx/animationtemplate.h
scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp
scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h
scummvm/trunk/engines/sword25/gfx/bitmap.cpp
scummvm/trunk/engines/sword25/gfx/bitmap.h
scummvm/trunk/engines/sword25/gfx/bitmapresource.cpp
scummvm/trunk/engines/sword25/gfx/bitmapresource.h
scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp
scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h
scummvm/trunk/engines/sword25/gfx/fontresource.cpp
scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
scummvm/trunk/engines/sword25/gfx/graphicengine.h
scummvm/trunk/engines/sword25/gfx/graphicengine_script.cpp
scummvm/trunk/engines/sword25/gfx/image/image.h
scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
scummvm/trunk/engines/sword25/gfx/image/vectorimage.h
scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp
scummvm/trunk/engines/sword25/gfx/opengl/glimage.h
scummvm/trunk/engines/sword25/gfx/opengl/glvectorimageblit.cpp
scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp
scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.h
scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp
scummvm/trunk/engines/sword25/gfx/opengl/swimage.h
scummvm/trunk/engines/sword25/gfx/panel.cpp
scummvm/trunk/engines/sword25/gfx/panel.h
scummvm/trunk/engines/sword25/gfx/renderobject.cpp
scummvm/trunk/engines/sword25/gfx/renderobject.h
scummvm/trunk/engines/sword25/gfx/renderobjectmanager.cpp
scummvm/trunk/engines/sword25/gfx/renderobjectmanager.h
scummvm/trunk/engines/sword25/gfx/renderobjectptr.h
scummvm/trunk/engines/sword25/gfx/rootrenderobject.h
scummvm/trunk/engines/sword25/gfx/staticbitmap.cpp
scummvm/trunk/engines/sword25/gfx/staticbitmap.h
scummvm/trunk/engines/sword25/gfx/text.cpp
scummvm/trunk/engines/sword25/gfx/text.h
scummvm/trunk/engines/sword25/gfx/timedrenderobject.cpp
scummvm/trunk/engines/sword25/gfx/timedrenderobject.h
scummvm/trunk/engines/sword25/input/scummvminput.cpp
scummvm/trunk/engines/sword25/input/scummvminput.h
scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.cpp
scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.h
scummvm/trunk/engines/sword25/kernel/objectregistry.h
scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.cpp
scummvm/trunk/engines/sword25/kernel/outputpersistenceblock.h
scummvm/trunk/engines/sword25/kernel/persistable.h
scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp
scummvm/trunk/engines/sword25/kernel/resmanager.cpp
scummvm/trunk/engines/sword25/kernel/resource.cpp
scummvm/trunk/engines/sword25/kernel/resource.h
scummvm/trunk/engines/sword25/math/geometry_script.cpp
scummvm/trunk/engines/sword25/math/polygon.cpp
scummvm/trunk/engines/sword25/math/polygon.h
scummvm/trunk/engines/sword25/math/region.cpp
scummvm/trunk/engines/sword25/math/region.h
scummvm/trunk/engines/sword25/math/regionregistry.cpp
scummvm/trunk/engines/sword25/math/regionregistry.h
scummvm/trunk/engines/sword25/math/walkregion.cpp
scummvm/trunk/engines/sword25/math/walkregion.h
scummvm/trunk/engines/sword25/script/luascript.cpp
scummvm/trunk/engines/sword25/script/luascript.h
scummvm/trunk/engines/sword25/script/script.h
scummvm/trunk/engines/sword25/sfx/fmodexsound.cpp
scummvm/trunk/engines/sword25/sfx/fmodexsound.h
Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -67,35 +67,35 @@
// Ausgabebitmap erstellen
GraphicEngine *pGfx = Kernel::GetInstance()->GetGfx();
- _outputBitmap = pGfx->GetMainPanel()->AddDynamicBitmap(_decoder.getWidth(), _decoder.getHeight());
- if (!_outputBitmap.IsValid()) {
+ _outputBitmap = pGfx->GetMainPanel()->addDynamicBitmap(_decoder.getWidth(), _decoder.getHeight());
+ if (!_outputBitmap.isValid()) {
BS_LOG_ERRORLN("Output bitmap for movie playback could not be created.");
return false;
}
// Skalierung des Ausgabebitmaps berechnen, so dass es m\xF6glichst viel Bildschirmfl\xE4che einnimmt.
- float ScreenToVideoWidth = (float) pGfx->GetDisplayWidth() / (float) _outputBitmap->GetWidth();
- float ScreenToVideoHeight = (float) pGfx->GetDisplayHeight() / (float) _outputBitmap->GetHeight();
- float ScaleFactor = MIN(ScreenToVideoWidth, ScreenToVideoHeight);
+ float screenToVideoWidth = (float)pGfx->GetDisplayWidth() / (float)_outputBitmap->getWidth();
+ float screenToVideoHeight = (float)pGfx->GetDisplayHeight() / (float)_outputBitmap->getHeight();
+ float scaleFactor = MIN(screenToVideoWidth, screenToVideoHeight);
- if (abs(ScaleFactor - 1.0f) < FLT_EPSILON)
- ScaleFactor = 1.0f;
+ if (abs(scaleFactor - 1.0f) < FLT_EPSILON)
+ scaleFactor = 1.0f;
- _outputBitmap->SetScaleFactor(ScaleFactor);
+ _outputBitmap->setScaleFactor(scaleFactor);
// Z-Wert setzen
- _outputBitmap->SetZ(z);
+ _outputBitmap->setZ(z);
// Ausgabebitmap auf dem Bildschirm zentrieren
- _outputBitmap->SetX((pGfx->GetDisplayWidth() - _outputBitmap->GetWidth()) / 2);
- _outputBitmap->SetY((pGfx->GetDisplayHeight() - _outputBitmap->GetHeight()) / 2);
+ _outputBitmap->setX((pGfx->GetDisplayWidth() - _outputBitmap->getWidth()) / 2);
+ _outputBitmap->setY((pGfx->GetDisplayHeight() - _outputBitmap->getHeight()) / 2);
return true;
}
bool MoviePlayer::UnloadMovie() {
_decoder.close();
- _outputBitmap.Erase();
+ _outputBitmap.erase();
return true;
}
@@ -117,7 +117,7 @@
// Transfer the next frame
assert(s->bytesPerPixel == 4);
byte *frameData = (byte *)s->getBasePtr(0, 0);
- _outputBitmap->SetContent(frameData, s->pitch * s->h, 0, s->pitch);
+ _outputBitmap->setContent(frameData, s->pitch * s->h, 0, s->pitch);
}
}
@@ -131,19 +131,19 @@
float MoviePlayer::GetScaleFactor() {
if (_decoder.isVideoLoaded())
- return _outputBitmap->GetScaleFactorX();
+ return _outputBitmap->getScaleFactorX();
else
return 0;
}
void MoviePlayer::SetScaleFactor(float scaleFactor) {
if (_decoder.isVideoLoaded()) {
- _outputBitmap->SetScaleFactor(scaleFactor);
+ _outputBitmap->setScaleFactor(scaleFactor);
// Ausgabebitmap auf dem Bildschirm zentrieren
GraphicEngine *gfxPtr = Kernel::GetInstance()->GetGfx();
- _outputBitmap->SetX((gfxPtr->GetDisplayWidth() - _outputBitmap->GetWidth()) / 2);
- _outputBitmap->SetY((gfxPtr->GetDisplayHeight() - _outputBitmap->GetHeight()) / 2);
+ _outputBitmap->setX((gfxPtr->GetDisplayWidth() - _outputBitmap->getWidth()) / 2);
+ _outputBitmap->setY((gfxPtr->GetDisplayHeight() - _outputBitmap->getHeight()) / 2);
}
}
Modified: scummvm/trunk/engines/sword25/gfx/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animation.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animation.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -57,17 +57,17 @@
Animation::Animation(RenderObjectPtr<RenderObject> ParentPtr, const Common::String &FileName) :
TimedRenderObject(ParentPtr, RenderObject::TYPE_ANIMATION) {
// Das BS_RenderObject konnte nicht erzeugt werden, daher muss an dieser Stelle abgebrochen werden.
- if (!m_InitSuccess) return;
+ if (!_initSuccess) return;
InitMembers();
// Vom negativen Fall ausgehen.
- m_InitSuccess = false;
+ _initSuccess = false;
InitializeAnimationResource(FileName);
// Erfolg signalisieren.
- m_InitSuccess = true;
+ _initSuccess = true;
}
// -----------------------------------------------------------------------------
@@ -75,17 +75,17 @@
Animation::Animation(RenderObjectPtr<RenderObject> ParentPtr, const AnimationTemplate &Template) :
TimedRenderObject(ParentPtr, RenderObject::TYPE_ANIMATION) {
// Das BS_RenderObject konnte nicht erzeugt werden, daher muss an dieser Stelle abgebrochen werden.
- if (!m_InitSuccess) return;
+ if (!_initSuccess) return;
InitMembers();
// Vom negativen Fall ausgehen.
- m_InitSuccess = false;
+ _initSuccess = false;
m_AnimationTemplateHandle = AnimationTemplate::Create(Template);
// Erfolg signalisieren.
- m_InitSuccess = true;
+ _initSuccess = true;
}
// -----------------------------------------------------------------------------
@@ -93,12 +93,12 @@
Animation::Animation(InputPersistenceBlock &Reader, RenderObjectPtr<RenderObject> ParentPtr, uint Handle) :
TimedRenderObject(ParentPtr, RenderObject::TYPE_ANIMATION, Handle) {
// Das BS_RenderObject konnte nicht erzeugt werden, daher muss an dieser Stelle abgebrochen werden.
- if (!m_InitSuccess) return;
+ if (!_initSuccess) return;
InitMembers();
// Objekt vom Stream laden.
- m_InitSuccess = Unpersist(Reader);
+ _initSuccess = unpersist(Reader);
}
// -----------------------------------------------------------------------------
@@ -125,11 +125,11 @@
m_Direction = FORWARD;
m_Running = false;
m_Finished = false;
- m_RelX = 0;
- m_RelY = 0;
- m_ScaleFactorX = 1.0f;
- m_ScaleFactorY = 1.0f;
- m_ModulationColor = 0xffffffff;
+ _relX = 0;
+ _relY = 0;
+ _scaleFactorX = 1.0f;
+ _scaleFactorY = 1.0f;
+ _modulationColor = 0xffffffff;
m_AnimationResourcePtr = 0;
m_AnimationTemplateHandle = 0;
m_FramesLocked = false;
@@ -140,7 +140,7 @@
Animation::~Animation() {
if (GetAnimationDescription()) {
Stop();
- GetAnimationDescription()->Unlock();
+ GetAnimationDescription()->unlock();
}
// Delete Callbacks
@@ -183,29 +183,29 @@
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- if (Nr >= animationDescriptionPtr->GetFrameCount()) {
+ if (Nr >= animationDescriptionPtr->getFrameCount()) {
BS_LOG_ERRORLN("Tried to set animation to illegal frame (%d). Value must be between 0 and %d.",
- Nr, animationDescriptionPtr->GetFrameCount());
+ Nr, animationDescriptionPtr->getFrameCount());
return;
}
m_CurrentFrame = Nr;
m_CurrentFrameTime = 0;
ComputeCurrentCharacteristics();
- ForceRefresh();
+ forceRefresh();
}
// -----------------------------------------------------------------------------
// Rendern
// -----------------------------------------------------------------------------
-bool Animation::DoRender() {
+bool Animation::doRender() {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- BS_ASSERT(m_CurrentFrame < animationDescriptionPtr->GetFrameCount());
+ BS_ASSERT(m_CurrentFrame < animationDescriptionPtr->getFrameCount());
// Bitmap des aktuellen Frames holen
- Resource *pResource = Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(m_CurrentFrame).FileName);
+ Resource *pResource = Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->getFrame(m_CurrentFrame).FileName);
BS_ASSERT(pResource);
BS_ASSERT(pResource->GetType() == Resource::TYPE_BITMAP);
BitmapResource *pBitmapResource = static_cast<BitmapResource *>(pResource);
@@ -216,20 +216,20 @@
// Bitmap zeichnen
bool Result;
- if (IsScalingAllowed() && (m_Width != pBitmapResource->GetWidth() || m_Height != pBitmapResource->GetHeight())) {
- Result = pBitmapResource->Blit(m_AbsoluteX, m_AbsoluteY,
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipV ? BitmapResource::FLIP_V : 0) |
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipH ? BitmapResource::FLIP_H : 0),
- 0, m_ModulationColor, m_Width, m_Height);
+ if (isScalingAllowed() && (_width != pBitmapResource->getWidth() || _height != pBitmapResource->getHeight())) {
+ Result = pBitmapResource->blit(_absoluteX, _absoluteY,
+ (animationDescriptionPtr->getFrame(m_CurrentFrame).FlipV ? BitmapResource::FLIP_V : 0) |
+ (animationDescriptionPtr->getFrame(m_CurrentFrame).FlipH ? BitmapResource::FLIP_H : 0),
+ 0, _modulationColor, _width, _height);
} else {
- Result = pBitmapResource->Blit(m_AbsoluteX, m_AbsoluteY,
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipV ? BitmapResource::FLIP_V : 0) |
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipH ? BitmapResource::FLIP_H : 0),
- 0, m_ModulationColor, -1, -1);
+ Result = pBitmapResource->blit(_absoluteX, _absoluteY,
+ (animationDescriptionPtr->getFrame(m_CurrentFrame).FlipV ? BitmapResource::FLIP_V : 0) |
+ (animationDescriptionPtr->getFrame(m_CurrentFrame).FlipH ? BitmapResource::FLIP_H : 0),
+ 0, _modulationColor, -1, -1);
}
// Resource freigeben
- pBitmapResource->Release();
+ pBitmapResource->release();
return Result;
}
@@ -238,7 +238,7 @@
// Frame Notifikation
// -----------------------------------------------------------------------------
-void Animation::FrameNotification(int TimeElapsed) {
+void Animation::frameNotification(int TimeElapsed) {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
BS_ASSERT(TimeElapsed >= 0);
@@ -249,10 +249,10 @@
m_CurrentFrameTime += TimeElapsed;
// Anzahl an zu \xFCberpringenden Frames bestimmen
- int SkipFrames = animationDescriptionPtr->GetMillisPerFrame() == 0 ? 0 : m_CurrentFrameTime / animationDescriptionPtr->GetMillisPerFrame();
+ int SkipFrames = animationDescriptionPtr->getMillisPerFrame() == 0 ? 0 : m_CurrentFrameTime / animationDescriptionPtr->getMillisPerFrame();
// Neue Frame-Restzeit bestimmen
- m_CurrentFrameTime -= animationDescriptionPtr->GetMillisPerFrame() * SkipFrames;
+ m_CurrentFrameTime -= animationDescriptionPtr->getMillisPerFrame() * SkipFrames;
// Neuen Frame bestimmen (je nach aktuellener Abspielrichtung wird addiert oder subtrahiert)
int TmpCurFrame = m_CurrentFrame;
@@ -280,10 +280,10 @@
}
// Ein Unterlauf darf nur auftreten, wenn der Animationstyp JOJO ist.
- BS_ASSERT(animationDescriptionPtr->GetAnimationType() == AT_JOJO);
+ BS_ASSERT(animationDescriptionPtr->getAnimationType() == AT_JOJO);
TmpCurFrame = - TmpCurFrame;
m_Direction = FORWARD;
- } else if (static_cast<uint>(TmpCurFrame) >= animationDescriptionPtr->GetFrameCount()) {
+ } else if (static_cast<uint>(TmpCurFrame) >= animationDescriptionPtr->getFrameCount()) {
// Loop-Point Callbacks
for (uint i = 0; i < m_LoopPointCallbacks.size();) {
if ((m_LoopPointCallbacks[i].Callback)(m_LoopPointCallbacks[i].Data) == false) {
@@ -292,19 +292,19 @@
i++;
}
- switch (animationDescriptionPtr->GetAnimationType()) {
+ switch (animationDescriptionPtr->getAnimationType()) {
case AT_ONESHOT:
- TmpCurFrame = animationDescriptionPtr->GetFrameCount() - 1;
+ TmpCurFrame = animationDescriptionPtr->getFrameCount() - 1;
m_Finished = true;
Pause();
break;
case AT_LOOP:
- TmpCurFrame = TmpCurFrame % animationDescriptionPtr->GetFrameCount();
+ TmpCurFrame = TmpCurFrame % animationDescriptionPtr->getFrameCount();
break;
case AT_JOJO:
- TmpCurFrame = animationDescriptionPtr->GetFrameCount() - (TmpCurFrame % animationDescriptionPtr->GetFrameCount()) - 1;
+ TmpCurFrame = animationDescriptionPtr->getFrameCount() - (TmpCurFrame % animationDescriptionPtr->getFrameCount()) - 1;
m_Direction = BACKWARD;
break;
@@ -314,9 +314,9 @@
}
if ((int)m_CurrentFrame != TmpCurFrame) {
- ForceRefresh();
+ forceRefresh();
- if (animationDescriptionPtr->GetFrame(m_CurrentFrame).Action != "") {
+ if (animationDescriptionPtr->getFrame(m_CurrentFrame).Action != "") {
// Action Callbacks
for (uint i = 0; i < m_ActionCallbacks.size();) {
if ((m_ActionCallbacks[i].Callback)(m_ActionCallbacks[i].Data) == false) {
@@ -333,7 +333,7 @@
// Gr\xF6\xDFe und Position der Animation anhand des aktuellen Frames bestimmen
ComputeCurrentCharacteristics();
- BS_ASSERT(m_CurrentFrame < animationDescriptionPtr->GetFrameCount());
+ BS_ASSERT(m_CurrentFrame < animationDescriptionPtr->getFrameCount());
BS_ASSERT(m_CurrentFrameTime >= 0);
}
@@ -342,7 +342,7 @@
void Animation::ComputeCurrentCharacteristics() {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- const AnimationResource::Frame &CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
+ const AnimationResource::Frame &CurFrame = animationDescriptionPtr->getFrame(m_CurrentFrame);
Resource *pResource = Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
BS_ASSERT(pResource);
@@ -350,16 +350,16 @@
BitmapResource *pBitmap = static_cast<BitmapResource *>(pResource);
// Gr\xF6\xDFe des Bitmaps auf die Animation \xFCbertragen
- m_Width = static_cast<int>(pBitmap->GetWidth() * m_ScaleFactorX);
- m_Height = static_cast<int>(pBitmap->GetHeight() * m_ScaleFactorY);
+ _width = static_cast<int>(pBitmap->getWidth() * _scaleFactorX);
+ _height = static_cast<int>(pBitmap->getHeight() * _scaleFactorY);
// Position anhand des Hotspots berechnen und setzen
- int PosX = m_RelX + ComputeXModifier();
- int PosY = m_RelY + ComputeYModifier();
+ int PosX = _relX + ComputeXModifier();
+ int PosY = _relY + ComputeYModifier();
- RenderObject::SetPos(PosX, PosY);
+ RenderObject::setPos(PosX, PosY);
- pBitmap->Release();
+ pBitmap->release();
}
// -----------------------------------------------------------------------------
@@ -368,8 +368,8 @@
if (!m_FramesLocked) {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- for (uint i = 0; i < animationDescriptionPtr->GetFrameCount(); ++i) {
- if (!Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(i).FileName)) {
+ for (uint i = 0; i < animationDescriptionPtr->getFrameCount(); ++i) {
+ if (!Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->getFrame(i).FileName)) {
BS_LOG_ERRORLN("Could not lock all animation frames.");
return false;
}
@@ -387,16 +387,17 @@
if (m_FramesLocked) {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- for (uint i = 0; i < animationDescriptionPtr->GetFrameCount(); ++i) {
+ for (uint i = 0; i < animationDescriptionPtr->getFrameCount(); ++i) {
Resource *pResource;
- if (!(pResource = Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(i).FileName))) {
+ if (!(pResource = Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->getFrame(i).FileName))) {
BS_LOG_ERRORLN("Could not unlock all animation frames.");
return false;
}
// Zwei mal freigeben um den Request von LockAllFrames() und den jetzigen Request aufzuheben
- pResource->Release();
- if (pResource->GetLockCount()) pResource->Release();
+ pResource->release();
+ if (pResource->GetLockCount())
+ pResource->release();
}
m_FramesLocked = false;
@@ -409,75 +410,75 @@
// Getter
// -----------------------------------------------------------------------------
-Animation::ANIMATION_TYPES Animation::GetAnimationType() const {
+Animation::ANIMATION_TYPES Animation::getAnimationType() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- return animationDescriptionPtr->GetAnimationType();
+ return animationDescriptionPtr->getAnimationType();
}
// -----------------------------------------------------------------------------
-int Animation::GetFPS() const {
+int Animation::getFPS() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- return animationDescriptionPtr->GetFPS();
+ return animationDescriptionPtr->getFPS();
}
// -----------------------------------------------------------------------------
-int Animation::GetFrameCount() const {
+int Animation::getFrameCount() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- return animationDescriptionPtr->GetFrameCount();
+ return animationDescriptionPtr->getFrameCount();
}
// -----------------------------------------------------------------------------
-bool Animation::IsScalingAllowed() const {
+bool Animation::isScalingAllowed() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- return animationDescriptionPtr->IsScalingAllowed();
+ return animationDescriptionPtr->isScalingAllowed();
}
// -----------------------------------------------------------------------------
-bool Animation::IsAlphaAllowed() const {
+bool Animation::isAlphaAllowed() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- return animationDescriptionPtr->IsAlphaAllowed();
+ return animationDescriptionPtr->isAlphaAllowed();
}
// -----------------------------------------------------------------------------
-bool Animation::IsColorModulationAllowed() const {
+bool Animation::isColorModulationAllowed() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- return animationDescriptionPtr->IsColorModulationAllowed();
+ return animationDescriptionPtr->isColorModulationAllowed();
}
// -----------------------------------------------------------------------------
// Positionieren
// -----------------------------------------------------------------------------
-void Animation::SetPos(int RelX, int RelY) {
- m_RelX = RelX;
- m_RelY = RelY;
+void Animation::setPos(int relX, int relY) {
+ _relX = relX;
+ _relY = relY;
ComputeCurrentCharacteristics();
}
// -----------------------------------------------------------------------------
-void Animation::SetX(int RelX) {
- m_RelX = RelX;
+void Animation::setX(int relX) {
+ _relX = relX;
ComputeCurrentCharacteristics();
}
// -----------------------------------------------------------------------------
-void Animation::SetY(int RelY) {
- m_RelY = RelY;
+void Animation::setY(int relY) {
+ _relY = relY;
ComputeCurrentCharacteristics();
}
@@ -486,77 +487,79 @@
// Darstellungsart festlegen
// -----------------------------------------------------------------------------
-void Animation::SetAlpha(int Alpha) {
+void Animation::setAlpha(int alpha) {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- if (!animationDescriptionPtr->IsAlphaAllowed()) {
+ if (!animationDescriptionPtr->isAlphaAllowed()) {
BS_LOG_WARNINGLN("Tried to set alpha value on an animation that does not support alpha. Call was ignored.");
return;
}
- uint NewModulationColor = (m_ModulationColor & 0x00ffffff) | Alpha << 24;
- if (NewModulationColor != m_ModulationColor) {
- m_ModulationColor = NewModulationColor;
- ForceRefresh();
+ uint newModulationColor = (_modulationColor & 0x00ffffff) | alpha << 24;
+ if (newModulationColor != _modulationColor) {
+ _modulationColor = newModulationColor;
+ forceRefresh();
}
}
// -----------------------------------------------------------------------------
-void Animation::SetModulationColor(uint ModulationColor) {
+void Animation::setModulationColor(uint modulationColor) {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- if (!animationDescriptionPtr->IsColorModulationAllowed()) {
+ if (!animationDescriptionPtr->isColorModulationAllowed()) {
BS_LOG_WARNINGLN("Tried to set modulation color on an animation that does not support color modulation. Call was ignored");
return;
}
- uint NewModulationColor = (ModulationColor & 0x00ffffff) | (m_ModulationColor & 0xff000000);
- if (NewModulationColor != m_ModulationColor) {
- m_ModulationColor = NewModulationColor;
- ForceRefresh();
+ uint newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000);
+ if (newModulationColor != _modulationColor) {
+ _modulationColor = newModulationColor;
+ forceRefresh();
}
}
// -----------------------------------------------------------------------------
-void Animation::SetScaleFactor(float ScaleFactor) {
- SetScaleFactorX(ScaleFactor);
- SetScaleFactorY(ScaleFactor);
+void Animation::setScaleFactor(float scaleFactor) {
+ setScaleFactorX(scaleFactor);
+ setScaleFactorY(scaleFactor);
}
// -----------------------------------------------------------------------------
-void Animation::SetScaleFactorX(float ScaleFactorX) {
+void Animation::setScaleFactorX(float scaleFactorX) {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- if (!animationDescriptionPtr->IsScalingAllowed()) {
+ if (!animationDescriptionPtr->isScalingAllowed()) {
BS_LOG_WARNINGLN("Tried to set x scale factor on an animation that does not support scaling. Call was ignored");
return;
}
- if (ScaleFactorX != m_ScaleFactorX) {
- m_ScaleFactorX = ScaleFactorX;
- if (m_ScaleFactorX <= 0.0f) m_ScaleFactorX = 0.001f;
- ForceRefresh();
+ if (scaleFactorX != _scaleFactorX) {
+ _scaleFactorX = scaleFactorX;
+ if (_scaleFactorX <= 0.0f)
+ _scaleFactorX = 0.001f;
+ forceRefresh();
ComputeCurrentCharacteristics();
}
}
// -----------------------------------------------------------------------------
-void Animation::SetScaleFactorY(float ScaleFactorY) {
+void Animation::setScaleFactorY(float scaleFactorY) {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- if (!animationDescriptionPtr->IsScalingAllowed()) {
+ if (!animationDescriptionPtr->isScalingAllowed()) {
BS_LOG_WARNINGLN("Tried to set y scale factor on an animation that does not support scaling. Call was ignored");
return;
}
- if (ScaleFactorY != m_ScaleFactorY) {
- m_ScaleFactorY = ScaleFactorY;
- if (m_ScaleFactorY <= 0.0f) m_ScaleFactorY = 0.001f;
- ForceRefresh();
+ if (scaleFactorY != _scaleFactorY) {
+ _scaleFactorY = scaleFactorY;
+ if (_scaleFactorY <= 0.0f)
+ _scaleFactorY = 0.001f;
+ forceRefresh();
ComputeCurrentCharacteristics();
}
}
@@ -566,31 +569,31 @@
const Common::String &Animation::GetCurrentAction() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- return animationDescriptionPtr->GetFrame(m_CurrentFrame).Action;
+ return animationDescriptionPtr->getFrame(m_CurrentFrame).Action;
}
// -----------------------------------------------------------------------------
-int Animation::GetX() const {
- return m_RelX;
+int Animation::getX() const {
+ return _relX;
}
// -----------------------------------------------------------------------------
-int Animation::GetY() const {
- return m_RelY;
+int Animation::getY() const {
+ return _relY;
}
// -----------------------------------------------------------------------------
-int Animation::GetAbsoluteX() const {
- return m_AbsoluteX + (m_RelX - m_X);
+int Animation::getAbsoluteX() const {
+ return _absoluteX + (_relX - _x);
}
// -----------------------------------------------------------------------------
-int Animation::GetAbsoluteY() const {
- return m_AbsoluteY + (m_RelY - m_Y);
+int Animation::getAbsoluteY() const {
+ return _absoluteY + (_relY - _y);
}
// -----------------------------------------------------------------------------
@@ -598,17 +601,17 @@
int Animation::ComputeXModifier() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- const AnimationResource::Frame &CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
+ const AnimationResource::Frame &CurFrame = animationDescriptionPtr->getFrame(m_CurrentFrame);
Resource *pResource = Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
BS_ASSERT(pResource);
BS_ASSERT(pResource->GetType() == Resource::TYPE_BITMAP);
BitmapResource *pBitmap = static_cast<BitmapResource *>(pResource);
- int Result = CurFrame.FlipV ? - static_cast<int>((pBitmap->GetWidth() - 1 - CurFrame.HotspotX) * m_ScaleFactorX) :
- - static_cast<int>(CurFrame.HotspotX * m_ScaleFactorX);
+ int Result = CurFrame.FlipV ? - static_cast<int>((pBitmap->getWidth() - 1 - CurFrame.HotspotX) * _scaleFactorX) :
+ - static_cast<int>(CurFrame.HotspotX * _scaleFactorX);
- pBitmap->Release();
+ pBitmap->release();
return Result;
}
@@ -618,17 +621,17 @@
int Animation::ComputeYModifier() const {
AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- const AnimationResource::Frame &CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
+ const AnimationResource::Frame &CurFrame = animationDescriptionPtr->getFrame(m_CurrentFrame);
Resource *pResource = Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
BS_ASSERT(pResource);
BS_ASSERT(pResource->GetType() == Resource::TYPE_BITMAP);
BitmapResource *pBitmap = static_cast<BitmapResource *>(pResource);
- int Result = CurFrame.FlipH ? - static_cast<int>((pBitmap->GetHeight() - 1 - CurFrame.HotspotY) * m_ScaleFactorY) :
- - static_cast<int>(CurFrame.HotspotY * m_ScaleFactorY);
+ int Result = CurFrame.FlipH ? - static_cast<int>((pBitmap->getHeight() - 1 - CurFrame.HotspotY) * _scaleFactorY) :
+ - static_cast<int>(CurFrame.HotspotY * _scaleFactorY);
- pBitmap->Release();
+ pBitmap->release();
return Result;
}
@@ -666,13 +669,13 @@
void Animation::PersistCallbackVector(OutputPersistenceBlock &Writer, const Common::Array<ANIMATION_CALLBACK_DATA> & Vector) {
// Anzahl an Callbacks persistieren.
- Writer.Write(Vector.size());
+ Writer.write(Vector.size());
// Alle Callbacks einzeln persistieren.
Common::Array<ANIMATION_CALLBACK_DATA>::const_iterator It = Vector.begin();
while (It != Vector.end()) {
- Writer.Write(CallbackRegistry::getInstance().resolveCallbackPointer((void (*)(int))It->Callback));
- Writer.Write(It->Data);
+ Writer.write(CallbackRegistry::getInstance().resolveCallbackPointer((void (*)(int))It->Callback));
+ Writer.write(It->Data);
++It;
}
@@ -686,17 +689,17 @@
// Anzahl an Callbacks einlesen.
uint CallbackCount;
- Reader.Read(CallbackCount);
+ Reader.read(CallbackCount);
// Alle Callbacks einzeln wieder herstellen.
for (uint i = 0; i < CallbackCount; ++i) {
ANIMATION_CALLBACK_DATA CallbackData;
Common::String CallbackFunctionName;
- Reader.Read(CallbackFunctionName);
+ Reader.read(CallbackFunctionName);
CallbackData.Callback = reinterpret_cast<ANIMATION_CALLBACK>(CallbackRegistry::getInstance().resolveCallbackFunction(CallbackFunctionName));
- Reader.Read(CallbackData.Data);
+ Reader.read(CallbackData.Data);
Vector.push_back(CallbackData);
}
@@ -704,97 +707,97 @@
// -----------------------------------------------------------------------------
-bool Animation::Persist(OutputPersistenceBlock &Writer) {
- bool Result = true;
+bool Animation::persist(OutputPersistenceBlock &writer) {
+ bool result = true;
- Result &= RenderObject::Persist(Writer);
+ result &= RenderObject::persist(writer);
- Writer.Write(m_RelX);
- Writer.Write(m_RelY);
- Writer.Write(m_ScaleFactorX);
- Writer.Write(m_ScaleFactorY);
- Writer.Write(m_ModulationColor);
- Writer.Write(m_CurrentFrame);
- Writer.Write(m_CurrentFrameTime);
- Writer.Write(m_Running);
- Writer.Write(m_Finished);
- Writer.Write(static_cast<uint>(m_Direction));
+ writer.write(_relX);
+ writer.write(_relY);
+ writer.write(_scaleFactorX);
+ writer.write(_scaleFactorY);
+ writer.write(_modulationColor);
+ writer.write(m_CurrentFrame);
+ writer.write(m_CurrentFrameTime);
+ writer.write(m_Running);
+ writer.write(m_Finished);
+ writer.write(static_cast<uint>(m_Direction));
// Je nach Animationstyp entweder das Template oder die Ressource speichern.
if (m_AnimationResourcePtr) {
uint Marker = 0;
- Writer.Write(Marker);
- Writer.Write(m_AnimationResourcePtr->GetFileName());
+ writer.write(Marker);
+ writer.write(m_AnimationResourcePtr->getFileName());
} else if (m_AnimationTemplateHandle) {
uint Marker = 1;
- Writer.Write(Marker);
- Writer.Write(m_AnimationTemplateHandle);
+ writer.write(Marker);
+ writer.write(m_AnimationTemplateHandle);
} else {
BS_ASSERT(false);
}
- //Writer.Write(m_AnimationDescriptionPtr);
+ //writer.write(m_AnimationDescriptionPtr);
- Writer.Write(m_FramesLocked);
- PersistCallbackVector(Writer, m_LoopPointCallbacks);
- PersistCallbackVector(Writer, m_ActionCallbacks);
- PersistCallbackVector(Writer, m_DeleteCallbacks);
+ writer.write(m_FramesLocked);
+ PersistCallbackVector(writer, m_LoopPointCallbacks);
+ PersistCallbackVector(writer, m_ActionCallbacks);
+ PersistCallbackVector(writer, m_DeleteCallbacks);
- Result &= RenderObject::PersistChildren(Writer);
+ result &= RenderObject::persistChildren(writer);
- return Result;
+ return result;
}
// -----------------------------------------------------------------------------
-bool Animation::Unpersist(InputPersistenceBlock &Reader) {
- bool Result = true;
+bool Animation::unpersist(InputPersistenceBlock &reader) {
+ bool result = true;
- Result &= RenderObject::Unpersist(Reader);
+ result &= RenderObject::unpersist(reader);
- Reader.Read(m_RelX);
- Reader.Read(m_RelY);
- Reader.Read(m_ScaleFactorX);
- Reader.Read(m_ScaleFactorY);
- Reader.Read(m_ModulationColor);
- Reader.Read(m_CurrentFrame);
- Reader.Read(m_CurrentFrameTime);
- Reader.Read(m_Running);
- Reader.Read(m_Finished);
+ reader.read(_relX);
+ reader.read(_relY);
+ reader.read(_scaleFactorX);
+ reader.read(_scaleFactorY);
+ reader.read(_modulationColor);
+ reader.read(m_CurrentFrame);
+ reader.read(m_CurrentFrameTime);
+ reader.read(m_Running);
+ reader.read(m_Finished);
uint Direction;
- Reader.Read(Direction);
+ reader.read(Direction);
m_Direction = static_cast<DIRECTION>(Direction);
// Animationstyp einlesen.
uint Marker;
- Reader.Read(Marker);
+ reader.read(Marker);
if (Marker == 0) {
Common::String ResourceFilename;
- Reader.Read(ResourceFilename);
+ reader.read(ResourceFilename);
InitializeAnimationResource(ResourceFilename);
} else if (Marker == 1) {
- Reader.Read(m_AnimationTemplateHandle);
+ reader.read(m_AnimationTemplateHandle);
} else {
BS_ASSERT(false);
}
- Reader.Read(m_FramesLocked);
+ reader.read(m_FramesLocked);
if (m_FramesLocked) LockAllFrames();
- UnpersistCallbackVector(Reader, m_LoopPointCallbacks);
- UnpersistCallbackVector(Reader, m_ActionCallbacks);
- UnpersistCallbackVector(Reader, m_DeleteCallbacks);
+ UnpersistCallbackVector(reader, m_LoopPointCallbacks);
+ UnpersistCallbackVector(reader, m_ActionCallbacks);
+ UnpersistCallbackVector(reader, m_DeleteCallbacks);
- Result &= RenderObject::UnpersistChildren(Reader);
+ result &= RenderObject::unpersistChildren(reader);
- return Reader.IsGood() && Result;
+ return reader.isGood() && result;
}
// -----------------------------------------------------------------------------
AnimationDescription *Animation::GetAnimationDescription() const {
if (m_AnimationResourcePtr) return m_AnimationResourcePtr;
- else return AnimationTemplateRegistry::GetInstance().ResolveHandle(m_AnimationTemplateHandle);
+ else return AnimationTemplateRegistry::GetInstance().resolveHandle(m_AnimationTemplateHandle);
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/animation.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animation.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animation.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -43,7 +43,6 @@
// Forward declarations
class Kernel;
-class BS_PackageManager;
class AnimationResource;
class AnimationTemplate;
class AnimationDescription;
@@ -53,9 +52,9 @@
friend class RenderObject;
private:
- Animation(RenderObjectPtr<RenderObject> ParentPtr, const Common::String &FileName);
- Animation(RenderObjectPtr<RenderObject> ParentPtr, const AnimationTemplate &Template);
- Animation(InputPersistenceBlock &Reader, RenderObjectPtr<RenderObject> ParentPtr, uint Handle);
+ Animation(RenderObjectPtr<RenderObject> parentPtr, const Common::String &fileName);
+ Animation(RenderObjectPtr<RenderObject> parentPtr, const AnimationTemplate &template_);
+ Animation(InputPersistenceBlock &reader, RenderObjectPtr<RenderObject> parentPtr, uint handle);
public:
enum ANIMATION_TYPES {
@@ -71,77 +70,77 @@
void Stop();
void SetFrame(uint Nr);
- virtual void SetPos(int X, int Y);
- virtual void SetX(int X);
- virtual void SetY(int Y);
+ virtual void setPos(int x, int y);
+ virtual void setX(int x);
+ virtual void setY(int y);
- virtual int GetX() const;
- virtual int GetY() const;
- virtual int GetAbsoluteX() const;
- virtual int GetAbsoluteY() const;
+ virtual int getX() const;
+ virtual int getY() const;
+ virtual int getAbsoluteX() const;
+ virtual int getAbsoluteY() const;
/**
@brief Setzt den Alphawert der Animation.
@param Alpha der neue Alphawert der Animation (0 = keine Deckung, 255 = volle Deckung).
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsAlphaAllowed() true zur\xFCckgibt.
*/
- void SetAlpha(int Alpha);
+ void setAlpha(int alpha);
/**
@brief Setzt die Modulationfarbe der Animation.
@param Color eine 24-Bit Farbe, die die Modulationsfarbe der Animation festlegt.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsColorModulationAllowed() true zur\xFCckgibt.
*/
- void SetModulationColor(uint ModulationColor);
+ void setModulationColor(uint modulationColor);
/**
@brief Setzt den Skalierungsfaktor der Animation.
@param ScaleFactor der Faktor um den die Animation in beide Richtungen gestreckt werden soll.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- void SetScaleFactor(float ScaleFactor);
+ void setScaleFactor(float scaleFactor);
/**
@brief Setzt den Skalierungsfaktor der Animation auf der X-Achse.
@param ScaleFactor der Faktor um den die Animation in Richtungen der X-Achse gestreckt werden soll.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- void SetScaleFactorX(float ScaleFactorX);
+ void setScaleFactorX(float scaleFactorX);
/**
@brief Setzt den Skalierungsfaktor der Animation auf der Y-Achse.
@param ScaleFactor der Faktor um den die Animation in Richtungen der Y-Achse gestreckt werden soll.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- void SetScaleFactorY(float ScaleFactorY);
+ void setScaleFactorY(float scaleFactorY);
/**
@brief Gibt den Skalierungsfakter der Animation auf der X-Achse zur\xFCck.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- float GetScaleFactorX() const {
- return m_ScaleFactorX;
+ float getScaleFactorX() const {
+ return _scaleFactorX;
}
/**
@brief Gibt den Skalierungsfakter der Animation auf der Y-Achse zur\xFCck.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- float GetScaleFactorY() const {
- return m_ScaleFactorY;
+ float getScaleFactorY() const {
+ return _scaleFactorY;
}
- virtual bool Persist(OutputPersistenceBlock &Writer);
- virtual bool Unpersist(InputPersistenceBlock &Reader);
+ virtual bool persist(OutputPersistenceBlock &writer);
+ virtual bool unpersist(InputPersistenceBlock &reader);
- virtual void FrameNotification(int TimeElapsed);
+ virtual void frameNotification(int timeElapsed);
- ANIMATION_TYPES GetAnimationType() const;
- int GetFPS() const;
- int GetFrameCount() const;
- bool IsScalingAllowed() const;
- bool IsAlphaAllowed() const;
- bool IsColorModulationAllowed() const;
+ ANIMATION_TYPES getAnimationType() const;
+ int getFPS() const;
+ int getFrameCount() const;
+ bool isScalingAllowed() const;
+ bool isAlphaAllowed() const;
+ bool isColorModulationAllowed() const;
uint GetCurrentFrame() const {
return m_CurrentFrame;
}
@@ -157,7 +156,7 @@
void RegisterDeleteCallback(ANIMATION_CALLBACK Callback, uint Data = 0);
protected:
- virtual bool DoRender();
+ virtual bool doRender();
private:
enum DIRECTION {
@@ -165,11 +164,11 @@
BACKWARD
};
- int m_RelX;
- int m_RelY;
- float m_ScaleFactorX;
- float m_ScaleFactorY;
- uint m_ModulationColor;
+ int _relX;
+ int _relY;
+ float _scaleFactorX;
+ float _scaleFactorY;
+ uint _modulationColor;
uint m_CurrentFrame;
int m_CurrentFrameTime;
bool m_Running;
Modified: scummvm/trunk/engines/sword25/gfx/animationdescription.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationdescription.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationdescription.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -46,30 +46,30 @@
// Persistenz
// -----------------------------------------------------------------------------
-bool AnimationDescription::Persist(OutputPersistenceBlock &Writer) {
- Writer.Write(static_cast<uint>(m_AnimationType));
- Writer.Write(m_FPS);
- Writer.Write(m_MillisPerFrame);
- Writer.Write(m_ScalingAllowed);
- Writer.Write(m_AlphaAllowed);
- Writer.Write(m_ColorModulationAllowed);
+bool AnimationDescription::persist(OutputPersistenceBlock &writer) {
+ writer.write(static_cast<uint>(_animationType));
+ writer.write(_FPS);
+ writer.write(_millisPerFrame);
+ writer.write(_scalingAllowed);
+ writer.write(_alphaAllowed);
+ writer.write(_colorModulationAllowed);
return true;
}
// -----------------------------------------------------------------------------
-bool AnimationDescription::Unpersist(InputPersistenceBlock &Reader) {
- uint AnimationType;
- Reader.Read(AnimationType);
- m_AnimationType = static_cast<Animation::ANIMATION_TYPES>(AnimationType);
- Reader.Read(m_FPS);
- Reader.Read(m_MillisPerFrame);
- Reader.Read(m_ScalingAllowed);
- Reader.Read(m_AlphaAllowed);
- Reader.Read(m_ColorModulationAllowed);
+bool AnimationDescription::unpersist(InputPersistenceBlock &reader) {
+ uint animationType;
+ reader.read(animationType);
+ _animationType = static_cast<Animation::ANIMATION_TYPES>(animationType);
+ reader.read(_FPS);
+ reader.read(_millisPerFrame);
+ reader.read(_scalingAllowed);
+ reader.read(_alphaAllowed);
+ reader.read(_colorModulationAllowed);
- return Reader.IsGood();
+ return reader.isGood();
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/animationdescription.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationdescription.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationdescription.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -52,12 +52,12 @@
class AnimationDescription : public Persistable {
protected:
AnimationDescription() :
- m_AnimationType(Animation::AT_LOOP),
- m_FPS(10),
- m_MillisPerFrame(0),
- m_ScalingAllowed(true),
- m_AlphaAllowed(true),
- m_ColorModulationAllowed(true)
+ _animationType(Animation::AT_LOOP),
+ _FPS(10),
+ _millisPerFrame(0),
+ _scalingAllowed(true),
+ _alphaAllowed(true),
+ _colorModulationAllowed(true)
{};
public:
@@ -75,43 +75,43 @@
// Abstrakte Methoden
// -----------------------------------------------------------------------------
- virtual const Frame &GetFrame(uint Index) const = 0;
- virtual uint GetFrameCount() const = 0;
- virtual void Unlock() = 0;
+ virtual const Frame &getFrame(uint index) const = 0;
+ virtual uint getFrameCount() const = 0;
+ virtual void unlock() = 0;
// -----------------------------------------------------------------------------
// Getter Methoden
// -----------------------------------------------------------------------------
- Animation::ANIMATION_TYPES GetAnimationType() const {
- return m_AnimationType;
+ Animation::ANIMATION_TYPES getAnimationType() const {
+ return _animationType;
}
- int GetFPS() const {
- return m_FPS;
+ int getFPS() const {
+ return _FPS;
}
- int GetMillisPerFrame() const {
- return m_MillisPerFrame;
+ int getMillisPerFrame() const {
+ return _millisPerFrame;
}
- bool IsScalingAllowed() const {
- return m_ScalingAllowed;
+ bool isScalingAllowed() const {
+ return _scalingAllowed;
}
- bool IsAlphaAllowed() const {
- return m_AlphaAllowed;
+ bool isAlphaAllowed() const {
+ return _alphaAllowed;
}
- bool IsColorModulationAllowed() const {
- return m_ColorModulationAllowed;
+ bool isColorModulationAllowed() const {
+ return _colorModulationAllowed;
}
- virtual bool Persist(OutputPersistenceBlock &Writer);
- virtual bool Unpersist(InputPersistenceBlock &Reader);
+ virtual bool persist(OutputPersistenceBlock &writer);
+ virtual bool unpersist(InputPersistenceBlock &reader);
protected:
- Animation::ANIMATION_TYPES m_AnimationType;
- int m_FPS;
- int m_MillisPerFrame;
- bool m_ScalingAllowed;
- bool m_AlphaAllowed;
- bool m_ColorModulationAllowed;
+ Animation::ANIMATION_TYPES _animationType;
+ int _FPS;
+ int _millisPerFrame;
+ bool _scalingAllowed;
+ bool _alphaAllowed;
+ bool _colorModulationAllowed;
};
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/animationresource.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationresource.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationresource.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -66,7 +66,7 @@
AnimationResource::AnimationResource(const Common::String &filename) :
Resource(filename, Resource::TYPE_ANIMATION),
Common::XMLParser(),
- m_Valid(false) {
+ _valid(false) {
// Get a pointer to the package manager
Kernel *pKernel = Kernel::GetInstance();
_pPackage = static_cast<PackageManager *>(pKernel->GetService("package"));
@@ -74,16 +74,16 @@
// Switch to the folder the specified Xml fiile is in
Common::String oldDirectory = _pPackage->GetCurrentDirectory();
- if (GetFileName().contains('/')) {
- Common::String dir = Common::String(GetFileName().c_str(), strrchr(GetFileName().c_str(), '/'));
+ if (getFileName().contains('/')) {
+ Common::String dir = Common::String(getFileName().c_str(), strrchr(getFileName().c_str(), '/'));
_pPackage->ChangeDirectory(dir);
}
// Load the contents of the file
uint fileSize;
- char *xmlData = _pPackage->GetXmlFile(GetFileName(), &fileSize);
+ char *xmlData = _pPackage->GetXmlFile(getFileName(), &fileSize);
if (!xmlData) {
- BS_LOG_ERRORLN("Could not read \"%s\".", GetFileName().c_str());
+ BS_LOG_ERRORLN("Could not read \"%s\".", getFileName().c_str());
return;
}
@@ -91,7 +91,7 @@
if (!loadBuffer((const byte *)xmlData, fileSize))
return;
- m_Valid = parse();
+ _valid = parse();
close();
free(xmlData);
@@ -99,24 +99,24 @@
_pPackage->ChangeDirectory(oldDirectory);
// Give an error message if there weren't any frames specified
- if (m_Frames.empty()) {
- BS_LOG_ERRORLN("\"%s\" does not have any frames.", GetFileName().c_str());
+ if (_frames.empty()) {
+ BS_LOG_ERRORLN("\"%s\" does not have any frames.", getFileName().c_str());
return;
}
// Pre-cache all the frames
if (!PrecacheAllFrames()) {
- BS_LOG_ERRORLN("Could not precache all frames of \"%s\".", GetFileName().c_str());
+ BS_LOG_ERRORLN("Could not precache all frames of \"%s\".", getFileName().c_str());
return;
}
// Post processing to compute animation features
if (!ComputeFeatures()) {
- BS_LOG_ERRORLN("Could not determine the features of \"%s\".", GetFileName().c_str());
+ BS_LOG_ERRORLN("Could not determine the features of \"%s\".", getFileName().c_str());
return;
}
- m_Valid = true;
+ _valid = true;
}
// -----------------------------------------------------------------------------
@@ -135,29 +135,29 @@
// -----------------------------------------------------------------------------
bool AnimationResource::parserCallback_animation(ParserNode *node) {
- if (!parseIntegerKey(node->values["fps"].c_str(), 1, &m_FPS) || (m_FPS < MIN_FPS) || (m_FPS > MAX_FPS)) {
+ if (!parseIntegerKey(node->values["fps"].c_str(), 1, &_FPS) || (_FPS < MIN_FPS) || (_FPS > MAX_FPS)) {
return parserError("Illegal or missing fps attribute in <animation> tag in \"%s\". Assuming default (\"%d\").",
- GetFileName().c_str(), DEFAULT_FPS);
+ getFileName().c_str(), DEFAULT_FPS);
}
// Loop type value
const char *loopTypeString = node->values["type"].c_str();
if (strcmp(loopTypeString, "oneshot") == 0) {
- m_AnimationType = Animation::AT_ONESHOT;
+ _animationType = Animation::AT_ONESHOT;
} else if (strcmp(loopTypeString, "loop") == 0) {
- m_AnimationType = Animation::AT_LOOP;
+ _animationType = Animation::AT_LOOP;
} else if (strcmp(loopTypeString, "jojo") == 0) {
- m_AnimationType = Animation::AT_JOJO;
+ _animationType = Animation::AT_JOJO;
} else {
BS_LOG_WARNINGLN("Illegal type value (\"%s\") in <animation> tag in \"%s\". Assuming default (\"loop\").",
- loopTypeString, GetFileName().c_str());
- m_AnimationType = Animation::AT_LOOP;
+ loopTypeString, getFileName().c_str());
+ _animationType = Animation::AT_LOOP;
}
// Calculate the milliseconds required per frame
// FIXME: Double check variable naming. Based on the constant, it may be microseconds
- m_MillisPerFrame = 1000000 / m_FPS;
+ _millisPerFrame = 1000000 / _FPS;
return true;
}
@@ -169,13 +169,13 @@
const char *fileString = node->values["file"].c_str();
if (!fileString) {
- BS_LOG_ERRORLN("<frame> tag without file attribute occurred in \"%s\".", GetFileName().c_str());
+ BS_LOG_ERRORLN("<frame> tag without file attribute occurred in \"%s\".", getFileName().c_str());
return false;
}
frame.FileName = _pPackage->GetAbsolutePath(fileString);
if (frame.FileName.empty()) {
BS_LOG_ERRORLN("Could not create absolute path for file specified in <frame> tag in \"%s\": \"%s\".",
- GetFileName().c_str(), fileString);
+ getFileName().c_str(), fileString);
return false;
}
@@ -190,23 +190,23 @@
BS_LOG_WARNINGLN("%s attribute occurred without %s attribute in <frame> tag in \"%s\". Assuming default (\"0\").",
hotspotxString ? "hotspotx" : "hotspoty",
!hotspotyString ? "hotspoty" : "hotspotx",
- GetFileName().c_str());
+ getFileName().c_str());
frame.HotspotX = 0;
if (hotspotxString && !parseIntegerKey(hotspotxString, 1, &frame.HotspotX))
BS_LOG_WARNINGLN("Illegal hotspotx value (\"%s\") in frame tag in \"%s\". Assuming default (\"%s\").",
- hotspotxString, GetFileName().c_str(), frame.HotspotX);
+ hotspotxString, getFileName().c_str(), frame.HotspotX);
frame.HotspotY = 0;
if (hotspotyString && !parseIntegerKey(hotspotyString, 1, &frame.HotspotY))
BS_LOG_WARNINGLN("Illegal hotspoty value (\"%s\") in frame tag in \"%s\". Assuming default (\"%s\").",
- hotspotyString, GetFileName().c_str(), frame.HotspotY);
+ hotspotyString, getFileName().c_str(), frame.HotspotY);
Common::String flipVString = node->values["flipv"];
if (!flipVString.empty()) {
if (!parseBooleanKey(flipVString, frame.FlipV)) {
BS_LOG_WARNINGLN("Illegal flipv value (\"%s\") in <frame> tag in \"%s\". Assuming default (\"false\").",
- flipVString.c_str(), GetFileName().c_str());
+ flipVString.c_str(), getFileName().c_str());
frame.FlipV = false;
}
} else
@@ -216,13 +216,13 @@
if (!flipHString.empty()) {
if (!parseBooleanKey(flipVString, frame.FlipV)) {
BS_LOG_WARNINGLN("Illegal fliph value (\"%s\") in <frame> tag in \"%s\". Assuming default (\"false\").",
- flipHString.c_str(), GetFileName().c_str());
+ flipHString.c_str(), getFileName().c_str());
frame.FlipH = false;
}
} else
frame.FlipH = false;
- m_Frames.push_back(frame);
+ _frames.push_back(frame);
return true;
}
@@ -234,10 +234,10 @@
// -----------------------------------------------------------------------------
bool AnimationResource::PrecacheAllFrames() const {
- Common::Array<Frame>::const_iterator Iter = m_Frames.begin();
- for (; Iter != m_Frames.end(); ++Iter) {
- if (!Kernel::GetInstance()->GetResourceManager()->PrecacheResource((*Iter).FileName)) {
- BS_LOG_ERRORLN("Could not precache \"%s\".", (*Iter).FileName.c_str());
+ Common::Array<Frame>::const_iterator iter = _frames.begin();
+ for (; iter != _frames.end(); ++iter) {
+ if (!Kernel::GetInstance()->GetResourceManager()->PrecacheResource((*iter).FileName)) {
+ BS_LOG_ERRORLN("Could not precache \"%s\".", (*iter).FileName.c_str());
return false;
}
}
@@ -248,30 +248,30 @@
// -----------------------------------------------------------------------------
bool AnimationResource::ComputeFeatures() {
- BS_ASSERT(m_Frames.size());
+ BS_ASSERT(_frames.size());
// Alle Features werden als vorhanden angenommen
- m_ScalingAllowed = true;
- m_AlphaAllowed = true;
- m_ColorModulationAllowed = true;
+ _scalingAllowed = true;
+ _alphaAllowed = true;
+ _colorModulationAllowed = true;
// Alle Frame durchgehen und alle Features deaktivieren, die auch nur von einem Frame nicht unterst\xFCtzt werden.
- Common::Array<Frame>::const_iterator Iter = m_Frames.begin();
- for (; Iter != m_Frames.end(); ++Iter) {
+ Common::Array<Frame>::const_iterator Iter = _frames.begin();
+ for (; Iter != _frames.end(); ++Iter) {
BitmapResource *pBitmap;
if (!(pBitmap = static_cast<BitmapResource *>(Kernel::GetInstance()->GetResourceManager()->RequestResource((*Iter).FileName)))) {
BS_LOG_ERRORLN("Could not request \"%s\".", (*Iter).FileName.c_str());
return false;
}
- if (!pBitmap->IsScalingAllowed())
- m_ScalingAllowed = false;
- if (!pBitmap->IsAlphaAllowed())
- m_AlphaAllowed = false;
- if (!pBitmap->IsColorModulationAllowed())
- m_ColorModulationAllowed = false;
+ if (!pBitmap->isScalingAllowed())
+ _scalingAllowed = false;
+ if (!pBitmap->isAlphaAllowed())
+ _alphaAllowed = false;
+ if (!pBitmap->isColorModulationAllowed())
+ _colorModulationAllowed = false;
- pBitmap->Release();
+ pBitmap->release();
}
return true;
Modified: scummvm/trunk/engines/sword25/gfx/animationresource.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationresource.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationresource.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -63,43 +63,43 @@
AnimationResource(const Common::String &filename);
virtual ~AnimationResource();
- virtual const Frame &GetFrame(uint Index) const {
- BS_ASSERT(Index < m_Frames.size());
- return m_Frames[Index];
+ virtual const Frame &getFrame(uint index) const {
+ BS_ASSERT(index < _frames.size());
+ return _frames[index];
}
- virtual uint GetFrameCount() const {
- return m_Frames.size();
+ virtual uint getFrameCount() const {
+ return _frames.size();
}
- virtual void Unlock() {
- Release();
+ virtual void unlock() {
+ release();
}
- Animation::ANIMATION_TYPES GetAnimationType() const {
- return m_AnimationType;
+ Animation::ANIMATION_TYPES getAnimationType() const {
+ return _animationType;
}
- int GetFPS() const {
- return m_FPS;
+ int getFPS() const {
+ return _FPS;
}
- int GetMillisPerFrame() const {
- return m_MillisPerFrame;
+ int getMillisPerFrame() const {
+ return _millisPerFrame;
}
- bool IsScalingAllowed() const {
- return m_ScalingAllowed;
+ bool isScalingAllowed() const {
+ return _scalingAllowed;
}
- bool IsAlphaAllowed() const {
- return m_AlphaAllowed;
+ bool isAlphaAllowed() const {
+ return _alphaAllowed;
}
- bool IsColorModulationAllowed() const {
- return m_ColorModulationAllowed;
+ bool isColorModulationAllowed() const {
+ return _colorModulationAllowed;
}
- bool IsValid() const {
- return m_Valid;
+ bool isValid() const {
+ return _valid;
}
private:
- bool m_Valid;
+ bool _valid;
- Common::Array<Frame> m_Frames;
+ Common::Array<Frame> _frames;
PackageManager * _pPackage;
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -56,7 +56,7 @@
uint AnimationTemplate::Create(const Common::String &SourceAnimation) {
AnimationTemplate *AnimationTemplatePtr = new AnimationTemplate(SourceAnimation);
- if (AnimationTemplatePtr->IsValid()) {
+ if (AnimationTemplatePtr->isValid()) {
return AnimationTemplateRegistry::GetInstance().ResolvePtr(AnimationTemplatePtr);
} else {
delete AnimationTemplatePtr;
@@ -69,7 +69,7 @@
uint AnimationTemplate::Create(const AnimationTemplate &Other) {
AnimationTemplate *AnimationTemplatePtr = new AnimationTemplate(Other);
- if (AnimationTemplatePtr->IsValid()) {
+ if (AnimationTemplatePtr->isValid()) {
return AnimationTemplateRegistry::GetInstance().ResolvePtr(AnimationTemplatePtr);
} else {
delete AnimationTemplatePtr;
@@ -82,7 +82,7 @@
uint AnimationTemplate::Create(InputPersistenceBlock &Reader, uint Handle) {
AnimationTemplate *AnimationTemplatePtr = new AnimationTemplate(Reader, Handle);
- if (AnimationTemplatePtr->IsValid()) {
+ if (AnimationTemplatePtr->isValid()) {
return AnimationTemplateRegistry::GetInstance().ResolvePtr(AnimationTemplatePtr);
} else {
delete AnimationTemplatePtr;
@@ -96,13 +96,13 @@
// Objekt registrieren.
AnimationTemplateRegistry::GetInstance().RegisterObject(this);
- m_Valid = false;
+ _valid = false;
// Die Animations-Resource wird f\xFCr die gesamte Lebensdauer des Objektes gelockt
- m_SourceAnimationPtr = RequestSourceAnimation(SourceAnimation);
+ _sourceAnimationPtr = RequestSourceAnimation(SourceAnimation);
// Erfolg signalisieren
- m_Valid = (m_SourceAnimationPtr != 0);
+ _valid = (_sourceAnimationPtr != 0);
}
// -----------------------------------------------------------------------------
@@ -111,24 +111,24 @@
// Objekt registrieren.
AnimationTemplateRegistry::GetInstance().RegisterObject(this);
- m_Valid = false;
+ _valid = false;
// Die Animations-Resource wird f\xFCr die gesamte Lebensdauer des Objektes gelockt.
- if (!Other.m_SourceAnimationPtr) return;
- m_SourceAnimationPtr = RequestSourceAnimation(Other.m_SourceAnimationPtr->GetFileName());
+ if (!Other._sourceAnimationPtr) return;
+ _sourceAnimationPtr = RequestSourceAnimation(Other._sourceAnimationPtr->getFileName());
// Alle Member kopieren.
- m_AnimationType = Other.m_AnimationType;
- m_FPS = Other.m_FPS;
- m_MillisPerFrame = Other.m_MillisPerFrame;
- m_ScalingAllowed = Other.m_ScalingAllowed;
- m_AlphaAllowed = Other.m_AlphaAllowed;
- m_ColorModulationAllowed = Other.m_ColorModulationAllowed;
- m_Frames = Other.m_Frames;
- m_SourceAnimationPtr = Other.m_SourceAnimationPtr;
- m_Valid = Other.m_Valid;
+ _animationType = Other._animationType;
+ _FPS = Other._FPS;
+ _millisPerFrame = Other._millisPerFrame;
+ _scalingAllowed = Other._scalingAllowed;
+ _alphaAllowed = Other._alphaAllowed;
+ _colorModulationAllowed = Other._colorModulationAllowed;
+ _frames = Other._frames;
+ _sourceAnimationPtr = Other._sourceAnimationPtr;
+ _valid = Other._valid;
- m_Valid &= (m_SourceAnimationPtr != 0);
+ _valid &= (_sourceAnimationPtr != 0);
}
// -----------------------------------------------------------------------------
@@ -138,7 +138,7 @@
AnimationTemplateRegistry::GetInstance().RegisterObject(this, Handle);
// Objekt laden.
- m_Valid = Unpersist(Reader);
+ _valid = unpersist(Reader);
}
// -----------------------------------------------------------------------------
@@ -157,8 +157,8 @@
AnimationTemplate::~AnimationTemplate() {
// Animations-Resource freigeben
- if (m_SourceAnimationPtr) {
- m_SourceAnimationPtr->Release();
+ if (_sourceAnimationPtr) {
+ _sourceAnimationPtr->release();
}
// Objekt deregistrieren
@@ -169,7 +169,7 @@
void AnimationTemplate::AddFrame(int Index) {
if (ValidateSourceIndex(Index)) {
- m_Frames.push_back(m_SourceAnimationPtr->GetFrame(Index));
+ _frames.push_back(_sourceAnimationPtr->getFrame(Index));
}
}
@@ -177,16 +177,16 @@
void AnimationTemplate::SetFrame(int DestIndex, int SrcIndex) {
if (ValidateDestIndex(DestIndex) && ValidateSourceIndex(SrcIndex)) {
- m_Frames[DestIndex] = m_SourceAnimationPtr->GetFrame(SrcIndex);
+ _frames[DestIndex] = _sourceAnimationPtr->getFrame(SrcIndex);
}
}
// -----------------------------------------------------------------------------
bool AnimationTemplate::ValidateSourceIndex(uint Index) const {
- if (Index > m_SourceAnimationPtr->GetFrameCount()) {
+ if (Index > _sourceAnimationPtr->getFrameCount()) {
BS_LOG_WARNINGLN("Tried to insert a frame (\"%d\") that does not exist in the source animation (\"%s\"). Ignoring call.",
- Index, m_SourceAnimationPtr->GetFileName().c_str());
+ Index, _sourceAnimationPtr->getFileName().c_str());
return false;
} else
return true;
@@ -195,7 +195,7 @@
// -----------------------------------------------------------------------------
bool AnimationTemplate::ValidateDestIndex(uint Index) const {
- if (Index > m_Frames.size()) {
+ if (Index > _frames.size()) {
BS_LOG_WARNINGLN("Tried to change a nonexistent frame (\"%d\") in a template animation. Ignoring call.",
Index);
return false;
@@ -206,73 +206,73 @@
// -----------------------------------------------------------------------------
void AnimationTemplate::SetFPS(int FPS) {
- m_FPS = FPS;
- m_MillisPerFrame = 1000000 / m_FPS;
+ _FPS = FPS;
+ _millisPerFrame = 1000000 / _FPS;
}
// -----------------------------------------------------------------------------
-bool AnimationTemplate::Persist(OutputPersistenceBlock &Writer) {
+bool AnimationTemplate::persist(OutputPersistenceBlock &writer) {
bool Result = true;
// Parent persistieren.
- Result &= AnimationDescription::Persist(Writer);
+ Result &= AnimationDescription::persist(writer);
// Frameanzahl schreiben.
- Writer.Write(m_Frames.size());
+ writer.write(_frames.size());
// Frames einzeln persistieren.
- Common::Array<const Frame>::const_iterator Iter = m_Frames.begin();
- while (Iter != m_Frames.end()) {
- Writer.Write(Iter->HotspotX);
- Writer.Write(Iter->HotspotY);
- Writer.Write(Iter->FlipV);
- Writer.Write(Iter->FlipH);
- Writer.Write(Iter->FileName);
- Writer.Write(Iter->Action);
+ Common::Array<const Frame>::const_iterator Iter = _frames.begin();
+ while (Iter != _frames.end()) {
+ writer.write(Iter->HotspotX);
+ writer.write(Iter->HotspotY);
+ writer.write(Iter->FlipV);
+ writer.write(Iter->FlipH);
+ writer.write(Iter->FileName);
+ writer.write(Iter->Action);
++Iter;
}
// Restliche Member persistieren.
- Writer.Write(m_SourceAnimationPtr->GetFileName());
- Writer.Write(m_Valid);
+ writer.write(_sourceAnimationPtr->getFileName());
+ writer.write(_valid);
return Result;
}
// -----------------------------------------------------------------------------
-bool AnimationTemplate::Unpersist(InputPersistenceBlock &Reader) {
+bool AnimationTemplate::unpersist(InputPersistenceBlock &reader) {
bool Result = true;
// Parent wieder herstellen.
- Result &= AnimationDescription::Unpersist(Reader);
+ Result &= AnimationDescription::unpersist(reader);
// Frameanzahl lesen.
uint FrameCount;
- Reader.Read(FrameCount);
+ reader.read(FrameCount);
// Frames einzeln wieder herstellen.
for (uint i = 0; i < FrameCount; ++i) {
Frame frame;
- Reader.Read(frame.HotspotX);
- Reader.Read(frame.HotspotY);
- Reader.Read(frame.FlipV);
- Reader.Read(frame.FlipH);
- Reader.Read(frame.FileName);
- Reader.Read(frame.Action);
+ reader.read(frame.HotspotX);
+ reader.read(frame.HotspotY);
+ reader.read(frame.FlipV);
+ reader.read(frame.FlipH);
+ reader.read(frame.FileName);
+ reader.read(frame.Action);
- m_Frames.push_back(frame);
+ _frames.push_back(frame);
}
// Die Animations-Resource wird f\xFCr die gesamte Lebensdauer des Objektes gelockt
Common::String SourceAnimation;
- Reader.Read(SourceAnimation);
- m_SourceAnimationPtr = RequestSourceAnimation(SourceAnimation);
+ reader.read(SourceAnimation);
+ _sourceAnimationPtr = RequestSourceAnimation(SourceAnimation);
- Reader.Read(m_Valid);
+ reader.read(_valid);
- return m_SourceAnimationPtr && Reader.IsGood() && Result;
+ return _sourceAnimationPtr && reader.isGood() && Result;
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplate.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplate.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplate.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -70,19 +70,19 @@
public:
~AnimationTemplate();
- virtual const Frame &GetFrame(uint Index) const {
- BS_ASSERT(Index < m_Frames.size());
- return m_Frames[Index];
+ virtual const Frame &getFrame(uint Index) const {
+ BS_ASSERT(Index < _frames.size());
+ return _frames[Index];
}
- virtual uint GetFrameCount() const {
- return m_Frames.size();
+ virtual uint getFrameCount() const {
+ return _frames.size();
}
- virtual void Unlock() {
+ virtual void unlock() {
delete this;
}
- bool IsValid() const {
- return m_Valid;
+ bool isValid() const {
+ return _valid;
}
/**
@@ -106,7 +106,7 @@
@param Type der Typ der Animation. Muss aus den enum BS_Animation::ANIMATION_TYPES sein.
*/
void SetAnimationType(Animation::ANIMATION_TYPES Type) {
- m_AnimationType = Type;
+ _animationType = Type;
}
/**
@@ -115,13 +115,13 @@
*/
void SetFPS(int FPS);
- virtual bool Persist(OutputPersistenceBlock &Writer);
- virtual bool Unpersist(InputPersistenceBlock &Reader);
+ virtual bool persist(OutputPersistenceBlock &writer);
+ virtual bool unpersist(InputPersistenceBlock &reader);
private:
- Common::Array<Frame> m_Frames;
- AnimationResource *m_SourceAnimationPtr;
- bool m_Valid;
+ Common::Array<Frame> _frames;
+ AnimationResource *_sourceAnimationPtr;
+ bool _valid;
AnimationResource *RequestSourceAnimation(const Common::String &SourceAnimation) const;
bool ValidateSourceIndex(uint Index) const;
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -63,23 +63,23 @@
// -----------------------------------------------------------------------------
-bool AnimationTemplateRegistry::Persist(OutputPersistenceBlock &Writer) {
+bool AnimationTemplateRegistry::persist(OutputPersistenceBlock &writer) {
bool Result = true;
// Das n\xE4chste zu vergebene Handle schreiben.
- Writer.Write(m_NextHandle);
+ writer.write(m_NextHandle);
// Anzahl an BS_AnimationTemplates schreiben.
- Writer.Write(m_Handle2PtrMap.size());
+ writer.write(m_Handle2PtrMap.size());
// Alle BS_AnimationTemplates persistieren.
HANDLE2PTR_MAP::const_iterator Iter = m_Handle2PtrMap.begin();
while (Iter != m_Handle2PtrMap.end()) {
// Handle persistieren.
- Writer.Write(Iter->_key);
+ writer.write(Iter->_key);
// Objekt persistieren.
- Result &= Iter->_value->Persist(Writer);
+ Result &= Iter->_value->persist(writer);
++Iter;
}
@@ -89,11 +89,11 @@
// -----------------------------------------------------------------------------
-bool AnimationTemplateRegistry::Unpersist(InputPersistenceBlock &Reader) {
+bool AnimationTemplateRegistry::unpersist(InputPersistenceBlock &reader) {
bool Result = true;
// Das n\xE4chste zu vergebene Handle wieder herstellen.
- Reader.Read(m_NextHandle);
+ reader.read(m_NextHandle);
// Alle vorhandenen BS_AnimationTemplates zerst\xF6ren.
while (!m_Handle2PtrMap.empty())
@@ -101,19 +101,19 @@
// Anzahl an BS_AnimationTemplates einlesen.
uint AnimationTemplateCount;
- Reader.Read(AnimationTemplateCount);
+ reader.read(AnimationTemplateCount);
// Alle gespeicherten BS_AnimationTemplates wieder herstellen.
for (uint i = 0; i < AnimationTemplateCount; ++i) {
// Handle lesen.
uint Handle;
- Reader.Read(Handle);
+ reader.read(Handle);
// BS_AnimationTemplate wieder herstellen.
- Result &= (AnimationTemplate::Create(Reader, Handle) != 0);
+ Result &= (AnimationTemplate::Create(reader, Handle) != 0);
}
- return Reader.IsGood() && Result;
+ return reader.isGood() && Result;
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -64,8 +64,8 @@
return *m_InstancePtr.get();
}
- virtual bool Persist(OutputPersistenceBlock &Writer);
- virtual bool Unpersist(InputPersistenceBlock &Reader);
+ virtual bool persist(OutputPersistenceBlock &Writer);
+ virtual bool unpersist(InputPersistenceBlock &Reader);
private:
virtual void LogErrorLn(const char *Message) const;
Modified: scummvm/trunk/engines/sword25/gfx/bitmap.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/bitmap.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/bitmap.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -52,13 +52,13 @@
// Konstruktion / Destruktion
// -----------------------------------------------------------------------------
-Bitmap::Bitmap(RenderObjectPtr<RenderObject> ParentPtr, TYPES Type, uint Handle) :
- RenderObject(ParentPtr, Type, Handle),
- m_ModulationColor(0xffffffff),
- m_ScaleFactorX(1.0f),
- m_ScaleFactorY(1.0f),
- m_FlipH(false),
- m_FlipV(false) {
+Bitmap::Bitmap(RenderObjectPtr<RenderObject> parentPtr, TYPES type, uint handle) :
+ RenderObject(parentPtr, type, handle),
+ _modulationColor(0xffffffff),
+ _scaleFactorX(1.0f),
+ _scaleFactorY(1.0f),
+ _flipH(false),
+ _flipV(false) {
}
// -----------------------------------------------------------------------------
@@ -70,142 +70,146 @@
// Darstellungsart festlegen
// -----------------------------------------------------------------------------
-void Bitmap::SetAlpha(int Alpha) {
- if (!IsAlphaAllowed()) {
+void Bitmap::setAlpha(int alpha) {
+ if (!isAlphaAllowed()) {
BS_LOG_WARNINGLN("Tried to set alpha value on a bitmap that does not support alpha blending. Call was ignored.");
return;
}
- if (Alpha < 0 || Alpha > 255) {
- int OldAlpha = Alpha;
- if (Alpha < 0) Alpha = 0;
- if (Alpha > 255) Alpha = 255;
- BS_LOG_WARNINGLN("Tried to set an invalid alpha value (%d) on a bitmap. Value was changed to %d.", OldAlpha, Alpha);
+ if (alpha < 0 || alpha > 255) {
+ int oldAlpha = alpha;
+ if (alpha < 0)
+ alpha = 0;
+ if (alpha > 255)
+ alpha = 255;
+ BS_LOG_WARNINGLN("Tried to set an invalid alpha value (%d) on a bitmap. Value was changed to %d.", oldAlpha, alpha);
return;
}
- uint NewModulationColor = (m_ModulationColor & 0x00ffffff) | Alpha << 24;
- if (NewModulationColor != m_ModulationColor) {
- m_ModulationColor = NewModulationColor;
- ForceRefresh();
+ uint newModulationColor = (_modulationColor & 0x00ffffff) | alpha << 24;
+ if (newModulationColor != _modulationColor) {
+ _modulationColor = newModulationColor;
+ forceRefresh();
}
}
// -----------------------------------------------------------------------------
-void Bitmap::SetModulationColor(uint ModulationColor) {
- if (!IsColorModulationAllowed()) {
+void Bitmap::setModulationColor(uint modulationColor) {
+ if (!isColorModulationAllowed()) {
BS_LOG_WARNINGLN("Tried to set modulation color of a bitmap that does not support color modulation. Call was ignored.");
return;
}
- uint NewModulationColor = (ModulationColor & 0x00ffffff) | (m_ModulationColor & 0xff000000);
- if (NewModulationColor != m_ModulationColor) {
- m_ModulationColor = NewModulationColor;
- ForceRefresh();
+ uint newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000);
+ if (newModulationColor != _modulationColor) {
+ _modulationColor = newModulationColor;
+ forceRefresh();
}
}
// -----------------------------------------------------------------------------
-void Bitmap::SetScaleFactor(float ScaleFactor) {
- SetScaleFactorX(ScaleFactor);
- SetScaleFactorY(ScaleFactor);
+void Bitmap::setScaleFactor(float scaleFactor) {
+ setScaleFactorX(scaleFactor);
+ setScaleFactorY(scaleFactor);
}
// -----------------------------------------------------------------------------
-void Bitmap::SetScaleFactorX(float ScaleFactorX) {
- if (!IsScalingAllowed()) {
+void Bitmap::setScaleFactorX(float scaleFactorX) {
+ if (!isScalingAllowed()) {
BS_LOG_WARNINGLN("Tried to set scale factor of a bitmap that does not support scaling. Call was ignored.");
return;
}
- if (ScaleFactorX < 0) {
+ if (scaleFactorX < 0) {
BS_LOG_WARNINGLN("Tried to set scale factor of a bitmap to a negative value. Call was ignored.");
return;
}
- if (ScaleFactorX != m_ScaleFactorX) {
- m_ScaleFactorX = ScaleFactorX;
- m_Width = static_cast<int>(m_OriginalWidth * m_ScaleFactorX);
- if (m_ScaleFactorX <= 0.0f) m_ScaleFactorX = 0.001f;
- ForceRefresh();
+ if (scaleFactorX != _scaleFactorX) {
+ _scaleFactorX = scaleFactorX;
+ _width = static_cast<int>(_originalWidth * _scaleFactorX);
+ if (_scaleFactorX <= 0.0f)
+ _scaleFactorX = 0.001f;
+ forceRefresh();
}
}
// -----------------------------------------------------------------------------
-void Bitmap::SetScaleFactorY(float ScaleFactorY) {
- if (!IsScalingAllowed()) {
+void Bitmap::setScaleFactorY(float scaleFactorY) {
+ if (!isScalingAllowed()) {
BS_LOG_WARNINGLN("Tried to set scale factor of a bitmap that does not support scaling. Call was ignored.");
return;
}
- if (ScaleFactorY < 0) {
+ if (scaleFactorY < 0) {
BS_LOG_WARNINGLN("Tried to set scale factor of a bitmap to a negative value. Call was ignored.");
return;
}
- if (ScaleFactorY != m_ScaleFactorY) {
- m_ScaleFactorY = ScaleFactorY;
- m_Height = static_cast<int>(m_OriginalHeight * ScaleFactorY);
- if (m_ScaleFactorY <= 0.0f) m_ScaleFactorY = 0.001f;
- ForceRefresh();
+ if (scaleFactorY != _scaleFactorY) {
+ _scaleFactorY = scaleFactorY;
+ _height = static_cast<int>(_originalHeight * scaleFactorY);
+ if (_scaleFactorY <= 0.0f)
+ _scaleFactorY = 0.001f;
+ forceRefresh();
}
}
// -----------------------------------------------------------------------------
-void Bitmap::SetFlipH(bool FlipH) {
- m_FlipH = FlipH;
- ForceRefresh();
+void Bitmap::setFlipH(bool flipH) {
+ _flipH = flipH;
+ forceRefresh();
}
// -----------------------------------------------------------------------------
-void Bitmap::SetFlipV(bool FlipV) {
- m_FlipV = FlipV;
- ForceRefresh();
+void Bitmap::setFlipV(bool flipV) {
+ _flipV = flipV;
+ forceRefresh();
}
// -----------------------------------------------------------------------------
// Persistenz
// -----------------------------------------------------------------------------
-bool Bitmap::Persist(OutputPersistenceBlock &Writer) {
- bool Result = true;
+bool Bitmap::persist(OutputPersistenceBlock &writer) {
+ bool result = true;
- Result &= RenderObject::Persist(Writer);
- Writer.Write(m_FlipH);
- Writer.Write(m_FlipV);
- Writer.Write(m_ScaleFactorX);
- Writer.Write(m_ScaleFactorY);
- Writer.Write(m_ModulationColor);
- Writer.Write(m_OriginalWidth);
- Writer.Write(m_OriginalHeight);
+ result &= RenderObject::persist(writer);
+ writer.write(_flipH);
+ writer.write(_flipV);
+ writer.write(_scaleFactorX);
+ writer.write(_scaleFactorY);
+ writer.write(_modulationColor);
+ writer.write(_originalWidth);
+ writer.write(_originalHeight);
- return Result;
+ return result;
}
// -----------------------------------------------------------------------------
-bool Bitmap::Unpersist(InputPersistenceBlock &Reader) {
- bool Result = true;
+bool Bitmap::unpersist(InputPersistenceBlock &reader) {
+ bool result = true;
- Result &= RenderObject::Unpersist(Reader);
- Reader.Read(m_FlipH);
- Reader.Read(m_FlipV);
- Reader.Read(m_ScaleFactorX);
- Reader.Read(m_ScaleFactorY);
- Reader.Read(m_ModulationColor);
- Reader.Read(m_OriginalWidth);
- Reader.Read(m_OriginalHeight);
+ result &= RenderObject::unpersist(reader);
+ reader.read(_flipH);
+ reader.read(_flipV);
+ reader.read(_scaleFactorX);
+ reader.read(_scaleFactorY);
+ reader.read(_modulationColor);
+ reader.read(_originalWidth);
+ reader.read(_originalHeight);
- ForceRefresh();
+ forceRefresh();
- return Reader.IsGood() && Result;
+ return reader.isGood() && result;
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/bitmap.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/bitmap.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/bitmap.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -50,7 +50,7 @@
class Bitmap : public RenderObject {
protected:
- Bitmap(RenderObjectPtr<RenderObject> ParentPtr, TYPES Type, uint Handle = 0);
+ Bitmap(RenderObjectPtr<RenderObject> parentPtr, TYPES type, uint handle = 0);
public:
@@ -61,90 +61,90 @@
@param Alpha der neue Alphawert der Bitmaps (0 = keine Deckung, 255 = volle Deckung).
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsAlphaAllowed() true zur\xFCckgibt.
*/
- void SetAlpha(int Alpha);
+ void setAlpha(int alpha);
/**
@brief Setzt die Modulationfarbe der Bitmaps.
@param Color eine 24-Bit Farbe, die die Modulationsfarbe des Bitmaps festlegt.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsColorModulationAllowed() true zur\xFCckgibt.
*/
- void SetModulationColor(uint ModulationColor);
+ void setModulationColor(uint modulationColor);
/**
@brief Setzt den Skalierungsfaktor des Bitmaps.
@param ScaleFactor der Faktor um den das Bitmap in beide Richtungen gestreckt werden soll.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- void SetScaleFactor(float ScaleFactor);
+ void setScaleFactor(float scaleFactor);
/**
@brief Setzt den Skalierungsfaktor der Bitmap auf der X-Achse.
@param ScaleFactor der Faktor um den die Bitmap in Richtungen der X-Achse gestreckt werden soll. Dieser Wert muss positiv sein.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- void SetScaleFactorX(float ScaleFactorX);
+ void setScaleFactorX(float scaleFactorX);
/**
@brief Setzt den Skalierungsfaktor der Bitmap auf der Y-Achse.
@param ScaleFactor der Faktor um den die Bitmap in Richtungen der Y-Achse gestreckt werden soll. Dieser Wert muss positiv sein.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- void SetScaleFactorY(float ScaleFactorY);
+ void setScaleFactorY(float scaleFactorY);
/**
@brief Legt fest, ob das Bild an der X-Achse gespiegelt werden soll.
*/
- void SetFlipH(bool FlipH);
+ void setFlipH(bool flipH);
/**
@brief Legt fest, ob das Bild an der Y-Achse gespiegelt werden soll.
*/
- void SetFlipV(bool FlipV);
+ void setFlipV(bool flipV);
/**
@brief Gibt den aktuellen Alphawert des Bildes zur\xFCck.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsAlphaAllowed() true zur\xFCckgibt.
*/
- int GetAlpha() {
- return m_ModulationColor >> 24;
+ int getAlpha() {
+ return _modulationColor >> 24;
}
/**
@brief Gibt die aktuelle 24bit RGB Modulationsfarde des Bildes zur\xFCck.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsColorModulationAllowed() true zur\xFCckgibt.
*/
- int GetModulationColor() {
- return m_ModulationColor & 0x00ffffff;
+ int getModulationColor() {
+ return _modulationColor & 0x00ffffff;
}
/**
@brief Gibt den Skalierungsfakter des Bitmaps auf der X-Achse zur\xFCck.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- float GetScaleFactorX() const {
- return m_ScaleFactorX;
+ float getScaleFactorX() const {
+ return _scaleFactorX;
}
/**
@brief Gibt den Skalierungsfakter des Bitmaps auf der Y-Achse zur\xFCck.
@remark Diese Methode darf nur aufgerufen werden, wenn die Methode IsScalingAllowed() true zur\xFCckgibt.
*/
- float GetScaleFactorY() const {
- return m_ScaleFactorY;
+ float getScaleFactorY() const {
+ return _scaleFactorY;
}
/**
@brief Gibt zur\xFCck, ob das Bild an der X-Achse gespiegelt angezeigt wird.
*/
- bool IsFlipH() {
- return m_FlipH;
+ bool isFlipH() {
+ return _flipH;
}
/**
@brief Gibt zur\xFCck, ob das Bild an der Y-Achse gespiegelt angezeigt wird.
*/
- bool IsFlipV() {
- return m_FlipV;
+ bool isFlipV() {
+ return _flipV;
}
// -----------------------------------------------------------------------------
@@ -159,7 +159,7 @@
@remark Diese Methode sollte auf keine Fall benutzt werden um gr\xF6\xDFere Teile des Bildes zu lesen, da sie sehr langsam ist. Sie ist
eher daf\xFCr gedacht einzelne Pixel des Bildes auszulesen.
*/
- virtual uint GetPixel(int X, int Y) const = 0;
+ virtual uint getPixel(int x, int y) const = 0;
/**
@brief F\xFCllt den Inhalt des Bildes mit Pixeldaten.
@@ -172,24 +172,24 @@
@return Gibt false zur\xFCck, falls der Aufruf fehlgeschlagen ist.
@remark Ein Aufruf dieser Methode ist nur erlaubt, wenn IsSetContentAllowed() true zur\xFCckgibt.
*/
- virtual bool SetContent(const byte *Pixeldata, uint size, uint Offset = 0, uint Stride = 0) = 0;
+ virtual bool setContent(const byte *pixeldata, uint size, uint offset = 0, uint stride = 0) = 0;
- virtual bool IsScalingAllowed() const = 0;
- virtual bool IsAlphaAllowed() const = 0;
- virtual bool IsColorModulationAllowed() const = 0;
- virtual bool IsSetContentAllowed() const = 0;
+ virtual bool isScalingAllowed() const = 0;
+ virtual bool isAlphaAllowed() const = 0;
+ virtual bool isColorModulationAllowed() const = 0;
+ virtual bool isSetContentAllowed() const = 0;
- virtual bool Persist(OutputPersistenceBlock &Writer);
- virtual bool Unpersist(InputPersistenceBlock &Reader);
+ virtual bool persist(OutputPersistenceBlock &writer);
+ virtual bool unpersist(InputPersistenceBlock &reader);
protected:
- bool m_FlipH;
- bool m_FlipV;
- float m_ScaleFactorX;
- float m_ScaleFactorY;
- uint m_ModulationColor;
- int m_OriginalWidth;
- int m_OriginalHeight;
+ bool _flipH;
+ bool _flipV;
+ float _scaleFactorX;
+ float _scaleFactorY;
+ uint _modulationColor;
+ int _originalWidth;
+ int _originalHeight;
};
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/bitmapresource.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/bitmapresource.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/bitmapresource.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -45,24 +45,24 @@
// Konstruktion / Destruktion
// --------------------------
-BitmapResource::BitmapResource(const Common::String &Filename, Image *pImage) :
- m_Valid(false),
- m_pImage(pImage),
- Resource(Filename, Resource::TYPE_BITMAP) {
- m_Valid = m_pImage != 0;
+BitmapResource::BitmapResource(const Common::String &filename, Image *pImage) :
+ _valid(false),
+ _pImage(pImage),
+ Resource(filename, Resource::TYPE_BITMAP) {
+ _valid = _pImage != 0;
}
BitmapResource::~BitmapResource() {
- delete m_pImage;
+ delete _pImage;
}
// -----------------------------------------------------------------------------
-uint BitmapResource::GetPixel(int X, int Y) const {
- BS_ASSERT(X >= 0 && X < m_pImage->GetWidth());
- BS_ASSERT(Y >= 0 && Y < m_pImage->GetHeight());
+uint BitmapResource::getPixel(int x, int y) const {
+ BS_ASSERT(x >= 0 && x < _pImage->getWidth());
+ BS_ASSERT(y >= 0 && y < _pImage->getHeight());
- return m_pImage->GetPixel(X, Y);
+ return _pImage->getPixel(x, y);
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/bitmapresource.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/bitmapresource.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/bitmapresource.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -60,30 +60,30 @@
FLIP_VH = FLIP_H | FLIP_V
};
- BitmapResource(const Common::String &Filename, Image *pImage);
+ BitmapResource(const Common::String &filename, Image *pImage);
virtual ~BitmapResource();
/**
@brief Gibt zur\xFCck, ob das Objekt einen g\xFCltigen Zustand hat.
*/
- bool IsValid() const {
- return m_Valid;
+ bool isValid() const {
+ return _valid;
}
/**
@brief Gibt die Breite des Bitmaps zur\xFCck.
*/
- int GetWidth() const {
- BS_ASSERT(m_pImage);
- return m_pImage->GetWidth();
+ int getWidth() const {
+ BS_ASSERT(_pImage);
+ return _pImage->getWidth();
}
/**
@brief Gibt die H\xF6he des Bitmaps zur\xFCck.
*/
- int GetHeight() const {
- BS_ASSERT(m_pImage);
- return m_pImage->GetHeight();
+ int getHeight() const {
+ BS_ASSERT(_pImage);
+ return _pImage->getHeight();
}
/**
@@ -122,13 +122,13 @@
- IsAlphaAllowed()
- IsColorModulationAllowed()
*/
- bool Blit(int PosX = 0, int PosY = 0,
- int Flipping = FLIP_NONE,
+ bool blit(int posX = 0, int posY = 0,
+ int flipping = FLIP_NONE,
Common::Rect *pSrcPartRect = NULL,
- uint Color = BS_ARGB(255, 255, 255, 255),
- int Width = -1, int Height = -1) {
- BS_ASSERT(m_pImage);
- return m_pImage->Blit(PosX, PosY, Flipping, pSrcPartRect, Color, Width, Height);
+ uint color = BS_ARGB(255, 255, 255, 255),
+ int width = -1, int height = -1) {
+ BS_ASSERT(_pImage);
+ return _pImage->blit(posX, posY, flipping, pSrcPartRect, color, width, height);
}
/**
@@ -144,9 +144,9 @@
BS_RGB und BS_ARGB benutzt werden.
@remark Falls das Rechteck nicht v\xF6llig innerhalb des Bildschirms ist, wird es automatisch zurechtgestutzt.
*/
- bool Fill(const Common::Rect *pFillRect = 0, uint Color = BS_RGB(0, 0, 0)) {
- BS_ASSERT(m_pImage);
- return m_pImage->Fill(pFillRect, Color);
+ bool fill(const Common::Rect *pFillRect = 0, uint color = BS_RGB(0, 0, 0)) {
+ BS_ASSERT(_pImage);
+ return _pImage->fill(pFillRect, color);
}
/**
@@ -157,7 +157,7 @@
@remark Diese Methode sollte auf keine Fall benutzt werden um gr\xF6\xDFere Teile des Bildes zu lesen, da sie sehr langsam ist. Sie ist
eher daf\xFCr gedacht einzelne Pixel des Bildes auszulesen.
*/
- uint GetPixel(int X, int Y) const;
+ uint getPixel(int x, int y) const;
//@{
/** @name Auskunfts-Methoden */
@@ -166,46 +166,46 @@
@brief \xDCberpr\xFCft, ob das BS_Image ein Zielbild f\xFCr einen Blit-Aufruf sein kann.
@return Gibt false zur\xFCck, falls ein Blit-Aufruf mit diesem Objekt als Ziel nicht gestattet ist.
*/
- bool IsBlitTarget() {
- BS_ASSERT(m_pImage);
- return m_pImage->IsBlitTarget();
+ bool isBlitTarget() {
+ BS_ASSERT(_pImage);
+ return _pImage->isBlitTarget();
}
/**
@brief Gibt true zur\xFCck, falls das BS_Image bei einem Aufruf von Blit() skaliert dargestellt werden kann.
*/
- bool IsScalingAllowed() {
- BS_ASSERT(m_pImage);
- return m_pImage->IsScalingAllowed();
+ bool isScalingAllowed() {
+ BS_ASSERT(_pImage);
+ return _pImage->isScalingAllowed();
}
/**
@brief Gibt true zur\xFCck, wenn das BS_Image mit einem Aufruf von Fill() gef\xFCllt werden kann.
*/
- bool IsFillingAllowed() {
- BS_ASSERT(m_pImage);
- return m_pImage->IsFillingAllowed();
+ bool isFillingAllowed() {
+ BS_ASSERT(_pImage);
+ return _pImage->isFillingAllowed();
}
/**
@brief Gibt true zur\xFCck, wenn das BS_Image bei einem Aufruf von Blit() mit einem Alphawert dargestellt werden kann.
*/
- bool IsAlphaAllowed() {
- BS_ASSERT(m_pImage);
- return m_pImage->IsAlphaAllowed();
+ bool isAlphaAllowed() {
+ BS_ASSERT(_pImage);
+ return _pImage->isAlphaAllowed();
}
/**
@brief Gibt true zur\xFCck, wenn das BS_Image bei einem Aufruf von Blit() mit Farbmodulation dargestellt werden kann.
*/
- bool IsColorModulationAllowed() {
- BS_ASSERT(m_pImage);
- return m_pImage->IsColorModulationAllowed();
+ bool isColorModulationAllowed() {
+ BS_ASSERT(_pImage);
+ return _pImage->isColorModulationAllowed();
}
private:
- Image *m_pImage;
- bool m_Valid;
+ Image *_pImage;
+ bool _valid;
};
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -53,32 +53,32 @@
// Konstruktion / Destruktion
// -----------------------------------------------------------------------------
-DynamicBitmap::DynamicBitmap(RenderObjectPtr<RenderObject> ParentPtr, uint Width, uint Height) :
- Bitmap(ParentPtr, TYPE_DYNAMICBITMAP) {
+DynamicBitmap::DynamicBitmap(RenderObjectPtr<RenderObject> parentPtr, uint width, uint height) :
+ Bitmap(parentPtr, TYPE_DYNAMICBITMAP) {
// Das BS_Bitmap konnte nicht erzeugt werden, daher muss an dieser Stelle abgebrochen werden.
- if (!m_InitSuccess) return;
+ if (!_initSuccess) return;
- m_InitSuccess = CreateGLImage(Width, Height);
+ _initSuccess = createGLImage(width, height);
}
// -----------------------------------------------------------------------------
-DynamicBitmap::DynamicBitmap(InputPersistenceBlock &Reader, RenderObjectPtr<RenderObject> ParentPtr, uint Handle) :
- Bitmap(ParentPtr, TYPE_DYNAMICBITMAP, Handle) {
- m_InitSuccess = Unpersist(Reader);
+DynamicBitmap::DynamicBitmap(InputPersistenceBlock &reader, RenderObjectPtr<RenderObject> parentPtr, uint handle) :
+ Bitmap(parentPtr, TYPE_DYNAMICBITMAP, handle) {
+ _initSuccess = unpersist(reader);
}
// -----------------------------------------------------------------------------
-bool DynamicBitmap::CreateGLImage(uint Width, uint Height) {
+bool DynamicBitmap::createGLImage(uint width, uint height) {
// GLImage mit den gew\xFCnschten Ma\xDFen erstellen
- bool Result = false;
- m_Image.reset(new GLImage(Width, Height, Result));
+ bool result = false;
+ _image.reset(new GLImage(width, height, result));
- m_OriginalWidth = m_Width = Width;
- m_OriginalHeight = m_Height = Height;
+ _originalWidth = _width = width;
+ _originalHeight = _height = height;
- return Result;
+ return result;
}
// -----------------------------------------------------------------------------
@@ -88,66 +88,66 @@
// -----------------------------------------------------------------------------
-uint DynamicBitmap::GetPixel(int X, int Y) const {
- BS_ASSERT(X >= 0 && X < m_Width);
- BS_ASSERT(Y >= 0 && Y < m_Height);
+uint DynamicBitmap::getPixel(int x, int y) const {
+ BS_ASSERT(x >= 0 && x < _width);
+ BS_ASSERT(y >= 0 && y < _height);
- return m_Image->GetPixel(X, Y);
+ return _image->getPixel(x, y);
}
// -----------------------------------------------------------------------------
-bool DynamicBitmap::DoRender() {
+bool DynamicBitmap::doRender() {
// Framebufferobjekt holen
GraphicEngine *pGfx = static_cast<GraphicEngine *>(Kernel::GetInstance()->GetService("gfx"));
BS_ASSERT(pGfx);
// Bitmap zeichnen
- bool Result;
- if (m_ScaleFactorX == 1.0f && m_ScaleFactorY == 1.0f) {
- Result = m_Image->Blit(m_AbsoluteX, m_AbsoluteY,
- (m_FlipV ? BitmapResource::FLIP_V : 0) |
- (m_FlipH ? BitmapResource::FLIP_H : 0),
- 0, m_ModulationColor, -1, -1);
+ bool result;
+ if (_scaleFactorX == 1.0f && _scaleFactorY == 1.0f) {
+ result = _image->blit(_absoluteX, _absoluteY,
+ (_flipV ? BitmapResource::FLIP_V : 0) |
+ (_flipH ? BitmapResource::FLIP_H : 0),
+ 0, _modulationColor, -1, -1);
} else {
- Result = m_Image->Blit(m_AbsoluteX, m_AbsoluteY,
- (m_FlipV ? BitmapResource::FLIP_V : 0) |
- (m_FlipH ? BitmapResource::FLIP_H : 0),
- 0, m_ModulationColor, m_Width, m_Height);
+ result = _image->blit(_absoluteX, _absoluteY,
+ (_flipV ? BitmapResource::FLIP_V : 0) |
+ (_flipH ? BitmapResource::FLIP_H : 0),
+ 0, _modulationColor, _width, _height);
}
- return Result;
+ return result;
}
// -----------------------------------------------------------------------------
-bool DynamicBitmap::SetContent(const byte *Pixeldata, uint size, uint Offset, uint Stride) {
- return m_Image->SetContent(Pixeldata, size, Offset, Stride);
+bool DynamicBitmap::setContent(const byte *pixeldata, uint size, uint offset, uint stride) {
+ return _image->setContent(pixeldata, size, offset, stride);
}
// -----------------------------------------------------------------------------
// Auskunftsmethoden
// -----------------------------------------------------------------------------
-bool DynamicBitmap::IsScalingAllowed() const {
- return m_Image->IsScalingAllowed();
+bool DynamicBitmap::isScalingAllowed() const {
+ return _image->isScalingAllowed();
}
// -----------------------------------------------------------------------------
-bool DynamicBitmap::IsAlphaAllowed() const {
- return m_Image->IsAlphaAllowed();
+bool DynamicBitmap::isAlphaAllowed() const {
+ return _image->isAlphaAllowed();
}
// -----------------------------------------------------------------------------
-bool DynamicBitmap::IsColorModulationAllowed() const {
- return m_Image->IsColorModulationAllowed();
+bool DynamicBitmap::isColorModulationAllowed() const {
+ return _image->isColorModulationAllowed();
}
// -----------------------------------------------------------------------------
-bool DynamicBitmap::IsSetContentAllowed() const {
+bool DynamicBitmap::isSetContentAllowed() const {
return true;
}
@@ -155,39 +155,39 @@
// Persistenz
// -----------------------------------------------------------------------------
-bool DynamicBitmap::Persist(OutputPersistenceBlock &Writer) {
- bool Result = true;
+bool DynamicBitmap::persist(OutputPersistenceBlock &writer) {
+ bool result = true;
- Result &= Bitmap::Persist(Writer);
+ result &= Bitmap::persist(writer);
// Bilddaten werden nicht gespeichert. Dies ist auch nicht weiter von bedeutung, da BS_DynamicBitmap nur vom Videoplayer benutzt wird.
// W\xE4hrend ein Video abl\xE4uft kann niemals gespeichert werden. BS_DynamicBitmap kann nur der Vollst\xE4ndigkeit halber persistiert werden.
BS_LOG_WARNINGLN("Persisting a BS_DynamicBitmap. Bitmap content is not persisted.");
- Result &= RenderObject::PersistChildren(Writer);
+ result &= RenderObject::persistChildren(writer);
- return Result;
+ return result;
}
-bool DynamicBitmap::Unpersist(InputPersistenceBlock &Reader) {
- bool Result = true;
+bool DynamicBitmap::unpersist(InputPersistenceBlock &reader) {
+ bool result = true;
- Result &= Bitmap::Unpersist(Reader);
+ result &= Bitmap::unpersist(reader);
// Ein BS_GLImage mit den gespeicherten Ma\xDFen erstellen.
- Result &= CreateGLImage(m_Width, m_Height);
+ result &= createGLImage(_width, _height);
// Bilddaten werden nicht gespeichert (s.o.).
BS_LOG_WARNINGLN("Unpersisting a BS_DynamicBitmap. Bitmap contents are missing.");
// Bild mit durchsichtigen Bilddaten initialisieren.
- byte *TransparentImageData = (byte *)calloc(m_Width * m_Height * 4, 1);
- m_Image->SetContent(TransparentImageData, m_Width * m_Height);
- free(TransparentImageData);
+ byte *transparentImageData = (byte *)calloc(_width * _height * 4, 1);
+ _image->setContent(transparentImageData, _width * _height);
+ free(transparentImageData);
- Result &= RenderObject::UnpersistChildren(Reader);
+ result &= RenderObject::unpersistChildren(reader);
- return Reader.IsGood() && Result;
+ return reader.isGood() && result;
}
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h 2010-10-12 23:32:32 UTC (rev 53310)
@@ -58,28 +58,28 @@
public:
virtual ~DynamicBitmap();
- virtual uint GetPixel(int X, int Y) const;
+ virtual uint getPixel(int x, int y) const;
- virtual bool SetContent(const byte *Pixeldata, uint size, uint Offset, uint Stride);
+ virtual bool setContent(const byte *pixeldata, uint size, uint offset, uint stride);
- virtual bool IsScalingAllowed() const;
- virtual bool IsAlphaAllowed() const;
- virtual bool IsColorModulationAllowed() const;
- virtual bool IsSetContentAllowed() const;
+ virtual bool isScalingAllowed() const;
+ virtual bool isAlphaAllowed() const;
+ virtual bool isColorModulationAllowed() const;
+ virtual bool isSetContentAllowed() const;
- virtual bool Persist(OutputPersistenceBlock &Writer);
- virtual bool Unpersist(InputPersistenceBlock &Reader);
+ virtual bool persist(OutputPersistenceBlock &writer);
+ virtual bool unpersist(InputPersistenceBlock &reader);
protected:
- virtual bool DoRender();
+ virtual bool doRender();
private:
- DynamicBitmap(RenderObjectPtr<RenderObject> ParentPtr, uint Width, uint Height);
- DynamicBitmap(InputPersistenceBlock &Reader, RenderObjectPtr<RenderObject> ParentPtr, uint Handle);
+ DynamicBitmap(RenderObjectPtr<RenderObject> parentPtr, uint width, uint height);
+ DynamicBitmap(InputPersistenceBlock &reader, RenderObjectPtr<RenderObject> parentPtr, uint handle);
- bool CreateGLImage(uint Width, uint Height);
+ bool createGLImage(uint width, uint height);
- Common::ScopedPtr<GLImage> m_Image;
+ Common::ScopedPtr<GLImage> _image;
};
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/fontresource.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/fontresource.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/fontresource.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -70,9 +70,9 @@
// Load the contents of the file
uint fileSize;
- char *xmlData = pPackage->GetXmlFile(GetFileName(), &fileSize);
+ char *xmlData = pPackage->GetXmlFile(getFileName(), &fileSize);
if (!xmlData) {
- BS_LOG_ERRORLN("Could not read \"%s\".", GetFileName().c_str());
+ BS_LOG_ERRORLN("Could not read \"%s\".", getFileName().c_str());
return;
}
@@ -93,13 +93,13 @@
if (!parseIntegerKey(node->values["lineheight"].c_str(), 1, &_LineHeight)) {
BS_LOG_WARNINGLN("Illegal or missing lineheight attribute in <font> tag in \"%s\". Assuming default (\"%d\").",
- GetFileName().c_str(), DEFAULT_LINEHEIGHT);
+ getFileName().c_str(), DEFAULT_LINEHEIGHT);
_LineHeight = DEFAULT_LINEHEIGHT;
}
if (!parseIntegerKey(node->values["gap"].c_str(), 1, &_GapWidth)) {
BS_LOG_WARNINGLN("Illegal or missing gap attribute in <font> tag in \"%s\". Assuming default (\"%d\").",
- GetFileName().c_str(), DEFAULT_GAPWIDTH);
+ getFileName().c_str(), DEFAULT_GAPWIDTH);
_GapWidth = DEFAULT_GAPWIDTH;
}
@@ -112,7 +112,7 @@
_BitmapFileName = pPackage->GetAbsolutePath(bitmapFilename);
if (_BitmapFileName == "") {
BS_LOG_ERRORLN("Image file \"%s\" was specified in <font> tag of \"%s\" but could not be found.",
- _BitmapFileName.c_str(), GetFileName().c_str());
+ _BitmapFileName.c_str(), getFileName().c_str());
}
// Pre-cache the resource
@@ -130,20 +130,20 @@
int charCode, top, left, right, bottom;
if (!parseIntegerKey(node->values["code"].c_str(), 1, &charCode) || (charCode < 0) || (charCode >= 256)) {
- return parserError("Illegal or missing code attribute in <character> tag in \"%s\".", GetFileName().c_str());
+ return parserError("Illegal or missing code attribute in <character> tag in \"%s\".", getFileName().c_str());
}
if (!parseIntegerKey(node->values["top"].c_str(), 1, &top) || (top < 0)) {
- return parserError("Illegal or missing top attribute in <character> tag in \"%s\".", GetFileName().c_str());
+ return parserError("Illegal or missing top attribute in <character> tag in \"%s\".", getFileName().c_str());
}
if (!parseIntegerKey(node->values["left"].c_str(), 1, &left) || (left < 0)) {
- return parserError("Illegal or missing left attribute in <character> tag in \"%s\".", GetFileName().c_str());
+ return parserError("Illegal or missing left attribute in <character> tag in \"%s\".", getFileName().c_str());
}
if (!parseIntegerKey(node->values["right"].c_str(), 1, &right) || (right < 0)) {
- return parserError("Illegal or missing right attribute in <character> tag in \"%s\".", GetFileName().c_str());
+ return parserError("Illegal or missing right attribute in <character> tag in \"%s\".", getFileName().c_str());
}
if (!parseIntegerKey(node->values["bottom"].c_str(), 1, &bottom) || (bottom < 0)) {
- return parserError("Illegal or missing bottom attribute in <character> tag in \"%s\".", GetFileName().c_str());
+ return parserError("Illegal or missing bottom attribute in <character> tag in \"%s\".", getFileName().c_str());
}
this->_CharacterRects[charCode] = Common::Rect(left, top, right, bottom);
Modified: scummvm/trunk/engines/sword25/gfx/graphicengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/graphicengine.cpp 2010-10-12 23:30:00 UTC (rev 53309)
+++ scummvm/trunk/engines/sword25/gfx/graphicengine.cpp 2010-10-12 23:32:32 UTC (rev 53310)
@@ -196,16 +196,16 @@
// -----------------------------------------------------------------------------
-bool GraphicEngine::Persist(OutputPersistenceBlock &Writer) {
- Writer.Write(m_TimerActive);
+bool GraphicEngine::persist(OutputPersistenceBlock &writer) {
+ writer.write(m_TimerActive);
return true;
}
// -----------------------------------------------------------------------------
-bool GraphicEngine::Unpersist(InputPersistenceBlock &Reader) {
- Reader.Read(m_TimerActive);
- return Reader.IsGood();
@@ Diff output truncated at 100000 characters. @@
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list