Menu

Show posts

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

Messages - spacefractal

#3211
its did fixed most cases, but I guess you should look on the SETSCREEN bug.
#3212
its a nice discovered bug after some invistate what its really happens. A code example to showoff the bug would still been in place, so its easier to checkout what it happens.

Im not sure I did that for WebOS version of my game, but should I do that (even its should not accour in my game because I did not use offbuffers at all)?
#3213
even with onscreen quit, that button might not been used and still quit in the normal metod. In Greedy Mouse I also added the quit button as well (for Android version only), but I still close the app directly by homebutton anyway. So you cant trust how the user close the app. Howover should this thread not been moved to the bug section, since its a real bug?

GLB_ON_QUIT() is not invoked, and I guess its also happens with ALLOWESCAPE FALSE?

Its could also been a OpenGL bug.

Howover this is a real bug, so move it to the bug forum.
#3214
Can you give a code example to invoke the bug?

It's look like its cause either a null pointer bug or loop issue when usescreen is invoked with no surface. Normally you should not write to buffer when quit have been handled.
#3215
Android Rotation Issues by SETORIENTATION 0 did not fix all issues (etc if I force my game in portrait mode in manifest on my HP Touchpad, you will see the issue again), but I guess I got a fix to that too.

Look in the Java communication thread. There is a java command that can tell the current orientation of the device, which is very important to use. The value can been varied from system to system, but you can checkout which value its have by set SETORIENTATION from the returned display.getOrientation() value. Here its worked by setting the game to "portrait" mode, and hp touchpad default mode is "landscape". Actuelly the return value for portrait was set to 3 for HP Touchpad.

PS. While this help with fixed orientation issues in either "landscape" or "portrait" in manifest, the surface changes using "unspecified" or "sensor" is still not doing correctly (but the hint got returned nicely).
#3216
Here is some java calls I use

Code (glbasic) Select

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;
}


EXAMPLE TO USE:

This fix orientation issue.

Code (glbasic) Select

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


A Late edit to reflect change to this post is more clean. Its dosent breaks the follow posts.
#3217
for use with offbuffers and then png use alpha for transperancy. its not that notiable when using graphics buffer. I think I have posted about that before for a year ago. That would also fixc eventuelly alpha multiply issues. In Greedy Mouse I did not use offbuffers at all.

PS. This is not a bug, but more just a limit.
#3218
CLEARSCREEN can still not support alpha. Its really annoying to trying clearscreen a offbuffer with 100% clean with alpha.

if Im doing this:
SETTRANSPARENCY RGB(0,0,0)
CLEARSCREEN RGB(0,0,0)


The screen is still filled with black, but its should have been fully transparency. I do hope Gernot add a "CLEARSCREEN RGB(RED, GREEN, BLUE), ALPHA" as a option (since I seen there is a opengl feature for that, so its should been a easy fix).

So this is property why some people have trouble to get ALPHA correctly work.
#3219
My artist used... Dropbox.

When I created new version I simply copy to Dropbox shared folder and from the Dropbox app it's possible to install directly. Howovere there was some issues, but it's works. The shared sync is very cool and direct reason I use that.

But it's actuelly easy to copy and install directly (but not sure here).

If your friend is at you, the game got installed automatic (but its require a driver to been installed).

Also pretty sure can look on the native keyboard support througt native java communication, but still not sure due sdl activity issues. But the IMPUT keyboard have real use as well.
#3220
Apple approvede my game (that talk about in my own thread), but i confirm the game run correctly on iPad 3 in 60fps for iOS5, but fall to around 45fps for iOS6 (and a bit worse with colored polygons as seen on iPad 1). The funny part is as I wrote ms taken for ENDPOLY is quite unstable and yes it's could been uvview issue.

But I just uploaded a tempfix to use 30fps for all iPads. So no hurry.
#3221
It's depend of projekt. In greedy mouse I was required to rename one type variable, because that name now was reserved, but elsewise it's compiled fine.

Howover you might need to create a new xCode project for iOS and setup that again. The project from v10 might won't work.
#3222
oh dear, spelling in the subject, fixed.

Yes this is not needed early in the development, but its handly when the project is near finished. I did need that due I did not like the default assest installing (which was the first reason to do that).
#3223
Looked into this today after fixed the Java issue. Its seen the shutdown issue was done when you using TargetAPI level 13 or higher, but if you set TargetAPI to 12 then glBasic does NOT quit but its got it hint as its should.

But its still some issues left. SETSCREEN is still not working correctly after the hint and X/Y is still been swapped on the other orientation.

Screen might start 90 degree wrong in startup, but that got fixed by SETORIENTATION 0 (which moved down for test), but after the hint then thing goes wrong (even I set SETORIENTATION 0).

Here the code (which also inclue some JAVACALL tests):

Code (glbasic) Select


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


here is the output I got:
Code (glbasic) Select

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()


As you see X and Y is still swapped when I rotate 90 degree from start orientation. Rotating 180 degree works fine.

#3224
Yes, but there is some activity issues left. Etc glbasic close its thread completely when I'm trying create a another activity (example a WebKit), Which look its does on purpuse. Hope we can get those fixed first. When fixed then we can use ads services native or use Dropbox.

Howover you can call any java libs, example Google Licence Service works very great (much better than internal drm on google play, and you can use own assets copy so it's don't hang in startup and eventuelly crash out. I later put them here.

#3225
also why dosent it not start automatic (just like various android stuff). As I wrote in code snippet, I got workaround the java issue, so its would been easy to been fixed.