Removed a global variable
[supertux.git] / contrib / supertux-nogl.diff
index d4f01c6..93e4773 100644 (file)
 #
 #  patch -p1 < contrib/supertux-nogl.diff
 #
+#  This patch works for revision 3321. It may break for later revisions.
+#
 # -----------------------------------------------------------------------------
-diff -Naur -x .svn -x build -x doxygen supertux/INSTALL supertux-nogl/INSTALL
+diff -Naur supertux/INSTALL supertux-nogl/INSTALL
 --- supertux/INSTALL   2006-03-03 21:49:07.000000000 +0100
 +++ supertux-nogl/INSTALL      2006-04-07 04:13:00.000000000 +0200
 @@ -1,7 +1,7 @@
@@ -66,7 +68,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/INSTALL supertux-nogl/INSTALL
  * PhysicsFS (1.0.0, the development branch 1.1.x is buggy and does not work,
               1.2.0 and later should work when it is released)
      http://www.icculus.org/physfs
-diff -Naur -x .svn -x build -x doxygen supertux/README supertux-nogl/README
+diff -Naur supertux/README supertux-nogl/README
 --- supertux/README    2006-03-03 20:43:38.000000000 +0100
 +++ supertux-nogl/README       2006-04-07 04:13:00.000000000 +0200
 @@ -2,7 +2,7 @@
@@ -92,7 +94,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/README supertux-nogl/README
  
  
  PLAYING THE GAME
-diff -Naur -x .svn -x build -x doxygen supertux/configure.ac supertux-nogl/configure.ac
+diff -Naur supertux/configure.ac supertux-nogl/configure.ac
 --- supertux/configure.ac      2006-03-03 20:43:38.000000000 +0100
 +++ supertux-nogl/configure.ac 2006-04-07 04:13:00.000000000 +0200
 @@ -11,7 +11,7 @@
@@ -104,7 +106,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/configure.ac supertux-nogl/confi
  AC_CONFIG_SRCDIR([src/main.cpp])
  AC_CONFIG_AUX_DIR([mk/autoconf])
  AC_CANONICAL_TARGET
-@@ -105,6 +105,14 @@
+@@ -112,6 +105,14 @@
          [AC_MSG_ERROR([Please install SDLImage >= 1.2.1])],
          [$SDL_CFLAGS], [$SDL_LIBS])
  
@@ -119,7 +121,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/configure.ac supertux-nogl/confi
  NP_FINDLIB([PHYSFS], [physfs], [physfs >= 1.0.0],
          NP_LANG_PROGRAM([
  #include <stdio.h>
-@@ -124,11 +132,6 @@
+@@ -131,11 +132,6 @@
           [AC_MSG_ERROR([Please intall OpenAL])],
           [], [])
  
@@ -131,7 +133,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/configure.ac supertux-nogl/confi
  dnl Checks for library functions.
  AC_CHECK_FUNCS(mkdir strdup strstr)
  
-diff -Naur -x .svn -x build -x doxygen supertux/src/Jamfile supertux-nogl/src/Jamfile
+diff -Naur supertux/src/Jamfile supertux-nogl/src/Jamfile
 --- supertux/src/Jamfile       2006-03-03 20:34:49.000000000 +0100
 +++ supertux-nogl/src/Jamfile  2006-04-07 04:11:50.000000000 +0200
 @@ -24,7 +24,7 @@
@@ -143,18 +145,18 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/Jamfile supertux-nogl/src/Ja
  Help supertux : "Build the supertux executable" ;
  IncludeDir supertux : squirrel/include ;
  
-diff -Naur -x .svn -x build -x doxygen supertux/src/main.cpp supertux-nogl/src/main.cpp
+diff -Naur supertux/src/main.cpp supertux-nogl/src/main.cpp
 --- supertux/src/main.cpp      2006-04-07 03:32:14.000000000 +0200
 +++ supertux-nogl/src/main.cpp 2006-04-07 04:11:50.000000000 +0200
 @@ -35,7 +35,6 @@
  #include <physfs.h>
  #include <SDL.h>
  #include <SDL_image.h>
--#include <SDL_opengl.h>
+-#include <GL/gl.h>
  
  #include "gameconfig.hpp"
  #include "resources.hpp"
-@@ -266,44 +265,6 @@
+@@ -269,46 +265,6 @@
        ;
  }
  
@@ -183,9 +185,11 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/main.cpp supertux-nogl/src/m
 -      case GL_OUT_OF_MEMORY:
 -        errormsg = "out of memory";
 -        break;
+-#ifdef GL_TABLE_TOO_LARGE
 -      case GL_TABLE_TOO_LARGE:
 -        errormsg = "table too large";
 -        break;
+-#endif
 -      default:
 -        errormsg = "unknown error number";
 -        break;
@@ -199,7 +203,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/main.cpp supertux-nogl/src/m
  void init_video()
  {
    if(texture_manager != NULL)
-@@ -314,7 +275,7 @@
+@@ -317,7 +275,7 @@
    SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
    SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);
    
@@ -208,7 +212,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/main.cpp supertux-nogl/src/m
    if(config->use_fullscreen)
      flags |= SDL_FULLSCREEN;
    int width = config->screenwidth;
-@@ -344,24 +305,6 @@
+@@ -347,24 +305,6 @@
    }
  #endif
  
@@ -233,19 +237,18 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/main.cpp supertux-nogl/src/m
    if(texture_manager != NULL)
      texture_manager->reload_textures();
    else
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp supertux-nogl/src/video/drawing_context.cpp
+diff -Naur supertux/src/video/drawing_context.cpp supertux-nogl/src/video/drawing_context.cpp
 --- supertux/src/video/drawing_context.cpp     2006-03-31 04:18:01.000000000 +0200
 +++ supertux-nogl/src/video/drawing_context.cpp        2006-04-07 04:11:49.000000000 +0200
-@@ -22,8 +22,6 @@
+@@ -22,7 +22,6 @@
  #include <cassert>
  #include <iostream>
  #include <SDL_image.h>
 -#include <GL/gl.h>
--#include <GL/glu.h>
  
  #include "drawing_context.hpp"
  #include "surface.hpp"
-@@ -49,30 +47,20 @@
+@@ -48,30 +47,20 @@
  {
    screen = SDL_GetVideoSurface();
  
@@ -279,7 +282,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
    assert(surface != 0);
    
    DrawingRequest request;
-@@ -97,6 +85,8 @@
+@@ -96,6 +85,8 @@
  DrawingContext::draw_surface_part(const Surface* surface, const Vector& source,
      const Vector& size, const Vector& dest, int layer)
  {
@@ -288,7 +291,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
    assert(surface != 0);
  
    DrawingRequest request;
-@@ -136,6 +126,8 @@
+@@ -135,6 +126,8 @@
  DrawingContext::draw_text(const Font* font, const std::string& text,
      const Vector& position, FontAlignment alignment, int layer)
  {
@@ -297,7 +300,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
    DrawingRequest request;
  
    request.type = TEXT;
-@@ -157,6 +149,8 @@
+@@ -156,6 +149,8 @@
  DrawingContext::draw_center_text(const Font* font, const std::string& text,
      const Vector& position, int layer)
  {
@@ -306,7 +309,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
    draw_text(font, text, Vector(position.x + SCREEN_WIDTH/2, position.y),
        CENTER_ALLIGN, layer);
  }
-@@ -164,6 +158,8 @@
+@@ -163,6 +158,8 @@
  void
  DrawingContext::draw_gradient(const Color& top, const Color& bottom, int layer)
  {
@@ -315,7 +318,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
    DrawingRequest request;
  
    request.type = GRADIENT;
-@@ -185,6 +181,8 @@
+@@ -184,6 +181,8 @@
  DrawingContext::draw_filled_rect(const Vector& topleft, const Vector& size,
                                   const Color& color, int layer)
  {
@@ -324,7 +327,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
    DrawingRequest request;
  
    request.type = FILLRECT;
-@@ -218,23 +216,55 @@
+@@ -217,23 +216,55 @@
    delete surfacepartrequest;
  }
  
@@ -391,7 +394,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
  
    delete gradientrequest;
  }
-@@ -260,17 +290,12 @@
+@@ -259,17 +290,12 @@
    float w = fillrectrequest->size.x;
    float h = fillrectrequest->size.y;
  
@@ -415,7 +418,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
  
    delete fillrectrequest;
  }
-@@ -285,66 +310,10 @@
+@@ -284,66 +310,10 @@
    transformstack.clear();
    target_stack.clear();
  
@@ -483,7 +486,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
  }
  
  void
-@@ -433,9 +402,5 @@
+@@ -432,9 +402,5 @@
  DrawingContext::set_target(Target target)
  {
    this->target = target;
@@ -493,7 +496,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.cpp su
 -    requests = &drawing_requests;
  }
  
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.hpp supertux-nogl/src/video/drawing_context.hpp
+diff -Naur supertux/src/video/drawing_context.hpp supertux-nogl/src/video/drawing_context.hpp
 --- supertux/src/video/drawing_context.hpp     2006-03-03 20:34:27.000000000 +0100
 +++ supertux-nogl/src/video/drawing_context.hpp        2006-04-07 04:11:49.000000000 +0200
 @@ -23,7 +23,6 @@
@@ -532,10 +535,10 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/drawing_context.hpp su
  };
  
  #endif
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/glutil.hpp supertux-nogl/src/video/glutil.hpp
+diff -Naur supertux/src/video/glutil.hpp supertux-nogl/src/video/glutil.hpp
 --- supertux/src/video/glutil.hpp      2006-03-21 16:13:11.000000000 +0100
 +++ supertux-nogl/src/video/glutil.hpp 2006-04-07 04:11:49.000000000 +0200
-@@ -21,45 +21,13 @@
+@@ -21,45 +21,14 @@
  
  #include <sstream>
  #include <stdexcept>
@@ -579,6 +582,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/glutil.hpp supertux-no
 -#endif
 -}
 +#define GLenum int
++#define GLint int
 +#define GL_SRC_ALPHA 0
 +#define GL_ONE_MINUS_SRC_ALPHA 1
 +#define GL_RGBA 2
@@ -587,7 +591,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/glutil.hpp supertux-no
  
  #endif
  
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/screen.cpp supertux-nogl/src/video/screen.cpp
+diff -Naur supertux/src/video/screen.cpp supertux-nogl/src/video/screen.cpp
 --- supertux/src/video/screen.cpp      2006-04-07 03:32:13.000000000 +0200
 +++ supertux-nogl/src/video/screen.cpp 2006-04-07 04:11:49.000000000 +0200
 @@ -38,61 +38,70 @@
@@ -719,7 +723,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/screen.cpp supertux-no
    }
  }
 -
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/screen.hpp supertux-nogl/src/video/screen.hpp
+diff -Naur supertux/src/video/screen.hpp supertux-nogl/src/video/screen.hpp
 --- supertux/src/video/screen.hpp      2006-04-07 03:32:13.000000000 +0200
 +++ supertux-nogl/src/video/screen.hpp 2006-04-07 04:11:49.000000000 +0200
 @@ -20,7 +20,6 @@
@@ -730,7 +734,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/screen.hpp supertux-no
  #include <iostream>
  
  #include <vector>
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/surface.cpp supertux-nogl/src/video/surface.cpp
+diff -Naur supertux/src/video/surface.cpp supertux-nogl/src/video/surface.cpp
 --- supertux/src/video/surface.cpp     2006-03-25 01:16:31.000000000 +0100
 +++ supertux-nogl/src/video/surface.cpp        2006-04-07 04:11:49.000000000 +0200
 @@ -28,6 +29,7 @@
@@ -945,7 +949,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/surface.cpp supertux-n
 +  SDL_BlitSurface(transformedSurface, &srcRect, screen, &dstRect);
  }
  
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/surface.hpp supertux-nogl/src/video/surface.hpp
+diff -Naur supertux/src/video/surface.hpp supertux-nogl/src/video/surface.hpp
 --- supertux/src/video/surface.hpp     2006-03-03 20:34:27.000000000 +0100
 +++ supertux-nogl/src/video/surface.hpp        2006-04-07 04:11:49.000000000 +0200
 @@ -20,7 +20,9 @@
@@ -1004,7 +1008,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/surface.hpp supertux-n
  public:
    Surface(const std::string& file);
    Surface(const std::string& file, int x, int y, int w, int h);
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture.cpp supertux-nogl/src/video/texture.cpp
+diff -Naur supertux/src/video/texture.cpp supertux-nogl/src/video/texture.cpp
 --- supertux/src/video/texture.cpp     2006-03-03 20:34:27.000000000 +0100
 +++ supertux-nogl/src/video/texture.cpp        2006-04-07 04:11:49.000000000 +0200
 @@ -20,7 +20,6 @@
@@ -1103,7 +1107,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture.cpp supertux-n
 -  assert_gl("set texture params");
  }
  
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture.hpp supertux-nogl/src/video/texture.hpp
+diff -Naur supertux/src/video/texture.hpp supertux-nogl/src/video/texture.hpp
 --- supertux/src/video/texture.hpp     2006-03-03 20:34:27.000000000 +0100
 +++ supertux-nogl/src/video/texture.hpp        2006-04-07 04:11:49.000000000 +0200
 @@ -20,7 +20,7 @@
@@ -1153,7 +1157,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture.hpp supertux-n
  private:
    void set_texture_params();
  };
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture_manager.cpp supertux-nogl/src/video/texture_manager.cpp
+diff -Naur supertux/src/video/texture_manager.cpp supertux-nogl/src/video/texture_manager.cpp
 --- supertux/src/video/texture_manager.cpp     2006-04-07 03:32:13.000000000 +0200
 +++ supertux-nogl/src/video/texture_manager.cpp        2006-04-07 04:11:49.000000000 +0200
 @@ -5,8 +5,6 @@
@@ -1209,7 +1213,7 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture_manager.cpp su
 -  glDeleteTextures(1, &(texture->handle));
 -  texture->handle = 0;
 -
--  assert_gl("retrieving texture");
+-  assert_gl("retrieving texture for save");
  }
  
  void
@@ -1254,14 +1258,15 @@ diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture_manager.cpp su
    saved_textures.clear();
  }
  
-diff -Naur -x .svn -x build -x doxygen supertux/src/video/texture_manager.hpp supertux-nogl/src/video/texture_manager.hpp
+diff -Naur supertux/src/video/texture_manager.hpp supertux-nogl/src/video/texture_manager.hpp
 --- supertux/src/video/texture_manager.hpp     2006-03-03 20:34:27.000000000 +0100
 +++ supertux-nogl/src/video/texture_manager.hpp        2006-04-07 04:11:49.000000000 +0200
-@@ -1,7 +1,6 @@
+@@ -1,7 +1,7 @@
  #ifndef __IMAGE_TEXTURE_MANAGER_HPP__
  #define __IMAGE_TEXTURE_MANAGER_HPP__
  
 -#include <GL/gl.h>
++#include "video/glutil.hpp"
  #include <string>
  #include <vector>
  #include <map>