snake: correct rolled_up window state handling

git-svn-id: svn://kolibrios.org@2061 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Ivan Baravy 2011-08-18 17:30:58 +00:00
parent e4ca2a0ae9
commit 41ce17015f
5 changed files with 34 additions and 16 deletions

View File

@ -19,14 +19,15 @@ First_menu:
call Set_geometry call Set_geometry
mcall 12,1 mcall 12,1
mcall 0, , ,[window_style], ,window_title mcall 0, , ,[window_style], ,window_title
test [proc_info.wnd_state], 0x04 ; is rolled up?
jnz @f
call Draw_decorations call Draw_decorations
call Draw_first_menu_picture call Draw_first_menu_picture
call Draw_menu_strings call Draw_menu_strings
call Draw_buttons call Draw_buttons
@@:
mcall 12,2 mcall 12,2
.still: .still:
mcall 10 ; wait for event mcall 10 ; wait for event
; ok, what an event? ; ok, what an event?

View File

@ -36,13 +36,14 @@ Game_over:
call Set_geometry call Set_geometry
mcall 12,1 mcall 12,1
mcall 0, , ,[window_style], ,window_title mcall 0, , ,[window_style], ,window_title
test [proc_info.wnd_state], 0x04 ; is rolled up?
jnz @f
call Draw_decorations call Draw_decorations
call Draw_game_over_picture call Draw_game_over_picture
call Draw_game_over_strings ; edit_box is here call Draw_game_over_strings ; edit_box is here
mcall 12,2 mcall 12,2
@@:
.still: .still:
mcall 10 ; wait for event mcall 10 ; wait for event
; ok, what an event? ; ok, what an event?

View File

@ -19,13 +19,14 @@ mcall 26, 9
call Set_geometry call Set_geometry
mcall 12,1 mcall 12,1
mcall 0, , ,[window_style], ,window_title mcall 0, , ,[window_style], ,window_title
test [proc_info.wnd_state], 0x04 ; is rolled up?
jnz Pause_mode
call Draw_decorations call Draw_decorations
call Draw_stones call Draw_stones
call Draw_snake call Draw_snake
call Draw_eat call Draw_eat
call Draw_level_strings call Draw_level_strings
mcall 12,2 mcall 12,2
.still: .still:

View File

@ -12,14 +12,14 @@ Pause_mode:
call Set_geometry call Set_geometry
mcall 12,1 mcall 12,1
mcall 0, , ,[window_style], ,window_title mcall 0, , ,[window_style], ,window_title
test [proc_info.wnd_state], 0x04 ; is rolled up?
jnz @f
call Draw_decorations call Draw_decorations
call Draw_pause_picture call Draw_pause_picture
call Draw_pause_strings call Draw_pause_strings
mcall 12,2 mcall 12,2
@@:
.still: .still:
mcall 10 ; wait for event mcall 10 ; wait for event
; ok, what an event? ; ok, what an event?

View File

@ -12,7 +12,7 @@ include '../../../macros.inc'
include '../../../system/launch/trunk/mem.inc' include '../../../system/launch/trunk/mem.inc'
include '../../../develop/libraries/libs-dev/.test/dll.inc' include '../../../develop/libraries/libs-dev/.test/dll.inc'
include '../../../develop/libraries/box_lib/trunk/box_lib.mac' include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../../system/board/trunk/debug.inc' ;include '../../../system/board/trunk/debug.inc'
;;===Define_chapter============================================================================================================ ;;===Define_chapter============================================================================================================
@ -188,7 +188,7 @@ align 4
mov eax, WINDOW_MODE_WINDOWED mov eax, WINDOW_MODE_WINDOWED
call Set_window_mode call Set_window_mode
mcall 0,0,0,0x51000000 ; create empty window. Set_geometry will set all parameters mcall 0,0,0,[window_style_windowed] ; create empty window. Set_geometry will set all parameters
call Set_geometry.by_hotkey call Set_geometry.by_hotkey
mcall 71,1,window_title mcall 71,1,window_title
@ -249,6 +249,14 @@ Set_geometry:
jnz .by_hotkey jnz .by_hotkey
mcall 9,proc_info,-1 mcall 9,proc_info,-1
test [proc_info.wnd_state], 0x04 ; is rolled up?
jz @f
mov eax, [proc_info.box.width]
mov [window_width], eax
mov eax, [proc_info.box.height]
mov [window_height], eax
jmp .quit
@@:
mov eax, [proc_info.box.width] mov eax, [proc_info.box.width]
cmp eax, [window_width] cmp eax, [window_width]
jne @f jne @f
@ -328,7 +336,14 @@ Set_geometry:
.by_hotkey: .by_hotkey:
mcall 9,proc_info,-1 mcall 9,proc_info,-1
mov [resized_by_hotkey], 0 mov [resized_by_hotkey], 0
test [proc_info.wnd_state], 0x04 ; is rolled up?
jz @f
mov eax, [proc_info.box.width]
mov [window_width], eax
mov eax, [proc_info.box.height]
mov [window_height], eax
jmp .quit
@@:
mov eax, [square_side_length] mov eax, [square_side_length]
inc eax ; space between squares inc eax ; space between squares
mov [g_s], eax mov [g_s], eax