[Scummvm-cvs-logs] SF.net SVN: scummvm:[53225] scummvm/trunk/engines/sword25

sev at users.sourceforge.net sev at users.sourceforge.net
Wed Oct 13 00:38:23 CEST 2010


Revision: 53225
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53225&view=rev
Author:   sev
Date:     2010-10-12 22:38:23 +0000 (Tue, 12 Oct 2010)

Log Message:
-----------
SWORD25: Clean compile!

Under MinGW, with OpenGL and tinyxml.

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/gfx/animationtemplate.h
    scummvm/trunk/engines/sword25/gfx/bitmap.h
    scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp
    scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h
    scummvm/trunk/engines/sword25/gfx/image/image.h
    scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
    scummvm/trunk/engines/sword25/gfx/image/vectorimage.h
    scummvm/trunk/engines/sword25/gfx/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/staticbitmap.cpp
    scummvm/trunk/engines/sword25/gfx/staticbitmap.h
    scummvm/trunk/engines/sword25/input/inputengine_script.cpp
    scummvm/trunk/engines/sword25/kernel/kernel_script.cpp
    scummvm/trunk/engines/sword25/module.mk
    scummvm/trunk/engines/sword25/package/packagemanager_script.cpp
    scummvm/trunk/engines/sword25/sfx/soundengine.cpp
    scummvm/trunk/engines/sword25/sfx/soundengine_script.cpp
    scummvm/trunk/engines/sword25/util/lua/luaconf.h

Modified: scummvm/trunk/engines/sword25/gfx/animationtemplate.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/animationtemplate.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/animationtemplate.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -123,7 +123,7 @@
 	virtual bool Unpersist(BS_InputPersistenceBlock &Reader);
 
 private:
-	Common::Array<const Frame>  m_Frames;
+	Common::Array<Frame>  m_Frames;
 	BS_AnimationResource       *m_SourceAnimationPtr;
 	bool                        m_Valid;
 

Modified: scummvm/trunk/engines/sword25/gfx/bitmap.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/bitmap.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/bitmap.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -172,7 +172,7 @@
 	    @return Gibt false zur\xFCck, falls der Aufruf fehlgeschlagen ist.
 	    @remark Ein Aufruf dieser Methode ist nur erlaubt, wenn IsSetContentAllowed() true zur\xFCckgibt.
 	*/
-	virtual bool    SetContent(const byte *Pixeldata, unsigned int Offset = 0, unsigned int Stride = 0) = 0;
+	virtual bool    SetContent(const byte *Pixeldata, uint size, unsigned int Offset = 0, unsigned int Stride = 0) = 0;
 
 	virtual bool    IsScalingAllowed() const = 0;
 	virtual bool    IsAlphaAllowed() const = 0;

Modified: scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/dynamicbitmap.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -123,8 +123,8 @@
 
 // -----------------------------------------------------------------------------
 
-bool BS_DynamicBitmap::SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride) {
-	return m_Image->SetContent(Pixeldata, Offset, Stride);
+bool BS_DynamicBitmap::SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) {
+	return m_Image->SetContent(Pixeldata, size, Offset, Stride);
 }
 
 // -----------------------------------------------------------------------------
@@ -184,7 +184,7 @@
 
 	// Bild mit durchsichtigen Bilddaten initialisieren.
 	byte *TransparentImageData = (byte *)calloc(m_Width * m_Height * 4, 1);
-	m_Image->SetContent(TransparentImageData);
+	m_Image->SetContent(TransparentImageData, m_Width * m_Height);
 	free(TransparentImageData);
 
 	Result &= BS_RenderObject::UnpersistChildren(Reader);

Modified: scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/dynamicbitmap.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -62,7 +62,7 @@
 
 	virtual unsigned int GetPixel(int X, int Y) const;
 
-	virtual bool    SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride);
+	virtual bool    SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride);
 
 	virtual bool    IsScalingAllowed() const;
 	virtual bool    IsAlphaAllowed() const;

Modified: scummvm/trunk/engines/sword25/gfx/image/image.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/image.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/image/image.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -165,7 +165,7 @@
 	    @return Gibt false zur\xFCck, falls der Aufruf fehlgeschlagen ist.
 	    @remark Ein Aufruf dieser Methode ist nur erlaubt, wenn IsSetContentAllowed() true zur\xFCckgibt.
 	*/
-	virtual bool SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride) = 0;
+	virtual bool SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) = 0;
 
 	/**
 	    @brief Liest einen Pixel des Bildes.

Modified: scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/image/vectorimage.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -38,13 +38,9 @@
 
 #include "sword25/kernel/bs_stdint.h"
 #include "sword25/gfx/image/vectorimage.h"
-#include <vector>
-#include <stdexcept>
 
-#include "agg_bounding_rect.h"
+#include "graphics/colormasks.h"
 
-using namespace std;
-
 namespace Sword25 {
 
 #define BS_LOG_PREFIX "VECTORIMAGE"
@@ -195,9 +191,9 @@
 // Konvertiert SWF-Farben in AntiGrain Farben
 // -----------------------------------------------------------------------------
 
-agg::rgba8 FlashColorToAGGRGBA8(unsigned int FlashColor) {
-	agg::rgba8 ResultColor((FlashColor >> 16) & 0xff, (FlashColor >> 8) & 0xff, FlashColor & 0xff, FlashColor >> 24);
-	ResultColor.premultiply();
+uint32 FlashColorToAGGRGBA8(unsigned int FlashColor) {
+	uint32 ResultColor = Graphics::ARGBToColor<Graphics::ColorMasks<8888> >(FlashColor >> 24, (FlashColor >> 16) & 0xff, (FlashColor >> 8) & 0xff, FlashColor & 0xff);
+
 	return ResultColor;
 }
 
@@ -215,12 +211,16 @@
 };
 
 BS_Rect CalculateBoundingBox(const BS_VectorImageElement &VectorImageElement) {
+#if 0 // TODO
 	agg::path_storage Path = VectorImageElement.GetPaths();
 	CBBGetId IdSource(VectorImageElement);
 
 	double x1, x2, y1, y2;
 	agg::bounding_rect(Path, IdSource, 0, VectorImageElement.GetPathCount(), &x1, &y1, &x2, &y2);
-
+#else
+	double x1, x2, y1, y2;
+	x1 = x2 = y1 = y2 = 0;
+#endif
 	return BS_Rect(static_cast<int>(x1), static_cast<int>(y1), static_cast<int>(x2) + 1, static_cast<int>(y2) + 1);
 }
 }
@@ -388,6 +388,7 @@
 				// Ein neuen Pfad erzeugen, es sei denn, es wurden nur neue Styles definiert
 				if (StateLineStyle || StateFillStyle0 || StateFillStyle1 || StateMoveTo) {
 					// Letzte Zeichenposition merken, beim Aufruf von start_new_path() wird die Zeichenpostionen auf 0, 0 zur\xFCckgesetzt
+#if 0 // TODO
 					double LastX = m_Elements.back().m_Paths.last_x();
 					double LastY = m_Elements.back().m_Paths.last_y();
 
@@ -400,6 +401,7 @@
 						m_Elements.back().m_Paths.move_to(MoveDeltaX, MoveDeltaY);
 					else
 						m_Elements.back().m_Paths.move_to(LastX, LastY);
+#endif
 				}
 			}
 		} else {
@@ -414,11 +416,13 @@
 				s32 AnchorDeltaX = bs.GetSignedBits(NumBits);
 				s32 AnchorDeltaY = bs.GetSignedBits(NumBits);
 
+#if 0 // TODO
 				double ControlX = m_Elements.back().m_Paths.last_x() + ControlDeltaX;
 				double ControlY = m_Elements.back().m_Paths.last_y() + ControlDeltaY;
 				double AnchorX = ControlX + AnchorDeltaX;
 				double AnchorY = ControlY + AnchorDeltaY;
 				m_Elements.back().m_Paths.curve3(ControlX, ControlY, AnchorX, AnchorY);
+#endif
 			} else {
 				// Staight edge
 				s32 DeltaX = 0;
@@ -436,13 +440,15 @@
 						DeltaX = bs.GetSignedBits(NumBits);
 				}
 
+#if 0 // TODO
 				m_Elements.back().m_Paths.line_rel(DeltaX, DeltaY);
+#endif
 			}
 		}
 	}
 
 	// Bounding-Boxes der einzelnen Elemente berechnen
-	vector<BS_VectorImageElement>::iterator it = m_Elements.begin();
+	Common::Array<BS_VectorImageElement>::iterator it = m_Elements.begin();
 	for (; it != m_Elements.end(); ++it) it->m_BoundingBox = CalculateBoundingBox(*it);
 
 	return true;
@@ -481,7 +487,8 @@
 
 	// Anzahl an Linestyles bestimmen
 	unsigned int LineStyleCount = bs.GetU8();
-	if (LineStyleCount == 0xff) LineStyleCount = bs.GetU16();
+	if (LineStyleCount == 0xff)
+		LineStyleCount = bs.GetU16();
 
 	// Alle Linestyles einlesen
 	m_Elements.back().m_LineStyles.reserve(LineStyleCount);
@@ -521,7 +528,7 @@
 
 // -----------------------------------------------------------------------------
 
-bool BS_VectorImage::SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride) {
+bool BS_VectorImage::SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) {
 	BS_LOG_ERRORLN("SetContent() is not supported.");
 	return 0;
 }

Modified: scummvm/trunk/engines/sword25/gfx/image/vectorimage.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/vectorimage.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/image/vectorimage.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -43,11 +43,11 @@
 #include "sword25/gfx/image/image.h"
 #include "sword25/math/rect.h"
 
+#if 0
 #include <vector>
 #include "agg_path_storage.h"
-#include "agg_color_rgba.h"
+#endif
 
-
 namespace Sword25 {
 
 class BS_VectorImage;
@@ -62,8 +62,12 @@
 class BS_VectorPathInfo {
 public:
 	BS_VectorPathInfo(unsigned int ID, unsigned int LineStyle, unsigned int FillStyle0, unsigned int FillStyle1) :
-		m_ID(ID), m_LineStyle(LineStyle), m_FillStyle0(FillStyle0), m_FillStyle1(FillStyle1) {};
+		m_ID(ID), m_LineStyle(LineStyle), m_FillStyle0(FillStyle0), m_FillStyle1(FillStyle1) {}
 
+	BS_VectorPathInfo() {
+		m_ID = m_LineStyle = m_FillStyle0 = m_FillStyle1 = 0;
+	}
+
 	unsigned int GetID() const {
 		return m_ID;
 	}
@@ -90,15 +94,18 @@
            Werden alle Elemente eines Vektorbildes \xFCbereinandergelegt, ergibt sich das komplette Bild.
 */
 class BS_VectorImageElement {
-	friend BS_VectorImage;
+	friend class BS_VectorImage;
 public:
-	const agg::path_storage    &GetPaths() const {
+#if 0 // TODO
+	const agg::path_storage &GetPaths() const {
 		return m_Paths;
 	}
-	unsigned int                GetPathCount() const {
+#endif
+
+	unsigned int GetPathCount() const {
 		return m_PathInfos.size();
 	}
-	const BS_VectorPathInfo    &GetPathInfo(unsigned int PathNr) const {
+	const BS_VectorPathInfo &GetPathInfo(unsigned int PathNr) const {
 		BS_ASSERT(PathNr < GetPathCount());
 		return m_PathInfos[PathNr];
 	}
@@ -112,7 +119,7 @@
 		return m_LineStyles.size();
 	}
 
-	const agg::rgba8 &GetLineStyleColor(unsigned int LineStyle) const {
+	uint32 GetLineStyleColor(unsigned int LineStyle) const {
 		BS_ASSERT(LineStyle < m_LineStyles.size());
 		return m_LineStyles[LineStyle].Color;
 	}
@@ -121,7 +128,7 @@
 		return m_FillStyles.size();
 	}
 
-	const agg::rgba8 &GetFillStyleColor(unsigned int FillStyle) const {
+	uint32 GetFillStyleColor(unsigned int FillStyle) const {
 		BS_ASSERT(FillStyle < m_FillStyles.size());
 		return m_FillStyles[FillStyle];
 	}
@@ -132,16 +139,19 @@
 
 private:
 	struct LineStyleType {
-		LineStyleType(double Width_, const agg::rgba8 &Color_) : Width(Width_), Color(Color_) {};
-		double      Width;
-		agg::rgba8  Color;
+		LineStyleType(double Width_, uint32 Color_) : Width(Width_), Color(Color_) {}
+		LineStyleType() { Width = 0; Color = 0; }
+		double Width;
+		uint32 Color;
 	};
 
-	agg::path_storage               m_Paths;
-	Common::Array<BS_VectorPathInfo>    m_PathInfos;
-	Common::Array<LineStyleType>        m_LineStyles;
-	Common::Array<agg::rgba8>           m_FillStyles;
-	BS_Rect                         m_BoundingBox;
+#if 0 // TODO
+	agg::path_storage m_Paths;
+#endif
+	Common::Array<BS_VectorPathInfo> m_PathInfos;
+	Common::Array<LineStyleType> m_LineStyles;
+	Common::Array<uint32>  m_FillStyles;
+	BS_Rect m_BoundingBox;
 };
 
 
@@ -201,7 +211,7 @@
 	virtual bool IsSetContentAllowed() const {
 		return false;
 	}
-	virtual bool SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride);
+	virtual bool SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride);
 	virtual bool Blit(int PosX = 0, int PosY = 0,
 	                  int Flipping = FLIP_NONE,
 	                  BS_Rect *pPartRect = NULL,

Modified: scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -38,13 +38,16 @@
 
 #include "sword25/gfx/image/vectorimagerenderer.h"
 #include "sword25/gfx/image/vectorimage.h"
+
+#if 0 // TODO
 #include "agg_conv_curve.h"
 #include "agg_path_storage.h"
 #include "agg_conv_stroke.h"
+#endif
 
-
 namespace Sword25 {
 
+#if 0 // TODO
 // -----------------------------------------------------------------------------
 // CompoundShape
 // -----------------------------------------------------------------------------
@@ -109,23 +112,16 @@
 	const BS_VectorImageElement &m_ImageElement;
 };
 
-
-// -----------------------------------------------------------------------------
-// Konstruktion
-// -----------------------------------------------------------------------------
-
 BS_VectorImageRenderer::BS_VectorImageRenderer() :
 	PixelFormat(rbuf) {
 
 }
 
 
-// -----------------------------------------------------------------------------
-
 bool BS_VectorImageRenderer::Render(const BS_VectorImage &VectorImage,
                                     float ScaleFactorX, float ScaleFactorY,
                                     unsigned int &Width, unsigned int &Height,
-                                    Common::Array<char> & ImageData,
+                                    byte *ImageData,
                                     float LineScaleFactor,
                                     bool NoAlphaShapes) {
 	Width = static_cast<unsigned int>(VectorImage.GetWidth() * ScaleFactorX);
@@ -200,4 +196,18 @@
 	return true;
 }
 
+#else
+
+BS_VectorImageRenderer::BS_VectorImageRenderer() {}
+
+bool BS_VectorImageRenderer::Render(const BS_VectorImage &VectorImage,
+                                    float ScaleFactorX, float ScaleFactorY,
+                                    unsigned int &Width, unsigned int &Height,
+                                    byte *ImageData,
+                                    float LineScaleFactor,
+                                    bool NoAlphaShapes) {
+	return true;
+}
+#endif
+
 } // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/image/vectorimagerenderer.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -40,8 +40,8 @@
 // -----------------------------------------------------------------------------
 
 #include "sword25/kernel/common.h"
-#include <vector>
 
+#if 0 // TODO
 #include "agg_rendering_buffer.h"
 #include "agg_pixfmt_rgba.h"
 #include "agg_renderer_scanline.h"
@@ -51,6 +51,7 @@
 #include "agg_scanline_bin.h"
 #include "agg_trans_affine.h"
 #include "agg_span_allocator.h"
+#endif
 
 namespace Sword25 {
 
@@ -68,11 +69,12 @@
 	bool Render(const BS_VectorImage &VectorImage,
 	            float ScaleFactorX, float ScaleFactorY,
 	            unsigned int &Width, unsigned int &Height,
-	            Common::Array<char> & ImageData,
+	            byte *ImageData,
 	            float LineScaleFactor = 1.0f,
 	            bool NoAlphaShapes = false);
 
 private:
+#if 0
 	typedef agg::pixfmt_rgba32_pre PixelFormatType;
 	typedef agg::renderer_base<PixelFormatType> BaseRendererType;
 	typedef agg::renderer_scanline_aa_solid<BaseRendererType> ScanlineRendererType;
@@ -87,6 +89,7 @@
 	agg::scanline_bin ScanlineBin;
 	agg::trans_affine Scale;
 	agg::span_allocator<agg::rgba8> Alloc;
+#endif
 };
 
 } // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/opengl/glimage.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -36,7 +36,6 @@
 // INCLUDES
 // -----------------------------------------------------------------------------
 
-#include "sword25/util/glsprites/glsprites.h"
 #include "sword25/package/packagemanager.h"
 #include "sword25/gfx/image/imageloader.h"
 #include "sword25/gfx/opengl/openglgfx.h"
@@ -139,9 +138,9 @@
 
 // -----------------------------------------------------------------------------
 
-bool BS_GLImage::SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride) {
+bool BS_GLImage::SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) {
 	// \xDCberpr\xFCfen, ob PixelData ausreichend viele Pixel enth\xE4lt um ein Bild der Gr\xF6\xDFe Width * Height zu erzeugen
-	if (Pixeldata.size() < static_cast<unsigned int>(m_Width * m_Height * 4)) {
+	if (size < static_cast<unsigned int>(m_Width * m_Height * 4)) {
 		BS_LOG_ERRORLN("PixelData vector is too small to define a 32 bit %dx%d image.", m_Width, m_Height);
 		return false;
 	}

Modified: scummvm/trunk/engines/sword25/gfx/opengl/glimage.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/glimage.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/opengl/glimage.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -88,7 +88,7 @@
 	                  unsigned int Color = BS_ARGB(255, 255, 255, 255),
 	                  int Width = -1, int Height = -1);
 	virtual bool Fill(const BS_Rect *pFillRect, unsigned int Color);
-	virtual bool SetContent(const byte *Pixeldata, unsigned int Offset = 0, unsigned int Stride = 0);
+	virtual bool SetContent(const byte *Pixeldata, uint size, unsigned int Offset = 0, unsigned int Stride = 0);
 	virtual unsigned int GetPixel(int X, int Y);
 
 	virtual bool IsBlitSource() const               {

Modified: scummvm/trunk/engines/sword25/gfx/opengl/glvectorimageblit.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/glvectorimageblit.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/opengl/glvectorimageblit.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -62,7 +62,7 @@
                           unsigned int Color,
                           int Width, int Height) {
 	static BS_VectorImageRenderer VectorImageRenderer;
-	static vector<char> PixelData;
+	static byte *PixelData;
 	static GLS_Sprite Sprite = 0;
 	static BS_VectorImage *OldThis = 0;
 	static int              OldWidth;
@@ -98,7 +98,7 @@
 			return true;
 		}
 
-		GLS_Result Result = GLS_SetSpriteData(Sprite, RenderedWidth, RenderedHeight, &PixelData[0], 0);
+		GLS_Result Result = GLS_SetSpriteData(Sprite, RenderedWidth, RenderedHeight, PixelData, 0);
 		if (Result != GLS_OK) {
 			BS_LOG_ERRORLN("Call to GLS_SetSpriteData() failed. Reason: %s", GLS_ResultString(Result));
 			return false;

Modified: scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -55,12 +55,8 @@
 #include "sword25/gfx/opengl/glimage.h"
 #include "sword25/gfx/opengl/swimage.h"
 
-#include <algorithm>
-
 namespace Sword25 {
 
-using namespace std;
-
 #define BS_LOG_PREFIX "OPENGLGFX"
 
 
@@ -266,48 +262,50 @@
 
 // -----------------------------------------------------------------------------
 
-bool BS_OpenGLGfx::GetScreenshot(unsigned int &Width, unsigned int &Height, vector<unsigned int> & Data) {
-	if (!ReadFramebufferContents(m_Width, m_Height, Data)) return false;
+bool BS_OpenGLGfx::GetScreenshot(unsigned int &Width, unsigned int &Height, byte **Data) {
+	if (!ReadFramebufferContents(m_Width, m_Height, Data))
+		return false;
 
 	// Die Gr\xF6\xDFe des Framebuffers zur\xFCckgeben.
 	Width = m_Width;
 	Height = m_Height;
 
 	// Bilddaten vom OpenGL-Format in unser eigenes Format umwandeln.
-	ReverseRGBAComponentOrder(Data);
-	FlipImagedataVertical(Width, Height, Data);
+	ReverseRGBAComponentOrder(*Data, Width * Height);
+	FlipImagedataVertical(Width, Height, *Data);
 
 	return true;
 }
 
 // -----------------------------------------------------------------------------
 
-bool BS_OpenGLGfx::ReadFramebufferContents(unsigned int Width, unsigned int Height, Common::Array<unsigned int> & Data) {
-	Data.resize(Width * Height);
-	glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, &Data[0]);
+bool BS_OpenGLGfx::ReadFramebufferContents(unsigned int Width, unsigned int Height, byte **Data) {
+    *Data = (byte *)malloc(Width * Height * 4);
+	glReadPixels(0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, *Data);
 
 	if (glGetError() == 0)
 		return true;
 	else {
-		Data.clear();
 		return false;
 	}
 }
 
 // -----------------------------------------------------------------------------
 
-void BS_OpenGLGfx::ReverseRGBAComponentOrder(vector<unsigned int> & Data) {
-	vector<unsigned int>::iterator It = Data.begin();
-	while (It != Data.end()) {
-		unsigned int Pixel = *It;
-		*It = (Pixel & 0xff00ff00) | ((Pixel >> 16) & 0xff) | ((Pixel & 0xff) << 16);
-		++It;
+void BS_OpenGLGfx::ReverseRGBAComponentOrder(byte *Data, uint size) {
+	uint32 *ptr = (uint32 *)Data;
+
+	for (uint i = 0; i < size; i++) {
+		unsigned int Pixel = *ptr;
+		*ptr = (Pixel & 0xff00ff00) | ((Pixel >> 16) & 0xff) | ((Pixel & 0xff) << 16);
+		++ptr;
 	}
 }
 
 // -----------------------------------------------------------------------------
 
-void BS_OpenGLGfx::FlipImagedataVertical(unsigned int Width, unsigned int Height, vector<unsigned int> & Data) {
+void BS_OpenGLGfx::FlipImagedataVertical(unsigned int Width, unsigned int Height, byte *Data) {
+#if 0 // TODO
 	vector<unsigned int> LineBuffer(Width);
 
 	for (unsigned int Y = 0; Y < Height / 2; ++Y) {
@@ -317,26 +315,18 @@
 		copy(Line2It, Line2It + Width, Line1It);
 		copy(LineBuffer.begin(), LineBuffer.end(), Line2It);
 	}
+#endif
 }
 
 // -----------------------------------------------------------------------------
 // RESOURCE MANAGING
 // -----------------------------------------------------------------------------
 
-static bool DoesStringEndWith(const Common::String &String, const std::string &OtherString) {
-	Common::String::size_type StringPos = String.rfind(OtherString);
-	if (StringPos == Common::String::npos) return false;
-
-	return StringPos + OtherString.size() == String.size();
-}
-
-// -----------------------------------------------------------------------------
-
 BS_Resource *BS_OpenGLGfx::LoadResource(const Common::String &FileName) {
 	BS_ASSERT(CanLoadResource(FileName));
 
 	// Bild f\xFCr den Softwarebuffer laden
-	if (DoesStringEndWith(FileName, PNG_S_EXTENSION)) {
+	if (FileName.hasSuffix(PNG_S_EXTENSION)) {
 		bool Result;
 		BS_SWImage *pImage = new BS_SWImage(FileName, Result);
 		if (!Result) {
@@ -354,7 +344,7 @@
 	}
 
 	// Sprite-Bild laden
-	if (DoesStringEndWith(FileName, PNG_EXTENSION) || DoesStringEndWith(FileName, B25S_EXTENSION)) {
+	if (FileName.hasSuffix(PNG_EXTENSION) || FileName.hasSuffix(B25S_EXTENSION)) {
 		bool Result;
 		BS_GLImage *pImage = new BS_GLImage(FileName, Result);
 		if (!Result) {
@@ -373,7 +363,7 @@
 
 
 	// Vectorgraphik laden
-	if (DoesStringEndWith(FileName, SWF_EXTENSION)) {
+	if (FileName.hasSuffix(SWF_EXTENSION)) {
 		// Pointer auf Package-Manager holen
 		BS_PackageManager *pPackage = BS_Kernel::GetInstance()->GetPackage();
 		BS_ASSERT(pPackage);
@@ -406,7 +396,7 @@
 	}
 
 	// Animation laden
-	if (DoesStringEndWith(FileName, ANI_EXTENSION)) {
+	if (FileName.hasSuffix(ANI_EXTENSION)) {
 		BS_AnimationResource *pResource = new BS_AnimationResource(FileName);
 		if (pResource->IsValid())
 			return pResource;
@@ -417,7 +407,7 @@
 	}
 
 	// Font laden
-	if (DoesStringEndWith(FileName, FNT_EXTENSION)) {
+	if (FileName.hasSuffix(FNT_EXTENSION)) {
 		BS_FontResource *pResource = new BS_FontResource(BS_Kernel::GetInstance(), FileName);
 		if (pResource->IsValid())
 			return pResource;
@@ -434,11 +424,11 @@
 // -----------------------------------------------------------------------------
 
 bool BS_OpenGLGfx::CanLoadResource(const Common::String &FileName) {
-	return DoesStringEndWith(FileName, PNG_EXTENSION) ||
-	       DoesStringEndWith(FileName, ANI_EXTENSION) ||
-	       DoesStringEndWith(FileName, FNT_EXTENSION) ||
-	       DoesStringEndWith(FileName, SWF_EXTENSION) ||
-	       DoesStringEndWith(FileName, B25S_EXTENSION);
+	return FileName.hasSuffix(PNG_EXTENSION) ||
+		FileName.hasSuffix(ANI_EXTENSION) ||
+		FileName.hasSuffix(FNT_EXTENSION) ||
+		FileName.hasSuffix(SWF_EXTENSION) ||
+		FileName.hasSuffix(B25S_EXTENSION);
 }
 
 

Modified: scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/opengl/openglgfx.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -84,7 +84,7 @@
 	virtual bool        GetVsync() const;
 
 	virtual bool        Fill(const BS_Rect *FillRectPtr = 0, unsigned int Color = BS_RGB(0, 0, 0));
-	virtual bool        GetScreenshot(unsigned int &Width, unsigned int &Height, Common::Array<unsigned int> & Data);
+	virtual bool        GetScreenshot(unsigned int &Width, unsigned int &Height, byte **Data);
 
 	// Resource-Managing Methoden
 	// --------------------------
@@ -112,7 +112,8 @@
 		DebugLine(const BS_Vertex &_Start, const BS_Vertex &_End, unsigned int _Color) :
 			Start(_Start),
 			End(_End),
-			Color(_Color) {};
+			Color(_Color) {}
+		DebugLine() {}
 
 		BS_Vertex       Start;
 		BS_Vertex       End;
@@ -121,9 +122,9 @@
 
 	Common::Array<DebugLine> m_DebugLines;
 
-	static bool ReadFramebufferContents(unsigned int Width, unsigned int Height, Common::Array<unsigned int> & Data);
-	static void ReverseRGBAComponentOrder(Common::Array<unsigned int> & Data);
-	static void FlipImagedataVertical(unsigned int Width, unsigned int Height, Common::Array<unsigned int> & Data);
+	static bool ReadFramebufferContents(unsigned int Width, unsigned int Height, byte **Data);
+	static void ReverseRGBAComponentOrder(byte *Data, uint size);
+	static void FlipImagedataVertical(unsigned int Width, unsigned int Height, byte *Data);
 };
 
 } // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/opengl/swimage.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -118,7 +118,7 @@
 
 // -----------------------------------------------------------------------------
 
-bool BS_SWImage::SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride) {
+	bool BS_SWImage::SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) {
 	BS_LOG_ERRORLN("SetContent() is not supported.");
 	return false;
 }

Modified: scummvm/trunk/engines/sword25/gfx/opengl/swimage.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/opengl/swimage.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/opengl/swimage.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -71,7 +71,7 @@
 	                  unsigned int Color = BS_ARGB(255, 255, 255, 255),
 	                  int Width = -1, int Height = -1);
 	virtual bool Fill(const BS_Rect *FillRectPtr, unsigned int Color);
-	virtual bool SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride);
+	virtual bool SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride);
 	virtual unsigned int GetPixel(int X, int Y);
 
 	virtual bool IsBlitSource() const               {

Modified: scummvm/trunk/engines/sword25/gfx/staticbitmap.cpp
===================================================================
--- scummvm/trunk/engines/sword25/gfx/staticbitmap.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/staticbitmap.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -152,7 +152,7 @@
 
 // -----------------------------------------------------------------------------
 
-bool BS_StaticBitmap::SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride) {
+bool BS_StaticBitmap::SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride) {
 	BS_LOG_ERRORLN("SetContent() ist not supported with this object.");
 	return false;
 }

Modified: scummvm/trunk/engines/sword25/gfx/staticbitmap.h
===================================================================
--- scummvm/trunk/engines/sword25/gfx/staticbitmap.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/gfx/staticbitmap.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -63,7 +63,7 @@
 
 	virtual unsigned int GetPixel(int X, int Y) const;
 
-	virtual bool    SetContent(const byte *Pixeldata, unsigned int Offset, unsigned int Stride);
+	virtual bool    SetContent(const byte *Pixeldata, uint size, unsigned int Offset, unsigned int Stride);
 
 	virtual bool    IsScalingAllowed() const;
 	virtual bool    IsAlphaAllowed() const;

Modified: scummvm/trunk/engines/sword25/input/inputengine_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/input/inputengine_script.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/input/inputengine_script.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -298,28 +298,28 @@
 static const char *PACKAGE_LIBRARY_NAME = "Input";
 
 static const luaL_reg PACKAGE_FUNCTIONS[] = {
-	"Init", Init,
-	"Update", Update,
-	"IsLeftMouseDown", IsLeftMouseDown,
-	"IsRightMouseDown", IsRightMouseDown,
-	"WasLeftMouseDown", WasLeftMouseDown,
-	"WasRightMouseDown", WasRightMouseDown,
-	"IsLeftDoubleClick", IsLeftDoubleClick,
-	"GetMouseX", GetMouseX,
-	"GetMouseY", GetMouseY,
-	"SetMouseX", SetMouseX,
-	"SetMouseY", SetMouseY,
-	"IsKeyDown", IsKeyDown,
-	"WasKeyDown", WasKeyDown,
-	"RegisterCharacterCallback", RegisterCharacterCallback,
-	"UnregisterCharacterCallback", UnregisterCharacterCallback,
-	"RegisterCommandCallback", RegisterCommandCallback,
-	"UnregisterCommandCallback", UnregisterCommandCallback,
-	0, 0,
+	{"Init", Init},
+	{"Update", Update},
+	{"IsLeftMouseDown", IsLeftMouseDown},
+	{"IsRightMouseDown", IsRightMouseDown},
+	{"WasLeftMouseDown", WasLeftMouseDown},
+	{"WasRightMouseDown", WasRightMouseDown},
+	{"IsLeftDoubleClick", IsLeftDoubleClick},
+	{"GetMouseX", GetMouseX},
+	{"GetMouseY", GetMouseY},
+	{"SetMouseX", SetMouseX},
+	{"SetMouseY", SetMouseY},
+	{"IsKeyDown", IsKeyDown},
+	{"WasKeyDown", WasKeyDown},
+	{"RegisterCharacterCallback", RegisterCharacterCallback},
+	{"UnregisterCharacterCallback", UnregisterCharacterCallback},
+	{"RegisterCommandCallback", RegisterCommandCallback},
+	{"UnregisterCommandCallback", UnregisterCommandCallback},
+	{0, 0}
 };
 
-#define X(k) "KEY_" #k, BS_InputEngine::KEY_##k
-#define Y(k) "KEY_COMMAND_" #k, BS_InputEngine::KEY_COMMAND_##k
+#define X(k) {"KEY_" #k, BS_InputEngine::KEY_##k}
+#define Y(k) {"KEY_COMMAND_" #k, BS_InputEngine::KEY_COMMAND_##k}
 static const lua_constant_reg PACKAGE_CONSTANTS[] = {
 	X(BACKSPACE), X(TAB), X(CLEAR), X(RETURN), X(PAUSE), X(CAPSLOCK), X(ESCAPE), X(SPACE), X(PAGEUP), X(PAGEDOWN), X(END), X(HOME), X(LEFT),
 	X(UP), X(RIGHT), X(DOWN), X(PRINTSCREEN), X(INSERT), X(DELETE), X(0), X(1), X(2), X(3), X(4), X(5), X(6), X(7), X(8), X(9), X(A), X(B),

Modified: scummvm/trunk/engines/sword25/kernel/kernel_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/kernel/kernel_script.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/kernel/kernel_script.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -234,26 +234,26 @@
 static const char *KERNEL_LIBRARY_NAME = "Kernel";
 
 static const luaL_reg KERNEL_FUNCTIONS[] = {
-	"DisconnectService", DisconnectService,
-	"GetActiveServiceIdentifier", GetActiveServiceIdentifier,
-	"GetSuperclassCount", GetSuperclassCount,
-	"GetSuperclassIdentifier", GetSuperclassIdentifier,
-	"GetServiceCount", GetServiceCount,
-	"GetServiceIdentifier", GetServiceIdentifier,
-	"GetMilliTicks", GetMilliTicks,
-	"GetTimer", GetTimer,
-	"StartService", StartService,
-	"Sleep", Sleep,
-	"Crash", Crash,
-	"ExecuteFile", ExecuteFile,
-	"GetUserdataDirectory", GetUserdataDirectory,
-	"GetPathSeparator", GetPathSeparator,
-	"FileExists", FileExists,
-	"CreateDirectory", CreateDirectory,
-	"GetWinCode", GetWinCode,
-	"GetSubversionRevision", GetSubversionRevision,
-	"GetUsedMemory", GetUsedMemory,
-	0, 0,
+	{"DisconnectService", DisconnectService},
+	{"GetActiveServiceIdentifier", GetActiveServiceIdentifier},
+	{"GetSuperclassCount", GetSuperclassCount},
+	{"GetSuperclassIdentifier", GetSuperclassIdentifier},
+	{"GetServiceCount", GetServiceCount},
+	{"GetServiceIdentifier", GetServiceIdentifier},
+	{"GetMilliTicks", GetMilliTicks},
+	{"GetTimer", GetTimer},
+	{"StartService", StartService},
+	{"Sleep", Sleep},
+	{"Crash", Crash},
+	{"ExecuteFile", ExecuteFile},
+	{"GetUserdataDirectory", GetUserdataDirectory},
+	{"GetPathSeparator", GetPathSeparator},
+	{"FileExists", FileExists},
+	{"CreateDirectory", CreateDirectory},
+	{"GetWinCode", GetWinCode},
+	{"GetSubversionRevision", GetSubversionRevision},
+	{"GetUsedMemory", GetUsedMemory},
+	{0, 0}
 };
 
 // -----------------------------------------------------------------------------
@@ -495,25 +495,25 @@
 static const char *WINDOW_LIBRARY_NAME = "Window";
 
 static const luaL_reg WINDOW_FUNCTIONS[] = {
-	"IsVisible", IsVisible,
-	"SetVisible", SetVisible,
-	"GetX", GetX,
-	"SetX", SetX,
-	"GetY", GetY,
-	"SetY", SetY,
-	"GetClientX", GetClientX,
-	"GetClientY", GetClientY,
-	"GetWidth", GetWidth,
-	"GetHeight", GetHeight,
-	"SetWidth", SetWidth,
-	"SetHeight", SetHeight,
-	"GetTitle", GetTitle,
-	"SetTitle", SetTitle,
-	"ProcessMessages", ProcessMessages,
-	"CloseWanted", CloseWanted,
-	"WaitForFocus", WaitForFocus,
-	"HasFocus", HasFocus,
-	0, 0,
+	{"IsVisible", IsVisible},
+	{"SetVisible", SetVisible},
+	{"GetX", GetX},
+	{"SetX", SetX},
+	{"GetY", GetY},
+	{"SetY", SetY},
+	{"GetClientX", GetClientX},
+	{"GetClientY", GetClientY},
+	{"GetWidth", GetWidth},
+	{"GetHeight", GetHeight},
+	{"SetWidth", SetWidth},
+	{"SetHeight", SetHeight},
+	{"GetTitle", GetTitle},
+	{"SetTitle", SetTitle},
+	{"ProcessMessages", ProcessMessages},
+	{"CloseWanted", CloseWanted},
+	{"WaitForFocus", WaitForFocus},
+	{"HasFocus", HasFocus},
+	{0, 0}
 };
 
 // -----------------------------------------------------------------------------
@@ -625,15 +625,15 @@
 static const char *RESOURCE_LIBRARY_NAME = "Resource";
 
 static const luaL_reg RESOURCE_FUNCTIONS[] = {
-	"PrecacheResource", PrecacheResource,
-	"ForcePrecacheResource", ForcePrecacheResource,
-	"GetMaxMemoryUsage", GetMaxMemoryUsage,
-	"SetMaxMemoryUsage", SetMaxMemoryUsage,
-	"EmptyCache", EmptyCache,
-	"IsLogCacheMiss", IsLogCacheMiss,
-	"SetLogCacheMiss", SetLogCacheMiss,
-	"DumpLockedResources", DumpLockedResources,
-	0, 0,
+	{"PrecacheResource", PrecacheResource},
+	{"ForcePrecacheResource", ForcePrecacheResource},
+	{"GetMaxMemoryUsage", GetMaxMemoryUsage},
+	{"SetMaxMemoryUsage", SetMaxMemoryUsage},
+	{"EmptyCache", EmptyCache},
+	{"IsLogCacheMiss", IsLogCacheMiss},
+	{"SetLogCacheMiss", SetLogCacheMiss},
+	{"DumpLockedResources", DumpLockedResources},
+	{0, 0}
 };
 
 // -----------------------------------------------------------------------------
@@ -708,16 +708,16 @@
 static const char *PERSISTENCE_LIBRARY_NAME = "Persistence";
 
 static const luaL_reg PERSISTENCE_FUNCTIONS[] = {
-	"ReloadSlots", ReloadSlots,
-	"GetSlotCount", GetSlotCount,
-	"IsSlotOccupied", IsSlotOccupied,
-	"GetSavegameDirectory", GetSavegameDirectory,
-	"IsSavegameCompatible", IsSavegameCompatible,
-	"GetSavegameDescription", GetSavegameDescription,
-	"GetSavegameFilename", GetSavegameFilename,
-	"LoadGame", LoadGame,
-	"SaveGame", SaveGame,
-	0, 0,
+	{"ReloadSlots", ReloadSlots},
+	{"GetSlotCount", GetSlotCount},
+	{"IsSlotOccupied", IsSlotOccupied},
+	{"GetSavegameDirectory", GetSavegameDirectory},
+	{"IsSavegameCompatible", IsSavegameCompatible},
+	{"GetSavegameDescription", GetSavegameDescription},
+	{"GetSavegameFilename", GetSavegameFilename},
+	{"LoadGame", LoadGame},
+	{"SaveGame", SaveGame},
+	{0, 0}
 };
 
 // -----------------------------------------------------------------------------

Modified: scummvm/trunk/engines/sword25/module.mk
===================================================================
--- scummvm/trunk/engines/sword25/module.mk	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/module.mk	2010-10-12 22:38:23 UTC (rev 53225)
@@ -31,6 +31,10 @@
 	gfx/image/pngloader.o \
 	gfx/image/vectorimage.o \
 	gfx/image/vectorimagerenderer.o \
+	gfx/opengl/glimage.o \
+	gfx/opengl/glvectorimageblit.o \
+	gfx/opengl/openglgfx.o \
+	gfx/opengl/swimage.o \
 	input/inputengine.o \
 	input/inputengine_script.o \
 	kernel/callbackregistry.o \
@@ -60,54 +64,48 @@
 	script/luacallback.o \
 	script/luascript.o \
 	script/lua_extensions.o \
-	sfx/fmodexchannel.o \
-	sfx/fmodexresource.o \
-	sfx/fmodexsound.o \
 	sfx/soundengine.o \
 	sfx/soundengine_script.o \
-	util/glsprites/internal/core.o \
-	util/glsprites/internal/glswindow.o \
-	util/glsprites/internal/sprite.o \
-	util/glsprites/internal/sprite_pow2.o \
-	util/glsprites/internal/sprite_rectangle.o \
-	util/glsprites/internal/sprite_tiled.o \
-	util/glsprites/internal/util.o \
-	util/lua/src/lapi.o \
-	util/lua/src/lauxlib.o \
-	util/lua/src/lbaselib.o \
-	util/lua/src/lcode.o \
-	util/lua/src/ldblib.o \
-	util/lua/src/ldebug.o \
-	util/lua/src/ldo.o \
-	util/lua/src/ldump.o \
-	util/lua/src/lfunc.o \
-	util/lua/src/lgc.o \
-	util/lua/src/linit.o \
-	util/lua/src/liolib.o \
-	util/lua/src/llex.o \
-	util/lua/src/lmathlib.o \
-	util/lua/src/lmem.o \
-	util/lua/src/loadlib.o \
-	util/lua/src/lobject.o \
-	util/lua/src/lopcodes.o \
-	util/lua/src/loslib.o \
-	util/lua/src/lparser.o \
-	util/lua/src/lstate.o \
-	util/lua/src/lstring.o \
-	util/lua/src/lstrlib.o \
-	util/lua/src/ltable.o \
-	util/lua/src/ltablib.o \
-	util/lua/src/ltm.o \
-	util/lua/src/lua.o \
-	util/lua/src/luac.o \
-	util/lua/src/lundump.o \
-	util/lua/src/lvm.o \
-	util/lua/src/lzio.o \
-	util/lua/src/print.o \
+	util/lua/lapi.o \
+	util/lua/lauxlib.o \
+	util/lua/lbaselib.o \
+	util/lua/lcode.o \
+	util/lua/ldblib.o \
+	util/lua/ldebug.o \
+	util/lua/ldo.o \
+	util/lua/ldump.o \
+	util/lua/lfunc.o \
+	util/lua/lgc.o \
+	util/lua/linit.o \
+	util/lua/liolib.o \
+	util/lua/llex.o \
+	util/lua/lmathlib.o \
+	util/lua/lmem.o \
+	util/lua/loadlib.o \
+	util/lua/lobject.o \
+	util/lua/lopcodes.o \
+	util/lua/loslib.o \
+	util/lua/lparser.o \
+	util/lua/lstate.o \
+	util/lua/lstring.o \
+	util/lua/lstrlib.o \
+	util/lua/ltable.o \
+	util/lua/ltablib.o \
+	util/lua/ltm.o \
+	util/lua/lua.o \
+	util/lua/luac.o \
+	util/lua/lundump.o \
+	util/lua/lvm.o \
+	util/lua/lzio.o \
+	util/lua/print.o \
 	util/pluto/pdep.o \
 	util/pluto/pluto.o \
 	util/pluto/plzio.o
 
+%.o: %.c
+	$(QUIET)$(MKDIR) $(*D)/$(DEPDIR)
+	$(QUIET_CXX)$(CXX) $(CXX_UPDATE_DEP_FLAG) $(CXXFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
+
 # This module can be built as a plugin
 ifeq ($(ENABLE_SWORD25), DYNAMIC_PLUGIN)
 PLUGIN := 1

Modified: scummvm/trunk/engines/sword25/package/packagemanager_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/package/packagemanager_script.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/package/packagemanager_script.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -217,18 +217,18 @@
 static const char *PACKAGE_LIBRARY_NAME = "Package";
 
 static const luaL_reg PACKAGE_FUNCTIONS[] = {
-	"LoadPackage", LoadPackage,
-	"LoadDirectoryAsPackage", LoadDirectoryAsPackage,
-	"GetCurrentDirectory", GetCurrentDirectory,
-	"ChangeDirectory", ChangeDirectory,
-	"GetAbsolutePath", GetAbsolutePath,
-	"GetFileSize", GetFileSize,
-	"GetFileType", GetFileType,
-	"FindFiles", FindFiles,
-	"FindDirectories", FindDirectories,
-	"GetFileAsString", GetFileAsString,
-	"FileExists", FileExists,
-	0, 0
+	{"LoadPackage", LoadPackage},
+	{"LoadDirectoryAsPackage", LoadDirectoryAsPackage},
+	{"GetCurrentDirectory", GetCurrentDirectory},
+	{"ChangeDirectory", ChangeDirectory},
+	{"GetAbsolutePath", GetAbsolutePath},
+	{"GetFileSize", GetFileSize},
+	{"GetFileType", GetFileType},
+	{"FindFiles", FindFiles},
+	{"FindDirectories", FindDirectories},
+	{"GetFileAsString", GetFileAsString},
+	{"FileExists", FileExists},
+	{0, 0}
 };
 
 // -----------------------------------------------------------------------------

Modified: scummvm/trunk/engines/sword25/sfx/soundengine.cpp
===================================================================
--- scummvm/trunk/engines/sword25/sfx/soundengine.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/sfx/soundengine.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -34,17 +34,15 @@
 
 #define BS_LOG_PREFIX "SOUNDENGINE"
 
-// -----------------------------------------------------------------------------
-// Includes
-// -----------------------------------------------------------------------------
-
 #include "sword25/sfx/soundengine.h"
 
-// -----------------------------------------------------------------------------
+namespace Sword25 {
 
 BS_SoundEngine::BS_SoundEngine(BS_Kernel *pKernel) : BS_ResourceService(pKernel) {
 	if (!_RegisterScriptBindings())
 		BS_LOG_ERRORLN("Script bindings could not be registered.");
 	else
 		BS_LOGLN("Script bindings registered.");
-}
\ No newline at end of file
+}
+
+} // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/sfx/soundengine_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/sfx/soundengine_script.cpp	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/sfx/soundengine_script.cpp	2010-10-12 22:38:23 UTC (rev 53225)
@@ -43,6 +43,7 @@
 
 #include "sword25/sfx/soundengine.h"
 
+namespace Sword25 {
 // -----------------------------------------------------------------------------
 
 static int Init(lua_State *L) {
@@ -155,7 +156,7 @@
 
 // -----------------------------------------------------------------------------
 
-static void ProcessPlayParams(lua_State *L, std::string &FileName, BS_SoundEngine::SOUND_TYPES &Type, float &Volume, float &Pan, bool &Loop, int &LoopStart, int &LoopEnd, unsigned int &Layer) {
+static void ProcessPlayParams(lua_State *L, Common::String &FileName, BS_SoundEngine::SOUND_TYPES &Type, float &Volume, float &Pan, bool &Loop, int &LoopStart, int &LoopEnd, unsigned int &Layer) {
 	FileName = luaL_checkstring(L, 1);
 
 	Type = static_cast<BS_SoundEngine::SOUND_TYPES>(static_cast<unsigned int>(luaL_checknumber(L, 2)));
@@ -185,7 +186,7 @@
 	BS_SoundEngine *pSfx = static_cast<BS_SoundEngine *>(BS_Kernel::GetInstance()->GetService("sfx"));
 	BS_ASSERT(pSfx);
 
-	std::string FileName;
+	Common::String FileName;
 	BS_SoundEngine::SOUND_TYPES Type;
 	float Volume;
 	float Pan;
@@ -206,7 +207,7 @@
 	BS_SoundEngine *pSfx = static_cast<BS_SoundEngine *>(BS_Kernel::GetInstance()->GetService("sfx"));
 	BS_ASSERT(pSfx);
 
-	std::string FileName;
+	Common::String FileName;
 	BS_SoundEngine::SOUND_TYPES Type;
 	float Volume;
 	float Pan;
@@ -343,33 +344,33 @@
 static const char *SFX_LIBRARY_NAME = "Sfx";
 
 static const luaL_reg SFX_FUNCTIONS[] = {
-	"Init", Init,
-	"Update", Update,
-	"__SetVolume", SetVolume,
-	"__GetVolume", GetVolume,
-	"PauseAll", PauseAll,
-	"ResumeAll", ResumeAll,
-	"PauseLayer", PauseLayer,
-	"ResumeLayer", ResumeLayer,
-	"__PlaySound", PlaySound,
-	"__PlaySoundEx", PlaySoundEx,
-	"__SetSoundVolume", SetSoundVolume,
-	"__SetSoundPanning", SetSoundPanning,
-	"__PauseSound", PauseSound,
-	"__ResumeSound", ResumeSound,
-	"__StopSound", StopSound,
-	"__IsSoundPaused", IsSoundPaused,
-	"__IsSoundPlaying", IsSoundPlaying,
-	"__GetSoundVolume", GetSoundVolume,
-	"__GetSoundPanning", GetSoundPanning,
-	0, 0,
+	{"Init", Init},
+	{"Update", Update},
+	{"__SetVolume", SetVolume},
+	{"__GetVolume", GetVolume},
+	{"PauseAll", PauseAll},
+	{"ResumeAll", ResumeAll},
+	{"PauseLayer", PauseLayer},
+	{"ResumeLayer", ResumeLayer},
+	{"__PlaySound", PlaySound},
+	{"__PlaySoundEx", PlaySoundEx},
+	{"__SetSoundVolume", SetSoundVolume},
+	{"__SetSoundPanning", SetSoundPanning},
+	{"__PauseSound", PauseSound},
+	{"__ResumeSound", ResumeSound},
+	{"__StopSound", StopSound},
+	{"__IsSoundPaused", IsSoundPaused},
+	{"__IsSoundPlaying", IsSoundPlaying},
+	{"__GetSoundVolume", GetSoundVolume},
+	{"__GetSoundPanning", GetSoundPanning},
+	{0, 0}
 };
 
 static const lua_constant_reg SFX_CONSTANTS[] = {
-	"MUSIC", BS_SoundEngine::MUSIC,
-	"SPEECH", BS_SoundEngine::SPEECH,
-	"SFX", BS_SoundEngine::SFX,
-	0, 0,
+	{"MUSIC", BS_SoundEngine::MUSIC},
+	{"SPEECH", BS_SoundEngine::SPEECH},
+	{"SFX", BS_SoundEngine::SFX},
+	{0, 0}
 };
 
 // -----------------------------------------------------------------------------
@@ -387,3 +388,5 @@
 
 	return true;
 }
+
+} // End of namespace Sword25

Modified: scummvm/trunk/engines/sword25/util/lua/luaconf.h
===================================================================
--- scummvm/trunk/engines/sword25/util/lua/luaconf.h	2010-10-12 22:37:13 UTC (rev 53224)
+++ scummvm/trunk/engines/sword25/util/lua/luaconf.h	2010-10-12 22:38:23 UTC (rev 53225)
@@ -603,7 +603,7 @@
 ** compiling as C++ code, with _longjmp/_setjmp when asked to use them,
 ** and with longjmp/setjmp otherwise.
 */
-#if defined(__cplusplus)
+#if 0  /* defined(__cplusplus) */
 /* C++ exceptions */
 #define LUAI_THROW(L,c)	throw(c)
 #define LUAI_TRY(L,c,a)	try { a } catch(...) \


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