wwtbam 0.2: rolled-up bug fixed, no clipping while window redrawing, init_heap at start (CleverMouse), support different shin height

git-svn-id: svn://kolibrios.org@2830 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2012-06-28 12:38:52 +00:00
parent f657cc8f9b
commit 87f20fb78f
2 changed files with 124 additions and 36 deletions

View File

@ -0,0 +1,99 @@
ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Û Û
Û Š’Ž •Ž—…’ <20>œ ŒˆˆŽ<CB86><EFBFBD>ŽŒ? Û
Û Û
Û ˆ£à  ¤«ï Ž‘ Š®«¨¡à¨ ¯® ¬®â¨¢ ¬ ¯®¯ã«ïà­®© ⥫¥¯¥à¥¤ ç¨ Û
Û Û
ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Û Û
Û 1. <20>à ¢¨«  ¨£àë Û
Û Û
Û ˆ£à  "Šâ® å®ç¥â ¡ëâì ¬¨««¨®­¥à®¬?" ï¥âáï ª®¬¯ìîâ¥à­®© ¨£à®©- Û
Û  ­ «®£®¬ ¯®¯ã«ïà­®© ⥫¥¯¥à¥¤ ç¨. ‚ è  § ¤ ç  - ®â¢¥â¨¢ ­  15 ¢®¯- Û
Û à®á®¢, ¢ë¨£à âì ¬¨««¨®­ àã¡«¥©. Û
Û Žâ¢¥ç ï ­  ª ¦¤ë© ¨§ ¢®¯à®á®¢, ¢ë § à ¡ â뢠¥â¥ ®¯à¥¤¥«ñ­­®¥ ª®«¨- Û
Û ç¥á⢮ ¤¥­¥£: Û
Û Û
Û 1 ¢®¯à®á - 100 àã¡«¥© Û
Û 2 ¢®¯à®á - 200 àã¡«¥© Û
Û 3 ¢®¯à®á - 300 àã¡«¥© Û
Û 4 ¢®¯à®á - 500 àã¡«¥© Û
Û 5 ¢®¯à®á - 1000 àã¡«¥© Û
Û 6 ¢®¯à®á - 2000 àã¡«¥© Û
Û 7 ¢®¯à®á - 4000 àã¡«¥© Û
Û 8 ¢®¯à®á - 8000 àã¡«¥© Û
Û 9 ¢®¯à®á - 16000 àã¡«¥© Û
Û 10 ¢®¯à®á - 32000 àã¡«¥© Û
Û 11 ¢®¯à®á - 64000 àã¡«¥© Û
Û 12 ¢®¯à®á - 125000 àã¡«¥© Û
Û 13 ¢®¯à®á - 250000 àã¡«¥© Û
Û 14 ¢®¯à®á - 500000 àã¡«¥© Û
Û 15 ¢®¯à®á - 1000000 àã¡«¥© Û
Û Û
Û <20>ਠ¯à ¢¨«ì­®¬ ®â¢¥â¥ ­  ¢®¯à®á ¢ë ¯¥à¥å®¤¨â¥ ª á«¥¤ãî饬㠢®¯- Û
Û à®áã (¨«¨ ¦¥, ¥á«¨ íâ® ¡ë« 15-© ¢®¯à®á, ¢ë ¢ë¨£à뢠¥â¥ ¬¨««¨®­ ¨ Û
Û ¨£à  § ª ­ç¨¢ ¥âáï. Û
Û «î¡®© ¬®¬¥­â (­  «î¡®¬ ¢®¯à®á¥) ¢ë ¬®¦¥â¥ ã©â¨ ¨ § ¡à âì ¤¥­ì£¨ Û
Û (­ ¦ ¢ ª« ¢¨èã <BACKSPACE>). Û
Û á«ãç ¥, ¥á«¨ ¢ë ®â¢¥â¨â¥ ­¥¯à ¢¨«ì­®, ¨£à  § ª ­ç¨¢ ¥âáï ¨ Û
Û ¤¥­ì£¨ ᣮà îâ, §  ¨áª«î祭¨¥¬ 1000 (¥á«¨ ¢ë ®â¢¥â¨«¨ ­  5 ¢®¯à®á®¢) Û
Û ¨«¨ 32000 (¥á«¨ ¢ë ®â¢¥â¨«¨ ­  10 ¢®¯à®á®¢). Û
Û “ ¢ á ¥áâì 3 ¯®¤áª §ª¨, ª®â®à묨 ¢ë ¬®¦¥â¥ ¢®á¯®«ì§®¢ âìáï ¯® ®¤- Û
Û ­®¬ã ࠧ㠧  ¨£àã: "50 ­  50", "<22>®¤áª §ª  § « " ¨ "‡¢®­®ª ¤àã£ã". Û
Û Û
Û “ „ € — <20> Ž ‰ ˆ ƒ <20> ! ! ! Û
Û Û
ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Û Û
Û 2. ‘¨á⥬­ë¥ âॡ®¢ ­¨ï Û
Û Û
Û ˆ£à  ­ ¯¨á ­  ¤«ï ®¯¥à æ¨®­­®© á¨á⥬ë "Š®«¨¡à¨ Ž‘". Û
Û Û
Û ‘¨á⥬­ë¥ âॡ®¢ ­¨ï: Û
Û 1. IBM-PC ᮢ¬¥áâ¨¬ë© ¯¥àá®­ «ì­ë© ª®¬¯ìîâ¥à Û
Û 2. Ž¯¥à æ¨®­­ ï á¨á⥬  "Š®«¨¡à¨" ¢¥àᨨ 0.7.1.0 ¨«¨ ¢ëè¥ Û
Û Û
Û ‘⮨⠮ᮡ® ®â¬¥â¨âì, çâ® ¤«ï § ¯ã᪠ ¨£àë ¢ ¬ ¯®âॡã¥âáï ¤¨á- Û
Û âਡã⨢ Kolibri OS ¨¬¥­­® ¢¥àᨨ 0.7.1.0 ¨«¨ ­®¢¥¥, â ª ª ª ¨£à  Û
Û ¨á¯®«ì§ã¥â ¢®§¬®¦­®á⨠ï¤à  á¨á⥬ë, ®âáãâá⢮¢ ¢è¨¥ ¢ ¯à¥¤ë¤ãé¨å Û
Û ¢¥àá¨ïå ¤¨áâਡã⨢ . Û
Û Û
ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Û Û
Û 3. <20> §à ¡®âª  ¡ § ¢®¯à®á®¢ Û
Û Û
Û ‚ë ¬®¦¥â¥ ࠧࠡ®â âì ᮡá⢥­­ãî ¡ §ã ¢®¯à®á®¢ ¤«ï ¨£àë. Û
Û ” ©« ¡ §ë ¢®¯à®á®¢ ¤®«¦¥­ ­ §ë¢ âìáï "appdata.dat", ¨ à á¯®«®- Û
Û £ âìáï ¢ ®¤­®¬ ª â «®£¥ á ¨£à®©. Û
Û Û
Û ”®à¬ â ä ©« : Û
Û Û
Û <0x10><‘«®¦­®áâì>’¥ªáâ ¢®¯à®á <0x01>‚ à¨ ­â ®â¢¥â <0x02>‚ à¨ ­â Û
Û ®â¢¥â <0x03>‚ à¨ ­â ®â¢¥â <0x04>‚ à¨ ­â ®â¢¥â <0x08><<3C>à ¢¨«ì­ë© Û
Û ®â¢¥â><0x10>‚â®à®© ¢®¯à®á<0x01>.....<0x14>(«î¡ë¥ ᨬ¢®«ë ¢ ª®­æ¥ Û
Û ä ©« , ­¥®¡å®¤¨¬ë¥ ¤«ï ⮣®, ç⮡ë à §¬¥à ä ©«  ¡ë« ªà â¥­ 512 Û
Û ¡ ©â ¬) Û
Û Û
Û (¡¥§ ᨬ¢®«®¢ < ¨ >,   â ª¦¥ ( ¨ )) Û
Û Û
Û ‘«®¦­®áâì ¢®¯à®á  ¬®¦¥â ¡ëâì: Û
Û 0x05 - «¥£ª¨© ¢®¯à®á Û
Û 0x06 - ¢®¯à®á á।­¥© á«®¦­®á⨠Û
Û 0x07 - á«®¦­ë© ¢®¯à®á Û
Û Û
Û <20>®¬¥à ¯à ¢¨«ì­®£® ®â¢¥â  ¬®¦¥â ¡ëâì ᮮ⢥âá⢥­­®: Û
Û 0å01, 0å02, 0å03 ¨«¨ 0å04 Û
Û Û
Û <>ˆŒ€<C592>ˆ…: ¤«ï ­ ç «  ¨£àë ¢ ¡ §¥ Ž<>Ÿ‡€œ<E280B9>Ž ¤®«¦­® ¡ëâì ­¥ ¬¥­¥¥ Û
Û 5 «ñ£ª¨å, 5 á।­¨å ¨ 5 á«®¦­ëå ¢®à®á®¢! Û
Û Û
Û ‘«¥¤ã¥â § ¬¥â¨âì, çâ® ¯à¨ ¨£à¥ ®â¢¥âë ­  ¢®¯à®á ¡ã¤ã á«ãç ©­ë¬ ®¡- Û
Û à §®¬ ¯¥à¥¬¥è ­ë. Û
Û Û
ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ
Û Û
Û <20> §à ¡®â稪: Dron2004 Û
Û Û
Û <20>¥â -â¥áâ¨à®¢ ­¨¥: Leency Û
Û Û
ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ

View File

@ -3,8 +3,9 @@
#include <kosSyst.h> #include <kosSyst.h>
#include <kosFile.h> #include <kosFile.h>
#include <func.h>
char sVersion[] = "‚¥àá¨ï 0.1"; char sVersion[] = "‚¥àá¨ï 0.2";
int status=0; int status=0;
@ -47,8 +48,6 @@ bool drawC = true;
bool drawD = true; bool drawD = true;
char * tempquestion; char * tempquestion;
char * tempanswerA; char * tempanswerA;
char * tempanswerB; char * tempanswerB;
@ -62,11 +61,11 @@ int tempanswerClength=0;
int tempanswerDlength=0; int tempanswerDlength=0;
const char header[]="Šâ® å®ç¥â ¡ëâì ¬¨««¨®­¥à®¬";
const char header[]="Šâ® å®ç¥â ¡ëâì ¬¨««¨®­¥à®¬ ¤«ï Kolibri OS";
void app_halt(); void app_halt();
char * filepathname; //Îïðåäåëÿåì ïóòü è èìÿ ôàéëà ñ áàçîé âîïðîñîâ char * filepathname; //Îïðåäåëÿåì ïóòü è èìÿ ôàéëà ñ áàçîé âîïðîñîâ
void getFilePathName(){ void getFilePathName(){
int lastslashindex=0; int lastslashindex=0;
@ -105,16 +104,10 @@ void loadquestion(){
int qcodee; int qcodee;
int skipsleft; int skipsleft;
regenerate: regenerate:
qcodee=(rtlRand()%questioncount)+1; qcodee=(rtlRand()%questioncount)+1;
Byte inputbyte[1]={0x00}; Byte inputbyte[1]={0x00};
@ -217,7 +210,7 @@ regenerate:
tempanswerD = new char[tempanswerDlength+1]; tempanswerD = new char[tempanswerDlength+1];
// ÂÒÎÐÎÉ ÏÐÎÕÎÄ: ÔÎÐÌÈÐÓÅÌ Â ÏÀÌßÒÈ ÂÎÏÐÎÑ È ÂÀÐÈÀÍÒÛ ÎÒÂÅÒÀ // ÂÒÎÐÎÉ ÏÐÎÕÎÄ: ÔÎÐÌÈÐÓÅÌ Â ÏÀÌßÒÈ ÂÎÏÐÎÑ È ÂÀÐÈÀÍÒÛ ÎÒÂÅÒÀ
CKosFile basefile2(filepathname); CKosFile basefile2(filepathname);
inputbyte[0]=0x00; inputbyte[0]=0x00;
@ -577,31 +570,28 @@ regenD:
} }
} }
delete tempquestion; delete tempquestion;
delete tempanswerA; delete tempanswerA;
delete tempanswerB; delete tempanswerB;
delete tempanswerC; delete tempanswerC;
delete tempanswerD; delete tempanswerD;
} }
void draw_window(void){ //Ðèñóåì îêíî void draw_window(void){ //Ðèñóåì îêíî
sProcessInfo sPI;
kos_WindowRedrawStatus(1); kos_WindowRedrawStatus(1);
kos_DefineAndDrawWindow(10,10,620,200,0x34, 0xDDDDFF, 0,0, (Dword)header); kos_DefineAndDrawWindow(10,10,619,179+kos_GetSkinHeight(),0x74, 0xDDDDFF, 0,0, (Dword)header);
kos_WindowRedrawStatus(2);
kos_ProcessInfo( &sPI );
if (sPI.rawData[70]&0x04) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê
if (status==0){ //Ìåíþ if (status==0){ //Ìåíþ
kos_DrawBar(0,0,610,174,0xFFFFBB); kos_DrawBar(0,0,610,175,0xFFFFBB);
kos_WriteTextToWindow (10,10,0x80,0x000000, "Šâ® å®ç¥â ¡ëâì ¬¨««¨®­¥à®¬?", 3); kos_WriteTextToWindow (10,10,0x80,0x000000, "Šâ® å®ç¥â ¡ëâì ¬¨««¨®­¥à®¬?", 3);
kos_WriteTextToWindow (10,25,0x80,0x000000, sVersion, 3); kos_WriteTextToWindow (10,25,0x80,0x000000, sVersion, 3);
@ -614,7 +604,7 @@ void draw_window(void){ //
} }
if (status==1){ //Èãðà if (status==1){ //Èãðà
kos_DrawBar(0,0,610,174,0xEEEEFF); kos_DrawBar(0,0,610,175,0xEEEEFF);
kos_WriteTextToWindow (10,10,0x0,0x000000, question, questionlength-1); kos_WriteTextToWindow (10,10,0x0,0x000000, question, questionlength-1);
@ -650,24 +640,24 @@ void draw_window(void){ //
} }
if (status==2){ //Îêíî "Ýòî - ïðàâèëüíûé îòâåò" if (status==2){ //Îêíî "Ýòî - ïðàâèëüíûé îòâåò"
kos_DrawBar(0,0,610,174,0xDDFFDD); kos_DrawBar(0,0,610,175,0xDDFFDD);
kos_WriteTextToWindow (10,10,0x80,0x000000, "„ , íâ® ¯à ¢¨«ì­ë© ®â¢¥â!", 0); kos_WriteTextToWindow (10,10,0x80,0x000000, "„ , íâ® ¯à ¢¨«ì­ë© ®â¢¥â!", 0);
kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - ¯à®¤®«¦¨âì", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - ¯à®¤®«¦¨âì", 0);
} }
if (status==3){ //Âû âûèãðàëè ìèëëèîí, îäíàêî æ!!! if (status==3){ //Âû âûèãðàëè ìèëëèîí, îäíàêî æ!!!
kos_DrawBar(0,0,610,174,0x00FF00); kos_DrawBar(0,0,610,175,0x00FF00);
kos_WriteTextToWindow (10,10,0x80,0x000000, "‚ë ¢ë¨£à «¨ ¬¨««¨®­!!!", 0); kos_WriteTextToWindow (10,10,0x80,0x000000, "‚ë ¢ë¨£à «¨ ¬¨««¨®­!!!", 0);
kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ¢ë室", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ¢ë室", 0);
} }
if (status==4){ //Çâîíîê äðóãó if (status==4){ //Çâîíîê äðóãó
kos_DrawBar(0,0,610,174,0xAAFFFF); kos_DrawBar(0,0,610,175,0xAAFFFF);
kos_WriteTextToWindow (10,10,0x80,0x000000, "„à㣠ᮢ¥âã¥â ¢ ¬ ®â¢¥â", 0); kos_WriteTextToWindow (10,10,0x80,0x000000, "„à㣠ᮢ¥âã¥â ¢ ¬ ®â¢¥â", 0);
kos_WriteTextToWindow (165,10,0x80,0x000000, friendsAdvice, 0); kos_WriteTextToWindow (165,10,0x80,0x000000, friendsAdvice, 0);
kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - ¯à®¤®«¦¨âì", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ENTER> - ¯à®¤®«¦¨âì", 0);
} }
if (status==5){ //Ïîäñêàçêà çàëà if (status==5){ //Ïîäñêàçêà çàëà
kos_DrawBar(0,0,610,174,0xAAFFFF); kos_DrawBar(0,0,610,175,0xAAFFFF);
kos_WriteTextToWindow (10,10,0x80,0x000000, "Œ­¥­¨¥  ã¤¨â®à¨¨ à á¯à¥¤¥«¨«®áì â ª:", 0); kos_WriteTextToWindow (10,10,0x80,0x000000, "Œ­¥­¨¥  ã¤¨â®à¨¨ à á¯à¥¤¥«¨«®áì â ª:", 0);
if (drawA==true){ if (drawA==true){
kos_WriteTextToWindow (10,30,0x80,0x000000, "Žâ¢¥â A: ", 0); kos_WriteTextToWindow (10,30,0x80,0x000000, "Žâ¢¥â A: ", 0);
@ -698,13 +688,13 @@ void draw_window(void){ //
} }
if (status==6){ //Âû çàáðàëè äåíüãè ;-) if (status==6){ //Âû çàáðàëè äåíüãè ;-)
kos_DrawBar(0,0,610,174,0xBBFFBB); kos_DrawBar(0,0,610,175,0xBBFFBB);
kos_WriteTextToWindow (10,10,0x80,0x000000, "‚ë § ¡à «¨ ¤¥­ì£¨ ¨ ã諨. ‚ è ¢ë¨£àëè á®áâ ¢¨«:", 0); kos_WriteTextToWindow (10,10,0x80,0x000000, "‚ë § ¡à «¨ ¤¥­ì£¨ ¨ ã諨. ‚ è ¢ë¨£àëè á®áâ ¢¨«:", 0);
kos_WriteTextToWindow (10,20,0x80,0x000000, summs[currentquestion-1], 0); kos_WriteTextToWindow (10,20,0x80,0x000000, summs[currentquestion-1], 0);
kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ¢ë室", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ¢ë室", 0);
} }
if (status==-1){ //Âû îøèáëèñü :-( if (status==-1){ //Âû îøèáëèñü :-(
kos_DrawBar(0,0,610,174,0xFF8888); kos_DrawBar(0,0,610,175,0xFF8888);
kos_WriteTextToWindow (10,10,0x80,0x000000, "Š ᮦ «¥­¨î, ¢ë ®è¨¡«¨áì... <20>à ¢¨«ì­ë© ®â¢¥â -", 0); kos_WriteTextToWindow (10,10,0x80,0x000000, "Š ᮦ «¥­¨î, ¢ë ®è¨¡«¨áì... <20>à ¢¨«ì­ë© ®â¢¥â -", 0);
switch (correctanswer){ switch (correctanswer){
@ -737,8 +727,6 @@ void draw_window(void){ //
kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ¢ë室", 0); kos_WriteTextToWindow (10,150,0x80,0x000000, "<ESC> - ¢ë室", 0);
} }
kos_WindowRedrawStatus(2);
} }
@ -970,6 +958,7 @@ void call_zal(){ //
void kos_Main(){ void kos_Main(){
rtlSrand(kos_GetSystemClock() / 10000); rtlSrand(kos_GetSystemClock() / 10000);
kos_InitHeap();
getFilePathName(); getFilePathName();
prepareFileData(); prepareFileData();
draw_window(); draw_window();