Subversion Repositories Kolibri OS

Rev

Rev 1522 | Rev 1677 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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