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.226 by root, Sat Aug 11 13:05:58 2007 UTC vs.
Revision 1.231 by root, Sun Aug 19 14:09:28 2007 UTC

203 203
204typedef uint16_t tileid; 204typedef uint16_t tileid;
205typedef uint16_t faceid; 205typedef uint16_t faceid;
206 206
207typedef struct { 207typedef struct {
208 int name; 208 GLuint name;
209 int w, h; 209 int w, h;
210 float s, t; 210 float s, t;
211 uint8_t r, g, b, a; 211 uint8_t r, g, b, a;
212 tileid smoothtile; 212 tileid smoothtile;
213 uint8_t smoothlevel; 213 uint8_t smoothlevel;
715 715
716 if (RETVAL) 716 if (RETVAL)
717 { 717 {
718 av_clear (texture_av); 718 av_clear (texture_av);
719 719
720 SDL_WM_SetCaption ("Crossfire+ Client " VERSION, "Crossfire+"); 720 SDL_WM_SetCaption ("Crossfire TRT Client " VERSION, "Crossfire TRT");
721#define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name); 721#define GL_FUNC(ptr,name) gl.name = (ptr)SDL_GL_GetProcAddress ("gl" # name);
722#include "glfunc.h" 722#include "glfunc.h"
723#undef GL_FUNC 723#undef GL_FUNC
724 } 724 }
725} 725}
2243 int x, y, z; 2243 int x, y, z;
2244 int w, h; 2244 int w, h;
2245 int x1, y1; 2245 int x1, y1;
2246 2246
2247 if (*data++ != 0) 2247 if (*data++ != 0)
2248 return; /* version mismatch */ 2248 XSRETURN_EMPTY; /* version mismatch */
2249 2249
2250 w = *data++ << 8; w |= *data++; 2250 w = *data++ << 8; w |= *data++;
2251 h = *data++ << 8; h |= *data++; 2251 h = *data++ << 8; h |= *data++;
2252 2252
2253 // we need to do this 'cause we don't keep an absolute coord system for rows 2253 // we need to do this 'cause we don't keep an absolute coord system for rows
2549 const_iv (GL_INTENSITY), 2549 const_iv (GL_INTENSITY),
2550 const_iv (GL_LUMINANCE), 2550 const_iv (GL_LUMINANCE),
2551 const_iv (GL_LUMINANCE_ALPHA), 2551 const_iv (GL_LUMINANCE_ALPHA),
2552 const_iv (GL_FLOAT), 2552 const_iv (GL_FLOAT),
2553 const_iv (GL_UNSIGNED_INT_8_8_8_8_REV), 2553 const_iv (GL_UNSIGNED_INT_8_8_8_8_REV),
2554 const_iv (GL_COMPRESSED_ALPHA_ARB),
2555 const_iv (GL_COMPRESSED_LUMINANCE_ARB),
2556 const_iv (GL_COMPRESSED_LUMINANCE_ALPHA_ARB),
2557 const_iv (GL_COMPRESSED_INTENSITY_ARB),
2558 const_iv (GL_COMPRESSED_RGB_ARB),
2559 const_iv (GL_COMPRESSED_RGBA_ARB),
2554 const_iv (GL_COMPILE), 2560 const_iv (GL_COMPILE),
2555 const_iv (GL_PROXY_TEXTURE_1D), 2561 const_iv (GL_PROXY_TEXTURE_1D),
2556 const_iv (GL_PROXY_TEXTURE_2D), 2562 const_iv (GL_PROXY_TEXTURE_2D),
2557 const_iv (GL_TEXTURE_1D), 2563 const_iv (GL_TEXTURE_1D),
2558 const_iv (GL_TEXTURE_2D), 2564 const_iv (GL_TEXTURE_2D),
2614 2620
2615 texture_av = newAV (); 2621 texture_av = newAV ();
2616 AvREAL_off (texture_av); 2622 AvREAL_off (texture_av);
2617} 2623}
2618 2624
2625void
2626disable_GL_EXT_blend_func_separate ()
2627 CODE:
2628 gl.BlendFuncSeparate = 0;
2629 gl.BlendFuncSeparateEXT = 0;
2630
2619char * 2631char *
2620gl_vendor () 2632gl_vendor ()
2621 CODE: 2633 CODE:
2622 RETVAL = (char *)glGetString (GL_VENDOR); 2634 RETVAL = (char *)glGetString (GL_VENDOR);
2623 OUTPUT: 2635 OUTPUT:
2854 NV x, y, w, h; 2866 NV x, y, w, h;
2855 SV *draw_x_sv = GvSV (draw_x_gv); 2867 SV *draw_x_sv = GvSV (draw_x_gv);
2856 SV *draw_y_sv = GvSV (draw_y_gv); 2868 SV *draw_y_sv = GvSV (draw_y_gv);
2857 SV *draw_w_sv = GvSV (draw_w_gv); 2869 SV *draw_w_sv = GvSV (draw_w_gv);
2858 SV *draw_h_sv = GvSV (draw_h_gv); 2870 SV *draw_h_sv = GvSV (draw_h_gv);
2859 SV *hover;
2860 double draw_x, draw_y, draw_w, draw_h; 2871 double draw_x, draw_y;
2861 2872
2862 if (!SvROK (self)) 2873 if (!SvROK (self))
2863 croak ("CFPlus::Base::draw: %s not a reference", SvPV_nolen (self)); 2874 croak ("CFPlus::Base::draw: %s not a reference", SvPV_nolen (self));
2864 2875
2865 hv = (HV *)SvRV (self); 2876 hv = (HV *)SvRV (self);
2893 { 2904 {
2894 svp = hv_fetch (hv, "can_hover", sizeof ("can_hover") - 1, 0); 2905 svp = hv_fetch (hv, "can_hover", sizeof ("can_hover") - 1, 0);
2895 2906
2896 if (svp && SvTRUE (*svp)) 2907 if (svp && SvTRUE (*svp))
2897 { 2908 {
2898 glColor4f (1*0.2f, 0.8*0.2f, 0.5*0.2f, 0.2f); 2909 glColor4f (1.0f * 0.2f, 0.8f * 0.2f, 0.5f * 0.2f, 0.2f);
2899 glEnable (GL_BLEND); 2910 glEnable (GL_BLEND);
2900 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); 2911 glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
2901 glBegin (GL_QUADS); 2912 glBegin (GL_QUADS);
2902 glVertex2f (0, 0); 2913 glVertex2f (0, 0);
2903 glVertex2f (w, 0); 2914 glVertex2f (w, 0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines