its did fixed most cases, but I guess you should look on the SETSCREEN bug.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menu
public static String glb_JAVACALL(String url)
{ //Log.i("glbasic", "calltest");
String[] tokens = url.split(":");
// copy the sigle assets
if (tokens[0].equals("copy"))
{ tokens[1]="Media/"+tokens[1];
int ok=mSingleton.copyAsset(tokens[1]);
return "";
}
// RecursiveCopy
if (tokens[0].equals("dircopy"))
{ tokens[1]="Media/"+tokens[1];
mSingleton.recursiveCopy(tokens[1], 0);
}
// get device info
if (tokens[0].equals("getdevice"))
{ String AndroidInfo="OSVersion="+System.getProperty("os.version")+"|";
AndroidInfo=AndroidInfo+"OSDevice="+android.os.Build.DEVICE+"|";
AndroidInfo=AndroidInfo+"OSModel="+android.os.Build.MODEL+"|";
AndroidInfo=AndroidInfo+"OSProduct="+android.os.Build.PRODUCT+"|";
AndroidInfo=AndroidInfo+"OSManufacturer="+android.os.Build.MANUFACTURER+"|";
AndroidInfo=AndroidInfo+"DisplayMetrics="+mSingleton.getResources().getDisplayMetrics().density+"|";
return AndroidInfo;
}
if (tokens[0].equals("ScreenOrientation"))
{ Display display = ((WindowManager) mSingleton.getSystemService(WINDOW_SERVICE)).getDefaultDisplay();
screenOrientation = display.getOrientation();
return Integer.toString(screenOrientation);
}
// check file size
if (tokens[0].equals("size"))
{ int size=-1;
tokens[1]="Media/"+tokens[1];
try {
Log.i("glbasic", tokens[1].concat(" is a file, reading..."));
InputStream is = mSingleton.getAssets().open(tokens[1]);
size=-2;
size = is.available();
is.close();
}
catch (IOException e)
{ e.printStackTrace(System.out);
}
return Integer.toString(size);
}
// a working test function.
if (tokens[0].equals("test"))
{ return "This is Working String";
}
return "";
}
// this check a file and copy a new over on the top, if no file exist or filesize have been changed (this is the asset copy I use)
public int copyAsset(String path)
{ int succes=0;
try {
InputStream in = getAssets().open(path);
FileOutputStream out = new FileOutputStream(getFilesDir().getAbsolutePath().concat(File.separator).concat(path));
int read;
byte[] buffer = new byte[4096];
while ((read = in.read(buffer)) > 0)
{ out.write(buffer, 0, read);
}
out.close();
in.close();
}
catch (IOException e)
{ succes=-1;
e.printStackTrace();
}
return succes;
}
FUNCTION CallJava$: Args$
LOCAL result$
IF device$<>"a" AND device$<>"ak" THEN RETURN
?IFDEF ANDROID
result$=android_JAVACALL(Args$)
RETURN result$
?ENDIF
ENDFUNCTION
LOCAL orentation=CallJava$("screenOrientation")
DEPRINT("GetOrientation: "+orentation)
SETORIENTATION orentation // that fix orientation issues.
GETSCREENSIZE ScreenWidth, ScreenHeight
AUTOPAUSE FALSE
ALLOWESCAPE FALSE
STDOUT "IMPORT"
?IFDEF ANDROID
IMPORT "C" const char* android_JAVACALL(const char* string)
?ENDIF
LOCAL test$=android_JAVACALL("test")
STDOUT "test: "+test$
GETDESKTOPSIZE Xcreen, Yscreen
SETSCREEN Xcreen, Ycreen, 1
LOCAL C=0
Check_File("block.png")
SETCURRENTDIR("Media")
LOADSPRITE "block.png",0
REPEAT
FOR i=0 TO 360 STEP 4
GETSCREENSIZE x, y
DRAWRECT 0, 0, x, y, RGB(250, 250, 0)
DRAWSPRITE 0, x-100, y-100
DRAWSPRITE 0, 20, 20
DRAWSPRITE 0, x-100, 20
DRAWSPRITE 0, 20, y-100
DRAWRECT x/2-i/2, y/2-i/2, i, i, RGB(100, 100, 100)
DRAWRECT 10, y/2-i/8, i/4, i/4, RGB(100, 100, 100)
SHOWSCREEN
C=C+1
MOUSESTATE mx, my, mba, mbb
IF (mba=1 OR mbb=1) AND mx<20 AND my<20 THEN END
GETDESKTOPSIZE xDesk, yDesk
GETSCREENSIZE Xcreen, Yscreen
IF C=50 THEN SETORIENTATION 0
IF C=100
C=0
STDOUT xDesk+" "+yDesk+" :: "+Xcreen+" "+Yscreen
IF xDesk<>Xcreen AND yDesk<>Yscreen
SETSCREEN xDesk, yDesk, 1
ENDIF
ENDIF
NEXT
UNTIL mba=1000
FUNCTION CallJava$: Args$
LOCAL result$
?IFDEF ANDROID
result$=android_JAVACALL(Args$)
STDOUT "calljava: "+Args$+" "+result$
RETURN result$
?ENDIF
RETURN ""
ENDFUNCTION
FUNCTION Check_File: File$
LOCAL fileapksize=CallJava$("size:"+File$)
STDOUT "Check Filesize on "+File$+" :: "+fileapksize
LOCAL filelocalsize=GETFILESIZE(File$);
IF fileapksize<1 OR fileapksize<>filelocalsize
CallJava$("copy:"+File$)
ENDIF
ENDFUNCTION
I/SDL (18573): ---------------------------------------------
I/SDL (18573): --- restart ---
I/SDL (18573): ---------------------------------------------
I/SDL (18573): onCreate
I/glbasic (18573): external files dir is /data/data/com.unmapcom.rotosprite/file
s
I/glbasic (18573): external storage /mnt/sdcard/Download
I/glbasic (18573): test 2
I/glbasic (18573): test
I/glbasic (18573): onCreate done
I/SDL (18573): glbasicOnPause(0)
I/SDL (18573): onResume done
I/SDL (18573): ceateEGLSurface
I/SDL (18573): surfaceChanged()
I/SDL (18573): pixel format RGB_565
I/SDL (18573): hint screensize to glb
I/SDL (18573): SDL_Android_Init()
I/glbasic (18573): timer
I/glbasic (18573): rbow
I/glbasic (18573): rbow init
I/SDL (18573): [STUB] GL_SetSwapInterval
I/glbasic (18573): SDL_init video
I/glbasic (18573): SDL_GetVideoInfo = 1024x720 @ 16 bpp
I/glbasic (18573): Requested SDL_OPENGL = 67108864
I/glbasic (18573): set up SDL for OpenGL-ES mode
I/glbasic (18573): Setting video mode: 1024x720x16 fl=4800000
I/SDL (18573): [STUB] GL_LoadLibrary
I/SDL (18573): ceateGLContext
I/SDL (18573): initEGL 1.1
I/SDL (18573): ceateEGLSurface
I/SDL (18573): ceateEGLContext
I/glbasic (18573): SDL_SetVideoMode seems to be 1
I/glbasic (18573): get accurate timer - 1st call
I/glbasic (18573): flip - 1st call
I/glbasic (18573): BGRA ext supported
I/glbasic (18573): Texture size limit: 4096
I/glbasic (18573): init fbo
I/glbasic (18573): 2D VP
I/glbasic (18573): OGRB init [OK]
I/glbasic (18573): Cptn
I/glbasic (18573): Network
I/glbasic (18573): Input
I/glbasic (18573): Window mode
I/glbasic (18573): Create DXin
I/glbasic (18573): sdl_grab
I/glbasic (18573): reptr
I/glbasic (18573): getexe
I/glbasic (18573): cd
I/glbasic (18573): set cdir to: /data/data/com.unmapcom.rotosprite
I/glbasic (18573): exepath=curdir= /data/data/com.unmapcom.rotosprite
I/glbasic (18573): shoeboxing...
I/glbasic (18573): init gettimer
I/glbasic (18573): clear screen
I/glbasic (18573): flip
I/glbasic (18573): mk2D
I/glbasic (18573): finding font...
I/glbasic (18573): set cdir to: files
I/glbasic (18573): Init Finalized
I/glbasic (18573): IMPORT
I/glbasic (18573): calltest
I/glbasic (18573): test: This is Working String
I/glbasic (18573): Rbow::SetScreen( 1024,0)
I/glbasic (18573): calltest
I/glbasic (18573): Media/block.png is a file, reading...
I/glbasic (18573): calljava: size:block.png 8773
I/glbasic (18573): Check Filesize on block.png :: 8773
I/glbasic (18573): calltest
I/glbasic (18573): calljava: copy:block.png
I/glbasic (18573): set cdir to: Media
I/glbasic (18573): 1024 720 :: 1024 720
I/glbasic (18573): 1024 720 :: 1024 720
I/SDL (18573): surfaceChanged()
I/SDL (18573): pixel format RGB_565
I/SDL (18573): hint screensize to glb
I/glbasic (18573): 768 976 :: 1024 720
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/SDL (18573): surfaceChanged()
I/SDL (18573): pixel format RGB_565
I/SDL (18573): hint screensize to glb
I/glbasic (18573): 1024 720 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 1024,720)
I/glbasic (18573): 1024 720 :: 1024 720
I/glbasic (18573): 1024 720 :: 1024 720
I/glbasic (18573): 1024 720 :: 1024 720
I/glbasic (18573): 1024 720 :: 1024 720
I/glbasic (18573): 1024 720 :: 1024 720
I/SDL (18573): surfaceChanged()
I/SDL (18573): pixel format RGB_565
I/SDL (18573): hint screensize to glb
I/glbasic (18573): 768 976 :: 1024 720
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/glbasic (18573): 768 976 :: 976 768
I/glbasic (18573): Rbow::SetScreen( 768,976)
I/SDL (18573): glbasicOnPause(1)
I/SDL (18573): super.onPause
I/SDL (18573): onPause done
I/SDL (18573): surfaceDestroyed()