Subversion Repositories Kolibri OS

Rev

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