texture.c
1.73 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*---------------------------------------------------------------------
Copyright (C) 1997, Nintendo.
File texture.c
Coded by Yoshitaka Yasumoto. Feb 7, 1997.
Modified by
Comments
$Id: texture.c,v 1.1.1.1 2002/05/02 03:27:17 blythe Exp $
---------------------------------------------------------------------*/
#include <ultra64.h>
#include "texture.h"
#define BLACK GPACK_RGBA5551( 0, 0, 0,1)
#define RED GPACK_RGBA5551(255, 0, 0,1)
#define YELLOW GPACK_RGBA5551(255,255, 0,1)
#define GREEN GPACK_RGBA5551( 0,255, 0,1)
#define BLUE GPACK_RGBA5551( 32, 32,255,1)
#define GRAY GPACK_RGBA5551(128,128,128,1)
#define PACK16(a,b,c,d) { (((a)<<16)|(b)), (((c)<<16)|(d)) }
#define PACK4(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
{ (((a)<<28)|((b)<<24)|((c)<<20)|((d)<<16)| \
((e)<<12)|((f)<< 8)|((g)<< 4)|(h)), \
(((i)<<28)|((j)<<24)|((k)<<20)|((l)<<16)| \
((m)<<12)|((n)<< 8)|((o)<< 4)|(p)) }
/*
* RGBA 16b ƥ
*/
#define TXL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
PACK16(a,b,c,d), PACK16(e,f,g,h), PACK16(i,j,k,l), PACK16(m,n,o,p)
#define X BLACK
#define A RED
#define B YELLOW
#define C GREEN
#define D BLUE
TXTR textureRGBA16[] = {
#include "texture_pattern.h"
};
#undef TXL
#undef X
#undef A
#undef B
#undef C
#undef D
/*
* CI 4b ƥ
*/
#define TXL(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p) \
PACK4(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p)
#define X 0
#define A 1
#define B 2
#define C 3
#define D 4
TXTR textureCI4[] = {
#include "texture_pattern.h"
};
TXTR textureCI4pal[] = {
PACK16(BLACK, RED, YELLOW, GREEN ), PACK16(BLUE, GRAY, GRAY, GRAY ),
PACK16(GRAY, GRAY, GRAY, GRAY ), PACK16(GRAY, GRAY, GRAY, GRAY ),
};
#undef TXL
#undef X
#undef A
#undef B
#undef C
#undef D
/*======== End of texture.c ========*/