diff --git a/programs/cmm/appearance/appearance.c b/programs/cmm/appearance/appearance.c index 506f006182..d98bb34dd4 100644 --- a/programs/cmm/appearance/appearance.c +++ b/programs/cmm/appearance/appearance.c @@ -89,8 +89,8 @@ void Draw_List() } else { - DrawBar(0, yyy, list[active].w, list[active].item_h, system.color.grab_button); - if (i]\n" -:struct COLORS -{ - dword frame,grab,grab_button,grab_button_text,grab_text, - work,work_button,work_button_text,work_text,work_graph; +:struct COLORS { +dword + nonset1, + nonset2, + work_light, + work_dark, + nonset3, + work, + work_button, + work_button_text, + work_text, + work_graph; void get(); }; @@ -13,7 +21,7 @@ { EAX = 48; EBX = 3; - ECX = #frame; + ECX = #nonset1; EDX = 40; $int 0x40 } diff --git a/programs/games/clicks/trunk/clicks.c b/programs/games/clicks/trunk/clicks.c index 99d9ac1436..803053c29e 100644 --- a/programs/games/clicks/trunk/clicks.c +++ b/programs/games/clicks/trunk/clicks.c @@ -7,7 +7,7 @@ system_colors sc; //уровни сложности int DIFFICULTY_LEVEL=1; //по-умолчанию среднее поле -char *BOARD_SIZES[]={ "S", "M", "L", 0 }; +char *BOARD_SIZES[]={ "S\0", "M\0", "L\0", 0 }; int DIFFICULTY_LEV_PARAMS[]={ 9, 12, 16 }; int BLOCKS_NUM; //количество квадратиков по Х и по Y @@ -18,14 +18,14 @@ int blocks_matrix[28*28]; // #define BLOCK_SIZE 21 //размер квадратика #define MARKED 7 #define DELETED_BLOCK 6 -#define HEADER "Just Clicks v2.1" +#define HEADER "Just Clicks v2.2" #ifndef AUTOBUILD #include "lang.h--" #endif #ifdef LANG_RUS - char NEW_GAME_TEXT[]=" ‡ ­®ў® [F2]"; + char NEW_GAME_TEXT[]="‡ ­®ў® [F2]"; char REZULT_TEXT[]="ђҐ§г«мв в: "; #elif LANG_EST char NEW_GAME_TEXT[]="Uus mдng [F2]"; @@ -38,7 +38,7 @@ int blocks_matrix[28*28]; // void main() { - int key, id; + int key_scancode, id; BLOCKS_NUM=DIFFICULTY_LEV_PARAMS[DIFFICULTY_LEVEL]; @@ -75,10 +75,10 @@ void main() } break; case evKey: - key = GetKey(); - if (key==027) //Escape + key_scancode = GetKeyScancode(); + if (key_scancode==001) //Escape ExitProcess(); - if (key==051) //F2 + if (key_scancode==060) //F2 { _NEW_GAME_MARK: new_game(); @@ -181,14 +181,8 @@ void draw_window() DrawBar(0,PANEL_Y, PANEL_Y, USER_PANEL_HEIGHT, sc.work); //панель снизу - //новая игра - DefineButton(10,PANEL_Y+7, 13*6+6, 20, 2,sc.work_button); - WriteText(10+4,PANEL_Y+14,0x80,sc.work_button_text,#NEW_GAME_TEXT,0); - - - //кнопочкa выбора уровня сложности - DefineButton(95,PANEL_Y+7, 20,20, 10,sc.work_button); - WriteText(95+8,PANEL_Y+14,0x80,sc.work_button_text,BOARD_SIZES[DIFFICULTY_LEVEL],0); + DrawCaptButton(10, PANEL_Y+7, 90, 20, 2, sc.work_button, sc.work_button_text,#NEW_GAME_TEXT); + DrawCaptButton(105,PANEL_Y+7, 20, 20, 10,sc.work_button, sc.work_button_text,BOARD_SIZES[DIFFICULTY_LEVEL]); draw_field(); @@ -272,7 +266,7 @@ void draw_field() else { DefineButton(j*BLOCK_SIZE,i*BLOCK_SIZE,BLOCK_SIZE-1,BLOCK_SIZE-1, current_id+100+BT_HIDE,0); - PutImage(blocks_matrix[current_id]*1323+#img,21,21,j*BLOCK_SIZE,i*BLOCK_SIZE); + PutImage(blocks_matrix[current_id]*1323+#block,21,21,j*BLOCK_SIZE,i*BLOCK_SIZE); } } } diff --git a/programs/games/clicks/trunk/compile_eng.bat b/programs/games/clicks/trunk/compile_eng.bat index 53a2262a07..5a9c0e15a8 100644 --- a/programs/games/clicks/trunk/compile_eng.bat +++ b/programs/games/clicks/trunk/compile_eng.bat @@ -1,8 +1,9 @@ -del lang.h-- -echo #define LANG_ENG 1 >lang.h-- -..\C--\C-- clicks.c -del clicks -rename clicks.com clicks -del warning.txt -del lang.h-- -pause +@del lang.h-- +@echo #define LANG_ENG 1 >lang.h-- +C-- clicks.c +@del clicks +@rename clicks.com clicks +@del warning.txt +@del lang.h-- +@pause +@kpack clicks \ No newline at end of file diff --git a/programs/games/clicks/trunk/compile_rus.bat b/programs/games/clicks/trunk/compile_rus.bat index a43163ff29..6a4046630b 100644 --- a/programs/games/clicks/trunk/compile_rus.bat +++ b/programs/games/clicks/trunk/compile_rus.bat @@ -1,8 +1,9 @@ -del lang.h-- -echo #define LANG_RUS 1 >lang.h-- -..\C--\C-- clicks.c -del clicks -rename clicks.com clicks -del warning.txt -del lang.h-- -pause \ No newline at end of file +@del lang.h-- +@echo #define LANG_RUS 1 >lang.h-- +c-- clicks.c +@pause +@del clicks +@rename clicks.com clicks +@del warning.txt +@del lang.h-- +@kpack clicks \ No newline at end of file diff --git a/programs/games/clicks/trunk/lib/boxes.txt b/programs/games/clicks/trunk/lib/boxes.txt index 288eb21717..c9016ccf87 100644 --- a/programs/games/clicks/trunk/lib/boxes.txt +++ b/programs/games/clicks/trunk/lib/boxes.txt @@ -1,4 +1,4 @@ -unsigned char img[6615] = { +unsigned char block[6615] = { 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, 0xE2, 0xE2, 0x8C, diff --git a/programs/games/clicks/trunk/lib/cups.png b/programs/games/clicks/trunk/lib/cups.png index 9b0132cfbe..d34fc10cd2 100644 Binary files a/programs/games/clicks/trunk/lib/cups.png and b/programs/games/clicks/trunk/lib/cups.png differ diff --git a/programs/games/clicks/trunk/lib/kolibri.h b/programs/games/clicks/trunk/lib/kolibri.h index 220cba1825..3851a65c60 100644 --- a/programs/games/clicks/trunk/lib/kolibri.h +++ b/programs/games/clicks/trunk/lib/kolibri.h @@ -45,8 +45,18 @@ inline fastcall void GetProcessInfo(dword EBX, ECX) $int 0x40 } -struct system_colors{ - dword frame,grab,grab_button,grab_button_text,grab_text,work,work_button,work_button_text,work_text,work_graph; +struct system_colors { +dword + nonset1, + nonset2, + work_light, + work_dark, + nonset3, + work, + work_button, + work_button_text, + work_text, + work_graph; void get(); }; @@ -55,7 +65,7 @@ void system_colors::get() $push ecx EAX = 48; EBX = 3; - ECX = #frame; + ECX = #nonset1; EDX = 40; $int 0x40 $pop ecx @@ -68,11 +78,12 @@ inline fastcall dword WaitEvent(){ $int 0x40 } - -inline fastcall word GetKey(){ - EAX = 2; // just read it key from buffer - $int 0x40 - EAX = EAX >> 8; +int GetKeyScancode() +{ + $mov eax,2 + $int 0x40 + $shr eax,16 + return AL; } inline fastcall word GetButtonID(){ @@ -243,4 +254,12 @@ done: $int 0x40 $pop ecx $pop ebx -} \ No newline at end of file +} + +void DrawCaptButton(dword x,y,w,h,id,color_b, color_t,text) +{ + if (id>0) DefineButton(x,y,w,h,id,color_b); + WriteText(-strlen(text)*6+w/2+x+1,h/2-3+y,0x80,color_t,text); +} + +