#include"froggy.h" //#include //# |_ For 333Mhz Overclock //#include //# | SDL_Surface *front; SDL_Surface *intro; SDL_Surface *credit; int scr = 0; typedef struct _Credit { int x,y,index,off; } Credit; static char *str_array[] = { "RoadKill 2", " ported to freeES by jared ", " nothing else ..", " freeES is free ", " as in free free ", "beer and candy free", "as in free", "hmmm", "you still here?", "close this", "already", "im not kiddin", "close it", "ack", "since your readin this: ", "go to", "LostSideDead.com ", "yeah I know", 0 }; Credit cr[17]; /* 0 Triangle 1 Circle 2 Cross 3 Square 4 Left trigger 5 Right trigger 6 Down 7 Left 8 Up 9 Right 10 Select 11 Start 12 Home 13 Hold */ void render_intro() { Uint8 *key = SDL_GetKeyState(0); SDL_BlitSurface(intro, 0, front, 0); SDL_PrintText(front, font, 480/2-120, 272-20, SDL_MapRGB(front->format, rand()%255, rand()%255, rand()%255), "Press Start to Play"); if(key[SDLK_SPACE]) { scr = 1; new_game(); } } void init_credits() { int i; memset(cr, 0, sizeof(cr)); for(i = 0; i < 17; i++) { cr[i].x = 250; cr[i].y = 250; cr[i].index = i; cr[i].off = 0; } cr[0].off = 1; } void render_credits() { int i; static int index = 0; static int c = 0; SDL_BlitSurface(credit, 0, front, 0); // rasterize the text for(i = 0; i < 17; i++) { if(cr[i].off == 1) { SDL_PrintText(front, font, cr[i].x, cr[i].y, SDL_MapRGB(front->format, 0, 255, 0), str_array[cr[i].index]); SDL_Delay(10); cr[i].y--; } } if((++c % 25) == 0) { cr[index].off = 1; index++; } if(cr[index].y <= 0) cr[index].off = 0; if(cr[16].y <= 0) { scr = 0; init_credits(); } } void rls() { free_gfx(); SDL_FreeSurface(intro); SDL_FreeSurface(credit); } int startup(int argc, char **argv) { static SDL_Event e; int active = 1; static int rmask, gmask, bmask, amask; int width = 480, height = 272; #if SDL_BYTEORDER == SDL_BIG_ENDIAN rmask = 0xff000000; gmask = 0x00ff0000; bmask = 0x0000ff00; amask = 0x000000ff; #else rmask = 0x000000ff; gmask = 0x0000ff00; bmask = 0x00ff0000; amask = 0xff000000; #endif intro = SDL_LoadBMP("img/intro.bmp"); credit = SDL_LoadBMP("img/credits.bmp"); init_credits(); init(); scr = 0; }