From 03911e65050127fc53f7d779987147876e90fe36 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 26 Sep 2013 22:58:46 +0300 Subject: SWORD25: Fix copy-paste error. CID 1004130 --- engines/sword25/gfx/animationresource.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/animationresource.cpp b/engines/sword25/gfx/animationresource.cpp index 621e20ad8c..8c09a545a0 100644 --- a/engines/sword25/gfx/animationresource.cpp +++ b/engines/sword25/gfx/animationresource.cpp @@ -188,7 +188,7 @@ bool AnimationResource::parserCallback_frame(ParserNode *node) { Common::String flipHString = node->values["fliph"]; if (!flipHString.empty()) { - if (!parseBooleanKey(flipVString, frame.flipV)) { + if (!parseBooleanKey(flipHString, frame.flipH)) { warning("Illegal fliph value (\"%s\") in tag in \"%s\". Assuming default (\"false\").", flipHString.c_str(), getFileName().c_str()); frame.flipH = false; -- cgit v1.2.3 From 08c010b8dff22b1f03301fb90f8d1efb7a9e7a1f Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 22:58:10 +0300 Subject: SWORD25: Further fixes for Amiga compilation --- engines/sword25/gfx/animation.h | 12 ++++++------ engines/sword25/gfx/animationdescription.cpp | 2 +- engines/sword25/gfx/animationdescription.h | 8 ++++---- engines/sword25/gfx/animationtemplate.cpp | 4 ++-- engines/sword25/gfx/animationtemplateregistry.cpp | 2 +- engines/sword25/gfx/bitmap.h | 6 +++--- 6 files changed, 17 insertions(+), 17 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/animation.h b/engines/sword25/gfx/animation.h index 44255e3b64..ced1995ae9 100644 --- a/engines/sword25/gfx/animation.h +++ b/engines/sword25/gfx/animation.h @@ -159,18 +159,18 @@ private: BACKWARD }; - int _relX; - int _relY; + int32 _relX; + int32 _relY; float _scaleFactorX; float _scaleFactorY; - uint _modulationColor; - uint _currentFrame; - int _currentFrameTime; + uint32 _modulationColor; + uint32 _currentFrame; + int32 _currentFrameTime; bool _running; bool _finished; Direction _direction; AnimationResource *_animationResourcePtr; - uint _animationTemplateHandle; + uint32 _animationTemplateHandle; bool _framesLocked; ANIMATION_CALLBACK _loopPointCallback; diff --git a/engines/sword25/gfx/animationdescription.cpp b/engines/sword25/gfx/animationdescription.cpp index da0a660df9..0a23601f67 100644 --- a/engines/sword25/gfx/animationdescription.cpp +++ b/engines/sword25/gfx/animationdescription.cpp @@ -36,7 +36,7 @@ namespace Sword25 { bool AnimationDescription::persist(OutputPersistenceBlock &writer) { - writer.write(static_cast(_animationType)); + writer.write(static_cast(_animationType)); writer.write(_FPS); writer.write(_millisPerFrame); writer.write(_scalingAllowed); diff --git a/engines/sword25/gfx/animationdescription.h b/engines/sword25/gfx/animationdescription.h index 3b11686bb9..009d83dcc7 100644 --- a/engines/sword25/gfx/animationdescription.h +++ b/engines/sword25/gfx/animationdescription.h @@ -52,8 +52,8 @@ protected: public: struct Frame { // Die Hotspot-Angabe bezieht sich auf das ungeflippte Bild!! - int hotspotX; - int hotspotY; + int32 hotspotX; + int32 hotspotY; bool flipV; bool flipH; Common::String fileName; @@ -88,8 +88,8 @@ public: protected: Animation::ANIMATION_TYPES _animationType; - int _FPS; - int _millisPerFrame; + int32 _FPS; + int32 _millisPerFrame; bool _scalingAllowed; bool _alphaAllowed; bool _colorModulationAllowed; diff --git a/engines/sword25/gfx/animationtemplate.cpp b/engines/sword25/gfx/animationtemplate.cpp index 19924302b9..a1d2bf5d1a 100644 --- a/engines/sword25/gfx/animationtemplate.cpp +++ b/engines/sword25/gfx/animationtemplate.cpp @@ -181,7 +181,7 @@ bool AnimationTemplate::persist(OutputPersistenceBlock &writer) { Result &= AnimationDescription::persist(writer); // Frameanzahl schreiben. - writer.write(_frames.size()); + writer.write((uint32)_frames.size()); // Frames einzeln persistieren. Common::Array::const_iterator Iter = _frames.begin(); @@ -209,7 +209,7 @@ bool AnimationTemplate::unpersist(InputPersistenceBlock &reader) { result &= AnimationDescription::unpersist(reader); // Frameanzahl lesen. - uint frameCount; + uint32 frameCount; reader.read(frameCount); // Frames einzeln wieder herstellen. diff --git a/engines/sword25/gfx/animationtemplateregistry.cpp b/engines/sword25/gfx/animationtemplateregistry.cpp index 8184b49eba..7437e4b8d4 100644 --- a/engines/sword25/gfx/animationtemplateregistry.cpp +++ b/engines/sword25/gfx/animationtemplateregistry.cpp @@ -47,7 +47,7 @@ bool AnimationTemplateRegistry::persist(OutputPersistenceBlock &writer) { writer.write(_nextHandle); // Anzahl an BS_AnimationTemplates schreiben. - writer.write(_handle2PtrMap.size()); + writer.write((uint32)_handle2PtrMap.size()); // Alle BS_AnimationTemplates persistieren. HANDLE2PTR_MAP::const_iterator iter = _handle2PtrMap.begin(); diff --git a/engines/sword25/gfx/bitmap.h b/engines/sword25/gfx/bitmap.h index caa1238558..f22c5d7fc9 100644 --- a/engines/sword25/gfx/bitmap.h +++ b/engines/sword25/gfx/bitmap.h @@ -176,9 +176,9 @@ protected: bool _flipV; float _scaleFactorX; float _scaleFactorY; - uint _modulationColor; - int _originalWidth; - int _originalHeight; + uint32 _modulationColor; + int32 _originalWidth; + int32 _originalHeight; }; } // End of namespace Sword25 -- cgit v1.2.3 From 9a1ddf0deef80fd598fe64e96f1180e265cbc124 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:17:02 +0300 Subject: SWORD25: More int <-> int32 corrections --- engines/sword25/gfx/animation.cpp | 20 ++++++++++---------- engines/sword25/gfx/animationdescription.cpp | 2 +- engines/sword25/gfx/renderobject.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/animation.cpp b/engines/sword25/gfx/animation.cpp index 1660c393c0..37207c967b 100644 --- a/engines/sword25/gfx/animation.cpp +++ b/engines/sword25/gfx/animation.cpp @@ -553,15 +553,15 @@ bool Animation::persist(OutputPersistenceBlock &writer) { writer.write(_currentFrameTime); writer.write(_running); writer.write(_finished); - writer.write(static_cast(_direction)); + writer.write(static_cast(_direction)); // Je nach Animationstyp entweder das Template oder die Ressource speichern. if (_animationResourcePtr) { - uint marker = 0; + uint32 marker = 0; writer.write(marker); writer.writeString(_animationResourcePtr->getFileName()); } else if (_animationTemplateHandle) { - uint marker = 1; + uint32 marker = 1; writer.write(marker); writer.write(_animationTemplateHandle); } else { @@ -574,13 +574,13 @@ bool Animation::persist(OutputPersistenceBlock &writer) { // The following is only there to for compatibility with older saves // resp. the original engine. - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaLoopPointCB"); writer.write(getHandle()); - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaActionCB"); writer.write(getHandle()); - writer.write((uint)1); + writer.write((uint32)1); writer.writeString("LuaDeleteCB"); writer.write(getHandle()); @@ -605,12 +605,12 @@ bool Animation::unpersist(InputPersistenceBlock &reader) { reader.read(_currentFrameTime); reader.read(_running); reader.read(_finished); - uint direction; + uint32 direction; reader.read(direction); _direction = static_cast(direction); // Animationstyp einlesen. - uint marker; + uint32 marker; reader.read(marker); if (marker == 0) { Common::String resourceFilename; @@ -629,9 +629,9 @@ bool Animation::unpersist(InputPersistenceBlock &reader) { // The following is only there to for compatibility with older saves // resp. the original engine. - uint callbackCount; + uint32 callbackCount; Common::String callbackFunctionName; - uint callbackData; + uint32 callbackData; // loop point callback reader.read(callbackCount); diff --git a/engines/sword25/gfx/animationdescription.cpp b/engines/sword25/gfx/animationdescription.cpp index 0a23601f67..164206bbc2 100644 --- a/engines/sword25/gfx/animationdescription.cpp +++ b/engines/sword25/gfx/animationdescription.cpp @@ -47,7 +47,7 @@ bool AnimationDescription::persist(OutputPersistenceBlock &writer) { } bool AnimationDescription::unpersist(InputPersistenceBlock &reader) { - uint animationType; + uint32 animationType; reader.read(animationType); _animationType = static_cast(animationType); reader.read(_FPS); diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index 1116c3284c..d7857caddf 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -359,7 +359,7 @@ public: /** @brief Gibt das Handle des Objekte zurück. */ - uint getHandle() const { + uint32 getHandle() const { return _handle; } @@ -475,7 +475,7 @@ private: /// Ist true, wenn das Objekt in nächsten Frame neu gezeichnet werden soll bool _refreshForced; - uint _handle; + uint32 _handle; /** @brief Entfernt ein Objekt aus der Kinderliste. -- cgit v1.2.3 From 86550cdc3c19d7a75f634073b942440d72520dcd Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:28:19 +0300 Subject: SWORD25: Further fixes for Amiga --- engines/sword25/gfx/animationtemplateregistry.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/animationtemplateregistry.cpp b/engines/sword25/gfx/animationtemplateregistry.cpp index 7437e4b8d4..4cefe24b18 100644 --- a/engines/sword25/gfx/animationtemplateregistry.cpp +++ b/engines/sword25/gfx/animationtemplateregistry.cpp @@ -77,13 +77,13 @@ bool AnimationTemplateRegistry::unpersist(InputPersistenceBlock &reader) { delete _handle2PtrMap.begin()->_value; // Anzahl an BS_AnimationTemplates einlesen. - uint animationTemplateCount; + uint32 animationTemplateCount; reader.read(animationTemplateCount); // Alle gespeicherten BS_AnimationTemplates wieder herstellen. for (uint i = 0; i < animationTemplateCount; ++i) { // Handle lesen. - uint handle; + uint32 handle; reader.read(handle); // BS_AnimationTemplate wieder herstellen. -- cgit v1.2.3 From 5cb881be12fdffc5f4073fd874723b306c27a347 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:44:48 +0300 Subject: SWORD25: More int->int32 fixes --- engines/sword25/gfx/panel.h | 2 +- engines/sword25/gfx/renderobject.cpp | 2 +- engines/sword25/gfx/renderobject.h | 24 ++++++++++++------------ 3 files changed, 14 insertions(+), 14 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/panel.h b/engines/sword25/gfx/panel.h index 74a93247b6..d372b4e0fc 100644 --- a/engines/sword25/gfx/panel.h +++ b/engines/sword25/gfx/panel.h @@ -64,7 +64,7 @@ protected: virtual bool doRender(RectangleList *updateRects); private: - uint _color; + uint32 _color; }; } // End of namespace Sword25 diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index 1dd6f4590f..dcbfe6462b 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -399,7 +399,7 @@ RenderObjectPtr RenderObject::addText(const Common::String &font, const Co bool RenderObject::persist(OutputPersistenceBlock &writer) { // Typ und Handle werden als erstes gespeichert, damit beim Laden ein Objekt vom richtigen Typ mit dem richtigen Handle erzeugt werden kann. - writer.write(static_cast(_type)); + writer.write(static_cast(_type)); writer.write(_handle); // Restliche Objekteigenschaften speichern. diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index d7857caddf..92541e83a2 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -388,14 +388,14 @@ protected: typedef Common::List > RENDEROBJECT_LIST; typedef Common::List >::iterator RENDEROBJECT_ITER; - int _x; ///< Die X-Position des Objektes relativ zum Eltern-Objekt - int _y; ///< Die Y-Position des Objektes relativ zum Eltern-Objekt - int _z; ///< Der Z-Wert des Objektes relativ zum Eltern-Objekt - int _absoluteX; ///< Die absolute X-Position des Objektes - int _absoluteY; ///< Die absolute Y-Position des Objektes - int _absoluteZ; - int _width; ///< Die Breite des Objektes - int _height; ///< Die Höhe des Objektes + int32 _x; ///< Die X-Position des Objektes relativ zum Eltern-Objekt + int32 _y; ///< Die Y-Position des Objektes relativ zum Eltern-Objekt + int32 _z; ///< Der Z-Wert des Objektes relativ zum Eltern-Objekt + int32 _absoluteX; ///< Die absolute X-Position des Objektes + int32 _absoluteY; ///< Die absolute Y-Position des Objektes + int32 _absoluteZ; + int32 _width; ///< Die Breite des Objektes + int32 _height; ///< Die Höhe des Objektes bool _visible; ///< Ist true, wenn das Objekt sichtbar ist bool _childChanged; ///< Ist true, wenn sich ein Kinderobjekt verändert hat TYPES _type; ///< Der Objekttyp @@ -404,14 +404,14 @@ protected: // Kopien der Variablen, die für die Errechnung des Dirty-Rects und zur Bestimmung der Objektveränderung notwendig sind Common::Rect _oldBbox; - int _oldX; - int _oldY; - int _oldZ; + int32 _oldX; + int32 _oldY; + int32 _oldZ; bool _oldVisible; static int _nextGlobalVersion; - int _version; + int32 _version; // This should be set to true if the RenderObject is NOT alpha-blended to optimize drawing bool _isSolid; -- cgit v1.2.3 From 9220d331e2761a7f5a69a6a68617fce4b7fece18 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Sat, 28 Sep 2013 23:57:39 +0300 Subject: SWORD25: Make Amiga compiler happier --- engines/sword25/gfx/panel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/panel.cpp b/engines/sword25/gfx/panel.cpp index b9bb8b087d..9b7fe82914 100644 --- a/engines/sword25/gfx/panel.cpp +++ b/engines/sword25/gfx/panel.cpp @@ -104,7 +104,7 @@ bool Panel::unpersist(InputPersistenceBlock &reader) { result &= RenderObject::unpersist(reader); - uint color; + uint32 color; reader.read(color); setColor(color); -- cgit v1.2.3 From 03965ba855c510eecb0dfd653aef0cc9b67541dc Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 29 Sep 2013 00:45:43 +0100 Subject: SWORD25: Even more fixes for Amiga OS 4 compilation. --- engines/sword25/gfx/text.cpp | 6 +++--- engines/sword25/gfx/text.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index d4aaa90682..65add60e97 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -98,8 +98,8 @@ void Text::setText(const Common::String &text) { } } -void Text::setColor(uint modulationColor) { - uint newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000); +void Text::setColor(uint32 modulationColor) { + uint32 newModulationColor = (modulationColor & 0x00ffffff) | (_modulationColor & 0xff000000); if (newModulationColor != _modulationColor) { _modulationColor = newModulationColor; forceRefresh(); @@ -108,7 +108,7 @@ void Text::setColor(uint modulationColor) { void Text::setAlpha(int alpha) { assert(alpha >= 0 && alpha < 256); - uint newModulationColor = (_modulationColor & 0x00ffffff) | alpha << 24; + uint32 newModulationColor = (_modulationColor & 0x00ffffff) | alpha << 24; if (newModulationColor != _modulationColor) { _modulationColor = newModulationColor; forceRefresh(); diff --git a/engines/sword25/gfx/text.h b/engines/sword25/gfx/text.h index 94e7a30865..e82c24d93c 100644 --- a/engines/sword25/gfx/text.h +++ b/engines/sword25/gfx/text.h @@ -100,7 +100,7 @@ public: @brief Setzt die Farbe des Textes. @param Color eine 24-Bit RGB Farbe, die die Farbe des Textes festlegt. */ - void setColor(uint modulationColor); + void setColor(uint32 modulationColor); /** @brief Gibt den Alphawert des Textes zurück. @@ -142,7 +142,7 @@ private: Text(RenderObjectPtr parentPtr); Text(InputPersistenceBlock &reader, RenderObjectPtr parentPtr, uint handle); - uint _modulationColor; + uint32 _modulationColor; Common::String _font; Common::String _text; bool _autoWrap; -- cgit v1.2.3 From 7e62442376be966369008bfb8c4f1b66786177e7 Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 29 Sep 2013 02:33:02 +0100 Subject: SWORD25: And even more fixes for Amiga OS 4 compilation. --- engines/sword25/gfx/renderobject.cpp | 28 ++++++++++++++-------------- engines/sword25/gfx/renderobject.h | 8 ++++---- engines/sword25/gfx/renderobjectmanager.cpp | 8 ++++---- engines/sword25/gfx/text.cpp | 6 +++--- engines/sword25/gfx/text.h | 6 +++--- 5 files changed, 28 insertions(+), 28 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index dcbfe6462b..af12f61413 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -219,27 +219,27 @@ Common::Rect RenderObject::calcBoundingBox() const { return bbox; } -void RenderObject::calcAbsolutePos(int &x, int &y, int &z) const { +void RenderObject::calcAbsolutePos(int32 &x, int32 &y, int32 &z) const { x = calcAbsoluteX(); y = calcAbsoluteY(); z = calcAbsoluteZ(); } -int RenderObject::calcAbsoluteX() const { +int32 RenderObject::calcAbsoluteX() const { if (_parentPtr.isValid()) return _parentPtr->getAbsoluteX() + _x; else return _x; } -int RenderObject::calcAbsoluteY() const { +int32 RenderObject::calcAbsoluteY() const { if (_parentPtr.isValid()) return _parentPtr->getAbsoluteY() + _y; else return _y; } -int RenderObject::calcAbsoluteZ() const { +int32 RenderObject::calcAbsoluteZ() const { if (_parentPtr.isValid()) return _parentPtr->getAbsoluteZ() + _z; else @@ -417,10 +417,10 @@ bool RenderObject::persist(OutputPersistenceBlock &writer) { writer.write(_bbox.top); writer.write(_bbox.right); writer.write(_bbox.bottom); - writer.write(_oldBbox.left); - writer.write(_oldBbox.top); - writer.write(_oldBbox.right); - writer.write(_oldBbox.bottom); + writer.write((int32)_oldBbox.left); + writer.write((int32)_oldBbox.top); + writer.write((int32)_oldBbox.right); + writer.write((int32)_oldBbox.bottom); writer.write(_oldX); writer.write(_oldY); writer.write(_oldZ); @@ -455,7 +455,7 @@ bool RenderObject::unpersist(InputPersistenceBlock &reader) { reader.read(_oldY); reader.read(_oldZ); reader.read(_oldVisible); - uint parentHandle; + uint32 parentHandle; reader.read(parentHandle); _parentPtr = RenderObjectPtr(parentHandle); reader.read(_refreshForced); @@ -470,7 +470,7 @@ bool RenderObject::persistChildren(OutputPersistenceBlock &writer) { bool result = true; // Kinderanzahl speichern. - writer.write(_children.size()); + writer.write((uint32)_children.size()); // Rekursiv alle Kinder speichern. RENDEROBJECT_LIST::iterator it = _children.begin(); @@ -486,13 +486,13 @@ bool RenderObject::unpersistChildren(InputPersistenceBlock &reader) { bool result = true; // Kinderanzahl einlesen. - uint childrenCount; + uint32 childrenCount; reader.read(childrenCount); if (!reader.isGood()) return false; // Alle Kinder rekursiv wieder herstellen. - for (uint i = 0; i < childrenCount; ++i) { + for (uint32 i = 0; i < childrenCount; ++i) { if (!recreatePersistedRenderObject(reader).isValid()) return false; } @@ -504,8 +504,8 @@ RenderObjectPtr RenderObject::recreatePersistedRenderObject(InputP RenderObjectPtr result; // Typ und Handle auslesen. - uint type; - uint handle; + uint32 type; + uint32 handle; reader.read(type); reader.read(handle); if (!reader.isGood()) diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h index 92541e83a2..7fcd3a87a3 100644 --- a/engines/sword25/gfx/renderobject.h +++ b/engines/sword25/gfx/renderobject.h @@ -500,17 +500,17 @@ private: /** @brief Berechnet die absolute Position des Objektes. */ - void calcAbsolutePos(int &x, int &y, int &z) const; + void calcAbsolutePos(int32 &x, int32 &y, int32 &z) const; /** @brief Berechnet die absolute Position des Objektes auf der X-Achse. */ - int calcAbsoluteX() const; + int32 calcAbsoluteX() const; /** @brief Berechnet die absolute Position des Objektes. */ - int calcAbsoluteY() const; + int32 calcAbsoluteY() const; - int calcAbsoluteZ() const; + int32 calcAbsoluteZ() const; /** @brief Sortiert alle Kinderobjekte nach ihrem Renderang. diff --git a/engines/sword25/gfx/renderobjectmanager.cpp b/engines/sword25/gfx/renderobjectmanager.cpp index 77f944c9e0..57c8ec318f 100644 --- a/engines/sword25/gfx/renderobjectmanager.cpp +++ b/engines/sword25/gfx/renderobjectmanager.cpp @@ -171,7 +171,7 @@ bool RenderObjectManager::persist(OutputPersistenceBlock &writer) { writer.write(_frameStarted); // Referenzen auf die TimedRenderObjects persistieren. - writer.write(_timedRenderObjects.size()); + writer.write((uint32)_timedRenderObjects.size()); RenderObjectList::const_iterator iter = _timedRenderObjects.begin(); while (iter != _timedRenderObjects.end()) { writer.write((*iter)->getHandle()); @@ -200,10 +200,10 @@ bool RenderObjectManager::unpersist(InputPersistenceBlock &reader) { _timedRenderObjects.resize(0); // Referenzen auf die TimedRenderObjects wieder herstellen. - uint timedObjectCount; + uint32 timedObjectCount; reader.read(timedObjectCount); - for (uint i = 0; i < timedObjectCount; ++i) { - uint handle; + for (uint32 i = 0; i < timedObjectCount; ++i) { + uint32 handle; reader.read(handle); _timedRenderObjects.push_back(handle); } diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp index 65add60e97..8c33fa8d61 100644 --- a/engines/sword25/gfx/text.cpp +++ b/engines/sword25/gfx/text.cpp @@ -45,7 +45,7 @@ namespace Sword25 { namespace { -const uint AUTO_WRAP_THRESHOLD_DEFAULT = 300; +const uint32 AUTO_WRAP_THRESHOLD_DEFAULT = 300; } Text::Text(RenderObjectPtr parentPtr) : @@ -123,7 +123,7 @@ void Text::setAutoWrap(bool autoWrap) { } } -void Text::setAutoWrapThreshold(uint autoWrapThreshold) { +void Text::setAutoWrapThreshold(uint32 autoWrapThreshold) { if (autoWrapThreshold != _autoWrapThreshold) { _autoWrapThreshold = autoWrapThreshold; updateFormat(); @@ -351,7 +351,7 @@ bool Text::unpersist(InputPersistenceBlock &reader) { reader.read(autoWrap); setAutoWrap(autoWrap); - uint autoWrapThreshold; + uint32 autoWrapThreshold; reader.read(autoWrapThreshold); setAutoWrapThreshold(autoWrapThreshold); diff --git a/engines/sword25/gfx/text.h b/engines/sword25/gfx/text.h index e82c24d93c..873eb33380 100644 --- a/engines/sword25/gfx/text.h +++ b/engines/sword25/gfx/text.h @@ -80,7 +80,7 @@ public: @remark Dieses Attribut wird mit dem Wert 300 initialisiert. @remark Eine automatische Formatierung wird nur vorgenommen, wenn diese durch einen Aufruf von SetAutoWrap() aktiviert wurde. */ - void setAutoWrapThreshold(uint autoWrapThreshold); + void setAutoWrapThreshold(uint32 autoWrapThreshold); /** @brief Gibt den dargestellten Text zurück. @@ -128,7 +128,7 @@ public: /** @brief Gibt die Längengrenze des Textes in Pixeln zurück, ab der eine automatische Formatierung vorgenommen wird. */ - uint getAutoWrapThreshold() const { + uint32 getAutoWrapThreshold() const { return _autoWrapThreshold; } @@ -146,7 +146,7 @@ private: Common::String _font; Common::String _text; bool _autoWrap; - uint _autoWrapThreshold; + uint32 _autoWrapThreshold; struct Line { Common::Rect bbox; -- cgit v1.2.3 From befa99ca7761370e9f11c425b459d410d371723f Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sun, 29 Sep 2013 03:21:55 +0100 Subject: SWORD25: Some more fixes for Amiga OS 4 compilation. --- engines/sword25/gfx/renderobject.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/renderobject.cpp b/engines/sword25/gfx/renderobject.cpp index af12f61413..e9e11aae4e 100644 --- a/engines/sword25/gfx/renderobject.cpp +++ b/engines/sword25/gfx/renderobject.cpp @@ -413,10 +413,10 @@ bool RenderObject::persist(OutputPersistenceBlock &writer) { writer.write(_visible); writer.write(_childChanged); writer.write(_initSuccess); - writer.write(_bbox.left); - writer.write(_bbox.top); - writer.write(_bbox.right); - writer.write(_bbox.bottom); + writer.write((int32)_bbox.left); + writer.write((int32)_bbox.top); + writer.write((int32)_bbox.right); + writer.write((int32)_bbox.bottom); writer.write((int32)_oldBbox.left); writer.write((int32)_oldBbox.top); writer.write((int32)_oldBbox.right); -- cgit v1.2.3 From 4591bd6eb6bd5b4dccaab67bbfb8875f7fffd2d4 Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Sun, 29 Sep 2013 20:18:54 +0200 Subject: SWORD25: Fix alpha/colormod blitting This is a backport to sword25 of the wintermute commits e9cbda135bbc822009ff311cad6e420fb23cff82 and 2141ad285e0200f4773726a13504f960e382f13e Thanks to eriktorbjorn for noticing and testing. --- engines/sword25/gfx/image/renderedimage.cpp | 50 ++++++++++++----------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'engines/sword25/gfx') diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index 346b46f3b4..b359fc6a3e 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -240,14 +240,6 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe int cg = (color >> 8) & 0xff; int cb = (color >> 0) & 0xff; - // Compensate for transparency. Since we're coming - // down to 255 alpha, we just compensate for the colors here - if (ca != 255) { - cr = cr * ca >> 8; - cg = cg * ca >> 8; - cb = cb * ca >> 8; - } - // Create an encapsulating surface for the data Graphics::Surface srcImage; // TODO: Is the data really in the screen format? @@ -400,52 +392,52 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe } else { #if defined(SCUMM_LITTLE_ENDIAN) pix = *(uint32 *)out; - int outb = (pix >> 0) & 0xff; - int outg = (pix >> 8) & 0xff; - int outr = (pix >> 16) & 0xff; + int outb = ((pix >> 0) & 0xff) * (255 - a); + int outg = ((pix >> 8) & 0xff) * (255 - a); + int outr = ((pix >> 16) & 0xff) * (255 - a); if (cb == 0) - outb = 0; + outb = outb >> 8; else if (cb != 255) - outb += ((b - outb) * a * cb) >> 16; + outb = ((outb << 8) + b * a * cb) >> 16; else - outb += ((b - outb) * a) >> 8; + outb = (outb + b * a) >> 8; if (cg == 0) - outg = 0; + outg = outg >> 8; else if (cg != 255) - outg += ((g - outg) * a * cg) >> 16; + outg = ((outg << 8) + g * a * cg) >> 16; else - outg += ((g - outg) * a) >> 8; + outg = (outg + g * a) >> 8; if (cr == 0) - outr = 0; + outr = outr >> 8; else if (cr != 255) - outr += ((r - outr) * a * cr) >> 16; + outr = ((outr << 8) + r * a * cr) >> 16; else - outr += ((r - outr) * a) >> 8; + outr = (outr + r * a) >> 8; *(uint32 *)out = (255 << 24) | (outr << 16) | (outg << 8) | outb; out += 4; #else *out = 255; out++; if (cr == 0) - *out = 0; + *out = (*out * (255-a)) >> 8; else if (cr != 255) - *out += ((r - *out) * a * cr) >> 16; + *out = (((*out * (255-a)) << 8) + r * a * cr) >> 16; else - *out += ((r - *out) * a) >> 8; + *out = ((*out * (255-a)) + r * a) >> 8; out++; if (cg == 0) - *out = 0; + *out = (*out * (255-a)) >> 8; else if (cg != 255) - *out += ((g - *out) * a * cg) >> 16; + *out = (((*out * (255-a)) << 8) + g * a * cg) >> 16; else - *out += ((g - *out) * a) >> 8; + *out = ((*out * (255-a)) + g * a) >> 8; out++; if (cb == 0) - *out = 0; + *out = (*out * (255-a)) >> 8; else if (cb != 255) - *out += ((b - *out) * a * cb) >> 16; + *out = (((*out * (255-a)) << 8) + b * a * cb) >> 16; else - *out += ((b - *out) * a) >> 8; + *out = ((*out * (255-a)) + b * a) >> 8; out++; #endif } -- cgit v1.2.3