[xmoto-dev] [patch] make sdl_gfx compile again

[ Thread Index | Date Index | More lists.tuxfamily.org/xmoto-dev Archives ]


Hi

Here is a small patch to make the SDL_gfx port compiling again. The feature
that is missing most is currently the text rendering.

greetings


P.S. I was very pleased to see the PSP port . is that going to be merged in svn?
Index: src/PolyDraw.cpp
===================================================================
--- src/PolyDraw.cpp	(revision 2732)
+++ src/PolyDraw.cpp	(working copy)
@@ -24,6 +24,7 @@
 
 #include <string.h>
 
+#include "include/xm_SDL.h"
 #include "PolyDraw.h"
 
 #if defined(MIN)
Index: src/drawlib/DrawLibSDLgfx.h
===================================================================
--- src/drawlib/DrawLibSDLgfx.h	(revision 2732)
+++ src/drawlib/DrawLibSDLgfx.h	(working copy)
@@ -22,6 +22,9 @@
 #define __DRAWLIBSDLGFX_H__
 
 #include "DrawLib.h"
+#include <vector>
+#include <map>
+
 class PolyDraw;
 
 class DrawLibSDLgfx:public DrawLib {
Index: src/drawlib/DrawLibSDLgfx.cpp
===================================================================
--- src/drawlib/DrawLibSDLgfx.cpp	(revision 2732)
+++ src/drawlib/DrawLibSDLgfx.cpp	(working copy)
@@ -28,6 +28,7 @@
 
 #ifdef ENABLE_SDLGFX
 #include "PolyDraw.h"
+#include "VFileIO.h"
 #include "SDL_gfxPrimitives.h"
 #include "SDL_rotozoom.h"
 #include "iqsort.h"
Index: src/Renderer.cpp
===================================================================
--- src/Renderer.cpp	(revision 2732)
+++ src/Renderer.cpp	(working copy)
@@ -2127,6 +2127,7 @@
 void GameRenderer::_RenderBlockEdges(Block* pBlock)
 {
   DrawLib* pDrawlib = GameApp::instance()->getDrawLib();
+#ifdef ENABLE_OPENGL
   if(pDrawlib->getBackend() == DrawLib::backend_OpenGl) {
     for(unsigned int i=0; i<pBlock->getEdgeGeoms().size(); i++){
       int geom = pBlock->getEdgeGeoms()[i];
@@ -2158,6 +2159,7 @@
   } else if(pDrawlib->getBackend() == DrawLib::backend_SdlGFX){
     // SDLGFX::TODO
   }
+#endif /* ENABLE_OPENGL */
 }
 
   /*===========================================================================
Index: src/VFileIO.cpp
===================================================================
--- src/VFileIO.cpp	(revision 2732)
+++ src/VFileIO.cpp	(working copy)
@@ -1133,7 +1133,7 @@
   /* Initialize binary data package if any */
   FILE *fp = fopen(m_BinDataFile.c_str(),"rb");
   if(fp == NULL) {
-    throw Exception("Package " + i_binFile + " not found !");
+    throw Exception("Package " + i_binFile + " ( file " + m_BinDataFile +  " ) not found !");
   }
 
   char cBuf[256];


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/