Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 5474 → Rev 5340

/programs/games/LaserTank/trunk/LaserTank.cpp
44,7 → 44,6
#define FIELD_CRATER 25
 
char* header = "Laser Tank";
bool w_redraw = true;
 
struct Level
{
55,20 → 54,14
{
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];
183,8 → 176,6
{
gameMode = mode;
draw_window();
 
pause(40);
}
 
bool IsWater(Point pos)
937,10 → 928,6
 
void key_press(int key)
{
sProcessInfo sPI;
kos_ProcessInfo(&sPI);
if (sPI.rawData[70] & 0x04)
return;
//rtlDebugOutString(ftoa(key));
 
switch (gameMode)
1005,7 → 992,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)
1012,8 → 999,8
openLevel(levelIndex + 1);
SetMode(MODE_GAME);
}
else
if (key == 114)
 
if (key == 114 || (gameStatus == GAME_DEFEAT && (key == 32 || key == 13)))
{
openLevel(levelIndex);
SetMode(MODE_GAME);
1160,17 → 1147,8
 
void draw_window(void)
{
if (w_redraw)
{
kos_WindowRedrawStatus(1);
 
//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;
}
 
kos_DefineAndDrawWindow(10, 40, 384 + 9, 384 + 25, 0x33, 0x444444, 0, 0, (Dword)header);
Point level_pos = Point(0, 0);
switch (gameMode)
{
1273,6 → 1251,7
}
break;
}
kos_WindowRedrawStatus(2);
}
 
void LevelsLoad()
1470,7 → 1449,6
switch (kos_WaitForEvent())
{
case 1:
w_redraw = true;
draw_window();
break;
case 2:
/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,6 → 315,7
kos_sysfunc4(arg2, textPtr, arg1, textLen);
}
 
 
// ôóíêöèÿ 5 ïàóçà, â ñîòûõ äîëÿõ ñåêóíäû
void kos_Pause( Dword value )
{
327,6 → 328,7
}
}
 
 
// ôóíêöèÿ 7 íàðèñîâàòü èçîáðàæåíèå
void kos_PutImage( RGB * imagePtr, Word sizeX, Word sizeY, Word x, Word y )
{
515,11 → 517,9
//
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 - left;
cursorY = curY - sPI.processInfo.y_start - top;
cursorX = curX - sPI.processInfo.x_start;
cursorY = curY - sPI.processInfo.y_start;
}
 
 
/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)));