minor cleanup

This commit is contained in:
Scott W Palmer 2003-05-20 13:51:46 +00:00
parent 503f031b15
commit b9a7d26cb4
1 changed files with 2 additions and 5 deletions

View File

@ -87,13 +87,11 @@ jobjectArray GetAvailableDisplayModesOSX(JNIEnv * env)
displayModes = CGDisplayAvailableModes( kCGDirectMainDisplay ); displayModes = CGDisplayAvailableModes( kCGDirectMainDisplay );
count = CFArrayGetCount( displayModes ); count = CFArrayGetCount( displayModes );
printf("Found %d displaymodes\n", count );
// get a count of the number of display modes on this machine with a bpp greater than 8 // get a count of the number of display modes on this machine with a bpp greater than 8
// //
for ( i = 0; i < count; i++ ) for ( i = 0; i < count; i++ )
{ {
CFDictionaryRef mode = CFArrayGetValueAtIndex( displayModes, i ); CFDictionaryRef mode = static_cast<CFDictionaryRef>( CFArrayGetValueAtIndex( displayModes, i ) );
long bpp = _getDictLong( mode, kCGDisplayBitsPerPixel ); long bpp = _getDictLong( mode, kCGDisplayBitsPerPixel );
if ( bpp > 8 ) if ( bpp > 8 )
@ -105,13 +103,12 @@ jobjectArray GetAvailableDisplayModesOSX(JNIEnv * env)
// now that we have the count create the classes, and add 'em all - we'll remove dups in Java // now that we have the count create the classes, and add 'em all - we'll remove dups in Java
// Allocate an array of DisplayModes big enough // Allocate an array of DisplayModes big enough
jclass displayModeClass = env->FindClass("org/lwjgl/DisplayMode"); jclass displayModeClass = env->FindClass("org/lwjgl/DisplayMode");
jobjectArray ret = env->NewObjectArray( availableModes, displayModeClass, NULL); jobjectArray ret = env->NewObjectArray( availableModes, displayModeClass, NULL);
jmethodID displayModeConstructor = env->GetMethodID(displayModeClass, "<init>", "(IIII)V"); jmethodID displayModeConstructor = env->GetMethodID(displayModeClass, "<init>", "(IIII)V");
for ( i = 0; i < count; i++ ) for ( i = 0; i < count; i++ )
{ {
CFDictionaryRef modeDict = CFArrayGetValueAtIndex( displayModes, i ); CFDictionaryRef modeDict = static_cast<CFDictionaryRef>( CFArrayGetValueAtIndex( displayModes, i ) );
long width = _getDictLong( modeDict, kCGDisplayWidth ); long width = _getDictLong( modeDict, kCGDisplayWidth );
long height = _getDictLong( modeDict, kCGDisplayHeight ); long height = _getDictLong( modeDict, kCGDisplayHeight );
long freq = (long)(_getDictDouble( modeDict, kCGDisplayRefreshRate ) + 0.5 ); long freq = (long)(_getDictDouble( modeDict, kCGDisplayRefreshRate ) + 0.5 );