diff --git a/data/Tupfile.lua b/data/Tupfile.lua index bf12f99afc..fac582fab6 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -179,6 +179,7 @@ extra_files = { {"kolibrios/emul/", "common/emul/zsnes"}, {"kolibrios/demos/ak47.lif", "common/demos/ak47.lif"}, {"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/rpento.lif", "common/demos/rpento.lif"}, {"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/textures1", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/textures1"}, {"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/develop/utils/GenFiles", PROGS .. "/testing/genfiles/GenFiles"}, {"kolibrios/games/Almaz", PROGS .. "/games/almaz/almaz"}, diff --git a/programs/cmm/browser/download_manager.h b/programs/cmm/browser/download_manager.h index 88f557db94..2a8d903dba 100644 --- a/programs/cmm/browser/download_manager.h +++ b/programs/cmm/browser/download_manager.h @@ -78,10 +78,11 @@ void Downloader() default: if (!downloader.MonitorProgress()) break; - pb.max = downloader.httpd.content_length; - if (pb.value != downloader.httpd.content_received) + pb.max = downloader.httpd.content_length / 100; + EDI = downloader.httpd.content_received/100; + if (pb.value != EDI) { - pb.value = downloader.httpd.content_received; + pb.value = EDI; progressbar_draw stdcall(#pb); DrawDownloading(); } @@ -154,6 +155,7 @@ void StartDownloading() DL_Draw_Window(); } +/* struct TIME { dword old; @@ -180,6 +182,7 @@ void CalculateSpeed() } else time.old = time.cur; } +*/ void DrawDownloading() { diff --git a/programs/cmm/txtread/prepare_page.h b/programs/cmm/txtread/prepare_page.h index 909d1c1003..9c08b3bf41 100644 --- a/programs/cmm/txtread/prepare_page.h +++ b/programs/cmm/txtread/prepare_page.h @@ -3,13 +3,15 @@ enum { DRAW_BUF }; +#define DRAW_PADDING 12 + void Parcer(byte mode) { dword bufoff, buflen; byte ch; char line[4096]=0; int srch_pos; -dword stroka_y=5; +dword stroka_y=DRAW_PADDING-3; dword line_length=30; dword line_start=io.buffer_data; @@ -34,7 +36,7 @@ dword line_start=io.buffer_data; if (mode==DRAW_BUF) { EBX = bufoff-line_start; 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; line_start = bufoff; line_length = 30; @@ -42,7 +44,7 @@ dword line_start=io.buffer_data; } } 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() @@ -52,7 +54,7 @@ void PreparePage() Parcer(COUNT_BUF_HEIGHT); //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; kfont.size.height = list.count+1*list.item_h; kfont.raw_size = 0; diff --git a/programs/games/life3/trunk/Tupfile.lua b/programs/games/life3/trunk/Tupfile.lua index e329ca6237..77f33fcfc0 100644 --- a/programs/games/life3/trunk/Tupfile.lua +++ b/programs/games/life3/trunk/Tupfile.lua @@ -1,2 +1,3 @@ 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") diff --git a/programs/games/life3/trunk/build_ru.bat b/programs/games/life3/trunk/build_ru.bat index b898c517ce..c4a9cee1ae 100644 --- a/programs/games/life3/trunk/build_ru.bat +++ b/programs/games/life3/trunk/build_ru.bat @@ -1,4 +1,4 @@ -if not exist bin mkdir bin -@fasm.exe -m 16384 life3.asm bin\life3.kex -@kpack bin\life3.kex +@echo lang fix en >lang.inc +@fasm.exe -m 16384 life3.asm life3.kex +@kpack life3.kex pause diff --git a/programs/games/life3/trunk/life3.asm b/programs/games/life3/trunk/life3.asm index b77045e165..f668e86219 100644 --- a/programs/games/life3/trunk/life3.asm +++ b/programs/games/life3/trunk/life3.asm @@ -9,13 +9,18 @@ include '../../../KOSfuncs.inc' include '../../../load_img.inc' include '../../../develop/libraries/box_lib/load_lib.mac' +include 'lang.inc' + @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 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 @@ -51,9 +56,16 @@ tim dd 0 ; b_sort dd 0 ;граница для сортированных ячеек osob dd 0 ;число особей zoom db 3 ;масштаб поля -txt_zoom db 'Масштаб:',0 -txt_gen db 'Поколение:',0 -txt_osob db 'Особей:',0 + +if lang eq ru +txt_zoom db ' Масштаб:',0 +txt_gen db ' Поколение:',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 - цвет поля @@ -815,7 +827,7 @@ start: mov [memCell],eax stdcall mem.Alloc,(COL_MEM+1)*4 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 @@ -966,10 +978,7 @@ align 4 draw_window: pushad mcall SF_REDRAW,SSF_BEGIN_DRAW - mov edx,[sc.work] - or edx,0x33000000 - mov edi,hed - mcall SF_CREATE_WINDOW,(20 shl 16)+485,(20 shl 16)+415 + mcall SF_CREATE_WINDOW,(50 shl 16)+485,(50 shl 16)+415,0x73000000,0,hed mcall SF_THREAD_INFO,procinfo,-1 mov eax,[procinfo.box.height] @@ -994,98 +1003,91 @@ pushad stdcall [buf2d_clear], buf_0, [buf_0.color] call pole_paint .end0: + + mov edx,[sc.work] + mov ebx, 0 shl 16 + add ebx, [buf_0.w] + mcall SF_DRAW_RECT,,<0,35> - mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3, [sc.work_button] + mcall SF_DEFINE_BUTTON,(6 shl 16)+TBTNSIZE,(6 shl 16)+TBTNSIZE,4+0x40000000, [sc.work_button] - mov ebx,(30 shl 16)+20 - mov edx,4 + mov ebx,(36 shl 16)+TBTNSIZE + mov edx,6+0x40000000 int 0x40 - mov ebx,(55 shl 16)+20 - mov edx,5 + mov ebx,(61 shl 16)+TBTNSIZE + mov edx,7+0x40000000 int 0x40 - mov ebx,(85 shl 16)+20 - mov edx,6 + mov ebx,(86 shl 16)+TBTNSIZE + mov edx,8+0x40000000 int 0x40 - mov ebx,(110 shl 16)+20 - mov edx,7 + mov ebx,(116 shl 16)+TBTNSIZE + mov edx,9+0x40000000 int 0x40 - mov ebx,(135 shl 16)+20 - mov edx,8 + mov ebx,(141 shl 16)+TBTNSIZE + mov edx,10+0x40000000 int 0x40 - mov ebx,(165 shl 16)+20 - mov edx,9 + mov ebx,(171 shl 16)+TBTNSIZE + mov edx,11+0x40000000 int 0x40 - mov ebx,(190 shl 16)+20 - mov edx,10 + mov ebx,(196 shl 16)+TBTNSIZE + mov edx,12+0x40000000 int 0x40 - mov ebx,(220 shl 16)+20 - mov edx,11 + mov ebx,(221 shl 16)+TBTNSIZE + mov edx,13+0x40000000 int 0x40 - mov ebx,(245 shl 16)+20 - mov edx,12 + mov ebx,(246 shl 16)+TBTNSIZE + mov edx,14+0x40000000 int 0x40 - mov ebx,(270 shl 16)+20 - 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 + mcall SF_PUT_IMAGE,[image_data_toolbar],(ICONSIZE shl 16)+ICONSIZE,(5 shl 16)+5 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 add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(112 shl 16)+7 ;run auto + mov edx,(115 shl 16)+5 ;- int 0x40 add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(137 shl 16)+7 ;stop + mov edx,(140 shl 16)+5 ;+ int 0x40 add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(167 shl 16)+7 ;- + mov edx,(170 shl 16)+5 ;move up int 0x40 add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(192 shl 16)+7 ;+ - int 0x40 - - add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(222 shl 16)+7 ;move up + mov edx,(195 shl 16)+5 ;move doun int 0x40 add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(247 shl 16)+7 ;move doun + mov edx,(220 shl 16)+5 ;move left int 0x40 add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(272 shl 16)+7 ;move left - int 0x40 - add ebx,IMAGE_TOOLBAR_ICON_SIZE - mov edx,(297 shl 16)+7 ;move up + mov edx,(245 shl 16)+5 ;move right int 0x40 + + ; 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 - call draw_pok - - stdcall [buf2d_draw], buf_0 - - mcall SF_REDRAW,SSF_END_DRAW -popad - ret - -align 4 -draw_pok: mov eax,SF_DRAW_TEXT - mov ebx,325*65536+5 + mov ebx,295*65536+5 mov ecx,[sc.work_text] or ecx,0x80000000 ;or (1 shl 30) mov edx,txt_zoom @@ -1097,22 +1099,32 @@ draw_pok: add bx,9 mov edx,txt_osob 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 movzx ecx,byte[zoom] mov ebx,(2 shl 16) - mov edx,(325+6*9)*65536+5 - mov esi,[sc.work_button_text] + mov edx,(295+8*9)*65536+5 + mov esi,[sc.work_text] or esi,(1 shl 30) - mov edi,[sc.work_button] + mov edi,[sc.work] int 0x40 ;масштаб mov ebx,(5 shl 16) mov ecx,[tim] - add edx,(6*2)*65536+9 + add edx,9 int 0x40 ;время mov ebx,(5 shl 16) mov ecx,[osob] - add edx,(6*0)*65536+9 + add edx,9 int 0x40 ;популяция ret diff --git a/programs/games/life3/trunk/life3tb.png b/programs/games/life3/trunk/life3tb.png new file mode 100644 index 0000000000..26c8139b9d Binary files /dev/null and b/programs/games/life3/trunk/life3tb.png differ diff --git a/programs/games/life3/trunk/toolbar.png b/programs/games/life3/trunk/toolbar.png deleted file mode 100644 index 92cda518a0..0000000000 Binary files a/programs/games/life3/trunk/toolbar.png and /dev/null differ