… | |
… | |
470 | |
470 | |
471 | ++m; |
471 | ++m; |
472 | } |
472 | } |
473 | } |
473 | } |
474 | |
474 | |
|
|
475 | char * |
|
|
476 | SDL_GetError () |
|
|
477 | |
475 | int |
478 | int |
476 | SDL_SetVideoMode (int w, int h, int fullscreen) |
479 | SDL_SetVideoMode (int w, int h, int fullscreen) |
477 | CODE: |
480 | CODE: |
478 | RETVAL = !!SDL_SetVideoMode ( |
481 | RETVAL = !!SDL_SetVideoMode ( |
479 | w, h, 0, SDL_OPENGL | (fullscreen ? SDL_FULLSCREEN : 0) |
482 | w, h, 0, SDL_OPENGL | (fullscreen ? SDL_FULLSCREEN : 0) |
… | |
… | |
670 | } |
673 | } |
671 | |
674 | |
672 | void |
675 | void |
673 | error (char *message) |
676 | error (char *message) |
674 | CODE: |
677 | CODE: |
|
|
678 | fprintf (stderr, "ERROR: %s\n", message); |
675 | #ifdef _WIN32 |
679 | #ifdef _WIN32 |
676 | MessageBox (0, message, "Crossfire+ Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); |
680 | MessageBox (0, message, "Crossfire+ Error", MB_OK | MB_ICONERROR); |
677 | #else |
|
|
678 | fprintf (stderr, "ERROR: %s\n", message); |
|
|
679 | #endif |
681 | #endif |
680 | |
682 | |
681 | void |
683 | void |
682 | fatal (char *message) |
684 | fatal (char *message) |
683 | CODE: |
685 | CODE: |
|
|
686 | fprintf (stderr, "FATAL: %s\n", message); |
684 | #ifdef _WIN32 |
687 | #ifdef _WIN32 |
685 | MessageBox (0, message, "Crossfire+ Fatal Error", MB_OK | MB_ICONERROR | MB_SETFOREGROUND); |
688 | MessageBox (0, message, "Crossfire+ Fatal Error", MB_OK | MB_ICONERROR); |
686 | #else |
|
|
687 | fprintf (stderr, "FATAL: %s\n", message); |
|
|
688 | #endif |
689 | #endif |
689 | exit (1); |
690 | exit (1); |
690 | |
691 | |
691 | MODULE = CFClient PACKAGE = CFClient::Font |
692 | MODULE = CFClient PACKAGE = CFClient::Font |
692 | |
693 | |
… | |
… | |
715 | MODULE = CFClient PACKAGE = CFClient::Layout |
716 | MODULE = CFClient PACKAGE = CFClient::Layout |
716 | |
717 | |
717 | CFClient::Layout |
718 | CFClient::Layout |
718 | new (SV *class, int rgba = 0) |
719 | new (SV *class, int rgba = 0) |
719 | CODE: |
720 | CODE: |
|
|
721 | #if _WIN32 |
|
|
722 | rgba = 0;//D |
|
|
723 | #endif |
720 | New (0, RETVAL, 1, struct cf_layout); |
724 | New (0, RETVAL, 1, struct cf_layout); |
721 | |
725 | |
722 | RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); |
726 | RETVAL->pl = pango_layout_new (rgba ? cairo_context : ft2_context); |
723 | RETVAL->rgba = rgba; |
727 | RETVAL->rgba = rgba; |
724 | RETVAL->r = 1.; |
728 | RETVAL->r = 1.; |
… | |
… | |
904 | |
908 | |
905 | while (p < e) |
909 | while (p < e) |
906 | { |
910 | { |
907 | uint32_t rgba = *p; |
911 | uint32_t rgba = *p; |
908 | rgba = (rgba >> 24) | (rgba << 8); |
912 | rgba = (rgba >> 24) | (rgba << 8); |
|
|
913 | #if 0 |
|
|
914 | #ifdef _WIN32 |
|
|
915 | {//D |
|
|
916 | uint8_t r = rgba >> 24; |
|
|
917 | uint8_t g = rgba >> 16; |
|
|
918 | uint8_t b = rgba >> 8; |
|
|
919 | uint8_t a = rgba >> 0; |
|
|
920 | |
|
|
921 | rgba = (rgba & 0xffffff00) | a; |
|
|
922 | } |
|
|
923 | #endif |
|
|
924 | #endif |
909 | rgba = SDL_SwapBE32 (rgba); |
925 | rgba = SDL_SwapBE32 (rgba); |
910 | *p++ = rgba; |
926 | *p++ = rgba; |
911 | } |
927 | } |
912 | } |
928 | } |
913 | |
929 | |
… | |
… | |
970 | |
986 | |
971 | if (ix) |
987 | if (ix) |
972 | { |
988 | { |
973 | glEnable (GL_BLEND); |
989 | glEnable (GL_BLEND); |
974 | glBlendFunc (ix == 1 ? GL_SRC_ALPHA : GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
990 | glBlendFunc (ix == 1 ? GL_SRC_ALPHA : GL_ONE, GL_ONE_MINUS_SRC_ALPHA); |
|
|
991 | glEnable (GL_ALPHA_TEST); |
|
|
992 | glAlphaFunc (GL_GREATER, 0.01f); |
975 | } |
993 | } |
976 | |
994 | |
977 | glBindTexture (GL_TEXTURE_2D, name); |
995 | glBindTexture (GL_TEXTURE_2D, name); |
978 | |
996 | |
979 | if (wrap_mode) |
997 | if (wrap_mode) |
… | |
… | |
988 | glTexCoord2f (s, t); glVertex2f (x + w, y + h); |
1006 | glTexCoord2f (s, t); glVertex2f (x + w, y + h); |
989 | glTexCoord2f (s, 0); glVertex2f (x + w, y ); |
1007 | glTexCoord2f (s, 0); glVertex2f (x + w, y ); |
990 | glEnd (); |
1008 | glEnd (); |
991 | |
1009 | |
992 | if (ix) |
1010 | if (ix) |
|
|
1011 | { |
|
|
1012 | glDisable (GL_ALPHA_TEST); |
993 | glDisable (GL_BLEND); |
1013 | glDisable (GL_BLEND); |
|
|
1014 | } |
994 | } |
1015 | } |
995 | |
1016 | |
996 | MODULE = CFClient PACKAGE = CFClient::Map |
1017 | MODULE = CFClient PACKAGE = CFClient::Map |
997 | |
1018 | |
998 | CFClient::Map |
1019 | CFClient::Map |
… | |
… | |
1521 | const_iv (GL_ONE_MINUS_DST_ALPHA), |
1542 | const_iv (GL_ONE_MINUS_DST_ALPHA), |
1522 | const_iv (GL_RGB), |
1543 | const_iv (GL_RGB), |
1523 | const_iv (GL_RGBA), |
1544 | const_iv (GL_RGBA), |
1524 | const_iv (GL_UNSIGNED_BYTE), |
1545 | const_iv (GL_UNSIGNED_BYTE), |
1525 | const_iv (GL_ALPHA), |
1546 | const_iv (GL_ALPHA), |
|
|
1547 | const_iv (GL_INTENSITY), |
1526 | const_iv (GL_LUMINANCE), |
1548 | const_iv (GL_LUMINANCE), |
|
|
1549 | const_iv (GL_LUMINANCE_ALPHA), |
1527 | const_iv (GL_FLOAT), |
1550 | const_iv (GL_FLOAT), |
1528 | const_iv (GL_UNSIGNED_INT_8_8_8_8_REV), |
1551 | const_iv (GL_UNSIGNED_INT_8_8_8_8_REV), |
1529 | const_iv (GL_COMPILE), |
1552 | const_iv (GL_COMPILE), |
1530 | const_iv (GL_TEXTURE_1D), |
1553 | const_iv (GL_TEXTURE_1D), |
1531 | const_iv (GL_TEXTURE_2D), |
1554 | const_iv (GL_TEXTURE_2D), |