From: Tobias Gläßer Date: Sun, 14 Mar 2004 12:03:30 +0000 (+0000) Subject: fixed nosound and noopengl build bugs. fixed bkgd image bugs.. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a37b97510b23de2f8eea347651509ff74b730da7;p=supertux.git fixed nosound and noopengl build bugs. fixed bkgd image bugs.. SVN-Revision: 213 --- diff --git a/src/level.c b/src/level.c index d6fcfab77..bbc704104 100644 --- a/src/level.c +++ b/src/level.c @@ -339,6 +339,11 @@ void level_load_gfx(st_level *plevel) snprintf(fname, 1024, "%s/images/background/%s", DATA_PREFIX, plevel->bkgd_image); texture_load(&img_bkgd, fname, IGNORE_ALPHA); } + else + { + /* Quick hack to make sure an image is loaded, when we are freeing it afterwards. */# + level_load_image(&img_bkgd, plevel->theme,"solid0.png", IGNORE_ALPHA); + } } /* Free graphics data for this level: */ @@ -357,6 +362,7 @@ void level_free_gfx(void) texture_free(&img_bkgd_tile[0][i]); texture_free(&img_bkgd_tile[1][i]); } + texture_free(&img_bkgd); } diff --git a/src/leveleditor.c b/src/leveleditor.c index e23cd1f17..5c8a78d83 100644 --- a/src/leveleditor.c +++ b/src/leveleditor.c @@ -606,6 +606,7 @@ void update_level_settings_menu() string_list_copy(level_settings_menu.item[3].list, dsubdirs("images/themes", "solid0.png")); string_list_copy(level_settings_menu.item[4].list, dfiles("music/",NULL, "-fast")); string_list_copy(level_settings_menu.item[5].list, dfiles("images/background",NULL, NULL)); + string_list_add_item(level_settings_menu.item[5].list,""); if((i = string_list_find(level_settings_menu.item[3].list,le_current_level->theme)) != -1) level_settings_menu.item[3].list->active_item = i; if((i = string_list_find(level_settings_menu.item[4].list,le_current_level->song_title)) != -1) diff --git a/src/screen.c b/src/screen.c index 3301201a6..86e83a458 100644 --- a/src/screen.c +++ b/src/screen.c @@ -45,10 +45,14 @@ void clearscreen(int r, int g, int b) glClear(GL_COLOR_BUFFER_BIT); } else + { #endif SDL_FillRect(screen, NULL, SDL_MapRGB(screen->format, r, g, b)); +#ifndef NOOPENGL + } +#endif } /* 'Stolen' from the SDL documentation. @@ -174,7 +178,10 @@ void drawline(int x1, int y1, int x2, int y2, int r, int g, int b, int a) y1 += sh_step; } drawpixel(x1, y1, color); +#ifndef NOOPENGL + } +#endif } /* --- FILL A RECT --- */ diff --git a/src/sound.c b/src/sound.c index d81db7282..8766094c7 100644 --- a/src/sound.c +++ b/src/sound.c @@ -243,7 +243,7 @@ void free_music(Mix_Music *music) #else void* sounds[NUM_SOUNDS]; -void* level_song, *herring_song; +void* level_song, * level_song_fast, * herring_song; int open_audio (int frequency, int format, int channels, int chunksize) { diff --git a/src/sound.h b/src/sound.h index 3a1d30a17..48a26a376 100644 --- a/src/sound.h +++ b/src/sound.h @@ -97,7 +97,7 @@ void play_current_music(); /* fake variables */ extern void* sounds[NUM_SOUNDS]; -extern void* level_song, *herring_song; +extern void * level_song, * level_song_fast, * herring_song; /* fake sound handlers */ int open_audio (int frequency, int format, int channels, int chunksize); diff --git a/src/texture.h b/src/texture.h index 3c3d8034f..820a75b8e 100644 --- a/src/texture.h +++ b/src/texture.h @@ -22,7 +22,7 @@ typedef struct texture_type { SDL_Surface* sdl_surface; - GLuint gl_texture; + unsigned gl_texture; int w; int h; } texture_type;