debian/0000755000000000000000000000000012155001710007156 5ustar debian/patches/0000755000000000000000000000000012155001650010610 5ustar debian/patches/dot-files-endian-clean.patch0000644000000000000000000000726211536331312016045 0ustar Description: Save the game's dotfiles in an endian-independent way. Forwarded: no Author: Peter De Wachter Last-Update: 2009-05-07 Index: alex4src/src/control.c =================================================================== --- alex4src.orig/src/control.c 2008-01-17 00:20:33.000000000 +0100 +++ alex4src/src/control.c 2008-01-17 00:29:35.000000000 +0100 @@ -93,10 +93,24 @@ // saves the control config to disk using FP void save_control(Tcontrol *c, PACKFILE *fp) { - pack_fwrite(c, sizeof(Tcontrol), fp); + pack_iputl(c->use_joy, fp); + pack_iputl(c->key_left, fp); + pack_iputl(c->key_right, fp); + pack_iputl(c->key_up, fp); + pack_iputl(c->key_down, fp); + pack_iputl(c->key_fire, fp); + pack_iputl(c->key_jump, fp); + pack_putc(c->flags, fp); } // loads the control config from disk using FP void load_control(Tcontrol *c, PACKFILE *fp) { - pack_fread(c, sizeof(Tcontrol), fp); + c->use_joy = pack_igetl(fp); + c->key_left = pack_igetl(fp); + c->key_right = pack_igetl(fp); + c->key_up = pack_igetl(fp); + c->key_down = pack_igetl(fp); + c->key_fire = pack_igetl(fp); + c->key_jump = pack_igetl(fp); + c->flags = pack_getc(fp); } Index: alex4src/src/hisc.c =================================================================== --- alex4src.orig/src/hisc.c 2008-01-17 00:29:45.000000000 +0100 +++ alex4src/src/hisc.c 2008-01-17 00:42:13.000000000 +0100 @@ -117,9 +117,12 @@ for(i=0; imax_levels, fp); + for (i = 0; i < MAX_LEVELS; ++i) + pack_iputl(o->cherries[i], fp); + for (i = 0; i < MAX_LEVELS; ++i) + pack_iputl(o->stars[i], fp); + pack_iputl(o->use_vsync, fp); + pack_iputl(o->one_hundred, fp); } // loads the data structure from disk void load_options(Toptions *o, PACKFILE *fp) { - pack_fread(o, sizeof(Toptions), fp); + int i; + o->max_levels = pack_igetl(fp); + for (i = 0; i < MAX_LEVELS; ++i) + o->cherries[i] = pack_igetl(fp); + for (i = 0; i < MAX_LEVELS; ++i) + o->stars[i] = pack_igetl(fp); + o->use_vsync = pack_igetl(fp); + o->one_hundred = pack_igetl(fp); } // resets all data debian/patches/allegro-4.2.patch0000644000000000000000000003025311536331312013565 0ustar Description: Get rid of deprecated Allegro functions. Forwarded: yes Author: Peter De Wachter Last-Update: 2009-05-07 --- a/src/edit.c +++ b/src/edit.c @@ -69,8 +69,8 @@ } // show stuff - textprintf(bmp, data[THE_FONT].dat, 1, 1, 0, "TILE: %d,%d", tx, ty); - textprintf(bmp, data[THE_FONT].dat, 1, 11, 0, "SIZE: %d,%d", map->width, map->height); + textprintf_ex(bmp, data[THE_FONT].dat, 1, 1, 0, -1, "TILE: %d,%d", tx, ty); + textprintf_ex(bmp, data[THE_FONT].dat, 1, 11, 0, -1, "SIZE: %d,%d", map->width, map->height); // show start pos x = (ABS(map->start_x) << 4) - map->offset_x; @@ -80,7 +80,7 @@ // draw status bar rectfill(bmp, 0, 110, 159, 119, 1); - textprintf(bmp, data[THE_FONT].dat, 1, 111, 4, "EDITING: %s", get_filename(edit_path_and_file)); + textprintf_ex(bmp, data[THE_FONT].dat, 1, 111, 4, -1, "EDITING: %s", get_filename(edit_path_and_file)); } else if (edit_mode == EDIT_MODE_SELECT) { // draw tile palette // calculate offset depending on mouse pointer @@ -104,16 +104,16 @@ else if (edit_mode == EDIT_MODE_STATS) { // draw map properties int ty = 16; clear_to_color(bmp, 3); - textprintf(bmp, data[THE_FONT].dat, 1, 1, 1, "%s (props)", get_filename(edit_path_and_file)); + textprintf_ex(bmp, data[THE_FONT].dat, 1, 1, 1, -1, "%s (props)", get_filename(edit_path_and_file)); line(bmp, 0, 10, 159, 10, 1); - textprintf(bmp, data[THE_FONT].dat, 1, ty+=10, 1, "Win by:"); - textprintf(bmp, data[THE_FONT].dat, 1, ty+=10, 1, " 1) reach exit (%s)", (map->win_conditions & MAP_WIN_EXIT ? "X" : " ")); - textprintf(bmp, data[THE_FONT].dat, 1, ty+=10, 1, " 2) kill boss (%s)", (map->win_conditions & MAP_WIN_KILL_GUARDIAN ? "X" : " ")); - textprintf(bmp, data[THE_FONT].dat, 1, ty+=10, 1, " 3) kill all (%s)", (map->win_conditions & MAP_WIN_KILL_ALL ? "X" : " ")); - textprintf(bmp, data[THE_FONT].dat, 1, ty+=10, 1, "4) Boss level: (%s)", (map->boss_level ? "X" : " ")); - textprintf(bmp, data[THE_FONT].dat, 1, ty+=10, 1, "5) Name: %s", map->name); + textprintf_ex(bmp, data[THE_FONT].dat, 1, ty+=10, 1, -1, "Win by:"); + textprintf_ex(bmp, data[THE_FONT].dat, 1, ty+=10, 1, -1, " 1) reach exit (%s)", (map->win_conditions & MAP_WIN_EXIT ? "X" : " ")); + textprintf_ex(bmp, data[THE_FONT].dat, 1, ty+=10, 1, -1, " 2) kill boss (%s)", (map->win_conditions & MAP_WIN_KILL_GUARDIAN ? "X" : " ")); + textprintf_ex(bmp, data[THE_FONT].dat, 1, ty+=10, 1, -1, " 3) kill all (%s)", (map->win_conditions & MAP_WIN_KILL_ALL ? "X" : " ")); + textprintf_ex(bmp, data[THE_FONT].dat, 1, ty+=10, 1, -1, "4) Boss level: (%s)", (map->boss_level ? "X" : " ")); + textprintf_ex(bmp, data[THE_FONT].dat, 1, ty+=10, 1, -1, "5) Name: %s", map->name); - textprintf(bmp, data[THE_FONT].dat, 1, 110, 1, "F1: back to editor"); + textprintf_ex(bmp, data[THE_FONT].dat, 1, 110, 1, -1, "F1: back to editor"); } if (edit_mode != EDIT_MODE_STATS) { --- a/src/hisc.c +++ b/src/hisc.c @@ -153,9 +153,9 @@ // draws a single hisc post void draw_hisc_post(Thisc *table, BITMAP *bmp, FONT *fnt, int x, int y, int color, int show_level) { - textprintf(bmp, fnt, x, y, color, "%s", table->name); - if (show_level) textprintf_right(bmp, fnt, x+80, y, color, "%2d", table->level); - textprintf_right(bmp, fnt, x+140, y, color, "%d", table->score); + textprintf_ex(bmp, fnt, x, y, color, -1, "%s", table->name); + if (show_level) textprintf_right_ex(bmp, fnt, x+80, y, color, -1, "%2d", table->level); + textprintf_right_ex(bmp, fnt, x+140, y, color, -1, "%d", table->score); } // draws the entire table --- a/src/main.c +++ b/src/main.c @@ -496,15 +496,15 @@ rectfill(bmp, 0, y, 159, y+9, 1); draw_sprite_h_flip(bmp, data[HERO_NORM].dat, 0, y+1); - textprintf(bmp, data[THE_FONT].dat, 9, y+1, 4, " :%d", player.lives); + textprintf_ex(bmp, data[THE_FONT].dat, 9, y+1, 4, -1, " :%d", player.lives); for(i = 0; i < player.health; i ++) draw_sprite(bmp, data[HEART2].dat, 40 + 10 * i, y-3); draw_sprite(bmp, data[EGG].dat, 80, y-5); - textprintf(bmp, data[THE_FONT].dat, 85, y+1, 4, " :%d", player.ammo); + textprintf_ex(bmp, data[THE_FONT].dat, 85, y+1, 4, -1, " :%d", player.ammo); - textprintf_right(bmp, data[THE_FONT].dat, 158, y+1, 4, "%d", player.score); + textprintf_right_ex(bmp, data[THE_FONT].dat, 158, y+1, 4, -1, "%d", player.score); } @@ -626,7 +626,6 @@ // various allegro things log2file(" initializing allegro"); - text_mode(-1); garble_string(init_string, 53); #ifdef __unix__ snprintf(filename, sizeof(filename), "%s/.alex4/alex4.ini", @@ -635,7 +634,6 @@ #else set_config_file("alex4.ini"); #endif - set_window_close_button(FALSE); // install timers log2file(" installing timers"); @@ -701,7 +699,7 @@ // show initial loading screen clear(swap_screen); - textout_centre(swap_screen, font, "loading...", 320, 200, 1); + textout_centre_ex(swap_screen, font, "loading...", 320, 200, 1, -1); blit_to_screen(swap_screen); #ifndef __unix__ @@ -788,8 +786,8 @@ clear_to_color(swap_screen, 3); bmp = data[FLD_LOGO].dat; - draw_character(swap_screen, bmp, 80 - bmp->w / 2 + 0, 50 + 1, 1); - draw_character(swap_screen, bmp, 80 - bmp->w / 2, 50, 4); + draw_character_ex(swap_screen, bmp, 80 - bmp->w / 2 + 0, 50 + 1, 1, -1); + draw_character_ex(swap_screen, bmp, 80 - bmp->w / 2, 50, 4, -1); blit_to_screen(swap_screen); @@ -1100,11 +1098,11 @@ // draws text with an outline void textout_outline(BITMAP *bmp, const char *txt, int x, int y) { - textout(bmp, data[THE_FONT].dat, txt, x+1, y, 1); - textout(bmp, data[THE_FONT].dat, txt, x-1, y, 1); - textout(bmp, data[THE_FONT].dat, txt, x, y+1, 1); - textout(bmp, data[THE_FONT].dat, txt, x, y-1, 1); - textout(bmp, data[THE_FONT].dat, txt, x, y, 4); + textout_ex(bmp, data[THE_FONT].dat, txt, x+1, y, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, txt, x-1, y, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, txt, x, y+1, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, txt, x, y-1, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, txt, x, y, 4, -1); } @@ -1451,12 +1449,12 @@ sprintf(buf, "%s %d %s", (level > min ? "<" : " "), level, (level < max ? ">" : " ")); clear_bitmap(stuff); - textout_centre(stuff, data[THE_FONT].dat, buf, stuff->w/2 + 1, 1, 2); - textout_centre(stuff, data[THE_FONT].dat, buf, stuff->w/2, 0, 1); + textout_centre_ex(stuff, data[THE_FONT].dat, buf, stuff->w/2 + 1, 1, 2, -1); + textout_centre_ex(stuff, data[THE_FONT].dat, buf, stuff->w/2, 0, 1, -1); stretch_sprite(bmp, stuff, 80 - 4*stuff->w/2, 30, 4*stuff->w, 4*stuff->h); - textout_centre(bmp, data[THE_FONT].dat, "SELECT START LEVEL", 80, 90, 1); - textout_centre(bmp, data[THE_FONT].dat, "SELECT START LEVEL", 79, 89, 4); + textout_centre_ex(bmp, data[THE_FONT].dat, "SELECT START LEVEL", 80, 90, 1, -1); + textout_centre_ex(bmp, data[THE_FONT].dat, "SELECT START LEVEL", 79, 89, 4, -1); if (options.one_hundred) { if (game_count & 32 || game_count & 16) draw_sprite(bmp, data[SHIP100].dat, xpos, 2); @@ -2532,20 +2530,20 @@ y = 60; x = 50; - textout(bmp, data[THE_FONT].dat, start_string, x+1, y+1, 1); - textout(bmp, data[THE_FONT].dat, start_string, x, y, 4); + textout_ex(bmp, data[THE_FONT].dat, start_string, x+1, y+1, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, start_string, x, y, 4, -1); y += step; - textout(bmp, data[THE_FONT].dat, "HIGH SCORES", x+1, y+1, 1); - textout(bmp, data[THE_FONT].dat, "HIGH SCORES", x, y, 4); + textout_ex(bmp, data[THE_FONT].dat, "HIGH SCORES", x+1, y+1, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, "HIGH SCORES", x, y, 4, -1); y += step; - textout(bmp, data[THE_FONT].dat, "EDITOR", x+1, y+1, 1); - textout(bmp, data[THE_FONT].dat, "EDITOR", x, y, 4); + textout_ex(bmp, data[THE_FONT].dat, "EDITOR", x+1, y+1, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, "EDITOR", x, y, 4, -1); y += step; - textout(bmp, data[THE_FONT].dat, "QUIT", x+1, y+1, 1); - textout(bmp, data[THE_FONT].dat, "QUIT", x, y, 4); + textout_ex(bmp, data[THE_FONT].dat, "QUIT", x+1, y+1, 1, -1); + textout_ex(bmp, data[THE_FONT].dat, "QUIT", x, y, 4, -1); draw_sprite(bmp, data[POINTER].dat, x - 25 + fixtoi(3 * fcos(itofix(tick << 2))), 44 + menu_choice * step); } @@ -2597,7 +2595,7 @@ string[i] = letters[current_letter]; string[i + 1] = '\0'; blit(block, bmp, 0, 0, pos_x - 1, pos_y - 1, block->w, block->h); - textout(bmp, f, string, pos_x, pos_y, colour); + textout_ex(bmp, f, string, pos_x, pos_y, colour, -1); blit_to_screen(bmp); if (pad != NULL) { --- a/src/map.c +++ b/src/map.c @@ -280,7 +280,7 @@ if (sm == NULL) return; - set_clip(bmp, dx, dy, dx+w-1, dy+h-1); + set_clip_rect(bmp, dx, dy, dx+w-1, dy+h-1); for(y=0;y<7;y++) { for(x=0;x<11;x++) { @@ -330,13 +330,13 @@ if (edit) { if (sm->dat[pos].type == MAP_DEAD) { - textout(bmp, font, "D", dx + x*16 + ax, dy + y*16 + ay, 0); + textout_ex(bmp, font, "D", dx + x*16 + ax, dy + y*16 + ay, 0, -1); } if (sm->dat[pos].type == MAP_EXIT) { - textout(bmp, font, "XT", dx + x*16 + ax, dy + y*16 + ay, 255); + textout_ex(bmp, font, "XT", dx + x*16 + ax, dy + y*16 + ay, 255, -1); } if (sm->dat[pos].type == MAP_BRK) { - textout(bmp, font, "GL", dx + x*16 + ax, dy + y*16 + ay, 255); + textout_ex(bmp, font, "GL", dx + x*16 + ax, dy + y*16 + ay, 255, -1); } if (sm->dat[pos].type == MAP_ENEMY1) { draw_sprite(bmp, sm->data[ENEMY1_01 + ((ABS(game_count) >> 3) % 4)].dat, dx + x*16 + ax, dy + y*16 + ay); @@ -367,7 +367,7 @@ } } - set_clip(bmp, 0, 0, SCREEN_W - 1, SCREEN_H - 1); + set_clip_rect(bmp, 0, 0, SCREEN_W - 1, SCREEN_H - 1); } --- a/src/script.c +++ b/src/script.c @@ -89,7 +89,7 @@ // draw text for(i = 0; i < lines; i ++) { - textout(bmp, d[THE_FONT].dat, rows[i], x1 + 4, y1 + 5 + i * 9, 1); + textout_ex(bmp, d[THE_FONT].dat, rows[i], x1 + 4, y1 + 5 + i * 9, 1, -1); } } --- a/src/scroller.c +++ b/src/scroller.c @@ -65,22 +65,22 @@ if (sc->horizontal) { if (sc->offset < -sc->length) return; if (sc->offset > sc->width) return; - set_clip(bmp, x, y, x + sc->width, y + sc->height); - textout(bmp, sc->fnt, sc->text, x + sc->offset + 1, y + 1, 1); - textout(bmp, sc->fnt, sc->text, x + sc->offset, y, 3); - set_clip(bmp, 0, 0, bmp->w-1, bmp->h-1); + set_clip_rect(bmp, x, y, x + sc->width, y + sc->height); + textout_ex(bmp, sc->fnt, sc->text, x + sc->offset + 1, y + 1, 1, -1); + textout_ex(bmp, sc->fnt, sc->text, x + sc->offset, y, 3, -1); + set_clip_rect(bmp, 0, 0, bmp->w-1, bmp->h-1); } else { int i; if (sc->offset < -sc->rows * sc->font_height) return; if (sc->offset > sc->height) return; - set_clip(bmp, x, y, x + sc->width, y + sc->height); + set_clip_rect(bmp, x, y, x + sc->width, y + sc->height); for(i=0;irows;i++) { if (i * sc->font_height + sc->offset <= sc->height) if ((i+1) * sc->font_height + sc->offset >= 0) - textout_centre(bmp, sc->fnt, sc->lines[i], x+(sc->width>>1) , i * sc->font_height + y + sc->offset, -1); + textout_centre_ex(bmp, sc->fnt, sc->lines[i], x+(sc->width>>1) , i * sc->font_height + y + sc->offset, -1, -1); } - set_clip(bmp, 0, 0, bmp->w-1, bmp->h-1); + set_clip_rect(bmp, 0, 0, bmp->w-1, bmp->h-1); } } --- a/src/shooter.c +++ b/src/shooter.c @@ -341,7 +341,7 @@ if (!o->hit || o->type == SO_PLAYER_BULLET) draw_sprite(bmp, s_data[o->image].dat, (int)o->x, (int)o->y); else - draw_character(bmp, s_data[o->image].dat, (int)o->x, (int)o->y, 4); + draw_character_ex(bmp, s_data[o->image].dat, (int)o->x, (int)o->y, 4, -1); } else { int c = (o->energy + 8) >> 3; @@ -379,8 +379,8 @@ padding_str[i] = '0'; padding_str[i] = '\0'; strcat(padding_str, score_str); - textprintf_right(bmp, s_data[SPACE_FONT].dat, x + 160, y + 2, 3, "%s", padding_str); - if (s_var.score) textprintf_right(bmp, s_data[SPACE_FONT].dat, x + 160, y + 2, 4, "%s", score_str); + textprintf_right_ex(bmp, s_data[SPACE_FONT].dat, x + 160, y + 2, 3, -1, "%s", padding_str); + if (s_var.score) textprintf_right_ex(bmp, s_data[SPACE_FONT].dat, x + 160, y + 2, 4, -1, "%s", score_str); } debian/patches/save-some-cpu-cycles.patch0000644000000000000000000001260711536331312015606 0ustar Description: Fix the 100% CPU usage of alex4. Fix the 100% CPU usage of alex4. We can't do this properly (the game is written with a DOS mindset), but we can do two things easily: - Put a rest() in every busy loop. - Limit the frame rate to 50Hz (the speed of the game logic). . For future reference, the counters used by the game: game_count = increments at 50Hz cycle_count = increments at 50Hz, but is reset whenever the game feels like it frame_count = number of frames rendered, reset every second logic_count = number of game loops processed, reset every second Forwarded: no Author: Peter De Wachter Last-Update: 2009-05-07 --- a/src/main.c +++ b/src/main.c @@ -280,7 +280,7 @@ if (keypressed()) kp = 1; if (is_fire(&ctrl) || is_jump(&ctrl)) kp = 1; if (got_sound && dp != NULL) al_poll_duh(dp); - while(!cycle_count); + rest(20); } } @@ -322,7 +322,7 @@ cycle_count = 0; if (got_sound && duh_player != NULL) al_poll_duh(duh_player); i ++; - while(!cycle_count) yield_timeslice(); + while(!cycle_count) rest(1); } } @@ -1127,6 +1127,10 @@ cycle_count = 0; while(mode != 3) { + // Let other processes play + while(cycle_count == 0) + rest(1); + // do logic while(cycle_count > 0) { logic_count ++; @@ -1152,9 +1156,6 @@ cycle_count --; } - // let other processes play - yield_timeslice(); - // draw stuff draw_frame(swap_screen, 1); draw_sprite(swap_screen, go, x, 35); @@ -1174,6 +1175,10 @@ cycle_count = 0; while(mode != 3) { + // let other processes play + while(cycle_count == 0) + rest(1); + // do logic while(cycle_count > 0) { logic_count ++; @@ -1194,9 +1199,6 @@ cycle_count --; } - // let other processes play - yield_timeslice(); - // draw stuff draw_frame(swap_screen, 1); draw_sprite(swap_screen, go, x, 35); @@ -1237,6 +1239,10 @@ cycle_count = 0; while(!done) { + // let other processes play + while(cycle_count == 0) + rest(1); + // do logic while(cycle_count > 0) { logic_count ++; @@ -1256,9 +1262,6 @@ cycle_count --; } - // let other processes play - yield_timeslice(); - // draw stuff draw_custom_ending(swap_screen); blit_to_screen(swap_screen); @@ -1334,6 +1337,10 @@ clear_keybuf(); cycle_count = 0; while(mode != 3) { + // let other processes play + while(cycle_count == 0) + rest(1); + // do logic while(cycle_count > 0) { logic_count ++; @@ -1372,9 +1379,6 @@ cycle_count --; } - // let other processes play - yield_timeslice(); - // draw stuff blit(swap2, swap_screen, 0, 0, 0, 0, 160, 120); draw_status_bar(swap_screen, 110); @@ -1488,6 +1492,10 @@ cycle_count = 0; while(!done) { + // let other processes play + while(cycle_count == 0) + rest(1); + // do logic while(cycle_count > 0) { logic_count ++; @@ -2343,7 +2351,7 @@ if (is_fire(&ctrl) || is_jump(&ctrl)) done = 1; if (keypressed()) done = 1; if (key[KEY_ESC]) done = -1; - yield_timeslice(); + rest(20); } if (done == -1) { @@ -2369,6 +2377,9 @@ game_status = GS_OK; cycle_count = 0; while(game_status == GS_OK) { + // let other processes play + while(cycle_count == 0) + rest(1); // do logic while(cycle_count > 0) { @@ -2492,9 +2503,6 @@ cycle_count --; } - // let other processes play - yield_timeslice(); - // draw frame_count ++; draw_frame(swap_screen, 1); @@ -2658,7 +2666,7 @@ } - while(!cycle_count); + while(!cycle_count) rest(1); } } @@ -2693,6 +2701,9 @@ clear_keybuf(); cycle_count = 0; while(status == GS_OK) { + // let other processes play + while(cycle_count == 0) + rest(1); // do logic while(cycle_count > 0) { @@ -2774,9 +2785,6 @@ cycle_count --; } - // let other processes play - yield_timeslice(); - // draw frame_count ++; draw_title(swap_screen, tick); @@ -3021,7 +3029,8 @@ blit_to_screen(swap_screen); fade_in_pal(100); cycle_count = 0; - while(!key[KEY_ESC] && cycle_count < 200); + while(!key[KEY_ESC] && cycle_count < 200) + rest(50); fade_out_pal(100); clear(screen); } --- a/src/script.c +++ b/src/script.c @@ -102,8 +102,8 @@ cycle_count = 0; poll_music(); count ++; - while(!cycle_count); - yield_timeslice(); + while(!cycle_count) + rest(20); } if (key[KEY_ESC]) script_done = -1; } @@ -498,6 +498,10 @@ cycle_count = 0; while(loops && !script_done) { + // let other processes play + while(cycle_count == 0) + rest(1); + while(cycle_count > 0 && loops && !script_done) { logic_count ++; @@ -520,9 +524,6 @@ cycle_count --; } - // let other processes play - yield_timeslice(); - // blit buffer to swap buffer blit(buffer, swap_buffer, 0, 0, 0, 0, 160, 120); --- a/src/shooter.c +++ b/src/shooter.c @@ -1131,7 +1131,10 @@ game_count = 0; s_activate_sign(0, -1); while(playing || s_sign.alive) { - + // let other processes play + while(cycle_count == 0) + rest(1); + // do logic while(cycle_count > 0) { logic_count ++; @@ -1266,10 +1269,6 @@ cycle_count --; } - - // let other processes play - yield_timeslice(); - // draw frame_count ++; s_draw_frame(s_buffer); debian/patches/unix-port.patch0000644000000000000000000004626311536331312013614 0ustar Description: Support Unix-like operating systems. Based on Hans de Goede's patch for Fedora. Author: Hans de Goede Peter de Wachter , Peter Pentchev Forwarded: yes Last-Update: 2011-03-09 --- a/src/main.c +++ b/src/main.c @@ -38,6 +38,7 @@ #include "main.h" #include "edit.h" #include "shooter.h" +#include "unix.h" #include "../data/data.h" @@ -66,7 +67,6 @@ Tscroller hscroll; Thisc *hisc_table; Thisc *hisc_table_space; -char working_directory[1024]; // the map Tmap *map = NULL; @@ -126,6 +126,7 @@ int playing_original_game = 1; int init_ok = 0; +static FILE* log_fp = NULL; // // // // // // // // // // // // // // // // // // // // // @@ -154,20 +155,18 @@ // loggs the text to the text file void log2file(char *format, ...) { va_list ptr; /* get an arg pointer */ - FILE *fp; - fp = fopen("log.txt", "at"); - if (fp) { + if (log_fp) { /* initialize ptr to point to the first argument after the format string */ va_start(ptr, format); /* Write to logfile. */ - vfprintf(fp, format, ptr); // Write passed text. - fprintf(fp, "\n"); // New line.. + vfprintf(log_fp, format, ptr); // Write passed text. + fprintf(log_fp, "\n"); // New line.. va_end(ptr); - fclose(fp); + fflush(log_fp); } } @@ -618,6 +617,10 @@ BITMAP *bmp; int i; int w, h; +#ifdef __unix__ + char filename[512]; + char *homedir = get_homedir(); +#endif log2file("\nInit routines:"); @@ -625,7 +628,13 @@ log2file(" initializing allegro"); text_mode(-1); garble_string(init_string, 53); +#ifdef __unix__ + snprintf(filename, sizeof(filename), "%s/.alex4/alex4.ini", + homedir? homedir:"."); + override_config_file(filename); +#else set_config_file("alex4.ini"); +#endif set_window_close_button(FALSE); // install timers @@ -695,6 +704,7 @@ textout_centre(swap_screen, font, "loading...", 320, 200, 1); blit_to_screen(swap_screen); +#ifndef __unix__ // set switch modes and callbacks if (set_display_switch_mode(SWITCH_PAUSE) < 0) log2file(" * display switch mode failed"); @@ -702,6 +712,7 @@ log2file(" * display switch in failed"); if (set_display_switch_callback(SWITCH_OUT, display_switch_out) < 0) log2file(" * display switch out failed"); +#endif // set win title (no! really???) @@ -718,7 +729,7 @@ // load data log2file(" loading data"); packfile_password(init_string); - data = load_datafile("data/data.dat"); + data = load_datafile(DATADIR "data.dat"); packfile_password(NULL); if (data == NULL) { log2file(" *** failed"); @@ -728,7 +739,13 @@ // load options log2file(" loading options"); +#ifdef __unix__ + snprintf(filename, sizeof(filename), "%s/.alex4/alex4.sav", + homedir? homedir:"."); + pf = pack_fopen(filename, "rp"); +#else pf = pack_fopen("alex4.sav", "rp"); +#endif if (pf) { load_options(&options, pf); pack_fclose(pf); @@ -740,7 +757,13 @@ // loading highscores log2file(" loading hiscores"); +#ifdef __unix__ + snprintf(filename, sizeof(filename), "%s/.alex4/alex4.hi", + homedir? homedir:"."); + pf = pack_fopen(filename, "rp"); +#else pf = pack_fopen("alex4.hi", "rp"); +#endif if (pf) { load_hisc_table(hisc_table, pf); load_hisc_table(hisc_table_space, pf); @@ -776,7 +799,7 @@ log2file(" loading original maps"); packfile_password(init_string); num_levels = -1; // skip end object when counting - maps = load_datafile_callback("data/maps.dat", count_maps_callback); + maps = load_datafile_callback(DATADIR "maps.dat", count_maps_callback); packfile_password(NULL); if (maps == NULL) { log2file(" *** failed"); @@ -835,11 +858,12 @@ // install sound log2file(" installing sound"); set_volume_per_voice(0); - switch(get_config_int("sound", "sound_device", 0)) { + switch(get_config_int("sound", "sound_device", 1)) { case 1: i = DIGI_AUTODETECT; log2file(" DIGI_AUTODETECT selected (%d)", i); break; +#ifdef ALLEGRO_WINDOWS case 2: i = DIGI_DIRECTX(0); log2file(" DIGI_DIRECTX(0) selected (%d)", i); @@ -848,6 +872,20 @@ i = DIGI_DIRECTAMX(0); log2file(" DIGI_DIRECTAMX(0) selected (%d)", i); break; +#elif defined ALLEGRO_UNIX +#ifdef DIGI_OSS + case 2: + i = DIGI_OSS; + log2file(" DIGI_OSS selected (%d)", i); + break; +#endif +#ifdef DIGI_ALSA + case 3: + i = DIGI_ALSA; + log2file(" DIGI_ALSA selected (%d)", i); + break; +#endif +#endif default: i = -770405; // dummy number got_sound = 0; @@ -870,9 +908,9 @@ if (get_config_int("sound", "use_sound_datafile", 1)) { log2file(" loading sound datafile"); packfile_password(init_string); - sfx_data = load_datafile("data/sfx_44.dat"); + sfx_data = load_datafile(DATADIR "sfx_44.dat"); if (sfx_data == NULL) { - sfx_data = load_datafile("data/sfx_22.dat"); + sfx_data = load_datafile(DATADIR "sfx_22.dat"); log2file(" sfx_44.dat not found"); s = 0; } @@ -971,6 +1009,10 @@ void uninit_game() { int i; PACKFILE *pf; +#ifdef __unix__ + char filename[512]; + char *homedir = get_homedir(); +#endif log2file("\nExit routines:"); @@ -989,14 +1031,26 @@ // only save if everything was inited ok! if (init_ok) { log2file(" saving options"); +#ifdef __unix__ + snprintf(filename, sizeof(filename), "%s/.alex4/alex4.sav", + homedir? homedir:"."); + pf = pack_fopen(filename, "wp"); +#else pf = pack_fopen("alex4.sav", "wp"); +#endif if (pf) { save_options(&options, pf); pack_fclose(pf); } log2file(" saving highscores"); +#ifdef __unix__ + snprintf(filename, sizeof(filename), "%s/.alex4/alex4.hi", + homedir? homedir:"."); + pf = pack_fopen(filename, "wp"); +#else pf = pack_fopen("alex4.hi", "wp"); +#endif if (pf) { save_hisc_table(hisc_table, pf); save_hisc_table(hisc_table_space, pf); @@ -1289,7 +1343,7 @@ // poll music machine if (got_sound) al_poll_duh(dp); - if (mode == 1 && (keypressed() || is_fire(&ctrl) || is_jump(&ctrl) ) || my_counter > 200) { + if (((mode == 1) && (keypressed() || is_fire(&ctrl) || is_jump(&ctrl))) || (my_counter > 200)) { mode = 2; } @@ -1343,7 +1397,7 @@ if (space) { // get space bg packfile_password(init_string); - df = load_datafile_object("data/a45.dat", "BG1"); + df = load_datafile_object(DATADIR "a45.dat", "BG1"); packfile_password(NULL); if (df != NULL) { bg = df->dat; @@ -2149,7 +2203,7 @@ // calculates camera pos for map m considering player p void calculate_camera_pos(Tplayer *p, Tmap *m) { - static camera_type = 1; + static int camera_type = 1; if (p->actor->status == AC_BALL) { camera_type = 2; @@ -2841,6 +2895,10 @@ } else { PACKFILE *pf; +#ifdef __unix__ + char filename[512]; + char *homedir = get_homedir(); +#endif log2file(" level complete"); if (got_sound) stop_music(); if (level < MAX_LEVELS && playing_original_game) { @@ -2875,7 +2933,14 @@ // save options log2file(" saving options"); +#ifdef __unix__ + snprintf(filename, sizeof(filename), + "%s/.alex4/alex4.sav", + homedir? homedir:"."); + pf = pack_fopen(filename, "wp"); +#else pf = pack_fopen("alex4.sav", "wp"); +#endif if (pf) { save_options(&options, pf); pack_fclose(pf); @@ -2969,24 +3034,36 @@ // main int main(int argc, char **argv) { - FILE *fp; int i; char full_path[1024]; +#ifndef __unix__ + char working_directory[1024]; +#else + char *homedir = get_homedir(); +#endif // init allegro allegro_init(); +#ifdef __unix__ + // start logfile + snprintf(full_path, sizeof(full_path), "%s/.alex4", + homedir? homedir:"."); + check_and_create_dir(full_path); + snprintf(full_path, sizeof(full_path), "%s/.alex4/log.txt", + homedir? homedir:"."); + log_fp = fopen(full_path, "wt"); +#else // get working directory get_executable_name(full_path, 1024); replace_filename(working_directory, full_path, "", 1024); chdir(working_directory); - // start logfile - fp = fopen("log.txt", "wt"); - if (fp) { - fprintf(fp, "Alex 4 (%s) - log file\n-------------------\n", GAME_VERSION_STR); - fclose(fp); + log_fp = fopen("log.txt", "wt"); +#endif + if (log_fp) { + fprintf(log_fp, "Alex 4 (%s) - log file\n-------------------\n", GAME_VERSION_STR); } // log program arguments @@ -2994,7 +3071,9 @@ for(i = 0; i < argc; i ++) { log2file(" %s", argv[i]); } +#ifndef __unix__ log2file("Working directory is:\n %s", working_directory); +#endif // test wether to play real game // or custom levels @@ -3022,6 +3101,8 @@ uninit_game(); allegro_exit(); log2file("\nDone...\n"); + if (log_fp) + fclose(log_fp); return 0; } END_OF_MAIN(); --- a/src/player.h +++ b/src/player.h @@ -60,4 +60,4 @@ void wound_player(Tplayer *p); void kill_player(Tplayer *p); -#endif \ No newline at end of file +#endif --- a/src/map.h +++ b/src/map.h @@ -111,4 +111,4 @@ -#endif \ No newline at end of file +#endif --- /dev/null +++ b/src/unix.c @@ -0,0 +1,87 @@ +#ifdef __unix__ +#include +#include +#include +#include +#include +#include +#include +#if defined(__DECC) && defined(VMS) +#include +static char *vms_to_unix_buffer = NULL; +static int convert_vms_to_unix(char *vms_dir_name) +{ + vms_to_unix_buffer = vms_dir_name; +} +#endif + +char *get_homedir(void) +{ + struct passwd *pw; + char *home; + + home = getenv("HOME"); + if (home) + return home; + + if (!(pw = getpwuid(getuid()))) + { + fprintf(stderr, "Who are you? Not found in passwd database!!\n"); + return NULL; + } + +#if defined(__DECC) && defined(VMS) + /* Convert The OpenVMS Formatted "$HOME" Directory Path Into Unix + Format. */ + decc$from_vms(pw->pw_dir, convert_vms_to_unix, 1); + return vms_to_unix_buffer; +#else + return pw->pw_dir; +#endif +} +//----------------------------------------------------------------------------- +int check_and_create_dir(const char *name) +{ + struct stat stat_buffer; + + if (stat(name, &stat_buffer)) + { + /* error check if it doesn't exist or something else is wrong */ + if (errno == ENOENT) + { + /* doesn't exist letts create it ;) */ +#ifdef BSD43 + if (mkdir(name, 0775)) +#else + if (mkdir(name, S_IRWXU|S_IRWXG|S_IROTH|S_IXOTH)) +#endif + { + fprintf(stderr, "Error creating dir %s", name); + perror(" "); + return -1; + } + } + else + { + /* something else went wrong yell about it */ + fprintf(stderr, "Error opening %s", name); + perror(" "); + return -1; + } + } + else + { + /* file exists check it's a dir otherwise yell about it */ +#ifdef BSD43 + if (!(S_IFDIR & stat_buffer.st_mode)) +#else + if (!S_ISDIR(stat_buffer.st_mode)) +#endif + { + fprintf(stderr,"Error %s exists but isn't a dir\n", name); + return -1; + } + } + return 0; +} +#endif --- /dev/null +++ b/src/Makefile @@ -0,0 +1,24 @@ +PREFIX = /usr/local +DATADIR = $(PREFIX)/share/$(TARGET) +CFLAGS ?= -g -Wall -Wno-deprecated-declarations -O2 +LIBS = -laldmb -ldumb `allegro-config --libs` +DEFINES = -DDATADIR=\"$(DATADIR)/\" +OBJS = actor.o edit.o map.o player.o shooter.o unix.o \ + bullet.o hisc.o options.o script.o timer.o \ + control.o main.o particle.o scroller.o token.o +TARGET = alex4 + +$(TARGET): $(OBJS) + $(CC) $(LDFLAGS) -o $@ $^ $(LIBS) + +%.o: %.c + $(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -o $@ -c $< + +install: $(TARGET) + mkdir -p $(PREFIX)/bin + mkdir -p $(DATADIR) + install -p -m 755 $(TARGET) $(PREFIX)/bin + install -p -m 644 ../data/*.dat $(DATADIR) + +clean: + rm -f $(OBJS) $(TARGET) *~ --- a/src/token.h +++ b/src/token.h @@ -41,4 +41,4 @@ Ttoken *tokenize(char *str); -#endif \ No newline at end of file +#endif --- a/src/shooter.c +++ b/src/shooter.c @@ -1372,7 +1372,7 @@ // load data log2file(" loading shooter data"); packfile_password(get_init_string()); - s_data = load_datafile("data/a45.dat"); + s_data = load_datafile(DATADIR "a45.dat"); if (!s_data) { log2file(" *** failed"); return -1; --- a/src/particle.h +++ b/src/particle.h @@ -54,4 +54,4 @@ void update_particle_with_map(Tparticle *p, Tmap *m); void create_burst(Tparticle *ps, int x, int y, int spread, int num, int life, int bmp); -#endif \ No newline at end of file +#endif --- /dev/null +++ b/src/unix.h @@ -0,0 +1,6 @@ +#ifdef __unix__ + +char *get_homedir(); +int check_and_create_dir(const char *name); + +#endif --- a/src/scroller.h +++ b/src/scroller.h @@ -51,4 +51,4 @@ -#endif \ No newline at end of file +#endif --- a/src/map.c +++ b/src/map.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "allegro.h" #include "map.h" #include "timer.h" @@ -64,7 +65,41 @@ return m; } - + +static void mem_to_int(int *dest, unsigned char *mem) +{ +#if __BYTE_ORDER == __LITTLE_ENDIAN + memcpy(dest, mem, 4); +#else + *dest = mem[0] | (((int)mem[1]) << 8) | (((int)mem[2]) << 16) | + (((int)mem[3]) << 24); +#endif +} + +static void fread_int(int *dest, FILE *fp) +{ +#if __BYTE_ORDER == __LITTLE_ENDIAN + fread(dest, 4, 1, fp); +#else + unsigned char buf[4]; + fread(buf, 1, 4, fp); + mem_to_int(dest, buf); +#endif +} + +static void fwrite_int(const int *src, FILE *fp) +{ +#if __BYTE_ORDER == __LITTLE_ENDIAN + fwrite(src, 4, 1, fp); +#else + unsigned char buf[4]; + buf[0] = *src; + buf[1] = *src >> 8; + buf[2] = *src >> 16; + buf[3] = *src >> 24; + fwrite(buf, 1, 4, fp); +#endif +} // loads one splendind map from disk Tmap *load_map(char *fname) { @@ -93,7 +128,19 @@ } // read datastruct - fread(m, sizeof(Tmap), 1, fp); + // a mapfile contain a raw dump of the Tmap struct made on an i386 + // the code below reads these struct dumps in an arch neutral manner + // Note this dumps contains pointers, these are not used because these + // ofcourse point to some no longer valid address. + fread(m, 64, 1, fp); // first 64 bytes data + fread_int(&(m->width), fp); + fread_int(&(m->height), fp); + fread(header, 4, 1, fp); // skip the first pointer + fread_int(&(m->offset_x), fp); + fread_int(&(m->offset_y), fp); + fread(header, 4, 1, fp); // skip the second pointer + fread_int(&(m->start_x), fp); + fread_int(&(m->start_y), fp); // read map data m->dat = malloc(m->width * m->height * sizeof(Tmappos)); @@ -116,8 +163,8 @@ // loads one splendind map from memory Tmap *load_map_from_memory(void *mem) { Tmap *m; - char header[6]; - char *c = (char *)mem; + unsigned char header[6]; + unsigned char *c = (unsigned char *)mem; // does the header match? @@ -137,9 +184,19 @@ } // read datastruct - // fread(m, sizeof(Tmap), 1, fp); - memcpy(m, c, sizeof(Tmap)); - c += sizeof(Tmap); + // a mapfile contain a raw dump of the Tmap struct made on an i386 + // the code below reads these struct dumps in an arch neutral manner + // Note this dumps contains pointers, these are not used because these + // ofcourse point to some no longer valid address. + memcpy(m, c, 64); c += 64; // first 64 bytes data + mem_to_int(&(m->width), c); c += 4; + mem_to_int(&(m->height), c); c += 4; + c += 4; // skip the first pointer + mem_to_int(&(m->offset_x), c); c += 4; + mem_to_int(&(m->offset_y), c); c += 4; + c += 4; // skip the second pointer + mem_to_int(&(m->start_x), c); c+= 4; + mem_to_int(&(m->start_y), c); c+= 4; // read map data m->dat = malloc(m->width * m->height * sizeof(Tmappos)); @@ -174,7 +231,18 @@ fwrite(header, 6, 1, fp); // write datastruct - fwrite(m, sizeof(Tmap), 1, fp); + // a mapfile should contain a raw dump of the Tmap struct as made on an + // i386 the code below writes a struct dump as an i386 in an arch + // neutral manner + fwrite(m, 64, 1, fp); // first 64 bytes data + fwrite_int(&(m->width), fp); + fwrite_int(&(m->height), fp); + fwrite(header, 4, 1, fp); // skip the first pointer + fwrite_int(&(m->offset_x), fp); + fwrite_int(&(m->offset_y), fp); + fwrite(header, 4, 1, fp); // skip the second pointer + fwrite_int(&(m->start_x), fp); + fwrite_int(&(m->start_y), fp); // write map data fwrite(m->dat, sizeof(Tmappos), m->width * m->height, fp); @@ -409,7 +477,7 @@ } if (mask == 5 && oy > 31 - ox) return mask; // 45 degree slope / - if (mask == 6 && oy > ox) return mask; // 45 degree slope \ + if (mask == 6 && oy > ox) return mask; // 45 degree slope \ . // the not so simple ones if (mask == 3 && oy > 31 - ox / 2) return mask; // 22 degree slope / (low) --- a/src/shooter.h +++ b/src/shooter.h @@ -83,8 +83,8 @@ int difficulty; // player related - long unsigned int score; - long unsigned int show_score; + unsigned int score; + unsigned int show_score; int lives; int power_gauge; int power_level; @@ -118,4 +118,4 @@ int start_shooter(Tcontrol *c, int with_sound); -#endif \ No newline at end of file +#endif --- a/src/timer.h +++ b/src/timer.h @@ -37,4 +37,4 @@ void fps_counter(void); void cycle_counter(void); -#endif \ No newline at end of file +#endif --- a/src/main.h +++ b/src/main.h @@ -93,5 +93,8 @@ #define check_bb_collision(x1,y1,w1,h1,x2,y2,w2,h2) (!( ((x1)>=(x2)+(w2)) || ((x2)>=(x1)+(w1)) || \ ((y1)>=(y2)+(h2)) || ((y2)>=(y1)+(h1)) )) +#ifndef DATADIR +#define DATADIR "data/" +#endif -#endif \ No newline at end of file +#endif --- a/src/script.h +++ b/src/script.h @@ -51,4 +51,4 @@ -#endif \ No newline at end of file +#endif --- a/src/edit.h +++ b/src/edit.h @@ -37,4 +37,4 @@ void draw_edit_mode(BITMAP *bmp, Tmap *map, int mx, int my); void update_edit_mode(Tmap *map, BITMAP *bmp, int mx, int my, int mb); -#endif \ No newline at end of file +#endif --- a/src/token.c +++ b/src/token.c @@ -67,7 +67,7 @@ // tokenizes the string str Ttoken *tokenize(char *str) { - Ttoken *tok_list, *tok_tmp; + Ttoken *tok_list, *tok_tmp = NULL; char word[256]; int a, b, c; int i = 0; --- a/src/hisc.h +++ b/src/hisc.h @@ -48,4 +48,4 @@ void draw_hisc_post(Thisc *table, BITMAP *bmp, FONT *fnt, int x, int y, int color, int show_level); void draw_hisc_table(Thisc *table, BITMAP *bmp, FONT *fnt, int x, int y, int color, int show_level); -#endif \ No newline at end of file +#endif --- a/src/options.h +++ b/src/options.h @@ -43,4 +43,4 @@ void load_options(Toptions *o, PACKFILE *fp); void reset_options(Toptions *o); -#endif \ No newline at end of file +#endif --- a/src/timer.c +++ b/src/timer.c @@ -60,4 +60,4 @@ game_count ++; return TRUE; -} \ No newline at end of file +} --- a/src/actor.h +++ b/src/actor.h @@ -91,4 +91,4 @@ void kill_actor(Tactor *a); -#endif \ No newline at end of file +#endif --- a/src/bullet.h +++ b/src/bullet.h @@ -52,4 +52,4 @@ void update_bullet(Tbullet *b); void update_bullet_with_map(Tbullet *b, Tmap *m); -#endif \ No newline at end of file +#endif debian/patches/hardening.patch0000644000000000000000000001131611536331312013575 0ustar Description: Harden the build. - check the fread() and fwrite() return values - swap a return and an fclose() - fix an undefined order of operations problem Forwarded: no Author: Peter Pentchev Last-Update: 2011-03-07 --- a/src/map.c +++ b/src/map.c @@ -76,28 +76,30 @@ #endif } -static void fread_int(int *dest, FILE *fp) +static int fread_int(int *dest, FILE *fp) { #if __BYTE_ORDER == __LITTLE_ENDIAN - fread(dest, 4, 1, fp); + return (fread(dest, 4, 1, fp)); #else unsigned char buf[4]; - fread(buf, 1, 4, fp); + if (fread(buf, 1, 4, fp) < 4) + return (0); mem_to_int(dest, buf); + return (1); #endif } -static void fwrite_int(const int *src, FILE *fp) +static int fwrite_int(const int *src, FILE *fp) { #if __BYTE_ORDER == __LITTLE_ENDIAN - fwrite(src, 4, 1, fp); + return (fwrite(src, 4, 1, fp)); #else unsigned char buf[4]; buf[0] = *src; buf[1] = *src >> 8; buf[2] = *src >> 16; buf[3] = *src >> 24; - fwrite(buf, 1, 4, fp); + return (fwrite(buf, 1, 4, fp) == 4? 1: 0); #endif } @@ -114,10 +116,13 @@ } // does the header match? - fread(header, 6, 1, fp); + if (fread(header, 6, 1, fp) != 1) { + fclose(fp); + return (NULL); + } if (header[0] != 'A' && header[1] != 'X' && header[2] != '4' && header[3] != 'M' && header[4] != 'A' && header[5] != 'P') { - return NULL; fclose(fp); + return NULL; } // get memory @@ -132,24 +137,35 @@ // the code below reads these struct dumps in an arch neutral manner // Note this dumps contains pointers, these are not used because these // ofcourse point to some no longer valid address. - fread(m, 64, 1, fp); // first 64 bytes data - fread_int(&(m->width), fp); - fread_int(&(m->height), fp); - fread(header, 4, 1, fp); // skip the first pointer - fread_int(&(m->offset_x), fp); - fread_int(&(m->offset_y), fp); - fread(header, 4, 1, fp); // skip the second pointer - fread_int(&(m->start_x), fp); - fread_int(&(m->start_y), fp); + if (fread(m, 64, 1, fp) + // first 64 bytes data + fread_int(&(m->width), fp) + + fread_int(&(m->height), fp) + + fread(header, 4, 1, fp) + // skip the first pointer + fread_int(&(m->offset_x), fp) + + fread_int(&(m->offset_y), fp) + + fread(header, 4, 1, fp) + // skip the second pointer + fread_int(&(m->start_x), fp) + + fread_int(&(m->start_y), fp) != 9) { + fclose(fp); + free(m); + return NULL; + } // read map data m->dat = malloc(m->width * m->height * sizeof(Tmappos)); if (m->dat == NULL) { + fclose(fp); free(m); return NULL; } - fread(m->dat, sizeof(Tmappos), m->width * m->height, fp); + if (fread(m->dat, sizeof(Tmappos), m->width * m->height, fp) != + (size_t)m->width * m->height) { + fclose(fp); + free(m->dat); + free(m); + return NULL; + } // close file fclose(fp); @@ -228,24 +244,34 @@ if (fp == NULL) return FALSE; // write header - fwrite(header, 6, 1, fp); + if (fwrite(header, 6, 1, fp) != 1) { + fclose(fp); + return FALSE; + } // write datastruct // a mapfile should contain a raw dump of the Tmap struct as made on an // i386 the code below writes a struct dump as an i386 in an arch // neutral manner - fwrite(m, 64, 1, fp); // first 64 bytes data - fwrite_int(&(m->width), fp); - fwrite_int(&(m->height), fp); - fwrite(header, 4, 1, fp); // skip the first pointer - fwrite_int(&(m->offset_x), fp); - fwrite_int(&(m->offset_y), fp); - fwrite(header, 4, 1, fp); // skip the second pointer - fwrite_int(&(m->start_x), fp); - fwrite_int(&(m->start_y), fp); + if (fwrite(m, 64, 1, fp) + // first 64 bytes data + fwrite_int(&(m->width), fp) + + fwrite_int(&(m->height), fp) + + fwrite(header, 4, 1, fp) + // skip the first pointer + fwrite_int(&(m->offset_x), fp) + + fwrite_int(&(m->offset_y), fp) + + fwrite(header, 4, 1, fp) + // skip the second pointer + fwrite_int(&(m->start_x), fp) + + fwrite_int(&(m->start_y), fp) != 9) { + fclose(fp); + return (FALSE); + } // write map data - fwrite(m->dat, sizeof(Tmappos), m->width * m->height, fp); + if (fwrite(m->dat, sizeof(Tmappos), m->width * m->height, fp) != + (size_t)m->width * m->height) { + fclose(fp); + return (FALSE); + } // close file fclose(fp); --- a/src/shooter.c +++ b/src/shooter.c @@ -903,7 +903,8 @@ s_var.score += 1000000; } else { // increase power - s_var.power_level = MIN(s_var.power_level ++, 7); + if (++s_var.power_level > 7) + s_var.power_level = 7; } play_sound_id(SMPL_HEART); debian/patches/fsf-address.patch0000644000000000000000000000144311536331312014037 0ustar Description: Correct the FSF's address. Forwarded: yes Author: Peter De Wachter Last-Update: 2009-05-07 Index: alex4-1.1/readme.txt =================================================================== --- alex4-1.1.orig/readme.txt 2008-01-22 00:10:21.000000000 +0100 +++ alex4-1.1/readme.txt 2008-01-22 00:10:51.000000000 +0100 @@ -49,8 +49,8 @@ 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 +this program; if not, write to the Free Software Foundation, Inc., 51 Franklin +St, Fifth Floor, Boston, MA 02110-1301, USA. COMPILING debian/patches/compiler-warnings.patch0000644000000000000000000002027311561720307015304 0ustar Description: Fix some compiler warnings. - mark a couple of function parameters as unused - remove a couple of unused function parameters - remove a couple of stray semicolons outside of functions - define _XOPEN_SOURCE for strdup(3) - constify a couple of character pointers - replace some int -> float casts with a multiplication by 1.0 Forwarded: no Author: Peter Pentchev Last-Update: 2011-03-09 --- a/src/main.c +++ b/src/main.c @@ -17,13 +17,14 @@ * http://www.gnu.org for license information. * **************************************************************/ - +#define _XOPEN_SOURCE 700 #include #include #include #include +#include "defs.h" #include "timer.h" #include "map.h" #include "control.h" @@ -42,7 +43,6 @@ #include "../data/data.h" - // some game status defines #define GS_OK 1 #define GS_GAMEOVER 2 @@ -153,7 +153,7 @@ // loggs the text to the text file -void log2file(char *format, ...) { +void log2file(const char *format, ...) { va_list ptr; /* get an arg pointer */ if (log_fp) { @@ -254,7 +254,7 @@ // shows a little message -void msg_box(char *str) { +void msg_box(const char *str) { if (got_sound) al_pause_duh(dp); alert("Alex 4: Message", NULL, str, "OK", NULL, 0, 0); if (got_sound) al_resume_duh(dp); @@ -306,7 +306,7 @@ { sr = dumb_it_start_at_order(duh, n_channels, startorder); dp = al_duh_encapsulate_sigrenderer(sr, - ((float)(get_config_int("sound", "music_volume", 255)) / 255.0), + ((get_config_int("sound", "music_volume", 255) * 1.0) / 255.0), get_config_int("dumb", "buffer_size", 4096), get_config_int("dumb", "sound_freq", 44100)); if (!dp) duh_end_sigrenderer(sr); // howto.txt doesn't mention that this is necessary! dumb.txt does ... @@ -565,7 +565,7 @@ // loads a sample from disk -SAMPLE *load_path_sample(char *fname) { +SAMPLE *load_path_sample(const char *fname) { char buf[1024]; SAMPLE *s; sprintf(buf, "%s/%s", get_config_string("sound", "sfx_path", "sfx"), fname); @@ -581,7 +581,7 @@ // counts number of maps // invoked when loading the map datafile -void count_maps_callback(DATAFILE *d) { +void count_maps_callback(DATAFILE *d __unused) { num_levels ++; } @@ -1579,7 +1579,7 @@ // tidies up after a map has been used -void deinit_map(Tmap *m) { +void deinit_map(void) { int i; // stop any playing sounds @@ -1724,7 +1724,7 @@ // starts a new level // level_id < 0 -> load fname // uses datafile map o/w -void new_level(char *fname, int level_id, int draw) { +void new_level(const char *fname, int level_id, int draw) { int tox; int i; int x, y; @@ -2367,7 +2367,7 @@ // play the game! -int play(int level) { +int play(void) { int i; int playing_go_music = 0; @@ -2819,8 +2819,8 @@ draw_frame(swap_screen, 1); blit_to_screen(swap_screen); fade_in_pal(100); - status = play(-1); - deinit_map(map); + status = play(); + deinit_map(); } else { log2file(" *** failed"); @@ -2877,10 +2877,10 @@ // actual game starts here show_lets_go(); - status = play(level); + status = play(); // done playing level - deinit_map(map); + deinit_map(); // act on different outcomes if (status == GS_GAME_DIED) { @@ -3112,7 +3112,7 @@ fclose(log_fp); return 0; -} END_OF_MAIN(); +} END_OF_MAIN() --- /dev/null +++ b/src/defs.h @@ -0,0 +1,12 @@ +#ifndef _INCLUDED_DEFS_H +#define _INCLUDED_DEFS_H + +#ifndef __unused +#ifdef __GNUC__ +#define __unused __attribute__((unused)) +#else /* __GNUC__ */ +#define __unused +#endif /* __GNUC__ */ +#endif /* __unused */ + +#endif /* _INCLUDED */ --- a/src/particle.c +++ b/src/particle.c @@ -20,8 +20,8 @@ - #include "particle.h" +#include "defs.h" // pointer to datafile DATAFILE *data; @@ -92,7 +92,7 @@ } // updates particle with map -void update_particle_with_map(Tparticle *p, Tmap *m) { +void update_particle_with_map(Tparticle *p, Tmap *m __unused) { update_particle(p); /* bouncing algo removed --- a/src/timer.c +++ b/src/timer.c @@ -30,7 +30,7 @@ lps = logic_count; logic_count = 0; } -END_OF_FUNCTION(fps_counter); +END_OF_FUNCTION(fps_counter) // keeps track of internal game speed @@ -38,7 +38,7 @@ cycle_count++; game_count++; } -END_OF_FUNCTION(game_counter); +END_OF_FUNCTION(game_counter) // initiates the timers --- a/src/token.c +++ b/src/token.c @@ -18,7 +18,7 @@ **************************************************************/ - +#define _XOPEN_SOURCE 700 #include #include @@ -32,7 +32,7 @@ //////////////////////////////////////////////////////////////// // creates a new token -Ttoken *create_token(char *word) { +Ttoken *create_token(const char *word) { Ttoken *tok = malloc(sizeof(Ttoken)); if (tok != NULL) { tok->word = strdup(word); --- a/src/main.h +++ b/src/main.h @@ -63,13 +63,13 @@ // functions char *get_init_string(); void textout_outline_center(BITMAP *bmp, const char *txt, int cx, int y); -void log2file(char *format, ...); +void log2file(const char *format, ...); int do_pause_menu(BITMAP *bg); void take_screenshot(BITMAP *bmp); void set_map(Tmap *m); -void msg_box(char *str); +void msg_box(const char *str); void new_game(int reset_player_data); -void new_level(char *fname, int level_id, int draw); +void new_level(const char *fname, int level_id, int draw); Tactor *get_alex(); void draw_frame(BITMAP *bmp, int draw_status_bar); void blit_to_screen(BITMAP *bmp); --- a/src/shooter.c +++ b/src/shooter.c @@ -321,7 +321,7 @@ s_stop_music(); { - s_music_vol = (float)(get_config_int("sound", "music_volume", 255)) / 255.0; + s_music_vol = (get_config_int("sound", "music_volume", 255) * 1.0) / 255.0; s_sr = dumb_it_start_at_order(s_duh, n_channels, startorder); s_dp = al_duh_encapsulate_sigrenderer(s_sr, s_music_vol, --- a/src/edit.c +++ b/src/edit.c @@ -44,7 +44,7 @@ } // set the path for the current map -void set_edit_path_and_file(char *str) { +void set_edit_path_and_file(const char *str) { strcpy(edit_path_and_file, str); log2file(" edit path set to: <%s>", edit_path_and_file); } --- a/src/edit.h +++ b/src/edit.h @@ -33,7 +33,7 @@ // functions void set_edit_mode(int mode); char *get_edit_path_and_file(); -void set_edit_path_and_file(char *str); +void set_edit_path_and_file(const char *str); void draw_edit_mode(BITMAP *bmp, Tmap *map, int mx, int my); void update_edit_mode(Tmap *map, BITMAP *bmp, int mx, int my, int mb); --- a/src/hisc.c +++ b/src/hisc.c @@ -84,7 +84,7 @@ } // Resets the table to the values specified -void reset_hisc_table(Thisc *table, char *name, int hi, int lo) { +void reset_hisc_table(Thisc *table, const char *name, int hi, int lo) { int i; int d = (hi-lo)/(MAX_SCORES - 1); int acc = lo; --- a/src/hisc.h +++ b/src/hisc.h @@ -41,7 +41,7 @@ int qualify_hisc_table(Thisc *table, Thisc post); void sort_hisc_table(Thisc *table); void enter_hisc_table(Thisc *table, Thisc post); -void reset_hisc_table(Thisc *table, char *name, int hi, int lo); +void reset_hisc_table(Thisc *table, const char *name, int hi, int lo); int load_hisc_table(Thisc *table, PACKFILE *fp); void save_hisc_table(Thisc *table, PACKFILE *fp); --- a/src/map.c +++ b/src/map.c @@ -102,7 +102,7 @@ } // loads one splendind map from disk -Tmap *load_map(char *fname) { +Tmap *load_map(const char *fname) { Tmap *m; FILE *fp; char header[6]; --- a/src/map.h +++ b/src/map.h @@ -93,7 +93,7 @@ // functions Tmap *create_map(int w, int h); void destroy_map(Tmap *m); -Tmap *load_map(char *fname); +Tmap *load_map(const char *fname); Tmap *load_map_from_memory(void *mem); int save_map(Tmap *m, char *fname); void change_map_size(Tmap *m, int dw, int dh, int dir_flags); --- a/src/token.h +++ b/src/token.h @@ -32,7 +32,7 @@ // functions -Ttoken *create_token(char *word); +Ttoken *create_token(const char *word); void destroy_token(Ttoken *t); void flush_tokens(Ttoken *head); void insert_token(Ttoken *list, Ttoken *t); debian/patches/series0000644000000000000000000000022411536331312012026 0ustar unix-port.patch dot-files-endian-clean.patch save-some-cpu-cycles.patch allegro-4.2.patch fsf-address.patch compiler-warnings.patch hardening.patch debian/alex4.install0000644000000000000000000000015612154776033011605 0ustar alex4.ini etc debian/*.desktop /usr/share/applications/ debian/*.xpm /usr/share/pixmaps/ src/alex4 usr/games/ debian/watch0000644000000000000000000000036611141014134010212 0ustar # Upstream doesn't use versioned tarballs and hasn't released alex4 twice: # http://downloads.sourceforge.net/allegator/alex4src_data.zip # # Upstream has been requested to use versioned tarballs: # http://sf.net/support/tracker.php?aid=2551938 debian/alex4-data.install0000644000000000000000000000004212154776033012506 0ustar data/*.dat usr/share/games/alex4/ debian/alex4.manpages0000644000000000000000000000001711536331312011714 0ustar debian/alex4.6 debian/alex4.xpm0000644000000000000000000000251511004517775010743 0ustar /* XPM */ static char *alex4[] = { /* columns rows colors chars-per-pixel */ "32 32 7 1", " c gray3", ". c #181818", "X c #486128", "o c #597934", "O c #A5C67D", "+ c gray100", "@ c None", /* pixels */ "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", "@@@@@@@@@@@@@@@ @@@ @@@@@@@@@@", "@@@@@@@@@@@@@@ ++ @ ++ @@@@@@@@@", "@@@@@@@@@@@@@ + + @@@@ @@", "@@@@@@@@@@@@ Xo ooX ooX @", "@@@@@@@@@@@ Xo ooooooooooooooo @", "@@@@@@@@@@@ ooo @", "@@@@@@@@@@ XoooooooooooooooooX @", "@@@@@@@@@@ oooooO @@", "@@@@@@@@@@ ooooO @@@@@@@@@@@@@@@", "@@@@@@@@@@ ooooO @@@@@@@@@@@@@@@", "@@@@@@@@@@ Xoo oO @@@@@@@@@@@@@@", "@@@@@@@@@@@ Xoo @@@@@@@@@@@@@", "@@@@@@@@@@@ X ooooo @@@@@@@@@@@@", "@@@@@@@@@@@ oX o @@@@@@@@@@@@", "@@@@@@@@@@@ oooOO @@@@@@@@@@@@@", "@@@@@ @@@@@ oooOO @@@@@@@@@@@@@@", "@@@@ X @@@@ oooOO @@@@@@@@@@@@@@", "@@@@ X @@@ Xooo O @@@@@@@@@@@@@@", "@@@@ Xo @@ ooX O @@@@@@@@@@@@@@", "@@@@ OXo X oo O @@@@@@@@@@@@@@@", "@@@@@ OX XoooX @@@@@@@@@@@@@@@", "@@@@@@ O oo XX @ @@@@@@@@@@@", "@@@@@@@ Xoo @ XX XX @@@@@@@@@@", "@@@@@@@@ Xoo XXXXX @@@@@@@@@@@", "@@@@@@@@@ @ @@@@@@@@@@@@", "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", "@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@" }; debian/copyright0000644000000000000000000000141112154776033011126 0ustar Format: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=166 Upstream-Name: alex4 Upstream-Contact: Johan Peitz Source: http://allegator.sourceforge.net/ License: GPL-2+ Files: * Copyright: © 2003 Johan Peitz, Free Lunch Design License: GPL-2+ Files: debian/* Copyright: © 2008, 2009 Peter De Wachter © 2011 Peter Pentchev License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License; either version 2 of the License, or (at your option) any later version. . On Debian systems, the full text of the GNU General Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. debian/alex4.desktop0000644000000000000000000000025411164374071011603 0ustar [Desktop Entry] Type=Application Name=Alex the Allegator 4 Comment=Retro platform game Icon=alex4 Exec=alex4 Terminal=false Categories=Game;ActionGame; StartupNotify=false debian/menu0000644000000000000000000000027612154777520010074 0ustar ?package(alex4):needs="X11" \ section="Games/Action" \ title="Alex the Allegator 4" \ longtitle="Retro platform game" \ command="/usr/games/alex4" \ icon="/usr/share/pixmaps/alex4.xpm" debian/changelog0000644000000000000000000000640612155001411011034 0ustar alex4 (1.1-6) unstable; urgency=low * Team upload. * Add alex4.ini so that sound works (LP: #560664) * Add myself to uploaders * Build against liballegro4-dev instead (Closes: #710598) * Use the same longtitle in the Debian menu as the desktop comment * Use the canonical Vcs-* fields * Bump Standards-Version to 3.9.4, no changes needed -- Paul Wise Sun, 09 Jun 2013 12:22:28 +0800 alex4 (1.1-5) unstable; urgency=low * Team upload. * Include defs.h *after* particle.h, thus not redifining __unused from glibc's bits/stat.h Closes: #624884 * Standards-Version: 3.9.2 -- Evgeni Golov Sat, 07 May 2011 15:34:08 +0200 alex4 (1.1-4) unstable; urgency=low * Update the unix-port patch a bit: - place the libraries at the end of the linker invocation line to fix the build on Ubuntu natty with the binutils-gold linker. I couldn't reproduce the FTBFS on Debian with binutils-gold-2.21.0.20110302-1, but it seems a really sensible change to make anyway :) Closes: #617465 - put the aldumb library before the Allegro libraries that it depends on - honor CPPFLAGS, CFLAGS and LDFLAGS * Convert to the 3.0 (quilt) source format. * Add misc:Depends to the alex4-data package just in case. * Expand the alex4-data package's long description. * Bump the debhelper compatibility level to 8 and minimize the rules file using debhelper override targets. * Bump Standards-Version to 3.9.1 with no changes. * Use dpkg-buildflags to obtain the default values for CPPFLAGS, CFLAGS and LDFLAGS. * Convert the copyright file to the DEP 5 candidate format and add my copyright notice on the debian/* packaging. * Convert all patch file headers to the DEP 3 format. * Build with -Werror if the non-standard "werror" build option is set. * Add the compiler-warnings patch to fix some, well, compiler warnings. * Harden the build unless the "nohardening" build option is set. * Add myself to the list of uploaders. -- Peter Pentchev Wed, 09 Mar 2011 22:18:03 +0200 alex4 (1.1-3) unstable; urgency=low [ Paul Wise ] * Add a watch file explaining the upstream status [ Peter De Wachter ] * Honor the HOME environment variable. (Closes: #507950) * Applied a patch to bring down the game's CPU usage to a more reasonable level. This limits the frame rate to 50Hz (the speed of the game logic). This also fixes a bug that made the level selection screen unresponsive on some systems. * Bump Standards-Version to 3.8.1: - Renamed 'configure' target to 'patch'. * Rename from-fedora.patch to unix-port.patch * Refresh debian/copyright * rules: clean up [ Gonéri Le Bouder ] * Complet Peter changelog part -- Gonéri Le Bouder Sun, 07 Jun 2009 16:43:48 +0200 alex4 (1.1-2) unstable; urgency=low * Build-Depend on liballegro4.2-dev >= 4.2.2-2 - which has a versioned shlibs file (Closes: #467526) - allegro-config no longer tells us to link against unneeded libraries. -- Peter De Wachter Wed, 19 Mar 2008 00:03:46 +0100 alex4 (1.1-1) unstable; urgency=low * Initial release (Closes: #463033) -- Peter De Wachter Sat, 19 Jan 2008 19:26:51 +0100 debian/source/0000755000000000000000000000000012155001650010461 5ustar debian/source/format0000644000000000000000000000001411536331312011672 0ustar 3.0 (quilt) debian/alex4.60000644000000000000000000001064311004517775010305 0ustar .\" Copyright 2008 Peter De Wachter .\" .\" This is free documentation; you can redistribute it and/or .\" modify it under the terms of the GNU General Public License .\" version 2 as published by the Free Software Foundation. .\" .\" The GNU General Public License's references to "object code" .\" and "executables" are to be interpreted as the output of any .\" document formatting or typesetting system, including .\" intermediate and printed output. .\" .\" This manual 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 manual; if not, write to the Free .\" Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, .\" MA 02110-1301, USA. . .\" URL macro recipe from Branden Robinson's presentation .de URL \\$2 \(laURL: \\$1 \(ra\\$3 .. .if \n[.g] .mso www.tmac .\" End of recipe. . .TH alex4 6 "2008-02-07" .\" Please adjust this date whenever revising the manpage. . .SH "NAME" . alex4 \- Alex the Allegator 4, a retro platform game . .SH "SYNOPSIS" . .B alex4 .RI [ "gamefile" ] . .SH "DESCRIPTION" . Guide Alex the Allegator through the jungle in order to save his girlfriend Lola from evil humans who want to make a pair of shoes out of her. .PP Alex the Allegator 4 is a platform game in the style of old Gameboy games. You can play the game with a keyboard or a joystick. On the keyboard the following keys are used: .IP "Arrow keys" 13 Movement .IP "Alt" Jump .IP "Control" Shoot (only when you've found eggs to fire!) . .PP When you're on the menu screen, you can choose the window size with the following keys: .IP "1" 5 160x120 window .IP "2" 320x240 window .IP "3" 640x480 window .IP "4" full-screen . .SH "CUSTOM MAPS" . The Alex the Allegator homepage links to many user-contributed maps. Each set should contain several ".map" files and a text file describing the collection. To play the maps, simply start alex4 with the name of the text file as argument. .PP If you want to create your own maps, you can use the built-in map editor (described below), but you'll need to create the description file yourself. This is a plain text file that needs to list the file names of your maps between "#start#" and "#end#" markers (these markers are not optional). You can include a description of the maps outside these markers. For example, for a collection of three maps: .RS .PP In this game, Alex must rescue the Yellow Tetris Piece from the pirates of Ching Shih. .br #start# .br journey.map .br sea-of-despair.map .br endgame.map .br #end# .RE . .SH "USING THE MAP EDITOR" . Use the map editor to create your own maps. You can enter the map editor from the menu screen or by pressing F1 while playing a custom map. The basic editor commands are: .IP "Shift+L" 20 load an existing map .IP "Shift+S" save the map .IP "Insert+Left/Right" widen the map .IP "Delete+Left/Right" shorten the map .IP "F1" change the map's properties, e.g. its name. .PP Maps are composed of tiles. Tiles can contain scenery, enemies, items and other game objects. The mouse cursor shows the currently selected tile. To draw tiles, use the left mouse button. You can cycle through the available tiles by using the z and x keys, choose a tile from a palette using the p key, or pick a tile from the screen using the right mouse button. .PP Tiles can be given special behavior using the following commands: .IP "q" 10 instant death .IP "w" map exit .IP "e" roll activator .IP "r" breakable block .IP "t" submerged in water .IP "y" on the water surface .IP "a" Alex' start location (facing left) .IP "Shift+A" Alex' start location (facing right) . .PP Use the following command to place items and enemies: .IP "1" 10 extra life .IP "2" star bonus .IP "3" cherry bonus .IP "4" egg .IP "5" extra heart .IP "Shift+Q" grunt .IP "Shift+W" spear grunt .IP "Shift+E" crusher .IP "Shift+R" spike fish .IP "Shift+T" jellyfish .IP "Shift+Y" cannon .IP "Shift+U" spike truck boss .IP "Shift+I" ground pounder boss . .SH "SEE ALSO" . .URL "http://allegator.sourceforge.net/" "The Alex the Allegator series homepage" "" . .SH "AUTHOR" . Alex the Allegator 4 was written by Johan Peitz, Free Lunch Design. .PP This manual page was written by Peter De Wachter , for the Debian project (but may be used by others). debian/control0000644000000000000000000000260012155000307010560 0ustar Source: alex4 Section: games Priority: optional Maintainer: Debian Games Team Uploaders: Peter De Wachter , Paul Wise , Peter Pentchev Build-Depends: debhelper (>= 8), dpkg-dev (>= 1.15.7~), hardening-includes, libaldmb1-dev, liballegro4-dev, libdumb1-dev Standards-Version: 3.9.4 Homepage: http://allegator.sourceforge.net/ Vcs-Svn: svn://anonscm.debian.org/pkg-games/packages/trunk/alex4/ Vcs-Browser: http://anonscm.debian.org/viewsvn/pkg-games/packages/trunk/alex4/ Package: alex4 Architecture: any Depends: alex4-data (= ${source:Version}), ${misc:Depends}, ${shlibs:Depends} Description: Alex the Allegator 4 - a retro platform game Guide Alex the Allegator through the jungle in order to save his girlfriend Lola from evil humans who want to make a pair of shoes out of her. Plenty of classic platforming in four nice colors guaranteed! . The game includes a built-in editor so you can design and share your own maps. Package: alex4-data Architecture: all Depends: ${misc:Depends} Description: Alex the Allegator 4 - game data Guide Alex the Allegator through the jungle in order to save his girlfriend Lola from evil humans who want to make a pair of shoes out of her. Plenty of classic platforming in four nice colors guaranteed! . This package contains the game data files. debian/docs0000644000000000000000000000001311004517775010042 0ustar readme.txt debian/rules0000755000000000000000000000145612154777270010270 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 CFLAGS:= $(shell dpkg-buildflags --get CFLAGS) CPPFLAGS:= $(shell dpkg-buildflags --get CPPFLAGS) LDFLAGS:= $(shell dpkg-buildflags --get LDFLAGS) CFLAGS+= -Wall -W -Wbad-function-cast \ -Wcast-align -Wcast-qual -Wchar-subscripts -Winline \ -Wnested-externs -Wpointer-arith \ -Wredundant-decls -Wwrite-strings ifneq (,$(filter werror,$(DEB_BUILD_OPTIONS))) CFLAGS+= -Werror endif include /usr/share/hardening-includes/hardening.make ifeq (,$(filter nohardening,$(DEB_BUILD_OPTIONS))) CFLAGS+= $(HARDENING_CFLAGS) LDFLAGS+= $(HARDENING_LDFLAGS) endif export CPPFLAGS CFLAGS LDFLAGS override_dh_auto_build: dh_auto_build -D src -- DATADIR=/usr/share/games/alex4 override_dh_auto_clean: dh_auto_clean -D src %: dh $@ debian/compat0000644000000000000000000000000212154777304010376 0ustar 8