Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5473 → Rev 5474

/data/common/games/LaserTank/data.lvl
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/programs/games/LaserTank/trunk/LaserTank.cpp
44,6 → 44,7
#define FIELD_CRATER 25
 
char* header = "Laser Tank";
bool w_redraw = true;
 
struct Level
{
54,14 → 55,20
{
kos_Pause(time);
Byte keyCode;
Dword buttons;
int mX, mY;
for (int i = 0; i < 10; ++i)
{
kos_GetKey(keyCode);
kos_GetMouseState(buttons, mX, mY);
}
}
 
Level *levels;
int levelCount = 0;
int levelIndex = 0;
int levelPage = 0;
float clickTime = 0;
 
RGBA img_tank[576];
RGB img_water[576];
176,6 → 183,8
{
gameMode = mode;
draw_window();
 
pause(40);
}
 
bool IsWater(Point pos)
928,6 → 937,10
 
void key_press(int key)
{
sProcessInfo sPI;
kos_ProcessInfo(&sPI);
if (sPI.rawData[70] & 0x04)
return;
//rtlDebugOutString(ftoa(key));
switch (gameMode)
992,7 → 1005,7
case MODE_PAUSE:
if (key == 27)
SetMode(MODE_LEVELS);
else
if ((key == 32 || key == 13) && (gameStatus == GAME_NONE || (gameStatus == GAME_VICTORY && levelIndex < (levelCount - 1))))
{
if (gameStatus == GAME_VICTORY)
999,8 → 1012,8
openLevel(levelIndex + 1);
SetMode(MODE_GAME);
}
 
if (key == 114 || (gameStatus == GAME_DEFEAT && (key == 32 || key == 13)))
else
if (key == 114)
{
openLevel(levelIndex);
SetMode(MODE_GAME);
1147,8 → 1160,17
 
void draw_window(void)
{
if (w_redraw)
{
kos_WindowRedrawStatus(1);
kos_DefineAndDrawWindow(10, 40, 384 + 9, 384 + 25, 0x33, 0x444444, 0, 0, (Dword)header);
 
//kos_DefineAndDrawWindow(50, 50, 640, 506 - 22 + kos_GetSkinHeight(), 0x74, 0xEEEEEE, 0, 0, (Dword)windowTitle);
 
kos_DefineAndDrawWindow(10, 40, 384 + 9, 384 + 25, 0x74, 0x444444, 0, 0, (Dword)header);
kos_WindowRedrawStatus(2);
w_redraw = false;
}
 
Point level_pos = Point(0, 0);
switch (gameMode)
{
1251,7 → 1273,6
}
break;
}
kos_WindowRedrawStatus(2);
}
 
void LevelsLoad()
1449,6 → 1470,7
switch (kos_WaitForEvent())
{
case 1:
w_redraw = true;
draw_window();
break;
case 2:
/programs/games/LaserTank/trunk/image.cpp
115,7 → 115,7
 
alpha = (float)addPixel.a / 255.0f;
 
if (this->mode = DRAW_ALPHA)
if (this->mode == DRAW_ALPHA)
{
newPixel.r = di((double)(pixel.r * (1 - alpha) + addPixel.r * alpha));
newPixel.g = di((double)(pixel.g * (1 - alpha) + addPixel.g * alpha));
122,7 → 122,7
newPixel.b = di((double)(pixel.b * (1 - alpha) + addPixel.b * alpha));
}
else
if (this->mode = DRAW_ALPHA_ADD)
if (this->mode == DRAW_ALPHA_ADD)
{
newPixel.r = di(min(255, (double)(pixel.r * (1 - alpha) + addPixel.r * alpha)));
newPixel.g = di(min(255, (double)(pixel.g * (1 - alpha) + addPixel.g * alpha)));
/programs/games/LaserTank/trunk/smalllibc/func.h
3,7 → 3,7
 
#include "kosSyst.h"
#include "kosFile.h"
#include "mcsmemm.H"
#include "mcsmemm.h"
 
#include <stdarg.h>
 
/programs/games/LaserTank/trunk/smalllibc/kosSyst.cpp
315,7 → 315,6
kos_sysfunc4(arg2, textPtr, arg1, textLen);
}
 
 
// ôóíêöèÿ 5 ïàóçà, â ñîòûõ äîëÿõ ñåêóíäû
void kos_Pause( Dword value )
{
328,7 → 327,6
}
}
 
 
// ôóíêöèÿ 7 íàðèñîâàòü èçîáðàæåíèå
void kos_PutImage( RGB * imagePtr, Word sizeX, Word sizeY, Word x, Word y )
{
517,9 → 515,11
//
kos_ProcessInfo( &sPI );
//
int left = (int)((sPI.processInfo.x_size - 384) / 2);
int top = sPI.processInfo.y_size - 384 - left;
buttons = mB;
cursorX = curX - sPI.processInfo.x_start;
cursorY = curY - sPI.processInfo.y_start;
cursorX = curX - sPI.processInfo.x_start - left;
cursorY = curY - sPI.processInfo.y_start - top;
}