--- deliantra/Deliantra-Client/Client.xs 2006/05/19 03:49:47 1.85 +++ deliantra/Deliantra-Client/Client.xs 2006/05/22 03:28:54 1.91 @@ -446,7 +446,7 @@ SDL_GL_SetAttribute (SDL_GL_ALPHA_SIZE, 1); SDL_GL_SetAttribute (SDL_GL_BUFFER_SIZE, 15); - SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 0); + SDL_GL_SetAttribute (SDL_GL_DEPTH_SIZE, 16); SDL_GL_SetAttribute (SDL_GL_ACCUM_RED_SIZE, 0); SDL_GL_SetAttribute (SDL_GL_ACCUM_GREEN_SIZE, 0); @@ -472,6 +472,9 @@ } } +char * +SDL_GetError () + int SDL_SetVideoMode (int w, int h, int fullscreen) CODE: @@ -672,19 +675,17 @@ void error (char *message) CODE: -#ifdef _WIN32 - MessageBox (0, message, "Crossfire+ Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); -#else fprintf (stderr, "ERROR: %s\n", message); +#ifdef _WIN32 + MessageBox (0, message, "Crossfire+ Error", MB_OK | MB_ICONERROR); #endif void fatal (char *message) CODE: -#ifdef _WIN32 - MessageBox (0, message, "Crossfire+ Fatal Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); -#else fprintf (stderr, "FATAL: %s\n", message); +#ifdef _WIN32 + MessageBox (0, message, "Crossfire+ Fatal Error", MB_OK | MB_ICONERROR); #endif exit (1); @@ -717,6 +718,9 @@ CFClient::Layout new (SV *class, int rgba = 0) CODE: +#if _WIN32 + rgba = 0;//D +#endif New (0, RETVAL, 1, struct cf_layout); RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); @@ -906,6 +910,18 @@ { uint32_t rgba = *p; rgba = (rgba >> 24) | (rgba << 8); +#if 0 +#ifdef _WIN32 + {//D + uint8_t r = rgba >> 24; + uint8_t g = rgba >> 16; + uint8_t b = rgba >> 8; + uint8_t a = rgba >> 0; + + rgba = (rgba & 0xffffff00) | a; + } +#endif +#endif rgba = SDL_SwapBE32 (rgba); *p++ = rgba; } @@ -972,6 +988,8 @@ { glEnable (GL_BLEND); glBlendFunc (ix == 1 ? GL_SRC_ALPHA : GL_ONE, GL_ONE_MINUS_SRC_ALPHA); + glEnable (GL_ALPHA_TEST); + glAlphaFunc (GL_GREATER, 0.01f); } glBindTexture (GL_TEXTURE_2D, name); @@ -990,7 +1008,10 @@ glEnd (); if (ix) - glDisable (GL_BLEND); + { + glDisable (GL_ALPHA_TEST); + glDisable (GL_BLEND); + } } MODULE = CFClient PACKAGE = CFClient::Map @@ -1511,7 +1532,12 @@ const_iv (GL_FLAT), const_iv (GL_DITHER), const_iv (GL_BLEND), + const_iv (GL_CULL_FACE), const_iv (GL_SCISSOR_TEST), + const_iv (GL_DEPTH_TEST), + const_iv (GL_ALPHA_TEST), + const_iv (GL_NORMALIZE), + const_iv (GL_RESCALE_NORMAL), const_iv (GL_AND), const_iv (GL_ONE), const_iv (GL_ZERO), @@ -1522,8 +1548,12 @@ const_iv (GL_RGB), const_iv (GL_RGBA), const_iv (GL_UNSIGNED_BYTE), + const_iv (GL_UNSIGNED_SHORT), + const_iv (GL_UNSIGNED_INT), const_iv (GL_ALPHA), + const_iv (GL_INTENSITY), const_iv (GL_LUMINANCE), + const_iv (GL_LUMINANCE_ALPHA), const_iv (GL_FLOAT), const_iv (GL_UNSIGNED_INT_8_8_8_8_REV), const_iv (GL_COMPILE), @@ -1547,6 +1577,7 @@ const_iv (GL_MODULATE), const_iv (GL_DECAL), const_iv (GL_REPLACE), + const_iv (GL_DEPTH_BUFFER_BIT), const_iv (GL_COLOR_BUFFER_BIT), const_iv (GL_PROJECTION), const_iv (GL_MODELVIEW), @@ -1556,10 +1587,18 @@ const_iv (GL_CONVOLUTION_BORDER_MODE), const_iv (GL_CONSTANT_BORDER), const_iv (GL_LINES), - const_iv (GL_QUADS), const_iv (GL_LINE_LOOP), + const_iv (GL_QUADS), + const_iv (GL_QUAD_STRIP), + const_iv (GL_TRIANGLES), + const_iv (GL_TRIANGLE_STRIP), + const_iv (GL_TRIANGLE_FAN), const_iv (GL_PERSPECTIVE_CORRECTION_HINT), const_iv (GL_FASTEST), + const_iv (GL_V2F), + const_iv (GL_V3F), + const_iv (GL_T2F_V3F), + const_iv (GL_T2F_N3F_V3F), # undef const_iv }; @@ -1584,6 +1623,8 @@ void glBlendFunc (int sfactor, int dfactor) +void glDepthMask (int flag) + void glLogicOp (int opcode) void glColorMask (int red, int green, int blue, int alpha) @@ -1596,7 +1637,10 @@ void glLoadIdentity () -# near and far are due to microsofts buggy c compiler +# near_ and far_ are due to microsofts buggy "c" compiler +void glFrustum (double left, double right, double bottom, double top, double near_, double far_) + +# near_ and far_ are due to microsofts buggy "c" compiler void glOrtho (double left, double right, double bottom, double top, double near_, double far_) void glViewport (int x, int y, int width, int height) @@ -1622,11 +1666,23 @@ void glColor (float r, float g, float b, float a = 1.0) PROTOTYPE: @ CODE: + // microsoft visual "c" rounds instead of truncating... glColor4ub (MIN ((int)(r * 255.f), 255), MIN ((int)(g * 255.f), 255), MIN ((int)(b * 255.f), 255), MIN ((int)(a * 255.f), 255)); +void glInterleavedArrays (int format, int stride, char *data) + +void glDrawElements (int mode, int count, int type, char *indices) + +# 1.2 void glDrawRangeElements (int mode, int start, int end + +void glRasterPos (float x, float y, float z = 0.) + CODE: + glRasterPos3f (0, 0, z); + glBitmap (0, 0, 0, 0, x, y, 0); + void glVertex (float x, float y, float z = 0.) CODE: glVertex3f (x, y, z); @@ -1663,9 +1719,7 @@ void glCopyTexImage2D (int target, int level, int internalformat, int x, int y, int width, int height, int border) -void glRasterPos (int x, int y) - CODE: - glRasterPos2i (x, y); +void glDrawPixels (int width, int height, int format, int type, char *pixels) void glCopyPixels (int x, int y, int width, int height, int type = GL_COLOR) @@ -1702,3 +1756,4 @@ void glCallList (int list) +