summaryrefslogtreecommitdiff
path: root/src/include/graphic.h
blob: 5b5960064bc96a75befaf8730a0c78490ca37880 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef GRAPHIC_H
#define GRAPHIC_H

#include "SDL/SDL.h"
#include "data_ini.h"
#include "data_ress.h"
#include "data_config.h"
#include "data_localgame.h"

#define SCREEN_BPP 32
#define MY_SDLSURFACE_OPTS SDL_HWSURFACE|SDL_HWACCEL|SDL_SRCCOLORKEY|SDL_ASYNCBLIT|SDL_RLEACCEL

Uint32 getPixel(SDL_Surface *s, int x, int y);
Uint32 getPixel8BitPalette(SDL_Surface *s, int x, int y);
int isTransparent(SDL_Surface *s, int x, int y);
void putPixel(SDL_Surface *s, int x, int y, Uint32 p);

SDL_Surface * createSurface(int width, int height);
SDL_Surface * loadGif(char *filePath);

int init(char *winCaption, gameConfig_t *conf, gameGraphics_t *gGraph);
int paintTerrain(gameIni_t *gIni, gameRess_t *gRess, gameGraphics_t *gGraph);

int repaint(gameObjectsState_t *objStates, gameGraphSurfaces_t *srcSurfs, SDL_Rect *srcRect, SDL_Surface *dstSurf);
int findAndZSortObjects(gameObjectsState_t *objectsStat, SDL_Rect *offsetRect, gameObjectsState_t *objectsFound);
int paintObject(struct gameObjectState *obj, SDL_Surface *dstSurf, SDL_Rect dstRect);

int refresh(SDL_Surface *tmpSurf, SDL_Rect *srcRect, SDL_Surface *screen, SDL_Rect dstRect);
#endif /*GRAPHIC_H*/