Mercurial > hg > old > magoroku_racing
view title_scene.cc @ 119:f2e2460b4011
draw_title
author | e085768 |
---|---|
date | Sun, 19 Jun 2011 02:16:20 +0900 |
parents | ed702e49cc6c |
children |
line wrap: on
line source
#include "libps2.h" #include "ps2util.h" #include "title_scene.h" #include "gSprite.h" #include "sjoy.h" typedef enum { TITLE_INIT, TITLE_MAIN, TITLE_FINISH } TITLE_STATE; static ps2utilSprite title_sprite; //static TEXTURE *title_img; #define TITLE_IMG_FILE "img/title.png" static void title_init() { /* //load texture title_img = read_png_file( TITLE_IMG_FILE ); ps2util_tex_Set( title_img ); */ /* create sprite object */ /* ps2util_sprite_Create( &title_sprite, title_img ); ps2util_sprite_Set_basicAttribute( &title_sprite, 0, 0, 650, 500, 0, 0, 512, 256, SPRITE_PRIO_FOREGROUND ); ps2util_sprite_Use_alpha( &title_sprite ); ps2util_sprite_Request( &title_sprite ); */ } void title_init_call() { title_init(); } static void title_finish() { ps2util_sprite_Destroy( &title_sprite ); //ps2util_tex_Exclude( title_img ); //free_texture( title_img ); } void title_finish_call() { title_finish(); } int title_scene() { static TITLE_STATE state = TITLE_INIT; int pad; switch (state) { case TITLE_INIT: title_init(); state = TITLE_MAIN; break; case TITLE_MAIN: pad = sjoy_get_ps2_button( JOYPAD_1 ); state = (pad & SJOY_PS2_START) ? TITLE_FINISH : TITLE_MAIN; break; case TITLE_FINISH: title_finish(); return -1; default: break; } return 0; }