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.153 by root, Tue Sep 19 22:02:38 2006 UTC vs.
Revision 1.157 by root, Sun Oct 1 14:48:50 2006 UTC

1#ifdef _WIN32 1#ifdef _WIN32
2# define WIN32_LEAN_AND_MEAN 2# define WIN32_LEAN_AND_MEAN
3# define _WIN32_WINNT 0x0500 // needed to get win2000 api calls 3# define _WIN32_WINNT 0x0500 // needed to get win2000 api calls
4# include <malloc.h> 4# include <malloc.h>
5# include <windows.h> 5# include <windows.h>
6# include <wininet.h>
6# pragma warning(disable:4244) 7# pragma warning(disable:4244)
7#endif 8#endif
8 9
9#include "EXTERN.h" 10#include "EXTERN.h"
10#include "perl.h" 11#include "perl.h"
315 316
316 cell = row->col + x - row->c0; 317 cell = row->col + x - row->c0;
317 318
318 cell->darkness = 0; 319 cell->darkness = 0;
319 cell->stat_hp = 0; 320 cell->stat_hp = 0;
321 cell->flags = 0;
322 cell->player = 0;
320 } 323 }
321 } 324 }
322} 325}
323 326
324static void 327static void
649#ifndef _WIN32 652#ifndef _WIN32
650 setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val)); 653 setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val));
651#endif 654#endif
652 655
653void 656void
657win32_proxy_info ()
658 PPCODE:
659{
660#ifdef _WIN32
661 INTERNET_PROXY_INFO proxyinfo;
662 char buffer[2048];
663 DWORD buflen;
664
665 EXTEND (SP, 3);
666
667 buflen = sizeof (buffer);
668 if (InternetQueryOption (0, INTERNET_OPTION_PROXY, (void *)buffer, &buflen))
669 if (((INTERNET_PROXY_INFO *)buffer)->dwAccessType == INTERNET_OPEN_TYPE_PROXY)
670 {
671 PUSHs (newSVpv (((INTERNET_PROXY_INFO *)buffer)->lpszProxy, 0));
672
673 buflen = sizeof (buffer);
674 if (InternetQueryOption (0, INTERNET_OPTION_PROXY_USERNAME, (void *)buffer, &buflen))
675 {
676 PUSHs (newSVpv (buffer, 0));
677
678 buflen = sizeof (buffer);
679 if (InternetQueryOption (0, INTERNET_OPTION_PROXY_PASSWORD, (void *)buffer, &buflen))
680 PUSHs (newSVpv (buffer, 0));
681 }
682 }
683#endif
684}
685
686void
654add_font (char *file) 687add_font (char *file)
655 CODE: 688 CODE:
656 FcConfigAppFontAddFile (0, (const FcChar8 *)file); 689 FcConfigAppFontAddFile (0, (const FcChar8 *)file);
657 690
658void 691void
1244void 1277void
1245scroll (CFPlus::Map self, int dx, int dy) 1278scroll (CFPlus::Map self, int dx, int dy)
1246 CODE: 1279 CODE:
1247{ 1280{
1248 if (dx > 0) 1281 if (dx > 0)
1249 map_blank (self, self->x, self->y, dx - 1, self->h); 1282 map_blank (self, self->x, self->y, dx, self->h);
1250 else if (dx < 0) 1283 else if (dx < 0)
1251 map_blank (self, self->x + self->w + dx + 1, self->y, 1 - dx, self->h); 1284 map_blank (self, self->x + self->w + dx + 1, self->y, -dx, self->h);
1252 1285
1253 if (dy > 0) 1286 if (dy > 0)
1254 map_blank (self, self->x, self->y, self->w, dy - 1); 1287 map_blank (self, self->x, self->y, self->w, dy);
1255 else if (dy < 0) 1288 else if (dy < 0)
1256 map_blank (self, self->x, self->y + self->h + dy + 1, self->w, 1 - dy); 1289 map_blank (self, self->x, self->y + self->h + dy + 1, self->w, -dy);
1257 1290
1258 self->ox += dx; self->x += dx; 1291 self->ox += dx; self->x += dx;
1259 self->oy += dy; self->y += dy; 1292 self->oy += dy; self->y += dy;
1260 1293
1261 while (self->y < 0) 1294 while (self->y < 0)
1287 1320
1288 if (flags & 15) 1321 if (flags & 15)
1289 { 1322 {
1290 if (!cell->darkness) 1323 if (!cell->darkness)
1291 { 1324 {
1325 memset (cell, 0, sizeof (*cell));
1292 cell->darkness = 256; 1326 cell->darkness = 256;
1293 cell->face [0] = 0;
1294 cell->face [1] = 0;
1295 cell->face [2] = 0;
1296 } 1327 }
1297 1328
1298 //TODO: don't trust server data to be in-range(!) 1329 //TODO: don't trust server data to be in-range(!)
1299 1330
1300 if (flags & 8) 1331 if (flags & 8)
1351 { 1382 {
1352 cell->face [2] = self->face [(data [0] << 8) + data [1]]; data += 2; 1383 cell->face [2] = self->face [(data [0] << 8) + data [1]]; data += 2;
1353 } 1384 }
1354 } 1385 }
1355 else 1386 else
1356 {
1357 cell->darkness = 0; 1387 cell->darkness = 0;
1358 cell->stat_hp = 0;
1359 }
1360 } 1388 }
1361} 1389}
1362 1390
1363SV * 1391SV *
1364mapmap (CFPlus::Map self, int x0, int y0, int w, int h) 1392mapmap (CFPlus::Map self, int x0, int y0, int w, int h)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines