X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fevents.c;h=4bf6da2d2ece4046f314267a48ae0d589eadee8a;hb=a1bc27d0855dc6fa72c4c361fc1671b2dcc6547b;hp=652ff31da2097c2690414392f1d62cfc29242e21;hpb=41e8d55b767c898f20c29a1b0b8d2ef8840be2f5;p=rocksndiamonds.git diff --git a/src/events.c b/src/events.c index 652ff31d..4bf6da2d 100644 --- a/src/events.c +++ b/src/events.c @@ -222,38 +222,7 @@ void SleepWhileUnmapped() void HandleExposeEvent(ExposeEvent *event) { #ifndef TARGET_SDL - int x = event->x, y = event->y; - int width = event->width, height = event->height; - - if (setup.direct_draw && game_status==PLAYING) - { - int xx,yy; - int x1 = (x-SX)/TILEX, y1 = (y-SY)/TILEY; - int x2 = (x-SX+width)/TILEX, y2 = (y-SY+height)/TILEY; - - SetDrawtoField(DRAW_BACKBUFFER); - - for(xx=0; xx=x1 && xx<=x2 && yy>=y1 && yy<=y2) - DrawScreenField(xx,yy); - DrawAllPlayers(); - - SetDrawtoField(DRAW_DIRECT); - } - - if (setup.soft_scrolling && game_status == PLAYING) - { - int fx = FX, fy = FY; - - fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0); - fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0); - - BlitBitmap(fieldbuffer, backbuffer, fx,fy, SXSIZE,SYSIZE, SX,SY); - } - - BlitBitmap(drawto, window, x,y, width,height, x,y); - + RedrawPlayfield(FALSE, event->x, event->y, event->width, event->height); FlushDisplay(); #endif } @@ -392,10 +361,6 @@ void HandleButton(int mx, int my, int button) HandleSetupScreen(mx,my, 0,0, button); break; - case SETUPINPUT: - HandleSetupInputScreen(mx,my, 0,0, button); - break; - case PLAYING: #ifdef DEBUG if (button == MB_RELEASED) @@ -511,7 +476,10 @@ void HandleKey(Key key, int key_status) /* allow quick escape to the main menu with the Escape key */ if (key == KSYM_Escape && - game_status != MAINMENU && game_status != LEVELED) + game_status != MAINMENU && + game_status != LEVELED && + game_status != CHOOSELEVEL && + game_status != SETUP) { game_status = MAINMENU; DrawMainMenu(); @@ -540,7 +508,6 @@ void HandleKey(Key key, int key_status) case MAINMENU: case CHOOSELEVEL: case SETUP: - case SETUPINPUT: switch(key) { case KSYM_Return: @@ -551,8 +518,13 @@ void HandleKey(Key key, int key_status) HandleChooseLevel(0,0, 0,0, MB_MENU_CHOICE); else if (game_status == SETUP) HandleSetupScreen(0,0, 0,0, MB_MENU_CHOICE); - else if (game_status == SETUPINPUT) - HandleSetupInputScreen(0,0, 0,0, MB_MENU_CHOICE); + break; + + case KSYM_Escape: + if (game_status == CHOOSELEVEL) + HandleChooseLevel(0,0, 0,0, MB_MENU_LEAVE); + else if (game_status == SETUP) + HandleSetupScreen(0,0, 0,0, MB_MENU_LEAVE); break; case KSYM_Page_Up: @@ -817,7 +789,6 @@ void HandleJoystick() case MAINMENU: case CHOOSELEVEL: case SETUP: - case SETUPINPUT: { static unsigned long joystickmove_delay = 0; @@ -831,9 +802,6 @@ void HandleJoystick() HandleChooseLevel(0,0,dx,dy,newbutton ? MB_MENU_CHOICE : MB_MENU_MARK); else if (game_status==SETUP) HandleSetupScreen(0,0,dx,dy,newbutton ? MB_MENU_CHOICE : MB_MENU_MARK); - else if (game_status==SETUPINPUT) - HandleSetupInputScreen(0,0,dx,dy, - newbutton ? MB_MENU_CHOICE : MB_MENU_MARK); break; }