Browse Source

[GNU/Linux]removed dependency on newer GLIBC 2.14 when compile ZenGL with zip/jpeg/ogg support on newer systems with GLIBC 2.14+; [iOS]fixed resolution problem with iPhone applications running on iPad

git-svn-id: http://zengl.googlecode.com/svn/branches/0.3.x@1884 6573c10b-8653-0410-9706-d32479e959fb
dr.andru 13 years ago
parent
commit
0918120524
3 changed files with 20 additions and 0 deletions
  1. 6 0
      src/zgl_screen.pas
  2. 1 0
      src/zgl_sound.pas
  3. 13 0
      src/zgl_utils.pas

+ 6 - 0
src/zgl_screen.pas

@@ -342,6 +342,12 @@ begin
     begin
     begin
       scrCurrModeW := Round( UIScreen.mainScreen.currentMode.size.width );
       scrCurrModeW := Round( UIScreen.mainScreen.currentMode.size.width );
       scrCurrModeH := Round( UIScreen.mainScreen.currentMode.size.height );
       scrCurrModeH := Round( UIScreen.mainScreen.currentMode.size.height );
+
+      if ( UIDevice.currentDevice.userInterfaceIdiom = UIUserInterfaceIdiomPhone ) and ( UIDevice.currentDevice.model.rangeOfString( utf8_GetNSString( 'iPad' ) ).location <> NSNotFound ) Then
+        begin
+          scrCurrModeW := 480;
+          scrCurrModeH := 320;
+        end;
     end else
     end else
       begin
       begin
         scrCurrModeW := Round( UIScreen.mainScreen.bounds.size.width );
         scrCurrModeW := Round( UIScreen.mainScreen.bounds.size.width );

+ 1 - 0
src/zgl_sound.pas

@@ -1344,6 +1344,7 @@ begin
         end;
         end;
     end;
     end;
 
 
+  sfStream[ id ]._decoder.Close();
   thread_EventDestroy( sfEvent[ id ] );
   thread_EventDestroy( sfEvent[ id ] );
   EndThread( 0 );
   EndThread( 0 );
 end;
 end;

+ 13 - 0
src/zgl_utils.pas

@@ -91,7 +91,12 @@ function dlsym  ( Lib : Pointer; Name : PAnsiChar) : Pointer; cdecl; external 'd
 function select( n : longint; readfds, writefds, exceptfds : Pointer; var timeout : timeVal ) : longint; cdecl; external 'libc';
 function select( n : longint; readfds, writefds, exceptfds : Pointer; var timeout : timeVal ) : longint; cdecl; external 'libc';
 
 
 function printf( format : PAnsiChar; const args : array of const ) : Integer; cdecl; external 'libc';
 function printf( format : PAnsiChar; const args : array of const ) : Integer; cdecl; external 'libc';
+
 {$ENDIF}
 {$ENDIF}
+{$IF DEFINED(LINUX) and DEFINED(CPUx86_64)}
+// GLIBC 2.14 is too new, so replace memcpy with Pascal implementation via hack
+function memcpy( destination, source : Pointer; num : csize_t ) : Pointer; cdecl; public name 'memcpy';
+{$IFEND}
 {$IFDEF ANDROID}
 {$IFDEF ANDROID}
 function __android_log_write( prio : LongInt; tag, text : PAnsiChar ) : LongInt; cdecl; external 'liblog.so' name '__android_log_write';
 function __android_log_write( prio : LongInt; tag, text : PAnsiChar ) : LongInt; cdecl; external 'liblog.so' name '__android_log_write';
 {$ENDIF}
 {$ENDIF}
@@ -363,6 +368,14 @@ begin
     System.Move( Str[ 1 ], Result^, len );
     System.Move( Str[ 1 ], Result^, len );
 end;
 end;
 
 
+{$IF DEFINED(LINUX) and DEFINED(CPUx86_64)}
+function memcpy( destination, source : Pointer; num : csize_t ) : Pointer;
+begin
+  Move( source^, destination^, num );
+  Result := destination;
+end;
+{$IFEND}
+
 {$IFDEF WINDOWS}
 {$IFDEF WINDOWS}
 function utf8_GetPWideChar( const Str : UTF8String ) : PWideChar;
 function utf8_GetPWideChar( const Str : UTF8String ) : PWideChar;
   var
   var