/* Dodgin' Diamond 2, a shot'em up arcade Copyright (C) 2003,2004 Juan J. Martinez This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include"SDL_plus.h" #include SDL_Surface * loadBMP(char *file) { SDL_Surface *a,*b; a=SDL_LoadBMP(file); if(!a) return NULL; b=SDL_DisplayFormat(a); if(!b) return NULL; SDL_FreeSurface(a); return b; } void writeNumber(SDL_Surface *src, SDL_Surface *dst, int x, int y, int number, int padd) { SDL_Rect a,b; char buffer[32],fmt[16]; int i; sprintf(fmt,"%%.%ii",padd); sprintf(buffer,fmt,number); a.y=y; a.w=8; a.h=12; b.y=73; b.w=8; b.h=12; for(i=0;i0) a.x+=12; } return; } /* ugly!!!! needs review */ char SDLK2ascii(int sym) { switch(sym) { default: break; case SDLK_a: return 'a'; case SDLK_b: return 'b'; case SDLK_c: return 'c'; case SDLK_d: return 'd'; case SDLK_e: return 'e'; case SDLK_f: return 'f'; case SDLK_g: return 'g'; case SDLK_h: return 'h'; case SDLK_i: return 'i'; case SDLK_j: return 'j'; case SDLK_k: return 'k'; case SDLK_l: return 'l'; case SDLK_m: return 'm'; case SDLK_n: return 'n'; case SDLK_o: return 'o'; case SDLK_p: return 'p'; case SDLK_q: return 'q'; case SDLK_r: return 'r'; case SDLK_s: return 's'; case SDLK_t: return 't'; case SDLK_u: return 'u'; case SDLK_v: return 'v'; case SDLK_w: return 'w'; case SDLK_x: return 'x'; case SDLK_y: return 'y'; case SDLK_z: return 'z'; case SDLK_0: return '0'; case SDLK_1: return '1'; case SDLK_2: return '2'; case SDLK_3: return '3'; case SDLK_4: return '4'; case SDLK_5: return '5'; case SDLK_6: return '6'; case SDLK_7: return '7'; case SDLK_8: return '8'; case SDLK_9: return '9'; } return ' '; }