You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
97 lines
2.8 KiB
97 lines
2.8 KiB
#ifndef _GFX_H_
|
|
|
|
#define _GFX_H_
|
|
|
|
#define SCALE_MAXRES 10000
|
|
#define GFX_IMGSIZE 64
|
|
#define GFX_PLAYERIMGSIZE_Y 128
|
|
|
|
#include "basic.h"
|
|
|
|
struct __gfxani {
|
|
SDL_Surface *image;
|
|
int frames; // how many single frames (image -> heigh / (1.5 * gamestyle.height))
|
|
} typedef _gfxani;
|
|
|
|
|
|
struct __gfxplayer {
|
|
_gfxani ani;
|
|
_point offset;
|
|
_point size; // height of the image.. needed for faster access.
|
|
_point smal_size; // smal size of the image
|
|
SDL_Surface *smal_image; // smal size of the animation
|
|
} typedef _gfxplayer;
|
|
|
|
|
|
struct __gfxfont {
|
|
SDL_Surface *image;
|
|
_point size;
|
|
} typedef _gfxfont;
|
|
|
|
|
|
struct __gfx {
|
|
SDL_Surface *screen;
|
|
_point res; // resolution
|
|
_point block; // block size
|
|
short int bpp; // bits per pixel
|
|
|
|
unsigned char fullscreen;
|
|
|
|
_point offset; // where the game field starts
|
|
|
|
_gfxfont font;
|
|
_gfxfont font1;
|
|
|
|
_gfxplayer players[MAX_PLAYERS];
|
|
short int postab[256]; // table of points where we need to go to.
|
|
|
|
_gfxani field[FT_max]; // the field animations
|
|
_gfxani powerup[3]; // powerup field animation
|
|
_gfxani fire; // fire (explostion)
|
|
_gfxani bomb; // bomb animation
|
|
_gfxani ill; // sick animation above the player
|
|
|
|
_gfxani menuselect; // The Menu Select GFX (the bomb ?)
|
|
|
|
int random_tileset; // random selecting of a tileset
|
|
char tileset[LEN_TILESETNAME]; // name of the tileset
|
|
|
|
SDL_Surface *logo;
|
|
} typedef _gfx;
|
|
|
|
extern _gfx gfx;
|
|
|
|
|
|
// everything what is in gfx.c
|
|
extern void gfx_loaddata ();
|
|
extern void gfx_UpdateRects ();
|
|
extern void gfx_AddUpdateRect (int x, int y, int w, int h);
|
|
extern void redraw_logo (int x, int y, int w, int h);
|
|
extern void draw_logo ();
|
|
extern void gfx_init (); // Load Base Image Data
|
|
extern void gfx_game_init (); // Load Game Data
|
|
extern void gfx_game_shutdown (); // Free Image Data
|
|
extern void gfx_shutdown (); //
|
|
extern void getRGBpixel (SDL_Surface *surface, int x, int y, int *R, int *G, int *B);
|
|
extern Uint32 getpixel(SDL_Surface *surface, int x, int y);
|
|
extern void putpixel(SDL_Surface *surface, int x, int y, Uint32 pixel);
|
|
extern void scale (short int *dpattern, short int x, short int y);
|
|
extern SDL_Surface *scale_image (SDL_Surface * orginal, int newx, int newy);
|
|
extern void shade_pixel(SDL_Surface *s, int x, int y, int c);
|
|
extern void draw_shadefield (SDL_Surface *s, SDL_Rect *rec, int c);
|
|
extern int gfx_locksurface (SDL_Surface *surface);
|
|
extern void gfx_unlocksurface (SDL_Surface *surface);
|
|
extern void redraw_logo_shaded (int x, int y, int w, int h, int c);
|
|
extern void gfx_load_players (int sx, int sy);
|
|
extern void gfx_free_players ();
|
|
extern void gfx_load_tileset (char *tileset);
|
|
extern void gfx_free_tileset ();
|
|
extern SDL_Surface *makegray_image (SDL_Surface *org);
|
|
extern SDL_Surface *gfx_copyscreen (SDL_Rect *wnd);
|
|
|
|
// declared functions in font.c
|
|
extern void draw_text (int x, int y, char *text, int white);
|
|
|
|
#endif
|
|
|