diff --git a/programs/cmm/appearance/appearance.c b/programs/cmm/appearance/appearance.c index 825c230e3..6822bb80d 100644 --- a/programs/cmm/appearance/appearance.c +++ b/programs/cmm/appearance/appearance.c @@ -106,7 +106,6 @@ void main() load_dll(boxlib, #box_lib_init,0); load_dll(libini, #lib_init,1); - load_dll(libio, #libio_init,1); load_dll(libimg, #libimg_init,1); load_dll(Proc_lib, #OpenDialog_init,0); o_dialog.type = 2; //select folder diff --git a/programs/cmm/browser/TWB/special.h b/programs/cmm/browser/TWB/special.h index 027d65194..ef3fef548 100644 --- a/programs/cmm/browser/TWB/special.h +++ b/programs/cmm/browser/TWB/special.h @@ -48,10 +48,10 @@ char *unicode_symbols[]={ "#8594", "->", -"uarr", "\24", -"darr", "\25", -"rarr", "\26", -"larr", "\27", +"uarr", "^", +"darr", "v", +"rarr", "->", +"larr", "<-", "bull", "\31", "percnt","%", diff --git a/programs/cmm/drvinst/drvinst.c b/programs/cmm/drvinst/drvinst.c index 49716a82d..3c38c5de0 100644 --- a/programs/cmm/drvinst/drvinst.c +++ b/programs/cmm/drvinst/drvinst.c @@ -13,7 +13,6 @@ #include "../lib/gui.h" #include "../lib/list_box.h" #include "../lib/obj/box_lib.h" -#include "../lib/obj/libio.h" #include "../lib/obj/libimg.h" #include "../lib/obj/libini.h" #include "../lib/collection.h" @@ -88,7 +87,6 @@ byte process_sections(dword sec_name, f_name) void main() { - load_dll(libio, #libio_init,1); load_dll(libini, #lib_init,1); load_dll(boxlib, #box_lib_init,0); load_dll(libimg, #libimg_init,1); diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index c38121ef5..e9d7f7ae4 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -23,6 +23,7 @@ #include "../lib/collection.h" #include "../lib/copyf.h" +#include "../lib/obj/libio.h" #include "../lib/obj/libini.h" #include "../lib/obj/box_lib.h" #include "../lib/obj/libimg.h" diff --git a/programs/cmm/iconedit/iconedit.c b/programs/cmm/iconedit/iconedit.c index 2d68874cb..3ecdf502a 100644 --- a/programs/cmm/iconedit/iconedit.c +++ b/programs/cmm/iconedit/iconedit.c @@ -13,6 +13,7 @@ #include "../lib/list_box.h" #include "../lib/events.h" +#include "../lib/obj/libio.h" #include "../lib/obj/libimg.h" #include "../lib/obj/box_lib.h" diff --git a/programs/cmm/lib/draw_buf.h b/programs/cmm/lib/draw_buf.h index 0152e299b..abe9dd70a 100644 --- a/programs/cmm/lib/draw_buf.h +++ b/programs/cmm/lib/draw_buf.h @@ -47,7 +47,7 @@ void DrawBufer::Fill(dword start_pointer, i_fill_color) dword i; dword max_i = bufw * bufh * 4 + buf_data + 8; fill_color = i_fill_color; - MEMSETD(buf_data+start_pointer+8, max_i-buf_data-start_pointer-8/4, fill_color); + @MEMSETD(buf_data+start_pointer+8, max_i-buf_data-start_pointer-8/4, fill_color); } void DrawBufer::DrawBar(dword x, y, w, h, color) @@ -158,9 +158,9 @@ void DrawBufer::Zoom2x(int zoom) */ -void DrawBufer::Show() +void DrawBufer::Show(dword _y_offset) { - PutPaletteImage(buf_data+8, bufw, bufh, bufx, bufy, 32, 0); + PutPaletteImage(_y_offset * bufw * 4 + buf_data+8, bufw, bufh, bufx, bufy, 32, 0); } void DrawBufer::IncreaseBufSize() diff --git a/programs/cmm/lib/obj/libimg.h b/programs/cmm/lib/obj/libimg.h index 26b87fe25..d1450b59a 100644 --- a/programs/cmm/lib/obj/libimg.h +++ b/programs/cmm/lib/obj/libimg.h @@ -14,38 +14,36 @@ #include "../lib/dll.h" #endif -#ifndef INCLUDE_LIBIO_H -#include "../lib/obj/libio.h" -#endif - //library dword libimg = #alibimg; char alibimg[] = "/sys/lib/libimg.obj"; -dword libimg_init = #alibimg_init; -dword img_is_img = #aimg_is_img; -dword img_to_rgb2 = #aimg_to_rgb2; -dword img_decode = #aimg_decode; -dword img_destroy = #aimg_destroy; -dword img_draw = #aimg_draw; -dword img_create = #aimg_create; -dword img_encode = #aimg_encode; -dword img_convert = #aimg_convert; +dword libimg_init = #alibimg_init; +dword img_is_img = #aimg_is_img; +dword img_to_rgb2 = #aimg_to_rgb2; +dword img_decode = #aimg_decode; +dword img_destroy = #aimg_destroy; +dword img_draw = #aimg_draw; +dword img_create = #aimg_create; +dword img_encode = #aimg_encode; +dword img_convert = #aimg_convert; +dword img_from_file = #aimg_from_file; //dword img_flip = #aimg_flip; //dword img_rotate = #aimg_rotate; $DD 2 dup 0 //import libimg , \ -char alibimg_init[] = "lib_init"; -char aimg_is_img[] = "img_is_img"; -char aimg_to_rgb2[] = "img_to_rgb2"; -char aimg_decode[] = "img_decode"; -char aimg_destroy[] = "img_destroy"; -char aimg_draw[] = "img_draw"; -char aimg_create[] = "img_create"; -char aimg_encode[] = "img_encode"; -char aimg_convert[] = "img_convert"; +char alibimg_init[] = "lib_init"; +char aimg_is_img[] = "img_is_img"; +char aimg_to_rgb2[] = "img_to_rgb2"; +char aimg_decode[] = "img_decode"; +char aimg_destroy[] = "img_destroy"; +char aimg_draw[] = "img_draw"; +char aimg_create[] = "img_create"; +char aimg_encode[] = "img_encode"; +char aimg_convert[] = "img_convert"; +char aimg_from_file[] = "img_from_file"; //char aimg_flip[] = "img_flip"; //char aimg_rotate[] = "img_rotate "; @@ -292,27 +290,38 @@ struct libimg_image ///////////////////////////// :void DrawIcon32(dword x,y, _bg, icon_n) { - static libimg_image i32; static dword bg; - //load_dll(libimg, #libimg_init,1); - if (!i32.image) || (bg!=_bg) { + static dword pure_img32; + if (!pure_img32) || (bg!=_bg) { bg = _bg; - i32.load("/sys/icons32.png"); - i32.replace_color(0x00000000, bg); + img_from_file stdcall("/sys/icons32.png"); + pure_img32 = EAX; + //now fill transparent with another color + EDX = ESDWORD[EAX+4] * ESDWORD[EAX+8] * 4 + ESDWORD[EAX+24]; + for (ESI = ESDWORD[EAX+24]; ESI < EDX; ESI += 4) { + if (DSDWORD[ESI]==0x00000000) DSDWORD[ESI] = bg; + } } - if (icon_n>=0) i32.draw(x, y, 32, 32, 0, icon_n*32); + img_draw stdcall(pure_img32, x, y, 32, 32, 0, icon_n*32); } -:void DrawIcon16(dword x,y, bg, icon_n) { - static libimg_image i16; - //load_dll(libimg, #libimg_init,1); - if (!i16.image) { - i16.load("/sys/icons16.png"); - i16.replace_color(0xffFFFfff, bg); - i16.replace_color(0xffCACBD6, MixColors(bg, 0, 220)); +:void DrawIcon16(dword x,y, _bg, icon_n) { + static dword bg; + static dword pure_img16; + dword bgshadow; + if (!pure_img16) || (bg!=_bg) { + bg = _bg; + bgshadow = MixColors(bg, 0, 220); + img_from_file stdcall("/sys/icons16.png"); + pure_img16 = EAX; + //now fill transparent with another color + EDX = ESDWORD[EAX+4] * ESDWORD[EAX+8] * 4 + ESDWORD[EAX+24]; + for (ESI = ESDWORD[EAX+24]; ESI < EDX; ESI += 4) { + if (DSDWORD[ESI]==0xffFFFfff) DSDWORD[ESI] = bg; + if (DSDWORD[ESI]==0xffCACBD6) DSDWORD[ESI] = bgshadow; + } } - if (icon_n>=0) i16.draw(x, y, 16, 16, 0, icon_n*16); + img_draw stdcall(pure_img16, x, y, 16, 16, 0, icon_n*16); } - #endif \ No newline at end of file diff --git a/programs/cmm/misc/easyshot.c b/programs/cmm/misc/easyshot.c index 8eea47979..7bc8b24d8 100644 --- a/programs/cmm/misc/easyshot.c +++ b/programs/cmm/misc/easyshot.c @@ -4,6 +4,7 @@ #include "../lib/mem.h" #include "../lib/gui.h" +#include "../lib/obj/libio.h" #include "../lib/obj/libimg.h" #include "../lib/obj/box_lib.h" #include "../lib/obj/proc_lib.h" diff --git a/programs/cmm/misc/mblocks.c b/programs/cmm/misc/mblocks.c index c1ca1895b..e8313492a 100644 --- a/programs/cmm/misc/mblocks.c +++ b/programs/cmm/misc/mblocks.c @@ -10,7 +10,6 @@ #include "..\lib\gui.h" #include "..\lib\random.h" -#include "..\lib\obj\libio.h" #include "..\lib\obj\libimg.h" #ifndef AUTOBUILD @@ -45,7 +44,6 @@ int count; void main() { dword id; - load_dll(libio, #libio_init,1); load_dll(libimg, #libimg_init,1); NewGame(); @@ -157,7 +155,7 @@ void ReDraw_Game_Button(int id) case BTN_OPEN: DrawBar(xx+1, yy+1, CELL_SIZE-1, CELL_SIZE-1, 0xFFFfff);//background } - DrawIcon32(xx+6, yy+6, 0xFFFfff, bitpict[id]); + DrawIcon32(xx+6, yy+6, 0xFFFfff, bitpict[id]+51); //skip first 51 icons as they are boring for game } void Draw_Panel() diff --git a/programs/cmm/quark/quark.c b/programs/cmm/quark/quark.c index ba9a4bbf5..4187ef77f 100644 --- a/programs/cmm/quark/quark.c +++ b/programs/cmm/quark/quark.c @@ -28,6 +28,7 @@ #include "../lib/obj/box_lib.h" #include "../lib/obj/libini.h" +#include "../lib/obj/libio.h" #include "../lib/obj/libimg.h" #include "../lib/obj/iconv.h" #include "../lib/obj/proc_lib.h" diff --git a/programs/cmm/sysmon/sysmon.c b/programs/cmm/sysmon/sysmon.c index 6949f56cc..7dceabdaa 100644 --- a/programs/cmm/sysmon/sysmon.c +++ b/programs/cmm/sysmon/sysmon.c @@ -1,6 +1,6 @@ /* * System Monitor - * version 1.35 + * version 1.36 * Author: Leency */ @@ -43,9 +43,6 @@ #define BOTPANEL_H 36 #ifdef LANG_RUS - #define T_CPU_AND_RAM "Процессор и ОЗУ" - #define T_DRIVES "Диски" - #define T_PROCESSES "Процессы" #define T_APP_TITLE "Системный монитор" #define T_SHOW_SYSTEM "Системные" #define T_DETAILS "Подробнее" @@ -57,9 +54,6 @@ #define T_RD_USAGE "Системный диск: %i Кб свободно из 1.4 Мб" #define T_TMP_USAGE "TMP%i диск: %i Мб свободно из %i Мб" #else - #define T_CPU_AND_RAM "CPU & RAM" - #define T_DRIVES "Drives" - #define T_PROCESSES "Processes" #define T_APP_TITLE "System Monitor" #define T_SHOW_SYSTEM "System" #define T_DETAILS "Details" @@ -118,7 +112,7 @@ void main() //dword cpu_frequency = GetCpuFrequency()/1000; load_lib(); SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER); - loop() switch(@WaitEventTimeout(120)) + loop() switch(@WaitEventTimeout(50)) { case evMouse: SelectList_ProcessMouse(); @@ -175,9 +169,9 @@ void main() ram.set_size(RIGHT_X, WIN_CONTENT_Y+170, right_w, 23); rd.set_size(RIGHT_X, WIN_CONTENT_Y+240, right_w, 23); default: - SelectList_LineChanged(); MonitorCpu(); MonitorRam(); + SelectList_LineChanged(); MonitorRd(); MonitorTmp(); } @@ -343,11 +337,11 @@ void MonitorCpu() sprintf(#param, T_CPU_LOAD, cpu_stack[pos]); DrawIconWithText(RIGHT_X, cpu.y - 25, 48, #param); - for (i=0; i