SWORD25: Compilation fixes

Majority of files now compile under Windoze.

svn-id: r53182
This commit is contained in:
Eugene Sandulenko 2010-07-30 12:19:13 +00:00
parent e8bca8b8fe
commit 69b618a8f5
40 changed files with 68 additions and 67 deletions

View File

@ -92,7 +92,7 @@ namespace
{
return ((x > high) ? high : (( x < low) ? low : x));
}
};
}
// -----------------------------------------------------------------------------
// Konstruktion / Destruktion
@ -313,7 +313,7 @@ bool BS_OggTheora::LoadMovie(const std::string & Filename, unsigned int Z)
float ScreenToVideoWidth = (float) pGfx->GetDisplayWidth() / (float) m_OutputBitmap->GetWidth();
float ScreenToVideoHeight = (float) pGfx->GetDisplayHeight() / (float) m_OutputBitmap->GetHeight();
float ScaleFactor = std::min(ScreenToVideoWidth, ScreenToVideoHeight);
if (abs(ScaleFactor - 1.0f) < FLT_EPSILON) ScaleFactor = 1.0f;
if (ABS(ScaleFactor - 1.0f) < FLT_EPSILON) ScaleFactor = 1.0f;
m_OutputBitmap->SetScaleFactor(ScaleFactor);
// Z-Wert setzen

View File

@ -28,7 +28,7 @@
#include "sword25/kernel/callbackregistry.h"
#include "sword25/package/packagemanager.h"
#include <tinyxml.h>
#include "sword25/image/image.h"
#include "sword25/gfx/image/image.h"
#include "sword25/gfx/animationtemplate.h"
#include "sword25/gfx/animationtemplateregistry.h"
#include "sword25/gfx/animationresource.h"

View File

@ -38,7 +38,7 @@ class BS_InputPersistenceBlock;
class BS_Animation : public BS_TimedRenderObject
{
friend BS_RenderObject;
friend class BS_RenderObject;
private:
BS_Animation(BS_RenderObjectPtr<BS_RenderObject> ParentPtr, const std::string & FileName);
@ -50,7 +50,7 @@ public:
{
AT_ONESHOT,
AT_LOOP,
AT_JOJO,
AT_JOJO
};
virtual ~BS_Animation();

View File

@ -22,7 +22,7 @@
#include "sword25/gfx/bitmapresource.h"
#include "sword25/kernel/kernel.h"
#include "sword25/gfx/graphicengine.h"
#include "sword25/image/imageloader.h"
#include "sword25/gfx/image/imageloader.h"
#include "sword25/package/packagemanager.h"
#define BS_LOG_PREFIX "BITMAP"

View File

@ -23,7 +23,7 @@
// Includes
#include "sword25/kernel/common.h"
#include "sword25/kernel/resource.h"
#include "sword25/image/image.h"
#include "sword25/gfx/image/image.h"
// -----------------------------------------------------------------------------
// Forward Declarations

View File

@ -39,7 +39,7 @@
class BS_DynamicBitmap : public BS_Bitmap
{
friend BS_RenderObject;
friend class BS_RenderObject;
public:
virtual ~BS_DynamicBitmap();

View File

@ -19,7 +19,7 @@
#define BS_LOG_PREFIX "GRAPHICENGINE"
#include "sword25/image/image.h"
#include "sword25/gfx/image/image.h"
#include "sword25/gfx/screenshot.h"
#include "sword25/kernel/memlog_off.h"
#include <memory>

View File

@ -111,7 +111,7 @@ public:
/**
32 Bit Farbformat (8 Bit Alpha, 8 Bit Blau, 8 Bit Grün, 8 Bit Rot) (little endian)
*/
CF_ABGR32,
CF_ABGR32
};
// Interface

View File

@ -349,7 +349,7 @@ private:
@brief Sucht zu Bilddaten ein BS_ImageLoader Objekt, dass die Bilddaten dekodieren kann.
@return Gibt einen Pointer auf ein passendes BS_ImageLoader Objekt zurück, oder NULL, wenn kein passendes Objekt gefunden wurde.
*/
static BS_ImageLoader* BS_ImageLoader::_FindSuitableImageLoader(const char* pFileData, unsigned int FileSize);
static BS_ImageLoader* _FindSuitableImageLoader(const char* pFileData, unsigned int FileSize);
static std::list<BS_ImageLoader*> _ImageLoaderList; // Die Liste aller BS_ImageLoader-Objekte
static bool _ImageLoaderListInitialized; // Gibt an, ob die Liste schon intialisiert wurde

View File

@ -26,7 +26,7 @@
#include "sword25/kernel/inputpersistenceblock.h"
#include "sword25/kernel/outputpersistenceblock.h"
#include "sword25/gfx/graphicengine.h"
#include "sword25/image/image.h"
#include "sword25/gfx/image/image.h"
// -----------------------------------------------------------------------------

View File

@ -79,7 +79,7 @@ public:
/// Ein Text. Siehe BS_Text.
TYPE_TEXT,
/// Ein unbekannter Objekttyp. Diesen Typ sollte kein Renderobjekt annehmen.
TYPE_UNKNOWN,
TYPE_UNKNOWN
};
// Add-Methoden
@ -373,13 +373,13 @@ protected:
// Das primäre Sortierkriterium ist hierbei der Z-Wert und das sekundäre der Y-Wert (von oben nach unten).
// Beispiel:
// Screen
// / | \
// / | \
// / | \
// / | \
// / | \.
// / | \.
// / | \.
// / | \.
// Background Interface Maus
// / \ / | \
// / \ / | \
// / \ / | \.
// / \ / | \.
// George Tür Icn1 Icn2 Icn3
//
// Wenn jetzt das Interface mit SetVisible() ausgeblendet würde, verschwinden auch die Icons, die sich im Interface

View File

@ -36,7 +36,7 @@
#include "sword25/kernel/memlog_on.h"
#include "sword25/kernel/common.h"
#include "sword25/renderobjectptr.h"
#include "sword25/gfx/renderobjectptr.h"
#include "sword25/kernel/persistable.h"
// Klassendefinition

View File

@ -50,6 +50,8 @@ public:
return *m_InstancePtr.get();
}
virtual ~BS_RenderObjectRegistry() {}
private:
virtual void LogErrorLn(const char * Message) const;
virtual void LogWarningLn(const char * Message) const;

View File

@ -33,7 +33,7 @@
class BS_StaticBitmap : public BS_Bitmap
{
friend BS_RenderObject;
friend class BS_RenderObject;
private:
/**

View File

@ -46,7 +46,7 @@ class BS_ResourceManager;
class BS_Text : public BS_RenderObject
{
friend BS_RenderObject;
friend class BS_RenderObject;
public:
/**

View File

@ -36,4 +36,4 @@ BS_TimedRenderObject::~BS_TimedRenderObject()
{
BS_ASSERT(GetManager());
GetManager()->DetatchTimedRenderObject(this);
}
}

View File

@ -44,7 +44,7 @@ class BS_TimedRenderObject : public BS_RenderObject
{
public:
BS_TimedRenderObject(BS_RenderObjectPtr<BS_RenderObject> pParent, TYPES Type, unsigned int Handle = 0);
BS_TimedRenderObject::~BS_TimedRenderObject();
~BS_TimedRenderObject();
/**
@brief Teilt dem Objekt mit, dass ein neuer Frame begonnen wird.
@ -54,4 +54,4 @@ public:
@param int TimeElapsed gibt an wie viel Zeit (in Microsekunden) seit dem letzten Frame vergangen ist.
*/
virtual void FrameNotification(int TimeElapsed) = 0;
};
};

View File

@ -133,7 +133,7 @@ public:
KEY_LSHIFT = 0xA0,
KEY_RSHIFT = 0xA1,
KEY_LCONTROL = 0xA2,
KEY_RCONTROL = 0xA3,
KEY_RCONTROL = 0xA3
};
// ACHTUNG: Diese Codes werden in inputengine_script.cpp beim Skript-Service registriert. Bei Änderungen an diesem Enum muss auch diese
@ -148,7 +148,7 @@ public:
KEY_COMMAND_BACKSPACE = 6,
KEY_COMMAND_TAB = 7,
KEY_COMMAND_INSERT = 8,
KEY_COMMAND_DELETE = 9,
KEY_COMMAND_DELETE = 9
};
/// --------------------------------------------------------------

View File

@ -42,7 +42,7 @@ public:
{
NONE,
END_OF_DATA,
OUT_OF_SYNC,
OUT_OF_SYNC
};
BS_InputPersistenceBlock(const void * Data, unsigned int DataLength);

View File

@ -328,11 +328,11 @@ private:
class BS_ServiceInfo
{
public:
BS_ServiceInfo(const std::string& SuperclassIdentifier, const std::string& ServiceIdentifier, BS_Service* (*CreateMethod)(BS_Kernel*))
BS_ServiceInfo(const std::string& SuperclassIdentifier_, const std::string& ServiceIdentifier_, BS_Service* (*CreateMethod_)(BS_Kernel*))
{
this->SuperclassIdentifier = SuperclassIdentifier;
this->ServiceIdentifier = ServiceIdentifier;
this->CreateMethod = CreateMethod;
this->SuperclassIdentifier = SuperclassIdentifier_;
this->ServiceIdentifier = ServiceIdentifier_;
this->CreateMethod = CreateMethod_;
};
std::string SuperclassIdentifier;

View File

@ -28,7 +28,7 @@
#include "sword25/kernel/resmanager.h"
#include "sword25/kernel/persistenceservice.h"
#include "sword25/kernel/wincodegenerator.h"
#include "sword25/debug/debugtools.h"
#include "sword25/kernel/debug/debugtools.h"
#include "sword25/script/script.h"
#include "sword25/script/luabindhelper.h"

View File

@ -23,7 +23,7 @@
#include "sword25/kernel/filesystemutil.h"
#include "sword25/kernel/log.h"
#include "sword25/debug/debugtools.h"
#include "sword25/kernel/debug/debugtools.h"
// Konstanten
static const char* BF_LOG_FILENAME = "log.txt";

View File

@ -35,7 +35,8 @@ template<typename T>
class BS_ObjectRegistry
{
public:
BS_ObjectRegistry() : m_NextHandle(1) {};
BS_ObjectRegistry() : m_NextHandle(1) {}
virtual ~BS_ObjectRegistry() {}
// -------------------------------------------------------------------------

View File

@ -48,7 +48,7 @@ protected:
FLOAT_MARKER,
STRING_MARKER,
BOOL_MARKER,
BLOCK_MARKER,
BLOCK_MARKER
};
// -----------------------------------------------------------------------------
@ -102,7 +102,7 @@ private:
// Compile time asserts
// -----------------------------------------------------------------------------
#define CTASSERT(ex) typedef char ctassert_type[(ex) ? 1 : -1];
#define CTASSERT(ex) typedef char ctassert_type[(ex) ? 1 : -1]
CTASSERT(sizeof(unsigned char) == 1);
CTASSERT(sizeof(signed int) == 4);
CTASSERT(sizeof(unsigned int) == 4);

View File

@ -31,8 +31,8 @@
#include "sword25/input/inputengine.h"
#include "sword25/math/regionregistry.h"
#include "sword25/script/script.h"
#include "sword25/debug/debugtools.h"
#include "sword25/util/zlib/zlib.h"
#include "sword25/kernel/debug/debugtools.h"
#include <zlib.h>
#include "sword25/kernel/memlog_off.h"
#include <sstream>

View File

@ -290,4 +290,4 @@ void BS_ResourceManager::SetMaxMemoryUsage(unsigned int MaxMemoryUsage)
{
m_MaxMemoryUsage = MaxMemoryUsage;
DeleteResourcesIfNecessary();
}
}

View File

@ -32,7 +32,7 @@ BS_Resource::BS_Resource(const std::string& FileName, RESOURCE_TYPES Type) :
_FileName = static_cast<BS_PackageManager *>(BS_Kernel::GetInstance()->GetService("package"))->GetAbsolutePath(FileName);
_FileNameHash = BS_String::GetHash(FileName);
};
}
void BS_Resource::Release()
{

View File

@ -31,7 +31,7 @@ class BS_ResourceManager;
class BS_Resource
{
friend BS_ResourceManager;
friend class BS_ResourceManager;
public:
enum RESOURCE_TYPES

View File

@ -97,7 +97,7 @@ public:
{
LEFT,
RIGHT,
ON,
ON
};
/**

View File

@ -249,4 +249,4 @@ private:
bool IsLineInCone(int StartVertexIndex, const BS_Vertex & EndVertex, bool IncludeEdges) const;
};
#endif
#endif

View File

@ -57,12 +57,12 @@ public:
@param right das rechte Extrem des Rechteckes + 1
@param bottom des untere Extrem des Rechteckes + 1
*/
BS_Rect(int left, int top, int right, int bottom)
BS_Rect(int left_, int top_, int right_, int bottom_)
{
this->left = left;
this->top = top;
this->right = right;
this->bottom = bottom;
this->left = left_;
this->top = top_;
this->right = right_;
this->bottom = bottom_;
}
/**
@brief Verschiebt das Rechteck.
@ -295,4 +295,4 @@ public:
}
};
#endif
#endif

View File

@ -55,7 +55,7 @@ public:
enum REGION_TYPE
{
RT_REGION,
RT_WALKREGION,
RT_WALKREGION
};
static unsigned int Create(REGION_TYPE Type);

View File

@ -41,7 +41,7 @@ class BS_Vertex
{
public:
BS_Vertex() : X(0), Y(0) {};
BS_Vertex(int X, int Y) { this->X = X; this->Y = Y; }
BS_Vertex(int X_, int Y_) { this->X = X_; this->Y = Y_; }
int X;
int Y;

View File

@ -30,7 +30,7 @@
// Konstanten
// -----------------------------------------------------------------------------
static const int INFINITY = INT_MAX;
static const int infinity = INT_MAX;
// -----------------------------------------------------------------------------
// Konstruktion / Destruktion
@ -103,7 +103,7 @@ struct DijkstraNode
typedef Container::iterator Iter;
typedef Container::const_iterator ConstIter;
DijkstraNode() : Cost(INFINITY), Chosen(false) {};
DijkstraNode() : Cost(infinity), Chosen(false) {};
ConstIter ParentIter;
int Cost;
bool Chosen;
@ -127,7 +127,7 @@ static void InitDijkstraNodes(DijkstraNode::Container & DijkstraNodes, const BS_
static DijkstraNode::Iter ChooseClosestNode(DijkstraNode::Container & Nodes)
{
DijkstraNode::Iter ClosestNodeInter = Nodes.end();
int MinCost = INFINITY;
int MinCost = infinity;
for (DijkstraNode::Iter iter = Nodes.begin(); iter != Nodes.end(); iter++)
{
@ -152,7 +152,7 @@ static void RelaxNodes(DijkstraNode::Container & Nodes,
for (unsigned int i = 0; i < Nodes.size(); i++)
{
int Cost = VisibilityMatrix[CurNodeIndex][i];
if (!Nodes[i].Chosen && Cost != INFINITY)
if (!Nodes[i].Chosen && Cost != infinity)
{
int TotalCost = (*CurNodeIter).Cost + Cost;
if (TotalCost < Nodes[i].Cost)
@ -268,7 +268,7 @@ void BS_WalkRegion::InitNodeVector()
void BS_WalkRegion::ComputeVisibilityMatrix()
{
// Sichtbarkeitsmatrix initialisieren
m_VisibilityMatrix = std::vector< std::vector <int> >(m_Nodes.size(), std::vector<int>(m_Nodes.size(), INFINITY));
m_VisibilityMatrix = std::vector< std::vector <int> >(m_Nodes.size(), std::vector<int>(m_Nodes.size(), infinity));
// Sichtbarkeiten zwischen Vertecies berechnen und in die Sichbarkeitsmatrix eintragen.
for (unsigned int j = 0; j < m_Nodes.size(); ++j)
@ -285,8 +285,8 @@ void BS_WalkRegion::ComputeVisibilityMatrix()
else
{
// Wenn keine Sichtlinie besteht wird die Entfernung "unendlich" eingetragen
m_VisibilityMatrix[i][j] = INFINITY;
m_VisibilityMatrix[j][i] = INFINITY;
m_VisibilityMatrix[i][j] = infinity;
m_VisibilityMatrix[j][i] = infinity;
}
}
}

View File

@ -42,7 +42,7 @@ typedef std::vector<BS_Vertex> BS_Path;
*/
class BS_WalkRegion : public BS_Region
{
friend BS_Region;
friend class BS_Region;
protected:
BS_WalkRegion();

View File

@ -122,9 +122,7 @@ MODULE_OBJS := \
util/lua/src/print.o \
util/pluto/pdep.o \
util/pluto/pluto.o \
util/pluto/plzio.o \
util/pluto/pptest.o \
util/pluto/puptest.o
util/pluto/plzio.o
# This module can be built as a plugin
ifeq ($(ENABLE_SWORD25), DYNAMIC_PLUGIN)

View File

@ -328,7 +328,7 @@ namespace
enum PERMANENT_TABLE_TYPE
{
PTT_PERSIST,
PTT_UNPERSIST,
PTT_UNPERSIST
};
// -------------------------------------------------------------------------

View File

@ -50,7 +50,7 @@ typedef enum
GLS_OPENGL_ERROR,
GLS_INVALID_DATA_DIMENSIONS,
GLS_INVALID_DATA_POINTER,
GLS_INVALID_SUB_IMAGE,
GLS_INVALID_SUB_IMAGE
} GLS_Result;
/* GLS_Rect */

View File

@ -13,7 +13,7 @@
#include <stddef.h>
#include "luaconf.h"
#include "sword25/util/lua/luaconf.h"
#define LUA_VERSION "Lua 5.1"

View File

@ -16,7 +16,7 @@
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "lua.h"
#include "sword25/util/lua/lua.h"
#include "pluto.h"
#define USE_PDEP