super-tux-commit Mailing List for Super Tux (Page 52)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Ricardo C. <rm...@us...> - 2004-06-25 11:54:47
|
Update of /cvsroot/super-tux/supertux/src/screen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31308/src/screen Modified Files: drawing_context.cpp drawing_context.h screen.cpp screen.h Log Message: Moved drawing line code from drawing_context back to screen. The SDL code has the following issues: - it writes right away to the screen. Not waiting for the updating screen call. - it is extremly slow, since our screen is a hardware surface. Would be neat to have a draw_line func in drawing_context, but looks like it will have to wait. Index: drawing_context.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- drawing_context.cpp 23 Jun 2004 10:18:00 -0000 1.10 +++ drawing_context.cpp 25 Jun 2004 11:54:37 -0000 1.11 @@ -145,24 +145,6 @@ } void -DrawingContext::draw_line(const Vector& topleft, const Vector& botright, - Color color, int layer) -{ - DrawingRequest request; - - request.type = LINE; - request.layer = layer; - request.pos = transform.apply(topleft); - - LineRequest* linerequest = new LineRequest; - linerequest->botright = botright; - linerequest->color = color; - request.request_data = linerequest; - - drawingrequests.push_back(request); -} - -void DrawingContext::draw_surface_part(DrawingRequest& request) { SurfacePartRequest* surfacepartrequest @@ -306,87 +288,6 @@ delete fillrectrequest; } -/* Needed for line calculations */ -#define SGN(x) ((x)>0 ? 1 : ((x)==0 ? 0:(-1))) -#define ABS(x) ((x)>0 ? (x) : (-x)) - -void -DrawingContext::draw_line(DrawingRequest& request) -{ - LineRequest* linerequest = (LineRequest*) request.request_data; - - float x1 = request.pos.x; - float y1 = request.pos.y; - float x2 = linerequest->botright.x; - float y2 = linerequest->botright.y; - int r = linerequest->color.red; - int g = linerequest->color.green; - int b = linerequest->color.blue; - int a = linerequest->color.alpha; - -#ifndef NOOPENGL - if(use_gl) - { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4ub(r, g, b,a); - - glBegin(GL_LINES); - glVertex2f(x1, y1); - glVertex2f(x2, y2); - glEnd(); - glDisable(GL_BLEND); - } - else - { -#endif - /* Basic unantialiased Bresenham line algorithm */ - int lg_delta, sh_delta, cycle, lg_step, sh_step; - Uint32 color = SDL_MapRGBA(screen->format, r, g, b, a); - - lg_delta = (int)(x2 - x1); - sh_delta = (int)(y2 - y1); - lg_step = SGN(lg_delta); - lg_delta = ABS(lg_delta); - sh_step = SGN(sh_delta); - sh_delta = ABS(sh_delta); - if (sh_delta < lg_delta) - { - cycle = lg_delta >> 1; - while (x1 != x2) - { - drawpixel((int)x1, (int)y1, color); - cycle += sh_delta; - if (cycle > lg_delta) - { - cycle -= lg_delta; - y1 += sh_step; - } - x1 += lg_step; - } - drawpixel((int)x1, (int)y1, color); - } - cycle = sh_delta >> 1; - while (y1 != y2) - { - drawpixel((int)x1, (int)y1, color); - cycle += lg_delta; - if (cycle > sh_delta) - { - cycle -= sh_delta; - x1 += lg_step; - } - y1 += sh_step; - } - drawpixel((int)x1, (int)y1, color); -#ifndef NOOPENGL - - } -#endif - - delete linerequest; -} - void DrawingContext::do_drawing() { @@ -413,9 +314,6 @@ case FILLRECT: draw_filled_rect(*i); break; - case LINE: - draw_line(*i); - break; } } Index: drawing_context.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- drawing_context.h 23 Jun 2004 10:18:00 -0000 1.8 +++ drawing_context.h 25 Jun 2004 11:54:37 -0000 1.9 @@ -71,9 +71,6 @@ /** fills a rectangle */ void draw_filled_rect(const Vector& topleft, const Vector& size, Color color, int layer); - /** draws an one-pixel line */ - void draw_line(const Vector& topleft, const Vector& downright, - Color color, int layer); /** Processes all pending drawing requests and flushes the list */ void do_drawing(); @@ -105,7 +102,7 @@ enum RequestType { - SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, LINE + SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT }; struct SurfacePartRequest @@ -132,12 +129,6 @@ Vector size; }; - struct LineRequest - { - Color color; - Vector botright; - }; - struct DrawingRequest { int layer; @@ -158,7 +149,6 @@ void draw_text(DrawingRequest& request); void draw_gradient(DrawingRequest& request); void draw_filled_rect(DrawingRequest& request); - void draw_line(DrawingRequest& request); typedef std::vector<DrawingRequest> DrawingRequests; DrawingRequests drawingrequests; Index: screen.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/screen.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- screen.h 23 Jun 2004 10:18:00 -0000 1.6 +++ screen.h 25 Jun 2004 11:54:37 -0000 1.7 @@ -29,10 +29,10 @@ { public: Color() - : red(0), green(0), blue(0), alpha(0) + : red(0), green(0), blue(0), alpha(255) {} - Color(Uint8 red_, Uint8 green_, Uint8 blue_, Uint8 alpha_ = 0) + Color(Uint8 red_, Uint8 green_, Uint8 blue_, Uint8 alpha_ = 255) : red(red_), green(green_), blue(blue_), alpha(alpha_) {} @@ -61,6 +61,7 @@ void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel); void drawpixel(int x, int y, Uint32 pixel); void fillrect(float x, float y, float w, float h, int r, int g, int b, int a = 255); +void draw_line(float x1, float y1, float x2, int r, int g, int b, int a = 255); void fadeout(int fade_time); void shrink_fade(const Vector& point, int fade_time); Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/screen.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- screen.cpp 23 Jun 2004 10:18:00 -0000 1.4 +++ screen.cpp 25 Jun 2004 11:54:37 -0000 1.5 @@ -177,6 +177,74 @@ #endif } +/* Needed for line calculations */ +#define SGN(x) ((x)>0 ? 1 : ((x)==0 ? 0:(-1))) +#define ABS(x) ((x)>0 ? (x) : (-x)) + +void +draw_line(float x1, float y1, float x2, float y2, int r, int g, int b, int a) +{ +#ifndef NOOPENGL + if(use_gl) + { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4ub(r, g, b,a); + + glBegin(GL_LINES); + glVertex2f(x1, y1); + glVertex2f(x2, y2); + glEnd(); + glDisable(GL_BLEND); + } + else + { +#endif + /* Basic unantialiased Bresenham line algorithm */ + int lg_delta, sh_delta, cycle, lg_step, sh_step; + Uint32 color = SDL_MapRGBA(screen->format, r, g, b, a); + + lg_delta = (int)(x2 - x1); + sh_delta = (int)(y2 - y1); + lg_step = SGN(lg_delta); + lg_delta = ABS(lg_delta); + sh_step = SGN(sh_delta); + sh_delta = ABS(sh_delta); + if (sh_delta < lg_delta) + { + cycle = lg_delta >> 1; + while (x1 != x2) + { + drawpixel((int)x1, (int)y1, color); + cycle += sh_delta; + if (cycle > lg_delta) + { + cycle -= lg_delta; + y1 += sh_step; + } + x1 += lg_step; + } + drawpixel((int)x1, (int)y1, color); + } + cycle = sh_delta >> 1; + while (y1 != y2) + { + drawpixel((int)x1, (int)y1, color); + cycle += lg_delta; + if (cycle > sh_delta) + { + cycle -= sh_delta; + x1 += lg_step; + } + y1 += sh_step; + } + drawpixel((int)x1, (int)y1, color); +#ifndef NOOPENGL + + } +#endif +} + #define LOOP_DELAY 20.0 void fadeout(int fade_time) |
From: Ricardo C. <rm...@us...> - 2004-06-23 10:18:10
|
Update of /cvsroot/super-tux/supertux/src/screen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26828/src/screen Modified Files: drawing_context.cpp drawing_context.h screen.cpp screen.h Log Message: Moved line drawing from screen to drawing_context. Index: drawing_context.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- drawing_context.cpp 14 Jun 2004 22:45:24 -0000 1.9 +++ drawing_context.cpp 23 Jun 2004 10:18:00 -0000 1.10 @@ -145,6 +145,24 @@ } void +DrawingContext::draw_line(const Vector& topleft, const Vector& botright, + Color color, int layer) +{ + DrawingRequest request; + + request.type = LINE; + request.layer = layer; + request.pos = transform.apply(topleft); + + LineRequest* linerequest = new LineRequest; + linerequest->botright = botright; + linerequest->color = color; + request.request_data = linerequest; + + drawingrequests.push_back(request); +} + +void DrawingContext::draw_surface_part(DrawingRequest& request) { SurfacePartRequest* surfacepartrequest @@ -288,6 +306,87 @@ delete fillrectrequest; } +/* Needed for line calculations */ +#define SGN(x) ((x)>0 ? 1 : ((x)==0 ? 0:(-1))) +#define ABS(x) ((x)>0 ? (x) : (-x)) + +void +DrawingContext::draw_line(DrawingRequest& request) +{ + LineRequest* linerequest = (LineRequest*) request.request_data; + + float x1 = request.pos.x; + float y1 = request.pos.y; + float x2 = linerequest->botright.x; + float y2 = linerequest->botright.y; + int r = linerequest->color.red; + int g = linerequest->color.green; + int b = linerequest->color.blue; + int a = linerequest->color.alpha; + +#ifndef NOOPENGL + if(use_gl) + { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glColor4ub(r, g, b,a); + + glBegin(GL_LINES); + glVertex2f(x1, y1); + glVertex2f(x2, y2); + glEnd(); + glDisable(GL_BLEND); + } + else + { +#endif + /* Basic unantialiased Bresenham line algorithm */ + int lg_delta, sh_delta, cycle, lg_step, sh_step; + Uint32 color = SDL_MapRGBA(screen->format, r, g, b, a); + + lg_delta = (int)(x2 - x1); + sh_delta = (int)(y2 - y1); + lg_step = SGN(lg_delta); + lg_delta = ABS(lg_delta); + sh_step = SGN(sh_delta); + sh_delta = ABS(sh_delta); + if (sh_delta < lg_delta) + { + cycle = lg_delta >> 1; + while (x1 != x2) + { + drawpixel((int)x1, (int)y1, color); + cycle += sh_delta; + if (cycle > lg_delta) + { + cycle -= lg_delta; + y1 += sh_step; + } + x1 += lg_step; + } + drawpixel((int)x1, (int)y1, color); + } + cycle = sh_delta >> 1; + while (y1 != y2) + { + drawpixel((int)x1, (int)y1, color); + cycle += lg_delta; + if (cycle > sh_delta) + { + cycle -= sh_delta; + x1 += lg_step; + } + y1 += sh_step; + } + drawpixel((int)x1, (int)y1, color); +#ifndef NOOPENGL + + } +#endif + + delete linerequest; +} + void DrawingContext::do_drawing() { @@ -314,6 +413,9 @@ case FILLRECT: draw_filled_rect(*i); break; + case LINE: + draw_line(*i); + break; } } Index: drawing_context.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- drawing_context.h 10 Jun 2004 14:09:49 -0000 1.7 +++ drawing_context.h 23 Jun 2004 10:18:00 -0000 1.8 @@ -69,7 +69,10 @@ /** draws a color gradient onto the whole screen */ void draw_gradient(Color from, Color to, int layer); /** fills a rectangle */ - void draw_filled_rect(const Vector& topleft, const Vector& downright, + void draw_filled_rect(const Vector& topleft, const Vector& size, + Color color, int layer); + /** draws an one-pixel line */ + void draw_line(const Vector& topleft, const Vector& downright, Color color, int layer); /** Processes all pending drawing requests and flushes the list */ @@ -102,7 +105,7 @@ enum RequestType { - SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT + SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, LINE }; struct SurfacePartRequest @@ -129,6 +132,12 @@ Vector size; }; + struct LineRequest + { + Color color; + Vector botright; + }; + struct DrawingRequest { int layer; @@ -149,6 +158,7 @@ void draw_text(DrawingRequest& request); void draw_gradient(DrawingRequest& request); void draw_filled_rect(DrawingRequest& request); + void draw_line(DrawingRequest& request); typedef std::vector<DrawingRequest> DrawingRequests; DrawingRequests drawingrequests; Index: screen.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/screen.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- screen.h 14 Jun 2004 22:45:24 -0000 1.5 +++ screen.h 23 Jun 2004 10:18:00 -0000 1.6 @@ -58,9 +58,9 @@ #define USE_ALPHA 0 #define IGNORE_ALPHA 1 -void drawline(int x1, int y1, int x2, int y2, int r, int g, int b, int a); -void fillrect(float x, float y, float w, float h, int r, int g, int b, - int a = 255); +void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel); +void drawpixel(int x, int y, Uint32 pixel); +void fillrect(float x, float y, float w, float h, int r, int g, int b, int a = 255); void fadeout(int fade_time); void shrink_fade(const Vector& point, int fade_time); Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/screen.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- screen.cpp 9 Jun 2004 04:43:15 -0000 1.3 +++ screen.cpp 23 Jun 2004 10:18:00 -0000 1.4 @@ -40,54 +40,6 @@ #include "drawing_context.h" #include "type.h" -/* Needed for line calculations */ -#define SGN(x) ((x)>0 ? 1 : ((x)==0 ? 0:(-1))) -#define ABS(x) ((x)>0 ? (x) : (-x)) - -/* --- FADE IN --- */ - -/** Fades the given surface into a black one. If fade_out is true, it will fade out, else -it will fade in */ - -#if 0 -void fade(Surface *surface, int seconds, bool fade_out); - -void fade(const std::string& surface, int seconds, bool fade_out) -{ -Surface* sur = new Surface(datadir + surface, IGNORE_ALPHA); -fade(sur, seconds, fade_out); -delete sur; -} - -void fade(Surface *surface, int seconds, bool fade_out) -{ -float alpha; -if (fade_out) - alpha = 0; -else - alpha = 255; - - int cur_time, old_time; - cur_time = SDL_GetTicks(); - - while(alpha >= 0 && alpha < 256) - { - surface->draw(0,0,(int)alpha); - flipscreen(); - - old_time = cur_time; - cur_time = SDL_GetTicks(); - - /* Calculate the next alpha value */ - float calc = (float) ((cur_time - old_time) / seconds); - if(fade_out) - alpha += 255 * calc; - else - alpha -= 255 * calc; - } -} -#endif - /* 'Stolen' from the SDL documentation. * Set the pixel at (x, y) to the given value * NOTE: The surface must be locked before calling this! @@ -153,70 +105,6 @@ SDL_UpdateRect(screen, x, y, 1, 1); } -void drawline(int x1, int y1, int x2, int y2, int r, int g, int b, int a) -{ -#ifndef NOOPENGL - if(use_gl) - { - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - glColor4ub(r, g, b,a); - - glBegin(GL_LINES); - glVertex2f(x1, y1); - glVertex2f(x2, y2); - glEnd(); - glDisable(GL_BLEND); - } - else - { -#endif - - /* Basic unantialiased Bresenham line algorithm */ - int lg_delta, sh_delta, cycle, lg_step, sh_step; - Uint32 color = SDL_MapRGBA(screen->format, r, g, b, a); - - lg_delta = x2 - x1; - sh_delta = y2 - y1; - lg_step = SGN(lg_delta); - lg_delta = ABS(lg_delta); - sh_step = SGN(sh_delta); - sh_delta = ABS(sh_delta); - if (sh_delta < lg_delta) - { - cycle = lg_delta >> 1; - while (x1 != x2) - { - drawpixel(x1, y1, color); - cycle += sh_delta; - if (cycle > lg_delta) - { - cycle -= lg_delta; - y1 += sh_step; - } - x1 += lg_step; - } - drawpixel(x1, y1, color); - } - cycle = sh_delta >> 1; - while (y1 != y2) - { - drawpixel(x1, y1, color); - cycle += lg_delta; - if (cycle > sh_delta) - { - cycle -= sh_delta; - x1 += lg_step; - } - y1 += sh_step; - } - drawpixel(x1, y1, color); -#ifndef NOOPENGL - - } -#endif -} - /* --- FILL A RECT --- */ void fillrect(float x, float y, float w, float h, int r, int g, int b, int a) @@ -289,7 +177,6 @@ #endif } - #define LOOP_DELAY 20.0 void fadeout(int fade_time) |
From: Ricardo C. <rm...@us...> - 2004-06-23 10:17:34
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26754/src Modified Files: title.cpp Log Message: Missing include. Was only included, cause it was on leveleditor.h. Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- title.cpp 16 Jun 2004 00:40:42 -0000 1.98 +++ title.cpp 23 Jun 2004 10:17:25 -0000 1.99 @@ -43,6 +43,7 @@ #include "timer.h" #include "setup.h" #include "level.h" +#include "level_subset.h" #include "gameloop.h" #include "leveleditor.h" #include "scene.h" |
From: Ricardo C. <rm...@us...> - 2004-06-22 12:43:52
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1839/src Modified Files: configfile.cpp setup.cpp Log Message: Should fix the joystick bug, when the user changes joystick port or something. Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.102 retrieving revision 1.103 diff -u -d -r1.102 -r1.103 --- setup.cpp 21 Jun 2004 21:21:01 -0000 1.102 +++ setup.cpp 22 Jun 2004 12:43:42 -0000 1.103 @@ -775,7 +775,7 @@ /* Open joystick: */ if (SDL_NumJoysticks() <= 0) { - fprintf(stderr, "Warning: No joysticks are available.\n"); + fprintf(stderr, "Info: No joysticks were found.\n"); use_joystick = false; } Index: configfile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/configfile.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- configfile.cpp 20 Jun 2004 17:43:26 -0000 1.8 +++ configfile.cpp 22 Jun 2004 12:43:41 -0000 1.9 @@ -88,17 +88,16 @@ use_gl = false; reader.read_int ("joystick", joystick_num); - if (!(joystick_num >= 0)) - use_joystick = false; - else - use_joystick = true; - reader.read_int ("joystick-x", joystick_keymap.x_axis); - reader.read_int ("joystick-y", joystick_keymap.y_axis); - reader.read_int ("joystick-a", joystick_keymap.a_button); - reader.read_int ("joystick-b", joystick_keymap.b_button); - reader.read_int ("joystick-start", joystick_keymap.start_button); - reader.read_int ("joystick-deadzone", joystick_keymap.dead_zone); + if (joystick_num >= 0) + { + reader.read_int ("joystick-x", joystick_keymap.x_axis); + reader.read_int ("joystick-y", joystick_keymap.y_axis); + reader.read_int ("joystick-a", joystick_keymap.a_button); + reader.read_int ("joystick-b", joystick_keymap.b_button); + reader.read_int ("joystick-start", joystick_keymap.start_button); + reader.read_int ("joystick-deadzone", joystick_keymap.dead_zone); + } reader.read_int ("keyboard-jump", keymap.jump); reader.read_int ("keyboard-activate", keymap.activate); @@ -127,15 +126,18 @@ fprintf(config, "\n\t;; either \"opengl\" or \"sdl\"\n"); fprintf(config, "\t(video \"%s\")\n", use_gl ? "opengl" : "sdl"); - fprintf(config, "\n\t;; joystick number (-1 means no joystick):\n"); - fprintf(config, "\t(joystick %d)\n", use_joystick ? joystick_num : -1); + if(use_joystick) + { + fprintf(config, "\n\t;; joystick number:\n"); + fprintf(config, "\t(joystick %d)\n", joystick_num); - fprintf(config, "\t(joystick-x %d)\n", joystick_keymap.x_axis); - fprintf(config, "\t(joystick-y %d)\n", joystick_keymap.y_axis); - fprintf(config, "\t(joystick-a %d)\n", joystick_keymap.a_button); - fprintf(config, "\t(joystick-b %d)\n", joystick_keymap.b_button); - fprintf(config, "\t(joystick-start %d)\n", joystick_keymap.start_button); - fprintf(config, "\t(joystick-deadzone %d)\n", joystick_keymap.dead_zone); + fprintf(config, "\t(joystick-x %d)\n", joystick_keymap.x_axis); + fprintf(config, "\t(joystick-y %d)\n", joystick_keymap.y_axis); + fprintf(config, "\t(joystick-a %d)\n", joystick_keymap.a_button); + fprintf(config, "\t(joystick-b %d)\n", joystick_keymap.b_button); + fprintf(config, "\t(joystick-start %d)\n", joystick_keymap.start_button); + fprintf(config, "\t(joystick-deadzone %d)\n", joystick_keymap.dead_zone); + } fprintf(config, "\t(keyboard-jump %d)\n", keymap.jump); fprintf(config, "\t(keyboard-duck %d)\n", keymap.duck); |
From: Ricardo C. <rm...@us...> - 2004-06-22 12:35:32
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28613/data/levels/test Modified Files: level7.stl Log Message: Added two slopes to test level 7. Index: level7.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/level7.stl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- level7.stl 8 Jun 2004 12:09:06 -0000 1.5 +++ level7.stl 22 Jun 2004 12:35:23 -0000 1.6 @@ -4,9 +4,9 @@ (name "Fire Test") (author "Ingo Ruhnke") (music "Mortimers_chipdisko.mod") - (background "arctis.jpg") + (background "") (particle_system "") - (bkgd_speed 0.5) + (bkgd_speed 50) (bkgd_red_top 150) (bkgd_green_top 150) (bkgd_blue_top 150) @@ -46,7 +46,7 @@ 0 0 0 102 102 102 0 0 0 140 140 140 0 0 0 0 0 0 11 11 11 11 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 11 11 11 11 11 11 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 11 11 11 11 11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 115 116 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 11 11 11 11 11 11 0 0 0 0 0 0 0 0 0 36 0 0 0 0 0 0 0 117 118 0 0 0 0 0 8 8 36 8 8 8 8 8 8 8 8 8 36 8 8 8 8 8 8 8 36 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 + 0 0 0 0 0 0 0 400 401 0 0 0 0 0 0 11 11 11 11 11 11 0 0 0 0 0 0 0 0 0 36 0 0 0 0 0 0 0 117 118 0 0 0 0 0 8 8 36 8 8 8 8 8 8 8 8 8 36 8 8 8 8 8 8 8 36 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 14 14 14 14 14 14 14 14 14 14 14 14 14 14 11 11 11 11 11 11 11 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 14 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 |
From: Ricardo C. <rm...@us...> - 2004-06-22 12:35:09
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28164/data/images/tilesets Modified Files: supertux.stgt Added Files: slope-left.png slope-right.png Log Message: Added slope graphics. --- NEW FILE: slope-left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: slope-right.png --- (This appears to be a binary file; contents omitted.) Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- supertux.stgt 15 Jun 2004 16:16:46 -0000 1.41 +++ supertux.stgt 22 Jun 2004 12:34:55 -0000 1.42 @@ -18,6 +18,7 @@ (tilegroup (name "Signs") (tiles 136 137 138 139 141 142 143 144)) (tilegroup (name "Grasslands") (tiles 145 146 147 148)) (tilegroup (name "Jungle") (tiles 301 302 303 304 305 306 307 308 309 310 311 312)) + (tilegroup (name "Slopes") (tiles 400 401)) (tile (id 0) (images "notile.png")) @@ -644,5 +645,14 @@ (spike #t) (images "spike.png")) +; Slopes + + (tile (id 400) + (slope-angle 45) + (images "slope-right.png")) + (tile (id 401) + (slope-angle 135) + (images "slope-left.png")) + ) |
From: Ricardo C. <rm...@us...> - 2004-06-22 12:34:23
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27449/src Modified Files: collision.cpp tile.cpp tile.h Log Message: Added slope tiles. Doesn't work that well, maybe they shouldn't have the solid attribute. Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- tile.h 14 Jun 2004 22:45:23 -0000 1.29 +++ tile.h 22 Jun 2004 12:34:14 -0000 1.30 @@ -81,6 +81,9 @@ int next_tile; int anim_speed; + + /** This is the angle of the slope. Set to 0, if this is no slope. */ + float slope_angle; /** Draw a tile on the screen: */ static void draw(const Vector& pos, unsigned int c, Uint8 alpha = 255); Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/collision.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- collision.cpp 1 Jun 2004 21:09:37 -0000 1.27 +++ collision.cpp 22 Jun 2004 12:34:13 -0000 1.28 @@ -26,6 +26,12 @@ #include "tilemap.h" #include "tile.h" +struct TileInfo +{ + Tile *tile; + int x, y; +} tileinfo; + bool rectcollision(const base_type& one, const base_type& two) { return (one.x >= two.x - one.width + 1 && @@ -52,11 +58,18 @@ int max_x = int(base.x + base.width); int max_y = int(base.y + base.height); + tileinfo.tile = NULL; + for(int x = starttilex; x*32 < max_x; ++x) { for(int y = starttiley; y*32 < max_y; ++y) { Tile* tile = tilemap.get_tile(x, y); if(tile && tile->attributes & Tile::SOLID) + { + tileinfo.tile = tile; + tileinfo.x = x*32; + tileinfo.y = y*32; return true; + } } } @@ -175,6 +188,21 @@ if(collision_object_map(*old)) { + if(tileinfo.tile->slope_angle != 0) + { // in case this is a slope, set the right Y position + // left-right slope: + if(tileinfo.tile->slope_angle > 0 && tileinfo.tile->slope_angle < M_PI/2) + current->y = tileinfo.y - current->height + + (tileinfo.x - current->x)*tan(M_PI/2 - tileinfo.tile->slope_angle) + - 1; + // right-left slope: + if(tileinfo.tile->slope_angle > M_PI/2 && tileinfo.tile->slope_angle < M_PI) + current->y = tileinfo.y - current->height + + (current->x - tileinfo.x)*tan(M_PI - tileinfo.tile->slope_angle) + - 1; + } + else + { switch(h) { case 1: @@ -225,6 +253,7 @@ } break; } + } } if((xd > 0 && current->x < orig_x) || (xd < 0 && current->x > orig_x)) Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- tile.cpp 15 Jun 2004 12:18:59 -0000 1.31 +++ tile.cpp 22 Jun 2004 12:34:14 -0000 1.32 @@ -147,6 +147,14 @@ reader.read_int("anim-speed", anim_speed); reader.read_int("next-tile", next_tile); + slope_angle = 0; + reader.read_float("slope-angle", slope_angle); + if(slope_angle != 0) + { // convert angle to radians from degrees: + slope_angle = (slope_angle * M_PI) / 180; + attributes |= SOLID; + } + // FIXME: make images and editor_images a sprite images = create_surfaces(reader.read_lisp("images")); editor_images = create_surfaces(reader.read_lisp("editor-images")); |
From: Ricardo C. <rm...@us...> - 2004-06-22 12:20:32
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16642/src Modified Files: gameloop.cpp Log Message: Don't show "by", in case the author name is blank. Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- gameloop.cpp 10 Jun 2004 13:54:20 -0000 1.152 +++ gameloop.cpp 22 Jun 2004 12:20:22 -0000 1.153 @@ -158,8 +158,9 @@ sprintf(str, "TUX x %d", player_status.lives); context.draw_text_center(white_text, str, Vector(0, 240), LAYER_FOREGROUND1); - - context.draw_text_center(white_small_text, + + if(level->get_author().size()) + context.draw_text_center(white_small_text, std::string(_("by ")) + level->get_author(), Vector(0, 400), LAYER_FOREGROUND1); |
From: Ryan F. <sik...@us...> - 2004-06-21 21:21:10
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10813 Modified Files: setup.cpp Log Message: - 'typo' fix Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- setup.cpp 16 Jun 2004 00:40:42 -0000 1.101 +++ setup.cpp 21 Jun 2004 21:21:01 -0000 1.102 @@ -678,7 +678,7 @@ { fprintf(stderr, "\nWarning: I could not set up fullscreen video for " - "640x480 mode.\n" + "800x600 mode.\n" "The Simple DirectMedia error that occured was:\n" "%s\n\n", SDL_GetError()); use_fullscreen = false; @@ -691,7 +691,7 @@ if (screen == NULL) { fprintf(stderr, - "\nError: I could not set up video for 640x480 mode.\n" + "\nError: I could not set up video for 800x600 mode.\n" "The Simple DirectMedia error that occured was:\n" "%s\n\n", SDL_GetError()); exit(1); |
From: Ricardo C. <rm...@us...> - 2004-06-20 17:43:38
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31331/src Modified Files: configfile.cpp Log Message: Activate key was not been saved. Index: configfile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/configfile.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- configfile.cpp 9 Jun 2004 05:23:19 -0000 1.7 +++ configfile.cpp 20 Jun 2004 17:43:26 -0000 1.8 @@ -142,6 +142,7 @@ fprintf(config, "\t(keyboard-left %d)\n", keymap.left); fprintf(config, "\t(keyboard-right %d)\n", keymap.right); fprintf(config, "\t(keyboard-fire %d)\n", keymap.fire); + fprintf(config, "\t(keyboard-activate %d)\n", keymap.activate); fprintf(config, ")\n"); } |
From: Ricardo C. <rm...@us...> - 2004-06-20 14:50:32
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11203/src Modified Files: door.cpp door.h resources.cpp Log Message: A couple of fixes on Door class: - door images were being stored for each object (IMO door game object, should be putted together with the others. This way, wouldn't be needed to add stuff into resources.cpp directly, but to load_objects_gfx() func); - animation was not working properly (could be added to Sprite one time animations). Index: door.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/door.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- door.cpp 10 Jun 2004 16:03:17 -0000 1.3 +++ door.cpp 20 Jun 2004 14:50:21 -0000 1.4 @@ -25,6 +25,11 @@ #include "sprite.h" #include "sprite_manager.h" #include "screen/drawing_context.h" +#include "globals.h" + +/** data images */ +Sprite* door; +Surface* door_opening[DOOR_OPENING_FRAMES]; Door::Door(LispReader& reader) { @@ -36,9 +41,10 @@ reader.read_string("sector", target_sector); reader.read_string("spawnpoint", target_spawnpoint); - sprite = sprite_manager->load("door"); animation_timer.init(true); door_activated = false; + + animation_timer.init(true); } void @@ -69,13 +75,16 @@ void Door::draw(DrawingContext& context) { - sprite->draw(context, Vector(area.x, area.y), LAYER_TILES); + if(animation_timer.check()) + context.draw_surface(door_opening[(animation_timer.get_gone() * DOOR_OPENING_FRAMES) / + DOOR_OPENING_TIME], Vector(area.x, area.y - (door_opening[0]->h/2)), LAYER_TILES); + else + door->draw(context, Vector(area.x, area.y), LAYER_TILES); //Check if door animation is complete //TODO: Move this out of the "draw" method as this is extremely dirty :) if ((!animation_timer.check()) && (door_activated)) { door_activated = false; - sprite = sprite_manager->load("door"); GameSession::current()->respawn(target_sector, target_spawnpoint); } } @@ -87,9 +96,7 @@ //TODO: Resetting the animation doesn't work correctly // Tux and badguys should stop moving while the door is opening if(type == INTERACTION_ACTIVATE) { - sprite = sprite_manager->load("openingdoor"); - sprite->reset(); - animation_timer.start(ANIM_TIME); + animation_timer.start(DOOR_OPENING_TIME); door_activated = true; } } Index: door.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/door.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- door.h 10 Jun 2004 16:03:17 -0000 1.3 +++ door.h 20 Jun 2004 14:50:21 -0000 1.4 @@ -26,12 +26,16 @@ #include "serializable.h" #include "timer.h" -#define ANIM_TIME 1500 - class Sprite; class LispReader; +/** data images */ +#define DOOR_OPENING_TIME 1500 +#define DOOR_OPENING_FRAMES 8 +extern Sprite* door; +extern Surface* door_opening[DOOR_OPENING_FRAMES]; + class Door : public InteractiveObject, public Serializable { public: @@ -45,7 +49,6 @@ virtual void interaction(InteractionType type); private: - Sprite* sprite; std::string target_sector; std::string target_spawnpoint; Timer animation_timer; //Used for door animation Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- resources.cpp 8 Jun 2004 17:44:29 -0000 1.39 +++ resources.cpp 20 Jun 2004 14:50:21 -0000 1.40 @@ -27,6 +27,7 @@ #include "sprite_manager.h" #include "sound_manager.h" #include "setup.h" +#include "door.h" Surface* img_waves[3]; Surface* img_water; @@ -194,6 +195,14 @@ /* Objects */ load_object_gfx(); + // load the door object graphics: + door = sprite_manager->load("door"); + for (int i = 0; i < DOOR_OPENING_FRAMES; i++) + { + sprintf(img_name, "%s/images/shared/door-%i.png", datadir.c_str(), i+1); + door_opening[i] = new Surface(img_name, false); + } + /* Distros: */ img_distro[0] = new Surface(datadir + "/images/tilesets/coin1.png", USE_ALPHA); @@ -264,6 +273,11 @@ delete growingtux_right[i]; } + // door game object: + + for (int i = 0; i < DOOR_OPENING_FRAMES; i++) + delete door_opening[i]; + for (i = 0; i < NUM_SOUNDS; i++) free_chunk(sounds[i]); |
From: Ingo R. <gr...@us...> - 2004-06-16 00:40:52
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17535 Modified Files: Makefile.am level.cpp level.h level_subset.cpp level_subset.h leveleditor.cpp leveleditor.h setup.cpp setup.h title.cpp Log Message: - moved level subsets into their own file - changed level subsets so that they do a readdir() instead of iterating ovre level1, level2,.. until error, this should also allow abitary level file names Index: level_subset.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level_subset.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- level_subset.cpp 15 Jun 2004 22:56:42 -0000 1.1 +++ level_subset.cpp 16 Jun 2004 00:40:42 -0000 1.2 @@ -18,20 +18,28 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. +#include <assert.h> #include "setup.h" #include "level.h" #include "globals.h" #include "screen/surface.h" #include "level_subset.h" +static bool has_suffix(const std::string& data, const std::string& suffix) +{ + if (data.length() >= suffix.length()) + return data.compare(data.length() - suffix.length(), suffix.length(), suffix) == 0; + else + return false; +} + LevelSubset::LevelSubset() - : image(0), levels(0) + : levels(0) { } LevelSubset::~LevelSubset() { - delete image; } void LevelSubset::create(const std::string& subset_name) @@ -42,112 +50,74 @@ new_subset.title = "Unknown Title"; new_subset.description = "No description so far."; new_subset.save(); - //new_lev.save(subset_name, 1, 0); } -void LevelSubset::parse (lisp_object_t* cursor) +void LevelSubset::read_info_file(const std::string& info_file) { - while(!lisp_nil_p(cursor)) + lisp_object_t* root_obj = lisp_read_from_file(info_file); + lisp_object_t* cur = lisp_car(root_obj); + + if (lisp_symbol_p(cur) && strcmp(lisp_symbol(cur), "supertux-level-subset") == 0) { - lisp_object_t* cur = lisp_car(cursor); - char *s; + LispReader reader(lisp_cdr(root_obj)); - if (!lisp_cons_p(cur) || !lisp_symbol_p (lisp_car(cur))) - { - printf("Not good"); - } - else - { - if (strcmp(lisp_symbol(lisp_car(cur)), "title") == 0) - { - if(( s = lisp_string(lisp_car(lisp_cdr(cur)))) != NULL) - { - title = s; - } - } - else if (strcmp(lisp_symbol(lisp_car(cur)), "description") == 0) - { - if(( s = lisp_string(lisp_car(lisp_cdr(cur)))) != NULL) - { - description = s; - } - } - } - cursor = lisp_cdr (cursor); + reader.read_string("title", title); + reader.read_string("description", description); + reader.read_string_vector("levels", levels); } + else + { + std::cout << "LevelSubset: parse error in info file: " << info_file << std::endl; + } + + lisp_free(root_obj); } void LevelSubset::load(const char* subset) { - FILE* fi; - char filename[1024]; - char str[1024]; - int i; - lisp_object_t* root_obj = 0; - name = subset; - - snprintf(filename, 1024, "%s/levels/%s/info", st_dir, subset); - if(!faccessible(filename)) - snprintf(filename, 1024, "%s/levels/%s/info", datadir.c_str(), subset); - if(faccessible(filename)) + + // Check in which directory our subset is located (ie. ~/.supertux/ + // or SUPERTUX_DATADIR) + char filename[1024]; + snprintf(filename, 1024, "%s/levels/%s/", st_dir, subset); + if (access(filename, R_OK) == 0) { - fi = fopen(filename, "r"); - if (fi == NULL) - { - perror(filename); - } - lisp_stream_t stream; - lisp_stream_init_file (&stream, fi); - root_obj = lisp_read (&stream); - - if (root_obj->type == LISP_TYPE_EOF || root_obj->type == LISP_TYPE_PARSE_ERROR) - { - printf("World: Parse Error in file %s", filename); - } - - lisp_object_t* cur = lisp_car(root_obj); - - if (!lisp_symbol_p (cur)) - { - printf("World: Read error in %s",filename); - } - - if (strcmp(lisp_symbol(cur), "supertux-level-subset") == 0) - { - parse(lisp_cdr(root_obj)); - - } - - lisp_free(root_obj); - fclose(fi); + directory = filename; + } + else + { + snprintf(filename, 1024, "%s/levels/%s/", datadir.c_str(), subset); + if (access(filename, R_OK) == 0) + directory = filename; + else + std::cout << "Error: LevelSubset: couldn't find subset: " << subset << std::endl; + } + + read_info_file(directory + "info"); - snprintf(str, 1024, "%s.png", filename); - if(faccessible(str)) + if (levels.empty()) + { // Level info file doesn't define any levels, so read the + // directory to see what we can find + std::vector<std::string> files; + + snprintf(filename, 1024, "%s/levels/%s/", st_dir, subset); + if(access(filename, R_OK) == 0) { - delete image; - image = new Surface(str,IGNORE_ALPHA); + files = read_directory(filename); } else { - snprintf(filename, 1024, "%s/images/status/level-subset-info.png", datadir.c_str()); - delete image; - image = new Surface(filename,IGNORE_ALPHA); + snprintf(filename, 1024, "%s/levels/%s/", datadir.c_str(), subset); + files = read_directory(filename); } - } - - for(i=1; i != -1; ++i) - { - /* Get the number of levels in this subset */ - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", st_dir, subset,i); - if(!faccessible(filename)) + + for(std::vector<std::string>::iterator i = files.begin(); i != files.end(); ++i) { - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", datadir.c_str(), subset,i); - if(!faccessible(filename)) - break; + if (has_suffix(*i, ".stl")) + levels.push_back(*i); } } - levels = --i; } void @@ -172,7 +142,7 @@ } /* Write header: */ - fprintf(fi,";SuperTux-Level-Subset\n"); + fprintf(fi,";; SuperTux-Level-Subset\n"); fprintf(fi,"(supertux-level-subset\n"); /* Save title info: */ @@ -186,20 +156,24 @@ } } +void +LevelSubset::add_level(const std::string& name) +{ + levels.push_back(name); +} + std::string LevelSubset::get_level_filename(unsigned int num) { - char filename[1024]; - - // Load data file: - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", st_dir, - name.c_str(), num); - if(!faccessible(filename)) - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", datadir.c_str(), - name.c_str(), num); + assert(num < levels.size()); - return std::string(filename); + return directory + levels[num]; } -/* EOF */ +int +LevelSubset::get_num_levels() const +{ + return levels.size(); +} +/* EOF */ Index: setup.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- setup.h 28 Apr 2004 13:18:54 -0000 1.19 +++ setup.h 16 Jun 2004 00:40:42 -0000 1.20 @@ -20,6 +20,8 @@ #ifndef SUPERTUX_SETUP_H #define SUPERTUX_SETUP_H +#include <vector> +#include <string> #include "menu.h" #include "sound.h" #include "type.h" @@ -27,6 +29,8 @@ int faccessible(const char *filename); int fcreatedir(const char* relative_dir); int fwriteable(const char *filename); +std::vector<std::string> read_directory(const std::string& pathname); + FILE * opendata(const char * filename, const char * mode); string_list_type dsubdirs(const char *rel_path, const char* expected_file); string_list_type dfiles(const char *rel_path, const char* glob, const char* exception_str); Index: level_subset.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level_subset.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- level_subset.h 15 Jun 2004 22:56:42 -0000 1.1 +++ level_subset.h 16 Jun 2004 00:40:42 -0000 1.2 @@ -21,6 +21,7 @@ #ifndef SUPERTUX_LEVEL_SUBSET_H #define SUPERTUX_LEVEL_SUBSET_H +#include <vector> #include <string> #include "lispreader.h" @@ -30,6 +31,14 @@ It could be extended to handle manipulation of subsets. */ class LevelSubset { +private: + /** Directory in which the level subset is stored */ + std::string directory; + + /** Level filenames without the leading path ("level1.stl", + "level3.stl", ...) */ + std::vector<std::string> levels; + public: LevelSubset(); ~LevelSubset(); @@ -38,16 +47,18 @@ void load(const char* subset); void save(); + void add_level(const std::string& name); + std::string get_level_filename(unsigned int i); + int get_num_levels() const; std::string name; std::string title; std::string description; Surface* image; - int levels; - + private: - void parse(lisp_object_t* cursor); + void read_info_file(const std::string& info_file); }; #endif Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- level.h 14 Jun 2004 22:45:23 -0000 1.58 +++ level.h 16 Jun 2004 00:40:42 -0000 1.59 @@ -24,37 +24,8 @@ #include <map> #include <string> -#include "screen/surface.h" -#include "lispreader.h" -#include "musicref.h" - -class Tile; - -/** This type holds meta-information about a level-subset. - It could be extended to handle manipulation of subsets. */ -class LevelSubset -{ -public: - LevelSubset(); - ~LevelSubset(); - - static void create(const std::string& subset_name); - void load(const char* subset); - void save(); - - std::string get_level_filename(unsigned int i); - - std::string name; - std::string title; - std::string description; - Surface* image; - int levels; - -private: - void parse(lisp_object_t* cursor); -}; - class Sector; +class LispReader; class Level { Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.92 retrieving revision 1.93 diff -u -d -r1.92 -r1.93 --- level.cpp 9 Jun 2004 19:56:00 -0000 1.92 +++ level.cpp 16 Jun 2004 00:40:41 -0000 1.93 @@ -42,185 +42,6 @@ using namespace std; -LevelSubset::LevelSubset() - : image(0), levels(0) -{ -} - -LevelSubset::~LevelSubset() -{ - delete image; -} - -void LevelSubset::create(const std::string& subset_name) -{ - Level new_lev; - LevelSubset new_subset; - new_subset.name = subset_name; - new_subset.title = "Unknown Title"; - new_subset.description = "No description so far."; - new_subset.save(); - //new_lev.save(subset_name, 1, 0); -} - -void LevelSubset::parse (lisp_object_t* cursor) -{ - while(!lisp_nil_p(cursor)) - { - lisp_object_t* cur = lisp_car(cursor); - char *s; - - if (!lisp_cons_p(cur) || !lisp_symbol_p (lisp_car(cur))) - { - printf("Not good"); - } - else - { - if (strcmp(lisp_symbol(lisp_car(cur)), "title") == 0) - { - if(( s = lisp_string(lisp_car(lisp_cdr(cur)))) != NULL) - { - title = s; - } - } - else if (strcmp(lisp_symbol(lisp_car(cur)), "description") == 0) - { - if(( s = lisp_string(lisp_car(lisp_cdr(cur)))) != NULL) - { - description = s; - } - } - } - cursor = lisp_cdr (cursor); - } -} - -void LevelSubset::load(const char* subset) -{ - FILE* fi; - char filename[1024]; - char str[1024]; - int i; - lisp_object_t* root_obj = 0; - - name = subset; - - snprintf(filename, 1024, "%s/levels/%s/info", st_dir, subset); - if(!faccessible(filename)) - snprintf(filename, 1024, "%s/levels/%s/info", datadir.c_str(), subset); - if(faccessible(filename)) - { - fi = fopen(filename, "r"); - if (fi == NULL) - { - perror(filename); - } - lisp_stream_t stream; - lisp_stream_init_file (&stream, fi); - root_obj = lisp_read (&stream); - - if (root_obj->type == LISP_TYPE_EOF || root_obj->type == LISP_TYPE_PARSE_ERROR) - { - printf("World: Parse Error in file %s", filename); - } - - lisp_object_t* cur = lisp_car(root_obj); - - if (!lisp_symbol_p (cur)) - { - printf("World: Read error in %s",filename); - } - - if (strcmp(lisp_symbol(cur), "supertux-level-subset") == 0) - { - parse(lisp_cdr(root_obj)); - - } - - lisp_free(root_obj); - fclose(fi); - - snprintf(str, 1024, "%s.png", filename); - if(faccessible(str)) - { - delete image; - image = new Surface(str,IGNORE_ALPHA); - } - else - { - snprintf(filename, 1024, "%s/images/status/level-subset-info.png", datadir.c_str()); - delete image; - image = new Surface(filename,IGNORE_ALPHA); - } - } - - for(i=1; i != -1; ++i) - { - /* Get the number of levels in this subset */ - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", st_dir, subset,i); - if(!faccessible(filename)) - { - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", datadir.c_str(), subset,i); - if(!faccessible(filename)) - break; - } - } - levels = --i; -} - -void -LevelSubset::save() -{ - FILE* fi; - string filename; - - /* Save data file: */ - filename = "/levels/" + name + "/"; - - fcreatedir(filename.c_str()); - filename = string(st_dir) + "/levels/" + name + "/info"; - if(!fwriteable(filename.c_str())) - filename = datadir + "/levels/" + name + "/info"; - if(fwriteable(filename.c_str())) - { - fi = fopen(filename.c_str(), "w"); - if (fi == NULL) - { - perror(filename.c_str()); - } - - /* Write header: */ - fprintf(fi,";SuperTux-Level-Subset\n"); - fprintf(fi,"(supertux-level-subset\n"); - - /* Save title info: */ - fprintf(fi," (title \"%s\")\n", title.c_str()); - - /* Save the description: */ - fprintf(fi," (description \"%s\")\n", description.c_str()); - - fprintf( fi,")"); - fclose(fi); - } -} - -std::string -LevelSubset::get_level_filename(unsigned int num) -{ - char filename[1024]; - - // Load data file: - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", st_dir, - name.c_str(), num); - if(!faccessible(filename)) - snprintf(filename, 1024, "%s/levels/%s/level%d.stl", datadir.c_str(), - name.c_str(), num); - - return std::string(filename); -} - -//--------------------------------------------------------------------------- - Level::Level() : name("noname"), author("mr. x"), time_left(500) { Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- setup.cpp 15 Jun 2004 22:38:52 -0000 1.100 +++ setup.cpp 16 Jun 2004 00:40:42 -0000 1.101 @@ -1112,3 +1112,24 @@ exit(ret); } +std::vector<std::string> read_directory(const std::string& pathname) +{ + std::vector<std::string> dirnames; + + DIR* dir = opendir(pathname.c_str()); + if (dir) + { + struct dirent *direntp; + + while((direntp = readdir(dir))) + { + dirnames.push_back(direntp->d_name); + } + + closedir(dir); + } + + return dirnames; +} + +/* EOF */ Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.139 retrieving revision 1.140 diff -u -d -r1.139 -r1.140 --- leveleditor.cpp 14 Jun 2004 22:45:23 -0000 1.139 +++ leveleditor.cpp 16 Jun 2004 00:40:42 -0000 1.140 @@ -822,8 +822,8 @@ le_object_properties_bt->draw(context); } - sprintf(str, "%d/%d", le_levelnb,le_level_subset->levels); - context.draw_text(white_text, str, Vector((le_level_subset->levels < 10) ? -10 : 0, 16), LAYER_GUI); + sprintf(str, "%d/%d", le_levelnb, le_level_subset->get_num_levels()); + context.draw_text(white_text, str, Vector((le_level_subset->get_num_levels() < 10) ? -10 : 0, 16), LAYER_GUI); if(!le_help_shown) context.draw_text(white_small_text, "F1 for Help", Vector(10, 430), LAYER_GUI); @@ -1153,7 +1153,7 @@ le_next_level_bt->event(event); if(le_next_level_bt->get_state() == BUTTON_CLICKED) { - if(le_levelnb < le_level_subset->levels) + if(le_levelnb < le_level_subset->get_num_levels()) { goto_level(le_levelnb+1); } @@ -1165,8 +1165,8 @@ Surface* surf = new Surface(le_level->get_sector("main")->background->get_image(), false); if(confirm_dialog(surf, str)) { - new_lev.save(le_level_subset->name.c_str()); - le_level_subset->levels = le_levelnb; + le_level_subset->add_level("newlevel.stl"); + new_lev.save(le_level_subset->get_level_filename(le_levelnb+1)); goto_level(le_levelnb); } if(surf != NULL) Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.97 retrieving revision 1.98 diff -u -d -r1.97 -r1.98 --- title.cpp 14 Jun 2004 22:45:23 -0000 1.97 +++ title.cpp 16 Jun 2004 00:40:42 -0000 1.98 @@ -129,7 +129,7 @@ contrib_subset_menu->additem(MN_LABEL, subset.title, 0,0); contrib_subset_menu->additem(MN_HL,"",0,0); - for (int i = 1; i <= subset.levels; ++i) + for (int i = 0; i < subset.get_num_levels(); ++i) { Level* level = new Level; level->load(subset.get_level_filename(i)); Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- Makefile.am 14 Jun 2004 22:45:23 -0000 1.36 +++ Makefile.am 16 Jun 2004 00:40:41 -0000 1.37 @@ -44,6 +44,8 @@ interactive_object.h \ level.cpp \ level.h \ +level_subset.cpp \ +level_subset.h \ leveleditor.cpp \ leveleditor.h \ lispreader.cpp \ Index: leveleditor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- leveleditor.h 14 Jun 2004 22:45:23 -0000 1.14 +++ leveleditor.h 16 Jun 2004 00:40:42 -0000 1.15 @@ -27,6 +27,8 @@ #include "game_object.h" #include "screen/surface.h" #include "level.h" +#include "level_subset.h" +#include "moving_object.h" #include "button.h" #include "menu.h" |
From: Ingo R. <gr...@us...> - 2004-06-15 22:56:50
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28237 Added Files: level_subset.cpp level_subset.h Log Message: - moved levelsubset into an own file --- NEW FILE: level_subset.cpp --- // $Id: level_subset.cpp,v 1.1 2004/06/15 22:56:42 grumbel Exp $ // // SuperTux // Copyright (C) 2004 SuperTux Development Team, see AUTHORS for details // // 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 "setup.h" #include "level.h" #include "globals.h" #include "screen/surface.h" #include "level_subset.h" LevelSubset::LevelSubset() : image(0), levels(0) { } LevelSubset::~LevelSubset() { delete image; } void LevelSubset::create(const std::string& subset_name) { Level new_lev; LevelSubset new_subset; new_subset.name = subset_name; new_subset.title = "Unknown Title"; new_subset.description = "No description so far."; new_subset.save(); //new_lev.save(subset_name, 1, 0); } void LevelSubset::parse (lisp_object_t* cursor) { while(!lisp_nil_p(cursor)) { lisp_object_t* cur = lisp_car(cursor); char *s; if (!lisp_cons_p(cur) || !lisp_symbol_p (lisp_car(cur))) { printf("Not good"); } else { if (strcmp(lisp_symbol(lisp_car(cur)), "title") == 0) { if(( s = lisp_string(lisp_car(lisp_cdr(cur)))) != NULL) { title = s; } } else if (strcmp(lisp_symbol(lisp_car(cur)), "description") == 0) { if(( s = lisp_string(lisp_car(lisp_cdr(cur)))) != NULL) { description = s; } } } cursor = lisp_cdr (cursor); } } void LevelSubset::load(const char* subset) { FILE* fi; char filename[1024]; char str[1024]; int i; lisp_object_t* root_obj = 0; name = subset; snprintf(filename, 1024, "%s/levels/%s/info", st_dir, subset); if(!faccessible(filename)) snprintf(filename, 1024, "%s/levels/%s/info", datadir.c_str(), subset); if(faccessible(filename)) { fi = fopen(filename, "r"); if (fi == NULL) { perror(filename); } lisp_stream_t stream; lisp_stream_init_file (&stream, fi); root_obj = lisp_read (&stream); if (root_obj->type == LISP_TYPE_EOF || root_obj->type == LISP_TYPE_PARSE_ERROR) { printf("World: Parse Error in file %s", filename); } lisp_object_t* cur = lisp_car(root_obj); if (!lisp_symbol_p (cur)) { printf("World: Read error in %s",filename); } if (strcmp(lisp_symbol(cur), "supertux-level-subset") == 0) { parse(lisp_cdr(root_obj)); } lisp_free(root_obj); fclose(fi); snprintf(str, 1024, "%s.png", filename); if(faccessible(str)) { delete image; image = new Surface(str,IGNORE_ALPHA); } else { snprintf(filename, 1024, "%s/images/status/level-subset-info.png", datadir.c_str()); delete image; image = new Surface(filename,IGNORE_ALPHA); } } for(i=1; i != -1; ++i) { /* Get the number of levels in this subset */ snprintf(filename, 1024, "%s/levels/%s/level%d.stl", st_dir, subset,i); if(!faccessible(filename)) { snprintf(filename, 1024, "%s/levels/%s/level%d.stl", datadir.c_str(), subset,i); if(!faccessible(filename)) break; } } levels = --i; } void LevelSubset::save() { FILE* fi; std::string filename; /* Save data file: */ filename = "/levels/" + name + "/"; fcreatedir(filename.c_str()); filename = std::string(st_dir) + "/levels/" + name + "/info"; if(!fwriteable(filename.c_str())) filename = datadir + "/levels/" + name + "/info"; if(fwriteable(filename.c_str())) { fi = fopen(filename.c_str(), "w"); if (fi == NULL) { perror(filename.c_str()); } /* Write header: */ fprintf(fi,";SuperTux-Level-Subset\n"); fprintf(fi,"(supertux-level-subset\n"); /* Save title info: */ fprintf(fi," (title \"%s\")\n", title.c_str()); /* Save the description: */ fprintf(fi," (description \"%s\")\n", description.c_str()); fprintf( fi,")"); fclose(fi); } } std::string LevelSubset::get_level_filename(unsigned int num) { char filename[1024]; // Load data file: snprintf(filename, 1024, "%s/levels/%s/level%d.stl", st_dir, name.c_str(), num); if(!faccessible(filename)) snprintf(filename, 1024, "%s/levels/%s/level%d.stl", datadir.c_str(), name.c_str(), num); return std::string(filename); } /* EOF */ --- NEW FILE: level_subset.h --- // $Id: level_subset.h,v 1.1 2004/06/15 22:56:42 grumbel Exp $ // // SuperTux // Copyright (C) 2004 SuperTux Development Team, see AUTHORS for details // // 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 SUPERTUX_LEVEL_SUBSET_H #define SUPERTUX_LEVEL_SUBSET_H #include <string> #include "lispreader.h" class Surface; /** This type holds meta-information about a level-subset. It could be extended to handle manipulation of subsets. */ class LevelSubset { public: LevelSubset(); ~LevelSubset(); static void create(const std::string& subset_name); void load(const char* subset); void save(); std::string get_level_filename(unsigned int i); std::string name; std::string title; std::string description; Surface* image; int levels; private: void parse(lisp_object_t* cursor); }; #endif /* Local Variables: */ /* mode:c++ */ /* End: */ |
From: Ingo R. <gr...@us...> - 2004-06-15 22:39:02
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13882 Modified Files: setup.cpp Log Message: - added option to start in window mode Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- setup.cpp 14 Jun 2004 22:45:23 -0000 1.99 +++ setup.cpp 15 Jun 2004 22:38:52 -0000 1.100 @@ -946,10 +946,13 @@ if (strcmp(argv[i], "--fullscreen") == 0 || strcmp(argv[i], "-f") == 0) { - /* Use full screen: */ - use_fullscreen = true; } + else if (strcmp(argv[i], "--window") == 0 || + strcmp(argv[i], "-w") == 0) + { + use_fullscreen = false; + } else if (strcmp(argv[i], "--joystick") == 0 || strcmp(argv[i], "-j") == 0) { assert(i+1 < argc); @@ -1044,7 +1047,8 @@ " Please see the file \"README.txt\" for more details.\n")); printf(_("Usage: %s [OPTIONS] FILENAME\n\n"), argv[0]); puts(_("Display Options:\n" - " --fullscreen Run in fullscreen mode.\n" + " -f, --fullscreen Run in fullscreen mode.\n" + " -w, --window Run in window mode.\n" " --opengl If OpenGL support was compiled in, this will tell\n" " SuperTux to make use of it.\n" " --sdl Use the SDL software graphical renderer\n" |
From: Ingo R. <gr...@us...> - 2004-06-15 16:29:54
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12484 Modified Files: paratest.stl Log Message: - make use of new bgtiles Index: paratest.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/paratest.stl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- paratest.stl 15 Jun 2004 14:29:32 -0000 1.1 +++ paratest.stl 15 Jun 2004 16:29:44 -0000 1.2 @@ -10,14 +10,14 @@ (height 15) (music "supertux-1.ogg") (gravity 10.000000) - (background (top_red 10) (top_green 10) (top_blue 155) - (bottom_red 200) (bottom_green 200) (bottom_blue 255) + (background (top_red 75) (top_green 100) (top_blue 190) + (bottom_red 220) (bottom_green 230) (bottom_blue 255) ) (tilemap - (layer "para2") + (layer "background") (solid #f) - (speed 0.250000) + (speed 0.2500000) (width 100) (height 20) (tiles @@ -26,51 +26,50 @@ 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 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 0 0 0 0 - 0 0 0 0 0 0 149 150 151 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 149 150 151 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 149 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 152 153 154 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 152 153 154 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 152 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 151 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 - 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 154 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 - 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 150 151 0 0 149 150 150 151 0 152 153 154 0 0 0 0 149 150 160 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 154 0 0 152 153 153 154 0 152 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 158 150 160 159 153 153 158 150 159 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 + 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 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 161 162 163 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 164 165 166 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 161 162 163 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 164 165 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 161 162 163 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 161 162 163 0 164 165 166 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 164 165 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 161 162 163 0 0 0 + 0 0 164 165 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 161 162 171 165 166 0 164 165 166 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 161 162 163 0 0 0 0 0 0 0 0 0 0 0 164 165 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 164 165 166 0 0 0 + 0 0 164 165 166 0 0 0 0 0 0 161 162 163 0 0 0 0 0 0 0 0 0 0 0 161 162 163 167 168 165 165 166 0 167 168 169 0 0 0 0 0 0 161 162 163 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 164 165 166 0 0 0 0 0 0 161 162 163 0 0 164 165 166 0 0 0 0 0 0 161 162 163 0 0 0 0 0 0 164 165 166 0 0 0 + 0 161 171 165 166 0 161 162 162 163 161 171 165 166 0 0 161 162 163 161 162 163 0 161 163 164 165 166 0 0 167 168 169 0 0 0 0 0 0 0 0 0 0 164 165 166 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 164 165 166 0 0 0 0 0 0 164 165 166 0 0 164 165 166 0 0 0 0 0 0 164 165 166 0 0 0 0 0 0 164 165 166 0 0 0 + 162 171 165 165 170 162 171 165 165 170 171 165 165 170 162 162 171 165 170 171 165 170 162 171 170 171 165 170 162 162 162 162 162 162 162 162 162 162 162 162 162 162 162 171 165 166 0 0 0 0 0 0 0 0 0 0 0 0 161 162 162 162 171 165 170 162 162 162 162 162 162 171 165 170 162 162 171 165 170 162 162 162 162 162 162 171 165 170 162 162 162 162 162 162 171 165 170 162 162 162 + 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 170 163 0 0 0 0 0 161 162 163 0 0 0 164 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 + 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 170 162 162 162 162 162 171 165 170 162 162 162 171 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 + 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 + 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 + 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 165 )) - (tilemap - (layer "para") + (layer "background") (solid #f) (speed 0.500000) - (width 100) + (width 200) (height 20) (tiles - 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 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 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 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 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 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 149 150 151 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 149 150 151 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 149 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 0 0 0 0 152 153 154 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 152 153 154 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 152 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 151 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 - 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 154 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 - 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 150 151 0 0 149 150 150 151 0 152 153 154 0 0 0 0 149 150 160 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 154 0 0 152 153 153 154 0 152 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 158 150 160 159 153 153 158 150 159 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 - 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 + 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 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 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 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 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 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 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 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 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 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 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 149 150 151 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 149 150 151 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 149 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 151 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 149 150 151 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 149 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 152 153 154 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 152 153 154 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 152 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 154 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 152 153 154 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 152 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 151 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 151 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 0 0 0 0 0 149 150 150 151 152 153 154 0 0 0 0 149 150 150 151 0 0 0 0 0 0 0 0 + 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 154 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 154 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 0 0 0 0 0 152 153 153 154 152 153 158 160 151 0 0 152 153 153 154 0 0 0 0 0 0 0 0 + 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 150 151 0 0 149 150 150 151 0 152 153 154 0 0 0 0 149 150 160 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 150 151 0 0 149 150 150 151 0 152 153 154 0 0 0 0 149 150 160 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 0 149 150 160 160 159 153 153 158 159 153 153 153 158 160 160 159 153 153 158 150 151 0 0 0 0 0 0 + 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 154 0 0 152 153 153 154 0 152 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 154 0 0 152 153 153 154 0 152 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 0 0 + 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 158 150 160 159 153 153 158 150 159 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 158 150 160 159 153 153 158 150 159 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 154 0 0 0 0 149 150 + 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 151 0 0 152 153 + 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 158 160 160 159 153 + 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 + 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 + 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 153 )) (tilemap @@ -102,7 +101,7 @@ 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 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 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )) (tilemap - (layer "main") + (layer "interactive") (solid #t) (speed 1.000000) (width 310) |
From: Ingo R. <gr...@us...> - 2004-06-15 16:16:55
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3129 Modified Files: supertux.stgt Added Files: snow-para-2.png Log Message: - added second paralax tiles --- NEW FILE: snow-para-2.png --- (This appears to be a binary file; contents omitted.) Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- supertux.stgt 15 Jun 2004 14:28:44 -0000 1.40 +++ supertux.stgt 15 Jun 2004 16:16:46 -0000 1.41 @@ -559,6 +559,35 @@ (tile (id 160) (images (region "snow-para-1.png" 96 64 32 32))) + + (tile (id 161) + (images (region "snow-para-2.png" 0 0 32 32))) + (tile (id 162) + (images (region "snow-para-2.png" 32 0 32 32))) + (tile (id 163) + (images (region "snow-para-2.png" 64 0 32 32))) + + (tile (id 164) + (images (region "snow-para-2.png" 0 32 32 32))) + (tile (id 165) + (images (region "snow-para-2.png" 32 32 32 32))) + (tile (id 166) + (images (region "snow-para-2.png" 64 32 32 32))) + + (tile (id 167) + (images (region "snow-para-2.png" 0 64 32 32))) + (tile (id 168) + (images (region "snow-para-2.png" 32 64 32 32))) + (tile (id 169) + (images (region "snow-para-2.png" 64 64 32 32))) + + (tile (id 170) + (images (region "snow-para-2.png" 96 0 32 32))) + (tile (id 171) + (images (region "snow-para-2.png" 96 32 32 32))) + (tile (id 172) + (images (region "snow-para-2.png" 96 64 32 32))) + ;; Jungle (tile (id 301) |
From: Ingo R. <gr...@us...> - 2004-06-15 14:28:53
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18054/tilesets Modified Files: snow-para-1.png supertux.stgt Log Message: - fixed background tiles Index: snow-para-1.png =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/snow-para-1.png,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 Binary files /tmp/cvsXmZjHz and /tmp/cvsnXmZjU differ Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- supertux.stgt 15 Jun 2004 12:20:53 -0000 1.39 +++ supertux.stgt 15 Jun 2004 14:28:44 -0000 1.40 @@ -533,15 +533,31 @@ (tile (id 149) (images (region "snow-para-1.png" 0 0 32 32))) - (tile (id 150) (images (region "snow-para-1.png" 32 0 32 32))) - (tile (id 151) - (images (region "snow-para-1.png" 0 32 32 32))) + (images (region "snow-para-1.png" 64 0 32 32))) (tile (id 152) + (images (region "snow-para-1.png" 0 32 32 32))) + (tile (id 153) (images (region "snow-para-1.png" 32 32 32 32))) + (tile (id 154) + (images (region "snow-para-1.png" 64 32 32 32))) + + (tile (id 155) + (images (region "snow-para-1.png" 0 64 32 32))) + (tile (id 156) + (images (region "snow-para-1.png" 32 64 32 32))) + (tile (id 157) + (images (region "snow-para-1.png" 64 64 32 32))) + + (tile (id 158) + (images (region "snow-para-1.png" 96 0 32 32))) + (tile (id 159) + (images (region "snow-para-1.png" 96 32 32 32))) + (tile (id 160) + (images (region "snow-para-1.png" 96 64 32 32))) ;; Jungle |
From: Ingo R. <gr...@us...> - 2004-06-15 14:27:43
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16929 Modified Files: tilemap.cpp Log Message: - quick&dirty fix for paralax scrolling tilemap layers Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- tilemap.cpp 14 Jun 2004 22:45:23 -0000 1.11 +++ tilemap.cpp 15 Jun 2004 14:27:34 -0000 1.12 @@ -125,26 +125,57 @@ void TileMap::draw(DrawingContext& context) -{ - /** if we don't round here, we'll have a 1 pixel gap on screen sometimes. - * I have no idea why */ - float start_x = roundf(context.get_translation().x * speed); - float start_y = roundf(context.get_translation().y * speed); - float end_x = std::min(start_x + screen->w, float(width * 32)); - float end_y = std::min(start_y + screen->h, float(height * 32)); - start_x -= int(start_x) % 32; - start_y -= int(start_y) % 32; - int tsx = int(start_x / 32); // tilestartindex x - int tsy = int(start_y / 32); // tilestartindex y - - Vector pos; - int tx, ty; - for(pos.x = start_x, tx = tsx; pos.x < end_x; pos.x += 32, ++tx) { - for(pos.y = start_y, ty = tsy; pos.y < end_y; pos.y += 32, ++ty) { - if (!tiles[ty*width + tx].hidden) - tilemanager->draw_tile(context, tiles[ty*width + tx].id, pos, layer); +{ + if (speed == 1.0) + { + /** if we don't round here, we'll have a 1 pixel gap on screen sometimes. + * I have no idea why */ + float start_x = roundf(context.get_translation().x); + float start_y = roundf(context.get_translation().y); + float end_x = std::min(start_x + screen->w, float(width * 32)); + float end_y = std::min(start_y + screen->h, float(height * 32)); + start_x -= int(start_x) % 32; + start_y -= int(start_y) % 32; + int tsx = int(start_x / 32); // tilestartindex x + int tsy = int(start_y / 32); // tilestartindex y + + Vector pos; + int tx, ty; + for(pos.x = start_x, tx = tsx; pos.x < end_x; pos.x += 32, ++tx) { + for(pos.y = start_y, ty = tsy; pos.y < end_y; pos.y += 32, ++ty) { + if (!tiles[ty*width + tx].hidden) + tilemanager->draw_tile(context, tiles[ty*width + tx].id, pos, layer); + } + } + } + else + { + float trans_x = roundf(context.get_translation().x); + float trans_y = roundf(context.get_translation().y); + + context.push_transform(); + context.set_translation(Vector(trans_x * speed, trans_y * speed)); + + float start_x = roundf(context.get_translation().x); + float start_y = roundf(context.get_translation().y); + float end_x = std::min(start_x + screen->w, float(width * 32)); + float end_y = std::min(start_y + screen->h, float(height * 32)); + start_x -= int(start_x) % 32; + start_y -= int(start_y) % 32; + int tsx = int(start_x / 32); // tilestartindex x + int tsy = int(start_y / 32); // tilestartindex y + + Vector pos; + int tx, ty; + for(pos.x = start_x, tx = tsx; pos.x < end_x; pos.x += 32, ++tx) { + for(pos.y = start_y, ty = tsy; pos.y < end_y; pos.y += 32, ++ty) { + if (!tiles[ty*width + tx].hidden) + tilemanager->draw_tile(context, tiles[ty*width + tx].id, pos, layer); + } + } + + context.pop_transform(); } - } } void |
From: Marek M. <wa...@us...> - 2004-06-15 14:21:30
|
Update of /cvsroot/super-tux/supertux/po In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12021/po Added Files: nl.po Log Message: Added Dutch translation file written by Frank van der Loo --- NEW FILE: nl.po --- # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR SuperTux Development Team # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" "Project-Id-Version: PACGE VERSION\n" "Report-Msgid-Bugs-To: sup...@li...\n" "POT-Creation-Date: 2004-06-10 14:53+0100\n" "PO-Revision-Date: 2004-06-07 HO:MI+ZONE\n" "Last-Translator: Frank van der Loo <fr...@li...>\n" "Language-Team: Dutch <nl...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=iso-8859-1\n" "Content-Transfer-Encoding: 8bit\n" #: src/gameloop.cpp:163 msgid "by " msgstr "door " #: src/gameloop.cpp:523 msgid "PAUSE - Press 'P' To Play" msgstr "PAUSE - Druk op 'P' Om Verder Te Gaan" #: src/gameloop.cpp:528 #, c-format msgid "Playing: " msgstr "Level: " #: src/gameloop.cpp:714 src/worldmap.cpp:849 msgid "SCORE" msgstr "SCORE" #: src/gameloop.cpp:719 msgid "Press ESC To Return" msgstr "Druk op ESC Om Terug Te Gaan" #: src/gameloop.cpp:724 msgid "TIME's UP" msgstr "TIJD is OM" #: src/gameloop.cpp:728 msgid "TIME" msgstr "TIJD" #: src/gameloop.cpp:735 src/gameloop.cpp:736 src/worldmap.cpp:853 msgid "COINS" msgstr "MUNTEN" #: src/gameloop.cpp:757 src/gameloop.cpp:758 src/worldmap.cpp:874 #: src/worldmap.cpp:875 msgid "LIVES" msgstr "LEVENS" #: src/gameloop.cpp:780 msgid "Result:" msgstr "Resultaat:" #: src/gameloop.cpp:783 src/worldmap.cpp:726 #, c-format msgid "SCORE: %d" msgstr "SCORE: %d" #: src/gameloop.cpp:786 src/worldmap.cpp:730 #, c-format msgid "COINS: %d" msgstr "MUNTEN: %d" #: src/gameloop.cpp:815 #, c-format msgid "Slot %d - Savegame" msgstr "Slot %d - Bewaard spel" #: src/gameloop.cpp:818 #, c-format msgid "Slot %d - Free" msgstr "Slot %d - Vrij" #: src/menu.cpp:76 msgid "Yes" msgstr "Ja" #: src/menu.cpp:77 msgid "No" msgstr "Nee" #: src/menu.cpp:256 msgid "Up cursor" msgstr "Pijltje omhoom" #: src/menu.cpp:259 msgid "Down cursor" msgstr "Pijltje omlaag" #: src/menu.cpp:262 msgid "Left cursor" msgstr "Pijltje naar links" #: src/menu.cpp:265 msgid "Right cursor" msgstr "Pijltje naar rechts" #: src/menu.cpp:268 msgid "Return" msgstr "Enter" #: src/menu.cpp:271 msgid "Space" msgstr "Spatiebalk" #: src/menu.cpp:274 msgid "Right Shift" msgstr "Rechter Shift toets" #: src/menu.cpp:277 msgid "Left Shift" msgstr "Linker Shift toets" #: src/menu.cpp:280 msgid "Right Control" msgstr "Rechter Control toets" #: src/menu.cpp:283 msgid "Left Control" msgstr "Linker Control toets" #: src/menu.cpp:286 msgid "Right Alt" msgstr "Rechter Alt toets" #: src/menu.cpp:289 msgid "Left Alt" msgstr "Linker Alt toets" #: src/setup.cpp:390 src/setup.cpp:450 msgid "Start Game" msgstr "Spel Starten" #: src/setup.cpp:391 src/title.cpp:91 msgid "Contrib Levels" msgstr "Contrib Levels" #: src/setup.cpp:392 src/setup.cpp:397 src/setup.cpp:473 src/setup.cpp:480 msgid "Options" msgstr "Opties" #: src/setup.cpp:393 msgid "Level Editor" msgstr "Level Bewerker" #: src/setup.cpp:394 msgid "Credits" msgstr "Credits" #: src/setup.cpp:395 msgid "Quit" msgstr "Afsluiten" #: src/setup.cpp:400 msgid "OpenGL " msgstr "OpenGL " #: src/setup.cpp:402 msgid "OpenGL (not supported)" msgstr "OpenGL (niet ondersteund)" #: src/setup.cpp:404 msgid "Fullscreen" msgstr "Volledig scherm" #: src/setup.cpp:407 src/setup.cpp:412 msgid "Sound " msgstr "Geluid " #: src/setup.cpp:408 src/setup.cpp:413 msgid "Music " msgstr "Muziek " #: src/setup.cpp:415 msgid "Show FPS " msgstr "Toon FPS " #: src/setup.cpp:416 msgid "Setup Keys" msgstr "Toetsen Instellen" #: src/setup.cpp:419 msgid "Setup Joystick" msgstr "Joystick Instellen" #: src/setup.cpp:422 src/setup.cpp:434 src/setup.cpp:447 src/setup.cpp:458 #: src/title.cpp:104 src/title.cpp:141 msgid "Back" msgstr "Terug" #: src/setup.cpp:424 msgid "Keyboard Setup" msgstr "Toetsenbord Instellen" #: src/setup.cpp:426 msgid "Left move" msgstr "Naar links" #: src/setup.cpp:427 msgid "Right move" msgstr "Naar rechts" #: src/setup.cpp:428 msgid "Jump" msgstr "Spring" #: src/setup.cpp:429 msgid "Duck" msgstr "Buk" #: src/setup.cpp:430 msgid "Activate" msgstr "Activeer" #: src/setup.cpp:432 msgid "Power/Run" msgstr "Kracht/Rennen" #: src/setup.cpp:438 msgid "Joystick Setup" msgstr "Joystick Instellen" #: src/setup.cpp:442 msgid "A button" msgstr "A knop" #: src/setup.cpp:443 msgid "B button" msgstr "B knop" #: src/setup.cpp:460 msgid "Save Game" msgstr "Bewaar Spel" #: src/setup.cpp:470 src/setup.cpp:477 msgid "Pause" msgstr "Pause" #: src/setup.cpp:472 src/setup.cpp:479 msgid "Continue" msgstr "Verder gaan" #: src/setup.cpp:475 msgid "Abort Level" msgstr "Level Afbreken" #: src/setup.cpp:482 msgid "Quit Game" msgstr "Spel Afsluiten" #: src/setup.cpp:484 msgid "Enter your name:" msgstr "Voer uw naam in:" #: src/setup.cpp:1043 msgid " SuperTux " msgstr " SuperTux " #: src/setup.cpp:1043 msgid "" "\n" " Please see the file \"README.txt\" for more details.\n" msgstr "" "\n" " Lees a.u.b. het bestand \"README.txt\" voor meer details.\n" #: src/setup.cpp:1045 #, c-format msgid "" "Usage: %s [OPTIONS] FILENAME\n" "\n" msgstr "" "Gebruik: %s [OPTIES] BESTANDSNAAM\n" "\n" #: src/setup.cpp:1046 msgid "" "Display Options:\n" " --fullscreen Run in fullscreen mode.\n" " --opengl If OpenGL support was compiled in, this will tell\n" " SuperTux to make use of it.\n" " --sdl Use the SDL software graphical renderer\n" "\n" "Sound Options:\n" " --disable-sound If sound support was compiled in, this will\n" " disable sound for this session of the game.\n" " --disable-music Like above, but this will disable music.\n" "\n" "Misc Options:\n" " -j, --joystick NUM Use joystick NUM (default: 0)\n" " --joymap XAXIS:YAXIS:A:B:START\n" " Define how joystick buttons and axis should be mapped\n" " --leveleditor Opens the leveleditor in a file. (Only works when a " "file is provided.)\n" " -d, --datadir DIR Load Game data from DIR (default: automatic)\n" " --debug-mode Enables the debug-mode, which is useful for " "developers.\n" " --help Display a help message summarizing command-line\n" " options, license and game controls.\n" " --usage Display a brief message summarizing command-line " "options.\n" " --version Display the version of SuperTux you're running.\n" "\n" msgstr "" "Beeld Opties:\n" " --fullscreen Draai in volledig scherm.\n" " --opengl Als OpenGL ondersteuning is meegecompileerd, dan " "vertelt dit\n" " SuperTux om er gebruik van te maken.\n" " --sdl Gebruik SDL voor het renderen\n" "\n" "Geluid Opties:\n" " --disable-sound Als geluidsondersteuning is meegecompileerd, dan " "schakelt dit\n" " het geluid uit voor deze sessie van het spel.\n" " --disable-music Zoals hierboven, maar dit schakelt de muziek uit.\n" "\n" "Overige Opties:\n" " -j, --joystick NUM Gebruik joystick NUM (standaard: 0)\n" " --joymap XAXIS:YAXIS:A:B:START\n" " Defineert hoe de joystick knoppen en assen gebruikt " "worden\n" " --leveleditor Opent de leveleditor in een bestand. (Werkt alleen als " "een bestand is opgegeven.)\n" " -d, --datadir DIR Laad Spel data uit DIR (standaard: automatisch)\n" " --debug-mode Schakelt de debug-modus in, wat nuttig is voor " "ontwikkelaars.\n" " --help Toon een help bericht waarin de opties,\n" " licentie en besturing worden getoond.\n" " --usage Toon een kort bericht waarin de opties worden " "opgesomd.\n" " --version Toon de versie van SuperTux die u heeft.\n" "\n" #: src/setup.cpp:1102 #, c-format msgid "" "Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--" "debug-mode] | [--usage | --help | --version] [--leveleditor] FILENAME\n" msgstr "" "Gebruik: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--" "debug-mode] | [--usage | --help | --version] [--leveleditor] BESTANDSNAAM\n" #: src/title.cpp:277 msgid "" "Copyright (c) 2003 SuperTux Devel Team\n" "This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n" "are welcome to redistribute it under certain conditions; see the file " "COPYING\n" "for details.\n" msgstr "" "Copyright (C) 2003 SuperTux Devel Team\n" "Dit spel komt ZONDER ENIGE GARANTIE. Dit is vrije software, en u\n" "mag het verspreiden onder bepaalde voorwaarden; bekijk het bestand COPYING\n" "voor details.\n" #: src/title.cpp:327 #, c-format msgid "Are you sure you want to delete slot %d?" msgstr "Weet u zeker dat u slot %d wilt verwijderen?" #: src/worldmap.cpp:723 msgid "GAMEOVER" msgstr "GAMEOVER" #~ msgid " SuperTux " #~ msgstr " SuperTux " #~ msgid "" #~ "\n" #~ "Copyright (c) 2003 SuperTux Devel Team\n" #~ "This game comes with ABSOLUTELY NO WARRANTY. This is free software, and " #~ "you\n" #~ "are welcome to redistribute it under certain conditions; see the file " #~ "COPYING\n" #~ "for details.\n" #~ msgstr "" #~ "\n" #~ "Copyright (C) 2003 SuperTux Devel Team\n" #~ "Dit spel komt ZONDER ENIGE GARANTIE. Dit is vrije software, en u\n" #~ "mag het verspreiden onder bepaalde voorwaarden; bekijk het bestand " #~ "COPYING\n" #~ "voor details.\n" |
From: Marek M. <wa...@us...> - 2004-06-15 14:21:30
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12021 Modified Files: config.h.in Log Message: Added Dutch translation file written by Frank van der Loo Index: config.h.in =================================================================== RCS file: /cvsroot/super-tux/supertux/config.h.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- config.h.in 13 Jun 2004 21:48:15 -0000 1.1 +++ config.h.in 15 Jun 2004 14:21:21 -0000 1.2 @@ -242,9 +242,9 @@ /* If using the C implementation of alloca, define if you know the direction of stack growth for your system; otherwise it will be automatically deduced at run-time. - STACK_DIRECTION > 0 => grows toward higher addresses - STACK_DIRECTION < 0 => grows toward lower addresses - STACK_DIRECTION = 0 => direction of growth unknown */ + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown */ #undef STACK_DIRECTION /* Define to 1 if you have the ANSI C header files. */ @@ -256,9 +256,11 @@ /* Define to empty if `const' does not conform to ANSI C. */ #undef const -/* Define as `__inline' if that's what the C compiler calls it, or to nothing - if it is not supported. */ +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus #undef inline +#endif /* Define to `long' if <sys/types.h> does not define. */ #undef off_t |
From: Ingo R. <gr...@us...> - 2004-06-15 12:21:17
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7802/data/images/tilesets Modified Files: supertux.stgt Added Files: snow-para-1.png Log Message: - added background tiles for snow --- NEW FILE: snow-para-1.png --- (This appears to be a binary file; contents omitted.) Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- supertux.stgt 13 Jun 2004 17:56:43 -0000 1.38 +++ supertux.stgt 15 Jun 2004 12:20:53 -0000 1.39 @@ -275,7 +275,7 @@ (anim-speed 50)) (tile (id 82) -;; (images "distro-0.png" "distro-1.png" "distro-2.png" "distro-3.png") + ;; (images "distro-0.png" "distro-1.png" "distro-2.png" "distro-3.png") (images "coin1.png" "coin2.png" "coin3.png" "coin2.png" ) (anim-speed 45) (solid #f) @@ -482,110 +482,122 @@ (goal #t) (data 1) (editor-images "finalgoal.png")) -(tile (id 133) + (tile (id 133) (images) (goal #t) (data 0) (editor-images "endseq.png")) -(tile (id 134) - (solid #f) - (images "nolok1.png")) -(tile (id 135) - (solid #f) - (images "nolok2.png")) + (tile (id 134) + (solid #f) + (images "nolok1.png")) + (tile (id 135) + (solid #f) + (images "nolok2.png")) -; Signs -(tile (id 136) + ; Signs + (tile (id 136) (solid #f) (images "run1.png")) -(tile (id 137) + (tile (id 137) (solid #f) (images "run2.png")) -(tile (id 138) + (tile (id 138) (solid #f) (images "run3.png")) -(tile (id 139) + (tile (id 139) (solid #f) (images "run4.png")) -(tile (id 141) - (solid #f) - (images "sign_right1.png")) -(tile (id 142) - (solid #f) - (images "sign_right2.png")) -(tile (id 143) - (solid #f) - (images "sign_right3.png")) -(tile (id 144) - (solid #f) - (images "sign_right4.png")) + (tile (id 141) + (solid #f) + (images "sign_right1.png")) + (tile (id 142) + (solid #f) + (images "sign_right2.png")) + (tile (id 143) + (solid #f) + (images "sign_right3.png")) + (tile (id 144) + (solid #f) + (images "sign_right4.png")) -; Grasslands + ;; Grasslands - (tile (id 145) - (images "grasslands1.png")) - (tile (id 146) - (images "grasslands2.png")) - (tile (id 147) - (images "grasslands3.png")) - (tile (id 148) - (images "grasslands4.png")) + (tile (id 145) + (images "grasslands1.png")) + (tile (id 146) + (images "grasslands2.png")) + (tile (id 147) + (images "grasslands3.png")) + (tile (id 148) + (images "grasslands4.png")) -; Jungle + (tile (id 149) + (images (region "snow-para-1.png" 0 0 32 32))) - (tile (id 301) - (solid #f) - (images "jungle1.png")) - (tile (id 302) - (solid #f) - (images "jungle2.png")) - (tile (id 303) - (solid #f) - (images "jungle3.png")) - (tile (id 304) - (solid #t) - (images "jungle4.png")) - (tile (id 305) - (solid #t) - (images "jungle5.png")) - (tile (id 306) - (solid #t) - (images "jungle6.png")) - (tile (id 307) - (solid #t) - (images "jungle7.png")) - (tile (id 308) - (solid #t) - (images "jungle8.png")) - (tile (id 309) - (solid #t) - (images "jungle9.png")) - (tile (id 310) - (solid #t) - (images "jungle10.png")) - (tile (id 311) - (solid #t) - (images "jungle11.png")) - (tile (id 312) - (solid #t) - (anim-speed 300) - (images "jungle12-1.png") - (images "jungle12-1.png") - (images "jungle12-1.png") - (images "jungle12-1.png") - (images "jungle12-2.png") - (images "jungle12-3.png") - (images "jungle12-4.png") - (images "jungle12-4.png") - (images "jungle12-4.png") - (images "jungle12-4.png") - (images "jungle12-3.png") - (images "jungle12-2.png")) + (tile (id 150) + (images (region "snow-para-1.png" 32 0 32 32))) -; Spike - (tile (id 200) - (spike #t) - (images "spike.png")) + (tile (id 151) + (images (region "snow-para-1.png" 0 32 32 32))) + + (tile (id 152) + (images (region "snow-para-1.png" 32 32 32 32))) + + ;; Jungle + + (tile (id 301) + (solid #f) + (images "jungle1.png")) + (tile (id 302) + (solid #f) + (images "jungle2.png")) + (tile (id 303) + (solid #f) + (images "jungle3.png")) + (tile (id 304) + (solid #t) + (images "jungle4.png")) + (tile (id 305) + (solid #t) + (images "jungle5.png")) + (tile (id 306) + (solid #t) + (images "jungle6.png")) + (tile (id 307) + (solid #t) + (images "jungle7.png")) + (tile (id 308) + (solid #t) + (images "jungle8.png")) + (tile (id 309) + (solid #t) + (images "jungle9.png")) + (tile (id 310) + (solid #t) + (images "jungle10.png")) + (tile (id 311) + (solid #t) + (images "jungle11.png")) + (tile (id 312) + (solid #t) + (anim-speed 300) + (images "jungle12-1.png" + "jungle12-1.png" + "jungle12-1.png" + "jungle12-1.png" + "jungle12-2.png" + "jungle12-3.png" + "jungle12-4.png" + "jungle12-4.png" + "jungle12-4.png" + "jungle12-4.png" + "jungle12-3.png" + "jungle12-2.png")) + + ; Spike + (tile (id 200) + (spike #t) + (images "spike.png")) ) |
From: Ingo R. <gr...@us...> - 2004-06-15 12:19:08
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5762 Modified Files: lispreader.cpp lispreader.h tile.cpp Log Message: - change subimage loading syntax to be more usefull, ie. now its (images "somefile" (region "somefile" 0 0 32 32") "someotherfile") Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- tile.cpp 14 Jun 2004 22:45:23 -0000 1.30 +++ tile.cpp 15 Jun 2004 12:18:59 -0000 1.31 @@ -28,6 +28,74 @@ #include "vector.h" #include "screen/drawing_context.h" +/** Dirty little helper to create a surface from a snipped of lisp: + * + * "filename" + * (region "filename" x y w h) + */ +static +Surface* create_surface(lisp_object_t* cur) +{ + if (lisp_string_p(cur)) + { + return new Surface(datadir + "/images/tilesets/" + lisp_string(cur), + USE_ALPHA); + } + else if (lisp_cons_p(cur) && lisp_symbol_p(lisp_car(cur))) + { + lisp_object_t* sym = lisp_car(cur); + lisp_object_t* data = lisp_cdr(cur); + + if (strcmp(lisp_symbol(sym), "region") == 0) + { + if (lisp_list_length(data) == 5) // (image-region filename x y w h) + { + return new Surface(datadir + "/images/tilesets/" + lisp_string(lisp_car(data)), + lisp_integer(lisp_list_nth(data, 1)), + lisp_integer(lisp_list_nth(data, 2)), + lisp_integer(lisp_list_nth(data, 3)), + lisp_integer(lisp_list_nth(data, 4)), + USE_ALPHA); + } + else + { + std::cout << "Tile: Type mispatch, should be '(region \"somestring\" x y w h)'" << std::endl; + return 0; + } + } + else + { + std::cout << "Tile: Unhandled tag: " << lisp_symbol(sym) << std::endl; + return 0; + } + } + + std::cout << "Tile: unhandled element" << std::endl; + return 0; +} + +/** Create a vector of surfaces (aka Sprite) from a piece of lisp: + ((image "bla.png") (image-region "bla.png") ...) + */ +static +std::vector<Surface*> create_surfaces(lisp_object_t* cur) +{ + std::vector<Surface*> surfs; + + while(cur) + { + Surface* surface = create_surface(lisp_car(cur)); + if (surface) + surfs.push_back(surface); + else + std::cout << "Tile: Couldn't create image" << std::endl; + + cur = lisp_cdr(cur); + } + + return surfs; +} + Tile::Tile() : id(-1), attributes(0), data(0), next_tile(0), anim_speed(25) { @@ -79,38 +147,9 @@ reader.read_int("anim-speed", anim_speed); reader.read_int("next-tile", next_tile); - std::vector<std::string> filenames; - reader.read_string_vector("images", filenames); - std::vector<std::string> editor_filenames; - reader.read_string_vector("editor-images", editor_filenames); - - std::vector<int> grid; - reader.read_int_vector("grid", grid); - - // read images - for(std::vector<std::string>::iterator i = filenames.begin(); - i != filenames.end(); ++i) - { - if (grid.size() == 4) - { - Surface* surface = new Surface(datadir + "/images/tilesets/" + *i, - grid[0], grid[1], grid[2], grid[3], - USE_ALPHA); - images.push_back(surface); - } - else - { - Surface* surface = new Surface(datadir + "/images/tilesets/" + *i, USE_ALPHA); - images.push_back(surface); - } - } - - for(std::vector<std::string>::iterator i = editor_filenames.begin(); - i != editor_filenames.end(); ++i) { - Surface* surface - = new Surface(datadir + "/images/tilesets/" + *i, USE_ALPHA); - editor_images.push_back(surface); - } + // FIXME: make images and editor_images a sprite + images = create_surfaces(reader.read_lisp("images")); + editor_images = create_surfaces(reader.read_lisp("editor-images")); return id; } Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- lispreader.cpp 9 Jun 2004 05:23:19 -0000 1.23 +++ lispreader.cpp 15 Jun 2004 12:18:59 -0000 1.24 @@ -1102,14 +1102,10 @@ return true; } -LispReader* +lisp_object_t* LispReader::read_lisp(const char* name) { - lisp_object_t* obj = search_for(name); - if(!obj) - return 0; - - return new LispReader(obj); + return search_for(name); } bool Index: lispreader.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispreader.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- lispreader.h 9 Jun 2004 05:23:20 -0000 1.13 +++ lispreader.h 15 Jun 2004 12:18:59 -0000 1.14 @@ -192,7 +192,7 @@ bool read_float(const char* name, float& f); bool read_bool(const char* name, bool& b); bool read_lisp(const char* name, lisp_object_t*& b); - LispReader* read_lisp(const char* name); + lisp_object_t* read_lisp(const char* name); static LispReader* load(const std::string& filename, const std::string& toplevellist); |
From: Ingo R. <gr...@us...> - 2004-06-14 22:56:28
|
Update of /cvsroot/super-tux/supertux/src/screen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18090 Modified Files: surface.cpp surface.h Removed Files: texture.cpp texture.h Log Message: - moved gradient fix over into surface.h, removed texture.h Index: surface.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/surface.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- surface.cpp 14 Jun 2004 22:45:24 -0000 1.1 +++ surface.cpp 14 Jun 2004 22:56:17 -0000 1.2 @@ -170,9 +170,12 @@ surfaces.push_back(this); } -Surface::Surface(Color top_background, Color bottom_background, int w, int h) - : data(top_background, bottom_background, w, h), w(0), h(0) +Surface::Surface(Color top_background, Color bottom_background, int w_, int h_) + : data(top_background, bottom_background, 0, 0), w(0), h(0) { + // FIXME: Gradient surfaces currently don't accept width/height + // If nonzero values are passed to data.create(), supertux + // crashes. impl = data.create(); if (impl) { Index: surface.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/surface.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- surface.h 14 Jun 2004 22:45:24 -0000 1.1 +++ surface.h 14 Jun 2004 22:56:17 -0000 1.2 @@ -97,7 +97,7 @@ Surface(SDL_Surface* surf, int use_alpha); Surface(const std::string& file, int use_alpha); Surface(const std::string& file, int x, int y, int w, int h, int use_alpha); - Surface(Color top_gradient, Color bottom_gradient, int w, int h); + Surface(Color top_gradient, Color bottom_gradient, int w_, int h_); ~Surface(); /** Reload the surface, which is necesarry in case of a mode swich */ --- texture.h DELETED --- --- texture.cpp DELETED --- |
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9380 Modified Files: Makefile.am background.h badguy.h button.h gameobjs.cpp gameobjs.h high_scores.cpp level.h leveleditor.cpp leveleditor.h menu.h mousecursor.h particlesystem.h player.h scene.h sector.cpp setup.cpp special.h sprite.h supertux.cpp tile.cpp tile.h tilemap.cpp title.cpp worldmap.cpp Added Files: tile_manager.cpp tile_manager.h Log Message: - moved tilemanager into its own class - renamed texture.h to surface.h Index: tile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- tile.cpp 14 Jun 2004 22:08:01 -0000 1.29 +++ tile.cpp 14 Jun 2004 22:45:23 -0000 1.30 @@ -21,13 +21,13 @@ #include <cassert> #include <iostream> +#include "globals.h" #include "tile.h" #include "scene.h" +#include "lispreader.h" +#include "vector.h" #include "screen/drawing_context.h" -TileManager* TileManager::instance_ = 0; -std::set<TileGroup>* TileManager::tilegroups_ = 0; - Tile::Tile() : id(-1), attributes(0), data(0), next_tile(0), anim_speed(25) { @@ -115,129 +115,5 @@ return id; } -//--------------------------------------------------------------------------- - -TileManager::TileManager() -{ - std::string filename = datadir + "/images/tilesets/supertux.stgt"; - load_tileset(filename); -} - -TileManager::~TileManager() -{ - for(std::vector<Tile*>::iterator i = tiles.begin(); i != tiles.end(); ++i) { - delete *i; - } - - delete tilegroups_; -} - -void TileManager::load_tileset(std::string filename) -{ - if(filename == current_tileset) - return; - - // free old tiles - for(std::vector<Tile*>::iterator i = tiles.begin(); i != tiles.end(); ++i) { - delete *i; - } - tiles.clear(); - - lisp_object_t* root_obj = lisp_read_from_file(filename); - - if (!root_obj) - st_abort("Couldn't load file", filename); - - if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-tiles") == 0) - { - lisp_object_t* cur = lisp_cdr(root_obj); - int tileset_id = 0; - - while(!lisp_nil_p(cur)) - { - lisp_object_t* element = lisp_car(cur); - - if (strcmp(lisp_symbol(lisp_car(element)), "tile") == 0) - { - LispReader reader(lisp_cdr(element)); - - Tile* tile = new Tile; - int tile_id = tile->read(reader); - if(tile_id < 0) { - std::cerr - << "Warning: parse error when reading a tile, skipping.\n"; - continue; - } - - tile_id += tileset_id; - - if(tile_id >= int(tiles.size())) - tiles.resize(tile_id+1); - tiles[tile_id] = tile; - } - else if (strcmp(lisp_symbol(lisp_car(element)), "tileset") == 0) - { - LispReader reader(lisp_cdr(element)); - std::string filename; - reader.read_string("file", filename); - filename = datadir + "/images/tilesets/" + filename; - load_tileset(filename); - } - else if (strcmp(lisp_symbol(lisp_car(element)), "tilegroup") == 0) - { - TileGroup new_; - LispReader reader(lisp_cdr(element)); - reader.read_string("name", new_.name); - reader.read_int_vector("tiles", new_.tiles); - if(!tilegroups_) - tilegroups_ = new std::set<TileGroup>; - tilegroups_->insert(new_).first; - } - else if (strcmp(lisp_symbol(lisp_car(element)), "properties") == 0) - { - LispReader reader(lisp_cdr(element)); - reader.read_int("id", tileset_id); - tileset_id *= 1000; - } - else - { - std::cerr << "Unknown symbol: " << - lisp_symbol(lisp_car(element)) << "\n"; - } - - cur = lisp_cdr(cur); - } - } - else - { - assert(0); - } - - lisp_free(root_obj); - current_tileset = filename; -} - -void -TileManager::draw_tile(DrawingContext& context, unsigned int c, - const Vector& pos, int layer) -{ - if(c == 0) - return; - - Tile& tile = get(c); - - if(!tile.images.size()) - return; - - if(tile.images.size() > 1) - { - size_t frame - = ((global_frame_counter*25) / tile.anim_speed) % tile.images.size(); - context.draw_surface(tile.images[frame], pos, layer); - } - else if (tile.images.size() == 1) - { - context.draw_surface(tile.images[0], pos, layer); - } -} +/* EOF */ Index: mousecursor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/mousecursor.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- mousecursor.h 9 Jun 2004 05:23:20 -0000 1.8 +++ mousecursor.h 14 Jun 2004 22:45:23 -0000 1.9 @@ -23,7 +23,7 @@ #include <string> #include "timer.h" -#include "screen/texture.h" +#include "screen/surface.h" #define MC_FRAME_PERIOD 800 // in ms Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- sector.cpp 14 Jun 2004 22:08:01 -0000 1.10 +++ sector.cpp 14 Jun 2004 22:45:23 -0000 1.11 @@ -24,6 +24,7 @@ #include <fstream> #include <stdexcept> +#include "globals.h" #include "sector.h" #include "lispreader.h" #include "badguy.h" Index: gameobjs.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- gameobjs.h 14 Jun 2004 22:08:01 -0000 1.27 +++ gameobjs.h 14 Jun 2004 22:45:23 -0000 1.28 @@ -23,7 +23,7 @@ #define SUPERTUX_GAMEOBJS_H #include "type.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "timer.h" #include "scene.h" #include "physic.h" Index: particlesystem.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/particlesystem.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- particlesystem.h 9 Jun 2004 05:23:20 -0000 1.9 +++ particlesystem.h 14 Jun 2004 22:45:23 -0000 1.10 @@ -22,7 +22,7 @@ #include <vector> -#include "screen/texture.h" +#include "screen/surface.h" #include "game_object.h" #include "serializable.h" Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.96 retrieving revision 1.97 diff -u -d -r1.96 -r1.97 --- title.cpp 7 Jun 2004 22:43:24 -0000 1.96 +++ title.cpp 14 Jun 2004 22:45:23 -0000 1.97 @@ -37,7 +37,7 @@ #include "globals.h" #include "title.h" #include "screen/screen.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "high_scores.h" #include "menu.h" #include "timer.h" Index: leveleditor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- leveleditor.h 3 Jun 2004 11:26:12 -0000 1.13 +++ leveleditor.h 14 Jun 2004 22:45:23 -0000 1.14 @@ -25,7 +25,7 @@ #include "screen/drawing_context.h" #include "game_object.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "level.h" #include "button.h" #include "menu.h" Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.138 retrieving revision 1.139 diff -u -d -r1.138 -r1.139 --- leveleditor.cpp 14 Jun 2004 22:08:01 -0000 1.138 +++ leveleditor.cpp 14 Jun 2004 22:45:23 -0000 1.139 @@ -44,6 +44,7 @@ #include "player.h" #include "scene.h" #include "tile.h" +#include "tile_manager.h" #include "resources.h" #include "background.h" #include "camera.h" Index: background.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/background.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- background.h 9 Jun 2004 05:23:20 -0000 1.8 +++ background.h 14 Jun 2004 22:45:23 -0000 1.9 @@ -20,7 +20,7 @@ #ifndef SUPERTUX_BACKGROUND_H #define SUPERTUX_BACKGROUND_H -#include "screen/texture.h" +#include "screen/surface.h" #include "screen/drawing_context.h" #include "game_object.h" #include "lispreader.h" Index: scene.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- scene.h 30 May 2004 01:08:49 -0000 1.31 +++ scene.h 14 Jun 2004 22:45:23 -0000 1.32 @@ -20,7 +20,7 @@ #ifndef SUPERTUX_SCENE_H #define SUPERTUX_SCENE_H -#include "screen/texture.h" +#include "screen/surface.h" #include "timer.h" #define FRAME_RATE 10 // 100 Frames per second (10ms) Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- badguy.h 14 Jun 2004 18:34:25 -0000 1.54 +++ badguy.h 14 Jun 2004 22:45:23 -0000 1.55 @@ -26,7 +26,7 @@ #include "SDL.h" #include "timer.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "physic.h" #include "sprite.h" #include "defines.h" Index: supertux.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/supertux.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- supertux.cpp 9 Jun 2004 05:23:20 -0000 1.22 +++ supertux.cpp 14 Jun 2004 22:45:23 -0000 1.23 @@ -34,8 +34,8 @@ #include "screen/screen.h" #include "worldmap.h" #include "resources.h" -#include "screen/texture.h" -#include "tile.h" +#include "screen/surface.h" +#include "tile_manager.h" #include "gettext.h" int main(int argc, char * argv[]) Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.66 retrieving revision 1.67 diff -u -d -r1.66 -r1.67 --- menu.h 9 Jun 2004 05:23:20 -0000 1.66 +++ menu.h 14 Jun 2004 22:45:23 -0000 1.67 @@ -24,7 +24,7 @@ #include "SDL.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "timer.h" #include "type.h" #include "mousecursor.h" Index: gameobjs.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- gameobjs.cpp 14 Jun 2004 22:08:01 -0000 1.40 +++ gameobjs.cpp 14 Jun 2004 22:45:23 -0000 1.41 @@ -23,7 +23,9 @@ #include <iostream> #include <cmath> +#include "globals.h" #include "tile.h" +#include "tile_manager.h" #include "gameloop.h" #include "gameobjs.h" #include "sprite_manager.h" Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- Makefile.am 7 Jun 2004 19:21:18 -0000 1.35 +++ Makefile.am 14 Jun 2004 22:45:23 -0000 1.36 @@ -11,8 +11,8 @@ screen/font.cpp \ screen/screen.h \ screen/screen.cpp \ -screen/texture.cpp \ -screen/texture.h \ +screen/surface.cpp \ +screen/surface.h \ lispwriter.h \ lispwriter.cpp \ badguy.cpp \ @@ -85,6 +85,8 @@ worldmap.h \ tile.h \ tile.cpp \ +tile_manager.h \ +tile_manager.cpp \ resources.h \ resources.cpp \ gameobjs.h \ Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- tile.h 14 Jun 2004 22:08:01 -0000 1.28 +++ tile.h 14 Jun 2004 22:45:23 -0000 1.29 @@ -21,16 +21,11 @@ #ifndef TILE_H #define TILE_H -#include <set> -#include <map> #include <vector> +#include "SDL.h" +#include "screen/surface.h" -#include "screen/texture.h" -#include "globals.h" -#include "lispreader.h" -#include "setup.h" -#include "vector.h" - +class Vector; class LispReader; /** @@ -107,54 +102,6 @@ } }; -struct TileGroup -{ - friend bool operator<(const TileGroup& lhs, const TileGroup& rhs) - { return lhs.name < rhs.name; }; - friend bool operator>(const TileGroup& lhs, const TileGroup& rhs) - { return lhs.name > rhs.name; }; - - std::string name; - std::vector<int> tiles; -}; - -class TileManager -{ - private: - TileManager(); - ~TileManager(); - - std::vector<Tile*> tiles; - static TileManager* instance_ ; - static std::set<TileGroup>* tilegroups_; - void load_tileset(std::string filename); - - std::string current_tileset; - - public: - static TileManager* instance() - { return instance_ ? instance_ : instance_ = new TileManager(); } - static void destroy_instance() - { delete instance_; instance_ = 0; } - - void draw_tile(DrawingContext& context, unsigned int id, - const Vector& pos, int layer); - - static std::set<TileGroup>* tilegroups() { if(!instance_) { instance_ = new TileManager(); } return tilegroups_ ? tilegroups_ : tilegroups_ = new std::set<TileGroup>; } - Tile& get(unsigned int id) { - - if(id < tiles.size()) - { - return *tiles[id]; - } - else - { - // Never return 0, but return the 0th tile instead so that - // user code doesn't have to check for NULL pointers all over - // the place - return *tiles[0]; - } - } -}; - #endif + +/* EOF */ Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.73 retrieving revision 1.74 diff -u -d -r1.73 -r1.74 --- player.h 14 Jun 2004 21:39:58 -0000 1.73 +++ player.h 14 Jun 2004 22:45:23 -0000 1.74 @@ -25,7 +25,7 @@ #include "bitmask.h" #include "type.h" #include "timer.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "collision.h" #include "sound.h" #include "moving_object.h" --- NEW FILE: tile_manager.h --- // $Id: tile_manager.h,v 1.1 2004/06/14 22:45:23 grumbel Exp $ // // SuperTux // Copyright (C) 2004 Tobias Glaesser <tob...@gm...> // // 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 HEADER_TILE_MANAGER_HXX #define HEADER_TILE_MANAGER_HXX #include <set> #include <vector> #include <string> class Tile; struct TileGroup { friend bool operator<(const TileGroup& lhs, const TileGroup& rhs) { return lhs.name < rhs.name; }; friend bool operator>(const TileGroup& lhs, const TileGroup& rhs) { return lhs.name > rhs.name; }; std::string name; std::vector<int> tiles; }; class TileManager { private: TileManager(); ~TileManager(); std::vector<Tile*> tiles; static TileManager* instance_ ; static std::set<TileGroup>* tilegroups_; void load_tileset(std::string filename); std::string current_tileset; public: static TileManager* instance() { return instance_ ? instance_ : instance_ = new TileManager(); } static void destroy_instance() { delete instance_; instance_ = 0; } void draw_tile(DrawingContext& context, unsigned int id, const Vector& pos, int layer); static std::set<TileGroup>* tilegroups() { if(!instance_) { instance_ = new TileManager(); } return tilegroups_ ? tilegroups_ : tilegroups_ = new std::set<TileGroup>; } Tile& get(unsigned int id) { if(id < tiles.size()) { return *tiles[id]; } else { // Never return 0, but return the 0th tile instead so that // user code doesn't have to check for NULL pointers all over // the place return *tiles[0]; } } }; #endif /* EOF */ --- NEW FILE: tile_manager.cpp --- // $Id: tile_manager.cpp,v 1.1 2004/06/14 22:45:23 grumbel Exp $ // // SuperTux // Copyright (C) 2004 Tobias Glaesser <tob...@gm...> // // 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 <assert.h> #include "screen/drawing_context.h" #include "setup.h" #include "globals.h" #include "lispreader.h" #include "tile.h" #include "tile_manager.h" TileManager* TileManager::instance_ = 0; std::set<TileGroup>* TileManager::tilegroups_ = 0; TileManager::TileManager() { std::string filename = datadir + "/images/tilesets/supertux.stgt"; load_tileset(filename); } TileManager::~TileManager() { for(std::vector<Tile*>::iterator i = tiles.begin(); i != tiles.end(); ++i) { delete *i; } delete tilegroups_; } void TileManager::load_tileset(std::string filename) { if(filename == current_tileset) return; // free old tiles for(std::vector<Tile*>::iterator i = tiles.begin(); i != tiles.end(); ++i) { delete *i; } tiles.clear(); lisp_object_t* root_obj = lisp_read_from_file(filename); if (!root_obj) st_abort("Couldn't load file", filename); if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-tiles") == 0) { lisp_object_t* cur = lisp_cdr(root_obj); int tileset_id = 0; while(!lisp_nil_p(cur)) { lisp_object_t* element = lisp_car(cur); if (strcmp(lisp_symbol(lisp_car(element)), "tile") == 0) { LispReader reader(lisp_cdr(element)); Tile* tile = new Tile; int tile_id = tile->read(reader); if(tile_id < 0) { std::cerr << "Warning: parse error when reading a tile, skipping.\n"; continue; } tile_id += tileset_id; if(tile_id >= int(tiles.size())) tiles.resize(tile_id+1); tiles[tile_id] = tile; } else if (strcmp(lisp_symbol(lisp_car(element)), "tileset") == 0) { LispReader reader(lisp_cdr(element)); std::string filename; reader.read_string("file", filename); filename = datadir + "/images/tilesets/" + filename; load_tileset(filename); } else if (strcmp(lisp_symbol(lisp_car(element)), "tilegroup") == 0) { TileGroup new_; LispReader reader(lisp_cdr(element)); reader.read_string("name", new_.name); reader.read_int_vector("tiles", new_.tiles); if(!tilegroups_) tilegroups_ = new std::set<TileGroup>; tilegroups_->insert(new_).first; } else if (strcmp(lisp_symbol(lisp_car(element)), "properties") == 0) { LispReader reader(lisp_cdr(element)); reader.read_int("id", tileset_id); tileset_id *= 1000; } else { std::cerr << "Unknown symbol: " << lisp_symbol(lisp_car(element)) << "\n"; } cur = lisp_cdr(cur); } } else { assert(0); } lisp_free(root_obj); current_tileset = filename; } void TileManager::draw_tile(DrawingContext& context, unsigned int c, const Vector& pos, int layer) { if(c == 0) return; Tile& tile = get(c); if(!tile.images.size()) return; if(tile.images.size() > 1) { size_t frame = ((global_frame_counter*25) / tile.anim_speed) % tile.images.size(); context.draw_surface(tile.images[frame], pos, layer); } else if (tile.images.size() == 1) { context.draw_surface(tile.images[0], pos, layer); } } /* EOF */ Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- tilemap.cpp 14 Jun 2004 22:08:01 -0000 1.10 +++ tilemap.cpp 14 Jun 2004 22:45:23 -0000 1.11 @@ -27,6 +27,7 @@ #include "screen/drawing_context.h" #include "level.h" #include "tile.h" +#include "tile_manager.h" #include "globals.h" #include "lispreader.h" #include "lispwriter.h" Index: special.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.h,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- special.h 9 Jun 2004 05:23:20 -0000 1.25 +++ special.h 14 Jun 2004 22:45:23 -0000 1.26 @@ -24,7 +24,7 @@ #include "bitmask.h" #include "type.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "collision.h" #include "player.h" #include "physic.h" Index: sprite.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sprite.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- sprite.h 9 Jun 2004 05:23:20 -0000 1.13 +++ sprite.h 14 Jun 2004 22:45:23 -0000 1.14 @@ -24,7 +24,7 @@ #include <vector> #include "lispreader.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "vector.h" class Sprite Index: high_scores.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/high_scores.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- high_scores.cpp 9 Jun 2004 05:23:19 -0000 1.20 +++ high_scores.cpp 14 Jun 2004 22:45:23 -0000 1.21 @@ -28,7 +28,7 @@ #include "menu.h" #include "screen/drawing_context.h" #include "screen/screen.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "setup.h" #include "lispreader.h" Index: button.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.h,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- button.h 9 Jun 2004 05:23:20 -0000 1.27 +++ button.h 14 Jun 2004 22:45:23 -0000 1.28 @@ -23,7 +23,7 @@ #include <vector> -#include "screen/texture.h" +#include "screen/surface.h" #include "timer.h" enum ButtonState { Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- worldmap.cpp 9 Jun 2004 05:23:20 -0000 1.86 +++ worldmap.cpp 14 Jun 2004 22:45:23 -0000 1.87 @@ -24,7 +24,7 @@ #include <unistd.h> #include "globals.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "screen/screen.h" #include "screen/drawing_context.h" #include "lispreader.h" Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.98 retrieving revision 1.99 diff -u -d -r1.98 -r1.99 --- setup.cpp 9 Jun 2004 05:23:19 -0000 1.98 +++ setup.cpp 14 Jun 2004 22:45:23 -0000 1.99 @@ -45,7 +45,7 @@ #include "globals.h" #include "setup.h" #include "screen/screen.h" -#include "screen/texture.h" +#include "screen/surface.h" #include "menu.h" #include "gameloop.h" #include "configfile.h" Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- level.h 9 Jun 2004 05:23:20 -0000 1.57 +++ level.h 14 Jun 2004 22:45:23 -0000 1.58 @@ -24,7 +24,7 @@ #include <map> #include <string> -#include "screen/texture.h" +#include "screen/surface.h" #include "lispreader.h" #include "musicref.h" |
From: Ingo R. <gr...@us...> - 2004-06-14 22:45:36
|
Update of /cvsroot/super-tux/supertux/src/screen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9380/screen Modified Files: drawing_context.cpp font.h screen.h Added Files: surface.cpp surface.h Log Message: - moved tilemanager into its own class - renamed texture.h to surface.h Index: drawing_context.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/drawing_context.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- drawing_context.cpp 12 Jun 2004 16:07:12 -0000 1.8 +++ drawing_context.cpp 14 Jun 2004 22:45:24 -0000 1.9 @@ -21,7 +21,7 @@ #include <iostream> #include "drawing_context.h" -#include "texture.h" +#include "surface.h" #include "globals.h" #include "font.h" --- NEW FILE: surface.h --- // $Id: surface.h,v 1.1 2004/06/14 22:45:24 grumbel Exp $ // // SuperTux // Copyright (C) 2004 Tobias Glaesser <tob...@gm...> // // 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 SUPERTUX_TEXTURE_H #define SUPERTUX_TEXTURE_H #include <string> #include <list> #ifndef NOOPENGL #include "SDL_opengl.h" #endif #include "SDL.h" #include "screen.h" #include "vector.h" SDL_Surface* sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha); SDL_Surface* sdl_surface_from_nothing(); class SurfaceImpl; class SurfaceSDL; class SurfaceOpenGL; class DrawingContext; /// bitset for drawing effects enum { /** Don't apply anything */ NONE_EFFECT = 0x0000, /** Draw the Surface upside down */ VERTICAL_FLIP = 0x0001, /** Draw the Surface with alpha equal to 128 */ SEMI_TRANSPARENT = 0x0002 }; /** This class holds all the data necessary to construct a surface */ class SurfaceData { public: enum ConstructorType { LOAD, LOAD_PART, SURFACE, GRADIENT }; ConstructorType type; SDL_Surface* surface; std::string file; int use_alpha; int x; int y; int w; int h; Color top_gradient; Color bottom_gradient; SurfaceData(SDL_Surface* surf, int use_alpha_); SurfaceData(const std::string& file_, int use_alpha_); SurfaceData(const std::string& file_, int x_, int y_, int w_, int h_, int use_alpha_); SurfaceData(Color top_gradient_, Color bottom_gradient_, int w_, int h_); ~SurfaceData(); SurfaceSDL* create_SurfaceSDL(); SurfaceOpenGL* create_SurfaceOpenGL(); SurfaceImpl* create(); }; /** Container class that holds a surface, necessary so that we can switch Surface implementations (OpenGL, SDL) on the fly */ class Surface { public: SurfaceData data; SurfaceImpl* impl; int w; int h; typedef std::list<Surface*> Surfaces; static Surfaces surfaces; public: static void reload_all(); static void debug_check(); Surface(SDL_Surface* surf, int use_alpha); Surface(const std::string& file, int use_alpha); Surface(const std::string& file, int x, int y, int w, int h, int use_alpha); Surface(Color top_gradient, Color bottom_gradient, int w, int h); ~Surface(); /** Reload the surface, which is necesarry in case of a mode swich */ void reload(); void resize(int widht, int height); }; /** Surface implementation, all implementation have to inherit from this class */ class SurfaceImpl { protected: SDL_Surface* sdl_surface; public: int w; int h; public: SurfaceImpl(); virtual ~SurfaceImpl(); /** Return 0 on success, -2 if surface needs to be reloaded */ virtual int draw(float x, float y, Uint8 alpha, Uint32 effect = NONE_EFFECT) = 0; virtual int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect = NONE_EFFECT) = 0; #if 0 virtual int draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update) = 0; #endif int resize(int w_, int h_); SDL_Surface* get_sdl_surface() const; // @evil@ try to avoid this function }; class SurfaceSDL : public SurfaceImpl { public: SurfaceSDL(SDL_Surface* surf, int use_alpha); SurfaceSDL(const std::string& file, int use_alpha); SurfaceSDL(const std::string& file, int x, int y, int w, int h, int use_alpha); SurfaceSDL(Color top_gradient, Color bottom_gradient, int w, int h); virtual ~SurfaceSDL(); int draw(float x, float y, Uint8 alpha, Uint32 effect = NONE_EFFECT); int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect = NONE_EFFECT); #if 0 int draw_stretched(float x, float y, int w, int h, Uint8 alpha); #endif }; #ifndef NOOPENGL class SurfaceOpenGL : public SurfaceImpl { public: GLuint gl_texture; public: SurfaceOpenGL(SDL_Surface* surf, int use_alpha); SurfaceOpenGL(const std::string& file, int use_alpha); SurfaceOpenGL(const std::string& file, int x, int y, int w, int h, int use_alpha); SurfaceOpenGL(Color top_gradient, Color bottom_gradient, int w, int h); virtual ~SurfaceOpenGL(); int draw(float x, float y, Uint8 alpha, Uint32 effect = NONE_EFFECT); int draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect = NONE_EFFECT); #if 0 int draw_stretched(float x, float y, int w, int h, Uint8 alpha); #endif private: void create_gl(SDL_Surface * surf, GLuint * tex); }; #endif #endif /*SUPERTUX_TEXTURE_H*/ /* Local Variables: */ /* mode: c++ */ /* End: */ Index: font.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/font.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- font.h 9 Jun 2004 04:43:15 -0000 1.3 +++ font.h 14 Jun 2004 22:45:24 -0000 1.4 @@ -23,7 +23,7 @@ #include <string> -#include "texture.h" +#include "surface.h" #include "vector.h" void display_text_file(const std::string& file, const std::string& surface, float scroll_speed); --- NEW FILE: surface.cpp --- // $Id: surface.cpp,v 1.1 2004/06/14 22:45:24 grumbel Exp $ // // SuperTux // Copyright (C) 2004 Tobias Glaesser <tob...@gm...> // // 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 <cassert> #include <iostream> #include <algorithm> #include "SDL.h" #include "SDL_image.h" #include "surface.h" #include "globals.h" #include "setup.h" Surface::Surfaces Surface::surfaces; SurfaceData::SurfaceData(SDL_Surface* temp, int use_alpha_) : type(SURFACE), surface(0), use_alpha(use_alpha_) { // Copy the given surface and make sure that it is not stored in // video memory surface = SDL_CreateRGBSurface(temp->flags & (~SDL_HWSURFACE), temp->w, temp->h, temp->format->BitsPerPixel, temp->format->Rmask, temp->format->Gmask, temp->format->Bmask, temp->format->Amask); if(!surface) st_abort("No memory left.", ""); SDL_SetAlpha(temp,0,0); SDL_BlitSurface(temp, NULL, surface, NULL); } SurfaceData::SurfaceData(const std::string& file_, int use_alpha_) : type(LOAD), surface(0), file(file_), use_alpha(use_alpha_) {} SurfaceData::SurfaceData(const std::string& file_, int x_, int y_, int w_, int h_, int use_alpha_) : type(LOAD_PART), surface(0), file(file_), use_alpha(use_alpha_), x(x_), y(y_), w(w_), h(h_) {} SurfaceData::SurfaceData(Color top_gradient_, Color bottom_gradient_, int w_, int h_) : type(GRADIENT), surface(0), use_alpha(false), w(w_), h(h_) { top_gradient = top_gradient_; bottom_gradient = bottom_gradient_; } SurfaceData::~SurfaceData() { SDL_FreeSurface(surface); } SurfaceImpl* SurfaceData::create() { #ifndef NOOPENGL if (use_gl) return create_SurfaceOpenGL(); else return create_SurfaceSDL(); #else return create_SurfaceSDL(); #endif } SurfaceSDL* SurfaceData::create_SurfaceSDL() { switch(type) { case LOAD: return new SurfaceSDL(file, use_alpha); case LOAD_PART: return new SurfaceSDL(file, x, y, w, h, use_alpha); case SURFACE: return new SurfaceSDL(surface, use_alpha); case GRADIENT: return new SurfaceSDL(top_gradient, bottom_gradient, w, h); } assert(0); } SurfaceOpenGL* SurfaceData::create_SurfaceOpenGL() { #ifndef NOOPENGL switch(type) { case LOAD: return new SurfaceOpenGL(file, use_alpha); case LOAD_PART: return new SurfaceOpenGL(file, x, y, w, h, use_alpha); case SURFACE: return new SurfaceOpenGL(surface, use_alpha); case GRADIENT: return new SurfaceOpenGL(top_gradient, bottom_gradient, w, h); } #endif assert(0); } #ifndef NOOPENGL /* Quick utility function for texture creation */ static int power_of_two(int input) { int value = 1; while ( value < input ) { value <<= 1; } return value; } #endif Surface::Surface(SDL_Surface* surf, int use_alpha) : data(surf, use_alpha), w(0), h(0) { impl = data.create(); if (impl) { w = impl->w; h = impl->h; } surfaces.push_back(this); } Surface::Surface(const std::string& file, int use_alpha) : data(file, use_alpha), w(0), h(0) { impl = data.create(); if (impl) { w = impl->w; h = impl->h; } surfaces.push_back(this); } Surface::Surface(const std::string& file, int x, int y, int w, int h, int use_alpha) : data(file, x, y, w, h, use_alpha), w(0), h(0) { impl = data.create(); if (impl) { w = impl->w; h = impl->h; } surfaces.push_back(this); } Surface::Surface(Color top_background, Color bottom_background, int w, int h) : data(top_background, bottom_background, w, h), w(0), h(0) { impl = data.create(); if (impl) { w = impl->w; h = impl->h; } surfaces.push_back(this); } void Surface::reload() { delete impl; impl = data.create(); if (impl) { w = impl->w; h = impl->h; } } Surface::~Surface() { #ifdef DEBUG bool found = false; for(std::list<Surface*>::iterator i = surfaces.begin(); i != surfaces.end(); ++i) { if(*i == this) { found = true; break; } } if(!found) printf("Error: Surface freed twice!!!\n"); #endif surfaces.remove(this); delete impl; } void Surface::reload_all() { for(Surfaces::iterator i = surfaces.begin(); i != surfaces.end(); ++i) { (*i)->reload(); } } void Surface::debug_check() { for(Surfaces::iterator i = surfaces.begin(); i != surfaces.end(); ++i) { printf("Surface not freed: T:%d F:%s.\n", (*i)->data.type, (*i)->data.file.c_str()); } } void Surface::resize(int w_, int h_) { if (impl) { w = w_; h = h_; if (impl->resize(w_,h_) == -2) reload(); } } SDL_Surface* sdl_surface_part_from_file(const std::string& file, int x, int y, int w, int h, int use_alpha) { SDL_Rect src; SDL_Surface * sdl_surface; SDL_Surface * temp; SDL_Surface * conv; temp = IMG_Load(file.c_str()); if (temp == NULL) st_abort("Can't load", file); /* Set source rectangle for conv: */ src.x = x; src.y = y; src.w = w; src.h = h; conv = SDL_CreateRGBSurface(temp->flags, w, h, temp->format->BitsPerPixel, temp->format->Rmask, temp->format->Gmask, temp->format->Bmask, temp->format->Amask); /* #if SDL_BYTEORDER == SDL_BIG_ENDIAN 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff); #else 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000); #endif*/ SDL_SetAlpha(temp,0,0); SDL_BlitSurface(temp, &src, conv, NULL); if(use_alpha == IGNORE_ALPHA && !use_gl) sdl_surface = SDL_DisplayFormat(conv); else sdl_surface = SDL_DisplayFormatAlpha(conv); if (sdl_surface == NULL) st_abort("Can't covert to display format", file); if (use_alpha == IGNORE_ALPHA && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); SDL_FreeSurface(temp); SDL_FreeSurface(conv); return sdl_surface; } SDL_Surface* sdl_surface_from_file(const std::string& file, int use_alpha) { SDL_Surface* sdl_surface; SDL_Surface* temp; temp = IMG_Load(file.c_str()); if (temp == NULL) st_abort("Can't load", file); if(use_alpha == IGNORE_ALPHA && !use_gl) sdl_surface = SDL_DisplayFormat(temp); else sdl_surface = SDL_DisplayFormatAlpha(temp); if (sdl_surface == NULL) st_abort("Can't covert to display format", file); if (use_alpha == IGNORE_ALPHA && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); SDL_FreeSurface(temp); return sdl_surface; } SDL_Surface* sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha) { SDL_Surface* sdl_surface; Uint32 saved_flags; Uint8 saved_alpha; /* Save the alpha blending attributes */ saved_flags = sdl_surf->flags&(SDL_SRCALPHA|SDL_RLEACCELOK); saved_alpha = sdl_surf->format->alpha; if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { SDL_SetAlpha(sdl_surf, 0, 0); } if(use_alpha == IGNORE_ALPHA && !use_gl) sdl_surface = SDL_DisplayFormat(sdl_surf); else sdl_surface = SDL_DisplayFormatAlpha(sdl_surf); /* Restore the alpha blending attributes */ if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { SDL_SetAlpha(sdl_surface, saved_flags, saved_alpha); } if (sdl_surface == NULL) st_abort("Can't covert to display format", "SURFACE"); if (use_alpha == IGNORE_ALPHA && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); return sdl_surface; } SDL_Surface* sdl_surface_from_gradient(Color top, Color bottom, int w, int h) { SDL_Surface* sdl_surface; sdl_surface = SDL_CreateRGBSurface(screen->flags, w, h, screen->format->BitsPerPixel, screen->format->Rmask, screen->format->Gmask, screen->format->Bmask, screen->format->Amask); if(sdl_surface == NULL) st_abort("Cannot create surface for the gradient", "SURFACE"); if(top == bottom) { SDL_FillRect(sdl_surface, NULL, SDL_MapRGB(sdl_surface->format, top.red, top.green, top.blue)); } else { float redstep = (float(bottom.red)-float(top.red)) / float(h); float greenstep = (float(bottom.green)-float(top.green)) / float(h); float bluestep = (float(bottom.blue) - float(top.blue)) / float(h); SDL_Rect rect; rect.x = 0; rect.w = w; rect.h = 1; for(float y = 0; y < h; y++) { rect.y = (int)y; SDL_FillRect(sdl_surface, &rect, SDL_MapRGB(sdl_surface->format, int(float(top.red) + redstep * y), int(float(top.green) + greenstep * y), int(float(top.blue) + bluestep * y))); } } return sdl_surface; } //--------------------------------------------------------------------------- SurfaceImpl::SurfaceImpl() {} SurfaceImpl::~SurfaceImpl() { SDL_FreeSurface(sdl_surface); } SDL_Surface* SurfaceImpl::get_sdl_surface() const { return sdl_surface; } int SurfaceImpl::resize(int w_, int h_) { w = w_; h = h_; SDL_Rect dest; dest.x = 0; dest.y = 0; dest.w = w; dest.h = h; int ret = SDL_SoftStretch(sdl_surface, NULL, sdl_surface, &dest); return ret; } #ifndef NOOPENGL SurfaceOpenGL::SurfaceOpenGL(SDL_Surface* surf, int use_alpha) { sdl_surface = sdl_surface_from_sdl_surface(surf, use_alpha); create_gl(sdl_surface,&gl_texture); w = sdl_surface->w; h = sdl_surface->h; } SurfaceOpenGL::SurfaceOpenGL(const std::string& file, int use_alpha) { sdl_surface = sdl_surface_from_file(file, use_alpha); create_gl(sdl_surface,&gl_texture); w = sdl_surface->w; h = sdl_surface->h; } SurfaceOpenGL::SurfaceOpenGL(const std::string& file_, int x_, int y_, int w_, int h_, int use_alpha_) { sdl_surface = sdl_surface_part_from_file(file_,x_,y_,w_,h_,use_alpha_); create_gl(sdl_surface, &gl_texture); w = sdl_surface->w; h = sdl_surface->h; } SurfaceOpenGL::SurfaceOpenGL(Color top_gradient, Color bottom_gradient, int w, int h) { sdl_surface = sdl_surface_from_gradient(top_gradient, bottom_gradient, w, h); create_gl(sdl_surface, &gl_texture); w = sdl_surface->w; h = sdl_surface->h; } SurfaceOpenGL::~SurfaceOpenGL() { glDeleteTextures(1, &gl_texture); } void SurfaceOpenGL::create_gl(SDL_Surface * surf, GLuint * tex) { Uint32 saved_flags; Uint8 saved_alpha; int w, h; SDL_Surface *conv; w = power_of_two(surf->w); h = power_of_two(surf->h), #if SDL_BYTEORDER == SDL_BIG_ENDIAN conv = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, surf->format->BitsPerPixel, 0xff000000, 0x00ff0000, 0x0000ff00, 0x000000ff); #else conv = SDL_CreateRGBSurface(SDL_SWSURFACE, w, h, surf->format->BitsPerPixel, 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000); #endif /* Save the alpha blending attributes */ saved_flags = surf->flags&(SDL_SRCALPHA|SDL_RLEACCELOK); saved_alpha = surf->format->alpha; if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { SDL_SetAlpha(surf, 0, 0); } SDL_BlitSurface(surf, 0, conv, 0); /* Restore the alpha blending attributes */ if ( (saved_flags & SDL_SRCALPHA) == SDL_SRCALPHA ) { SDL_SetAlpha(surf, saved_flags, saved_alpha); } // We check all the pixels of the surface to figure out which // internal format OpenGL should use for storing it, ie. if no alpha // is present store in RGB instead of RGBA, this saves a few bytes // of memory, but much more importantly it makes the game look // *much* better in 16bit color mode int internal_format = GL_RGB10_A2; bool has_alpha = false; unsigned char* buf = static_cast<unsigned char*>(conv->pixels); for (int y = 0; y < surf->h; ++y) for (int x = 0; x < surf->w; ++x) { if (buf[(conv->pitch*y + x*4) + 3] != 255) { has_alpha = true; break; } } if (!has_alpha) { internal_format = GL_RGB; } glGenTextures(1, &*tex); glBindTexture(GL_TEXTURE_2D , *tex); 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_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glPixelStorei(GL_UNPACK_ROW_LENGTH, conv->pitch / conv->format->BytesPerPixel); glTexImage2D(GL_TEXTURE_2D, 0, internal_format, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, conv->pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); SDL_FreeSurface(conv); } int SurfaceOpenGL::draw(float x, float y, Uint8 alpha, Uint32 effect) { float pw = power_of_two(w); float ph = power_of_two(h); if(effect & SEMI_TRANSPARENT) alpha = 128; glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4ub(alpha, alpha, alpha, alpha); glBindTexture(GL_TEXTURE_2D, gl_texture); glBegin(GL_QUADS); if(effect & VERTICAL_FLIP) { glTexCoord2f(0, 0); glVertex2f(x, (float)h+y); glTexCoord2f((float)w / pw, 0); glVertex2f((float)w+x, (float)h+y); glTexCoord2f((float)w / pw, (float)h / ph); glVertex2f((float)w+x, y); glTexCoord2f(0, (float)h / ph); glVertex2f(x, y); } else { glTexCoord2f(0, 0); glVertex2f(x, y); glTexCoord2f((float)w / pw, 0); glVertex2f((float)w+x, y); glTexCoord2f((float)w / pw, (float)h / ph); glVertex2f((float)w+x, (float)h+y); glTexCoord2f(0, (float)h / ph); glVertex2f(x, (float)h+y); } glEnd(); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); return 0; } int SurfaceOpenGL::draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect) { float pw = power_of_two(int(this->w)); float ph = power_of_two(int(this->h)); if(effect & SEMI_TRANSPARENT) alpha = 128; glBindTexture(GL_TEXTURE_2D, gl_texture); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4ub(alpha, alpha, alpha, alpha); glEnable(GL_TEXTURE_2D); glBegin(GL_QUADS); if(effect & VERTICAL_FLIP) { glTexCoord2f(sx / pw, sy / ph); glVertex2f(x, y); glTexCoord2f((float)(sx + w) / pw, sy / ph); glVertex2f(w+x, y); glTexCoord2f((sx+w) / pw, (sy+h) / ph); glVertex2f(w +x, h+y); glTexCoord2f(sx / pw, (float)(sy+h) / ph); glVertex2f(x, h+y); } else { glTexCoord2f(sx / pw, (float)(sy+h) / ph); glVertex2f(x, h+y); glTexCoord2f((sx+w) / pw, (sy+h) / ph); glVertex2f(w +x, h+y); glTexCoord2f((float)(sx + w) / pw, sy / ph); glVertex2f(w+x, y); glTexCoord2f(sx / pw, sy / ph); glVertex2f(x, y); } glEnd(); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); return 0; } #if 0 int SurfaceOpenGL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha) { float pw = power_of_two(int(this->w)); float ph = power_of_two(int(this->h)); glBindTexture(GL_TEXTURE_2D, gl_texture); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4ub(alpha, alpha, alpha, alpha); glEnable(GL_TEXTURE_2D); glBegin(GL_QUADS); glTexCoord2f(0, 0); glVertex2f(x, y); glTexCoord2f((float)w / pw, 0); glVertex2f(sw+x, y); glTexCoord2f((float)w / pw, (float)h / ph); glVertex2f((float)sw+x, (float)sh+y); glVertex2f(sw +x, sh+y); glTexCoord2f(0, (float)h / ph); glVertex2f(x, sh+y); glEnd(); glDisable(GL_TEXTURE_2D); glDisable(GL_BLEND); return 0; } #endif #endif SurfaceSDL::SurfaceSDL(SDL_Surface* surf, int use_alpha) { sdl_surface = sdl_surface_from_sdl_surface(surf, use_alpha); w = sdl_surface->w; h = sdl_surface->h; } SurfaceSDL::SurfaceSDL(const std::string& file, int use_alpha) { sdl_surface = sdl_surface_from_file(file, use_alpha); w = sdl_surface->w; h = sdl_surface->h; } SurfaceSDL::SurfaceSDL(const std::string& file, int x, int y, int w, int h, int use_alpha) { sdl_surface = sdl_surface_part_from_file(file, x, y, w, h, use_alpha); w = sdl_surface->w; h = sdl_surface->h; } SurfaceSDL::SurfaceSDL(Color top_gradient, Color bottom_gradient, int w, int h) { sdl_surface = sdl_surface_from_gradient(top_gradient, bottom_gradient, w, h); w = sdl_surface->w; h = sdl_surface->h; } int SurfaceSDL::draw(float x, float y, Uint8 alpha, Uint32 effect) { SDL_Rect dest; dest.x = (int)x; dest.y = (int)y; dest.w = w; dest.h = h; if(effect & SEMI_TRANSPARENT) alpha = 128; if(effect & VERTICAL_FLIP) // FIXME: feel free to replace this hack { for(float sy = 0; sy < h; sy++) if(draw_part(0, sy, x, y+(h-sy), w, 1, alpha, NONE_EFFECT) == -2) return -2; return 0; } if(alpha != 255) { /* Create a Surface, make it using colorkey, blit surface into temp, apply alpha to temp sur, blit the temp into the screen */ /* Note: this has to be done, since SDL doesn't allow to set alpha to surfaces that already have an alpha mask yet... */ SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, sdl_surface->format->Rmask, sdl_surface->format->Gmask, sdl_surface->format->Bmask, 0); int colorkey = SDL_MapRGB(sdl_surface_copy->format, 255, 0, 255); SDL_FillRect(sdl_surface_copy, NULL, colorkey); SDL_SetColorKey(sdl_surface_copy, SDL_SRCCOLORKEY, colorkey); SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); SDL_FreeSurface (sdl_surface_copy); return ret; } int ret = SDL_BlitSurface(sdl_surface, NULL, screen, &dest); return ret; } int SurfaceSDL::draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha, Uint32 effect) { SDL_Rect src, dest; src.x = (int)sx; src.y = (int)sy; src.w = (int)w; src.h = (int)h; dest.x = (int)x; dest.y = (int)y; dest.w = (int)w; dest.h = (int)h; if(effect & SEMI_TRANSPARENT) alpha = 128; if(effect & VERTICAL_FLIP) // FIXME: feel free to replace this hack { for(float sy_ = sy; sy_ < h; sy_++) if(draw_part(sx, sy_, x, y+(h-sy_), w, 1, alpha, NONE_EFFECT) == -2) return -2; return 0; } if(alpha != 255) { /* Create a Surface, make it using colorkey, blit surface into temp, apply alpha to temp sur, blit the temp into the screen */ /* Note: this has to be done, since SDL doesn't allow to set alpha to surfaces that already have an alpha mask yet... */ SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, sdl_surface->w, sdl_surface->h, sdl_surface->format->BitsPerPixel, sdl_surface->format->Rmask, sdl_surface->format->Gmask, sdl_surface->format->Bmask, 0); int colorkey = SDL_MapRGB(sdl_surface_copy->format, 255, 0, 255); SDL_FillRect(sdl_surface_copy, NULL, colorkey); SDL_SetColorKey(sdl_surface_copy, SDL_SRCCOLORKEY, colorkey); SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); SDL_SetAlpha(sdl_surface_copy ,SDL_SRCALPHA,alpha); int ret = SDL_BlitSurface(sdl_surface_copy, NULL, screen, &dest); SDL_FreeSurface (sdl_surface_copy); return ret; } int ret = SDL_BlitSurface(sdl_surface, &src, screen, &dest); return ret; } #if 0 int SurfaceSDL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha, bool update) { SDL_Rect dest; dest.x = (int)x; dest.y = (int)y; dest.w = (int)sw; dest.h = (int)sh; if(alpha != 255) SDL_SetAlpha(sdl_surface ,SDL_SRCALPHA,alpha); SDL_Surface* sdl_surface_copy = SDL_CreateRGBSurface (sdl_surface->flags, sw, sh, sdl_surface->format->BitsPerPixel, sdl_surface->format->Rmask, sdl_surface->format->Gmask, sdl_surface->format->Bmask, 0); SDL_BlitSurface(sdl_surface, NULL, sdl_surface_copy, NULL); SDL_SoftStretch(sdl_surface_copy, NULL, sdl_surface_copy, &dest); int ret = SDL_BlitSurface(sdl_surface_copy,NULL,screen,&dest); SDL_FreeSurface(sdl_surface_copy); if (update == UPDATE) update_rect(screen, dest.x, dest.y, dest.w, dest.h); return ret; } #endif SurfaceSDL::~SurfaceSDL() {} /* EOF */ Index: screen.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen/screen.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- screen.h 12 Jun 2004 16:07:12 -0000 1.4 +++ screen.h 14 Jun 2004 22:45:24 -0000 1.5 @@ -49,7 +49,7 @@ Uint8 red, green, blue, alpha; }; -#include "texture.h" +#include "surface.h" class Vector; |