Package: tecnoballz Version: 0.92-2.1 Severity: normal Tags: patch Starting at certain level, walls on right can disappear. And when we loose a ball on right, a part of the ball can go over the right panel, but the right panel is not redrawn.
The patch I send include this fix and a few others things : - wired things with pointers (see configfile.cc) - a few spelling fixes - a few warning fixes (Sorry, english is not my first language.) PS : There would be a lot of things to do for the code to look like real C++ Object Oriented (why the hell everything inherits from Tecnoballz?!), but that's not the time to do this. Celelibi -- System Information: Debian Release: 5.0 APT prefers testing APT policy: (990, 'testing'), (600, 'unstable') Architecture: i386 (i686) Kernel: Linux 2.6.23.9 (SMP w/2 CPU cores; PREEMPT) Locale: LANG=fr_FR, LC_CTYPE=fr_FR (charmap=ISO-8859-1) Shell: /bin/sh linked to /bin/bash Versions of packages tecnoballz depends on: ii libc6 2.7-16 GNU C Library: Shared libraries ii libgcc1 1:4.3.2-1 GCC support library ii libmikmod2 3.1.11-a-6 A portable sound library ii libogg0 1.1.3-4 Ogg Bitstream Library ii libsdl-image1.2 1.2.6-3 image loading library for Simple D ii libsdl-mixer1.2 1.2.8-4 mixer library for Simple DirectMed ii libsdl1.2debian 1.2.13-2 Simple DirectMedia Layer ii libsmpeg0 0.4.5+cvs20030824-2.2 SDL MPEG Player Library - shared l ii libstdc++6 4.3.2-1 The GNU Standard C++ Library v3 ii libvorbisfile3 1.2.0.dfsg-3.1 The Vorbis General Audio Compressi ii tecnoballz-data 0.92-2.1 graphic, sound and music files for tecnoballz recommends no packages. tecnoballz suggests no packages. -- no debconf information
diff -Naur tecnoballz.orig/include/configfile.h tecnoballz-no-garbage/include/configfile.h --- tecnoballz.orig/include/configfile.h 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/include/configfile.h 2009-01-02 04:16:05.000000000 +0100 @@ -87,7 +87,7 @@ void load (); void save (); Sint32 scan_arguments (Sint32 arg_count, char **arg_values); - char *get_player_name (Uint32 playernum); + const char *get_player_name (Uint32 playernum); void set_player_name (Uint32 playernum, char *name); const char * get_language (); diff -Naur tecnoballz.orig/include/handler_players.h tecnoballz-no-garbage/include/handler_players.h --- tecnoballz.orig/include/handler_players.h 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/include/handler_players.h 2009-01-02 04:16:05.000000000 +0100 @@ -111,7 +111,7 @@ public: void initialize (Uint32 lifes, Uint32 areaN, Uint32 level, Uint32 monay, Uint32 grdPt); - void set_name (char *playername); + void set_name (const char *playername); char *get_name (); Uint32 get_area_number (); Uint32 get_level_number (); diff -Naur tecnoballz.orig/include/right_panel_score.h tecnoballz-no-garbage/include/right_panel_score.h --- tecnoballz.orig/include/right_panel_score.h 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/include/right_panel_score.h 2009-01-02 04:16:05.000000000 +0100 @@ -40,6 +40,8 @@ class right_panel_score:public display_text_bitmap { private: + bitmap_data *bmp; + static right_panel_score* panel_score_singleton; static const Uint32 DELAY_GIGABLITZ_COUNTDOWN = 10; @@ -93,7 +95,6 @@ void set_bricks_counter (Uint32 counter); void draw_gigablizt_gauge (); void reset_gigablitz_countdown (); -private: void draw_background (); }; diff -Naur tecnoballz.orig/include/supervisor.h tecnoballz-no-garbage/include/supervisor.h --- tecnoballz.orig/include/supervisor.h 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/include/supervisor.h 2009-01-02 04:16:05.000000000 +0100 @@ -35,7 +35,7 @@ public: supervisor (); - virtual ~ supervisor (); + virtual ~supervisor () = 0; void initialize (); void release (); virtual void first_init (); diff -Naur tecnoballz.orig/include/surface_sdl.h tecnoballz-no-garbage/include/surface_sdl.h --- tecnoballz.orig/include/surface_sdl.h 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/include/surface_sdl.h 2009-01-02 04:16:05.000000000 +0100 @@ -46,7 +46,7 @@ ~surface_sdl (); SDL_Surface* get_surface (); char* get_pixel_data (); - char* get_pixel_data (Uint32 coord_x, Uint32 coord_x); + char* get_pixel_data (Uint32 coord_x, Uint32 coord_y); Uint32 get_row_size (); Uint32 get_offset (Uint32 xcoord, Uint32 ycoord); void clear (Uint32 color = 0); diff -Naur tecnoballz.orig/src/configfile.cc tecnoballz-no-garbage/src/configfile.cc --- tecnoballz.orig/src/configfile.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/configfile.cc 2009-01-02 04:16:04.000000000 +0100 @@ -47,12 +47,12 @@ */ configfile::configfile () { - thePlayers[0] = &thePlayer1[0]; - thePlayers[1] = &thePlayer2[1]; - thePlayers[2] = &thePlayer3[2]; - thePlayers[3] = &thePlayer4[3]; - thePlayers[4] = &thePlayer5[4]; - thePlayers[5] = &thePlayer6[5]; + thePlayers[0] = thePlayer1; + thePlayers[1] = thePlayer2; + thePlayers[2] = thePlayer3; + thePlayers[3] = thePlayer4; + thePlayers[4] = thePlayer5; + thePlayers[5] = thePlayer6; for (Uint32 i = 0; i < handler_players::MAX_OF_PLAYERS; i++) { char *p = thePlayers[i]; @@ -307,7 +307,7 @@ * @param playernum Player number from 0 to 5 * @return Pointer to a player name */ -char * +const char * configfile::get_player_name (Uint32 playernum) { if (playernum >= handler_players::MAX_OF_PLAYERS) diff -Naur tecnoballz.orig/src/handler_players.cc tecnoballz-no-garbage/src/handler_players.cc --- tecnoballz.orig/src/handler_players.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/handler_players.cc 2009-01-02 04:16:05.000000000 +0100 @@ -158,7 +158,7 @@ * @param name the name of the player */ void -handler_players::set_name (char *name) +handler_players::set_name (const char *name) { for (Uint32 i = 0; i < PLAYER_NAME_LENGTH; i++) { diff -Naur tecnoballz.orig/src/head_animation.cc tecnoballz-no-garbage/src/head_animation.cc --- tecnoballz.orig/src/head_animation.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/head_animation.cc 2009-01-02 04:16:04.000000000 +0100 @@ -88,7 +88,7 @@ } /** - * Draw the current image of the hean animation + * Draw the current image of the head animation */ void head_animation::draw () diff -Naur tecnoballz.orig/src/right_panel_score.cc tecnoballz-no-garbage/src/right_panel_score.cc --- tecnoballz.orig/src/right_panel_score.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/right_panel_score.cc 2009-01-02 04:16:04.000000000 +0100 @@ -41,6 +41,8 @@ gigablitz_countdown = gauge_height; delay_gigablitz_countdown = 0; flip_white = false; + bmp = new bitmap_data (); + bmp->load (handler_resources::BITMAP_RIGHT_PANEL); } /** @@ -48,6 +50,8 @@ */ right_panel_score::~right_panel_score () { + delete bmp; + bmp = NULL; destroy_me (); panel_score_singleton = NULL; } @@ -86,9 +90,6 @@ void right_panel_score::draw_background () { - bitmap_data *bmp = new bitmap_data (); - bmp->load (handler_resources::BITMAP_RIGHT_PANEL); - /* drawn panel score */ offscreen_surface* screen; if (has_background) @@ -101,8 +102,7 @@ } screen->blit_surface (bmp, 0, 0, 256 * resolution, 0, bmp->get_width (), 240 * resolution); - delete bmp; - bmp = (bitmap_data *) NULL; + draw (screen, AREA_NUM_XCOORD * resolution, AREA_NUM_YCOORD * resolution, current_player->area_number, 2); draw (screen, LEVEL_NUM_XCOORD * resolution, diff -Naur tecnoballz.orig/src/sprite_display_menu.cc tecnoballz-no-garbage/src/sprite_display_menu.cc --- tecnoballz.orig/src/sprite_display_menu.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/sprite_display_menu.cc 2009-01-02 04:16:05.000000000 +0100 @@ -237,7 +237,7 @@ char a = *(p++) - 32; if (a != 0) { - b = c[a]; + b = c[(int)a]; unsigned char * s = (unsigned char *) font; unsigned char * d = (unsigned char *) dest; b = b << 3; @@ -284,7 +284,7 @@ a = *(p++) - 32; if (a != 0) { - b = c[a]; + b = c[(int)a]; b = b << 4; #ifndef BYTES_COPY Sint32 * s = (Sint32 *) font; @@ -338,7 +338,7 @@ char a = *(p++) - 32; if (a != 0) { - b = c[a]; + b = c[(int)a]; unsigned char * s = (unsigned char *) font; unsigned char * d = (unsigned char *) dest; b = b << 4; diff -Naur tecnoballz.orig/src/sprite_gem.cc tecnoballz-no-garbage/src/sprite_gem.cc --- tecnoballz.orig/src/sprite_gem.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/sprite_gem.cc 2009-01-02 04:16:04.000000000 +0100 @@ -99,7 +99,7 @@ paddle = pad; towards = paddle->get_paddle_number (); speed_of_moving = resolution; - Uint32 h = (random_counter >> 4 + rand_count++) & 7; + Uint32 h = (random_counter >> (4 + rand_count++)) & 7; random_counter += xcoord; h = gem_random[h]; gem_id = h; diff -Naur tecnoballz.orig/src/supervisor_bricks_level.cc tecnoballz-no-garbage/src/supervisor_bricks_level.cc --- tecnoballz.orig/src/supervisor_bricks_level.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/supervisor_bricks_level.cc 2009-01-02 04:16:04.000000000 +0100 @@ -307,6 +307,8 @@ head_anim->play (); } sides_bricks->run (); + panel_score->draw_background(); + head_anim->play(); display->lock_surfaces (); if (has_background) { diff -Naur tecnoballz.orig/src/supervisor_main_menu.cc tecnoballz-no-garbage/src/supervisor_main_menu.cc --- tecnoballz.orig/src/supervisor_main_menu.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/supervisor_main_menu.cc 2009-01-02 04:16:04.000000000 +0100 @@ -320,13 +320,13 @@ * @return the area code */ const char * -supervisor_main_menu::get_area_code (Uint32 aera_num, Uint32 difficulty) +supervisor_main_menu::get_area_code (Uint32 area_num, Uint32 difficulty) { - if (aera_num < 2) + if (area_num < 2) { return NULL; } - return &area_codes[(aera_num - 2) * 40 + (difficulty - 1) * 10]; + return &area_codes[(area_num - 2) * 40 + (difficulty - 1) * 10]; } /** diff -Naur tecnoballz.orig/src/surface_sdl.cc tecnoballz-no-garbage/src/surface_sdl.cc --- tecnoballz.orig/src/surface_sdl.cc 2008-12-31 18:25:59.000000000 +0100 +++ tecnoballz-no-garbage/src/surface_sdl.cc 2009-01-02 04:16:04.000000000 +0100 @@ -53,7 +53,7 @@ surface_sdl::~surface_sdl () { - if (NULL == surface) + if (NULL != surface) { SDL_FreeSurface (surface); surface = NULL;;