gfxEngine_documentation
bfg_GfxEngine_PC.h
Go to the documentation of this file.
1 #ifndef GFXENGINE_PC_H_INCLUDED
2 #define GFXENGINE_PC_H_INCLUDED
3 
4 #include <SDL2/SDL.h>
5 #include <stdlib.h>
6 #define MAX_IMAGE_TRA 16
7 #define MAX_IMAGEBANK_TRA 5000
8 #define MAX_IMGTILE 4096
9 #define MAX_ALPHA 255
10 
11 #define IMAGE_TRA0 0
12 #define IMAGE_TRA1 1
13 #define IMAGE_TRA2 2
14 #define IMAGE_TRA3 3
15 #define IMAGE_TRA4 4
16 #define IMAGE_TRA5 5
17 #define IMAGE_TRA6 6
18 #define IMAGE_TRA7 7
19 #define IMAGE_TRA8 8
20 #define IMAGE_TRA9 9
21 #define IMAGE_TRA10 10
22 #define IMAGE_TRA11 11
23 #define IMAGE_TRA12 12
24 #define IMAGE_TRA13 13
25 #define IMAGE_TRA14 14
26 #define IMAGE_TRA15 15
27 
28 typedef struct si
29 {
30  int chargee; // L'image est elle chargée ?
31  int hauteur; // Hauteur
32  int largeur; // Largeur
33  SDL_Texture* surface;
34 } simage;
35 
36 typedef struct ib
37 {
39  int chargee;
40  int sx;
41  int sy;
42  int sh;
43  int sl;
44  float p1_x;
45  float p1_y;
46  float p2_x;
47  float p2_y;
48  float p3_x;
49  float p3_y;
50  float p4_x;
51  float p4_y;
52 } sibank;
53 
54 typedef struct it
55 {
57  int chargee;
58  int sx;
59  int sy;
60  int sh;
61  int sl;
62  float p1_x;
63  float p1_y;
64  float p2_x;
65  float p2_y;
66  float p3_x;
67  float p3_y;
68  float p4_x;
69  float p4_y;
70 } stiles;
71 
72 typedef struct al
73 {
75  int chargee;
76  int sx;
77  int sy;
78  int sh;
79  int sl;
80 } salpha;
81 
82 void destroyGfxEngine();
83 void initGfxEngine();
84 void initGfxEngine320();
85 int getResX(void);
86 int getResY(void);
87 void waitInMs(int ms);
88 void synchroStart();
89 void synchroEnd(int ms);
94 int loadImageTra(char *filename,int noImage,int hauteur,int largeur);
95 
96 int loadMask(char *filename,int noImage);
97 int getPixelMask(int noImage,int x,int y);
98 void freeMask(int noImage);
99 
100 int loadCompressMask(char *filename,int noImage);
101 void freeCompressMask(int noImage);
102 int getPixelCompressMask(int noImage,int x,int y);
103 
104 void blitImageTra(int ino,int dx,int dy);
105 int getFreeImageBankTra();
106 void getImageBankTra(int ibno,int is,int sx,int sy,int sh,int sl);
107 void blitImageBankTra(int ibno,int dx,int dy);
108 void blitImageBankTraRot(int ibno,int dx,int dy,float myrot,float zx,float zy,int center);
109 
110 void getImageTile(int ibno,int is,int sx,int sy,int sh,int sl);
111 void blitImageTile(int ibno,int dx,int dy);
112 
113 void getImageAlpha(int ibno,int is,int sx,int sy,int sh,int sl);
114 void blitImageAlpha(int ibno,int dx,int dy);
115 
116 void freeImageTra(int noImage);
117 void freeAllImageTra(void);
118 void freeAllImage(void);
119 
120 int checkController();
121 int getKeyA(void);
122 int getKeyB(void);
123 int getKeyX(void);
124 int getKeyY(void);
125 int getKeyUp(void);
126 int getKeyDown(void);
127 int getKeyLeft(void);
128 int getKeyRight(void);
129 int getKeyStart(void);
130 int anyActionKeyPress(void);
131 int getNoDirection(void);
132 
133 #endif // GFXENGINE_PC_H_INCLUDED
struct al salpha
int getKeyB(void)
Retourne 1 si le bouton B de la manette a ete presse (Dreamcast), ou touche "V" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:775
int getKeyLeft(void)
Retourne 1 si le bouton GAUCHE de la manette a ete presse (Dreamcast), ou touche "gauche" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:800
float p4_x
Definition: bfg_GfxEngine_PC.h:50
void blitImageAlpha(int ibno, int dx, int dy)
Affiche un Alpha.
Definition: bfg_GfxEngine_Dreamcast.c:589
int getNoDirection(void)
Retourne 1 si il n'y a aucune direction de selectionne.
Definition: bfg_GfxEngine_Dreamcast.c:815
int getFreeImageBankTra()
Retourne le premier numero d'imageBank non utilise.
Definition: bfg_GfxEngine_Dreamcast.c:469
int sx
Definition: bfg_GfxEngine_PC.h:76
Definition: bfg_GfxEngine_PC.h:54
void termineEcritureVideoGlobale()
Signale au PVR qu'on a termine d'ecrire des donnees et affiche a l'ecran.(Dreamcast) Ou affiche le bu...
Definition: bfg_GfxEngine_Dreamcast.c:411
int sh
Definition: bfg_GfxEngine_PC.h:60
float p3_y
Definition: bfg_GfxEngine_PC.h:67
void getImageTile(int ibno, int is, int sx, int sy, int sh, int sl)
Cree en memoire une tuile (= Tile) a partir d'une image complete. (Servira pour tileMapEngine ou scro...
Definition: bfg_GfxEngine_Dreamcast.c:308
int loadCompressMask(char *filename, int noImage)
Charge un masque de collision compresse de sprite en memoire.
Definition: bfg_GfxEngine_Dreamcast.c:212
void blitImageTile(int ibno, int dx, int dy)
Affiche une tuile.
Definition: bfg_GfxEngine_Dreamcast.c:537
int getPixelMask(int noImage, int x, int y)
Definition: bfg_GfxEngine_Dreamcast.c:195
Definition: bfg_GfxEngine_PC.h:36
int sx
Definition: bfg_GfxEngine_PC.h:58
int image_source
Definition: bfg_GfxEngine_PC.h:56
void initGfxEngine320()
Initialise le gfxEngine en 320*240.
Definition: bfg_GfxEngine_Dreamcast.c:62
float p1_y
Definition: bfg_GfxEngine_PC.h:45
int checkController()
Lit la manette (Dreamcast) ou le clavier (PC), et charge en memoire les donnees recueillis.
Definition: bfg_GfxEngine_Dreamcast.c:732
float p3_x
Definition: bfg_GfxEngine_PC.h:48
void synchroEnd(int ms)
int getKeyRight(void)
Retourne 1 si le bouton DROITE de la manette a ete presse (Dreamcast), ou touche "droite" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:805
int loadMask(char *filename, int noImage)
Charge un masque de collision de sprite en memoire.
Definition: bfg_GfxEngine_Dreamcast.c:173
int getKeyUp(void)
Retourne 1 si le bouton HAUT de la manette a ete presse (Dreamcast), ou touche "haut" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:790
void freeCompressMask(int noImage)
Definition: bfg_GfxEngine_Dreamcast.c:259
float p1_x
Definition: bfg_GfxEngine_PC.h:44
void getImageBankTra(int ibno, int is, int sx, int sy, int sh, int sl)
Cree en memoire une portion d'image (= ImageBank) a partir d'une image complete.
Definition: bfg_GfxEngine_Dreamcast.c:265
int anyActionKeyPress(void)
Retourne 1 si une touche "action" (A,B,X,Y sur DC) (C,V,B,N sur PC) a ete enfonce.
Definition: bfg_GfxEngine_Dreamcast.c:821
int image_source
Definition: bfg_GfxEngine_PC.h:38
void prepareEcritureVideoTra()
Signale au PVR qu'il va recevoir des polygones avec transparence (Dreamcast only) ...
Definition: bfg_GfxEngine_Dreamcast.c:401
SDL_Texture * surface
Definition: bfg_GfxEngine_PC.h:33
void synchroStart()
void prepareEcritureVideoGlobale()
Signale au PVR qu'il va recevoir des donnees (Dreamcast only)
Definition: bfg_GfxEngine_Dreamcast.c:394
void freeImageTra(int noImage)
Detruit l'image et libere la memoire.
Definition: bfg_GfxEngine_Dreamcast.c:709
void getImageAlpha(int ibno, int is, int sx, int sy, int sh, int sl)
Cree en memoire un caractere graphique (= Alpha) a partir d'une image complete. (Servira pour writeEn...
Definition: bfg_GfxEngine_Dreamcast.c:351
void blitImageTra(int ino, int dx, int dy)
Affiche une image.
Definition: bfg_GfxEngine_Dreamcast.c:416
void initGfxEngine()
Initialise le gfxEngine en 640*480.
Definition: bfg_GfxEngine_Dreamcast.c:95
void blitImageBankTraRot(int ibno, int dx, int dy, float myrot, float zx, float zy, int center)
Affiche une imageBank avec zoom et rotation.
Definition: bfg_GfxEngine_Dreamcast.c:641
void freeMask(int noImage)
Libere la memoire utilisee par le masque lie a une image.
Definition: bfg_GfxEngine_Dreamcast.c:206
int sy
Definition: bfg_GfxEngine_PC.h:59
float p3_x
Definition: bfg_GfxEngine_PC.h:66
int sl
Definition: bfg_GfxEngine_PC.h:43
float p2_x
Definition: bfg_GfxEngine_PC.h:46
float p1_y
Definition: bfg_GfxEngine_PC.h:63
struct it stiles
int sh
Definition: bfg_GfxEngine_PC.h:42
Definition: bfg_GfxEngine_PC.h:72
float p1_x
Definition: bfg_GfxEngine_PC.h:62
int largeur
Definition: bfg_GfxEngine_PC.h:32
int sh
Definition: bfg_GfxEngine_PC.h:78
Definition: bfg_GfxEngine_PC.h:28
int sy
Definition: bfg_GfxEngine_PC.h:41
int chargee
Definition: bfg_GfxEngine_PC.h:39
int loadImageTra(char *filename, int noImage, int hauteur, int largeur)
Charge une image PNG 32bits.
Definition: bfg_GfxEngine_Dreamcast.c:162
float p4_y
Definition: bfg_GfxEngine_PC.h:51
int chargee
Definition: bfg_GfxEngine_PC.h:57
float p2_y
Definition: bfg_GfxEngine_PC.h:65
int getKeyY(void)
Retourne 1 si le bouton Y de la manette a ete presse (Dreamcast), ou touche "N" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:785
void freeAllImageTra(void)
Detruit toutes les images et libere la memoire.
Definition: bfg_GfxEngine_Dreamcast.c:718
struct ib sibank
int getPixelCompressMask(int noImage, int x, int y)
Libere la memoire utilisee par le masque compresse lie a une image.
Definition: bfg_GfxEngine_Dreamcast.c:238
int getResX(void)
Retourne la valeur de la resolution x en pixel.
Definition: bfg_GfxEngine_Dreamcast.c:152
int getKeyStart(void)
Retourne 1 si le bouton START de la manette a ete presse (Dreamcast), ou touche "P" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:810
int chargee
Definition: bfg_GfxEngine_PC.h:30
struct si simage
int sl
Definition: bfg_GfxEngine_PC.h:79
int getKeyDown(void)
Retourne 1 si le bouton BAS de la manette a ete presse (Dreamcast), ou touche "bas" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:795
int getKeyX(void)
Retourne 1 si le bouton X de la manette a ete presse (Dreamcast), ou touche "B" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:780
void waitInMs(int ms)
int getKeyA(void)
Retourne 1 si le bouton A de la manette a ete presse (Dreamcast), ou touche "C" (PC) ...
Definition: bfg_GfxEngine_Dreamcast.c:770
float p2_x
Definition: bfg_GfxEngine_PC.h:64
int sy
Definition: bfg_GfxEngine_PC.h:77
float p4_y
Definition: bfg_GfxEngine_PC.h:69
float p2_y
Definition: bfg_GfxEngine_PC.h:47
int sx
Definition: bfg_GfxEngine_PC.h:40
int chargee
Definition: bfg_GfxEngine_PC.h:75
void termineEcritureVideoTra()
Signale au PVR qu'on a termine l'envoie des polygones transparent (Dreamcast only) ...
Definition: bfg_GfxEngine_Dreamcast.c:406
float p3_y
Definition: bfg_GfxEngine_PC.h:49
float p4_x
Definition: bfg_GfxEngine_PC.h:68
int image_source
Definition: bfg_GfxEngine_PC.h:74
int hauteur
Definition: bfg_GfxEngine_PC.h:31
void destroyGfxEngine()
Definition: bfg_GfxEngine_PC.c:66
void freeAllImage(void)
Detruit toutes les images et libere la memoire (Doublon freeAllImageTra)
Definition: bfg_GfxEngine_Dreamcast.c:727
int sl
Definition: bfg_GfxEngine_PC.h:61
int getResY(void)
Retourne la valeur de la resolution y en pixel.
Definition: bfg_GfxEngine_Dreamcast.c:157
void blitImageBankTra(int ibno, int dx, int dy)
Affiche une imageBank.
Definition: bfg_GfxEngine_Dreamcast.c:481