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.54 by root, Wed Apr 19 23:37:48 2006 UTC vs.
Revision 1.56 by root, Thu Apr 20 09:13:31 2006 UTC

237 break; 237 break;
238 238
239 row->col[x - row->c0].darkness = -1; 239 row->col[x - row->c0].darkness = -1;
240 } 240 }
241 } 241 }
242}
243
244static void
245music_finished ()
246{
247 SDL_UserEvent ev;
248
249 ev.type = SDL_USEREVENT;
250 ev.code = 0;
251 ev.data1 = 0;
252 ev.data2 = 0;
253
254 SDL_PushEvent (&ev);
242} 255}
243 256
244MODULE = CFClient PACKAGE = CFClient 257MODULE = CFClient PACKAGE = CFClient
245 258
246PROTOTYPES: ENABLE 259PROTOTYPES: ENABLE
463 } 476 }
464} 477}
465 478
466int 479int
467Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) 480Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512)
481 POSTCALL:
482 Mix_HookMusicFinished (music_finished);
468 483
469void 484void
470Mix_CloseAudio () 485Mix_CloseAudio ()
471 486
472int 487int
933 cell->darkness = -1; 948 cell->darkness = -1;
934 } 949 }
935} 950}
936 951
937SV * 952SV *
938mapmap (CFClient::Map self, int w, int h) 953mapmap (CFClient::Map self, int x0, int y0, int w, int h)
939 CODE: 954 CODE:
940{ 955{
941 int x0, x1, x; 956 int x1, x;
942 int y0, y1, y; 957 int y1, y;
943 int z; 958 int z;
944 SV *map_sv = newSV (w * h * sizeof (uint32_t)); 959 SV *map_sv = newSV (w * h * sizeof (uint32_t));
945 uint32_t *map = (uint32_t *)SvPVX (map_sv); 960 uint32_t *map = (uint32_t *)SvPVX (map_sv);
946 961
947 SvPOK_only (map_sv); 962 SvPOK_only (map_sv);
948 SvCUR_set (map_sv, w * h * sizeof (uint32_t)); 963 SvCUR_set (map_sv, w * h * sizeof (uint32_t));
949 964
950 x0 = self->x - w / 2; x1 = x0 + w; 965 x0 += self->x; x1 = x0 + w;
951 y0 = self->y - h / 2; y1 = y0 + h; 966 y0 += self->y; y1 = y0 + h;
952 967
953 for (y = y0; y < y1; y++) 968 for (y = y0; y < y1; y++)
954 { 969 {
955 maprow *row = 0 <= y && y < self->rows 970 maprow *row = 0 <= y && y < self->rows
956 ? self->row + y 971 ? self->row + y
1096 *data++ = 0; /* version 0 format */ 1111 *data++ = 0; /* version 0 format */
1097 *data++ = w >> 8; *data++ = w; 1112 *data++ = w >> 8; *data++ = w;
1098 *data++ = h >> 8; *data++ = h; 1113 *data++ = h >> 8; *data++ = h;
1099 1114
1100 // we need to do this 'cause we don't keep an absolute coord system for rows 1115 // we need to do this 'cause we don't keep an absolute coord system for rows
1101 // TODO: treat rows as we treat 1116 // TODO: treat rows as we treat columns
1102 map_get_row (self, y0 + self->y - self->oy);//D 1117 map_get_row (self, y0 + self->y - self->oy);//D
1103 map_get_row (self, y0 + self->y - self->oy + h - 1);//D 1118 map_get_row (self, y0 + self->y - self->oy + h - 1);//D
1104 1119
1105 x0 += self->x - self->ox; 1120 x0 += self->x - self->ox;
1106 y0 += self->y - self->oy; 1121 y0 += self->y - self->oy;
1170 1185
1171 w = *data++ << 8; w |= *data++; 1186 w = *data++ << 8; w |= *data++;
1172 h = *data++ << 8; h |= *data++; 1187 h = *data++ << 8; h |= *data++;
1173 1188
1174 // we need to do this 'cause we don't keep an absolute coord system for rows 1189 // we need to do this 'cause we don't keep an absolute coord system for rows
1175 // TODO: treat rows as we treat 1190 // TODO: treat rows as we treat columns
1176 map_get_row (self, y0 + self->y - self->oy);//D 1191 map_get_row (self, y0 + self->y - self->oy);//D
1177 map_get_row (self, y0 + self->y - self->oy + h - 1);//D 1192 map_get_row (self, y0 + self->y - self->oy + h - 1);//D
1178 1193
1179 x0 += self->x - self->ox; 1194 x0 += self->x - self->ox;
1180 y0 += self->y - self->oy; 1195 y0 += self->y - self->oy;
1319 const_iv (GL_CONVOLUTION_2D), 1334 const_iv (GL_CONVOLUTION_2D),
1320 const_iv (GL_CONVOLUTION_BORDER_MODE), 1335 const_iv (GL_CONVOLUTION_BORDER_MODE),
1321 const_iv (GL_CONSTANT_BORDER), 1336 const_iv (GL_CONSTANT_BORDER),
1322 const_iv (GL_LINES), 1337 const_iv (GL_LINES),
1323 const_iv (GL_QUADS), 1338 const_iv (GL_QUADS),
1339 const_iv (GL_LINE_LOOP),
1324 const_iv (GL_PERSPECTIVE_CORRECTION_HINT), 1340 const_iv (GL_PERSPECTIVE_CORRECTION_HINT),
1325 const_iv (GL_FASTEST), 1341 const_iv (GL_FASTEST),
1326# undef const_iv 1342# undef const_iv
1327 }; 1343 };
1328 1344

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines