Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 3131 → Rev 3132

/programs/games/kosilka/kosilka.cpp
1,6 → 1,6
/* ------- ÊÎÑÈËÊÀ ÄËß ÊÎËÈÁÐÈ -------
Èãðà ïèøåòñÿ íà C++ (èñïîëüçóåòñÿ MS Visual C++ 6.0).
Ýòî - èñõîäíèê âåðñèè 1.0.
Èãðà ïèøåòñÿ íà C++ (èñïîëüçóåòñÿ MS Visual C++ 6.0+).
Ýòî - èñõîäíèê âåðñèè 1.15.
Andrey Mihaylovich aka Dron2004
*/
9,6 → 9,7
 
#include "kosSyst.h"
#include "kosFile.h"
#include "images.cpp"
 
 
 
21,12 → 22,7
/////////////////
 
int lastkosilkadirection=1;
int laststep=0; //Ïîñëåäíèé õîä. Çäåñü
// 0 - íåò òàêîâîãî
// 1 - âíèç
// 2 - ââåðõ
// 3 - âëåâî
// 4 - âïðàâî
int laststep=0; //Ïîñëåäíèé õîä. 0-íåáûëî, 1-âíèç, 2-ââåðõ, 3-âëåâî, 4-âïðàâî
 
 
Byte skindata[13824];
35,7 → 31,7
bool w_redraw=true;
 
const char windowTitle[]="Š®á¨«ª  ¤«ï Š®«¨¡à¨";
const char version[]="‚¥àá¨ï 1.12";
const char version[]="‚¥àá¨ï 1.15";
int levelcount=7; //×èñëî óðîâíåé
 
char gamearea[20][20]; //Êàðòà
56,11 → 52,8
 
bool drawgraphics=true; //Ðèñîâàòü ëè äåòàëüíóþ ãðàôèêó (èëè îãðàíè÷èòüñÿ àñêåòè÷íîé)
bool drawanimation=true; //Àíèìèðîâàòü ëè
bool skinned=false;
int grassLeft(); //Ñîîáùèì î íàëè÷èè ôóíêöèè Grass Left
 
//Ãðàôèêà èãðû
 
RGB kosilka_d[576];
RGB kosilka_l[576];
RGB kosilka_r[576];
70,233 → 63,11
RGB tree[576];
RGB skos[576];
 
Byte kosilka_d1[]={0,1,2,3,4,5,5,6,6,6,5,5,5,5,5,6,5,5,5,4,2,2,1,7,1,2,4,6,21
,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,6,5,2,40,1,4,62,63,63,64,65,66,66
,67,66,66,66,66,68,66,66,63,69,65,65,62,4,1,2,6,75,91,64,65,67,92,75,75,75,75,75
,75,75,75,75,93,65,94,94,62,6,2,3,6,76,94,96,67,103,104,104,104,104,104,104,105
,106,107,108,109,93,63,64,75,6,3,3,21,75,94,94,67,115,104,104,104,104,105,105
,106,107,108,116,117,92,65,96,76,21,4,3,21,62,64,63,78,115,105,105,105,105,106
,107,108,116,116,119,120,92,65,96,77,6,3,4,6,62,96,69,67,123,106,106,107,107,108
,108,116,119,119,127,124,92,66,64,77,21,4,3,21,62,64,91,67,123,107,108,108,116
,116,119,119,127,127,127,124,75,69,64,77,21,4,4,6,62,64,69,68,123,108,116,119
,119,127,127,127,129,129,129,125,93,63,64,77,21,4,4,21,62,64,91,67,123,119,119
,127,127,129,129,129,129,129,129,125,68,94,64,77,6,4,3,21,62,64,94,63,122,128
,128,121,121,121,121,121,121,121,121,76,66,69,91,77,21,4,4,21,62,64,94,69,69,65
,66,67,68,68,67,68,67,67,66,66,69,91,64,77,21,4,4,21,76,96,64,94,94,64,94,96,69
,91,94,94,64,69,69,94,64,64,64,77,6,4,3,6,75,64,64,64,64,64,64,64,64,64,64,64,64
,64,64,64,64,64,96,75,21,4,3,6,16,94,64,64,64,64,64,64,64,64,64,64,64,64,64,64
,64,64,96,75,6,2,2,6,75,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62
,6,2,1,2,33,95,111,111,111,111,79,79,79,79,79,79,79,79,111,95,79,111,95,33,32,40
,7,42,49,44,47,72,44,47,80,49,45,72,45,70,47,47,47,46,71,45,44,49,50,15,15,43,45
,72,70,71,44,71,43,44,44,46,47,71,49,71,45,47,45,47,80,80,110,0,15,45,45,45,44
,44,72,72,70,45,44,71,46,71,80,44,45,47,44,71,72,71,45,9,14,45,47,72,46,73,45,47
,72,46,45,47,45,70,43,45,45,46,47,44,43,43,42,10,8,32,42,45,46,44,43,44,44,47,45
,45,49,44,46,46,45,44,45,44,45,42,41,9,10,114,36,36,12,10,12,14,9,11,10,36,13,11
,10,9,13,12,11,9,10,8,8,8
};
 
Byte kosilka_u1[]={8,9,9,10,9,11,12,13,9,10,11,13,8,10,11,9,14,12,10,12,14,8,11
,10,9,41,42,43,44,45,44,45,46,46,44,45,45,45,47,44,44,43,44,46,45,42,32,0,14,42
,45,43,44,47,46,45,45,43,70,45,71,45,46,72,47,45,73,46,44,71,45,14,11,45,71,72
,71,44,47,45,44,80,71,46,71,44,45,70,72,72,44,44,45,45,45,15,0,110,80,80,71,45
,47,45,71,49,71,47,46,44,44,43,71,44,71,70,72,43,71,15,15,50,49,44,45,71,46,47
,47,71,70,45,72,45,49,80,47,44,72,47,44,45,50,15,1,32,121,95,111,79,95,111,79,79
,79,79,79,79,79,79,111,111,111,111,95,121,3,1,2,5,62,96,64,64,64,64,64,64,64,64
,64,64,64,64,64,64,64,96,96,75,5,2,2,6,75,94,64,64,64,64,64,64,64,64,64,64,64,64
,64,64,64,64,96,76,6,3,4,21,75,96,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64
,64,94,76,6,3,4,21,77,64,64,64,94,69,69,64,94,94,91,69,64,94,64,94,94,64,64,16
,21,4,4,6,77,64,91,69,66,66,66,67,67,67,68,68,67,66,65,69,69,94,64,77,21,4
,4,21,77,64,69,66,76,121,121,121,121,121,121,121,121,128,128,122,63,94,64,62,21
,3,4,6,77,64,94,67,125,129,129,129,129,129,129,127,127,119,119,123,66,91,64,62
,21,4,4,21,77,64,63,92,125,129,129,129,127,127,127,119,119,116,108,123,68,69,64
,62,6,4,4,21,77,64,63,92,124,127,127,127,119,119,116,108,108,108,108,123,68,91
,64,62,21,3,4,21,77,91,66,92,124,127,119,119,116,108,108,107,107,106,106,123,67
,69,64,62,21,3,3,21,77,64,65,92,120,119,116,116,108,107,106,105,105,105,105,115
,93,63,64,62,6,3,4,21,75,64,65,92,117,116,108,107,106,105,105,105,104,104,104
,115,67,94,96,76,21,3,3,6,75,96,63,93,109,108,107,106,105,104,104,104,104,104
,104,136,67,96,94,76,6,3,2,6,62,94,94,65,93,75,75,75,75,75,75,75,92,75,93,67,65
,64,64,75,6,2,1,4,62,65,65,69,63,65,66,67,66,66,65,65,67,66,66,65,64,63,65,62,4
,1,1,2,6,6,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,6,4,2,1,7,1,2,2,4,5
,5,6,6,5,5,5,6,6,6,6,6,5,6,3,4,2,1,0
};
 
Byte kosilka_l1[]={10,8,14,15,15,15,1,2,3,2,4,4,3,3,4,3,3,3,3,3,2,1,1,0,11,48,49
,45,47,50,3,6,6,6,21,21,21,21,6,21,21,6,21,6,5,4,2,1,29,42,71,45,74,49,33,75,76
,76,76,62,62,62,62,62,62,62,76,76,75,62,4,2,14,70,72,45,72,44,95,96,94,94,94,96
,64,64,64,64,64,96,94,94,94,66,6,3,12,46,46,44,70,47,111,64,96,96,64,94,94,91,69
,91,69,63,94,96,64,63,21,4,10,44,73,44,71,72,111,64,64,64,94,69,63,66,68,67,67
,68,67,67,65,64,21,5,12,43,45,72,44,44,111,64,64,64,94,69,122,123,123,123,123
,115,115,103,67,63,21,6,14,44,47,72,71,47,111,64,64,64,64,65,128,119,116,107,106
,105,104,104,93,66,21,6,9,44,72,70,43,80,79,64,64,64,94,66,128,119,116,108,106
,105,104,104,75,66,21,6,11,47,46,45,44,49,79,64,64,64,64,67,121,127,116,108,107
,105,104,104,92,67,21,6,10,45,45,44,44,45,79,64,64,64,69,68,121,127,119,116,107
,106,104,104,75,66,21,6,8,49,47,71,46,72,79,64,64,64,91,68,121,129,127,116,108
,106,105,104,75,66,21,6,13,45,45,46,47,45,79,64,64,64,94,67,121,129,127,119,108
,107,105,104,75,66,21,4,11,44,70,71,71,70,79,64,64,64,94,67,121,129,127,119,116
,108,106,105,75,66,21,5,10,46,43,80,49,47,79,64,64,64,64,67,121,129,129,127,119
,108,107,106,75,67,21,4,9,46,45,44,71,47,79,64,64,64,69,67,121,129,129,127,119
,116,108,107,75,66,21,6,13,45,45,45,45,47,111,64,64,64,69,66,121,129,129,127,127
,119,116,108,75,66,21,6,12,44,46,47,47,46,95,64,64,64,94,66,76,125,125,124,124
,120,117,109,93,63,21,4,11,45,47,44,45,71,79,64,64,64,64,69,66,68,92,75,92,92,92
,93,65,69,21,6,9,44,44,71,47,45,111,64,64,64,64,91,69,94,63,69,66,65,65,63,94,65
,21,4,10,47,43,72,80,44,95,64,64,64,64,64,64,64,64,64,64,64,64,64,64,63,6,2,9,42
,45,47,80,45,121,62,75,75,77,77,77,77,77,77,77,77,75,75,62,75,5,2,0,48,42,45,71
,50,2,6,6,21,6,21,21,6,21,21,21,21,21,6,6,4,2,40,8,11,51,9,8,15,1,2,2,4,4,3,4,4
,4,4,4,3,3,3,2,1,1,7
};
 
Byte kosilka_r1[]={7,1,1,2,3,3,3,4,4,4,4,4,4,4,4,2,2,1,15,0,9,12,9,8,40,2,4,6,6
,21,21,21,21,21,6,21,21,6,4,1,15,51,52,53,47,45,23,9,2,6,62,62,75,75,77,77,77,77
,77,77,77,77,77,77,78,79,45,80,47,71,42,9,2,6,65,94,94,94,96,64,64,64,64,64,64
,96,64,64,64,95,44,72,44,43,45,10,4,21,65,94,63,65,65,66,69,63,94,69,91,64,64,64
,64,79,43,47,71,44,72,9,5,21,69,65,93,92,92,92,92,92,67,66,69,64,64,64,64,79,71
,45,44,47,43,11,5,21,63,93,109,117,120,124,124,125,125,76,66,94,64,64,64,95,46
,47,47,46,72,12,6,21,65,75,108,116,119,127,127,129,129,121,66,69,64,64,64,111,47
,45,45,45,45,13,6,21,66,75,107,108,116,119,127,129,129,121,66,69,64,64,64,79,47
,71,44,45,44,9,4,21,67,75,106,107,116,119,127,129,129,121,67,64,64,64,64,79,47
,49,80,43,44,10,5,21,66,75,105,106,108,116,119,127,129,121,67,94,64,64,64,79,70
,71,71,70,72,11,4,21,66,75,104,105,107,108,119,127,129,121,67,94,64,64,64,79,45
,47,46,45,45,13,6,21,66,75,104,105,106,108,116,127,129,121,68,91,64,64,64,79,72
,46,71,47,45,8,6,21,65,75,104,104,105,107,116,119,127,121,68,69,64,64,64,79,45
,44,44,45,45,10,6,21,67,75,104,104,105,107,108,116,127,121,67,64,64,64,64,79,49
,44,45,46,46,11,6,21,66,92,104,104,105,106,108,116,119,128,66,94,64,64,64,79,80
,43,70,72,72,9,6,21,66,92,104,104,105,106,107,108,119,128,65,64,64,64,64,111,47
,71,72,47,72,14,6,21,65,67,103,115,115,123,123,123,123,122,69,94,64,64,64,111,44
,44,72,45,47,12,5,21,64,65,67,67,93,68,68,93,66,63,69,94,64,64,64,111,72,71,44
,73,72,10,3,21,63,64,96,94,63,69,91,69,91,94,94,64,64,64,64,111,47,70,44,46,44
,12,4,6,63,64,64,64,64,64,64,64,64,64,64,64,64,64,64,95,44,72,45,72,45,14,2,4,62
,75,76,76,62,62,62,62,62,62,62,76,62,62,77,79,45,43,45,46,42,36,1,2,5,6,6,21,6
,21,21,6,21,21,21,21,6,6,6,37,52,46,45,45,20,11,0,40,40,2,3,4,4,3,3,4,4,2,4,4,3
,3,2,1,15,15,15,14,36,10
};
 
Byte skos1[]={13,14,14,14,12,11,10,14,11,14,10,9,13,13,13,14,9,13,8,12,13,11,14
,8,11,10,9,8,10,10,12,11,14,10,9,14,14,9,10,12,10,14,9,11,10,8,10,8,13,14,10,8
,10,10,13,13,10,11,11,10,8,14,12,13,9,12,12,12,9,9,9,12,8,13,9,13,8,14,13,8,12
,13,11,9,11,14,9,10,10,9,14,10,8,12,12,13,9,10,14,12,14,12,9,9,8,8,10,8,12,8,14
,13,13,14,8,10,9,10,10,9,13,9,8,9,8,12,12,9,14,14,10,14,14,14,14,9,12,14,12,14
,13,10,11,51,12,13,10,14,8,8,11,13,8,8,8,9,14,12,8,13,14,14,9,14,13,9,8,126
,12,8,10,11,10,8,14,14,10,8,12,12,13,12,9,13,10,14,13,11,12,9,11,12,13,13,11,13
,12,13,13,10,8,10,14,12,11,10,11,9,14,10,11,11,11,12,9,8,9,13,14,8,8,14,10,11,9
,14,13,9,10,11,12,8,11,8,8,13,9,12,9,10,10,11,12,8,10,11,9,9,10,10,14,14,8,14,8
,13,14,9,14,11,8,12,12,14,12,14,13,9,11,8,8,14,10,9,11,12,11,10,9,9,9,11,11,14
,10,11,14,11,9,8,12,12,9,14,14,10,14,14,14,14,9,12,14,12,14,13,10,11,10,10,10,10
,8,8,8,10,13,9,12,9,12,8,8,14,11,11,13,13,12,13,12,8,11,12,13,11,12,10,13,8,8,8
,10,9,11,13,14,12,14,12,12,12,8,14,12,13,10,10,8,14,11,13,14,11,9,10,12,13,8,10
,11,13,11,11,14,9,11,8,10,14,10,14,10,12,8,8,14,14,11,13,11,12,8,8,13,12,11,14,9
,13,11,8,12,10,10,8,12,12,51,10,9,8,9,13,10,14,8,14,8,9,9,14,8,10,14,13,8,11,8
,11,13,12,13,10,13,10,10,10,9,12,11,13,14,13,11,8,14,8,10,10,10,14,13,10,11,10
,11,13,13,12,12,9,11,12,8,13,9,10,14,10,9,9,9,13,12,12,11,8,13,13,36,13,9,10,13
,12,8,13,12,9,13,10,11,12,12,10,9,13,8,9,12,10,11,12,14,9,14,14,8,11,14,12,12,10
,11,9,8,8,14,14,11,13,11,12,8,8,13,12,8,8,10,13,14,10,11,8,8,8,11,11,14,11,12,10
,13,9,14,14,9,9,11,9,10,11,8,14,12,10,12,14,9,11,10,8,13,11,10,9,13,12,11,9,10,9
,9,8
};
 
Byte grass1[]={16,17,17,18,17,19,20,21,22,22,23,22,24,18,23,23,25,18,22,26,27,28
,28,18,20,24,28,54,55,19,54,56,24,20,54,24,24,20,24,20,20,24,27,24,17,54,54,24
,55,55,28,55,55,54,54,55,54,24,54,54,24,24,54,20,54,17,54,54,55,24,81,55,17,19
,17,27,81,27,54,19,17,54,41,18,24,24,81,23,19,55,18,27,24,97,20,54,19,112,55,81
,18,24,19,24,48,20,55,28,81,28,18,24,112,55,18,81,17,54,24,54,118,19,54,81,23,81
,55,41,26,23,26,26,41,20,26,55,19,81,18,17,28,54,19,28,55,54,17,22,17,55,17,17
,81,18,28,25,97,18,27,112,112,81,24,24,27,26,81,54,24,54,17,27,55,28,23,97,25,54
,28,23,26,26,22,112,55,97,24,28,27,26,16,55,17,27,54,18,19,54,23,16,97,20,54,25
,26,26,19,19,48,18,16,28,17,23,20,19,28,55,24,20,19,28,20,48,23,33,19,97,26,26
,55,54,18,26,25,19,28,26,28,17,27,55,81,23,19,19,18,20,24,41,54,22,26,81,17,27
,17,25,26,28,24,48,22,27,26,55,54,55,55,28,16,33,5,24,41,18,48,55,19,48,97,16,26
,27,48,33,23,97,22,28,19,54,48,81,21,6,21,41,26,33,33,28,54,20,16,48,18,26,33,16
,48,23,17,19,112,26,23,48,21,21,131,48,26,33,97,17,17,20,16,25,97,16,16,26,21,20
,19,112,54,26,26,21,20,41,6,33,16,25,33,55,19,16,41,25,48,16,26,48,97,24,55,54
,24,24,23,21,23,97,48,21,33,24,6,54,54,132,54,18,16,97,28,26,22,28,27,54,20,16
,23,33,22,16,26,48,17,20,33,54,24,19,20,25,97,48,54,54,26,27,20,20,41,21,97,6,33
,23,26,48,19,17,48,24,23,24,27,16,18,16,55,55,19,26,27,54,48,21,24,48,23,33,25
,33,28,23,97,97,6,16,16,20,25,48,17,48,97,22,27,24,20,48,22,17,27,48,48,16,22,25
,24,41,33,25,25,54,23,97,17,18,27,22,97,24,20,18,23,27,17,23,48,25,23,97,27,97
,18,26,18,22,26,18,19,17,28,26,23,17,81,97,25,81,27,24,6,97,48,18,97,16,16,81,33
,18,22,26,24,17,27,23,26,17,27,23,26,26,54,41,33,18,97,22,18,22,48,18,16,97,22
,18,18,27,27,26,48,27,17,97,18,27,55,21,20,26,23,26,27,27,22,26,16,23,22,26,27
,140,19,20
};
 
Byte stone1[]={13,14,14,29,30,31,31,31,30,3,32,33,32,34,35,36,9,13,8,12,13,11,14
,8,11,10,36,30,31,57,58,57,31,59,59,59,59,31,31,30,32,29,11,11,10,8,10,8,13,8,30
,31,58,82,83,82,82,83,84,84,85,84,83,58,59,30,30,51,9,9,9,12,8,98,30,57,99,83,83
,83,83,84,84,85,100,73,49,74,73,82,31,30,8,12,12,13,9,0,30,57,82,83,83,83,83,84
,84,85,85,73,49,74,113,74,84,59,30,114,10,9,12,0,30,59,58,82,83,83,83,83,84,85
,85,73,49,74,74,113,113,83,31,30,11,10,12,13,30,30,57,99,82,83,83,83,84,84,85
,100,49,49,74,113,113,74,99,30,29,13,12,8,0,30,57,82,83,83,83,83,83,84,85,100,73
,49,74,113,113,113,85,31,40,12,13,13,1,30,99,83,83,83,83,83,83,84,84,85,73,49,74
,74,113,113,74,57,32,8,9,13,30,59,82,83,82,83,83,83,83,83,84,85,100,73,49,74,74
,113,113,57,5,51,10,0,30,57,82,82,83,83,83,83,83,83,84,85,85,73,49,74,74,113,113
,58,130,11,12,29,30,57,82,82,83,83,83,83,83,83,83,84,85,100,73,49,74,74,74,99,30
,11,9,29,30,57,82,82,83,83,83,83,83,83,83,84,84,85,73,49,49,74,74,82,30,0,8,8,30
,31,99,82,82,83,83,83,83,83,83,83,84,85,100,73,49,74,74,83,31,15,12,10,15,30,58
,82,82,82,83,83,83,83,83,83,84,84,85,100,73,49,74,84,31,1,11,13,7,30,58,82,82,82
,82,82,82,83,83,82,83,84,85,85,100,73,49,84,31,15,8,8,7,30,58,82,82,82,82,82,82
,82,82,82,83,84,84,85,85,73,73,82,30,35,10,10,35,30,57,82,82,82,82,82,82,82,82
,83,82,83,84,84,85,85,85,59,30,51,13,10,133,30,59,99,99,82,82,82,82,82,82,82,83
,82,83,84,84,84,57,30,35,10,11,13,13,1,31,58,82,99,82,82,82,99,58,58,82,82,83,83
,99,57,31,40,13,13,8,13,9,0,30,59,99,99,99,99,99,58,59,59,57,57,57,59,31,30,15
,10,11,12,14,9,14,14,15,30,31,58,58,58,57,30,30,30,30,30,30,32,1,37,8,8,13,12,8
,8,10,13,14,35,30,30,31,30,30,30,8,0,37,0,133,9,14,14,9,9,11,9,10,11,8,14,12,10
,37,40,32,1,35,8,13,11,10,9,13,12,11,9,10,9,9,8
};
 
Byte tree1[]={13,14,8,36,37,11,10,36,38,39,0,14,13,13,13,14,9,13,8,12,13,11,14,8
,11,36,39,39,39,34,38,39,60,61,60,39,34,0,37,37,14,36,15,36,14,8,10,8,11,86,60
,87,61,60,88,61,89,90,89,61,60,88,39,86,39,88,88,88,39,15,9,12,34,88,87,89,89
,101,89,89,89,89,89,89,101,61,61,90,89,89,102,87,60,39,37,13,34,60,89,89,89,89
,89,89,89,89,89,89,89,89,89,89,89,89,89,89,102,88,7,11,15,88,102,101,89,89,89,89
,89,89,101,89,89,101,89,89,89,89,89,89,101,60,34,51,8,39,60,102,89,89,89,89,89
,90,102,101,89,101,101,89,89,89,89,89,101,60,39,51,37,34,60,90,101,89,89,101,89
,101,101,89,89,89,89,89,89,89,89,89,89,87,88,15,37,60,89,89,89,89,101,90,89,89
,89,89,89,89,89,89,89,89,89,89,89,101,102,88,39,102,89,89,89,89,101,90,89,89,89
,89,89,89,101,101,101,101,89,89,89,89,89,61,32,102,89,89,89,89,101,90,90,101,89
,89,89,101,87,101,89,89,89,89,89,89,89,102,39,61,89,89,89,89,89,89,101,102,101
,89,89,90,89,89,89,89,89,89,89,89,89,90,9,39,61,101,89,89,89,89,101,102,102,89
,101,101,89,89,89,89,89,89,89,89,89,102,36,34,88,102,89,89,89,89,89,101,101,89
,89,89,89,89,89,89,89,89,89,101,90,60,8,39,60,101,89,89,89,89,89,89,89,89,89,89
,89,89,89,89,89,89,89,101,101,60,34,88,101,89,89,89,89,89,89,89,89,89,89,89,89
,89,89,89,89,101,101,89,89,102,34,60,89,89,89,89,89,89,89,89,89,89,89,89,89,89
,89,89,101,90,101,89,89,101,34,88,87,89,89,101,89,89,89,89,90,102,89,89,89,89,89
,89,89,89,101,89,89,102,37,32,60,102,87,87,89,89,89,134,135,135,101,89,89,89,89
,89,89,89,101,102,102,60,11,51,37,38,34,88,61,102,61,39,137,131,134,101,101,101
,102,90,89,89,102,60,39,37,8,51,11,37,37,0,39,39,32,15,137,137,138,60,61,60,88
,88,102,102,60,39,40,10,11,9,14,8,8,36,40,36,51,51,137,137,137,34,39,34,29,38,39
,39,32,15,13,12,8,8,10,51,14,37,37,8,8,8,137,137,137,8,9,139,51,8,7,7,14,11,11,9
,10,11,8,14,51,10,12,14,11,11,137,137,137,11,10,9,13,51,14,11,51,9,9,8
};
 
 
//Ïàëèòðà öâåòîâ. Äåêîäèðóåì â 0xRRGGBB
 
char * apppath;
char * levpath;
char * getSkinPathName(){
 
int lastslashindex=0;
static char skinfilename[]="kosskin.gfx";
int tempslfnd=0;
 
for (tempslfnd=0; tempslfnd < strlen(kosExePath); tempslfnd++){
if (kosExePath[tempslfnd]=='/'){lastslashindex=tempslfnd;}
}
 
apppath = new char[lastslashindex+strlen(skinfilename)+1];
 
for (tempslfnd=0; tempslfnd <= lastslashindex; tempslfnd++){
apppath[tempslfnd]=kosExePath[tempslfnd];
}
for (tempslfnd=0; tempslfnd < strlen(skinfilename); tempslfnd++){
apppath[tempslfnd+lastslashindex+1]=skinfilename[tempslfnd];
}
 
return apppath;
 
}
 
char * getLevelsPathName(){
 
int lastslashindex=0;
317,38 → 88,9
}
 
return levpath;
 
}
 
 
void decode_graphics(Byte * source, RGB * target){
static const char palette[] = {
0x31,0x8A,0x97,0x2E,0x7F,0x8B,0x2B,0x7B,0x86,0x2B,0x76,0x82,0x28,0x74,0x7F,0x2B,0x70,0x79,0x26,0x6C,0x76,0x2E,0x83,0x90,
0x2F,0x8A,0x97,0x31,0x8C,0x9A,0x32,0x8D,0x9B,0x31,0x8C,0x99,0x33,0x8E,0x9C,0x34,0x8F,0x9D,0x30,0x8B,0x98,0x31,0x85,0x92,
0x32,0x75,0x88,0x54,0xA4,0xBA,0x3D,0x8C,0xA1,0x6A,0xB2,0xC6,0x46,0x8E,0xA0,0x26,0x5F,0x6B,0x44,0x98,0xAF,0x3B,0x87,0x9C,
0x4D,0x96,0xAB,0x38,0x83,0x98,0x40,0x91,0xA8,0x4C,0x9D,0xB4,0x5C,0xAC,0xC1,0x2F,0x87,0x94,0x30,0x30,0x30,0x35,0x34,0x34,
0x33,0x79,0x82,0x2F,0x6E,0x80,0x34,0x81,0x8B,0x32,0x86,0x93,0x2F,0x89,0x96,0x33,0x8C,0x98,0x3B,0x87,0x8F,0x39,0x9F,0x7E,
0x2D,0x81,0x8E,0x3F,0x80,0x92,0x5C,0x71,0x75,0x62,0x64,0x67,0x68,0x6A,0x6D,0x60,0x62,0x66,0x66,0x68,0x6B,0x64,0x66,0x6A,
0x35,0x7B,0x8E,0x61,0x61,0x62,0x41,0x76,0x79,0x33,0x8E,0x9B,0x54,0x79,0x7F,0x67,0x6A,0x77,0x55,0x9E,0xB2,0x5E,0xA7,0xBC,
0x3E,0x8C,0x97,0x3D,0x3E,0x3E,0x45,0x42,0x43,0x38,0x39,0x37,0x37,0x97,0x3C,0x37,0x94,0x20,0x34,0x79,0xB9,0x3E,0x86,0xE6,
0x41,0x8C,0xF2,0x3D,0x83,0xE2,0x3B,0x80,0xDD,0x3A,0x7C,0xD7,0x38,0x79,0xD1,0x3F,0x88,0xEA,0x5B,0x5D,0x60,0x63,0x65,0x68,
0x6B,0x6D,0x70,0x5E,0x5F,0x5F,0x66,0x65,0x65,0x31,0x69,0xB5,0x3B,0x66,0xAC,0x36,0x7D,0xC1,0x38,0x83,0xC8,0x46,0x72,0x99,
0x71,0x72,0x73,0x46,0x95,0xA8,0x4E,0x4D,0x4D,0x52,0x51,0x51,0x56,0x56,0x56,0x59,0x5A,0x5A,0x41,0x7B,0x68,0x33,0x89,0x09,
0x38,0x9B,0x5B,0x36,0x90,0x00,0x36,0x91,0x06,0x41,0x8B,0xF1,0x34,0x70,0xC2,0x37,0x77,0xCD,0x40,0x8A,0xEE,0x4B,0x77,0xA0,
0x41,0x8C,0xF1,0x37,0x80,0x94,0x34,0x8B,0x98,0x4A,0x48,0x49,0x5D,0x5D,0x5D,0x36,0x90,0x03,0x36,0x92,0x0E,0x7B,0x6B,0xB0,
0xF8,0x9C,0x94,0xF6,0x85,0x7C,0xF5,0x74,0x6A,0xF4,0x66,0x5A,0xF1,0x53,0x46,0xB6,0x53,0x5F,0x62,0x64,0x72,0x49,0x74,0x9C,
0x72,0xC4,0xD0,0x69,0x69,0x69,0x32,0x8B,0x99,0x76,0x66,0x9D,0xDD,0x47,0x3B,0xA0,0x49,0x53,0x77,0xCD,0xD8,0xC1,0x3E,0x34,
0x8C,0x43,0x4F,0x38,0x55,0x8E,0x41,0x73,0xC3,0x71,0x5D,0x89,0x74,0x3B,0x48,0x59,0x33,0x43,0x34,0x8D,0x9C,0x9A,0x32,0x2A,
0x49,0x5F,0x99,0x6D,0x23,0x1D,0x37,0x6E,0x75,0x19,0x48,0x52,0x48,0x88,0x8D,0x34,0x8D,0x9B,0x2F,0x7F,0x15,0x28,0x6C,0x2D,
0x8B,0x77,0xAA,0x15,0x3C,0x66,0x24,0x59,0x4E,0x31,0x8F,0x9D,0x48,0xAD,0xBC
};
 
for (int lc=0;lc<576;lc++)
target[lc] = ((RGB*)palette)[source[lc]];
}
 
 
void interlevelpause(){ //Ïàóçà ìåæäó óðîâíÿìè
Byte tempCode;
RGB tmprgb;
357,13 → 99,13
static int yellow_pal[] = {0xA8A93D,0xBEBF4C,0xD6D856,0xDFE15A,0xECEE5B,
0xECEE5B,0xDFE15A,0xD6D856,0xBEBF4C,0xA8A93D};
for (int iic=0;iic<240;iic++){
kos_WaitForEvent(1);
kos_WaitForEvent(); //Pause()?
kos_GetKey(tempCode);
 
kos_DrawBar(iic*2,0,2,480,yellow_pal[tmpa]);
 
tmpa++;
if (tmpa>9){tmpa=0;}
if (tmpa>9) tmpa=0;
}
}
 
395,8 → 137,6
kos_PutImage((RGB*)kosilka_r,24,24,elx*24,ely*24);
break;
}
 
 
}
else
{
404,7 → 144,6
}
 
 
break;
case 'n':
if (drawgraphics==true){
440,7 → 179,6
 
 
break;
 
}
 
}
508,20 → 246,16
}
break;
}
 
}
 
 
void draw_window(void){ //Ïåðåðèñîâêà îêíà
//----Leency
sProcessInfo sPI;
if (w_redraw)
{
kos_WindowRedrawStatus(1); //Íà÷àëî ïåðåðèñîâêè
//kos_DefineAndDrawWindow(50,50,640,506,0x74,0xEEEEEE,0,0,(Dword)windowTitle);
kos_DefineAndDrawWindow(50,50,640,506-22+kos_GetSkinWidth(),0x74,0xEEEEEE,0,0,(Dword)windowTitle);
kos_DefineAndDrawWindow(50,50,640,506-22+kos_GetSkinHeight(),0x74,0xEEEEEE,0,0,(Dword)windowTitle);
kos_WindowRedrawStatus(2); //Êîíåö ïåðåðèñîâêè
}
w_redraw=false;
534,8 → 268,8
{
kos_DrawBar(631-151,0,151,480,0xEEEEEE);
 
kos_WriteTextToWindow(505,30,0x80, 0 ,"Š Ž ‘ ˆ ‹ Š €",19);
kos_WriteTextToWindow(522,40,0x80, 0 ,"¤«ï Š®«¨¡à¨ Ž‘",14);
kos_WriteTextToWindow(500,30,0x80, 0 ,"Š Ž ‘ ˆ ‹ Š €",19);
kos_WriteTextToWindow(517,40,0x80, 0 ,"¤«ï Š®«¨¡à¨ Ž‘",14);
 
kos_WriteTextToWindow(495,80,0x80, 0 ,"“஢¥­ì:",6);
kos_DisplayNumberToWindow(level,3,605,80,0x0000FF,nbDecimal,false);
586,7 → 320,7
kos_DrawBar(335,150,24,24,0xAA0000);
}
 
kos_WriteTextToWindow(257,200,0x80, 0xFFFFFF ,"Š Ž ‘ ˆ ‹ Š €",19);
kos_WriteTextToWindow(255,200,0x80, 0xFFFFFF ,"Š Ž ‘ ˆ ‹ Š €",19);
kos_WriteTextToWindow(290, 220,0x80, 0xFFFFFF ,"¤«ï Š®«¨¡à¨ Ž‘",14);
kos_WriteTextToWindow(239, 240,0x80, 0xFFFFFF ,"<¤«ï ­ ç «  ¨£àë ­ ¦¬¨â¥ ENTER>",30);
kos_WriteTextToWindow(30, 380,0x80, 0xFFFFFF ,"<­ ¦¬¨â¥ <g> ¤«ï ¯¥à¥ª«î祭¨ï ०¨¬  £à ä¨ª¨>",53);
987,7 → 721,6
//Ìåíÿåì óðîâåíü èëè âûâîäèì ñîîáùåíèå î òîì, ÷òî âñå óðîâíè ïðîéäåíû
void updateStatus(){
 
if (grassLeft()==0) {
if (level==levelcount){
gamestarted=false;
1006,88 → 739,6
 
 
 
 
void decode_skin(){
int currentbyte3x=0;
RGB tmpRGB;
int tmpcc1=0;
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
kosilka_d[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
kosilka_u[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
kosilka_l[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
kosilka_r[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
skos[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
grass[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
stone[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
for (tmpcc1=0;tmpcc1<576;tmpcc1++){
 
tmpRGB.r= skindata[currentbyte3x];
tmpRGB.g= skindata[currentbyte3x+1];
tmpRGB.b= skindata[currentbyte3x+2];
tree[tmpcc1]=tmpRGB;
currentbyte3x+=3;
}
 
}
 
 
 
void load_external_levels(){
 
CKosFile lev(getLevelsPathName());
1094,26 → 745,18
 
level_read_result=lev.Read (external_levels_count,1);
 
if (level_read_result == 1){
if (level_read_result == 1)
external_levels_available=true;
}
else
{
external_levels_available=false;
};
 
 
if (external_levels_count[0]==0){
if (external_levels_count[0]==0)
external_levels_available=false;
}
else
{
externallevels = new Byte[400*external_levels_count[0]];
lev.Read (externallevels,400*external_levels_count[0]);
}
 
 
}
 
void app_halt(){
1122,44 → 765,23
delete levpath;
if (external_levels_available==true) {delete externallevels;}
kos_ExitApp();
 
}
 
 
 
void kos_Main(){
 
load_external_levels();
 
CKosFile skin(getSkinPathName());
decode_graphics(576*0 + kosilka_gfx,kosilka_d);
decode_graphics(576*1 + kosilka_gfx,kosilka_u);
decode_graphics(576*2 + kosilka_gfx,kosilka_l);
decode_graphics(576*3 + kosilka_gfx,kosilka_r);
decode_graphics(576*4 + kosilka_gfx,skos);
decode_graphics(576*5 + kosilka_gfx,stone);
decode_graphics(576*6 + kosilka_gfx,tree);
decode_graphics(576*7 + kosilka_gfx,grass);
read_result=skin.Read (skindata,13824);
if (read_result != 13824){
skin_available=false;
}
else
{
skin_available=true;
};
 
if (skin_available==false){
decode_graphics(kosilka_d1,kosilka_d);
decode_graphics(kosilka_u1,kosilka_u);
decode_graphics(kosilka_l1,kosilka_l);
decode_graphics(kosilka_r1,kosilka_r);
decode_graphics(skos1,skos);
decode_graphics(stone1,stone);
decode_graphics(tree1,tree);
decode_graphics(grass1,grass);
skinned=false;
}
else
{
decode_skin();
skinned=true;
}
 
draw_window();
 
for (;;){
 
switch (kos_WaitForEvent()){
1367,29 → 989,6
draw_window();
}
 
if (keyCode==115){
if (skin_available==true){
if (skinned==true){
skinned=false;
decode_graphics(kosilka_d1,kosilka_d);
decode_graphics(kosilka_u1,kosilka_u);
decode_graphics(kosilka_l1,kosilka_l);
decode_graphics(kosilka_r1,kosilka_r);
decode_graphics(skos1,skos);
decode_graphics(stone1,stone);
decode_graphics(tree1,tree);
decode_graphics(grass1,grass);
} else {
skinned=true;
decode_skin();
}
 
draw_window();
 
}
 
}
if (keyCode==27){
app_halt();
}
1451,10 → 1050,6
}
}
 
//Âûâîäèì êîä íàæàòîé êëàâèøè. Ôè÷à âðåìåííàÿ
/* kos_DrawBar(20,250,150,10,0xEEEEEE);
kos_WriteTextToWindow(20,250,0x80, 0 ,"Button",0);
kos_DisplayNumberToWindow(keyCode,3,70,250,0x0000FF,nbDecimal,false); */
break;
case 3:
1464,4 → 1059,4
}
}
 
// Êîíåö èñõîäíèêà ;-)
// Êîíåö èñõîäíèêà