… | |
… | |
203 | |
203 | |
204 | typedef uint16_t tileid; |
204 | typedef uint16_t tileid; |
205 | typedef uint16_t faceid; |
205 | typedef uint16_t faceid; |
206 | |
206 | |
207 | typedef struct { |
207 | typedef 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; |
… | |
… | |
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 |
… | |
… | |
2854 | NV x, y, w, h; |
2854 | NV x, y, w, h; |
2855 | SV *draw_x_sv = GvSV (draw_x_gv); |
2855 | SV *draw_x_sv = GvSV (draw_x_gv); |
2856 | SV *draw_y_sv = GvSV (draw_y_gv); |
2856 | SV *draw_y_sv = GvSV (draw_y_gv); |
2857 | SV *draw_w_sv = GvSV (draw_w_gv); |
2857 | SV *draw_w_sv = GvSV (draw_w_gv); |
2858 | SV *draw_h_sv = GvSV (draw_h_gv); |
2858 | SV *draw_h_sv = GvSV (draw_h_gv); |
2859 | SV *hover; |
|
|
2860 | double draw_x, draw_y, draw_w, draw_h; |
2859 | double draw_x, draw_y; |
2861 | |
2860 | |
2862 | if (!SvROK (self)) |
2861 | if (!SvROK (self)) |
2863 | croak ("CFPlus::Base::draw: %s not a reference", SvPV_nolen (self)); |
2862 | croak ("CFPlus::Base::draw: %s not a reference", SvPV_nolen (self)); |
2864 | |
2863 | |
2865 | hv = (HV *)SvRV (self); |
2864 | hv = (HV *)SvRV (self); |
… | |
… | |
2893 | { |
2892 | { |
2894 | svp = hv_fetch (hv, "can_hover", sizeof ("can_hover") - 1, 0); |
2893 | svp = hv_fetch (hv, "can_hover", sizeof ("can_hover") - 1, 0); |
2895 | |
2894 | |
2896 | if (svp && SvTRUE (*svp)) |
2895 | if (svp && SvTRUE (*svp)) |
2897 | { |
2896 | { |
2898 | glColor4f (1*0.2f, 0.8*0.2f, 0.5*0.2f, 0.2f); |
2897 | glColor4f (1.0f * 0.2f, 0.8f * 0.2f, 0.5f * 0.2f, 0.2f); |
2899 | glEnable (GL_BLEND); |
2898 | glEnable (GL_BLEND); |
2900 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
2899 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
2901 | glBegin (GL_QUADS); |
2900 | glBegin (GL_QUADS); |
2902 | glVertex2f (0, 0); |
2901 | glVertex2f (0, 0); |
2903 | glVertex2f (w, 0); |
2902 | glVertex2f (w, 0); |