X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Ftools.c;h=2626f2e4195c99b3aee3e5cd67de8e17502b7da2;hb=78ec772d11cb8823d8dca05c227b472da8708a07;hp=20a129bc77f66c4195cadd85a6ba9563e517b73f;hpb=c1d1d669f782d9af7dfa71159962d5a89c62f03b;p=rocksndiamonds.git diff --git a/src/tools.c b/src/tools.c index 20a129bc..2626f2e4 100644 --- a/src/tools.c +++ b/src/tools.c @@ -460,8 +460,7 @@ void DrawPlayer(struct PlayerInfo *player) int graphic, phase; boolean player_is_moving = (last_jx != jx || last_jy != jy ? TRUE : FALSE); - if (!player->active || player->gone || - !IN_SCR_FIELD(SCREENX(last_jx), SCREENY(last_jy))) + if (!player->active || !IN_SCR_FIELD(SCREENX(last_jx), SCREENY(last_jy))) return; #if DEBUG @@ -524,7 +523,7 @@ void DrawPlayer(struct PlayerInfo *player) /* draw player himself */ - if (game_emulation == EMU_SUPAPLEX) + if (game.emulation == EMU_SUPAPLEX) { static int last_dir = MV_LEFT; int action = (player->programmed_action ? player->programmed_action : @@ -649,7 +648,7 @@ void DrawPlayer(struct PlayerInfo *player) phase = 7 - phase; } - if (game_emulation == EMU_SUPAPLEX) + if (game.emulation == EMU_SUPAPLEX) DrawGraphic(sx, sy, GFX_SP_DISK_RED); else DrawGraphicThruMask(sx, sy, graphic + phase); @@ -1862,12 +1861,7 @@ boolean Request(char *text, unsigned int req_state) DOOR_GFX_PAGEX2, DOOR_GFX_PAGEY1); /* clear door drawing field */ -#if 0 - XFillRectangle(display, pix[PIX_DB_DOOR], gc, - DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE); -#else XFillRectangle(display, drawto, gc, DX, DY, DXSIZE, DYSIZE); -#endif /* write text for request */ for(ty=0; ty<13; ty++) @@ -1892,37 +1886,12 @@ boolean Request(char *text, unsigned int req_state) } sprintf(txt, text); txt[tl] = 0; -#if 0 - DrawTextExt(pix[PIX_DB_DOOR], gc, - DOOR_GFX_PAGEX1 + 51 - (tl * 14)/2, SY + ty * 16, - txt, FS_SMALL, FC_YELLOW); -#else DrawTextExt(drawto, gc, DX + 51 - (tl * 14)/2, DY + 8 + ty * 16, txt, FS_SMALL, FC_YELLOW); -#endif text += tl + (tc == 32 ? 1 : 0); } -#if 0 - if (req_state & REQ_ASK) - { - DrawYesNoButton(BUTTON_OK, DB_INIT); - DrawYesNoButton(BUTTON_NO, DB_INIT); - } - else if (req_state & REQ_CONFIRM) - { - DrawConfirmButton(BUTTON_CONFIRM, DB_INIT); - } - else if (req_state & REQ_PLAYER) - { - DrawPlayerButton(BUTTON_PLAYER_1, DB_INIT); - DrawPlayerButton(BUTTON_PLAYER_2, DB_INIT); - DrawPlayerButton(BUTTON_PLAYER_3, DB_INIT); - DrawPlayerButton(BUTTON_PLAYER_4, DB_INIT); - } -#else - if (req_state & REQ_ASK) { MapGadget(tool_gadget[TOOL_CTRL_ID_YES]); @@ -1945,8 +1914,6 @@ boolean Request(char *text, unsigned int req_state) DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); -#endif - OpenDoor(DOOR_OPEN_1); ClearEventQueue(); @@ -1974,11 +1941,6 @@ boolean Request(char *text, unsigned int req_state) case ButtonRelease: case MotionNotify: { - -#if 0 - int choice; -#endif - if (event.type == MotionNotify) { Window root, child; @@ -2008,46 +1970,6 @@ boolean Request(char *text, unsigned int req_state) button_status = MB_RELEASED; } - - -#if 0 - if (req_state & REQ_ASK) - choice = CheckYesNoButtons(mx,my,button_status); - else if (req_state & REQ_CONFIRM) - choice = CheckConfirmButton(mx,my,button_status); - else - choice = CheckPlayerButtons(mx,my,button_status); - - switch(choice) - { - case BUTTON_OK: - result = TRUE; - break; - case BUTTON_NO: - result = FALSE; - break; - case BUTTON_CONFIRM: - result = TRUE | FALSE; - break; - - case BUTTON_PLAYER_1: - result = 1; - break; - case BUTTON_PLAYER_2: - result = 2; - break; - case BUTTON_PLAYER_3: - result = 3; - break; - case BUTTON_PLAYER_4: - result = 4; - break; - - default: - break; - } -#else - /* this sets 'request_gadget_id' */ HandleGadgets(mx, my, button_status); @@ -2079,7 +2001,6 @@ boolean Request(char *text, unsigned int req_state) default: break; } -#endif break; }