2010-07-15 16:37:55 +04:00
|
|
|
;;===Pause_mode================================================================================================================
|
|
|
|
|
|
|
|
Pause_mode:
|
|
|
|
|
2010-10-24 23:11:32 +04:00
|
|
|
mcall 66,1,1 ; set scan codes mode for keyboard
|
2010-08-14 17:58:36 +04:00
|
|
|
call Show_cursor
|
2010-07-15 16:37:55 +04:00
|
|
|
mov [action], 0
|
|
|
|
mov eax, [time_wait_limit]
|
|
|
|
mov [time_to_wait], eax
|
|
|
|
|
2010-07-19 18:59:30 +04:00
|
|
|
.redraw:
|
2010-10-24 23:11:32 +04:00
|
|
|
call Set_geometry
|
2010-07-15 16:37:55 +04:00
|
|
|
mcall 12,1
|
2010-07-19 18:59:30 +04:00
|
|
|
mcall 0, , ,[window_style], ,window_title
|
2011-08-18 21:30:58 +04:00
|
|
|
test [proc_info.wnd_state], 0x04 ; is rolled up?
|
|
|
|
jnz @f
|
2010-07-15 16:37:55 +04:00
|
|
|
|
|
|
|
call Draw_decorations
|
|
|
|
call Draw_pause_picture
|
|
|
|
call Draw_pause_strings
|
|
|
|
mcall 12,2
|
2011-08-18 21:30:58 +04:00
|
|
|
@@:
|
2010-07-19 18:59:30 +04:00
|
|
|
.still:
|
2010-07-15 16:37:55 +04:00
|
|
|
mcall 10 ; wait for event
|
|
|
|
; ok, what an event?
|
|
|
|
dec al ; has the window been moved or resized?
|
2010-07-19 18:59:30 +04:00
|
|
|
jz .redraw
|
2010-07-15 16:37:55 +04:00
|
|
|
dec al ; was a key pressed?
|
2010-07-19 18:59:30 +04:00
|
|
|
jz .key
|
2010-07-15 16:37:55 +04:00
|
|
|
|
|
|
|
|
2010-07-19 18:59:30 +04:00
|
|
|
.button: ; a button was pressed
|
2010-07-15 16:37:55 +04:00
|
|
|
mcall 17 ; get button number
|
|
|
|
shr eax, 8 ; we should do it to get the real button code
|
|
|
|
|
|
|
|
cmp eax, 1
|
2010-08-14 17:58:36 +04:00
|
|
|
je Save_do_smth_else_and_exit
|
2010-07-15 16:37:55 +04:00
|
|
|
|
2010-07-19 18:59:30 +04:00
|
|
|
jmp .still
|
2010-07-15 16:37:55 +04:00
|
|
|
|
|
|
|
|
2010-07-19 18:59:30 +04:00
|
|
|
.key: ; a key was pressed
|
2010-07-15 16:37:55 +04:00
|
|
|
mcall 2 ; get keycode
|
|
|
|
|
2010-10-24 23:11:32 +04:00
|
|
|
cmp ah, 0x01 ; Escape - go to menu
|
2010-07-15 16:37:55 +04:00
|
|
|
je First_menu
|
2010-10-24 23:11:32 +04:00
|
|
|
cmp ah, 0x39 ; Space - resume game
|
2010-07-15 16:37:55 +04:00
|
|
|
je Level_body
|
2010-10-24 23:11:32 +04:00
|
|
|
cmp ah, [shortcut_increase]
|
|
|
|
jne @f
|
|
|
|
call Increase_geometry
|
|
|
|
jmp .redraw
|
|
|
|
@@:
|
|
|
|
cmp ah, [shortcut_decrease]
|
|
|
|
jne @f
|
|
|
|
call Decrease_geometry
|
|
|
|
jmp .redraw
|
|
|
|
@@:
|
2010-07-15 16:37:55 +04:00
|
|
|
|
2010-07-19 18:59:30 +04:00
|
|
|
jmp .still
|
2010-07-15 16:37:55 +04:00
|
|
|
|
|
|
|
;;---Pause_mode----------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
;;===Some_functions============================================================================================================
|
|
|
|
|
|
|
|
Draw_pause_picture:
|
|
|
|
;;===Draw_pause_picture========================================================================================================
|
|
|
|
|
2010-08-14 17:58:36 +04:00
|
|
|
mov ax, 2*0x100+24
|
2010-07-19 18:59:30 +04:00
|
|
|
mov cx, 4*0x100+6
|
2010-07-15 16:37:55 +04:00
|
|
|
mov edx, [pause_picture_color]
|
2010-07-19 18:59:30 +04:00
|
|
|
mov esi, picture_pause
|
2010-07-15 16:37:55 +04:00
|
|
|
call Draw_picture
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
;;---Draw_pause_picture--------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Draw_pause_strings:
|
|
|
|
;;===Draw_pause_strings================================================================================================
|
|
|
|
|
2010-07-19 18:59:30 +04:00
|
|
|
mov ebx, [window_width]
|
|
|
|
shr ebx, 1
|
2010-08-14 17:58:36 +04:00
|
|
|
sub ebx, string_resume_space.size*3+6
|
2010-07-19 18:59:30 +04:00
|
|
|
shl ebx, 16
|
|
|
|
add ebx, dword[bottom_middle_strings]
|
|
|
|
mcall 4, ,[navigation_strings_color],string_resume_space ; Show 'RESUME - SPACE' string
|
2010-07-15 16:37:55 +04:00
|
|
|
|
|
|
|
call Draw_menu_esc ; Show 'MENU - ESC' string
|
|
|
|
|
|
|
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
;;---Draw_pause_strings------------------------------------------------------------------------------------------------
|
|
|
|
|
2011-08-18 21:30:58 +04:00
|
|
|
;;---Some_functions------------------------------------------------------------------------------------------------------------
|