forked from KolibriOS/kolibrios
life3: update UI, add to ISO
git-svn-id: svn://kolibrios.org@7525 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
4080229253
commit
0b4fb297f0
@ -179,6 +179,7 @@ extra_files = {
|
|||||||
{"kolibrios/emul/", "common/emul/zsnes"},
|
{"kolibrios/emul/", "common/emul/zsnes"},
|
||||||
{"kolibrios/demos/ak47.lif", "common/demos/ak47.lif"},
|
{"kolibrios/demos/ak47.lif", "common/demos/ak47.lif"},
|
||||||
{"kolibrios/demos/life2", "common/demos/life2"},
|
{"kolibrios/demos/life2", "common/demos/life2"},
|
||||||
|
{"kolibrios/demos/life3tb.png", PROGS .. "/games/life3/trunk/life3tb.png"},
|
||||||
{"kolibrios/demos/relay.lif", "common/demos/relay.lif"},
|
{"kolibrios/demos/relay.lif", "common/demos/relay.lif"},
|
||||||
{"kolibrios/demos/rpento.lif", "common/demos/rpento.lif"},
|
{"kolibrios/demos/rpento.lif", "common/demos/rpento.lif"},
|
||||||
{"kolibrios/games/BabyPainter", "common/games/BabyPainter"},
|
{"kolibrios/games/BabyPainter", "common/games/BabyPainter"},
|
||||||
@ -512,6 +513,7 @@ tup.append_table(extra_files, {
|
|||||||
{"kolibrios/3D/voxel_utilites/VOX_TGL" , PROGS .. "/media/voxel_editor/utilites/vox_tgl"},
|
{"kolibrios/3D/voxel_utilites/VOX_TGL" , PROGS .. "/media/voxel_editor/utilites/vox_tgl"},
|
||||||
{"kolibrios/3D/textures1", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/textures1"},
|
{"kolibrios/3D/textures1", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/textures1"},
|
||||||
{"kolibrios/demos/buddhabrot", PROGS .. "/demos/buddhabrot/trunk/buddhabrot"},
|
{"kolibrios/demos/buddhabrot", PROGS .. "/demos/buddhabrot/trunk/buddhabrot"},
|
||||||
|
{"kolibrios/demos/life3", PROGS .. "/games/life3/trunk/life3"},
|
||||||
{"kolibrios/demos/qjulia", PROGS .. "/demos/qjulia/trunk/qjulia"},
|
{"kolibrios/demos/qjulia", PROGS .. "/demos/qjulia/trunk/qjulia"},
|
||||||
{"kolibrios/develop/utils/GenFiles", PROGS .. "/testing/genfiles/GenFiles"},
|
{"kolibrios/develop/utils/GenFiles", PROGS .. "/testing/genfiles/GenFiles"},
|
||||||
{"kolibrios/games/Almaz", PROGS .. "/games/almaz/almaz"},
|
{"kolibrios/games/Almaz", PROGS .. "/games/almaz/almaz"},
|
||||||
|
@ -78,10 +78,11 @@ void Downloader()
|
|||||||
|
|
||||||
default:
|
default:
|
||||||
if (!downloader.MonitorProgress()) break;
|
if (!downloader.MonitorProgress()) break;
|
||||||
pb.max = downloader.httpd.content_length;
|
pb.max = downloader.httpd.content_length / 100;
|
||||||
if (pb.value != downloader.httpd.content_received)
|
EDI = downloader.httpd.content_received/100;
|
||||||
|
if (pb.value != EDI)
|
||||||
{
|
{
|
||||||
pb.value = downloader.httpd.content_received;
|
pb.value = EDI;
|
||||||
progressbar_draw stdcall(#pb);
|
progressbar_draw stdcall(#pb);
|
||||||
DrawDownloading();
|
DrawDownloading();
|
||||||
}
|
}
|
||||||
@ -154,6 +155,7 @@ void StartDownloading()
|
|||||||
DL_Draw_Window();
|
DL_Draw_Window();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
struct TIME
|
struct TIME
|
||||||
{
|
{
|
||||||
dword old;
|
dword old;
|
||||||
@ -180,6 +182,7 @@ void CalculateSpeed()
|
|||||||
}
|
}
|
||||||
else time.old = time.cur;
|
else time.old = time.cur;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void DrawDownloading()
|
void DrawDownloading()
|
||||||
{
|
{
|
||||||
|
@ -3,13 +3,15 @@ enum {
|
|||||||
DRAW_BUF
|
DRAW_BUF
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define DRAW_PADDING 12
|
||||||
|
|
||||||
void Parcer(byte mode)
|
void Parcer(byte mode)
|
||||||
{
|
{
|
||||||
dword bufoff, buflen;
|
dword bufoff, buflen;
|
||||||
byte ch;
|
byte ch;
|
||||||
char line[4096]=0;
|
char line[4096]=0;
|
||||||
int srch_pos;
|
int srch_pos;
|
||||||
dword stroka_y=5;
|
dword stroka_y=DRAW_PADDING-3;
|
||||||
dword line_length=30;
|
dword line_length=30;
|
||||||
dword line_start=io.buffer_data;
|
dword line_start=io.buffer_data;
|
||||||
|
|
||||||
@ -34,7 +36,7 @@ dword line_start=io.buffer_data;
|
|||||||
if (mode==DRAW_BUF) {
|
if (mode==DRAW_BUF) {
|
||||||
EBX = bufoff-line_start;
|
EBX = bufoff-line_start;
|
||||||
strlcpy(#line, line_start, EBX);
|
strlcpy(#line, line_start, EBX);
|
||||||
kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, #line);
|
kfont.WriteIntoBuffer(DRAW_PADDING,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, #line);
|
||||||
stroka_y += list.item_h;
|
stroka_y += list.item_h;
|
||||||
line_start = bufoff;
|
line_start = bufoff;
|
||||||
line_length = 30;
|
line_length = 30;
|
||||||
@ -42,7 +44,7 @@ dword line_start=io.buffer_data;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mode==COUNT_BUF_HEIGHT) list.count+=2;
|
if (mode==COUNT_BUF_HEIGHT) list.count+=2;
|
||||||
if (mode==DRAW_BUF) kfont.WriteIntoBuffer(8,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, line_start);
|
if (mode==DRAW_BUF) kfont.WriteIntoBuffer(DRAW_PADDING,stroka_y,list.w,kfont.size.height, bg_color, text_color, kfont.size.pt, line_start);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PreparePage()
|
void PreparePage()
|
||||||
@ -52,7 +54,7 @@ void PreparePage()
|
|||||||
Parcer(COUNT_BUF_HEIGHT);
|
Parcer(COUNT_BUF_HEIGHT);
|
||||||
|
|
||||||
//draw text in buffer
|
//draw text in buffer
|
||||||
list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, kfont.size.pt+4);
|
list.SetSizes(0, TOOLBAR_H, list.w, Form.cheight-TOOLBAR_H, kfont.size.pt+6);
|
||||||
if (list.count < list.visible) list.count = list.visible;
|
if (list.count < list.visible) list.count = list.visible;
|
||||||
kfont.size.height = list.count+1*list.item_h;
|
kfont.size.height = list.count+1*list.item_h;
|
||||||
kfont.raw_size = 0;
|
kfont.raw_size = 0;
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
if tup.getconfig("NO_FASM") ~= "" then return end
|
if tup.getconfig("NO_FASM") ~= "" then return end
|
||||||
|
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en" or tup.getconfig("LANG")) .. " > lang.inc", {"lang.inc"})
|
||||||
tup.rule("life3.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "life3")
|
tup.rule("life3.asm", "fasm %f %o " .. tup.getconfig("KPACK_CMD"), "life3")
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
if not exist bin mkdir bin
|
@echo lang fix en >lang.inc
|
||||||
@fasm.exe -m 16384 life3.asm bin\life3.kex
|
@fasm.exe -m 16384 life3.asm life3.kex
|
||||||
@kpack bin\life3.kex
|
@kpack life3.kex
|
||||||
pause
|
pause
|
||||||
|
@ -9,13 +9,18 @@ include '../../../KOSfuncs.inc'
|
|||||||
include '../../../load_img.inc'
|
include '../../../load_img.inc'
|
||||||
include '../../../develop/libraries/box_lib/load_lib.mac'
|
include '../../../develop/libraries/box_lib/load_lib.mac'
|
||||||
|
|
||||||
|
include 'lang.inc'
|
||||||
|
|
||||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||||
hed db 'Life 03.11.18',0 ;¯®¤¯¨áì ®ª
|
hed db 'Life 04.11.18',0 ;¯®¤¯¨áì ®ª
|
||||||
|
|
||||||
run_file_70 FileInfoBlock
|
run_file_70 FileInfoBlock
|
||||||
image_data dd 0 ;㪠§ â¥«ì ¢à¥¬¥ãî ¯ ¬ïâì. ¤«ï 㦥 ¯à¥®¡à §®¢ ¨ï ¨§®¡à ¦¥¨ï
|
image_data dd 0 ;㪠§ â¥«ì ¢à¥¬¥ãî ¯ ¬ïâì. ¤«ï 㦥 ¯à¥®¡à §®¢ ¨ï ¨§®¡à ¦¥¨ï
|
||||||
|
|
||||||
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
|
ICONSIZE = 21
|
||||||
|
TBTNSIZE = ICONSIZE-2
|
||||||
|
|
||||||
|
IMAGE_TOOLBAR_ICON_SIZE equ ICONSIZE*ICONSIZE*3
|
||||||
image_data_toolbar dd 0
|
image_data_toolbar dd 0
|
||||||
|
|
||||||
|
|
||||||
@ -51,9 +56,16 @@ tim dd 0 ;
|
|||||||
b_sort dd 0 ;£à ¨æ ¤«ï á®àâ¨à®¢ ëå ï祥ª
|
b_sort dd 0 ;£à ¨æ ¤«ï á®àâ¨à®¢ ëå ï祥ª
|
||||||
osob dd 0 ;ç¨á«® ®á®¡¥©
|
osob dd 0 ;ç¨á«® ®á®¡¥©
|
||||||
zoom db 3 ;¬ áèâ ¡ ¯®«ï
|
zoom db 3 ;¬ áèâ ¡ ¯®«ï
|
||||||
txt_zoom db 'Œ áèâ ¡:',0
|
|
||||||
txt_gen db '<27>®ª®«¥¨¥:',0
|
if lang eq ru
|
||||||
txt_osob db 'Žá®¡¥©:',0
|
txt_zoom db ' Œ áèâ ¡:',0
|
||||||
|
txt_gen db ' <20>®ª®«¥¨¥:',0
|
||||||
|
txt_osob db ' Žá®¡¥©:',0
|
||||||
|
else
|
||||||
|
txt_zoom db ' Zoom:',0
|
||||||
|
txt_gen db 'Generation:',0
|
||||||
|
txt_osob db 'Population:',0
|
||||||
|
end if
|
||||||
|
|
||||||
; áâனª ¬ áᨢ á 梥⠬¨
|
; áâனª ¬ áᨢ á 梥⠬¨
|
||||||
; col_pole - 梥⠯®«ï
|
; col_pole - 梥⠯®«ï
|
||||||
@ -815,7 +827,7 @@ start:
|
|||||||
mov [memCell],eax
|
mov [memCell],eax
|
||||||
stdcall mem.Alloc,(COL_MEM+1)*4
|
stdcall mem.Alloc,(COL_MEM+1)*4
|
||||||
mov [CellColors],eax
|
mov [CellColors],eax
|
||||||
include_image_file 'toolbar.png', image_data_toolbar
|
include_image_file 'life3tb.png', image_data_toolbar
|
||||||
|
|
||||||
; áâனª 梥⮢ ï祥ª
|
; áâனª 梥⮢ ï祥ª
|
||||||
stdcall pole_init_colors, 0xffffd0,0xff0000,0x0000ff
|
stdcall pole_init_colors, 0xffffd0,0xff0000,0x0000ff
|
||||||
@ -966,10 +978,7 @@ align 4
|
|||||||
draw_window:
|
draw_window:
|
||||||
pushad
|
pushad
|
||||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||||
mov edx,[sc.work]
|
mcall SF_CREATE_WINDOW,(50 shl 16)+485,(50 shl 16)+415,0x73000000,0,hed
|
||||||
or edx,0x33000000
|
|
||||||
mov edi,hed
|
|
||||||
mcall SF_CREATE_WINDOW,(20 shl 16)+485,(20 shl 16)+415
|
|
||||||
|
|
||||||
mcall SF_THREAD_INFO,procinfo,-1
|
mcall SF_THREAD_INFO,procinfo,-1
|
||||||
mov eax,[procinfo.box.height]
|
mov eax,[procinfo.box.height]
|
||||||
@ -995,97 +1004,90 @@ pushad
|
|||||||
call pole_paint
|
call pole_paint
|
||||||
.end0:
|
.end0:
|
||||||
|
|
||||||
mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3, [sc.work_button]
|
mov edx,[sc.work]
|
||||||
|
mov ebx, 0 shl 16
|
||||||
|
add ebx, [buf_0.w]
|
||||||
|
mcall SF_DRAW_RECT,,<0,35>
|
||||||
|
|
||||||
mov ebx,(30 shl 16)+20
|
mcall SF_DEFINE_BUTTON,(6 shl 16)+TBTNSIZE,(6 shl 16)+TBTNSIZE,4+0x40000000, [sc.work_button]
|
||||||
mov edx,4
|
|
||||||
|
mov ebx,(36 shl 16)+TBTNSIZE
|
||||||
|
mov edx,6+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(55 shl 16)+20
|
mov ebx,(61 shl 16)+TBTNSIZE
|
||||||
mov edx,5
|
mov edx,7+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(85 shl 16)+20
|
mov ebx,(86 shl 16)+TBTNSIZE
|
||||||
mov edx,6
|
mov edx,8+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(110 shl 16)+20
|
mov ebx,(116 shl 16)+TBTNSIZE
|
||||||
mov edx,7
|
mov edx,9+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(135 shl 16)+20
|
mov ebx,(141 shl 16)+TBTNSIZE
|
||||||
mov edx,8
|
mov edx,10+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(165 shl 16)+20
|
mov ebx,(171 shl 16)+TBTNSIZE
|
||||||
mov edx,9
|
mov edx,11+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(190 shl 16)+20
|
mov ebx,(196 shl 16)+TBTNSIZE
|
||||||
mov edx,10
|
mov edx,12+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(220 shl 16)+20
|
mov ebx,(221 shl 16)+TBTNSIZE
|
||||||
mov edx,11
|
mov edx,13+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(245 shl 16)+20
|
mov ebx,(246 shl 16)+TBTNSIZE
|
||||||
mov edx,12
|
mov edx,14+0x40000000
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
mov ebx,(270 shl 16)+20
|
mcall SF_PUT_IMAGE,[image_data_toolbar],(ICONSIZE shl 16)+ICONSIZE,(5 shl 16)+5
|
||||||
mov edx,13
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mov ebx,(295 shl 16)+20
|
|
||||||
mov edx,14
|
|
||||||
int 0x40
|
|
||||||
|
|
||||||
mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16,(32 shl 16)+7
|
|
||||||
|
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
mov edx,(87 shl 16)+7 ;run once
|
mov edx,(35 shl 16)+5 ;run once
|
||||||
|
int 0x40
|
||||||
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
|
mov edx,(60 shl 16)+5 ;run auto
|
||||||
|
int 0x40
|
||||||
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
|
mov edx,(85 shl 16)+5 ;stop
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
mov edx,(112 shl 16)+7 ;run auto
|
mov edx,(115 shl 16)+5 ;-
|
||||||
int 0x40
|
int 0x40
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
mov edx,(137 shl 16)+7 ;stop
|
mov edx,(140 shl 16)+5 ;+
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
mov edx,(167 shl 16)+7 ;-
|
mov edx,(170 shl 16)+5 ;move up
|
||||||
int 0x40
|
int 0x40
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
mov edx,(192 shl 16)+7 ;+
|
mov edx,(195 shl 16)+5 ;move doun
|
||||||
int 0x40
|
|
||||||
|
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
|
||||||
mov edx,(222 shl 16)+7 ;move up
|
|
||||||
int 0x40
|
int 0x40
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
mov edx,(247 shl 16)+7 ;move doun
|
mov edx,(220 shl 16)+5 ;move left
|
||||||
int 0x40
|
int 0x40
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
mov edx,(272 shl 16)+7 ;move left
|
mov edx,(245 shl 16)+5 ;move right
|
||||||
int 0x40
|
|
||||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
|
||||||
mov edx,(297 shl 16)+7 ;move up
|
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
call draw_pok
|
; add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
|
; mov edx,(270 shl 16)+5
|
||||||
|
; int 0x40
|
||||||
|
; add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||||
|
; mov edx,(295 shl 16)+5
|
||||||
|
; int 0x40
|
||||||
|
|
||||||
stdcall [buf2d_draw], buf_0
|
|
||||||
|
|
||||||
mcall SF_REDRAW,SSF_END_DRAW
|
|
||||||
popad
|
|
||||||
ret
|
|
||||||
|
|
||||||
align 4
|
|
||||||
draw_pok:
|
|
||||||
mov eax,SF_DRAW_TEXT
|
mov eax,SF_DRAW_TEXT
|
||||||
mov ebx,325*65536+5
|
mov ebx,295*65536+5
|
||||||
mov ecx,[sc.work_text]
|
mov ecx,[sc.work_text]
|
||||||
or ecx,0x80000000 ;or (1 shl 30)
|
or ecx,0x80000000 ;or (1 shl 30)
|
||||||
mov edx,txt_zoom
|
mov edx,txt_zoom
|
||||||
@ -1098,21 +1100,31 @@ draw_pok:
|
|||||||
mov edx,txt_osob
|
mov edx,txt_osob
|
||||||
int 0x40
|
int 0x40
|
||||||
|
|
||||||
|
call draw_pok
|
||||||
|
|
||||||
|
stdcall [buf2d_draw], buf_0
|
||||||
|
|
||||||
|
mcall SF_REDRAW,SSF_END_DRAW
|
||||||
|
popad
|
||||||
|
ret
|
||||||
|
|
||||||
|
align 4
|
||||||
|
draw_pok:
|
||||||
mov eax,SF_DRAW_NUMBER
|
mov eax,SF_DRAW_NUMBER
|
||||||
movzx ecx,byte[zoom]
|
movzx ecx,byte[zoom]
|
||||||
mov ebx,(2 shl 16)
|
mov ebx,(2 shl 16)
|
||||||
mov edx,(325+6*9)*65536+5
|
mov edx,(295+8*9)*65536+5
|
||||||
mov esi,[sc.work_button_text]
|
mov esi,[sc.work_text]
|
||||||
or esi,(1 shl 30)
|
or esi,(1 shl 30)
|
||||||
mov edi,[sc.work_button]
|
mov edi,[sc.work]
|
||||||
int 0x40 ;¬ áèâ ¡
|
int 0x40 ;¬ áèâ ¡
|
||||||
mov ebx,(5 shl 16)
|
mov ebx,(5 shl 16)
|
||||||
mov ecx,[tim]
|
mov ecx,[tim]
|
||||||
add edx,(6*2)*65536+9
|
add edx,9
|
||||||
int 0x40 ;¢à¥¬ï
|
int 0x40 ;¢à¥¬ï
|
||||||
mov ebx,(5 shl 16)
|
mov ebx,(5 shl 16)
|
||||||
mov ecx,[osob]
|
mov ecx,[osob]
|
||||||
add edx,(6*0)*65536+9
|
add edx,9
|
||||||
int 0x40 ;¯®¯ã«ïæ¨ï
|
int 0x40 ;¯®¯ã«ïæ¨ï
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
BIN
programs/games/life3/trunk/life3tb.png
Normal file
BIN
programs/games/life3/trunk/life3tb.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.2 KiB |
Loading…
Reference in New Issue
Block a user