added Game Options Menu + Player Plate

master
Sylvain PILLOT 6 months ago
parent ea81ccb330
commit d73a41fa99
  1. 3
      CMakeLists.txt
  2. 120
      CppOutRun.layout
  3. BIN
      assets-cg/fonts/__pycache__/make_grid.cpython-38.pyc
  4. 2
      assets-cg/fonts/createfont.py
  5. 10
      assets-cg/fonts/fxconv-metadata.txt
  6. BIN
      assets-cg/fonts/plate5.png
  7. BIN
      assets-cg/fonts/speedfont.png
  8. BIN
      assets-cg/player/player.png
  9. 1
      src/include/drawstuff.h
  10. 2
      src/include/menus.h
  11. 23
      src/main.cc
  12. 5
      src/src/drawstuff.cc
  13. 323
      src/src/menus.cc

@ -89,7 +89,8 @@ set(ASSETS_cg
assets-cg/fonts/auto15.png
assets-cg/fonts/auto20.png
assets-cg/fonts/startseq.png
assets-cg/fonts/plate5.png
assets-cg/menus/flag.png
assets-cg/menus/bigflag.png

@ -2,19 +2,24 @@
<CodeBlocks_layout_file>
<FileVersion major="1" minor="0" />
<ActiveTarget name="Release" />
<File name="src/include/drawstuff.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/camera.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="637" topLine="0" />
<Cursor1 position="221" topLine="0" />
</Cursor>
</File>
<File name="src/parameters.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/colors.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="559" topLine="0" />
<Cursor1 position="35" topLine="0" />
</Cursor>
</File>
<File name="src/src/segment.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
<File name="src/include/clouds.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="230" topLine="30" />
<Cursor1 position="306" topLine="0" />
</Cursor>
</File>
<File name="src/src/menus.cc" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="20917" topLine="638" />
</Cursor>
</File>
<File name="src/src/cars.cc" open="0" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -22,84 +27,84 @@
<Cursor1 position="1019" topLine="8" />
</Cursor>
</File>
<File name="src/src/drawstuff.cc" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/clouds.cc" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2603" topLine="18" />
<Cursor1 position="203" topLine="0" />
</Cursor>
<Folding>
<Collapse line="9" />
<Collapse line="33" />
<Collapse line="40" />
<Collapse line="46" />
<Collapse line="76" />
<Collapse line="126" />
</Folding>
</File>
<File name="src/colors.h" open="0" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/segment.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="2" zoom_2="0">
<Cursor>
<Cursor1 position="35" topLine="0" />
<Cursor1 position="230" topLine="30" />
</Cursor>
</File>
<File name="CMakeLists.txt" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/parameters.h" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2421" topLine="36" />
<Cursor1 position="559" topLine="0" />
</Cursor>
</File>
<File name="src/include/menus.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/drawstuff.h" open="0" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="390" topLine="0" />
<Cursor1 position="637" topLine="0" />
</Cursor>
</File>
<File name="src/src/circuit.cc" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/circuit.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="21787" topLine="506" />
<Cursor1 position="1291" topLine="0" />
</Cursor>
</File>
<File name="src/src/drawstuff.cc" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="2603" topLine="18" />
</Cursor>
<Folding>
<Collapse line="606" />
<Collapse line="622" />
<Collapse line="647" />
<Collapse line="657" />
<Collapse line="702" />
<Collapse line="738" />
<Collapse line="748" />
<Collapse line="795" />
<Collapse line="830" />
<Collapse line="868" />
<Collapse line="905" />
<Collapse line="1197" />
<Collapse line="1204" />
<Collapse line="1214" />
<Collapse line="1224" />
<Collapse line="9" />
<Collapse line="33" />
<Collapse line="40" />
<Collapse line="46" />
<Collapse line="76" />
<Collapse line="126" />
</Folding>
</File>
<File name="src/main.cc" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="18105" topLine="633" />
<Cursor1 position="24886" topLine="745" />
</Cursor>
</File>
<File name="src/include/clouds.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/menus.h" open="1" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="306" topLine="0" />
<Cursor1 position="390" topLine="0" />
</Cursor>
</File>
<File name="src/src/camera.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/circuit.cc" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="370" topLine="0" />
<Cursor1 position="10565" topLine="282" />
</Cursor>
<Folding>
<Collapse line="588" />
<Collapse line="604" />
<Collapse line="629" />
<Collapse line="639" />
<Collapse line="684" />
<Collapse line="720" />
<Collapse line="730" />
<Collapse line="777" />
<Collapse line="812" />
<Collapse line="850" />
<Collapse line="887" />
<Collapse line="1179" />
<Collapse line="1186" />
<Collapse line="1196" />
<Collapse line="1206" />
</Folding>
</File>
<File name="TODO.txt" open="0" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="251" topLine="0" />
</Cursor>
</File>
<File name="src/include/circuit.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1291" topLine="0" />
</Cursor>
</File>
<File name="src/src/clouds.cc" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="CMakeLists.txt" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="203" topLine="0" />
<Cursor1 position="2421" topLine="36" />
</Cursor>
</File>
<File name="src/fixed.h" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -107,24 +112,19 @@
<Cursor1 position="5" topLine="0" />
</Cursor>
</File>
<File name="src/src/menus.cc" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="20917" topLine="638" />
</Cursor>
</File>
<File name="src/include/segment.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="252" topLine="9" />
</Cursor>
</File>
<File name="src/include/camera.h" open="0" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/include/cars.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="221" topLine="0" />
<Cursor1 position="332" topLine="0" />
</Cursor>
</File>
<File name="src/include/cars.h" open="0" top="0" tabpos="4" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<File name="src/src/camera.cc" open="0" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="332" topLine="0" />
<Cursor1 position="370" topLine="0" />
</Cursor>
</File>
</CodeBlocks_layout_file>

@ -1,3 +1,3 @@
from make_grid import *
make_grid(16, 18)
make_grid(5, 5)

@ -26,3 +26,13 @@ startseq.png:
charset: print
grid.size: 70x93
plate5.png:
name: plate
type: font
charset: print
grid.size: 5x5
grid.padding: 1
grid.border: 0
proportional: true
height: 5

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 10 KiB

@ -13,3 +13,4 @@ void drawSky( uint8_t R, uint8_t G, uint8_t B );
void drawSky( int ymin, int ymax );
void drawSkyOptimised( uint16_t color );
void drawSkyQuick( uint16_t color );

@ -17,6 +17,8 @@ void getInputCredit( void );
void drawOptions( void );
void getInputOptions( void );
void drawGameOptions( void );
void getInputGameOptions( void );
void drawPauseQuit( void );
void getInputPauseQuit( void );

@ -29,7 +29,7 @@
#include <stdio.h>
extern bopti_image_t player;
extern font_t speedfont, startseq;
extern font_t speedfont, startseq, plate;
extern bopti_image_t speedhud;
extern bopti_image_t flag, bigflag;
@ -42,6 +42,10 @@ int MAX_SEGMENT=0;
camera *cam;
uint8_t DiffLevel = 1;
uint8_t CarsNumb = 1;
char PlayerName[3] = "SLY";
struct DataPerf
{
uint8_t update=0;
@ -389,13 +393,17 @@ int main(void)
}
else if (stage==2)
{
drawOptions();
drawGameOptions();
}
else if (stage==3)
{
drawCredit();
drawOptions();
}
else if (stage==4)
{
drawCredit();
}
else if (stage==5)
{
exitToOS = true;
exitflag=true;
@ -603,7 +611,8 @@ int main(void)
//if (BDrawBack) drawSkyOptimised( DAY_BLUE_SKY );
//else drawSkyFull( DAY_BLUE_SKY );
drawSkyFull( DAY_BLUE_SKY );
//drawSkyFull( DAY_BLUE_SKY );
drawSkyQuick( DAY_BLUE_SKY );
if (BDrawClds)
@ -702,6 +711,12 @@ int main(void)
else if (viewside==2) dsubimage( SCREEN_CX-40, SCREEN_HEIGHT-46, &player, 407,49,80,46, DIMAGE_NONE);
}
dfont(&plate);
if (viewside==-2) dprint_opt( 205, 203, C_WHITE, C_BLACK, DTEXT_CENTER, DTEXT_CENTER, "%c%c%c", PlayerName[0], PlayerName[1], PlayerName[2] );
else if (viewside==-1) dprint_opt( 202, 203, C_WHITE, C_BLACK, DTEXT_CENTER, DTEXT_CENTER, "%c%c%c", PlayerName[0], PlayerName[1], PlayerName[2] );
else if (viewside==0) dprint_opt( 197, 203, C_WHITE, C_BLACK, DTEXT_CENTER, DTEXT_CENTER, "%c%c%c", PlayerName[0], PlayerName[1], PlayerName[2] );
else if (viewside==1) dprint_opt( 193, 203, C_WHITE, C_BLACK, DTEXT_CENTER, DTEXT_CENTER, "%c%c%c", PlayerName[0], PlayerName[1], PlayerName[2] );
else if (viewside==2) dprint_opt( 189, 203, C_WHITE, C_BLACK, DTEXT_CENTER, DTEXT_CENTER, "%c%c%c", PlayerName[0], PlayerName[1], PlayerName[2] );
score = fround(cam->cZ)/100;

@ -117,6 +117,11 @@ void drawSkyOptimised( uint16_t color )
dma_memset(gint_vram, (color << 16) | color, 396 * (minYRoad+2) * 2);
};
void drawSkyQuick( uint16_t color )
{
dma_memset(gint_vram, (color << 16) | color, 396 * 150 * 2);
};
void drawSky( uint8_t R, uint8_t G, uint8_t B )
{
dclear( C_RGB(R,G,B) );

@ -10,7 +10,7 @@
extern bopti_image_t mainscreen;
extern bopti_image_t africa1, desert1, finland1, plains1, usa1;
extern bopti_image_t flag, linear, circular;
extern font_t autofont, autofontsmall;
extern font_t autofont, autofontsmall, speedfont;
extern bool record;
extern bool screenshot;
@ -29,6 +29,9 @@ bool doneMenuCredit = false;
bool doneOptions = false;
uint8_t OptionsSelection=0;
bool doneGameOptions = false;
uint8_t GameOptionsSelection=0;
bool donePauseQuit = false;
uint8_t PauseQuitSelection=0;
@ -42,6 +45,11 @@ extern bool exitToOS;
extern bool stop;
extern bool SkipTime;
extern uint8_t DiffLevel;
extern uint8_t CarsNumb;
extern char PlayerName[3];
bool nameCurrentlyWritten = false;
uint8_t selectedChar=0;
void drawStartTitle( void )
@ -123,27 +131,31 @@ int drawMainMenu( void )
dfont(&autofont);
dprint_opt(102, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" );
if (MainMenuSelection!=0) dprint_opt(100, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" );
else dprint_opt(100, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" );
dprint_opt(94, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" );
if (MainMenuSelection!=0) dprint_opt(92, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" );
else dprint_opt(92, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "ARCADE GAME" );
dprint_opt(94, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" );
if (MainMenuSelection!=1) dprint_opt(92, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" );
else dprint_opt(92, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" );
dprint_opt(102, 62, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" );
if (MainMenuSelection!=1) dprint_opt(100, 60, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" );
else dprint_opt(100, 60, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "TIME ATTACK" );
dprint_opt(94, 82, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "GAME OPTIONS" );
if (MainMenuSelection!=2) dprint_opt(92, 80, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "GAME OPTIONS" );
else dprint_opt(92, 80, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "GAME OPTIONS" );
dprint_opt(102, 102, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPTIONS" );
if (MainMenuSelection!=2) dprint_opt(100, 100, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPTIONS" );
else dprint_opt(100, 100, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPTIONS" );
dprint_opt(94, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "VISUAL OPTIONS" );
if (MainMenuSelection!=3) dprint_opt(92, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "VISUAL OPTIONS" );
else dprint_opt(92, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "VISUAL OPTIONS" );
dprint_opt(102, 142, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" );
if (MainMenuSelection!=3) dprint_opt(100, 140, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" );
else dprint_opt(100, 140, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" );
dprint_opt(94, 142, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" );
if (MainMenuSelection!=4) dprint_opt(92, 140, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" );
else dprint_opt(92, 140, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CREDITS" );
dprint_opt(102, 182, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" );
if (MainMenuSelection!=4) dprint_opt(100, 180, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" );
else dprint_opt(100, 180, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" );
dprint_opt(94, 172, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" );
if (MainMenuSelection!=5) dprint_opt(92, 170, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" );
else dprint_opt(92, 170, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "QUIT TO OS" );
dimage( 10, 10+40*MainMenuSelection, &flag );
dimage( 2, 10+30*MainMenuSelection, &flag );
// CODE HERE TO PRINT WELCOME MENU
@ -186,13 +198,13 @@ void getInputMainMenu( void )
if (key==KEY_UP)
{
if (MainMenuSelection==0) MainMenuSelection=4;
if (MainMenuSelection==0) MainMenuSelection=5;
else MainMenuSelection--;
}
if (key==KEY_DOWN)
{
if (MainMenuSelection==4) MainMenuSelection=0;
if (MainMenuSelection==5) MainMenuSelection=0;
else MainMenuSelection++;
}
#if IS_FXLIB==1
@ -507,77 +519,77 @@ void drawOptions( void )
if (BDrawDeco)
{
dprint_opt(102, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [Y]" );
if (OptionsSelection!=0) dprint_opt(100, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [Y]" );
else dprint_opt(100, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [Y]" );
dprint_opt(94, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [Y]" );
if (OptionsSelection!=0) dprint_opt(92, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [Y]" );
else dprint_opt(92, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [Y]" );
}
else
{
dprint_opt(102, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [N]" );
if (OptionsSelection!=0) dprint_opt(100, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [N]" );
else dprint_opt(100, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [N]" );
dprint_opt(94, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [N]" );
if (OptionsSelection!=0) dprint_opt(92, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [N]" );
else dprint_opt(92, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "SCENERY [N]" );
}
if (BDrawCars)
{
dprint_opt(102, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [Y]" );
if (OptionsSelection!=1) dprint_opt(100, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [Y]" );
else dprint_opt(100, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [Y]" );
dprint_opt(94, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [Y]" );
if (OptionsSelection!=1) dprint_opt(92, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [Y]" );
else dprint_opt(92, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [Y]" );
}
else
{
dprint_opt(102, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [N]" );
if (OptionsSelection!=1) dprint_opt(100, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [N]" );
else dprint_opt(100, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [N]" );
dprint_opt(94, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [N]" );
if (OptionsSelection!=1) dprint_opt(92, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [N]" );
else dprint_opt(92, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "OPPONENTS [N]" );
}
if (BDrawClds)
{
dprint_opt(102, 82, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [Y]" );
if (OptionsSelection!=2) dprint_opt(100, 80, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [Y]" );
else dprint_opt(100, 80, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [Y]" );
dprint_opt(94, 82, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [Y]" );
if (OptionsSelection!=2) dprint_opt(92, 80, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [Y]" );
else dprint_opt(92, 80, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [Y]" );
}
else
{
dprint_opt(102, 82, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [N]" );
if (OptionsSelection!=2) dprint_opt(100, 80, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [N]" );
else dprint_opt(100, 80, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [N]" );
dprint_opt(94, 82, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [N]" );
if (OptionsSelection!=2) dprint_opt(92, 80, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [N]" );
else dprint_opt(92, 80, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CLOUDS [N]" );
}
if (BDrawBack)
{
dprint_opt(102, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [Y]" );
if (OptionsSelection!=3) dprint_opt(100, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [Y]" );
else dprint_opt(100, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [Y]" );
dprint_opt(94, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [Y]" );
if (OptionsSelection!=3) dprint_opt(92, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [Y]" );
else dprint_opt(92, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [Y]" );
}
else
{
dprint_opt(102, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [N]" );
if (OptionsSelection!=3) dprint_opt(100, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [N]" );
else dprint_opt(100, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [N]" );
dprint_opt(94, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [N]" );
if (OptionsSelection!=3) dprint_opt(92, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [N]" );
else dprint_opt(92, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACKGROUND [N]" );
}
if (BDrawFPS)
{
dprint_opt(102, 142, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [Y]" );
if (OptionsSelection!=4) dprint_opt(100, 140, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [Y]" );
else dprint_opt(100, 140, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [Y]" );
dprint_opt(94, 142, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [Y]" );
if (OptionsSelection!=4) dprint_opt(92, 140, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [Y]" );
else dprint_opt(92, 140, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [Y]" );
}
else
{
dprint_opt(102, 142, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [N]" );
if (OptionsSelection!=4) dprint_opt(100, 140, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [N]" );
else dprint_opt(100, 140, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [N]" );
dprint_opt(94, 142, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [N]" );
if (OptionsSelection!=4) dprint_opt(92, 140, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [N]" );
else dprint_opt(92, 140, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "STATS-FPS [N]" );
}
dprint_opt(102, 172, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
if (OptionsSelection!=5) dprint_opt(100, 170, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
else dprint_opt(100, 170, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
dprint_opt(94, 172, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
if (OptionsSelection!=5) dprint_opt(92, 170, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
else dprint_opt(92, 170, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
dimage( 10, 5+30*OptionsSelection, &flag );
dimage( 2, 5+30*OptionsSelection, &flag );
// CODE HERE TO PRINT WELCOME MENU
@ -647,6 +659,211 @@ void getInputOptions( void )
void drawGameOptions( void )
{
uint16_t pulse=0;
doneGameOptions = false;
GameOptionsSelection=0;
selectedChar = 0;
while (!doneGameOptions)
{
dclear(0x0000);
dimage( 0, 0, &mainscreen);
dfont(&autofont);
if (DiffLevel==0)
{
dprint_opt(94, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <EASY>" );
if (GameOptionsSelection!=0) dprint_opt(92, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <EASY>" );
else dprint_opt(92, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <EASY>" );
}
else if (DiffLevel==1)
{
dprint_opt(94, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <NORMAL>" );
if (GameOptionsSelection!=0) dprint_opt(92, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <NORMAL>" );
else dprint_opt(92, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <NORMAL>" );
}
else if (DiffLevel==2)
{
dprint_opt(94, 22, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <HARD>" );
if (GameOptionsSelection!=0) dprint_opt(92, 20, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <HARD>" );
else dprint_opt(92, 20, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "LVL <HARD>" );
}
if (CarsNumb==0)
{
dprint_opt(94, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <50>" );
if (GameOptionsSelection!=1) dprint_opt(92, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <50>" );
else dprint_opt(92, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <50>" );
}
else if (CarsNumb==1)
{
dprint_opt(94, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <100>" );
if (GameOptionsSelection!=1) dprint_opt(92, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <100>" );
else dprint_opt(92, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <100>" );
}
else if (CarsNumb==2)
{
dprint_opt(94, 52, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <200>" );
if (GameOptionsSelection!=1) dprint_opt(92, 50, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <200>" );
else dprint_opt(92, 50, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "CARS <200>" );
}
dprint_opt(94, 82, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "PLAYER" );
dprint_opt(92, 80, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "PLAYER" );
dprint_opt(124, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[0] );
if (GameOptionsSelection!=2 || selectedChar!=0) dprint_opt(122, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[0] );
else if (GameOptionsSelection==2 && selectedChar==0) dprint_opt(122, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[0] );
dprint_opt(154, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[1] );
if (GameOptionsSelection!=2 || selectedChar!=1) dprint_opt(152, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[1] );
else if (GameOptionsSelection==2 && selectedChar==1) dprint_opt(152, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[1] );
dprint_opt(184, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[2] );
if (GameOptionsSelection!=2 || selectedChar!=2) dprint_opt(182, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[2] );
else if (GameOptionsSelection==2 && selectedChar==2) dprint_opt(182, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "%c", PlayerName[2] );
dfont(&speedfont);
dprint_opt(214, 112, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "@" );
if (GameOptionsSelection!=2 || selectedChar!=3) dprint_opt(212, 110, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "@" );
else if (GameOptionsSelection==2 && selectedChar==3) dprint_opt(212, 110, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "@" );
dfont(&autofont);
dprint_opt(94, 172, C_RGB(0,0,0), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
if (GameOptionsSelection!=3) dprint_opt(92, 170, C_RGB(255,255,255), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
else dprint_opt(92, 170, C_RGB(pulse%256,0,pulse%256), C_NONE, DTEXT_LEFT, DTEXT_TOP, "BACK TO GAME" );
if (GameOptionsSelection==0) dimage( 2, 5, &flag );
else if (GameOptionsSelection==1) dimage( 2, 35, &flag );
else if (GameOptionsSelection==2) dimage( 2, 65, &flag );
else if (GameOptionsSelection==3) dimage( 2, 155, &flag );
// CODE HERE TO PRINT WELCOME MENU
dupdate();
pulse++;
getInputGameOptions();
#if IS_FXLIB==1
if (screenshot && usb_is_open())
{
usb_fxlink_screenshot(false);
screenshot = false;
}
if(record && usb_is_open())
{
usb_fxlink_videocapture(false);
}
#endif
}
SkipTime = true; // To avoid counting or de-counting time during menu
return;
}
void getInputGameOptions( void )
{
int opt = GETKEY_DEFAULT & ~GETKEY_REP_ARROWS;
int timeout = 1;
while(1)
{
key_event_t ev = getkey_opt(opt, &timeout);
if(ev.type == KEYEV_NONE) return;
int key = ev.key;
if (key==KEY_EXE)
{
if (GameOptionsSelection==2) nameCurrentlyWritten=false;
if (GameOptionsSelection==3) doneGameOptions=true;
}
if (key==KEY_UP && !nameCurrentlyWritten)
{
if (GameOptionsSelection==0) GameOptionsSelection=3;
else GameOptionsSelection--;
}
if (key==KEY_UP && nameCurrentlyWritten)
{
if(GameOptionsSelection==2 && selectedChar>=0 && selectedChar<=2)
{
if (PlayerName[selectedChar]>'A') PlayerName[selectedChar]--;
else PlayerName[selectedChar]='Z';
}
else if(GameOptionsSelection==2 && selectedChar==3)
{
nameCurrentlyWritten=false;
}
}
if (key==KEY_DOWN && !nameCurrentlyWritten)
{
if (GameOptionsSelection==3) GameOptionsSelection=0;
else GameOptionsSelection++;
}
if (key==KEY_DOWN && nameCurrentlyWritten)
{
if(GameOptionsSelection==2 && selectedChar>=0 && selectedChar<=2)
{
if (PlayerName[selectedChar]<'Z') PlayerName[selectedChar]++;
else PlayerName[selectedChar]='A';
}
else if(GameOptionsSelection==2 && selectedChar==3)
{
nameCurrentlyWritten=false;
}
}
if (key==KEY_LEFT)
{
if (GameOptionsSelection==2 && selectedChar>=0 && selectedChar<=2) nameCurrentlyWritten=true;
else if (GameOptionsSelection==2 && selectedChar==3) nameCurrentlyWritten=false;
if (GameOptionsSelection==2 && selectedChar>0) selectedChar--;
else if (GameOptionsSelection==2) selectedChar=3;
if (GameOptionsSelection==0 && DiffLevel>0) DiffLevel--;
else if (GameOptionsSelection==1 && CarsNumb>0) CarsNumb--;
}
if (key==KEY_RIGHT)
{
if (GameOptionsSelection==2 && selectedChar>=0 && selectedChar<=2) nameCurrentlyWritten=true;
else if (GameOptionsSelection==2 && selectedChar==3) nameCurrentlyWritten=false;
if (GameOptionsSelection==2 && selectedChar<4) selectedChar++;
else if (GameOptionsSelection==2) selectedChar=0;
if (GameOptionsSelection==0 && DiffLevel<2) DiffLevel++;
else if (GameOptionsSelection==1 && CarsNumb<2) CarsNumb++;
}
#if IS_FXLIB==1
if(keydown(KEY_F5)) screenshot = true;
if(keydown(KEY_F6)) record = !record;
#endif // IS_FXLIB
}
}
void drawPauseQuit( void )
{
uint16_t pulse=0;

Loading…
Cancel
Save