From 8e7ccc8e3b34ee1adb6f3cf7c3bc49e07c59fcb0 Mon Sep 17 00:00:00 2001 From: Ricardo Cruz Date: Sat, 10 Jul 2004 14:22:59 +0000 Subject: [PATCH] Replaced USE_ALPHA/IGNORE_ALPHA by booleans. Should have been done long ago. SVN-Revision: 1565 --- src/background.cpp | 2 +- src/button.cpp | 4 ++-- src/high_scores.cpp | 2 +- src/leveleditor.cpp | 2 +- src/mousecursor.cpp | 2 +- src/particlesystem.cpp | 8 ++++---- src/resources.cpp | 42 +++++++++++++++++++++--------------------- src/screen/font.cpp | 6 +++--- src/screen/screen.h | 5 ----- src/screen/surface.cpp | 42 +++++++++++++++++++++--------------------- src/screen/surface.h | 28 ++++++++++++++-------------- src/setup.cpp | 10 +++++----- src/sprite.cpp | 2 +- src/tile.cpp | 4 ++-- src/title.cpp | 6 +++--- src/worldmap.cpp | 14 +++++++------- 16 files changed, 87 insertions(+), 92 deletions(-) diff --git a/src/background.cpp b/src/background.cpp index 42b9e41f3..78a91809d 100644 --- a/src/background.cpp +++ b/src/background.cpp @@ -86,7 +86,7 @@ Background::set_image(const std::string& name, float speed) this->speed = speed; delete image; - image = new Surface(datadir + "/images/background/" + name, IGNORE_ALPHA); + image = new Surface(datadir + "/images/background/" + name, false); } void diff --git a/src/button.cpp b/src/button.cpp index 1cfbc72cf..2201808fc 100644 --- a/src/button.cpp +++ b/src/button.cpp @@ -88,11 +88,11 @@ void Button::add_icon(const std::string& icon_file, int mw, int mh) if(mw != -1 || mh != -1) { - icon.push_back(new Surface(filename,USE_ALPHA)); + icon.push_back(new Surface(filename,true)); icon.back()->resize(mw,mh); } else - icon.push_back(new Surface(filename,USE_ALPHA)); + icon.push_back(new Surface(filename,true)); } diff --git a/src/high_scores.cpp b/src/high_scores.cpp index ae49086b3..4edd7bec5 100644 --- a/src/high_scores.cpp +++ b/src/high_scores.cpp @@ -86,7 +86,7 @@ void save_hs(int score) SDL_Event event; DrawingContext context; - bkgd = new Surface(datadir + "/images/highscore/highscore.png", IGNORE_ALPHA); + bkgd = new Surface(datadir + "/images/highscore/highscore.png", false); hs_score = score; diff --git a/src/leveleditor.cpp b/src/leveleditor.cpp index 2d7f6f742..c9c201fea 100644 --- a/src/leveleditor.cpp +++ b/src/leveleditor.cpp @@ -97,7 +97,7 @@ LevelEditor::LevelEditor() le_mouse_clicked[LEFT] = false; le_mouse_clicked[RIGHT] = false; - le_selection = new Surface(datadir + "/images/leveleditor/select.png", USE_ALPHA); + le_selection = new Surface(datadir + "/images/leveleditor/select.png", true); select_tilegroup_menu_effect.init(false); select_objects_menu_effect.init(false); diff --git a/src/mousecursor.cpp b/src/mousecursor.cpp index 86eb8ca55..f2176cf41 100644 --- a/src/mousecursor.cpp +++ b/src/mousecursor.cpp @@ -24,7 +24,7 @@ MouseCursor* MouseCursor::current_ = 0; MouseCursor::MouseCursor(std::string cursor_file, int frames) : mid_x(0), mid_y(0) { - cursor = new Surface(cursor_file, USE_ALPHA); + cursor = new Surface(cursor_file, true); cur_state = MC_NORMAL; cur_frame = 0; diff --git a/src/particlesystem.cpp b/src/particlesystem.cpp index 5ac67e920..baa812e31 100644 --- a/src/particlesystem.cpp +++ b/src/particlesystem.cpp @@ -71,9 +71,9 @@ void ParticleSystem::draw(DrawingContext& context) SnowParticleSystem::SnowParticleSystem() { - snowimages[0] = new Surface(datadir+"/images/shared/snow0.png", USE_ALPHA); - snowimages[1] = new Surface(datadir+"/images/shared/snow1.png", USE_ALPHA); - snowimages[2] = new Surface(datadir+"/images/shared/snow2.png", USE_ALPHA); + snowimages[0] = new Surface(datadir+"/images/shared/snow0.png", true); + snowimages[1] = new Surface(datadir+"/images/shared/snow1.png", true); + snowimages[2] = new Surface(datadir+"/images/shared/snow2.png", true); virtual_width = screen->w * 2; @@ -128,7 +128,7 @@ void SnowParticleSystem::action(float elapsed_time) CloudParticleSystem::CloudParticleSystem() { - cloudimage = new Surface(datadir + "/images/shared/cloud.png", USE_ALPHA); + cloudimage = new Surface(datadir + "/images/shared/cloud.png", true); virtual_width = 2000.0; diff --git a/src/resources.cpp b/src/resources.cpp index dcdd4b605..981541142 100644 --- a/src/resources.cpp +++ b/src/resources.cpp @@ -131,59 +131,59 @@ void loadshared() /* Water: */ - img_water = new Surface(datadir + "/images/shared/water.png", IGNORE_ALPHA); + img_water = new Surface(datadir + "/images/shared/water.png", false); img_waves[0] = new Surface(datadir + "/images/shared/waves-0.png", - USE_ALPHA); + true); img_waves[1] = new Surface(datadir + "/images/shared/waves-1.png", - USE_ALPHA); + true); img_waves[2] = new Surface(datadir + "/images/shared/waves-2.png", - USE_ALPHA); + true); /* Pole: */ - img_pole = new Surface(datadir + "/images/shared/pole.png", USE_ALPHA); + img_pole = new Surface(datadir + "/images/shared/pole.png", true); img_poletop = new Surface(datadir + "/images/shared/poletop.png", - USE_ALPHA); + true); /* Flag: */ img_flag[0] = new Surface(datadir + "/images/shared/flag-0.png", - USE_ALPHA); + true); img_flag[1] = new Surface(datadir + "/images/shared/flag-1.png", - USE_ALPHA); + true); /* Cloud: */ img_cloud[0][0] = new Surface(datadir + "/images/shared/cloud-00.png", - USE_ALPHA); + true); img_cloud[0][1] = new Surface(datadir + "/images/shared/cloud-01.png", - USE_ALPHA); + true); img_cloud[0][2] = new Surface(datadir + "/images/shared/cloud-02.png", - USE_ALPHA); + true); img_cloud[0][3] = new Surface(datadir + "/images/shared/cloud-03.png", - USE_ALPHA); + true); img_cloud[1][0] = new Surface(datadir + "/images/shared/cloud-10.png", - USE_ALPHA); + true); img_cloud[1][1] = new Surface(datadir + "/images/shared/cloud-11.png", - USE_ALPHA); + true); img_cloud[1][2] = new Surface(datadir + "/images/shared/cloud-12.png", - USE_ALPHA); + true); img_cloud[1][3] = new Surface(datadir + "/images/shared/cloud-13.png", - USE_ALPHA); + true); /* Bad guys: */ @@ -205,22 +205,22 @@ void loadshared() /* Distros: */ img_distro[0] = new Surface(datadir + "/images/tilesets/coin1.png", - USE_ALPHA); + true); img_distro[1] = new Surface(datadir + "/images/tilesets/coin2.png", - USE_ALPHA); + true); img_distro[2] = new Surface(datadir + "/images/tilesets/coin3.png", - USE_ALPHA); + true); img_distro[3] = new Surface(datadir + "/images/tilesets/coin2.png", - USE_ALPHA); + true); /* Tux life: */ tux_life = new Surface(datadir + "/images/shared/tux-life.png", - USE_ALPHA); + true); /* Sound effects: */ diff --git a/src/screen/font.cpp b/src/screen/font.cpp index 2063286a9..05555307c 100644 --- a/src/screen/font.cpp +++ b/src/screen/font.cpp @@ -33,7 +33,7 @@ Font::Font(const std::string& file, FontType ntype, int nw, int nh, : chars(0), shadow_chars(0), type(ntype), w(nw), h(nh), shadowsize(nshadowsize) { - chars = new Surface(file, USE_ALPHA); + chars = new Surface(file, true); switch(type) { case TEXT: @@ -58,7 +58,7 @@ Font::Font(const std::string& file, FontType ntype, int nw, int nh, } SDL_UnlockSurface(conv); SDL_SetAlpha(conv, SDL_SRCALPHA, 128); - shadow_chars = new Surface(conv, USE_ALPHA); + shadow_chars = new Surface(conv, true); SDL_FreeSurface(conv); } } @@ -172,7 +172,7 @@ void display_text_file(const std::string& file, float scroll_speed) } // load background image - Surface* background = new Surface(datadir + "/images/background/" + background_file, IGNORE_ALPHA); + Surface* background = new Surface(datadir + "/images/background/" + background_file, false); int done = 0; float scroll = 0; diff --git a/src/screen/screen.h b/src/screen/screen.h index f5192327a..b272741ea 100644 --- a/src/screen/screen.h +++ b/src/screen/screen.h @@ -53,11 +53,6 @@ public: class Vector; -#define NO_UPDATE false -#define UPDATE true -#define USE_ALPHA 0 -#define IGNORE_ALPHA 1 - 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); diff --git a/src/screen/surface.cpp b/src/screen/surface.cpp index 2eb02b88d..5dfff1fb1 100644 --- a/src/screen/surface.cpp +++ b/src/screen/surface.cpp @@ -31,7 +31,7 @@ Surface::Surfaces Surface::surfaces; -SurfaceData::SurfaceData(SDL_Surface* temp, int use_alpha_) +SurfaceData::SurfaceData(SDL_Surface* temp, bool use_alpha_) : type(SURFACE), surface(0), use_alpha(use_alpha_) { // Copy the given surface and make sure that it is not stored in @@ -49,11 +49,11 @@ SurfaceData::SurfaceData(SDL_Surface* temp, int use_alpha_) SDL_BlitSurface(temp, NULL, surface, NULL); } -SurfaceData::SurfaceData(const std::string& file_, int use_alpha_) +SurfaceData::SurfaceData(const std::string& file_, bool 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_) +SurfaceData::SurfaceData(const std::string& file_, int x_, int y_, int w_, int h_, bool use_alpha_) : type(LOAD_PART), surface(0), file(file_), use_alpha(use_alpha_), x(x_), y(y_), w(w_), h(h_) {} @@ -134,7 +134,7 @@ static int power_of_two(int input) } #endif -Surface::Surface(SDL_Surface* surf, int use_alpha) +Surface::Surface(SDL_Surface* surf, bool use_alpha) : data(surf, use_alpha), w(0), h(0) { impl = data.create(); @@ -146,7 +146,7 @@ Surface::Surface(SDL_Surface* surf, int use_alpha) surfaces.push_back(this); } -Surface::Surface(const std::string& file, int use_alpha) +Surface::Surface(const std::string& file, bool use_alpha) : data(file, use_alpha), w(0), h(0) { impl = data.create(); @@ -158,7 +158,7 @@ Surface::Surface(const std::string& file, int use_alpha) surfaces.push_back(this); } -Surface::Surface(const std::string& file, int x, int y, int w, int h, int use_alpha) +Surface::Surface(const std::string& file, int x, int y, int w, int h, bool use_alpha) : data(file, x, y, w, h, use_alpha), w(0), h(0) { impl = data.create(); @@ -248,7 +248,7 @@ Surface::resize(int w_, int h_) } SDL_Surface* -sdl_surface_part_from_file(const std::string& file, int x, int y, int w, int h, int use_alpha) +sdl_surface_part_from_file(const std::string& file, int x, int y, int w, int h, bool use_alpha) { SDL_Rect src; SDL_Surface * sdl_surface; @@ -283,7 +283,7 @@ sdl_surface_part_from_file(const std::string& file, int x, int y, int w, int h, SDL_SetAlpha(temp,0,0); SDL_BlitSurface(temp, &src, conv, NULL); - if(use_alpha == IGNORE_ALPHA && !use_gl) + if(use_alpha == false && !use_gl) sdl_surface = SDL_DisplayFormat(conv); else sdl_surface = SDL_DisplayFormatAlpha(conv); @@ -291,7 +291,7 @@ sdl_surface_part_from_file(const std::string& file, int x, int y, int w, int h, if (sdl_surface == NULL) st_abort("Can't covert to display format", file); - if (use_alpha == IGNORE_ALPHA && !use_gl) + if (use_alpha == false && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); SDL_FreeSurface(temp); @@ -301,7 +301,7 @@ sdl_surface_part_from_file(const std::string& file, int x, int y, int w, int h, } SDL_Surface* -sdl_surface_from_file(const std::string& file, int use_alpha) +sdl_surface_from_file(const std::string& file, bool use_alpha) { SDL_Surface* sdl_surface; SDL_Surface* temp; @@ -311,7 +311,7 @@ sdl_surface_from_file(const std::string& file, int use_alpha) if (temp == NULL) st_abort("Can't load", file); - if(use_alpha == IGNORE_ALPHA && !use_gl) + if(use_alpha == false && !use_gl) sdl_surface = SDL_DisplayFormat(temp); else sdl_surface = SDL_DisplayFormatAlpha(temp); @@ -319,7 +319,7 @@ sdl_surface_from_file(const std::string& file, int use_alpha) if (sdl_surface == NULL) st_abort("Can't covert to display format", file); - if (use_alpha == IGNORE_ALPHA && !use_gl) + if (use_alpha == false && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); SDL_FreeSurface(temp); @@ -328,7 +328,7 @@ sdl_surface_from_file(const std::string& file, int use_alpha) } SDL_Surface* -sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha) +sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, bool use_alpha) { SDL_Surface* sdl_surface; Uint32 saved_flags; @@ -343,7 +343,7 @@ sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha) SDL_SetAlpha(sdl_surf, 0, 0); } - if(use_alpha == IGNORE_ALPHA && !use_gl) + if(use_alpha == false && !use_gl) sdl_surface = SDL_DisplayFormat(sdl_surf); else sdl_surface = SDL_DisplayFormatAlpha(sdl_surf); @@ -358,7 +358,7 @@ sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha) if (sdl_surface == NULL) st_abort("Can't covert to display format", "SURFACE"); - if (use_alpha == IGNORE_ALPHA && !use_gl) + if (use_alpha == false && !use_gl) SDL_SetAlpha(sdl_surface, 0, 0); return sdl_surface; @@ -434,7 +434,7 @@ int SurfaceImpl::resize(int w_, int h_) } #ifndef NOOPENGL -SurfaceOpenGL::SurfaceOpenGL(SDL_Surface* surf, int use_alpha) +SurfaceOpenGL::SurfaceOpenGL(SDL_Surface* surf, bool use_alpha) { sdl_surface = sdl_surface_from_sdl_surface(surf, use_alpha); create_gl(sdl_surface,&gl_texture); @@ -443,7 +443,7 @@ SurfaceOpenGL::SurfaceOpenGL(SDL_Surface* surf, int use_alpha) h = sdl_surface->h; } -SurfaceOpenGL::SurfaceOpenGL(const std::string& file, int use_alpha) +SurfaceOpenGL::SurfaceOpenGL(const std::string& file, bool use_alpha) { sdl_surface = sdl_surface_from_file(file, use_alpha); create_gl(sdl_surface,&gl_texture); @@ -452,7 +452,7 @@ SurfaceOpenGL::SurfaceOpenGL(const std::string& file, int use_alpha) h = sdl_surface->h; } -SurfaceOpenGL::SurfaceOpenGL(const std::string& file_, int x_, int y_, int w_, int h_, int use_alpha_) +SurfaceOpenGL::SurfaceOpenGL(const std::string& file_, int x_, int y_, int w_, int h_, bool use_alpha_) { sdl_surface = sdl_surface_part_from_file(file_,x_,y_,w_,h_,use_alpha_); @@ -700,21 +700,21 @@ SurfaceOpenGL::draw_stretched(float x, float y, int sw, int sh, Uint8 alpha) #endif -SurfaceSDL::SurfaceSDL(SDL_Surface* surf, int use_alpha) +SurfaceSDL::SurfaceSDL(SDL_Surface* surf, bool 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) +SurfaceSDL::SurfaceSDL(const std::string& file, bool 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) +SurfaceSDL::SurfaceSDL(const std::string& file, int x, int y, int w, int h, bool use_alpha) { sdl_surface = sdl_surface_part_from_file(file, x, y, w, h, use_alpha); w = sdl_surface->w; diff --git a/src/screen/surface.h b/src/screen/surface.h index 79899d94d..535c57a6d 100644 --- a/src/screen/surface.h +++ b/src/screen/surface.h @@ -33,7 +33,7 @@ #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_sdl_surface(SDL_Surface* sdl_surf, bool use_alpha); SDL_Surface* sdl_surface_from_nothing(); class SurfaceImpl; @@ -59,7 +59,7 @@ public: ConstructorType type; SDL_Surface* surface; std::string file; - int use_alpha; + bool use_alpha; int x; int y; int w; @@ -67,9 +67,9 @@ public: 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(SDL_Surface* surf, bool use_alpha_); + SurfaceData(const std::string& file_, bool use_alpha_); + SurfaceData(const std::string& file_, int x_, int y_, int w_, int h_, bool use_alpha_); SurfaceData(Color top_gradient_, Color bottom_gradient_, int w_, int h_); ~SurfaceData(); @@ -94,9 +94,9 @@ 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(SDL_Surface* surf, bool use_alpha); + Surface(const std::string& file, bool use_alpha); + Surface(const std::string& file, int x, int y, int w, int h, bool use_alpha); Surface(Color top_gradient, Color bottom_gradient, int w_, int h_); ~Surface(); @@ -135,9 +135,9 @@ public: 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(SDL_Surface* surf, bool use_alpha); + SurfaceSDL(const std::string& file, bool use_alpha); + SurfaceSDL(const std::string& file, int x, int y, int w, int h, bool use_alpha); SurfaceSDL(Color top_gradient, Color bottom_gradient, int w, int h); virtual ~SurfaceSDL(); @@ -155,9 +155,9 @@ 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(SDL_Surface* surf, bool use_alpha); + SurfaceOpenGL(const std::string& file, bool use_alpha); + SurfaceOpenGL(const std::string& file, int x, int y, int w, int h, bool use_alpha); SurfaceOpenGL(Color top_gradient, Color bottom_gradient, int w, int h); virtual ~SurfaceOpenGL(); diff --git a/src/setup.cpp b/src/setup.cpp index f8c63c95a..1a5698b45 100644 --- a/src/setup.cpp +++ b/src/setup.cpp @@ -602,11 +602,11 @@ void st_general_setup(void) Font::NUM, 32,32); /* Load GUI/menu images: */ - checkbox = new Surface(datadir + "/images/status/checkbox.png", USE_ALPHA); - checkbox_checked = new Surface(datadir + "/images/status/checkbox-checked.png", USE_ALPHA); - back = new Surface(datadir + "/images/status/back.png", USE_ALPHA); - arrow_left = new Surface(datadir + "/images/icons/left.png", USE_ALPHA); - arrow_right = new Surface(datadir + "/images/icons/right.png", USE_ALPHA); + checkbox = new Surface(datadir + "/images/status/checkbox.png", true); + checkbox_checked = new Surface(datadir + "/images/status/checkbox-checked.png", true); + back = new Surface(datadir + "/images/status/back.png", true); + arrow_left = new Surface(datadir + "/images/icons/left.png", true); + arrow_right = new Surface(datadir + "/images/icons/right.png", true); /* Load the mouse-cursor */ mouse_cursor = new MouseCursor( datadir + "/images/status/mousecursor.png",1); diff --git a/src/sprite.cpp b/src/sprite.cpp index 8386b4cb5..7c435f89a 100644 --- a/src/sprite.cpp +++ b/src/sprite.cpp @@ -44,7 +44,7 @@ Sprite::Sprite(lisp_object_t* cur) for(std::vector::size_type i = 0; i < images.size(); ++i) { surfaces.push_back( - new Surface(datadir + "/images/" + images[i], USE_ALPHA)); + new Surface(datadir + "/images/" + images[i], true)); } frame_delay = 1000.0f/fps; diff --git a/src/tile.cpp b/src/tile.cpp index 0ab782fe2..d96fb6810 100644 --- a/src/tile.cpp +++ b/src/tile.cpp @@ -39,7 +39,7 @@ Surface* create_surface(lisp_object_t* cur) if (lisp_string_p(cur)) { return new Surface(datadir + "/images/tilesets/" + lisp_string(cur), - USE_ALPHA); + true); } else if (lisp_cons_p(cur) && lisp_symbol_p(lisp_car(cur))) { @@ -55,7 +55,7 @@ Surface* create_surface(lisp_object_t* cur) lisp_integer(lisp_list_nth(data, 2)), lisp_integer(lisp_list_nth(data, 3)), lisp_integer(lisp_list_nth(data, 4)), - USE_ALPHA); + true); } else { diff --git a/src/title.cpp b/src/title.cpp index 9d6388e81..730dbf782 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -247,9 +247,9 @@ void title(void) titlesession = new GameSession(datadir + "/levels/misc/menu.stl", ST_GL_DEMO_GAME); /* Load images: */ - bkg_title = new Surface(datadir + "/images/background/arctis.jpg", IGNORE_ALPHA); - logo = new Surface(datadir + "/images/title/logo.png", USE_ALPHA); - img_choose_subset = new Surface(datadir + "/images/status/choose-level-subset.png", USE_ALPHA); + bkg_title = new Surface(datadir + "/images/background/arctis.jpg", false); + logo = new Surface(datadir + "/images/title/logo.png", true); + img_choose_subset = new Surface(datadir + "/images/status/choose-level-subset.png", true); /* Generating contrib maps by only using a string_list */ worldmap_list = dfiles("levels/worldmap", NULL, NULL); diff --git a/src/worldmap.cpp b/src/worldmap.cpp index d69302f28..e8b711d7d 100644 --- a/src/worldmap.cpp +++ b/src/worldmap.cpp @@ -130,7 +130,7 @@ TileManager::TileManager() tile->sprite = new Surface( datadir + "/images/worldmap/" + filename, - USE_ALPHA); + true); if (id >= int(tiles.size())) tiles.resize(id+1); @@ -171,9 +171,9 @@ TileManager::get(int i) Tux::Tux(WorldMap* worldmap_) : worldmap(worldmap_) { - largetux_sprite = new Surface(datadir + "/images/worldmap/tux.png", USE_ALPHA); - firetux_sprite = new Surface(datadir + "/images/worldmap/firetux.png", USE_ALPHA); - smalltux_sprite = new Surface(datadir + "/images/worldmap/smalltux.png", USE_ALPHA); + largetux_sprite = new Surface(datadir + "/images/worldmap/tux.png", true); + firetux_sprite = new Surface(datadir + "/images/worldmap/firetux.png", true); + smalltux_sprite = new Surface(datadir + "/images/worldmap/smalltux.png", true); offset = 0; moving = false; @@ -357,9 +357,9 @@ WorldMap::WorldMap() start_x = 4; start_y = 5; - level_sprite = new Surface(datadir + "/images/worldmap/levelmarker.png", USE_ALPHA); - leveldot_green = new Surface(datadir + "/images/worldmap/leveldot_green.png", USE_ALPHA); - leveldot_red = new Surface(datadir + "/images/worldmap/leveldot_red.png", USE_ALPHA); + level_sprite = new Surface(datadir + "/images/worldmap/levelmarker.png", true); + leveldot_green = new Surface(datadir + "/images/worldmap/leveldot_green.png", true); + leveldot_red = new Surface(datadir + "/images/worldmap/leveldot_red.png", true); input_direction = D_NONE; enter_level = false; -- 2.11.0