[Scummvm-cvs-logs] SF.net SVN: scummvm:[53222] scummvm/trunk/engines/sword25
sev at users.sourceforge.net
sev at users.sourceforge.net
Wed Oct 13 00:35:56 CEST 2010
Revision: 53222
http://scummvm.svn.sourceforge.net/scummvm/?rev=53222&view=rev
Author: sev
Date: 2010-10-12 22:35:55 +0000 (Tue, 12 Oct 2010)
Log Message:
-----------
SWORD25: Mass-astyle.
Modified Paths:
--------------
scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
scummvm/trunk/engines/sword25/fmv/movieplayer.h
scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
scummvm/trunk/engines/sword25/fmv/theora_decoder.h
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/fontresource.h
scummvm/trunk/engines/sword25/gfx/framecounter.cpp
scummvm/trunk/engines/sword25/gfx/framecounter.h
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/b25sloader.cpp
scummvm/trunk/engines/sword25/gfx/image/b25sloader.h
scummvm/trunk/engines/sword25/gfx/image/image.h
scummvm/trunk/engines/sword25/gfx/image/imageloader.cpp
scummvm/trunk/engines/sword25/gfx/image/imageloader.h
scummvm/trunk/engines/sword25/gfx/image/imageloader_ids.h
scummvm/trunk/engines/sword25/gfx/image/pngloader.cpp
scummvm/trunk/engines/sword25/gfx/image/pngloader.h
scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
scummvm/trunk/engines/sword25/gfx/image/vectorimage.h
scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.cpp
scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.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.cpp
scummvm/trunk/engines/sword25/gfx/renderobjectptr.h
scummvm/trunk/engines/sword25/gfx/renderobjectregistry.cpp
scummvm/trunk/engines/sword25/gfx/renderobjectregistry.h
scummvm/trunk/engines/sword25/gfx/rootrenderobject.h
scummvm/trunk/engines/sword25/gfx/screenshot.cpp
scummvm/trunk/engines/sword25/gfx/screenshot.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/inputengine.cpp
scummvm/trunk/engines/sword25/input/inputengine.h
scummvm/trunk/engines/sword25/input/inputengine_script.cpp
scummvm/trunk/engines/sword25/input/scummvminput.cpp
scummvm/trunk/engines/sword25/input/scummvminput.h
scummvm/trunk/engines/sword25/kernel/bs_stdint.h
scummvm/trunk/engines/sword25/kernel/callbackregistry.cpp
scummvm/trunk/engines/sword25/kernel/callbackregistry.h
scummvm/trunk/engines/sword25/kernel/common.h
scummvm/trunk/engines/sword25/kernel/filesystemutil.cpp
scummvm/trunk/engines/sword25/kernel/filesystemutil.h
scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.cpp
scummvm/trunk/engines/sword25/kernel/inputpersistenceblock.h
scummvm/trunk/engines/sword25/kernel/kernel.cpp
scummvm/trunk/engines/sword25/kernel/kernel.h
scummvm/trunk/engines/sword25/kernel/kernel_script.cpp
scummvm/trunk/engines/sword25/kernel/log.cpp
scummvm/trunk/engines/sword25/kernel/log.h
scummvm/trunk/engines/sword25/kernel/memleaks.cpp
scummvm/trunk/engines/sword25/kernel/memleaks.h
scummvm/trunk/engines/sword25/kernel/memlog_off.h
scummvm/trunk/engines/sword25/kernel/memlog_on.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/persistenceblock.h
scummvm/trunk/engines/sword25/kernel/persistenceservice.cpp
scummvm/trunk/engines/sword25/kernel/persistenceservice.h
scummvm/trunk/engines/sword25/kernel/resmanager.cpp
scummvm/trunk/engines/sword25/kernel/resmanager.h
scummvm/trunk/engines/sword25/kernel/resource.cpp
scummvm/trunk/engines/sword25/kernel/resource.h
scummvm/trunk/engines/sword25/kernel/resservice.h
scummvm/trunk/engines/sword25/kernel/scummvmwindow.cpp
scummvm/trunk/engines/sword25/kernel/scummvmwindow.h
scummvm/trunk/engines/sword25/kernel/service.h
scummvm/trunk/engines/sword25/kernel/service_ids.h
scummvm/trunk/engines/sword25/kernel/string.h
scummvm/trunk/engines/sword25/kernel/window.cpp
scummvm/trunk/engines/sword25/kernel/window.h
scummvm/trunk/engines/sword25/math/geometry.cpp
scummvm/trunk/engines/sword25/math/geometry.h
scummvm/trunk/engines/sword25/math/geometry_script.cpp
scummvm/trunk/engines/sword25/math/line.h
scummvm/trunk/engines/sword25/math/polygon.cpp
scummvm/trunk/engines/sword25/math/polygon.h
scummvm/trunk/engines/sword25/math/rect.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/vertex.cpp
scummvm/trunk/engines/sword25/math/vertex.h
scummvm/trunk/engines/sword25/math/walkregion.cpp
scummvm/trunk/engines/sword25/math/walkregion.h
scummvm/trunk/engines/sword25/package/packagemanager.cpp
scummvm/trunk/engines/sword25/package/packagemanager.h
scummvm/trunk/engines/sword25/package/packagemanager_script.cpp
scummvm/trunk/engines/sword25/package/scummvmpackagemanager.cpp
scummvm/trunk/engines/sword25/package/scummvmpackagemanager.h
scummvm/trunk/engines/sword25/script/lua_extensions.cpp
scummvm/trunk/engines/sword25/script/luabindhelper.cpp
scummvm/trunk/engines/sword25/script/luabindhelper.h
scummvm/trunk/engines/sword25/script/luacallback.cpp
scummvm/trunk/engines/sword25/script/luacallback.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/fmodexchannel.cpp
scummvm/trunk/engines/sword25/sfx/fmodexchannel.h
scummvm/trunk/engines/sword25/sfx/fmodexexception.h
scummvm/trunk/engines/sword25/sfx/fmodexresource.cpp
scummvm/trunk/engines/sword25/sfx/fmodexresource.h
scummvm/trunk/engines/sword25/sfx/fmodexsound.cpp
scummvm/trunk/engines/sword25/sfx/fmodexsound.h
scummvm/trunk/engines/sword25/sfx/soundengine.cpp
scummvm/trunk/engines/sword25/sfx/soundengine.h
scummvm/trunk/engines/sword25/sfx/soundengine_script.cpp
scummvm/trunk/engines/sword25/sword25.cpp
scummvm/trunk/engines/sword25/sword25.h
Property Changed:
----------------
scummvm/trunk/engines/sword25/fmv/theora_decoder.h
Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -38,7 +38,9 @@
#define BS_LOG_PREFIX "MOVIEPLAYER"
-BS_Service *BS_OggTheora_CreateObject(BS_Kernel *pKernel) { return new BS_MoviePlayer(pKernel); }
+BS_Service *BS_OggTheora_CreateObject(BS_Kernel *pKernel) {
+ return new BS_MoviePlayer(pKernel);
+}
BS_MoviePlayer::BS_MoviePlayer(BS_Kernel *pKernel) : BS_Service(pKernel) {
if (!_RegisterScriptBindings())
Modified: scummvm/trunk/engines/sword25/fmv/movieplayer.h
===================================================================
--- scummvm/trunk/engines/sword25/fmv/movieplayer.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/fmv/movieplayer.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -67,16 +67,16 @@
* This method loads a movie file and prepares it for playback.
* There can be oly one movie file loaded at a time. If you already have loaded a
* movie file, it will be unloaded and, if necessary, stopped playing.
- * @param Filename The filename of the movie file to be loaded
- * @param Z Z indicates the position of the film on the main graphics layer
- * @return Returns false if an error occured while loading, otherwise true.
+ * @param Filename The filename of the movie file to be loaded
+ * @param Z Z indicates the position of the film on the main graphics layer
+ * @return Returns false if an error occured while loading, otherwise true.
*/
bool LoadMovie(const Common::String &Filename, unsigned int Z);
/**
* Unloads the currently loaded movie file.
- * @return Returns false if an error occurred while unloading, otherwise true.
- * @remark This method can only be called when IsMovieLoaded() returns true.
+ * @return Returns false if an error occurred while unloading, otherwise true.
+ * @remark This method can only be called when IsMovieLoaded() returns true.
*/
bool UnloadMovie();
@@ -85,8 +85,8 @@
*
* The film will be keeping the aspect ratio of the screen.
* If the film was previously paused with Pause(), then the film will resume playing.
- * @return Returns false if an error occurred while starting, otherwise true.
- * @remark This method can only be called when IsMovieLoaded() returns true.
+ * @return Returns false if an error occurred while starting, otherwise true.
+ * @remark This method can only be called when IsMovieLoaded() returns true.
*/
bool Play();
@@ -94,8 +94,8 @@
* Pauses movie playback.
*
* A paused movie can later be resumed by calling the Play() method again.
- * @return Returns false if an error occurred while pausing, otherwise true.
- * @remark This method can only be called when IsMovieLoaded() returns true.
+ * @return Returns false if an error occurred while pausing, otherwise true.
+ * @remark This method can only be called when IsMovieLoaded() returns true.
*/
bool Pause();
@@ -111,7 +111,7 @@
/**
* Returns whether the movie playback is paused.
- * @remark This method can only be called when IsMovieLoaded() returns true.
+ * @remark This method can only be called when IsMovieLoaded() returns true.
*/
bool IsPaused();
@@ -120,21 +120,21 @@
*
* When a movie is loaded, the scaling factor is automatically selected so that the film
* takes the maximum screen space, without the film being distorted.
- * @return Returns the scaling factor of the film.
- * @remark This method can only be called when IsMovieLoaded() returns true.
+ * @return Returns the scaling factor of the film.
+ * @remark This method can only be called when IsMovieLoaded() returns true.
*/
float GetScaleFactor();
/**
* Sets the factor by which the loaded film is to be scaled.
- * @param ScaleFactor The desired scale factor.
- * @remark This method can only be called when IsMovieLoaded() returns true.
+ * @param ScaleFactor The desired scale factor.
+ * @remark This method can only be called when IsMovieLoaded() returns true.
*/
void SetScaleFactor(float ScaleFactor);
/**
* Returns the current playing position in seconds.
- * @remark This method can only be called when IsMovieLoaded() returns true.
+ * @remark This method can only be called when IsMovieLoaded() returns true.
*/
double GetTime();
Modified: scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp
===================================================================
--- scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/fmv/theora_decoder.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -64,11 +64,11 @@
}
void TheoraDecoder::queuePage(ogg_page *page) {
- if (_theoraPacket)
- ogg_stream_pagein(&_theoraOut, page);
+ if (_theoraPacket)
+ ogg_stream_pagein(&_theoraOut, page);
- if (_vorbisPacket)
- ogg_stream_pagein(&_vorbisOut, page);
+ if (_vorbisPacket)
+ ogg_stream_pagein(&_vorbisOut, page);
}
int TheoraDecoder::bufferData() {
@@ -203,7 +203,7 @@
if (_theoraInfo.pic_width != _theoraInfo.frame_width || _theoraInfo.pic_height != _theoraInfo.frame_height)
debug(1, " Frame content is %dx%d with offset (%d,%d).",
- _theoraInfo.frame_width, _theoraInfo.frame_height, _theoraInfo.pic_x, _theoraInfo.pic_y);
+ _theoraInfo.frame_width, _theoraInfo.frame_height, _theoraInfo.pic_x, _theoraInfo.pic_y);
th_decode_ctl(_theoraDecode, TH_DECCTL_GET_PPLEVEL_MAX, &_ppLevelMax, sizeof(_ppLevelMax));
_ppLevel = _ppLevelMax;
@@ -222,7 +222,7 @@
vorbis_synthesis_init(&_vorbisDSP, &_vorbisInfo);
vorbis_block_init(&_vorbisDSP, &_vorbisBlock);
debug(3, "Ogg logical stream %lx is Vorbis %d channel %ld Hz audio.",
- _vorbisOut.serialno, _vorbisInfo.channels, _vorbisInfo.rate);
+ _vorbisOut.serialno, _vorbisInfo.channels, _vorbisInfo.rate);
} else {
// tear down the partial vorbis setup
vorbis_info_clear(&_vorbisInfo);
@@ -307,7 +307,7 @@
_audiobufGranulePos = _vorbisDSP.granulepos - ret + i;
else
_audiobufGranulePos += i;
- } else {
+ } else {
// no pending audio; is there a pending packet to decode?
if (ogg_stream_packetout(&_vorbisOut, &_oggPacket) > 0) {
@@ -367,7 +367,7 @@
// are we at or past time for this video frame?
if (_stateFlag && _videobufReady) {
th_ycbcr_buffer yuv;
-
+
th_decode_ycbcr_out(_theoraDecode, yuv);
// TODO: YUV->RGB
@@ -388,7 +388,7 @@
// if our buffers either don't exist or are ready to go,
// we can begin playback
if ((!_theoraPacket || _videobufReady) &&
- (!_vorbisPacket || _audiobufReady))
+ (!_vorbisPacket || _audiobufReady))
_stateFlag = true;
// same if we've run out of input
Modified: scummvm/trunk/engines/sword25/fmv/theora_decoder.h
===================================================================
--- scummvm/trunk/engines/sword25/fmv/theora_decoder.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/fmv/theora_decoder.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -34,7 +34,7 @@
#include <vorbis/codec.h>
namespace Common {
- class SeekableReadStream;
+class SeekableReadStream;
}
namespace Sword25 {
@@ -65,16 +65,28 @@
*/
Graphics::Surface *decodeNextFrame();
- bool isVideoLoaded() const { return _fileStream != 0; }
- uint16 getWidth() const { return _surface->w; }
- uint16 getHeight() const { return _surface->h; }
- uint32 getFrameCount() const { return _frameCount; }
- Graphics::PixelFormat getPixelFormat() const { return Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 0, 0, 0); }
+ bool isVideoLoaded() const {
+ return _fileStream != 0;
+ }
+ uint16 getWidth() const {
+ return _surface->w;
+ }
+ uint16 getHeight() const {
+ return _surface->h;
+ }
+ uint32 getFrameCount() const {
+ return _frameCount;
+ }
+ Graphics::PixelFormat getPixelFormat() const {
+ return Graphics::PixelFormat(3, 8, 8, 8, 0, 0, 0, 0, 0);
+ }
uint32 getElapsedTime() const;
protected:
- Common::Rational getFrameRate() const { return _frameRate; }
+ Common::Rational getFrameRate() const {
+ return _frameRate;
+ }
private:
void queuePage(ogg_page *page);
Property changes on: scummvm/trunk/engines/sword25/fmv/theora_decoder.h
___________________________________________________________________
Deleted: svn:executable
- *
Modified: scummvm/trunk/engines/sword25/gfx/animation.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animation.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animation.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -57,9 +57,8 @@
// Konstruktion / Destruktion
// --------------------------
-BS_Animation::BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const Common::String & FileName) :
- BS_TimedRenderObject(ParentPtr, BS_RenderObject::TYPE_ANIMATION)
-{
+BS_Animation::BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const Common::String &FileName) :
+ BS_TimedRenderObject(ParentPtr, BS_RenderObject::TYPE_ANIMATION) {
// Das BS_RenderObject konnte nicht erzeugt werden, daher muss an dieser Stelle abgebrochen werden.
if (!m_InitSuccess) return;
@@ -69,16 +68,15 @@
m_InitSuccess = false;
InitializeAnimationResource(FileName);
-
+
// Erfolg signalisieren.
m_InitSuccess = true;
}
// -----------------------------------------------------------------------------
-BS_Animation::BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const BS_AnimationTemplate & Template) :
- BS_TimedRenderObject(ParentPtr, BS_RenderObject::TYPE_ANIMATION)
-{
+BS_Animation::BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const BS_AnimationTemplate &Template) :
+ BS_TimedRenderObject(ParentPtr, BS_RenderObject::TYPE_ANIMATION) {
// Das BS_RenderObject konnte nicht erzeugt werden, daher muss an dieser Stelle abgebrochen werden.
if (!m_InitSuccess) return;
@@ -95,9 +93,8 @@
// -----------------------------------------------------------------------------
-BS_Animation::BS_Animation(BS_InputPersistenceBlock & Reader, BS_RenderObjectPtr<BS_RenderObject> ParentPtr, unsigned int Handle) :
- BS_TimedRenderObject(ParentPtr, BS_RenderObject::TYPE_ANIMATION, Handle)
-{
+BS_Animation::BS_Animation(BS_InputPersistenceBlock &Reader, BS_RenderObjectPtr<BS_RenderObject> ParentPtr, unsigned int Handle) :
+ BS_TimedRenderObject(ParentPtr, BS_RenderObject::TYPE_ANIMATION, Handle) {
// Das BS_RenderObject konnte nicht erzeugt werden, daher muss an dieser Stelle abgebrochen werden.
if (!m_InitSuccess) return;
@@ -109,14 +106,12 @@
// -----------------------------------------------------------------------------
-void BS_Animation::InitializeAnimationResource(const Common::String &FileName)
-{
+void BS_Animation::InitializeAnimationResource(const Common::String &FileName) {
// Die Resource wird f\xFCr die gesamte Lebensdauer des Animations-Objektes gelockt.
- BS_Resource * ResourcePtr = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(FileName);
+ BS_Resource *ResourcePtr = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(FileName);
if (ResourcePtr && ResourcePtr->GetType() == BS_Resource::TYPE_ANIMATION)
m_AnimationResourcePtr = static_cast<BS_AnimationResource *>(ResourcePtr);
- else
- {
+ else {
BS_LOG_ERRORLN("The resource \"%s\" could not be requested. The Animation can't be created.", FileName.c_str());
return;
}
@@ -127,8 +122,7 @@
// -----------------------------------------------------------------------------
-void BS_Animation::InitMembers()
-{
+void BS_Animation::InitMembers() {
m_CurrentFrame = 0;
m_CurrentFrameTime = 0;
m_Direction = FORWARD;
@@ -146,17 +140,15 @@
// -----------------------------------------------------------------------------
-BS_Animation::~BS_Animation()
-{
- if (GetAnimationDescription())
- {
+BS_Animation::~BS_Animation() {
+ if (GetAnimationDescription()) {
Stop();
GetAnimationDescription()->Unlock();
}
// Delete Callbacks
Common::Array<ANIMATION_CALLBACK_DATA>::iterator it = m_DeleteCallbacks.begin();
- for (; it != m_DeleteCallbacks.end(); it++) ((*it).Callback)((*it).Data);
+ for (; it != m_DeleteCallbacks.end(); it++)((*it).Callback)((*it).Data);
}
@@ -164,8 +156,7 @@
// Steuermethoden
// -----------------------------------------------------------------------------
-void BS_Animation::Play()
-{
+void BS_Animation::Play() {
// Wenn die Animation zuvor komplett durchgelaufen ist, wird sie wieder von Anfang abgespielt
if (m_Finished) Stop();
@@ -175,16 +166,14 @@
// -----------------------------------------------------------------------------
-void BS_Animation::Pause()
-{
+void BS_Animation::Pause() {
m_Running = false;
UnlockAllFrames();
}
// -----------------------------------------------------------------------------
-void BS_Animation::Stop()
-{
+void BS_Animation::Stop() {
m_CurrentFrame = 0;
m_CurrentFrameTime = 0;
m_Direction = FORWARD;
@@ -193,15 +182,13 @@
// -----------------------------------------------------------------------------
-void BS_Animation::SetFrame(unsigned int Nr)
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+void BS_Animation::SetFrame(unsigned int Nr) {
+ BS_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;
}
@@ -215,37 +202,33 @@
// Rendern
// -----------------------------------------------------------------------------
-bool BS_Animation::DoRender()
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+bool BS_Animation::DoRender() {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
BS_ASSERT(m_CurrentFrame < animationDescriptionPtr->GetFrameCount());
// Bitmap des aktuellen Frames holen
- BS_Resource* pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(m_CurrentFrame).FileName);
+ BS_Resource *pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(m_CurrentFrame).FileName);
BS_ASSERT(pResource);
BS_ASSERT(pResource->GetType() == BS_Resource::TYPE_BITMAP);
- BS_BitmapResource * pBitmapResource = static_cast<BS_BitmapResource*>(pResource);
+ BS_BitmapResource *pBitmapResource = static_cast<BS_BitmapResource *>(pResource);
// Framebufferobjekt holen
- BS_GraphicEngine * pGfx = static_cast<BS_GraphicEngine *>(BS_Kernel::GetInstance()->GetService("gfx"));
+ BS_GraphicEngine *pGfx = static_cast<BS_GraphicEngine *>(BS_Kernel::GetInstance()->GetService("gfx"));
BS_ASSERT(pGfx);
// Bitmap zeichnen
bool Result;
- if (IsScalingAllowed() && (m_Width != pBitmapResource->GetWidth() || m_Height != pBitmapResource->GetHeight()))
- {
+ if (IsScalingAllowed() && (m_Width != pBitmapResource->GetWidth() || m_Height != pBitmapResource->GetHeight())) {
Result = pBitmapResource->Blit(m_AbsoluteX, m_AbsoluteY,
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipV ? BS_BitmapResource::FLIP_V : 0) |
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipH ? BS_BitmapResource::FLIP_H : 0),
- 0, m_ModulationColor, m_Width, m_Height);
- }
- else
- {
+ (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipV ? BS_BitmapResource::FLIP_V : 0) |
+ (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipH ? BS_BitmapResource::FLIP_H : 0),
+ 0, m_ModulationColor, m_Width, m_Height);
+ } else {
Result = pBitmapResource->Blit(m_AbsoluteX, m_AbsoluteY,
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipV ? BS_BitmapResource::FLIP_V : 0) |
- (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipH ? BS_BitmapResource::FLIP_H : 0),
- 0, m_ModulationColor, -1, -1);
+ (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipV ? BS_BitmapResource::FLIP_V : 0) |
+ (animationDescriptionPtr->GetFrame(m_CurrentFrame).FlipH ? BS_BitmapResource::FLIP_H : 0),
+ 0, m_ModulationColor, -1, -1);
}
// Resource freigeben
@@ -258,15 +241,13 @@
// Frame Notifikation
// -----------------------------------------------------------------------------
-void BS_Animation::FrameNotification(int TimeElapsed)
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+void BS_Animation::FrameNotification(int TimeElapsed) {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
BS_ASSERT(TimeElapsed >= 0);
// Nur wenn die Animation l\xE4uft wird sie auch weiterbewegt
- if (m_Running)
- {
+ if (m_Running) {
int OldFrame = m_CurrentFrame;
// Gesamte vergangene Zeit bestimmen (inkl. Restzeit des aktuellen Frames)
@@ -280,8 +261,7 @@
// Neuen Frame bestimmen (je nach aktuellener Abspielrichtung wird addiert oder subtrahiert)
int TmpCurFrame = m_CurrentFrame;
- switch (m_Direction)
- {
+ switch (m_Direction) {
case FORWARD:
TmpCurFrame += SkipFrames;
break;
@@ -292,20 +272,16 @@
default:
BS_ASSERT(0);
- }
+ }
// \xDCberl\xE4ufe behandeln
- if (TmpCurFrame < 0)
- {
+ if (TmpCurFrame < 0) {
// Loop-Point Callbacks
Common::Array<ANIMATION_CALLBACK_DATA>::iterator it = m_LoopPointCallbacks.begin();
- while (it != m_LoopPointCallbacks.end())
- {
- if (((*it).Callback)((*it).Data) == false)
- {
+ while (it != m_LoopPointCallbacks.end()) {
+ if (((*it).Callback)((*it).Data) == false) {
it = m_LoopPointCallbacks.erase(it);
- }
- else
+ } else
it++;
}
@@ -313,21 +289,17 @@
BS_ASSERT(animationDescriptionPtr->GetAnimationType() == AT_JOJO);
TmpCurFrame = - TmpCurFrame;
m_Direction = FORWARD;
- }
- else if (static_cast<unsigned int>(TmpCurFrame) >= animationDescriptionPtr->GetFrameCount())
- {
+ } else if (static_cast<unsigned int>(TmpCurFrame) >= animationDescriptionPtr->GetFrameCount()) {
// Loop-Point Callbacks
Common::Array<ANIMATION_CALLBACK_DATA>::iterator it = m_LoopPointCallbacks.begin();
- while (it != m_LoopPointCallbacks.end())
- {
+ while (it != m_LoopPointCallbacks.end()) {
if (((*it).Callback)((*it).Data) == false)
it = m_LoopPointCallbacks.erase(it);
else
it++;
}
- switch (animationDescriptionPtr->GetAnimationType())
- {
+ switch (animationDescriptionPtr->GetAnimationType()) {
case AT_ONESHOT:
TmpCurFrame = animationDescriptionPtr->GetFrameCount() - 1;
m_Finished = true;
@@ -348,16 +320,13 @@
}
}
- if (m_CurrentFrame != TmpCurFrame)
- {
+ if (m_CurrentFrame != TmpCurFrame) {
ForceRefresh();
-
- if (animationDescriptionPtr->GetFrame(m_CurrentFrame).Action != "")
- {
+
+ if (animationDescriptionPtr->GetFrame(m_CurrentFrame).Action != "") {
// Action Callbacks
Common::Array<ANIMATION_CALLBACK_DATA>::iterator it = m_ActionCallbacks.begin();
- while (it != m_ActionCallbacks.end())
- {
+ while (it != m_ActionCallbacks.end()) {
if (((*it).Callback)((*it).Data) == false)
it = m_ActionCallbacks.erase(it);
else
@@ -378,23 +347,22 @@
// -----------------------------------------------------------------------------
-void BS_Animation::ComputeCurrentCharacteristics()
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+void BS_Animation::ComputeCurrentCharacteristics() {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- const BS_AnimationResource::Frame & CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
+ const BS_AnimationResource::Frame &CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
- BS_Resource* pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
+ BS_Resource *pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
BS_ASSERT(pResource);
BS_ASSERT(pResource->GetType() == BS_Resource::TYPE_BITMAP);
- BS_BitmapResource* pBitmap = static_cast<BS_BitmapResource *>(pResource);
+ BS_BitmapResource *pBitmap = static_cast<BS_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);
// Position anhand des Hotspots berechnen und setzen
- int PosX = m_RelX + ComputeXModifier();
+ int PosX = m_RelX + ComputeXModifier();
int PosY = m_RelY + ComputeYModifier();
BS_RenderObject::SetPos(PosX, PosY);
@@ -404,16 +372,12 @@
// -----------------------------------------------------------------------------
-bool BS_Animation::LockAllFrames()
-{
- if (!m_FramesLocked)
- {
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+bool BS_Animation::LockAllFrames() {
+ if (!m_FramesLocked) {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- for (unsigned int i = 0; i < animationDescriptionPtr->GetFrameCount(); ++i)
- {
- if (!BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(i).FileName))
- {
+ for (unsigned int i = 0; i < animationDescriptionPtr->GetFrameCount(); ++i) {
+ if (!BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(i).FileName)) {
BS_LOG_ERRORLN("Could not lock all animation frames.");
return false;
}
@@ -427,17 +391,13 @@
// -----------------------------------------------------------------------------
-bool BS_Animation::UnlockAllFrames()
-{
- if (m_FramesLocked)
- {
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+bool BS_Animation::UnlockAllFrames() {
+ if (m_FramesLocked) {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- for (unsigned int i = 0; i < animationDescriptionPtr->GetFrameCount(); ++i)
- {
- BS_Resource* pResource;
- if (!(pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(i).FileName)))
- {
+ for (unsigned int i = 0; i < animationDescriptionPtr->GetFrameCount(); ++i) {
+ BS_Resource *pResource;
+ if (!(pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(animationDescriptionPtr->GetFrame(i).FileName))) {
BS_LOG_ERRORLN("Could not unlock all animation frames.");
return false;
}
@@ -457,54 +417,48 @@
// Getter
// -----------------------------------------------------------------------------
-BS_Animation::ANIMATION_TYPES BS_Animation::GetAnimationType() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+BS_Animation::ANIMATION_TYPES BS_Animation::GetAnimationType() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
return animationDescriptionPtr->GetAnimationType();
}
// -----------------------------------------------------------------------------
-int BS_Animation::GetFPS() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+int BS_Animation::GetFPS() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
return animationDescriptionPtr->GetFPS();
}
// -----------------------------------------------------------------------------
-int BS_Animation::GetFrameCount() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+int BS_Animation::GetFrameCount() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
return animationDescriptionPtr->GetFrameCount();
}
// -----------------------------------------------------------------------------
-bool BS_Animation::IsScalingAllowed() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+bool BS_Animation::IsScalingAllowed() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
return animationDescriptionPtr->IsScalingAllowed();
}
// -----------------------------------------------------------------------------
-bool BS_Animation::IsAlphaAllowed() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+bool BS_Animation::IsAlphaAllowed() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
return animationDescriptionPtr->IsAlphaAllowed();
}
// -----------------------------------------------------------------------------
-bool BS_Animation::IsColorModulationAllowed() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+bool BS_Animation::IsColorModulationAllowed() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
return animationDescriptionPtr->IsColorModulationAllowed();
}
@@ -513,8 +467,7 @@
// Positionieren
// -----------------------------------------------------------------------------
-void BS_Animation::SetPos(int RelX, int RelY)
-{
+void BS_Animation::SetPos(int RelX, int RelY) {
m_RelX = RelX;
m_RelY = RelY;
@@ -523,8 +476,7 @@
// -----------------------------------------------------------------------------
-void BS_Animation::SetX(int RelX)
-{
+void BS_Animation::SetX(int RelX) {
m_RelX = RelX;
ComputeCurrentCharacteristics();
@@ -532,8 +484,7 @@
// -----------------------------------------------------------------------------
-void BS_Animation::SetY(int RelY)
-{
+void BS_Animation::SetY(int RelY) {
m_RelY = RelY;
ComputeCurrentCharacteristics();
@@ -543,19 +494,16 @@
// Darstellungsart festlegen
// -----------------------------------------------------------------------------
-void BS_Animation::SetAlpha(int Alpha)
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+void BS_Animation::SetAlpha(int Alpha) {
+ BS_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;
}
unsigned int NewModulationColor = (m_ModulationColor & 0x00ffffff) | Alpha << 24;
- if (NewModulationColor != m_ModulationColor)
- {
+ if (NewModulationColor != m_ModulationColor) {
m_ModulationColor = NewModulationColor;
ForceRefresh();
}
@@ -563,19 +511,16 @@
// -----------------------------------------------------------------------------
-void BS_Animation::SetModulationColor(unsigned int ModulationColor)
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+void BS_Animation::SetModulationColor(unsigned int ModulationColor) {
+ BS_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;
}
unsigned int NewModulationColor = (ModulationColor & 0x00ffffff) | (m_ModulationColor & 0xff000000);
- if (NewModulationColor != m_ModulationColor)
- {
+ if (NewModulationColor != m_ModulationColor) {
m_ModulationColor = NewModulationColor;
ForceRefresh();
}
@@ -583,26 +528,22 @@
// -----------------------------------------------------------------------------
-void BS_Animation::SetScaleFactor(float ScaleFactor)
-{
+void BS_Animation::SetScaleFactor(float ScaleFactor) {
SetScaleFactorX(ScaleFactor);
SetScaleFactorY(ScaleFactor);
}
// -----------------------------------------------------------------------------
-void BS_Animation::SetScaleFactorX(float ScaleFactorX)
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+void BS_Animation::SetScaleFactorX(float ScaleFactorX) {
+ BS_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)
- {
+ if (ScaleFactorX != m_ScaleFactorX) {
m_ScaleFactorX = ScaleFactorX;
if (m_ScaleFactorX <= 0.0f) m_ScaleFactorX = 0.001f;
ForceRefresh();
@@ -612,18 +553,15 @@
// -----------------------------------------------------------------------------
-void BS_Animation::SetScaleFactorY(float ScaleFactorY)
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+void BS_Animation::SetScaleFactorY(float ScaleFactorY) {
+ BS_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)
- {
+ if (ScaleFactorY != m_ScaleFactorY) {
m_ScaleFactorY = ScaleFactorY;
if (m_ScaleFactorY <= 0.0f) m_ScaleFactorY = 0.001f;
ForceRefresh();
@@ -633,56 +571,50 @@
// -----------------------------------------------------------------------------
-const Common::String & BS_Animation::GetCurrentAction() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+const Common::String &BS_Animation::GetCurrentAction() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
return animationDescriptionPtr->GetFrame(m_CurrentFrame).Action;
}
// -----------------------------------------------------------------------------
-int BS_Animation::GetX() const
-{
+int BS_Animation::GetX() const {
return m_RelX;
}
// -----------------------------------------------------------------------------
-int BS_Animation::GetY() const
-{
+int BS_Animation::GetY() const {
return m_RelY;
}
// -----------------------------------------------------------------------------
-int BS_Animation::GetAbsoluteX() const
-{
+int BS_Animation::GetAbsoluteX() const {
return m_AbsoluteX + (m_RelX - m_X);
}
// -----------------------------------------------------------------------------
-int BS_Animation::GetAbsoluteY() const
-{
+int BS_Animation::GetAbsoluteY() const {
return m_AbsoluteY + (m_RelY - m_Y);
}
// -----------------------------------------------------------------------------
-int BS_Animation::ComputeXModifier() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+int BS_Animation::ComputeXModifier() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- const BS_AnimationResource::Frame & CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
+ const BS_AnimationResource::Frame &CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
- BS_Resource* pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
+ BS_Resource *pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
BS_ASSERT(pResource);
BS_ASSERT(pResource->GetType() == BS_Resource::TYPE_BITMAP);
- BS_BitmapResource* pBitmap = static_cast<BS_BitmapResource *>(pResource);
+ BS_BitmapResource *pBitmap = static_cast<BS_BitmapResource *>(pResource);
int Result = CurFrame.FlipV ? - static_cast<int>((pBitmap->GetWidth() - 1 - CurFrame.HotspotX) * m_ScaleFactorX) :
- - static_cast<int>(CurFrame.HotspotX * m_ScaleFactorX);
+ - static_cast<int>(CurFrame.HotspotX * m_ScaleFactorX);
pBitmap->Release();
@@ -691,19 +623,18 @@
// -----------------------------------------------------------------------------
-int BS_Animation::ComputeYModifier() const
-{
- BS_AnimationDescription * animationDescriptionPtr = GetAnimationDescription();
+int BS_Animation::ComputeYModifier() const {
+ BS_AnimationDescription *animationDescriptionPtr = GetAnimationDescription();
BS_ASSERT(animationDescriptionPtr);
- const BS_AnimationResource::Frame & CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
+ const BS_AnimationResource::Frame &CurFrame = animationDescriptionPtr->GetFrame(m_CurrentFrame);
- BS_Resource* pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
+ BS_Resource *pResource = BS_Kernel::GetInstance()->GetResourceManager()->RequestResource(CurFrame.FileName);
BS_ASSERT(pResource);
BS_ASSERT(pResource->GetType() == BS_Resource::TYPE_BITMAP);
- BS_BitmapResource* pBitmap = static_cast<BS_BitmapResource *>(pResource);
+ BS_BitmapResource *pBitmap = static_cast<BS_BitmapResource *>(pResource);
int Result = CurFrame.FlipH ? - static_cast<int>((pBitmap->GetHeight() - 1 - CurFrame.HotspotY) * m_ScaleFactorY) :
- - static_cast<int>(CurFrame.HotspotY * m_ScaleFactorY);
+ - static_cast<int>(CurFrame.HotspotY * m_ScaleFactorY);
pBitmap->Release();
@@ -712,8 +643,7 @@
// -----------------------------------------------------------------------------
-void BS_Animation::RegisterActionCallback(ANIMATION_CALLBACK Callback, unsigned int Data)
-{
+void BS_Animation::RegisterActionCallback(ANIMATION_CALLBACK Callback, unsigned int Data) {
ANIMATION_CALLBACK_DATA CD;
CD.Callback = Callback;
CD.Data = Data;
@@ -722,8 +652,7 @@
// -----------------------------------------------------------------------------
-void BS_Animation::RegisterLoopPointCallback(ANIMATION_CALLBACK Callback, unsigned int Data)
-{
+void BS_Animation::RegisterLoopPointCallback(ANIMATION_CALLBACK Callback, unsigned int Data) {
ANIMATION_CALLBACK_DATA CD;
CD.Callback = Callback;
CD.Data = Data;
@@ -732,8 +661,7 @@
// -----------------------------------------------------------------------------
-void BS_Animation::RegisterDeleteCallback(ANIMATION_CALLBACK Callback, unsigned int Data)
-{
+void BS_Animation::RegisterDeleteCallback(ANIMATION_CALLBACK Callback, unsigned int Data) {
ANIMATION_CALLBACK_DATA CD;
CD.Callback = Callback;
CD.Data = Data;
@@ -744,15 +672,13 @@
// Persistenz
// -----------------------------------------------------------------------------
-void BS_Animation::PersistCallbackVector(BS_OutputPersistenceBlock & Writer, const Common::Array<ANIMATION_CALLBACK_DATA> & Vector)
-{
+void BS_Animation::PersistCallbackVector(BS_OutputPersistenceBlock &Writer, const Common::Array<ANIMATION_CALLBACK_DATA> & Vector) {
// Anzahl an Callbacks persistieren.
Writer.Write(Vector.size());
-
+
// Alle Callbacks einzeln persistieren.
Common::Array<ANIMATION_CALLBACK_DATA>::const_iterator It = Vector.begin();
- while (It != Vector.end())
- {
+ while (It != Vector.end()) {
Writer.Write(BS_CallbackRegistry::GetInstance().ResolveCallbackPointer(It->Callback));
Writer.Write(It->Data);
@@ -762,8 +688,7 @@
// -----------------------------------------------------------------------------
-void BS_Animation::UnpersistCallbackVector(BS_InputPersistenceBlock & Reader, Common::Array<ANIMATION_CALLBACK_DATA> & Vector)
-{
+void BS_Animation::UnpersistCallbackVector(BS_InputPersistenceBlock &Reader, Common::Array<ANIMATION_CALLBACK_DATA> & Vector) {
// Callbackvector leeren.
Vector.resize(0);
@@ -772,14 +697,13 @@
Reader.Read(CallbackCount);
// Alle Callbacks einzeln wieder herstellen.
- for (unsigned int i = 0; i < CallbackCount; ++i)
- {
+ for (unsigned int i = 0; i < CallbackCount; ++i) {
ANIMATION_CALLBACK_DATA CallbackData;
Common::String CallbackFunctionName;
Reader.Read(CallbackFunctionName);
CallbackData.Callback = reinterpret_cast<ANIMATION_CALLBACK>(BS_CallbackRegistry::GetInstance().ResolveCallbackFunction(CallbackFunctionName));
-
+
Reader.Read(CallbackData.Data);
Vector.push_back(CallbackData);
@@ -788,8 +712,7 @@
// -----------------------------------------------------------------------------
-bool BS_Animation::Persist(BS_OutputPersistenceBlock & Writer)
-{
+bool BS_Animation::Persist(BS_OutputPersistenceBlock &Writer) {
bool Result = true;
Result &= BS_RenderObject::Persist(Writer);
@@ -806,20 +729,15 @@
Writer.Write(static_cast<unsigned int>(m_Direction));
// Je nach Animationstyp entweder das Template oder die Ressource speichern.
- if (m_AnimationResourcePtr)
- {
+ if (m_AnimationResourcePtr) {
unsigned int Marker = 0;
Writer.Write(Marker);
Writer.Write(m_AnimationResourcePtr->GetFileName());
- }
- else if (m_AnimationTemplateHandle)
- {
+ } else if (m_AnimationTemplateHandle) {
unsigned int Marker = 1;
Writer.Write(Marker);
Writer.Write(m_AnimationTemplateHandle);
- }
- else
- {
+ } else {
BS_ASSERT(false);
}
@@ -837,8 +755,7 @@
// -----------------------------------------------------------------------------
-bool BS_Animation::Unpersist(BS_InputPersistenceBlock & Reader)
-{
+bool BS_Animation::Unpersist(BS_InputPersistenceBlock &Reader) {
bool Result = true;
Result &= BS_RenderObject::Unpersist(Reader);
@@ -859,18 +776,13 @@
// Animationstyp einlesen.
unsigned int Marker;
Reader.Read(Marker);
- if (Marker == 0)
- {
+ if (Marker == 0) {
Common::String ResourceFilename;
Reader.Read(ResourceFilename);
InitializeAnimationResource(ResourceFilename);
- }
- else if (Marker == 1)
- {
+ } else if (Marker == 1) {
Reader.Read(m_AnimationTemplateHandle);
- }
- else
- {
+ } else {
BS_ASSERT(false);
}
@@ -888,8 +800,7 @@
// -----------------------------------------------------------------------------
-BS_AnimationDescription * BS_Animation::GetAnimationDescription() const
-{
+BS_AnimationDescription *BS_Animation::GetAnimationDescription() const {
if (m_AnimationResourcePtr) return m_AnimationResourcePtr;
else return BS_AnimationTemplateRegistry::GetInstance().ResolveHandle(m_AnimationTemplateHandle);
}
Modified: scummvm/trunk/engines/sword25/gfx/animation.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animation.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animation.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -53,23 +53,21 @@
class BS_AnimationDescription;
class BS_InputPersistenceBlock;
-class BS_Animation : public BS_TimedRenderObject
-{
-friend class BS_RenderObject;
+class BS_Animation : public BS_TimedRenderObject {
+ friend class BS_RenderObject;
private:
- BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const Common::String & FileName);
- BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const BS_AnimationTemplate & Template);
- BS_Animation(BS_InputPersistenceBlock & Reader, BS_RenderObjectPtr<BS_RenderObject> ParentPtr, unsigned int Handle);
+ BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const Common::String &FileName);
+ BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const BS_AnimationTemplate &Template);
+ BS_Animation(BS_InputPersistenceBlock &Reader, BS_RenderObjectPtr<BS_RenderObject> ParentPtr, unsigned int Handle);
public:
- enum ANIMATION_TYPES
- {
+ enum ANIMATION_TYPES {
AT_ONESHOT,
AT_LOOP,
AT_JOJO
};
-
+
virtual ~BS_Animation();
void Play();
@@ -80,44 +78,44 @@
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;
/**
- @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.
+ @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);
/**
- @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.
+ @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(unsigned int 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.
+ @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);
/**
- @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.
+ @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);
/**
- @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.
+ @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);
@@ -125,29 +123,37 @@
@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 m_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; }
-
- virtual bool Persist(BS_OutputPersistenceBlock & Writer);
- virtual bool Unpersist(BS_InputPersistenceBlock & Reader);
+ float GetScaleFactorY() const {
+ return m_ScaleFactorY;
+ }
+ virtual bool Persist(BS_OutputPersistenceBlock &Writer);
+ virtual bool Unpersist(BS_InputPersistenceBlock &Reader);
+
virtual void FrameNotification(int TimeElapsed);
-
- ANIMATION_TYPES GetAnimationType() const;
- int GetFPS() const;
- int GetFrameCount() const;
- bool IsScalingAllowed() const;
- bool IsAlphaAllowed() const;
- bool IsColorModulationAllowed() const;
- unsigned int GetCurrentFrame() const { return m_CurrentFrame; }
- const Common::String & GetCurrentAction() const ;
- bool IsRunning() const { return m_Running; }
+ ANIMATION_TYPES GetAnimationType() const;
+ int GetFPS() const;
+ int GetFrameCount() const;
+ bool IsScalingAllowed() const;
+ bool IsAlphaAllowed() const;
+ bool IsColorModulationAllowed() const;
+ unsigned int GetCurrentFrame() const {
+ return m_CurrentFrame;
+ }
+ const Common::String &GetCurrentAction() const ;
+ bool IsRunning() const {
+ return m_Running;
+ }
+
typedef bool (*ANIMATION_CALLBACK)(unsigned int);
void RegisterLoopPointCallback(ANIMATION_CALLBACK Callback, unsigned int Data = 0);
@@ -158,68 +164,66 @@
virtual bool DoRender();
private:
- enum DIRECTION
- {
+ enum DIRECTION {
FORWARD,
BACKWARD
};
- int m_RelX;
- int m_RelY;
- float m_ScaleFactorX;
- float m_ScaleFactorY;
- unsigned int m_ModulationColor;
- unsigned int m_CurrentFrame;
- int m_CurrentFrameTime;
- bool m_Running;
- bool m_Finished;
- DIRECTION m_Direction;
- BS_AnimationResource * m_AnimationResourcePtr;
- unsigned int m_AnimationTemplateHandle;
- bool m_FramesLocked;
+ int m_RelX;
+ int m_RelY;
+ float m_ScaleFactorX;
+ float m_ScaleFactorY;
+ unsigned int m_ModulationColor;
+ unsigned int m_CurrentFrame;
+ int m_CurrentFrameTime;
+ bool m_Running;
+ bool m_Finished;
+ DIRECTION m_Direction;
+ BS_AnimationResource *m_AnimationResourcePtr;
+ unsigned int m_AnimationTemplateHandle;
+ bool m_FramesLocked;
- struct ANIMATION_CALLBACK_DATA
- {
- ANIMATION_CALLBACK Callback;
- unsigned int Data;
+ struct ANIMATION_CALLBACK_DATA {
+ ANIMATION_CALLBACK Callback;
+ unsigned int Data;
};
Common::Array<ANIMATION_CALLBACK_DATA> m_LoopPointCallbacks;
Common::Array<ANIMATION_CALLBACK_DATA> m_ActionCallbacks;
Common::Array<ANIMATION_CALLBACK_DATA> m_DeleteCallbacks;
/**
- @brief Lockt alle Frames.
- @return Gibt false zur\xFCck, falls nicht alle Frames gelockt werden konnten.
+ @brief Lockt alle Frames.
+ @return Gibt false zur\xFCck, falls nicht alle Frames gelockt werden konnten.
*/
bool LockAllFrames();
/**
- @brief Unlockt alle Frames.
- @return Gibt false zur\xFCck, falls nicht alles Frames freigegeben werden konnten.
+ @brief Unlockt alle Frames.
+ @return Gibt false zur\xFCck, falls nicht alles Frames freigegeben werden konnten.
*/
bool UnlockAllFrames();
/**
- @brief Diese Methode aktualisiert die Parameter (Gr\xF6\xDFe, Position) der Animation anhand des aktuellen Frames.
+ @brief Diese Methode aktualisiert die Parameter (Gr\xF6\xDFe, Position) der Animation anhand des aktuellen Frames.
- Diese Methode muss bei jedem Framewechsel aufgerufen werden damit der RenderObject-Manager immer aktuelle Daten hat.
+ Diese Methode muss bei jedem Framewechsel aufgerufen werden damit der RenderObject-Manager immer aktuelle Daten hat.
*/
void ComputeCurrentCharacteristics();
/**
- @brief Berechnet den Abstand zwischen dem linken Rand und dem Hotspot auf X-Achse in der aktuellen Darstellung.
+ @brief Berechnet den Abstand zwischen dem linken Rand und dem Hotspot auf X-Achse in der aktuellen Darstellung.
*/
int ComputeXModifier() const;
/**
- @brief Berechnet den Abstand zwischen dem linken Rand und dem Hotspot auf X-Achse in der aktuellen Darstellung.
+ @brief Berechnet den Abstand zwischen dem linken Rand und dem Hotspot auf X-Achse in der aktuellen Darstellung.
*/
int ComputeYModifier() const;
void InitMembers();
- void PersistCallbackVector(BS_OutputPersistenceBlock & Writer, const Common::Array<ANIMATION_CALLBACK_DATA> & Vector);
- void UnpersistCallbackVector(BS_InputPersistenceBlock & Reader, Common::Array<ANIMATION_CALLBACK_DATA> & Vector);
- BS_AnimationDescription * GetAnimationDescription() const;
+ void PersistCallbackVector(BS_OutputPersistenceBlock &Writer, const Common::Array<ANIMATION_CALLBACK_DATA> & Vector);
+ void UnpersistCallbackVector(BS_InputPersistenceBlock &Reader, Common::Array<ANIMATION_CALLBACK_DATA> & Vector);
+ BS_AnimationDescription *GetAnimationDescription() const;
void InitializeAnimationResource(const Common::String &FileName);
};
Modified: scummvm/trunk/engines/sword25/gfx/animationdescription.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationdescription.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationdescription.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -46,8 +46,7 @@
// Persistenz
// -----------------------------------------------------------------------------
-bool BS_AnimationDescription::Persist(BS_OutputPersistenceBlock & Writer)
-{
+bool BS_AnimationDescription::Persist(BS_OutputPersistenceBlock &Writer) {
Writer.Write(static_cast<unsigned int>(m_AnimationType));
Writer.Write(m_FPS);
Writer.Write(m_MillisPerFrame);
@@ -60,8 +59,7 @@
// -----------------------------------------------------------------------------
-bool BS_AnimationDescription::Unpersist(BS_InputPersistenceBlock & Reader)
-{
+bool BS_AnimationDescription::Unpersist(BS_InputPersistenceBlock &Reader) {
unsigned int AnimationType;
Reader.Read(AnimationType);
m_AnimationType = static_cast<BS_Animation::ANIMATION_TYPES>(AnimationType);
Modified: scummvm/trunk/engines/sword25/gfx/animationdescription.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationdescription.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationdescription.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -49,8 +49,7 @@
// Klassendefinition
// -----------------------------------------------------------------------------
-class BS_AnimationDescription : public BS_Persistable
-{
+class BS_AnimationDescription : public BS_Persistable {
protected:
BS_AnimationDescription() :
m_AnimationType(BS_Animation::AT_LOOP),
@@ -62,46 +61,57 @@
{};
public:
- struct Frame
- {
+ struct Frame {
// Die Hotspot-Angabe bezieht sich auf das ungeflippte Bild!!
- int HotspotX;
- int HotspotY;
- bool FlipV;
- bool FlipH;
- Common::String FileName;
- Common::String Action;
+ int HotspotX;
+ int HotspotY;
+ bool FlipV;
+ bool FlipH;
+ Common::String FileName;
+ Common::String Action;
};
// -----------------------------------------------------------------------------
// Abstrakte Methoden
// -----------------------------------------------------------------------------
-
- virtual const Frame & GetFrame(unsigned int Index) const = 0;
- virtual unsigned int GetFrameCount() const = 0;
- virtual void Unlock() = 0;
+ virtual const Frame &GetFrame(unsigned int Index) const = 0;
+ virtual unsigned int GetFrameCount() const = 0;
+ virtual void Unlock() = 0;
+
// -----------------------------------------------------------------------------
// Getter Methoden
// -----------------------------------------------------------------------------
-
- BS_Animation::ANIMATION_TYPES GetAnimationType() const { return m_AnimationType; }
- int GetFPS() const { return m_FPS; }
- int GetMillisPerFrame() const { return m_MillisPerFrame; }
- bool IsScalingAllowed() const { return m_ScalingAllowed; }
- bool IsAlphaAllowed() const { return m_AlphaAllowed; }
- bool IsColorModulationAllowed() const { return m_ColorModulationAllowed; }
- virtual bool Persist(BS_OutputPersistenceBlock & Writer);
- virtual bool Unpersist(BS_InputPersistenceBlock & Reader);
+ BS_Animation::ANIMATION_TYPES GetAnimationType() const {
+ return m_AnimationType;
+ }
+ int GetFPS() const {
+ return m_FPS;
+ }
+ int GetMillisPerFrame() const {
+ return m_MillisPerFrame;
+ }
+ bool IsScalingAllowed() const {
+ return m_ScalingAllowed;
+ }
+ bool IsAlphaAllowed() const {
+ return m_AlphaAllowed;
+ }
+ bool IsColorModulationAllowed() const {
+ return m_ColorModulationAllowed;
+ }
+ virtual bool Persist(BS_OutputPersistenceBlock &Writer);
+ virtual bool Unpersist(BS_InputPersistenceBlock &Reader);
+
protected:
- BS_Animation::ANIMATION_TYPES m_AnimationType;
- int m_FPS;
- int m_MillisPerFrame;
- bool m_ScalingAllowed;
- bool m_AlphaAllowed;
- bool m_ColorModulationAllowed;
+ BS_Animation::ANIMATION_TYPES m_AnimationType;
+ int m_FPS;
+ int m_MillisPerFrame;
+ bool m_ScalingAllowed;
+ bool m_AlphaAllowed;
+ bool m_ColorModulationAllowed;
};
} // End of namespace Sword25
Modified: scummvm/trunk/engines/sword25/gfx/animationresource.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationresource.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationresource.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -54,34 +54,31 @@
// Constants
// -----------------------------------------------------------------------------
-namespace
-{
- const int DEFAULT_FPS = 10;
- const int MIN_FPS = 1;
- const int MAX_FPS = 200;
+namespace {
+const int DEFAULT_FPS = 10;
+const int MIN_FPS = 1;
+const int MAX_FPS = 200;
}
// -----------------------------------------------------------------------------
// Construction / Destruction
// -----------------------------------------------------------------------------
-BS_AnimationResource::BS_AnimationResource(const Common::String& FileName) :
+BS_AnimationResource::BS_AnimationResource(const Common::String &FileName) :
BS_Resource(FileName, BS_Resource::TYPE_ANIMATION),
- m_Valid(false)
-{
+ m_Valid(false) {
// Pointer auf den Package-Manager bekommen
- BS_PackageManager* PackagePtr = BS_Kernel::GetInstance()->GetPackage();
+ BS_PackageManager *PackagePtr = BS_Kernel::GetInstance()->GetPackage();
BS_ASSERT(PackagePtr);
// Animations-XML laden
TiXmlDocument Doc;
{
- // Die Daten werden zun\xE4chst \xFCber den Package-Manager gelesen und dann in einen um ein Byte gr\xF6\xDFeren Buffer kopiert und
+ // Die Daten werden zun\xE4chst \xFCber den Package-Manager gelesen und dann in einen um ein Byte gr\xF6\xDFeren Buffer kopiert und
// NULL-Terminiert, da TinyXML NULL-Terminierte Daten ben\xF6tigt.
unsigned int FileSize;
- char * LoadBuffer = (char *) PackagePtr->GetFile(GetFileName(), &FileSize);
- if (!LoadBuffer)
- {
+ char *LoadBuffer = (char *) PackagePtr->GetFile(GetFileName(), &FileSize);
+ if (!LoadBuffer) {
BS_LOG_ERRORLN("Could not read \"%s\".", GetFileName().c_str());
return;
}
@@ -94,27 +91,24 @@
// Datei parsen
Doc.Parse(&WorkBuffer[0]);
free(WorkBuffer);
- if (Doc.Error())
- {
+ if (Doc.Error()) {
BS_LOG_ERRORLN("The following TinyXML-Error occured while parsing \"%s\": %s", GetFileName().c_str(), Doc.ErrorDesc());
return;
}
}
// Wurzelknoten des Animations-Tags finden, pr\xFCfen und Attribute auslesen.
- TiXmlElement* pElement;
+ TiXmlElement *pElement;
{
- TiXmlNode* pNode = Doc.FirstChild("animation");
- if (!pNode || pNode->Type() != TiXmlNode::ELEMENT)
- {
+ TiXmlNode *pNode = Doc.FirstChild("animation");
+ if (!pNode || pNode->Type() != TiXmlNode::ELEMENT) {
BS_LOG_ERRORLN("No <animation> tag found in \"%s\".", GetFileName().c_str());
return;
}
pElement = pNode->ToElement();
// Animation-Tag parsen
- if (!ParseAnimationTag(*pElement, m_FPS, m_AnimationType))
- {
+ if (!ParseAnimationTag(*pElement, m_FPS, m_AnimationType)) {
BS_LOG_ERRORLN("An error occurred while parsing <animation> tag in \"%s\".", GetFileName().c_str());
return;
}
@@ -131,17 +125,15 @@
}
// Nacheinander alle Frames-Informationen erstellen.
- TiXmlElement* pFrameElement = pElement->FirstChild("frame")->ToElement();
- while (pFrameElement)
- {
+ TiXmlElement *pFrameElement = pElement->FirstChild("frame")->ToElement();
+ while (pFrameElement) {
Frame CurFrame;
-
- if (!ParseFrameTag(*pFrameElement, CurFrame, *PackagePtr))
- {
+
+ if (!ParseFrameTag(*pFrameElement, CurFrame, *PackagePtr)) {
BS_LOG_ERRORLN("An error occurred in \"%s\" while parsing <frame> tag.", GetFileName().c_str());
return;
}
-
+
m_Frames.push_back(CurFrame);
pFrameElement = pFrameElement->NextSiblingElement("frame");
}
@@ -150,54 +142,46 @@
PackagePtr->ChangeDirectory(OldDirectory);
// Sicherstellen, dass die Animation mindestens einen Frame besitzt
- if (m_Frames.empty())
- {
+ if (m_Frames.empty()) {
BS_LOG_ERRORLN("\"%s\" does not have any frames.", GetFileName().c_str());
return;
}
// Alle Frame-Dateien werden vorgecached
- if (!PrecacheAllFrames())
- {
+ if (!PrecacheAllFrames()) {
BS_LOG_ERRORLN("Could not precache all frames of \"%s\".", GetFileName().c_str());
return;
}
// Feststellen, ob die Animation skalierbar ist
- if (!ComputeFeatures())
- {
- BS_LOG_ERRORLN("Could not determine the features of \"%s\".", GetFileName().c_str());
- return;
- }
+ if (!ComputeFeatures()) {
+ BS_LOG_ERRORLN("Could not determine the features of \"%s\".", GetFileName().c_str());
+ return;
+ }
- m_Valid = true;
+ m_Valid = true;
}
// -----------------------------------------------------------------------------
// Dokument-Parsermethoden
// -----------------------------------------------------------------------------
-bool BS_AnimationResource::ParseAnimationTag(TiXmlElement& AnimationTag, int& FPS, BS_Animation::ANIMATION_TYPES & AnimationType)
-{
+bool BS_AnimationResource::ParseAnimationTag(TiXmlElement &AnimationTag, int &FPS, BS_Animation::ANIMATION_TYPES &AnimationType) {
// FPS einlesen
- const char* FPSString;
- if (FPSString = AnimationTag.Attribute("fps"))
- {
+ const char *FPSString;
+ if (FPSString = AnimationTag.Attribute("fps")) {
int TempFPS;
- if (!BS_String::ToInt(Common::String(FPSString), TempFPS) || TempFPS < MIN_FPS || TempFPS > MAX_FPS)
- {
+ if (!BS_String::ToInt(Common::String(FPSString), TempFPS) || TempFPS < MIN_FPS || TempFPS > MAX_FPS) {
BS_LOG_WARNINGLN("Illegal fps value (\"%s\") in <animation> tag in \"%s\". Assuming default (\"%d\"). "
- "The fps value has to be between %d and %d.",
- FPSString, GetFileName().c_str(), DEFAULT_FPS, MIN_FPS, MAX_FPS);
- }
- else
+ "The fps value has to be between %d and %d.",
+ FPSString, GetFileName().c_str(), DEFAULT_FPS, MIN_FPS, MAX_FPS);
+ } else
FPS = TempFPS;
}
// Loop-Typ einlesen
- const char* LoopTypeString;
- if (LoopTypeString = AnimationTag.Attribute("type"))
- {
+ const char *LoopTypeString;
+ if (LoopTypeString = AnimationTag.Attribute("type")) {
if (strcmp(LoopTypeString, "oneshot") == 0)
AnimationType = BS_Animation::AT_ONESHOT;
else if (strcmp(LoopTypeString, "loop") == 0)
@@ -206,7 +190,7 @@
AnimationType = BS_Animation::AT_JOJO;
else
BS_LOG_WARNINGLN("Illegal type value (\"%s\") in <animation> tag in \"%s\". Assuming default (\"loop\").",
- LoopTypeString, GetFileName().c_str());
+ LoopTypeString, GetFileName().c_str());
}
return true;
@@ -214,68 +198,59 @@
// -----------------------------------------------------------------------------
-bool BS_AnimationResource::ParseFrameTag(TiXmlElement& FrameTag, Frame& Frame_, BS_PackageManager& PackageManager)
-{
- const char* FileString = FrameTag.Attribute("file");
- if (!FileString)
- {
+bool BS_AnimationResource::ParseFrameTag(TiXmlElement &FrameTag, Frame &Frame_, BS_PackageManager &PackageManager) {
+ const char *FileString = FrameTag.Attribute("file");
+ if (!FileString) {
BS_LOG_ERRORLN("<frame> tag without file attribute occurred in \"%s\".", GetFileName().c_str());
return false;
}
Frame_.FileName = PackageManager.GetAbsolutePath(FileString);
- if (Frame_.FileName == "")
- {
+ if (Frame_.FileName == "") {
BS_LOG_ERRORLN("Could not create absolute path for file specified in <frame> tag in \"%s\": \"%s\".", GetFileName().c_str(), FileString);
return false;
}
- const char* ActionString = FrameTag.Attribute("action");
+ const char *ActionString = FrameTag.Attribute("action");
if (ActionString)
Frame_.Action = ActionString;
- const char* HotspotxString = FrameTag.Attribute("hotspotx");
- const char* HotspotyString = FrameTag.Attribute("hotspoty");
+ const char *HotspotxString = FrameTag.Attribute("hotspotx");
+ const char *HotspotyString = FrameTag.Attribute("hotspoty");
if ((!HotspotxString && HotspotyString) ||
- (HotspotxString && !HotspotyString))
+ (HotspotxString && !HotspotyString))
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());
+ HotspotxString ? "hotspotx" : "hotspoty",
+ !HotspotyString ? "hotspoty" : "hotspotx",
+ GetFileName().c_str());
Frame_.HotspotX = 0;
if (HotspotxString && !BS_String::ToInt(Common::String(HotspotxString), 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 && !BS_String::ToInt(Common::String(HotspotyString), 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);
- const char* FlipVString = FrameTag.Attribute("flipv");
- if (FlipVString)
- {
- if (!BS_String::ToBool(Common::String(FlipVString), Frame_.FlipV))
- {
+ const char *FlipVString = FrameTag.Attribute("flipv");
+ if (FlipVString) {
+ if (!BS_String::ToBool(Common::String(FlipVString), Frame_.FlipV)) {
BS_LOG_WARNINGLN("Illegal flipv value (\"%s\") in <frame> tag in \"%s\". Assuming default (\"false\").",
- FlipVString, GetFileName().c_str());
+ FlipVString, GetFileName().c_str());
Frame_.FlipV = false;
}
- }
- else
+ } else
Frame_.FlipV = false;
- const char* FlipHString = FrameTag.Attribute("fliph");
- if (FlipHString)
- {
- if (!BS_String::ToBool(FlipHString, Frame_.FlipH))
- {
+ const char *FlipHString = FrameTag.Attribute("fliph");
+ if (FlipHString) {
+ if (!BS_String::ToBool(FlipHString, Frame_.FlipH)) {
BS_LOG_WARNINGLN("Illegal fliph value (\"%s\") in <frame> tag in \"%s\". Assuming default (\"false\").",
- FlipHString, GetFileName().c_str());
+ FlipHString, GetFileName().c_str());
Frame_.FlipH = false;
}
- }
- else
+ } else
Frame_.FlipH = false;
return true;
@@ -283,19 +258,15 @@
// -----------------------------------------------------------------------------
-BS_AnimationResource::~BS_AnimationResource()
-{
+BS_AnimationResource::~BS_AnimationResource() {
}
// -----------------------------------------------------------------------------
-bool BS_AnimationResource::PrecacheAllFrames() const
-{
+bool BS_AnimationResource::PrecacheAllFrames() const {
Common::Array<Frame>::const_iterator Iter = m_Frames.begin();
- for (; Iter != m_Frames.end(); ++Iter)
- {
- if (!BS_Kernel::GetInstance()->GetResourceManager()->PrecacheResource((*Iter).FileName))
- {
+ for (; Iter != m_Frames.end(); ++Iter) {
+ if (!BS_Kernel::GetInstance()->GetResourceManager()->PrecacheResource((*Iter).FileName)) {
BS_LOG_ERRORLN("Could not precache \"%s\".", (*Iter).FileName.c_str());
return false;
}
@@ -306,8 +277,7 @@
// -----------------------------------------------------------------------------
-bool BS_AnimationResource::ComputeFeatures()
-{
+bool BS_AnimationResource::ComputeFeatures() {
BS_ASSERT(m_Frames.size());
// Alle Features werden als vorhanden angenommen
@@ -317,11 +287,9 @@
// 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)
- {
- BS_BitmapResource* pBitmap;
- if (!(pBitmap = static_cast<BS_BitmapResource*> (BS_Kernel::GetInstance()->GetResourceManager()->RequestResource((*Iter).FileName))))
- {
+ for (; Iter != m_Frames.end(); ++Iter) {
+ BS_BitmapResource *pBitmap;
+ if (!(pBitmap = static_cast<BS_BitmapResource *>(BS_Kernel::GetInstance()->GetResourceManager()->RequestResource((*Iter).FileName)))) {
BS_LOG_ERRORLN("Could not request \"%s\".", (*Iter).FileName.c_str());
return false;
}
Modified: scummvm/trunk/engines/sword25/gfx/animationresource.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationresource.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationresource.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -63,34 +63,54 @@
// Class Definition
// -----------------------------------------------------------------------------
-class BS_AnimationResource : public BS_Resource, public BS_AnimationDescription
-{
+class BS_AnimationResource : public BS_Resource, public BS_AnimationDescription {
public:
- BS_AnimationResource(const Common::String & FileName);
+ BS_AnimationResource(const Common::String &FileName);
virtual ~BS_AnimationResource();
- virtual const Frame & GetFrame(unsigned int Index) const { BS_ASSERT(Index < m_Frames.size()); return m_Frames[Index]; }
- virtual unsigned int GetFrameCount() const { return m_Frames.size(); }
- virtual void Unlock() { Release(); }
+ virtual const Frame &GetFrame(unsigned int Index) const {
+ BS_ASSERT(Index < m_Frames.size());
+ return m_Frames[Index];
+ }
+ virtual unsigned int GetFrameCount() const {
+ return m_Frames.size();
+ }
+ virtual void Unlock() {
+ Release();
+ }
- BS_Animation::ANIMATION_TYPES GetAnimationType() const { return m_AnimationType; }
- int GetFPS() const { return m_FPS; }
- int GetMillisPerFrame() const { return m_MillisPerFrame; }
- bool IsScalingAllowed() const { return m_ScalingAllowed; }
- bool IsAlphaAllowed() const { return m_AlphaAllowed; }
- bool IsColorModulationAllowed() const { return m_ColorModulationAllowed; }
- bool IsValid() const { return m_Valid; }
+ BS_Animation::ANIMATION_TYPES GetAnimationType() const {
+ return m_AnimationType;
+ }
+ int GetFPS() const {
+ return m_FPS;
+ }
+ int GetMillisPerFrame() const {
+ return m_MillisPerFrame;
+ }
+ bool IsScalingAllowed() const {
+ return m_ScalingAllowed;
+ }
+ bool IsAlphaAllowed() const {
+ return m_AlphaAllowed;
+ }
+ bool IsColorModulationAllowed() const {
+ return m_ColorModulationAllowed;
+ }
+ bool IsValid() const {
+ return m_Valid;
+ }
private:
- bool m_Valid;
+ bool m_Valid;
- Common::Array<Frame> m_Frames;
+ Common::Array<Frame> m_Frames;
//@{
/** @name Dokument-Parser Methoden */
- bool ParseAnimationTag(TiXmlElement& AnimationTag, int& FPS, BS_Animation::ANIMATION_TYPES & AnimationType);
- bool ParseFrameTag(TiXmlElement& FrameTag, Frame& Frame, BS_PackageManager& PackageManager);
+ bool ParseAnimationTag(TiXmlElement &AnimationTag, int &FPS, BS_Animation::ANIMATION_TYPES &AnimationType);
+ bool ParseFrameTag(TiXmlElement &FrameTag, Frame &Frame, BS_PackageManager &PackageManager);
//@}
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplate.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -53,16 +53,12 @@
// Konstruktion / Destruktion
// -----------------------------------------------------------------------------
-unsigned int BS_AnimationTemplate::Create(const Common::String & SourceAnimation)
-{
- BS_AnimationTemplate * AnimationTemplatePtr = new BS_AnimationTemplate(SourceAnimation);
+unsigned int BS_AnimationTemplate::Create(const Common::String &SourceAnimation) {
+ BS_AnimationTemplate *AnimationTemplatePtr = new BS_AnimationTemplate(SourceAnimation);
- if (AnimationTemplatePtr->IsValid())
- {
+ if (AnimationTemplatePtr->IsValid()) {
return BS_AnimationTemplateRegistry::GetInstance().ResolvePtr(AnimationTemplatePtr);
- }
- else
- {
+ } else {
delete AnimationTemplatePtr;
return 0;
}
@@ -70,16 +66,12 @@
// -----------------------------------------------------------------------------
-unsigned int BS_AnimationTemplate::Create(const BS_AnimationTemplate & Other)
-{
- BS_AnimationTemplate * AnimationTemplatePtr = new BS_AnimationTemplate(Other);
+unsigned int BS_AnimationTemplate::Create(const BS_AnimationTemplate &Other) {
+ BS_AnimationTemplate *AnimationTemplatePtr = new BS_AnimationTemplate(Other);
- if (AnimationTemplatePtr->IsValid())
- {
+ if (AnimationTemplatePtr->IsValid()) {
return BS_AnimationTemplateRegistry::GetInstance().ResolvePtr(AnimationTemplatePtr);
- }
- else
- {
+ } else {
delete AnimationTemplatePtr;
return 0;
}
@@ -87,16 +79,12 @@
// -----------------------------------------------------------------------------
-unsigned int BS_AnimationTemplate::Create(BS_InputPersistenceBlock & Reader, unsigned int Handle)
-{
- BS_AnimationTemplate * AnimationTemplatePtr = new BS_AnimationTemplate(Reader, Handle);
+unsigned int BS_AnimationTemplate::Create(BS_InputPersistenceBlock &Reader, unsigned int Handle) {
+ BS_AnimationTemplate *AnimationTemplatePtr = new BS_AnimationTemplate(Reader, Handle);
- if (AnimationTemplatePtr->IsValid())
- {
+ if (AnimationTemplatePtr->IsValid()) {
return BS_AnimationTemplateRegistry::GetInstance().ResolvePtr(AnimationTemplatePtr);
- }
- else
- {
+ } else {
delete AnimationTemplatePtr;
return 0;
}
@@ -104,8 +92,7 @@
// -----------------------------------------------------------------------------
-BS_AnimationTemplate::BS_AnimationTemplate(const Common::String & SourceAnimation)
-{
+BS_AnimationTemplate::BS_AnimationTemplate(const Common::String &SourceAnimation) {
// Objekt registrieren.
BS_AnimationTemplateRegistry::GetInstance().RegisterObject(this);
@@ -120,8 +107,7 @@
// -----------------------------------------------------------------------------
-BS_AnimationTemplate::BS_AnimationTemplate(const BS_AnimationTemplate & Other)
-{
+BS_AnimationTemplate::BS_AnimationTemplate(const BS_AnimationTemplate &Other) {
// Objekt registrieren.
BS_AnimationTemplateRegistry::GetInstance().RegisterObject(this);
@@ -147,23 +133,20 @@
// -----------------------------------------------------------------------------
-BS_AnimationTemplate::BS_AnimationTemplate(BS_InputPersistenceBlock & Reader, unsigned int Handle)
-{
+BS_AnimationTemplate::BS_AnimationTemplate(BS_InputPersistenceBlock &Reader, unsigned int Handle) {
// Objekt registrieren.
- BS_AnimationTemplateRegistry::GetInstance().RegisterObject(this, Handle);
+ BS_AnimationTemplateRegistry::GetInstance().RegisterObject(this, Handle);
// Objekt laden.
- m_Valid = Unpersist(Reader);
+ m_Valid = Unpersist(Reader);
}
// -----------------------------------------------------------------------------
-BS_AnimationResource * BS_AnimationTemplate::RequestSourceAnimation(const Common::String & SourceAnimation) const
-{
- BS_ResourceManager * RMPtr = BS_Kernel::GetInstance()->GetResourceManager();
- BS_Resource * ResourcePtr;
- if (NULL == (ResourcePtr = RMPtr->RequestResource(SourceAnimation)) || ResourcePtr->GetType() != BS_Resource::TYPE_ANIMATION)
- {
+BS_AnimationResource *BS_AnimationTemplate::RequestSourceAnimation(const Common::String &SourceAnimation) const {
+ BS_ResourceManager *RMPtr = BS_Kernel::GetInstance()->GetResourceManager();
+ BS_Resource *ResourcePtr;
+ if (NULL == (ResourcePtr = RMPtr->RequestResource(SourceAnimation)) || ResourcePtr->GetType() != BS_Resource::TYPE_ANIMATION) {
BS_LOG_ERRORLN("The resource \"%s\" could not be requested or is has an invalid type. The animation template can't be created.", SourceAnimation.c_str());
return 0;
}
@@ -172,11 +155,9 @@
// -----------------------------------------------------------------------------
-BS_AnimationTemplate::~BS_AnimationTemplate()
-{
+BS_AnimationTemplate::~BS_AnimationTemplate() {
// Animations-Resource freigeben
- if (m_SourceAnimationPtr)
- {
+ if (m_SourceAnimationPtr) {
m_SourceAnimationPtr->Release();
}
@@ -186,64 +167,52 @@
// -----------------------------------------------------------------------------
-void BS_AnimationTemplate::AddFrame(int Index)
-{
- if (ValidateSourceIndex(Index))
- {
+void BS_AnimationTemplate::AddFrame(int Index) {
+ if (ValidateSourceIndex(Index)) {
m_Frames.push_back(m_SourceAnimationPtr->GetFrame(Index));
}
}
// -----------------------------------------------------------------------------
-void BS_AnimationTemplate::SetFrame(int DestIndex, int SrcIndex)
-{
- if (ValidateDestIndex(DestIndex) && ValidateSourceIndex(SrcIndex))
- {
+void BS_AnimationTemplate::SetFrame(int DestIndex, int SrcIndex) {
+ if (ValidateDestIndex(DestIndex) && ValidateSourceIndex(SrcIndex)) {
m_Frames[DestIndex] = m_SourceAnimationPtr->GetFrame(SrcIndex);
}
}
// -----------------------------------------------------------------------------
-bool BS_AnimationTemplate::ValidateSourceIndex(unsigned int Index) const
-{
- if (Index > m_SourceAnimationPtr->GetFrameCount())
- {
+bool BS_AnimationTemplate::ValidateSourceIndex(unsigned int Index) const {
+ if (Index > m_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, m_SourceAnimationPtr->GetFileName().c_str());
return false;
- }
- else
+ } else
return true;
}
// -----------------------------------------------------------------------------
-bool BS_AnimationTemplate::ValidateDestIndex(unsigned int Index) const
-{
- if (Index > m_Frames.size())
- {
+bool BS_AnimationTemplate::ValidateDestIndex(unsigned int Index) const {
+ if (Index > m_Frames.size()) {
BS_LOG_WARNINGLN("Tried to change a nonexistent frame (\"%d\") in a template animation. Ignoring call.",
- Index);
+ Index);
return false;
- }
- else
+ } else
return true;
}
// -----------------------------------------------------------------------------
-void BS_AnimationTemplate::SetFPS(int FPS)
-{
+void BS_AnimationTemplate::SetFPS(int FPS) {
m_FPS = FPS;
m_MillisPerFrame = 1000000 / m_FPS;
}
// -----------------------------------------------------------------------------
-bool BS_AnimationTemplate::Persist(BS_OutputPersistenceBlock & Writer)
-{
+bool BS_AnimationTemplate::Persist(BS_OutputPersistenceBlock &Writer) {
bool Result = true;
// Parent persistieren.
@@ -254,8 +223,7 @@
// Frames einzeln persistieren.
Common::Array<const Frame>::const_iterator Iter = m_Frames.begin();
- while (Iter != m_Frames.end())
- {
+ while (Iter != m_Frames.end()) {
Writer.Write(Iter->HotspotX);
Writer.Write(Iter->HotspotY);
Writer.Write(Iter->FlipV);
@@ -274,8 +242,7 @@
// -----------------------------------------------------------------------------
-bool BS_AnimationTemplate::Unpersist(BS_InputPersistenceBlock & Reader)
-{
+bool BS_AnimationTemplate::Unpersist(BS_InputPersistenceBlock &Reader) {
bool Result = true;
// Parent wieder herstellen.
@@ -286,8 +253,7 @@
Reader.Read(FrameCount);
// Frames einzeln wieder herstellen.
- for (unsigned int i = 0; i < FrameCount; ++i)
- {
+ for (unsigned int i = 0; i < FrameCount; ++i) {
Frame frame;
Reader.Read(frame.HotspotX);
Reader.Read(frame.HotspotY);
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplate.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplate.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplate.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -59,65 +59,75 @@
// Klassendefinition
// -----------------------------------------------------------------------------
-class BS_AnimationTemplate : public BS_AnimationDescription
-{
+class BS_AnimationTemplate : public BS_AnimationDescription {
public:
- static unsigned int Create(const Common::String & SourceAnimation);
- static unsigned int Create(const BS_AnimationTemplate & Other);
- static unsigned int Create(BS_InputPersistenceBlock & Reader, unsigned int Handle);
- BS_AnimationTemplate * ResolveHandle(unsigned int Handle) const;
+ static unsigned int Create(const Common::String &SourceAnimation);
+ static unsigned int Create(const BS_AnimationTemplate &Other);
+ static unsigned int Create(BS_InputPersistenceBlock &Reader, unsigned int Handle);
+ BS_AnimationTemplate *ResolveHandle(unsigned int Handle) const;
private:
- BS_AnimationTemplate(const Common::String & SourceAnimation);
- BS_AnimationTemplate(const BS_AnimationTemplate & Other);
- BS_AnimationTemplate(BS_InputPersistenceBlock & Reader, unsigned int Handle);
+ BS_AnimationTemplate(const Common::String &SourceAnimation);
+ BS_AnimationTemplate(const BS_AnimationTemplate &Other);
+ BS_AnimationTemplate(BS_InputPersistenceBlock &Reader, unsigned int Handle);
public:
~BS_AnimationTemplate();
- virtual const Frame & GetFrame(unsigned int Index) const { BS_ASSERT(Index < m_Frames.size()); return m_Frames[Index]; }
- virtual unsigned int GetFrameCount() const { return m_Frames.size(); }
- virtual void Unlock() { delete this; }
+ virtual const Frame &GetFrame(unsigned int Index) const {
+ BS_ASSERT(Index < m_Frames.size());
+ return m_Frames[Index];
+ }
+ virtual unsigned int GetFrameCount() const {
+ return m_Frames.size();
+ }
+ virtual void Unlock() {
+ delete this;
+ }
- bool IsValid() const { return m_Valid; }
+ bool IsValid() const {
+ return m_Valid;
+ }
/**
- @brief F\xFCgt einen neuen Frame zur Animation hinzu.
+ @brief F\xFCgt einen neuen Frame zur Animation hinzu.
- Der Frame wird an das Ende der Animation angeh\xE4ngt.
+ Der Frame wird an das Ende der Animation angeh\xE4ngt.
- @param Index der Index des Frames in der Quellanimation
+ @param Index der Index des Frames in der Quellanimation
*/
void AddFrame(int Index);
/**
- @brief \xC4ndert einen bereits in der Animation vorhandenen Frame.
- @param DestIndex der Index des Frames der \xFCberschrieben werden soll
- @param SrcIndex der Index des einzuf\xFCgenden Frames in der Quellanimation
+ @brief \xC4ndert einen bereits in der Animation vorhandenen Frame.
+ @param DestIndex der Index des Frames der \xFCberschrieben werden soll
+ @param SrcIndex der Index des einzuf\xFCgenden Frames in der Quellanimation
*/
void SetFrame(int DestIndex, int SrcIndex);
/**
- @brief Setzt den Animationstyp.
- @param Type der Typ der Animation. Muss aus den enum BS_Animation::ANIMATION_TYPES sein.
+ @brief Setzt den Animationstyp.
+ @param Type der Typ der Animation. Muss aus den enum BS_Animation::ANIMATION_TYPES sein.
*/
- void SetAnimationType(BS_Animation::ANIMATION_TYPES Type) { m_AnimationType = Type; }
+ void SetAnimationType(BS_Animation::ANIMATION_TYPES Type) {
+ m_AnimationType = Type;
+ }
/**
- @brief Setzt die Abspielgeschwindigkeit.
- @param FPS die Abspielgeschwindigkeit in Frames pro Sekunde.
+ @brief Setzt die Abspielgeschwindigkeit.
+ @param FPS die Abspielgeschwindigkeit in Frames pro Sekunde.
*/
void SetFPS(int FPS);
- virtual bool Persist(BS_OutputPersistenceBlock & Writer);
- virtual bool Unpersist(BS_InputPersistenceBlock & Reader);
+ virtual bool Persist(BS_OutputPersistenceBlock &Writer);
+ virtual bool Unpersist(BS_InputPersistenceBlock &Reader);
private:
- Common::Array<const Frame> m_Frames;
- BS_AnimationResource * m_SourceAnimationPtr;
- bool m_Valid;
+ Common::Array<const Frame> m_Frames;
+ BS_AnimationResource *m_SourceAnimationPtr;
+ bool m_Valid;
- BS_AnimationResource * RequestSourceAnimation(const Common::String & SourceAnimation) const;
+ BS_AnimationResource *RequestSourceAnimation(const Common::String &SourceAnimation) const;
bool ValidateSourceIndex(unsigned int Index) const;
bool ValidateDestIndex(unsigned int Index) const;
};
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -57,22 +57,19 @@
// -----------------------------------------------------------------------------
-void BS_AnimationTemplateRegistry::LogErrorLn(const char * Message) const
-{
+void BS_AnimationTemplateRegistry::LogErrorLn(const char *Message) const {
BS_LOG_ERRORLN(Message);
}
// -----------------------------------------------------------------------------
-void BS_AnimationTemplateRegistry::LogWarningLn(const char * Message) const
-{
+void BS_AnimationTemplateRegistry::LogWarningLn(const char *Message) const {
BS_LOG_WARNINGLN(Message);
}
// -----------------------------------------------------------------------------
-bool BS_AnimationTemplateRegistry::Persist(BS_OutputPersistenceBlock & Writer)
-{
+bool BS_AnimationTemplateRegistry::Persist(BS_OutputPersistenceBlock &Writer) {
bool Result = true;
// Das n\xE4chste zu vergebene Handle schreiben.
@@ -83,8 +80,7 @@
// Alle BS_AnimationTemplates persistieren.
HANDLE2PTR_MAP::const_iterator Iter = m_Handle2PtrMap.begin();
- while (Iter != m_Handle2PtrMap.end())
- {
+ while (Iter != m_Handle2PtrMap.end()) {
// Handle persistieren.
Writer.Write(Iter->first);
@@ -99,8 +95,7 @@
// -----------------------------------------------------------------------------
-bool BS_AnimationTemplateRegistry::Unpersist(BS_InputPersistenceBlock & Reader)
-{
+bool BS_AnimationTemplateRegistry::Unpersist(BS_InputPersistenceBlock &Reader) {
bool Result = true;
// Das n\xE4chste zu vergebene Handle wieder herstellen.
@@ -114,8 +109,7 @@
Reader.Read(AnimationTemplateCount);
// Alle gespeicherten BS_AnimationTemplates wieder herstellen.
- for (unsigned int i = 0; i < AnimationTemplateCount; ++i)
- {
+ for (unsigned int i = 0; i < AnimationTemplateCount; ++i) {
// Handle lesen.
unsigned int Handle;
Reader.Read(Handle);
Modified: scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplateregistry.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -59,21 +59,19 @@
// Klassendeklaration
// -----------------------------------------------------------------------------
-class BS_AnimationTemplateRegistry : public BS_ObjectRegistry<BS_AnimationTemplate>, public BS_Persistable
-{
+class BS_AnimationTemplateRegistry : public BS_ObjectRegistry<BS_AnimationTemplate>, public BS_Persistable {
public:
- static BS_AnimationTemplateRegistry & GetInstance()
- {
+ static BS_AnimationTemplateRegistry &GetInstance() {
if (!m_InstancePtr.get()) m_InstancePtr.reset(new BS_AnimationTemplateRegistry);
return *m_InstancePtr.get();
}
- virtual bool Persist(BS_OutputPersistenceBlock & Writer);
- virtual bool Unpersist(BS_InputPersistenceBlock & Reader);
+ virtual bool Persist(BS_OutputPersistenceBlock &Writer);
+ virtual bool Unpersist(BS_InputPersistenceBlock &Reader);
private:
- virtual void LogErrorLn(const char * Message) const;
- virtual void LogWarningLn(const char * Message) const;
+ virtual void LogErrorLn(const char *Message) const;
+ virtual void LogWarningLn(const char *Message) const;
static std::auto_ptr<BS_AnimationTemplateRegistry> m_InstancePtr;
};
Modified: scummvm/trunk/engines/sword25/gfx/bitmap.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/bitmap.cpp 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/bitmap.cpp 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -58,41 +58,35 @@
m_ScaleFactorX(1.0f),
m_ScaleFactorY(1.0f),
m_FlipH(false),
- m_FlipV(false)
-{
+ m_FlipV(false) {
}
// -----------------------------------------------------------------------------
-BS_Bitmap::~BS_Bitmap()
-{
+BS_Bitmap::~BS_Bitmap() {
}
// -----------------------------------------------------------------------------
// Darstellungsart festlegen
// -----------------------------------------------------------------------------
-void BS_Bitmap::SetAlpha(int Alpha)
-{
- if (!IsAlphaAllowed())
- {
+void BS_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)
- {
+ 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;
}
unsigned int NewModulationColor = (m_ModulationColor & 0x00ffffff) | Alpha << 24;
- if (NewModulationColor != m_ModulationColor)
- {
+ if (NewModulationColor != m_ModulationColor) {
m_ModulationColor = NewModulationColor;
ForceRefresh();
}
@@ -100,17 +94,14 @@
// -----------------------------------------------------------------------------
-void BS_Bitmap::SetModulationColor(unsigned int ModulationColor)
-{
- if (!IsColorModulationAllowed())
- {
+void BS_Bitmap::SetModulationColor(unsigned int ModulationColor) {
+ if (!IsColorModulationAllowed()) {
BS_LOG_WARNINGLN("Tried to set modulation color of a bitmap that does not support color modulation. Call was ignored.");
return;
}
unsigned int NewModulationColor = (ModulationColor & 0x00ffffff) | (m_ModulationColor & 0xff000000);
- if (NewModulationColor != m_ModulationColor)
- {
+ if (NewModulationColor != m_ModulationColor) {
m_ModulationColor = NewModulationColor;
ForceRefresh();
}
@@ -118,30 +109,25 @@
// -----------------------------------------------------------------------------
-void BS_Bitmap::SetScaleFactor(float ScaleFactor)
-{
+void BS_Bitmap::SetScaleFactor(float ScaleFactor) {
SetScaleFactorX(ScaleFactor);
SetScaleFactorY(ScaleFactor);
}
// -----------------------------------------------------------------------------
-void BS_Bitmap::SetScaleFactorX(float ScaleFactorX)
-{
- if (!IsScalingAllowed())
- {
+void BS_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)
- {
+ 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;
@@ -151,22 +137,18 @@
// -----------------------------------------------------------------------------
-void BS_Bitmap::SetScaleFactorY(float ScaleFactorY)
-{
- if (!IsScalingAllowed())
- {
+void BS_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)
- {
+ if (ScaleFactorY != m_ScaleFactorY) {
m_ScaleFactorY = ScaleFactorY;
m_Height = static_cast<int>(m_OriginalHeight * ScaleFactorY);
if (m_ScaleFactorY <= 0.0f) m_ScaleFactorY = 0.001f;
@@ -176,16 +158,14 @@
// -----------------------------------------------------------------------------
-void BS_Bitmap::SetFlipH(bool FlipH)
-{
+void BS_Bitmap::SetFlipH(bool FlipH) {
m_FlipH = FlipH;
ForceRefresh();
}
// -----------------------------------------------------------------------------
-void BS_Bitmap::SetFlipV(bool FlipV)
-{
+void BS_Bitmap::SetFlipV(bool FlipV) {
m_FlipV = FlipV;
ForceRefresh();
}
@@ -194,8 +174,7 @@
// Persistenz
// -----------------------------------------------------------------------------
-bool BS_Bitmap::Persist(BS_OutputPersistenceBlock & Writer)
-{
+bool BS_Bitmap::Persist(BS_OutputPersistenceBlock &Writer) {
bool Result = true;
Result &= BS_RenderObject::Persist(Writer);
@@ -212,8 +191,7 @@
// -----------------------------------------------------------------------------
-bool BS_Bitmap::Unpersist(BS_InputPersistenceBlock & Reader)
-{
+bool BS_Bitmap::Unpersist(BS_InputPersistenceBlock &Reader) {
bool Result = true;
Result &= BS_RenderObject::Unpersist(Reader);
Modified: scummvm/trunk/engines/sword25/gfx/bitmap.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/bitmap.h 2010-10-12 22:31:38 UTC (rev 53221)
+++ scummvm/trunk/engines/sword25/gfx/bitmap.h 2010-10-12 22:35:55 UTC (rev 53222)
@@ -23,7 +23,7 @@
*
*/
-/*
+/*
* This code is based on Broken Sword 2.5 engine
*
* Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
@@ -48,8 +48,7 @@
// Klassendeklaration
// -----------------------------------------------------------------------------
-class BS_Bitmap : public BS_RenderObject
-{
+class BS_Bitmap : public BS_RenderObject {
protected:
BS_Bitmap(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, TYPES Type, unsigned int Handle = 0);
@@ -58,127 +57,139 @@
virtual ~BS_Bitmap();
/**
- @brief Setzt den Alphawert des Bitmaps.
- @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.
+ @brief Setzt den Alphawert des Bitmaps.
+ @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);
/**
- @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.
+ @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(unsigned int 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.
+ @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);
/**
- @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.
+ @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);
/**
- @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.
+ @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);
/**
- @brief Legt fest, ob das Bild an der X-Achse gespiegelt werden soll.
+ @brief Legt fest, ob das Bild an der X-Achse gespiegelt werden soll.
*/
void SetFlipH(bool FlipH);
/**
- @brief Legt fest, ob das Bild an der Y-Achse gespiegelt werden soll.
+ @brief Legt fest, ob das Bild an der Y-Achse gespiegelt werden soll.
*/
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.
+ @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 m_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.
+ @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 m_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.
+ @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 m_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.
+ @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 m_ScaleFactorY;
+ }
/**
- @brief Gibt zur\xFCck, ob das Bild an der X-Achse gespiegelt angezeigt wird.
+ @brief Gibt zur\xFCck, ob das Bild an der X-Achse gespiegelt angezeigt wird.
*/
- bool IsFlipH() { return m_FlipH; }
+ bool IsFlipH() {
+ return m_FlipH;
+ }
/**
- @brief Gibt zur\xFCck, ob das Bild an der Y-Achse gespiegelt angezeigt wird.
+ @brief Gibt zur\xFCck, ob das Bild an der Y-Achse gespiegelt angezeigt wird.
*/
- bool IsFlipV() { return m_FlipV; }
+ bool IsFlipV() {
+ return m_FlipV;
+ }
// -----------------------------------------------------------------------------
// Die folgenden Methoden m\xFCssen alle BS_Bitmap-Klassen implementieren
// -----------------------------------------------------------------------------
/**
- @brief Liest einen Pixel des Bildes.
- @param X die X-Koordinate des Pixels.
- @param Y die Y-Koordinate des Pixels
- @return Gibt den 32-Bit Farbwert des Pixels an der \xFCbergebenen Koordinate zur\xFCck.
- @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.
+ @brief Liest einen Pixel des Bildes.
+ @param X die X-Koordinate des Pixels.
+ @param Y die Y-Koordinate des Pixels
+ @return Gibt den 32-Bit Farbwert des Pixels an der \xFCbergebenen Koordinate zur\xFCck.
+ @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 unsigned int GetPixel(int X, int Y) const = 0;
/**
- @brief F\xFCllt den Inhalt des Bildes mit Pixeldaten.
- @param Pixeldata ein Vector der die Pixeldaten enth\xE4lt. Sie m\xFCssen in dem Farbformat des Bildes vorliegen und es m\xFCssen gen\xFCgend Daten
- vorhanden sein, um das ganze Bild zu f\xFCllen.
+ @brief F\xFCllt den Inhalt des Bildes mit Pixeldaten.
+ @param Pixeldata ein Vector der die Pixeldaten enth\xE4lt. Sie m\xFCssen in dem Farbformat des Bildes vorliegen und es m\xFCssen gen\xFCgend Daten
+ vorhanden sein, um das ganze Bild zu f\xFCllen.
@@ 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