--- nuclearchess-1.0.0.old/src/gui.c +++ nuclearchess-1.0.0/src/gui.c @@ -30,7 +30,13 @@ SDL_Surface *bauer[2], *laeufer[2], *dame[2], *koenig[2], *turm[2], *springer[2]; SDL_Surface *black, *white, *select_pic, *bomb, *board, *button, *button_light, *wood; + +#ifdef NOTDEF // Local version omits animation SDL_Surface *anim[15], *atom, *atom_rot; +int animCounter = 0; +#else +SDL_Surface *atom, *atom_rot; +#endif // Endif NOTDEF //SDL_Surface *Font, *FontLarge; SDL_Surface *Font; @@ -38,7 +44,6 @@ SFont_FontInfo *FontLarge=&FontLargeData; SDL_Event event; -int animCounter = 0; int selected = 0, select_x, select_y, select_old_x=0, select_old_y=0; int fertig = 0; long Now, delta_t; @@ -487,13 +492,15 @@ atom = LoadImage("atom.png"); atom_rot = LoadImage("atom-rot.png"); - - for (i=0; i<15; i++) { - char string[100]; - - sprintf(string, "anim%d.png", i+1); - anim[i] = LoadImage(string); + +#ifdef NOTDEF // Local version omits animation + for (i = 0; i < 15; i++) + { + char string [100]; + sprintf (string, "anim%d.png", i+1); + anim [i] = LoadImage (string); } +#endif // Endif NOTDEF } void mouse_click(int x, int y) @@ -1174,20 +1181,19 @@ SDL_Rect rect; - if (allow_timer) { - rect.x = ATOM_X; - rect.y = ATOM_Y; - rect.w = anim[animCounter]->w; - rect.h = anim[animCounter]->h; - - SDL_BlitSurface(board, &rect, Screen, &rect); - Blit(ATOM_X, ATOM_Y, anim[animCounter++]); - - Update(); - - animCounter %= 15; - - SDL_PollEvent(&event); + if (allow_timer) + { +#ifdef NOTDEF // Local version omits animation + rect.x = ATOM_X; + rect.y = ATOM_Y; + rect.w = anim [animCounter]->w; + rect.h = anim [animCounter]->h; + SDL_BlitSurface (board, &rect, Screen, &rect); + Blit (ATOM_X, ATOM_Y, anim [animCounter++]); + Update(); + animCounter %= 15; +#endif // Endif NOTDEF + SDL_PollEvent (&event); } return 50;