aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2010-08-06 10:59:22 +0000
committerEugene Sandulenko2010-10-12 22:28:54 +0000
commitc1b5e5acb88201910b07d20819a677ee09e64df4 (patch)
tree4fe37c784226184c75846bc10106028efa8b90fd
parent87553862d92d462534cb7a050bf481d9cd1d0d59 (diff)
downloadscummvm-rg350-c1b5e5acb88201910b07d20819a677ee09e64df4.tar.gz
scummvm-rg350-c1b5e5acb88201910b07d20819a677ee09e64df4.tar.bz2
scummvm-rg350-c1b5e5acb88201910b07d20819a677ee09e64df4.zip
SWORD25: Fix warnings and compilation
svn-id: r53217
-rw-r--r--engines/sword25/gfx/animationdescription.h4
-rw-r--r--engines/sword25/gfx/renderobject.h6
-rw-r--r--engines/sword25/gfx/renderobjectptr.cpp42
-rw-r--r--engines/sword25/gfx/renderobjectptr.h5
-rw-r--r--engines/sword25/gfx/text.cpp8
-rw-r--r--engines/sword25/kernel/resservice.h2
-rw-r--r--engines/sword25/module.mk1
7 files changed, 55 insertions, 13 deletions
diff --git a/engines/sword25/gfx/animationdescription.h b/engines/sword25/gfx/animationdescription.h
index db30b54149..e6cb578d2d 100644
--- a/engines/sword25/gfx/animationdescription.h
+++ b/engines/sword25/gfx/animationdescription.h
@@ -69,8 +69,8 @@ public:
int HotspotY;
bool FlipV;
bool FlipH;
- std::string FileName;
- std::string Action;
+ Common::String FileName;
+ Common::String Action;
};
// -----------------------------------------------------------------------------
diff --git a/engines/sword25/gfx/renderobject.h b/engines/sword25/gfx/renderobject.h
index 5d1a348125..545a6bf8db 100644
--- a/engines/sword25/gfx/renderobject.h
+++ b/engines/sword25/gfx/renderobject.h
@@ -51,6 +51,8 @@
#include "sword25/math/rect.h"
#include "sword25/gfx/renderobjectptr.h"
+#include "common/list.h"
+
namespace Sword25 {
// -----------------------------------------------------------------------------
@@ -339,8 +341,8 @@ public:
protected:
// Typen
// -----
- typedef std::vector<BS_RenderObjectPtr<BS_RenderObject> > RENDEROBJECT_LIST;
- typedef std::vector<BS_RenderObjectPtr<BS_RenderObject> >::iterator RENDEROBJECT_ITER;
+ typedef Common::List<BS_RenderObjectPtr<BS_RenderObject> > RENDEROBJECT_LIST;
+ typedef Common::List<BS_RenderObjectPtr<BS_RenderObject> >::iterator RENDEROBJECT_ITER;
int m_X; ///< Die X-Position des Objektes relativ zum Eltern-Objekt
int m_Y; ///< Die Y-Position des Objektes relativ zum Eltern-Objekt
diff --git a/engines/sword25/gfx/renderobjectptr.cpp b/engines/sword25/gfx/renderobjectptr.cpp
new file mode 100644
index 0000000000..f2eaa28d50
--- /dev/null
+++ b/engines/sword25/gfx/renderobjectptr.cpp
@@ -0,0 +1,42 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+/*
+ * This code is based on Broken Sword 2.5 engine
+ *
+ * Copyright (c) Malte Thiesen, Daniel Queteschiner and Michael Elsdoerfer
+ *
+ * Licensed under GNU GPL v2
+ *
+ */
+#include "sword25/gfx/renderobjectptr.h"
+
+namespace Sword25 {
+
+BS_RenderObjectPtr::BS_RenderObjectPtr(BS_RenderObject * RenderObjectPtr) {
+ m_Handle = RenderObjectPtr->GetHandle();
+}
+
+} // End of namespace Sword25
diff --git a/engines/sword25/gfx/renderobjectptr.h b/engines/sword25/gfx/renderobjectptr.h
index 52443c5535..89da5d28fc 100644
--- a/engines/sword25/gfx/renderobjectptr.h
+++ b/engines/sword25/gfx/renderobjectptr.h
@@ -64,10 +64,7 @@ public:
BS_RenderObjectPtr(unsigned int Handle) : m_Handle(Handle)
{}
- BS_RenderObjectPtr(BS_RenderObject * RenderObjectPtr)
- {
- m_Handle = RenderObjectPtr->GetHandle();
- }
+ BS_RenderObjectPtr(BS_RenderObject * RenderObjectPtr);
T * operator->() const
{
diff --git a/engines/sword25/gfx/text.cpp b/engines/sword25/gfx/text.cpp
index e91976366e..a469a929d5 100644
--- a/engines/sword25/gfx/text.cpp
+++ b/engines/sword25/gfx/text.cpp
@@ -84,7 +84,7 @@ BS_Text::BS_Text(BS_InputPersistenceBlock & Reader, BS_RenderObjectPtr<BS_Render
// -----------------------------------------------------------------------------
-bool BS_Text::SetFont(const std::string & Font)
+bool BS_Text::SetFont(const Common::String & Font)
{
// Font precachen.
if (GetResourceManager()->PrecacheResource(Font))
@@ -104,7 +104,7 @@ bool BS_Text::SetFont(const std::string & Font)
// -----------------------------------------------------------------------------
-void BS_Text::SetText(const std::string & Text)
+void BS_Text::SetText(const Common::String & Text)
{
m_Text = Text;
UpdateFormat();
@@ -398,11 +398,11 @@ bool BS_Text::Unpersist(BS_InputPersistenceBlock & Reader)
// Beim Laden der anderen Member werden die Set-Methoden benutzt statt der tatsächlichen Member.
// So wird das Layout automatisch aktualisiert und auch alle anderen notwendigen Methoden ausgeführt.
- std::string Font;
+ Common::String Font;
Reader.Read(Font);
SetFont(Font);
- std::string Text;
+ Common::String Text;
Reader.Read(Text);
SetText(Text);
diff --git a/engines/sword25/kernel/resservice.h b/engines/sword25/kernel/resservice.h
index eab0ee06af..8804b5bbac 100644
--- a/engines/sword25/kernel/resservice.h
+++ b/engines/sword25/kernel/resservice.h
@@ -88,7 +88,7 @@ private:
// 1. The pattern starts with '*' -> TRUE
if (*Pattern == '*') {
// Use a copy of the pattern pointer so as not to destroy the current state
- char *PatternCopy = (char *)Pattern;
+ const char *PatternCopy = Pattern;
while (*PatternCopy == '*') { PatternCopy++; }
if (!*PatternCopy) return true;
}
diff --git a/engines/sword25/module.mk b/engines/sword25/module.mk
index 1d79852e36..48666617b7 100644
--- a/engines/sword25/module.mk
+++ b/engines/sword25/module.mk
@@ -30,6 +30,7 @@ MODULE_OBJS := \
gfx/panel.o \
gfx/renderobject.o \
gfx/renderobjectmanager.o \
+ gfx/renderobjectptr.o \
gfx/renderobjectregistry.o \
gfx/screenshot.o \
gfx/staticbitmap.o \