--- deliantra/Deliantra-Client/Client.xs 2006/04/12 20:42:52 1.23 +++ deliantra/Deliantra-Client/Client.xs 2006/04/12 21:20:42 1.25 @@ -3,6 +3,7 @@ #include "XSUB.h" #include +#include #include #include @@ -12,10 +13,6 @@ #include #include -#include -#include -#include - #include #include #include @@ -151,7 +148,7 @@ SDL_LockSurface (surface2); PUSHs (sv_2mortal (newSVpvn (surface2->pixels, surface2->h * surface2->pitch))); SDL_UnlockSurface (surface2); - PUSHs (sv_2mortal (newSViv (surface->format->Amask ? GL_RGBA : GL_RGB))); + PUSHs (sv_2mortal (newSViv (surface->flags & (SDL_SRCCOLORKEY | SDL_SRCALPHA) ? GL_RGBA : GL_RGB))); PUSHs (sv_2mortal (newSViv (GL_RGBA))); PUSHs (sv_2mortal (newSViv (GL_UNSIGNED_INT_8_8_8_8_REV))); @@ -159,6 +156,16 @@ SDL_FreeSurface (surface2); } +void +fatal (char *message) + CODE: +#ifdef WIN32 + MessageBox (0, message, "Crossfire+ Fatal Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); +#else + fprintf (stderr, "%s\n", message); +#endif + exit (1); + MODULE = CFClient PACKAGE = CFClient::Layout CFClient::Layout