Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7483 → Rev 7484

/programs/games/rforces/trunk/kosSyst.h
10,14 → 10,16
#define FO_READ 0
#define FO_WRITE 2
 
//Process Events
#define EM_WINDOW_REDRAW 1
#define EM_KEY_PRESS 2
#define EM_BUTTON_CLICK 4
#define EM_APP_CLOSE 8
#define EM_DRAW_BACKGROUND 16
#define EM_MOUSE_EVENT 32
#define EM_IPC 64
#define EM_NETWORK 256
#define EM_BUTTON_CLICK 3
#define EM_APP_CLOSE 4
#define EM_DRAW_BACKGROUND 5
#define EM_MOUSE_EVENT 6
#define EM_IPC 7
#define EM_NETWORK 8
#define EM_DEBUG 9
 
#define KM_CHARS 0
#define KM_SCANS 1
27,6 → 29,25
 
#define PROCESS_ID_SELF -1
 
//Event mask bits for function 40
#define EVM_REDRAW 1b
#define EVM_KEY 10b
#define EVM_BUTTON 100b
#define EVM_EXIT 1000b
#define EVM_BACKGROUND 10000b
#define EVM_MOUSE 100000b
#define EVM_IPC 1000000b
#define EVM_STACK 10000000b
#define EVM_DEBUG 100000000b
#define EVM_STACK2 1000000000b
#define EVM_MOUSE_FILTER 0x80000000
#define EVM_CURSOR_FILTER 0x40000000
 
//Button options
#define BT_DEL 0x80000000
#define BT_HIDE 0x40000000
#define BT_NOFRAME 0x20000000
 
#define abs(a) (a<0?0-a:a)
 
 
/programs/games/rforces/trunk/properties.h
16,7 → 16,7
#define WHITE 0x00FFFFFF
 
// Visual properties
#define GAME_NAME "Rocket Forces v0.1 (F2 - new game, Esc - exit) "
#define GAME_NAME "Rocket Forces v1.12 (F2 - new game, Esc - exit) "
#define BG_COLOR BLACK
#define TEXT_COLOR WHITE
#define CUR_COLOR GREEN
/programs/games/rforces/trunk/rforces.cpp
39,15 → 39,16
Dword frame_start, frame_end;
OnStart();
Menu();
kos_SetMaskForEvents(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER);
for (;;)
{
frame_start = kos_GetTime();
switch (kos_CheckForEvent())
{
case 1:
case EM_WINDOW_REDRAW:
DrawWindow();
break;
case 2: // key pressed, read it and ignore
case EM_KEY_PRESS:
Byte keyCode;
kos_GetKey(keyCode);
if (keyCode == 27)
59,10 → 60,10
OnStart();
}
break;
case 3: // button pressed; we have only one button, close
case EM_BUTTON_CLICK: // button pressed; we have only one button, close
OnExit();
break;
case 6: // ñîáûòèå îò ìûøè (íàæàòèå íà êíîïêó ìûøè èëè ïåðåìåùåíèå; ñáðàñûâàåòñÿ ïðè ïðî÷òåíèè)
case EM_MOUSE_EVENT: // ñîáûòèå îò ìûøè (íàæàòèå íà êíîïêó ìûøè èëè ïåðåìåùåíèå; ñáðàñûâàåòñÿ ïðè ïðî÷òåíèè)
OnMouseMove();
if (ms.lbclick == 1)
{
69,9 → 70,6
OnLMBClick();
}
break;
default:
OnMouseMove();
break;
}
if (kos_GetButtonID(btn_id)) OnExit();
DrawBombs();
92,7 → 90,7
void DrawWindow()
{
kos_WindowRedrawStatus(1);
kos_DefineAndDrawWindow(10, 40, WINDOW_WIDTH + 8, WINDOW_HEIGHT + kos_GetSkinHeight(), 0x34, BG_COLOR, 0, 0, (Dword)header);
kos_DefineAndDrawWindow(10, 40, WINDOW_WIDTH + 8, WINDOW_HEIGHT + kos_GetSkinHeight() + 12, 0x34, BG_COLOR, 0, 0, (Dword)header);
kos_WindowRedrawStatus(2);
 
kos_WriteTextToWindow(8, 10, 0, TEXT_COLOR, "Population: %", 16);
368,7 → 366,6
rtlSrand(kos_GetTime());
 
DrawWindow();
kos_SetMaskForEvents(39);
}
 
void OnExit()