60 lines
1.3 KiB
C
60 lines
1.3 KiB
C
|
#include <gint/display.h>
|
||
|
#include <gint/keyboard.h>
|
||
|
#include "msg_fr.h"
|
||
|
#include "itemsizes.h"
|
||
|
#include "gamesettings.h"
|
||
|
|
||
|
extern bopti_image_t title_img;
|
||
|
|
||
|
void drawselectedgame(int selected) {
|
||
|
dclear(C_WHITE);
|
||
|
// dimage(16, 8, &title_img);
|
||
|
for(int i=0;i!=GAMESNUM;i++){
|
||
|
dtext(1, WORLDSEL_MARGIN + i*(LINEHEIGHT+LINEPADDING), C_BLACK, WORLDSEL_EMPTY);
|
||
|
}
|
||
|
drect(1, WORLDSEL_MARGIN+selected*(LINEHEIGHT+LINEPADDING), 128, WORLDSEL_MARGIN+selected*(LINEHEIGHT+LINEPADDING)+LINEHEIGHT, C_INVERT);
|
||
|
dupdate();
|
||
|
}
|
||
|
int main(void) {
|
||
|
dclear(C_WHITE);
|
||
|
dimage(16, TITLE_IMAGE_MARGIN, &title_img);
|
||
|
dtext(1, TITLE_MARGIN, C_BLACK, TITLE_START);
|
||
|
dupdate();
|
||
|
int key = 0, game = 0, selected = 0;
|
||
|
while(key != KEY_EXIT){
|
||
|
key=getkey().key;
|
||
|
////////// TITLE SCREEN //////////
|
||
|
if(game == 0){
|
||
|
if(key==KEY_EXE){
|
||
|
drawselectedgame(selected);
|
||
|
game = 1;
|
||
|
}
|
||
|
}
|
||
|
////////// GAME CHOOSING SCREEN //////////
|
||
|
else if(game == 1){
|
||
|
if(key==KEY_DOWN){
|
||
|
if(selected<GAMESNUM - 1){
|
||
|
selected++;
|
||
|
}else{
|
||
|
selected = 0;
|
||
|
}
|
||
|
drawselectedgame(selected);
|
||
|
}else if(key==KEY_UP){
|
||
|
if(selected>0){
|
||
|
selected--;
|
||
|
}else{
|
||
|
selected = GAMESNUM - 1;
|
||
|
}
|
||
|
drawselectedgame(selected);
|
||
|
}else if(key==KEY_EXE){
|
||
|
dclear(C_WHITE);
|
||
|
game = 2;
|
||
|
|
||
|
}
|
||
|
}else if(game == 2){
|
||
|
dupdate();
|
||
|
}
|
||
|
}
|
||
|
return 1;
|
||
|
}
|