AC_SUBST([ICONV_LIBS], [$LIBICONV])
dnl ===========================================================================
-dnl Check for OpenGL
-AX_CHECK_GL
-if test "$no_gl" = "yes"; then
- AC_MSG_ERROR([Please install opengl libraries and headers])
-fi
-
dnl Check for SDL
SDL_VERSION=1.2.4
AM_PATH_SDL($SDL_VERSION,
[AC_MSG_ERROR([Please intall OpenAL])],
[], [])
+AX_CHECK_GL
+if test "$no_gl" = "yes"; then
+ AC_MSG_ERROR([Please install opengl libraries and headers])
+fi
+AX_CHECK_GLU
+if test "$no_glu" = "yes"; then
+ AC_MSG_ERROR([Please install opengl utility libraries and headers])
+fi
+
dnl Checks for library functions.
AC_CHECK_FUNCS(mkdir strdup strstr)
(images "powerups/potions/blue-potion.png")
)
)
+
+ (sprite
+ (name "lightmap_light")
+ (action
+ (name "default")
+ (images "effects/light_red.png")
+ )
+ )
(sprite
(name "eat-me")
(name "default")
(images "objects/keys/key_gold.png")
)
- (action
+ (action
(name "display")
(images "objects/keys/display_gold.png")
)
(images "objects/keys/outline_gold.png")
)
)
+ (sprite
+ (name "leveldot")
+ (action
+ (name "default")
+ (x-offset 16)
+ (y-offset 16)
+ (images "worldmap/common/leveldot_red.png")
+ )
+ (action
+ (name "solved")
+ (x-offset 16)
+ (y-offset 16)
+ (images "worldmap/common/leveldot_green.png")
+ )
+ )
)
--- /dev/null
+;SuperTux level made using the built-in leveleditor
+(supertux-level
+ (version 1)
+ (name "One Block Fall-through / Spikes")
+ (author "")
+ (music "chipdisko.ogg")
+ (background "arctis.jpg")
+ (particle_system "")
+ (bkgd_speed 50)
+ (bkgd_red_top 50)
+ (bkgd_green_top 150)
+ (bkgd_blue_top 150)
+ (bkgd_red_bottom 150)
+ (bkgd_green_bottom 150)
+ (bkgd_blue_bottom 150)
+ (time 500)
+ (width 150)
+ (height 15)
+ (back_scrolling #f)
+ (hor_autoscroll_speed 0.0)
+ (gravity 10.0)
+ (background-tm 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14 14
+ 11 11 11 11 11 11 11 11 11 12 200 200 200 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11
+ 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11
+)
+ (foreground-tm 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+)
+(reset-points
+)
+(objects
+ (light )
+ (mriceblock (x 666) (y 68) (stay-on-platform #f))
+ (mriceblock (x 892) (y 70) (stay-on-platform #f))
+ (mriceblock (x 1146) (y 69) (stay-on-platform #f))
+ (mriceblock (x 1363) (y 58) (stay-on-platform #f))
+ (mriceblock (x 1180) (y 15) (stay-on-platform #f))
+ (mriceblock (x 939) (y 22) (stay-on-platform #f))
+ (mriceblock (x 703) (y 25) (stay-on-platform #f))
+ (stalactite (x 322) (y 287) (stay-on-platform #f))
+)
+)
(powerup
(sprite "red-potion")
(script "
-function wait(time) {
- set_wakeup_time(time);
- suspend();
-}
-
DisplayEffect.set_black(true);
wait(0.1);
DisplayEffect.set_black(false);
Application supertux : $(sources) $(wrapper_objects) ;
C++Flags supertux : -DAPPDATADIR='\"$(appdatadir)\"' ;
LinkWith supertux : squirrel ;
-ExternalLibs supertux : SDL SDLIMAGE GL OPENAL VORBIS VORBISFILE OGG ICONV PHYSFS BINRELOC ;
+ExternalLibs supertux : SDL SDLIMAGE GL GLU OPENAL VORBIS VORBISFILE OGG ICONV PHYSFS BINRELOC ;
Help supertux : "Build the supertux executable" ;
IncludeDir supertux : squirrel/include ;
(event.key.keysym.unicode & 0xFF80) == 0) {
memmove(last_keys, last_keys+1, sizeof(last_keys)-1);
last_keys[sizeof(last_keys)-1] = event.key.keysym.unicode;
- if(GameSession::current())
+ if(GameSession::current() != NULL)
GameSession::current()->try_cheats();
}
delete end_sequence_controller;
delete level;
delete context;
+
+ current_ = NULL;
}
void
void save();
/** screen width in pixel (warning: this is the real screen width+height,
- * supertux is using a logical width+height and not this one)
+ * you should use the logical SCREEN_WIDTH and SCREEN_HEIGHT for your
+ * rendering code.)
*/
int screenwidth;
int screenheight;
--- /dev/null
+#include <config.h>
+
+#include "light.hpp"
+#include "sprite/sprite_manager.hpp"
+#include "resources.hpp"
+#include "video/drawing_context.hpp"
+#include "object_factory.hpp"
+#include "player.hpp"
+#include "sector.hpp"
+
+Light::Light(const lisp::Lisp& )
+{
+ sprite = sprite_manager->create("lightmap_light");
+}
+
+Light::~Light()
+{
+ delete sprite;
+}
+
+void
+Light::update(float )
+{
+}
+
+void
+Light::draw(DrawingContext& context)
+{
+ context.push_target();
+ context.set_target(DrawingContext::LIGHTMAP);
+
+ sprite->draw(context, Sector::current()->player->get_pos(), 0);
+
+ context.pop_target();
+}
+
+IMPLEMENT_FACTORY(Light, "light");
--- /dev/null
+// $Id$
+//
+// SuperTux - A Jump'n Run
+// Copyright (C) 2004 Matthias Braun <matze@braunis.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#ifndef __LIGHT_HPP__
+#define __LIGHT_HPP__
+
+#include "game_object.hpp"
+#include "lisp/lisp.hpp"
+
+class Sprite;
+
+class Light : public GameObject
+{
+public:
+ Light(const lisp::Lisp& reader);
+ virtual ~Light();
+
+ void update(float elapsed_time);
+ void draw(DrawingContext& context);
+
+private:
+ Sprite* sprite;
+};
+
+#endif
+
#include "trigger/trigger_base.hpp"
#include "control/joystickkeyboardcontroller.hpp"
#include "main.hpp"
+#include "player_status.hpp"
static const int TILES_FOR_BUTTJUMP = 3;
static const float SHOOTING_TIME = .150;
#include "sprite/sprite.hpp"
#include "physic.hpp"
#include "control/controller.hpp"
-#include "player_status.hpp"
#include "scripting/player.hpp"
+#include "player_status.hpp"
class BadGuy;
class Portable;
context.pop_transform();
}
+
+void
+PlayerStatus::operator= (const PlayerStatus& other)
+{
+ coins = other.coins;
+ lives = other.lives;
+ bonus = other.bonus;
+ score_multiplier = other.score_multiplier;
+ max_score_multiplier = other.max_score_multiplier;
+ keys = other.keys;
+}
+
#ifndef SUPERTUX_PLAYERSTATUS_H
#define SUPERTUX_PLAYERSTATUS_H
+#include <assert.h>
#include "lisp/lisp.hpp"
#include "timer.hpp"
#include "serializable.hpp"
int score_multiplier;
int max_score_multiplier;
+
+ void operator= (const PlayerStatus& other);
enum {
KEY_BRASS = 0x001,
};
private:
+ // don't use this
+ PlayerStatus(const PlayerStatus& other);
+
int keys;
Sprite* key_iron;
Sprite* key_brass;
/** Frames per second */
float fps;
- /** Mirror is used to avoid duplicating left and right side
- sprites */
- // bool mirror;
-
std::vector<Surface*> surfaces;
};
#include <algorithm>
#include <cassert>
#include <iostream>
+#include <SDL_image.h>
+#include <GL/gl.h>
+#include <GL/glu.h>
#include "drawing_context.hpp"
#include "surface.hpp"
#include "font.hpp"
#include "main.hpp"
#include "gameconfig.hpp"
+#include "glutil.hpp"
+#include "texture.hpp"
-DrawingContext::DrawingContext(SDL_Surface* targetsurface)
+#define LIGHTMAP_DIV 4
+
+static inline int next_po2(int val)
{
- if(targetsurface) {
- screen = targetsurface;
- } else {
- screen = SDL_GetVideoSurface();
- }
+ int result = 1;
+ while(result < val)
+ result *= 2;
+
+ return result;
+}
+
+DrawingContext::DrawingContext()
+{
+ screen = SDL_GetVideoSurface();
+
+ lightmap_width = screen->w / LIGHTMAP_DIV;
+ lightmap_height = screen->h / LIGHTMAP_DIV;
+ int width = next_po2(lightmap_width);
+ int height = next_po2(lightmap_height);
+
+ lightmap.reset(new Texture(width, height, GL_RGB));
+
+ lightmap_uv_right = static_cast<float>(lightmap_width) / static_cast<float>(width);
+ lightmap_uv_bottom = static_cast<float>(lightmap_height) / static_cast<float>(height);
+
+ requests = &drawing_requests;
}
DrawingContext::~DrawingContext()
request.alpha = transform.alpha;
request.request_data = const_cast<Surface*> (surface);
- drawingrequests.push_back(request);
+ requests->push_back(request);
}
void
}
request.request_data = surfacepartrequest;
- drawingrequests.push_back(request);
+ requests->push_back(request);
}
void
textrequest->alignment = alignment;
request.request_data = textrequest;
- drawingrequests.push_back(request);
+ requests->push_back(request);
}
void
gradientrequest->bottom = bottom;
request.request_data = gradientrequest;
- drawingrequests.push_back(request);
+ requests->push_back(request);
}
void
* ((float) transform.alpha / 255.0));
request.request_data = fillrectrequest;
- drawingrequests.push_back(request);
+ requests->push_back(request);
}
void
{
#ifdef DEBUG
assert(transformstack.empty());
+ assert(target_stack.empty());
#endif
transformstack.clear();
+ target_stack.clear();
+
+ bool use_lightmap = lightmap_requests.size() != 0;
+
+ // PART1: create lightmap
+ if(use_lightmap) {
+ glViewport(0, screen->h - lightmap_height, lightmap_width, lightmap_height);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1.0, 1.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+
+ glClearColor(1, 1, 1, 1);
+ glClear(GL_COLOR_BUFFER_BIT);
+ handle_drawing_requests(lightmap_requests);
+ lightmap_requests.clear();
+
+ glDisable(GL_BLEND);
+ glEnable(GL_TEXTURE_2D);
+ glBindTexture(GL_TEXTURE_2D, lightmap->handle);
+ glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, screen->h - lightmap_height, lightmap_width, lightmap_height);
+
+ glViewport(0, 0, screen->w, screen->h);
+ glMatrixMode(GL_PROJECTION);
+ glLoadIdentity();
+ glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1.0, 1.0);
+ glMatrixMode(GL_MODELVIEW);
+ glLoadIdentity();
+ }
+
+ //glClear(GL_COLOR_BUFFER_BIT);
+ handle_drawing_requests(drawing_requests);
+ drawing_requests.clear();
+
+ if(use_lightmap) {
+ glEnable(GL_BLEND);
+ glBlendFunc(GL_DST_COLOR, GL_ZERO);
+ //glDisable(GL_BLEND);
+ //glColor4f((float) rand() / (float) RAND_MAX, .22, .88, 1.0f);
+
+ glEnable(GL_TEXTURE_2D);
+ glDisable(GL_DEPTH_TEST);
+ glDisable(GL_CULL_FACE);
+ glDisable(GL_ALPHA_TEST);
+
+ glBindTexture(GL_TEXTURE_2D, lightmap->handle);
+ glBegin(GL_QUADS);
+
+ glTexCoord2f(0, lightmap_uv_bottom);
+ glVertex2f(0, 0);
+
+ glTexCoord2f(lightmap_uv_right, lightmap_uv_bottom);
+ glVertex2f(SCREEN_WIDTH, 0);
+
+ glTexCoord2f(lightmap_uv_right, 0);
+ glVertex2f(SCREEN_WIDTH, SCREEN_HEIGHT);
+
+ glTexCoord2f(0, 0);
+ glVertex2f(0, SCREEN_HEIGHT);
- std::stable_sort(drawingrequests.begin(), drawingrequests.end());
+ glEnd();
+ }
- for(DrawingRequests::iterator i = drawingrequests.begin();
- i != drawingrequests.end(); ++i) {
+ assert_gl("drawing");
+
+ SDL_GL_SwapBuffers();
+}
+
+void
+DrawingContext::handle_drawing_requests(DrawingRequests& requests)
+{
+ std::stable_sort(requests.begin(), requests.end());
+
+ for(DrawingRequests::iterator i = requests.begin();
+ i != requests.end(); ++i) {
switch(i->type) {
case SURFACE:
{
break;
}
}
-
- drawingrequests.clear();
-
- // update screen
- SDL_GL_SwapBuffers();
}
void
{
return transform.alpha;
}
+
+void
+DrawingContext::push_target()
+{
+ target_stack.push_back(target);
+}
+
+void
+DrawingContext::pop_target()
+{
+ set_target(target_stack.back());
+ target_stack.pop_back();
+}
+
+void
+DrawingContext::set_target(Target target)
+{
+ this->target = target;
+ if(target == LIGHTMAP)
+ requests = &lightmap_requests;
+ else
+ requests = &drawing_requests;
+}
+
#include <SDL.h>
#include <stdint.h>
+#include <memory>
#include "math/vector.hpp"
#include "video/screen.hpp"
#include "video/font.hpp"
class Surface;
+class Texture;
// some constants for predefined layer values
enum {
LAYER_GUI = 500
};
-/// Handles drawing of things.
/**
* This class provides functions for drawing things on screen. It also
* maintains a stack of transforms that are applied to graphics.
class DrawingContext
{
public:
- DrawingContext(SDL_Surface* targetsurface = 0);
+ DrawingContext();
~DrawingContext();
/// Adds a drawing request for a surface into the request list.
void set_alpha(uint8_t alpha);
/// return currently set alpha
uint8_t get_alpha() const;
+
+ enum Target {
+ NORMAL, LIGHTMAP
+ };
+ void push_target();
+ void pop_target();
+ void set_target(Target target);
private:
class Transform
std::vector<Transform> transformstack;
/// the currently active transform
Transform transform;
+
+ class Blend
+ {
+ public:
+ GLenum sfactor;
+ GLenum dfactor;
+
+ Blend()
+ : sfactor(GL_SRC_ALPHA), dfactor(GL_ONE_MINUS_SRC_ALPHA)
+ {}
+ };
+ std::vector<Blend> blend_stack;
+ Blend blend_mode;
enum RequestType
{
uint32_t drawing_effect;
float zoom;
int alpha;
+ Blend blend;
void* request_data;
return layer < other.layer;
}
};
+
+ typedef std::vector<DrawingRequest> DrawingRequests;
+ void handle_drawing_requests(DrawingRequests& requests);
void draw_surface_part(DrawingRequest& request);
void draw_text(DrawingRequest& request);
void draw_text_center(DrawingRequest& request);
void draw_gradient(DrawingRequest& request);
void draw_filled_rect(DrawingRequest& request);
- typedef std::vector<DrawingRequest> DrawingRequests;
- DrawingRequests drawingrequests;
+ DrawingRequests drawing_requests;
+ DrawingRequests lightmap_requests;
+
+ DrawingRequests* requests;
SDL_Surface* screen;
+ Target target;
+ std::vector<Target> target_stack;
+ std::auto_ptr<Texture> lightmap;
+ int lightmap_width, lightmap_height;
+ float lightmap_uv_right, lightmap_uv_bottom;
};
#endif
--- /dev/null
+// $Id$
+//
+// SuperTux - A Jump'n Run
+// Copyright (C) 2004 Matthias Braun <matze@braunis.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#ifndef __GLUTIL_HPP__
+#define __GLUTIL_HPP__
+
+#include <sstream>
+#include <stdexcept>
+#include <GL/gl.h>
+#include <GL/glu.h>
+
+static inline void assert_gl(const char* message)
+{
+#ifdef DEBUG
+ GLenum error = glGetError();
+ if(error != GL_NO_ERROR) {
+ std::ostringstream msg;
+ msg << "OpenGLError while '" << message << "': "
+ << gluErrorString(error);
+ throw std::runtime_error(msg.str());
+ }
+#endif
+}
+
+#endif
+
#define SUPERTUX_SCREEN_H
#include <SDL.h>
-#include <SDL_opengl.h>
+#include <GL/gl.h>
#include <iostream>
#include <vector>
#include <list>
#include <SDL.h>
-#include <SDL_opengl.h>
+#include <GL/gl.h>
#include "math/vector.hpp"
#include "video/screen.hpp"
SDL_Surface* sdl_surface_from_nothing();
class SurfaceImpl;
-class SurfaceSDL;
class SurfaceOpenGL;
class DrawingContext;
SurfaceData(Color top_gradient_, Color bottom_gradient_, int w_, int h_);
~SurfaceData();
- SurfaceSDL* create_SurfaceSDL();
SurfaceOpenGL* create_SurfaceOpenGL();
SurfaceImpl* create();
};
--- /dev/null
+// $Id$
+//
+// SuperTux - A Jump'n Run
+// Copyright (C) 2004 Matthias Braun <matze@braunis.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#include <config.h>
+
+#include "texture.hpp"
+
+#include <GL/gl.h>
+#include <assert.h>
+#include "glutil.hpp"
+
+static inline bool is_power_of_2(int v)
+{
+ return (v & (v-1)) == 0;
+}
+
+Texture::Texture(unsigned int w, unsigned int h, GLenum glformat)
+{
+ assert(is_power_of_2(w));
+ assert(is_power_of_2(h));
+
+ this->width = w;
+ this->height = h;
+
+ assert_gl("before creating texture");
+ glGenTextures(1, &handle);
+
+ try {
+ glBindTexture(GL_TEXTURE_2D, handle);
+
+ glTexImage2D(GL_TEXTURE_2D, 0, glformat, width, height, 0, GL_RGBA,
+ GL_UNSIGNED_BYTE, 0);
+
+ set_texture_params();
+ } catch(...) {
+ glDeleteTextures(1, &handle);
+ throw;
+ }
+}
+
+Texture::Texture(SDL_Surface* image, GLenum glformat)
+{
+ const SDL_PixelFormat* format = image->format;
+ if(!is_power_of_2(image->w) || !is_power_of_2(image->h))
+ throw std::runtime_error("image has no power of 2 size");
+ if(format->BitsPerPixel != 24 && format->BitsPerPixel != 32)
+ throw std::runtime_error("image has no 24 or 32 bit color depth");
+
+ this->width = image->w;
+ this->height = image->h;
+
+ assert_gl("before creating texture");
+ glGenTextures(1, &handle);
+
+ try {
+ GLenum sdl_format;
+ if(format->BytesPerPixel == 3)
+ sdl_format = GL_RGB;
+ else if(format->BytesPerPixel == 4)
+ sdl_format = GL_RGBA;
+ else
+ assert(false);
+
+ glBindTexture(GL_TEXTURE_2D, handle);
+ glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, image->pitch/format->BytesPerPixel);
+ glTexImage2D(GL_TEXTURE_2D, 0, glformat, width, height, 0, sdl_format,
+ GL_UNSIGNED_BYTE, image->pixels);
+
+ assert_gl("creating texture");
+
+ set_texture_params();
+ } catch(...) {
+ glDeleteTextures(1, &handle);
+ throw;
+ }
+}
+
+Texture::~Texture()
+{
+ glDeleteTextures(1, &handle);
+}
+
+void upload_texture(SDL_Surface* , int , int , int , int , int , int )
+{
+ // TODO
+ assert(false);
+}
+
+void
+Texture::set_texture_params()
+{
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_R, GL_CLAMP);
+
+ assert_gl("set texture params");
+}
+
--- /dev/null
+// $Id$
+//
+// SuperTux - A Jump'n Run
+// Copyright (C) 2004 Matthias Braun <matze@braunis.de
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#ifndef __TEXTURE_HPP__
+#define __TEXTURE_HPP__
+
+#include <SDL.h>
+#include <GL/gl.h>
+
+/**
+ * This class is a very simple wrapper around a texture handle
+ */
+class Texture
+{
+public:
+ GLuint handle;
+ unsigned int width;
+ unsigned int height;
+
+ Texture(unsigned int width, unsigned int height, GLenum glformat);
+ Texture(SDL_Surface* surface, GLenum glformat);
+ ~Texture();
+
+ void upload_texture(SDL_Surface* image, int src_x, int src_y, int dst_x, int dst_y,
+ int width, int height);
+private:
+ void set_texture_params();
+};
+
+
+#endif
+
tux = new Tux(this);
add_object(tux);
- leveldot_green= new Surface("images/worldmap/common/leveldot_green.png", true);
- leveldot_red = new Surface("images/worldmap/common/leveldot_red.png", true);
messagedot = new Surface("images/worldmap/common/messagedot.png", true);
teleporterdot = new Surface("images/worldmap/common/teleporterdot.png", true);
i != spawn_points.end(); ++i) {
delete *i;
}
-
+ for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) {
+ Level& level = *i;
+ delete level.sprite;
+ }
+
delete tile_manager;
- delete leveldot_green;
- delete leveldot_red;
delete messagedot;
delete teleporterdot;
}
level.south = true;
level.west = true;
+ std::string sprite = "leveldot";
+ level_lisp->get("sprite", sprite);
+ level.sprite = sprite_manager->create(sprite);
+
level_lisp->get("extro-script", level.extro_script);
level_lisp->get("next-worldmap", level.next_worldmap);
if (level->pos == tux->get_tile_pos())
{
sound_manager->stop_music();
- PlayerStatus old_player_status = *player_status;
+ PlayerStatus old_player_status;
+ old_player_status = *player_status;
// do a shriking fade to the level
shrink_fade(Vector((level->pos.x*32 + 16 + offset.x),
level_finished = true;
bool old_level_state = level->solved;
level->solved = true;
+ level->sprite->set_action("solved");
// deal with statistics
level->statistics.merge(global_stats);
for(Levels::iterator i = levels.begin(); i != levels.end(); ++i)
{
- if (i->solved)
- context.draw_surface(leveldot_green,
- Vector(i->pos.x*32, i->pos.y*32), LAYER_TILES+1);
- else
- context.draw_surface(leveldot_red,
- Vector(i->pos.x*32, i->pos.y*32), LAYER_TILES+1);
+ const Level& level = *i;
+ level.sprite->draw(context, level.pos*32 + Vector(16, 16), LAYER_TILES+1);
}
for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i)
if (name == i->name)
{
i->solved = solved;
+ i->sprite->set_action(solved ? "solved" : "default");
i->statistics.parse(*level);
break;
}
std::string title;
bool solved;
+ Sprite* sprite;
+
/** Statistics for level tiles */
Statistics statistics;