ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/Deliantra-Client/rendercache.c
(Generate patch)

Comparing cf.schmorp.de/Deliantra-Client/rendercache.c (file contents):
Revision 1.2 by root, Sat Aug 11 11:41:24 2007 UTC vs.
Revision 1.3 by root, Sat Aug 11 13:46:40 2007 UTC

1typedef struct { 1typedef struct {
2 GLenum mode; 2 GLenum mode;
3 GLenum format; // GL_T2F_V3F, GL_V2F 3 GLenum format; // 0, GL_T2F_V3F, GL_V2F
4 GLint texname; 4 GLint texname;
5 unsigned char r, g, b, a; 5 unsigned char r, g, b, a;
6} rc_key_t; 6} rc_key_t;
7 7
8typedef struct { 8typedef struct {
87 rc_array_t *arr = HeVAL (he); 87 rc_array_t *arr = HeVAL (he);
88 STRLEN len; 88 STRLEN len;
89 char *arr_pv = SvPV (arr, len); 89 char *arr_pv = SvPV (arr, len);
90 GLsizei stride; 90 GLsizei stride;
91 91
92 stride = key->format == GL_T2F_V3F ? sizeof (float) * 5
93 : key->format == GL_V2F ? sizeof (float) * 2
94 : 65536;
95
96 if (key->texname) 92 if (key->texname)
97 { 93 {
98 glBindTexture (GL_TEXTURE_2D, key->texname); 94 glBindTexture (GL_TEXTURE_2D, key->texname);
99 glEnable (GL_TEXTURE_2D); 95 glEnable (GL_TEXTURE_2D);
100 } 96 }
101 else 97 else
102 glDisable (GL_TEXTURE_2D); 98 glDisable (GL_TEXTURE_2D);
103 99
104 glColor4ub (key->r, key->g, key->b, key->a); 100 glColor4ub (key->r, key->g, key->b, key->a);
101
102 stride = key->format == GL_T2F_V3F ? sizeof (float) * 5
103 : key->format == GL_V2F ? sizeof (float) * 2
104 : 65536;
105
105 glInterleavedArrays (key->format, 0, (void *)arr_pv); 106 glInterleavedArrays (key->format, 0, (void *)arr_pv);
106 glDrawArrays (key->mode, 0, len / stride); 107 glDrawArrays (key->mode, 0, len / stride);
107 } 108 }
108 109
109 glDisable (GL_TEXTURE_2D); 110 glDisable (GL_TEXTURE_2D);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines