Ticket #327: plib-1.8.5.patch
| File plib-1.8.5.patch, 10.9 KB (added by michaelvoliveira, 5 years ago) |
|---|
-
configure.in
diff -Naur plib-1.8.5/configure.in plib-1.8.5-haiku/configure.in
old new 36 36 AC_PROG_CXX 37 37 AC_PROG_CXXCPP 38 38 AC_PROG_INSTALL 39 AC_PROG_ RANLIB39 AC_PROG_LIBTOOL 40 40 41 41 dnl Command line arguments 42 42 … … 276 276 277 277 LDFLAGS="$LDFLAGS $X_LIBS" 278 278 279 LIBS="$LIBS $X_PRE_LIBS -lXi -lXmu -lXext -lX11 $X_EXTRA_LIBS -lm"279 LIBS="$LIBS $X_PRE_LIBS $X_EXTRA_LIBS" 280 280 281 281 dnl ========================================================= 282 282 dnl if test "x$x_includes" != "x"; then … … 289 289 AC_CHECK_LIB(pthread, pthread_create) 290 290 AC_CHECK_LIB(GL, glNewList) 291 291 if test "x$ac_cv_lib_GL_glNewList" = "xno" ; then 292 dnl if no GL, check for MesaGL293 AC_CHECK_LIB( MesaGL, glNewList,,292 dnl if no GL, check for GL 293 AC_CHECK_LIB(GL, glNewList,, 294 294 AC_MSG_ERROR([could not find working GL library])) 295 295 fi 296 296 … … 356 356 CFLAGS="$CFLAGS $WFLAG" 357 357 CXXFLAGS="$CXXFLAGS $WFLAG" 358 358 359 dnl Required to build shared libraries later 360 CFLAGS="$CFLAGS -fPIC" 361 CPPFLAGS="$CFLAGS" 362 CXXFLAGS="$CFLAGS" 363 359 364 dnl FreeBSD requires the -pthread switch to enable pthreads. Look for this 360 365 dnl weirdness. 361 366 save_CXXFLAGS="$CXXFLAGS" -
src/fnt/fntTXF.cxx
diff -Naur plib-1.8.5/src/fnt/fntTXF.cxx plib-1.8.5-haiku/src/fnt/fntTXF.cxx
old new 30 30 # include <OpenGL/CGLCurrent.h> 31 31 #elif defined(UL_WIN32) 32 32 /* Nothing */ 33 #elif defined(UL_BEOS) 34 /* Nothing */ 33 35 #else 34 36 # include <GL/glx.h> 35 37 #endif … … 44 46 return ( aglGetCurrentContext () != NULL ) ; 45 47 #elif defined(UL_MAC_OSX) 46 48 return ( CGLGetCurrentContext () != NULL ) ; 49 #elif defined(UL_BEOS) 50 return true ; 47 51 #else 48 52 return ( glXGetCurrentContext () != NULL ) ; 49 53 #endif -
src/js/jsNone.cxx
diff -Naur plib-1.8.5/src/js/jsNone.cxx plib-1.8.5-haiku/src/js/jsNone.cxx
old new 22 22 23 23 #include "js.h" 24 24 25 #if defined(UL_IRIX) || defined(UL_SOLARIS) || defined (UL_HPUX) 25 #if defined(UL_IRIX) || defined(UL_SOLARIS) || defined (UL_HPUX) || defined (UL_BEOS) 26 26 27 27 struct os_specific_s ; 28 28 -
src/pui/pu.cxx
diff -Naur plib-1.8.5/src/pui/pu.cxx plib-1.8.5-haiku/src/pui/pu.cxx
old new 27 27 # include <agl.h> 28 28 #elif defined(UL_CGL) 29 29 # include <OpenGL/CGLCurrent.h> 30 #elif defined(UL_GLX) 30 #elif defined(UL_GLX) && !defined(UL_BEOS) 31 31 # include <GL/glx.h> 32 32 #endif 33 33 … … 107 107 return ( aglGetCurrentContext () != NULL ) ; 108 108 #elif defined(UL_CGL) 109 109 return ( CGLGetCurrentContext () != NULL ) ; 110 #elif defined(UL_GLX) 110 #elif defined(UL_GLX) && !defined(UL_BEOS) 111 111 return ( glXGetCurrentContext () != NULL ) ; 112 112 #else 113 113 return true ; -
src/pw/Makefile.am
diff -Naur plib-1.8.5/src/pw/Makefile.am plib-1.8.5-haiku/src/pw/Makefile.am
old new 4 4 5 5 include_HEADERS = pw.h 6 6 7 libplibpw_a_SOURCES = pw.cxx pwX11.cxx pw Windows.cxx pwMacOSX.cxx7 libplibpw_a_SOURCES = pw.cxx pwX11.cxx pwHaiku.cxx pwWindows.cxx pwMacOSX.cxx 8 8 9 9 INCLUDES = -I$(top_srcdir)/src/util 10 10 -
src/pw/pwHaiku.cxx
diff -Naur plib-1.8.5/src/pw/pwHaiku.cxx plib-1.8.5-haiku/src/pw/pwHaiku.cxx
old new 1 #include "ul.h" 2 3 /* ONLY COMPILE THIS FILE FOR HAIKU/BEOS EQUIPPED SYSTEMS */ 4 5 #if defined(UL_BEOS) 6 7 #include "pw.h" 8 9 #include <stdio.h> 10 #include <stdlib.h> 11 #include <math.h> 12 #include <string.h> 13 #include <assert.h> 14 15 #include <GL/gl.h> 16 17 static bool initialised = false ; 18 static bool insideCallback = false ; 19 static int modifiers = 0 ; 20 static int origin [2] = { 0, 0 } ; 21 static int size [2] = { 640, 480 } ; 22 static int currScreen = 0 ; 23 static int currConnect = 0 ; 24 static int currCursor = PW_CURSOR_LEFT ; 25 26 static pwResizeCB *resizeCB = NULL ; 27 static pwExitCB *exitCB = NULL ; 28 static pwKeybdFunc *kbCB = NULL ; 29 static pwMouseFunc *msCB = NULL ; 30 static pwMousePosFunc *mpCB = NULL ; 31 32 static bool autoRepeat = false ; 33 34 void pwSetAutoRepeatKey ( bool enable ) 35 { 36 autoRepeat = enable ; 37 } 38 39 40 struct PixelFormat 41 { 42 int num_samples ; 43 int bits_per_pixel ; ; 44 int z_bits ; 45 } ; 46 47 48 static PixelFormat preferred_pixel_formats [] = 49 { 50 /* NumSamples, RGB_bits, Z_bits */ 51 52 { 0, 24, 24 }, /* Progressively nastier image formats */ 53 { 0, 16, 24 }, 54 { 0, 16, 16 }, 55 { 0, 3, 16 }, 56 { 0, 3, 1 }, 57 { -1, -1, -1 } /* Magic end marker */ 58 } ; 59 60 61 void defaultExitFunc () 62 { 63 pwCleanup () ; 64 exit ( 0 ) ; 65 } 66 67 68 void pwInit ( int multisample, int num_samples ) 69 { 70 pwInit ( 0, 0, -1, -1, multisample, "NoName", FALSE, num_samples ) ; 71 } 72 73 74 void pwSetCallbacks ( pwKeybdFunc *kb, pwMouseFunc *ms, 75 pwMousePosFunc *mp, pwResizeCB *rcb, 76 pwExitCB *ecb ) 77 { 78 if ( ! initialised ) 79 { 80 fprintf ( stderr, "PW: You must not call pwSetCallbacks before pwInit.\n"); 81 exit ( 1 ) ; 82 } 83 84 kbCB = kb ; 85 msCB = ms ; 86 mpCB = mp ; 87 resizeCB = rcb ; 88 exitCB = ecb ? ecb : defaultExitFunc ; 89 } 90 91 92 void pwInit ( int x, int y, int w, int h, int multisample, 93 char *title, int border, int num_samples ) 94 { 95 char *displayName = getenv ( "DISPLAY" ) ; 96 97 if ( displayName == NULL ) displayName = ":0.0" ; 98 99 pwSetCursor ( PW_CURSOR_LEFT ) ; 100 101 #ifdef GL_MULTISAMPLE_FILTER_HINT_NV 102 glHint ( GL_MULTISAMPLE_FILTER_HINT_NV, multisample ) ; 103 #endif 104 105 kbCB = NULL ; 106 msCB = NULL ; 107 mpCB = NULL ; 108 resizeCB = NULL ; 109 exitCB = defaultExitFunc ; 110 111 initialised = true ; 112 insideCallback = false ; 113 114 glClear ( GL_COLOR_BUFFER_BIT ) ; 115 pwSwapBuffers () ; 116 glClear ( GL_COLOR_BUFFER_BIT ) ; 117 pwSwapBuffers () ; 118 } 119 120 121 void pwGetSize ( int *w, int *h ) 122 { 123 if ( w ) *w = size[0] ; 124 if ( h ) *h = size[1] ; 125 } 126 127 128 void pwSetCursor ( int c ) 129 { 130 131 } 132 133 134 void pwSetSize ( int w, int h ) 135 { 136 137 } 138 139 140 void pwSetOrigin ( int x, int y ) 141 { 142 143 } 144 145 146 void pwSetSizeOrigin ( int x, int y, int w, int h ) 147 { 148 149 } 150 151 int pwGetModifiers () 152 { 153 return modifiers ; 154 } 155 156 157 static void getEvents () 158 { 159 160 } 161 162 163 void pwSwapBuffers () 164 { 165 if ( ! initialised ) 166 { 167 fprintf ( stderr, "PLIB/PW: FATAL - Application called pwSwapBuffers" 168 " before pwInit.\n" ) ; 169 exit ( 1 ) ; 170 } 171 172 if ( insideCallback ) 173 { 174 fprintf ( stderr, "PLIB/PW: FATAL - Application called pwSwapBuffers" 175 " from inside a callback function.\n" ) ; 176 exit ( 1 ) ; 177 } 178 179 glFlush () ; 180 getEvents () ; 181 } 182 183 184 #ifdef NEED_GAMMA 185 void pwSetGamma ( float g ) 186 { 187 188 } 189 #endif 190 191 192 void pwCleanup () 193 { 194 if ( ! initialised ) 195 fprintf ( stderr, "PLIB/PW: WARNING - Application called pwCleanup" 196 " before pwInit.\n" ) ; 197 } 198 199 200 #endif -
src/pw/pwX11.cxx
diff -Naur plib-1.8.5/src/pw/pwX11.cxx plib-1.8.5-haiku/src/pw/pwX11.cxx
old new 2 2 3 3 /* ONLY COMPILE THIS FILE FOR GLX/X11 EQUIPPED SYSTEMS */ 4 4 5 #if def UL_GLX5 #if defined(UL_GLX) && !defined(UL_BEOS) 6 6 7 7 #include "pw.h" 8 8 -
src/sl/sl.h
diff -Naur plib-1.8.5/src/sl/sl.h plib-1.8.5-haiku/src/sl/sl.h
old new 44 44 #define SLDSP_DEFAULT_DEVICE "/dev/audio" 45 45 #elif defined(UL_MACINTOSH) || defined(UL_MAC_OSX) 46 46 #define SLDSP_DEFAULT_DEVICE "dsp" // dummy 47 #elif defined(UL_BEOS) 48 #define SLDSP_DEFAULT_DEVICE "/dev/audio" 47 49 #else 48 50 #error "Port me !" 49 51 #endif -
src/sl/slDSP.cxx
diff -Naur plib-1.8.5/src/sl/slDSP.cxx plib-1.8.5-haiku/src/sl/slDSP.cxx
old new 1080 1080 return secUsed; 1081 1081 } 1082 1082 1083 /* ------------------------------------------------------------ */ 1084 /* Haiku/BeOS audio */ 1085 /* ------------------------------------------------------------ */ 1086 1087 #elif defined(UL_BEOS) 1088 1089 void slDSP::open ( const char *device, int _rate, int _stereo, int _bps ) 1090 { 1091 1092 } 1093 1094 1095 void slDSP::close () 1096 { 1097 1098 } 1099 1100 1101 int slDSP::getDriverBufferSize () 1102 { 1103 if ( error ) 1104 return 0 ; 1105 } 1106 1107 void slDSP::getBufferInfo () 1108 { 1109 if ( error ) 1110 return ; 1111 } 1112 1113 1114 void slDSP::write ( void *buffer, size_t length ) 1115 { 1116 1117 } 1118 1119 1120 float slDSP::secondsRemaining () 1121 { 1122 int samples_remain; 1123 1124 if ( error ) 1125 return 0.0f ; 1126 } 1127 1128 1129 float slDSP::secondsUsed () 1130 { 1131 int samples_used; 1132 1133 if ( error ) 1134 return 0.0f ; 1135 } 1136 1137 1138 void slDSP::sync () 1139 { 1140 if ( error ) 1141 return ; 1142 } 1143 1144 void slDSP::stop () 1145 { 1146 } 1147 1148 1083 1149 #endif 1084 1150 1085 1151 -
src/ssg/ssg.cxx
diff -Naur plib-1.8.5/src/ssg/ssg.cxx plib-1.8.5-haiku/src/ssg/ssg.cxx
old new 31 31 # include <OpenGL/CGLCurrent.h> 32 32 #elif defined(UL_WIN32) 33 33 /* Nothing */ 34 #elif defined(UL_BEOS) 35 /* Nothing */ 34 36 #else 35 37 # include <GL/glx.h> 36 38 #endif … … 45 47 return ( aglGetCurrentContext () != NULL ) ; 46 48 #elif defined(UL_MAC_OSX) 47 49 return ( CGLGetCurrentContext () != NULL ) ; 50 #elif defined(UL_BEOS) 51 return true ; 48 52 #else 49 53 return ( glXGetCurrentContext () != NULL ) ; 50 54 #endif -
src/util/ul.h
diff -Naur plib-1.8.5/src/util/ul.h plib-1.8.5-haiku/src/util/ul.h
old new 60 60 #define UL_WIN32 1 61 61 #define UL_MSVC 1 /* Windoze AND MSVC. */ 62 62 63 #elif defined(__BEOS__) 63 #elif defined(__BEOS__) || defined(__HAIKU__) 64 64 65 65 #define UL_BEOS 1 66 66 … … 118 118 119 119 #ifdef UL_BEOS 120 120 #include <be/kernel/image.h> 121 #define UL_GLX 1121 #define UL_GLX 0 122 122 #endif 123 123 124 124 #ifdef UL_MACINTOSH … … 647 647 } 648 648 }; 649 649 650 #elif defined (__BEOS__) 650 #elif defined (__BEOS__) || (__HAIKU__) 651 651 652 652 class ulDynamicLibrary 653 653 { … … 675 675 { 676 676 void *sym = NULL ; 677 677 678 if ( handle &&679 get_image_symbol ( handle, "funcname",678 if ( *handle && 679 get_image_symbol ( *handle, "funcname", 680 680 B_SYMBOL_TYPE_TEXT, &sym ) == B_NO_ERROR ) 681 681 return sym ; 682 682 … … 686 686 ~ulDynamicLibrary () 687 687 { 688 688 if ( handle != NULL ) 689 unload_add_on ( handle ) ;689 unload_add_on ( *handle ) ; 690 690 691 691 delete handle ; 692 692 }
