Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv27059/src/native/linux Modified Files: extxcursor.cpp org_lwjgl_Display.cpp org_lwjgl_Sys.cpp org_lwjgl_input_Mouse.cpp org_lwjgl_opengl_Pbuffer.cpp org_lwjgl_opengl_Window.cpp Log Message: Reduced Sys.debug from bool -> int Index: extxcursor.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/extxcursor.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- extxcursor.cpp 20 Dec 2003 14:01:30 -0000 1.6 +++ extxcursor.cpp 20 Dec 2003 22:03:25 -0000 1.7 @@ -40,7 +40,7 @@ load_success = false; xcursor_handle = dlopen(xcursor_lib_name, RTLD_GLOBAL | RTLD_LAZY); if (xcursor_handle == NULL) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not load %s: %s\n", xcursor_lib_name, dlerror()); + printfDebug("Could not load %s: %s\n", xcursor_lib_name, dlerror()); return load_success; } loadFunctionPointers(); Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- org_lwjgl_Display.cpp 20 Dec 2003 14:01:30 -0000 1.44 +++ org_lwjgl_Display.cpp 20 Dec 2003 22:03:25 -0000 1.45 @@ -61,14 +61,14 @@ int event_base, error_base; if (!XF86VidModeQueryExtension(disp, &event_base, &error_base)) { - printfDebug(org_lwjgl_Sys_DEBUG, "XF86VidMode extension not available\n"); + printfDebug("XF86VidMode extension not available\n"); return false; } if (!XF86VidModeQueryVersion(disp, major, minor)) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not determine XF86VidMode version\n"); + printfDebug("Could not determine XF86VidMode version\n"); return false; } - printfDebug(org_lwjgl_Sys_DEBUG, "XF86VidMode extension version %i.%i\n", *major, *minor); + printfDebug("XF86VidMode extension version %i.%i\n", *major, *minor); return true; } @@ -84,15 +84,15 @@ int num_modes, i; XF86VidModeModeInfo **avail_modes; if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not get display modes\n"); + printfDebug("Could not get display modes\n"); return false; } XF86VidModeLockModeSwitch(disp, screen, 0); for ( i = 0; i < num_modes; ++i ) { - printfDebug(org_lwjgl_Sys_DEBUG, "Mode %d: %dx%d\n", i, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay); + printfDebug("Mode %d: %dx%d\n", i, avail_modes[i]->hdisplay, avail_modes[i]->vdisplay); if (avail_modes[i]->hdisplay == width && avail_modes[i]->vdisplay == height) { if (!XF86VidModeSwitchToMode(disp, screen, avail_modes[i])) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not switch mode\n"); + printfDebug("Could not switch mode\n"); break; } if (lock_mode) @@ -118,11 +118,11 @@ static int getGammaRampLength(Display *disp, int screen) { int minor_ver, major_ver, ramp_size; if (!getVidModeExtensionVersion(disp, screen, &major_ver, &minor_ver) || major_ver < 2) { - printfDebug(org_lwjgl_Sys_DEBUG, "XF86VidMode extension version >= 2 not found\n"); + printfDebug("XF86VidMode extension version >= 2 not found\n"); return 0; } if (XF86VidModeGetGammaRampSize(disp, screen, &ramp_size) == False) { - printfDebug(org_lwjgl_Sys_DEBUG, "XF86VidModeGetGammaRampSize call failed\n"); + printfDebug("XF86VidModeGetGammaRampSize call failed\n"); return 0; } return ramp_size; @@ -136,18 +136,18 @@ int screen; Display *disp = XOpenDisplay(NULL); if (disp == NULL) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not open X connection\n"); + printfDebug("Could not open X connection\n"); return; } screen = DefaultScreen(disp); if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not get display modes\n"); + printfDebug("Could not get display modes\n"); } saved_width = avail_modes[0]->hdisplay; saved_height = avail_modes[0]->vdisplay; int bpp = XDefaultDepth(disp, screen); - printfDebug(org_lwjgl_Sys_DEBUG, "Saved width, height %d, %d\n", saved_width, saved_height); + printfDebug("Saved width, height %d, %d\n", saved_width, saved_height); jclass jclass_DisplayMode = env->FindClass("org/lwjgl/DisplayMode"); jmethodID ctor = env->GetMethodID(jclass_DisplayMode, "<init>", "(IIII)V"); jobject newMode = env->NewObject(jclass_DisplayMode, ctor, saved_width, saved_height, bpp, 0); @@ -195,7 +195,7 @@ Display *disp = XOpenDisplay(NULL); if (disp == NULL) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not open X connection\n"); + printfDebug("Could not open X connection\n"); return; } screen = DefaultScreen(disp); @@ -216,7 +216,7 @@ XF86VidModeModeInfo **avail_modes; if (disp == NULL) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not open X connection\n"); + printfDebug("Could not open X connection\n"); return NULL; } @@ -224,7 +224,7 @@ int bpp = XDefaultDepth(disp, screen); if (!getDisplayModes(disp, screen, &num_modes, &avail_modes)) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not get display modes\n"); + printfDebug("Could not get display modes\n"); XCloseDisplay(disp); return NULL; } Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- org_lwjgl_Sys.cpp 20 Dec 2003 14:01:30 -0000 1.21 +++ org_lwjgl_Sys.cpp 20 Dec 2003 22:03:25 -0000 1.22 @@ -63,15 +63,15 @@ static long queryTime(void) { struct timeval tv; if (gettimeofday(&tv, NULL) == -1) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not read current time\n"); + printfDebug("Could not read current time\n"); } long result = tv.tv_sec * 1000000l + tv.tv_usec; return result; } -JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setDebugLevel(JNIEnv *env, jclass clazz, jint debug_level) { - setDebugLevel(debug_level); +JNIEXPORT void JNICALL Java_org_lwjgl_Sys_setDebug(JNIEnv *env, jclass clazz, jboolean enabled) { + setDebugEnabled(enabled == JNI_TRUE ? true : false); } /* @@ -117,7 +117,7 @@ // Reset scheduler to normal sched_pri.sched_priority = 0; if (sched_setscheduler(0, SCHED_OTHER, &sched_pri) != 0) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not set realtime priority\n"); + printfDebug("Could not set realtime priority\n"); return; } } @@ -127,12 +127,12 @@ min_pri = sched_get_priority_min(SCHED_FIFO); max_pri = sched_get_priority_max(SCHED_FIFO); if (min_pri == -1 || max_pri == -1) { - printfDebug(org_lwjgl_Sys_DEBUG, "Failed to set realtime priority\n"); + printfDebug("Failed to set realtime priority\n"); return; } sched_pri.sched_priority = (max_pri + min_pri)/2; if (sched_setscheduler(0, SCHED_FIFO, &sched_pri) != 0) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not set realtime priority\n"); + printfDebug("Could not set realtime priority\n"); return; } return; @@ -150,7 +150,7 @@ } if (setpriority(PRIO_PROCESS, 0, linux_priority) == -1) { - printfDebug(org_lwjgl_Sys_DEBUG, "Failed to set priority.\n"); + printfDebug("Failed to set priority.\n"); } } Index: org_lwjgl_input_Mouse.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Mouse.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- org_lwjgl_input_Mouse.cpp 20 Dec 2003 14:01:30 -0000 1.43 +++ org_lwjgl_input_Mouse.cpp 20 Dec 2003 22:03:25 -0000 1.44 @@ -122,7 +122,7 @@ static bool blankCursor(void) { unsigned int best_width, best_height; if (XQueryBestCursor(getCurrentDisplay(), getCurrentWindow(), 1, 1, &best_width, &best_height) == 0) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not query best cursor size\n"); + printfDebug("Could not query best cursor size\n"); return false; } Pixmap mask = XCreatePixmap(getCurrentDisplay(), getCurrentWindow(), best_width, best_height, 1); @@ -199,10 +199,10 @@ event.xmotion.y > current_y - POINTER_WARP_BORDER && event.xmotion.y < current_y + POINTER_WARP_BORDER) break; - printfDebug(org_lwjgl_Sys_DEBUG, "Skipped event searching for warp event %d, %d\n", event.xmotion.x, event.xmotion.y); + printfDebug("Skipped event searching for warp event %d, %d\n", event.xmotion.x, event.xmotion.y); } if (i == WARP_RETRY) - printfDebug(org_lwjgl_Sys_DEBUG, "Never got warp event\n"); + printfDebug("Never got warp event\n"); } static void warpPointer(void) { Index: org_lwjgl_opengl_Pbuffer.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Pbuffer.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- org_lwjgl_opengl_Pbuffer.cpp 20 Dec 2003 14:01:30 -0000 1.6 +++ org_lwjgl_opengl_Pbuffer.cpp 20 Dec 2003 22:03:25 -0000 1.7 @@ -161,7 +161,7 @@ GLXPbuffer buffer = buffer_info->buffer; GLXContext context = buffer_info->context; if (glXMakeContextCurrent(getCurrentDisplay(), buffer, buffer, context) == False) { - printfDebug(org_lwjgl_Sys_DEBUG, "Could not make pbuffer current"); + printfDebug("Could not make pbuffer current"); } } Index: org_lwjgl_opengl_Window.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_Window.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- org_lwjgl_opengl_Window.cpp 20 Dec 2003 14:01:30 -0000 1.13 +++ org_lwjgl_opengl_Window.cpp 20 Dec 2003 22:03:25 -0000 1.14 @@ -208,7 +208,7 @@ } win = XCreateWindow(disp, root_win, x, y, width, height, 0, vis_info->depth, InputOutput, vis_info->visual, attribmask, &attribs); XFreeColormap(disp, cmap); - printfDebug(org_lwjgl_Sys_DEBUG, "Created window\n"); + printfDebug("Created window\n"); current_win = win; Java_org_lwjgl_opengl_Window_nSetTitle(env, NULL, title); XSizeHints * size_hints = XAllocSizeHints(); @@ -381,7 +381,7 @@ throwException(env, "Could not create visual info from FB config"); return false; } - if (ATDEBUGLEVEL(org_lwjgl_Sys_DEBUG)) + if (ISDEBUGENABLED()) dumpVisualInfo(disp, vis_info); createWindow(env, disp, screen, vis_info, title, x, y, width, height, fscreen); glx_window = glXCreateWindow(disp, configs[0], getCurrentWindow(), NULL); @@ -397,7 +397,7 @@ throwException(env, "Could not find a matching pixel format"); return false; } - if (ATDEBUGLEVEL(org_lwjgl_Sys_DEBUG)) + if (ISDEBUGENABLED()) dumpVisualInfo(disp, vis_info); context = glXCreateContext(disp, vis_info, NULL, True); if (context == NULL) { @@ -463,7 +463,7 @@ throwException(env, "Could not init gl function pointers"); return; } - if (ATDEBUGLEVEL(org_lwjgl_Sys_DEBUG)) { + if (ISDEBUGENABLED()) { const GLubyte * extensions = glGetString(GL_EXTENSIONS); printf("Supported extensions: %s\n", extensions); } |