Fara: Exit when pressing 'X' button. Press enter to start game instead of stupid number buttons. Reduced flicker on window redraw.

git-svn-id: svn://kolibrios.org@4484 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2014-01-19 17:00:32 +00:00
parent af2492b78b
commit b90b0dc20e
8 changed files with 33 additions and 20 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1000,6 +1000,9 @@ int GameLoop()
{ {
switch ( buttonID ) switch ( buttonID )
{ {
case 1:
kos_ExitApp();
case 0xA: case 0xA:
result = GM_ABORT; result = GM_ABORT;
break; break;
@ -1427,7 +1430,7 @@ void DrawGameWindow()
kos_DefineAndDrawWindow( kos_DefineAndDrawWindow(
WNDLEFT, WNDTOP, WNDLEFT, WNDTOP,
gcx + 1, gcy + 21, gcx + 1, gcy + 21,
0x14, 0x0, 0x54, 0x0, // Skinned fixed size window, dont fill working area, window has caption
0, WNDHEADCOLOUR, 0, WNDHEADCOLOUR,
gameWndTitle gameWndTitle
); );

View File

@ -20,14 +20,12 @@ RGB bmPMButton[] = {
#if LANG == RUS #if LANG == RUS
char mainWndTitle[] = "PHARAON's CRYPT\0"; char mainWndTitle[] = "PHARAON's CRYPT\0";
char mainWndCopyright[] = "(C) MMVI by Rabid Rabbit"; char mainWndCopyright[] = "(C) MMVI by Rabid Rabbit";
char mainWndMenuStart[] = "1. <20> ç âì ¨£àã"; char mainWndMenuStart[] = "Enter -<2D><>碪 見飹";
char mainWndMenuExit[] = "2. ‚ë室";
char mainWndMenuLevel[] = "<EFBFBD> ç «ì­ë© ã஢¥­ì - %U"; char mainWndMenuLevel[] = "<EFBFBD> ç «ì­ë© ã஢¥­ì - %U";
#else #else
char mainWndTitle[] = "PHARAON's CRYPT\0"; char mainWndTitle[] = "PHARAOH's CRYPT\0";
char mainWndCopyright[] = "(C) MMVI by Rabid Rabbit"; char mainWndCopyright[] = "(C) MMVI by Rabid Rabbit";
char mainWndMenuStart[] = "1. Start game"; char mainWndMenuStart[] = "Enter - Start game";
char mainWndMenuExit[] = "2. Exit";
char mainWndMenuLevel[] = "Starting level - %U"; char mainWndMenuLevel[] = "Starting level - %U";
#endif #endif
// //
@ -75,11 +73,11 @@ int MainWndLoop()
// //
switch ( keyCode ) switch ( keyCode )
{ {
case '1': case 13: // enter
result = MW_START_GAME; result = MW_START_GAME;
break; break;
case '2': case 27: // escape
result = MW_EXIT_APP; result = MW_EXIT_APP;
break; break;
@ -96,6 +94,9 @@ int MainWndLoop()
switch ( buttonID ) switch ( buttonID )
{ {
// //
case 1:
result = MW_EXIT_APP;
break;
case BT_SIZE_X_MINUS: case BT_SIZE_X_MINUS:
if ( --startGameLevel < 1 ) if ( --startGameLevel < 1 )
startGameLevel = 1; startGameLevel = 1;
@ -151,7 +152,7 @@ void DrawMainWindow()
kos_DefineAndDrawWindow( kos_DefineAndDrawWindow(
WNDLEFT, WNDTOP, WNDLEFT, WNDTOP,
mcx + 1, mcy + 21, mcx + 1, mcy + 21,
0x14, 0x0, 0x54, 0x0, // Skinned fixed size window, dont fill working area, window has caption
0, WNDHEADCOLOUR, 0, WNDHEADCOLOUR,
mainWndTitle mainWndTitle
); );
@ -164,12 +165,6 @@ void DrawMainWindow()
0, 0x0, 0, 0x0,
mainWndMenuStart, sizeof(mainWndMenuStart)-1 mainWndMenuStart, sizeof(mainWndMenuStart)-1
); );
// âòîðàÿ ñòðîêà
kos_WriteTextToWindow(
8, 48,
0, 0x0,
mainWndMenuExit, sizeof(mainWndMenuExit)-1
);
// òðåòüÿ ñòðîêà // òðåòüÿ ñòðîêà
sprintf( line, mainWndMenuLevel, startGameLevel); sprintf( line, mainWndMenuLevel, startGameLevel);
kos_WriteTextToWindow( kos_WriteTextToWindow(

View File

@ -243,7 +243,7 @@ void DrawTop10Window()
kos_DefineAndDrawWindow( kos_DefineAndDrawWindow(
100, 100, 100, 100,
TOP10_WND_SIZE_X, TOP10_WND_SIZE_Y, TOP10_WND_SIZE_X, TOP10_WND_SIZE_Y,
0x14, 0, 0x34, 0, // Relative coordinates, Skinned fixed size window, window has caption
0, 0x2040A0, 0, 0x2040A0,
Top10WndTitle Top10WndTitle
); );
@ -254,7 +254,7 @@ void DrawTop10Window()
{ {
// //
kos_WriteTextToWindow( kos_WriteTextToWindow(
6, 21 + 2 + (i * 10), 6, 0 + 2 + (i * 10),
0x0, enterName != i ? 0xFFFFFF : 0x00FF00, 0x0, enterName != i ? 0xFFFFFF : 0x00FF00,
heroTbl[i].name, heroTbl[i].name,
sizeof( heroTbl[0].name ) sizeof( heroTbl[0].name )
@ -263,7 +263,7 @@ void DrawTop10Window()
kos_DisplayNumberToWindow( kos_DisplayNumberToWindow(
heroTbl[i].score, heroTbl[i].score,
8, 8,
112, 21 + 2 + (i * 10), 112, 0 + 2 + (i * 10),
0xFFFF55, 0xFFFF55,
nbDecimal, nbDecimal,
false false
@ -271,7 +271,7 @@ void DrawTop10Window()
} }
// //
kos_WriteTextToWindow( kos_WriteTextToWindow(
6, 21 + 6 + (i * 10), 6, 0 + 6 + (i * 10),
0x10, 0x1060D0, 0x10, 0x1060D0,
enterName >= 0 ? top10str1 : top10str2, enterName >= 0 ? top10str1 : top10str2,
enterName >= 0 ? sizeof(top10str1) - 1 : sizeof(top10str2) - 1 enterName >= 0 ? sizeof(top10str1) - 1 : sizeof(top10str2) - 1
@ -283,6 +283,7 @@ void DrawTop10Window()
void Top10Loop() void Top10Loop()
{ {
Byte keyCode; Byte keyCode;
Dword buttonID;
// //
SetUpTop10(); SetUpTop10();
@ -348,7 +349,21 @@ void Top10Loop()
} }
// //
break; break;
//
case 3:
if ( kos_GetButtonID( buttonID ) )
{
//
switch ( buttonID )
{
//
case 1:
kos_ExitApp();
default:
break;
}
}
default: default:
break; break;
} }