# HG changeset patch # User Tero Marttila # Date 1232590193 -7200 # Node ID f337a86d144e9133bc9f83349c2cc8ea68fb2074 # Parent 947ab54de4b7a9b2189cb9c46ffad0183012ad98 fix GRAPHICS_ENABLED configuration... probably broken again if the includes aren't there diff -r 947ab54de4b7 -r f337a86d144e src/Engine.cc --- a/src/Engine.cc Thu Jan 22 03:53:17 2009 +0200 +++ b/src/Engine.cc Thu Jan 22 04:09:53 2009 +0200 @@ -178,8 +178,10 @@ } void Engine::run (void) { +#if NETWORK_ENABLED // timeout for NetworkReactor timeval timeout; +#endif while (is_running) { /* diff -r 947ab54de4b7 -r f337a86d144e src/Graphics/Drawable.hh --- a/src/Graphics/Drawable.hh Thu Jan 22 03:53:17 2009 +0200 +++ b/src/Graphics/Drawable.hh Thu Jan 22 04:09:53 2009 +0200 @@ -1,6 +1,5 @@ -// XXX: because this is included from .. -#if GRAPHICS_ENABLED && !(defined GRAPHICS_DRAWABLE_HH) +#ifndef GRAPHICS_DRAWABLE_HH #define GRAPHICS_DRAWABLE_HH namespace graphics diff -r 947ab54de4b7 -r f337a86d144e src/Graphics/Graphics.hh --- a/src/Graphics/Graphics.hh Thu Jan 22 03:53:17 2009 +0200 +++ b/src/Graphics/Graphics.hh Thu Jan 22 04:09:53 2009 +0200 @@ -1,5 +1,5 @@ -// XXX: ugly hack -#if GRAPHICS_ENABLED && !(defined GRAPHICS_GRAPHICS_HH) + +#ifndef GRAPHICS_GRAPHICS_HH #define GRAPHICS_GRAPHICS_HH namespace graphics diff -r 947ab54de4b7 -r f337a86d144e src/Terrain.hh --- a/src/Terrain.hh Thu Jan 22 03:53:17 2009 +0200 +++ b/src/Terrain.hh Thu Jan 22 04:09:53 2009 +0200 @@ -8,6 +8,11 @@ #include +#if GRAPHICS_ENABLED + #include "Graphics/Drawable.hh" + +#endif + /** * Different types of terrain available */ @@ -43,12 +48,11 @@ #if GRAPHICS_ENABLED /** We pre-render the textured terrain data for display */ CL_PixelBuffer pixbuf; - + + /** Generated texture pattern */ + std::vector > texture; #endif - // XXX: terrain texture - std::vector > texture; - public: /** * Construct a new terrain based on the given configuration @@ -105,6 +109,7 @@ */ void generatePixelBuffer (void); +#if GRAPHICS_ENABLED /** * Generates an area of random texture using a fractal-based algorithm, this can then be applied to the terrain * pixels using noisifyPixel @@ -116,6 +121,7 @@ * at \a pc. */ Color getTexturePixel (PixelDimension x, PixelDimension y); +#endif /** * Scale parameter to "pixels" diff -r 947ab54de4b7 -r f337a86d144e src/Vector.hh --- a/src/Vector.hh Thu Jan 22 03:53:17 2009 +0200 +++ b/src/Vector.hh Thu Jan 22 04:09:53 2009 +0200 @@ -208,8 +208,8 @@ * Float/int absolute value */ template static T absType (T value); -template<> float absType (float value) { return (float) fabs(value); } -template<> long absType (long value) { return labs(value); } +template<> static float absType (float value) { return (float) fabs(value); } +template<> static long absType (long value) { return labs(value); } /** * Direction-normalize the given coordinate against the tangent coordinate.