ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/Client.xs
(Generate patch)

Comparing deliantra/Deliantra-Client/Client.xs (file contents):
Revision 1.11 by root, Mon Apr 10 19:34:03 2006 UTC vs.
Revision 1.12 by root, Mon Apr 10 22:16:33 2006 UTC

104} 104}
105 105
106MODULE = Crossfire::Client PACKAGE = Crossfire::Client::Texture 106MODULE = Crossfire::Client PACKAGE = Crossfire::Client::Texture
107 107
108void 108void
109texture_quad (SV *self, double x0, double y0, double w, double h) 109draw_quad (SV *self, double x, double y, double w = 0, double h = 0)
110 PROTOTYPE: $$$;$$
110 CODE: 111 CODE:
111{ 112{
112 //glBegin 113 HV *hv = (HV *)SvRV (self);
114 double s = SvNV (*hv_fetch (hv, "s", 1, 1));
115 double t = SvNV (*hv_fetch (hv, "t", 1, 1));
116 int name = SvIV (*hv_fetch (hv, "name", 4, 1));
117
118 if (items < 5)
119 {
120 w = SvNV (*hv_fetch (hv, "width", 5, 1));
121 h = SvNV (*hv_fetch (hv, "height", 6, 1));
122 }
123
124 glBindTexture (GL_TEXTURE_2D, name);
125 glBegin (GL_QUADS);
126 glTexCoord2d (0, 0); glVertex2d (x , y );
127 glTexCoord2d (0, t); glVertex2d (x , y + h);
128 glTexCoord2d (s, t); glVertex2d (x + w, y + h);
129 glTexCoord2d (s, 0); glVertex2d (x + w, y );
130 glEnd ();
113} 131}

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines