From 0bf8ef743feb378ff9f7933f2af07915ee0188e4 Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 7 Feb 2016 21:18:54 +0000 Subject: [PATCH] clicks: small update, use scancode keys git-svn-id: svn://kolibrios.org@6167 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/appearance/appearance.c | 4 +-- programs/cmm/lib/system.h | 18 +++++++--- programs/games/clicks/trunk/clicks.c | 26 ++++++-------- programs/games/clicks/trunk/compile_eng.bat | 17 ++++----- programs/games/clicks/trunk/compile_rus.bat | 17 ++++----- programs/games/clicks/trunk/lib/boxes.txt | 2 +- programs/games/clicks/trunk/lib/cups.png | Bin 3936 -> 3048 bytes programs/games/clicks/trunk/lib/kolibri.h | 37 +++++++++++++++----- 8 files changed, 72 insertions(+), 49 deletions(-) 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 9b0132cfbe6a3cd337e183f8ccc532153fef15d3..d34fc10cd239d9062f2adcc3895bfb514dd6283f 100644 GIT binary patch delta 3043 zcmV<93mo*|9_Sa4BYyw{XF*Lt006O%3;baP00001b5ch_0Itp)=>Px$l~7DnMdIGz z{QdpGzQI~@ndIQ(sfcsh*4W|O-TSErm6oE@%gfWw(8t8bhliDulAU*VhPSS%x3#)) zaekR|TZw2?kdBywfsM$TI=_Dd%%DZ3f^C6dP3D&Xv6OzHe1B%rs#a-fclh$>+K~a0 zZC0V4rMtYu!@IiO(9O}MNz=u-si?Ameu#g7j{4Aghi_us+vBmWvX^*e@}B^?rkBHx zDCGtORcno>q^Zoy(0N%#+PZ(Wcmc_U0kMH2telmZgLnP1AJ1)W)*vC&iU8M`8}jYw z*8>BOd~>swUw`4%%K5!Sqm6;eqEy(kX|0Mz=N%U2&!xnzlFm|6;m49-VQ$jDqsWaG z<~TR!PePfBgVwsX^Qs%|-Mz=LpWVN}&p0_yVu0o+CbOZ6ZcjaSftUQ?r`4Y{``3`# zqNAaaiqWfP$hN5X?9*m*is3vU#vmc$gnq)Nb?mM-(tn9asBZ(Bp|9U%M$y5i(6e~^ z$YRo(RL^N7n`sTl2nxB3H&|F@;6*6em}7ZOWQRIV`QE2?P;8?V8?cDocmMzi@kvBM zR9M5MnE6}UY8J0*X|*a&=s4ty;C?(%M$r-Y(PSZZq?D z&q)9g%YWkY%=ZVM@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cIyMv@8Qlb%cED|TZO zI>gF9%mwBbx6?-1C~YmVm*y*x-}idfsC zEik0D_l!muLEhiSdU|*)1^gwYC-m58l32djx_-C%WIFk~gC{gMp6rQIMjPAf$=yPa ztKx7I2~Xu?@(q26<)QQ%i`H_hKOy8zaac`c5mUFkM8F&+Sl^pH*7C@8-dkMnN7c7@ zW+Wuu>^%i=WDMoFb(Qyy+FS=$pWLA~-^uIQ>vc5@+-|P|gW6E}td53}Xc&L}QE6-H z!LkTlOWGUSxAE5#NPqF5e;7)yZ{!W_O(y83^1UYL2I;T0O+2E)Q+Qv=vZ)Q8H-HUs z^KS_vS99T-XwoB!3R#Zr?o@m%8kqgGdvtt>LN)U3YRB=HH-p!CFrZ+H@6W#Mi)0+! zW@4JGrfZ|-t21cje`*F(I&#-QXShK}-{YB49909AjoS=|Xg3Bt7>9g@AScwcOG;HOSjb&xwNw#PVOLe0#?-*4bC~{q6{dAv%Kt3s&n*CNAop4hj^rCFnHTSL2 zl5@n>P2Ji0>{G4_K{a5pK_<)M3sqtUa)Scgo8az{s<+;41m326>h> 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); +} + +