Informations sur: Un test d'engin (bibli)

Publié par Bubonik le 20/10/2006

Description

Un début de bibli d'engin 2d

Code source (langage c)

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _EIKEN_H
#define _EIKEN_H
#include "python2.4/Python.h"
 
///extracteurs RVBA :
#define RED(pix) (pix)&255
#define GREEN(pix) ((pix)>>8)&255
#define BLUE(pix) ((pix)>>16)&255
#define ALPHA(pix) ((pix)>>24)&255
 
typedef struct Masques { Uint16 taille_unitaire; Uint8 taille_x, taille_y; Uint8 n_variations;	Uint8* pixels; } Masques;
 
typedef struct FicheAnimationTexture {
	Uint16 n_images;	// Le nombre d'images de l'animation
	Uint32 position_depart;
} FicheAnimationTexture;
 
typedef struct AnimationsTextures {
	Uint32 taille_image_materiau;	//65536
	Uint32 taille_sub_image;	//256
	Uint8 t_sub_x, t_sub_y;		//16*16
	Uint16 n_sub_images;		//256
	Uint16 n_sub_x, n_sub_y;	//16*16
	Uint16 taille_index;		// ?
	Uint32* index;
	Uint32* pixels;
} AnimationsTextures;
 
///Engin
typedef struct Engin {
	Uint32 pos_vue_x;	//
	Uint32 pos_vue_y;	//
	Uint32 dest_vue_x;	//
	Uint32 dest_vue_y;	//
	Masques *masques;	//
	AnimationsTextures *materiaux;	//
	/*il faut rajouter des tonnes de trucs :
	 -de quoi gerer les entrées clavier/souris
	 -peut-être de quoi gérer les objets.
	 */
 
	//--méthodes à implémenter après :
	/*
	 Engin.maj () : prend en compte les
	 entrées pour modifier les variables
	 de l'engin, fait avancer la vue vers
	 sa destination, 
	 */
} Engin;
 
Masques *CreerMasques(char *fichier);
FicheAnimationTexture *CreerFicheAnimationTexture(char *fichier);
AnimationsTexture *CreerAnimationTexture(char *fichier);
 
#endif
v6 © Computaid SPRL 2005-2009 - Tous droits réservés - Hébergé par eTigris - Page générée en 0,010 s - Crédits - Stats
1 connecté