Mercurial > hg > old > magoroku_racing
diff gFont.cc @ 116:ed702e49cc6c
conpile
author | e085768 |
---|---|
date | Thu, 16 Jun 2011 04:05:33 +0900 |
parents | e5f2eb98b575 |
children | f2e2460b4011 |
line wrap: on
line diff
--- a/gFont.cc Wed Jun 15 23:31:59 2011 +0900 +++ b/gFont.cc Thu Jun 16 04:05:33 2011 +0900 @@ -24,11 +24,12 @@ static unsigned int sp_counter; static bool flag_spriteInited = false; // スプライトロードフラグ -static TEXTURE *font_tex; +//static TEXTURE *font_tex; static void gFont_Init_Png(const char *texname) { + /* if (!(font_tex = read_png_file(texname))) { fprintf(stderr, "cannot creat texture - gFont_Init_Png().\n"); @@ -42,11 +43,13 @@ fflush(stderr); exit(EXIT_FAILURE); } + */ } static void gFont_Create() { + /* int i; for (i=0; i<DEFOBJ; i++) { if (ps2util_sprite_Create(&sp[i], font_tex) == -1) { @@ -58,17 +61,32 @@ ps2util_sprite_Unuse_alpha(&sp[i]); } + flag_spriteInited = true; + */ - flag_spriteInited = true; } static void gFont_DefSprite(int number, int x, int y, int w, int h) { - sptable[number].tx = x; - sptable[number].ty = y; - sptable[number].tw = w; - sptable[number].th = h; + sptable[number].mx = x; + sptable[number].my = y; + sptable[number].w = w; + sptable[number].h = h; +} + +void +DefSprite(int number, const char *name, float w, float h, int color, OBJECT *obj) +{ + SpriteTable *m = &sptable[number]; + m->w = w; + m->h = h; + m->color = (color & 32); + m->mx = w / 2; + m->my = h / 2; + m->tex_w = power_of_two(m->w); + m->tex_h = power_of_two(m->h); + m->texture = (int *)name; } void