Subversion Repositories Kolibri OS

Rev

Rev 1677 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. ;;===Pause_mode================================================================================================================
  2.  
  3. Pause_mode:
  4.  
  5.       mcall     66,1,1                          ; set scan codes mode for keyboard
  6.       call      Show_cursor
  7.     mov  [action],  0
  8.     mov  eax, [time_wait_limit]
  9.     mov  [time_to_wait],    eax
  10.  
  11.   .redraw:
  12.       call      Set_geometry
  13.       mcall     12,1
  14.       mcall     0, , ,[window_style], ,window_title
  15.     test [proc_info.wnd_state], 0x04            ; is rolled up?
  16.      jnz @f
  17.  
  18.       call      Draw_decorations
  19.       call      Draw_pause_picture
  20.       call      Draw_pause_strings
  21.       mcall     12,2
  22.   @@:
  23.   .still:
  24.       mcall     10                              ; wait for event
  25.                                                 ; ok, what an event?
  26.     dec  al                                     ; has the window been moved or resized?
  27.      jz  .redraw
  28.     dec  al                                     ; was a key pressed?
  29.      jz  .key
  30.  
  31.  
  32.   .button:                                      ; a button was pressed
  33.       mcall     17                              ; get button number
  34.     shr  eax, 8                                 ; we should do it to get the real button code
  35.  
  36.     cmp  eax, 1
  37.      je  Save_do_smth_else_and_exit
  38.  
  39.      jmp .still
  40.  
  41.  
  42.   .key:                                         ; a key was pressed
  43.       mcall     2                               ; get keycode
  44.    
  45.     cmp  ah,  0x01                              ; Escape - go to menu
  46.      je  First_menu
  47.     cmp  ah,  0x39                              ; Space - resume game
  48.      je  Level_body
  49.     cmp  ah, [shortcut_increase]
  50.      jne @f
  51.       call      Increase_geometry
  52.      jmp .redraw
  53.   @@:
  54.     cmp  ah, [shortcut_decrease]
  55.      jne @f
  56.       call      Decrease_geometry
  57.      jmp .redraw
  58.   @@:
  59.    
  60.      jmp .still
  61.  
  62. ;;---Pause_mode----------------------------------------------------------------------------------------------------------------
  63.  
  64.  
  65. ;;===Some_functions============================================================================================================
  66.  
  67. Draw_pause_picture:
  68.     ;;===Draw_pause_picture========================================================================================================
  69.  
  70.     mov  ax,  2*0x100+24
  71.     mov  cx,  4*0x100+6
  72.     mov  edx, [pause_picture_color]
  73.     mov  esi, picture_pause
  74.       call      Draw_picture
  75.  
  76.     ret
  77.            
  78.     ;;---Draw_pause_picture--------------------------------------------------------------------------------------------------------
  79.                
  80.            
  81. Draw_pause_strings:
  82.     ;;===Draw_pause_strings================================================================================================
  83.  
  84.     mov  ebx, [window_width]
  85.     shr  ebx, 1
  86.     sub  ebx, string_resume_space.size*3+6
  87.     shl  ebx, 16
  88.     add  ebx, dword[bottom_middle_strings]
  89.       mcall     4, ,[navigation_strings_color],string_resume_space ; Show 'RESUME - SPACE' string
  90.      
  91.     call    Draw_menu_esc                       ; Show 'MENU - ESC' string
  92.  
  93.  
  94.     ret
  95.  
  96.     ;;---Draw_pause_strings------------------------------------------------------------------------------------------------
  97.        
  98. ;;---Some_functions------------------------------------------------------------------------------------------------------------
  99.