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

Topics - spacefractal

#121
as above tell, this is very much needed, because its so annoying when there is no commands to tell how many frames there is in a animation, so you need to do various workaround (why?).

by now its simply just return the whole image size, but actuelly its should have returned the framesize, which its dosent do that. Howover this is property by design, not a bug.

animframes%% should of course only been optimal, not required. IF that is not possible, then GETANIMFRAMES img, animframes%% could been used as a new command.
#122
I hate this stage build really much (its fail too much), so I really ask this feature possible to been disabled.

The reason is, this build begin to more more unstable for my devices, and I need to unplug and plug the usb too much, while installing from sdcard works pretty nice (using Astro file manager).

That why I want to ask the possible to disable this build, and then instead manully copy the apk file to sdcard (or doing that automatic to a contain drive&folder if exist).

PS. This is NOT a bug or anything that can been fixed, so that why its on the feature request.
#123
Quote from: BdR on 2012-Dec-21
I'm testing on Android again, and two things I've noticed

Firstly, my app uses PLATFORMINFO$("DOCUMENTS") to store the settings and saved game. Now I was testing on an Android device without a SD card and then the game was not saved. So, I changed it to PLATFORMINFO$("APPDATA") for Android just to be sure, so like this:
Code (glbasic) Select
CONSTANT SETTINGS_FILE$ = "/snakeslider.ini"
//INIOPEN PLATFORMINFO$("DOCUMENTS") + SETTINGS_FILE$
INIOPEN PLATFORMINFO$("APPDATA") + SETTINGS_FILE$


Second, the GETJOYX(0), GETJOYY(0), GETJOYZ(0) functions don't seem to work for Android. When compiling with v10 for Android, it gave the accelerometer values but now in v11 it seems to give just 0. Only GETJOYZ(0) sometimes jumps from 0 to -1 when I shake the device. The GETJOYNAME$(0) still gives "Android accelerometer" though..

I can as I wrote in the beta 11 thread, confirm this bug.

The java part code works fine. If I multiply with 10 in onSensorChanged() in SDLActicvity.java, then I got returned a nice integer values between -10 and 10. But If I multiply more, then its seen its have limited to 10 for some reasons. so its a bug in the onNativeAccel() c++ function. Its cleary its have been converted to integer, which its should not....

This bug can been workaround by using the java communication code I wrote in the code snippets forum and then gets its floats that way. I look on that later, or by multiply with 10 (which give some control, but not fine control over it).
#124
I got both 0 as well 5 stars on Greedy Mouse (which mean the game does run nice).

m are NOT concerned about getting 0 stars, because they dosent count to the total been seen to users, only for internal stats.

Howover does some know why this happens? Im pretty sure its not a issue glbasic, but more AppCatalog got corrupted something?

Buts im are more concern why its wont install correctly sometimes.
#125
http://www.glbasic.com/forum/index.php?topic=8677.msg73706#msg73706

Quote from: fivesprites on 2012-Nov-06
The issue with Nexus 7 is that when using CREATESCREEN/USESCREEN you will get similar errors to:

         I/glbasic ( 8665): glBindRenderbufferExt failed 8cd6

which is: 

         GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT

I believe this is an issue within GLB whereby it's not defining the correct z buffer component (16bits vs 32bits).

If you do NOT use createscreen/usescreen in your app/game, then it will run perfectly fine on the Nexus 7.

Note: The same also applies to the Asus Transformer.

I thinks he can been right you might use wrong settings. If its cant been fixed, its would been nice to return a gracefull error rather than a crash.
#126
First at all here is how you can enable iCloud support:
http://www.raywenderlich.com/6015/beginning-icloud-in-ios-5-tutorial-part-1

Howover I did got wawe of Entitlements issues,  but finally I got fixed that too. Here is the final Entitlements content I used, putted in maually in noteblok:

Code (glbasic) Select

#import <Foundation/NSObject.h>
#import <Foundation/NSString.h>
#import <Foundation/NSFileManager.h>
#import <Foundation/NSURL.h>
#import <Foundation/NSBundle.h>
#import <string.h>

char iString[512]="";

const char* iCloudURL()
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSString *bundleID = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIdentifier"];
NSLog(@"bundleID is: %@", bundleID);
NSString *appID = [NSString stringWithFormat:@"N3L62N3PZ4.%@", bundleID];
NSLog(@"appID is: %@", appID);
NSURL *testCloudURL = [fileManager URLForUbiquityContainerIdentifier:appID];
    if (testCloudURL==NULL)
        return iString;
NSString *myURL = [testCloudURL absoluteString];
    NSLog(@"testCloudURL is: %@", myURL);
    strcpy(iString, [myURL UTF8String]);
   
   
    return iString;
}



This will either return null or a url. The url is actuelly just a folder pointer , so there require no networking uploading and such. iOS doing that its self in a thread.

in GlBasic, you can check iCloud test doing something like this:

Code (glbasic) Select

?IFDEF IPHONE
IMPORT "C" const char* iCloudURL()
LOCAL iCloud$=iCloudURL()
iCloud$=REPLACE$(iCloud$, "file://localhost/private", "")
iCloud$=URLDECODE$(iCloud$);
IF LEN(iCloud$)>3
CLOUDFILE$=iCloud$+"Save.ini"
ENDIF
?ENDIF


Howover remember you can NOT access files directly from the iClould folder. If you doing that, then GlBasic will crash out by a GLB Error 3. But you can do a COPYFILE from AppData file to your iCloud folder before use, something like this for saving:

Code (glbasic) Select

FUNCTION LoadCloudStr: File$
DEPRINT("LoadCloudStr: "+File$)
LOCAL SaveFile2$=REPLACE$(SaveFile$, "save.ini", "save2.ini")
LOCAL SaveFile2$=REPLACE$(SaveFile$, "Save.ini", "Save2.ini")
COPYFILE File$, SaveFile2$
LOCAL si=GETFILESIZE(SaveFile2$)
IF si>0
DEPRINT("SaveFile2$: "+si)
LoadStr(SaveFile2$, "all", 1)
ENDIF
ENDFUNCTION


A Example for iCloud use:
I use iCloud for sync the game by the scoring and stars progress between devices. Its checking if the scoring and stars got is higher on the cloud file and then eventuelly update it. Also I read the cloud file when exiting a level, before sync back again to avoid eventeully confict.

Another example could been updating savegame from a light to paid version of the game. YES, using iCloud will been possible to share data between app if user have enabled iCloud.

This is extractly why I looked Dropbox, but I still do that in later day. Howover I did got iCloud working first.

PS. TEAMID and APPID is NOT the same. Remember to replace those with your own of course.
#127
I finally found a workaround from the bug that prevent me to communicate with java directly in this version. Its a bit more advanced, but when its works, then its would been much easier. This method will not break the current apps.

Compiler\platform\android\bin\sdl_main.cpp:
put below lines in the extern "C" area (can been inserted below char g_androidExtStoragePubDir[512] = "~";)
Code (glbasic) Select

char g_androidJAVACALL[512] = "~";
jclass cls;
jmethodID mid;

// * COSTUME JAVACALL *
const char* android_JAVACALL(const char* url)
{

if (cls==NULL)
{ cls = gJNIenv->FindClass("org/libsdl/app/SDLActivity");
mid = gJNIenv->GetStaticMethodID(cls,
   "glb_JAVACALL",
   "(Ljava/lang/String;)Ljava/lang/String;"); // (params;..)return_type
}

   if (mid==NULL)
{ return g_androidJAVACALL;
}

// there could be some exception handling happening here, but there isn't
jstring mystr = gJNIenv->NewStringUTF(url);
jobject retJava = gJNIenv->CallStaticObjectMethod(cls, mid, mystr);
if (retJava==NULL)
{ gJNIenv->DeleteLocalRef(mystr);
gJNIenv->DeleteLocalRef(retJava);
return g_androidJAVACALL;
}
jstring res = (jstring)retJava;
strncpy(g_androidJAVACALL, gJNIenv->GetStringUTFChars(res,  0L), 512);

gJNIenv->DeleteLocalRef(mystr);
gJNIenv->DeleteLocalRef(res);
gJNIenv->DeleteLocalRef(retJava);
res=NULL;
return g_androidJAVACALL;
}


EDIT: Please note, Fivesprite have wrote a more protection one of above code, which can been used, when the above works, its here:
http://www.glbasic.com/forum/index.php?topic=8621.msg77670#msg77670

templateproj\src\com\glbasic\test\SDLActivity.java:
can example inserted before glb_open_url() or around there
Code (glbasic) Select

    // Java functions called from C
public static String glb_JAVACALL(String url)
{ Log.i("glbasic", "calltest");
return "works";
}


test above code in glbasic with:
Code (glbasic) Select

STDOUT "IMPORT"
?IFDEF ANDROID
IMPORT "C" const char* android_JAVACALL(const char* string)
?ENDIF

LOCAL test$=android_JAVACALL("test")
STDOUT "test: "+test$


If the above works corretly, you should get a "works" string in STDOUT, that came from java code call.

With that in mind you can do fun thing with example doing attest loading your self while loading or even better, using Google License Service. When that code have been validated then I post how to use that service.

in java there is a string split command, so you could collect all required calls into that method.

etc String[] tokens = url.split(":");

EDIT:
I got succesful ported Greedy Mouse with this Java communication system over. So its works very well and its dont impact combatible at all. Later in this thread I doing how doing some stuff with that,
#128
Rather than debate from the beta 11 thread, I think I should starte a new thread here, since this happens both in early and the new beta.

By know I have no clue how to read those crash log I got from logview.bat. This happens very often when I quit my game (which do elsewise run very flawless):
Code (glbasic) Select

I/glbasic (  672): [GLB]->MiniGames_LoadingRoom()
I/SDL     (  672): 1: keycode_back w/o alt-key -> finish
I/glbasic (  672): [GLB]->GLB_ON_QUIT()
I/glbasic (  672): Shut down GLB
I/DEBUG   (  619): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *
**
I/DEBUG   (  619): Build fingerprint: 'hp/hp_tenderloin/tenderloin:4.0.4/IMM76I/
330937:user/release-keys'
I/DEBUG   (  619): pid: 672, tid: 672  >>> com.spacefractal.greedymouse <<<
I/DEBUG   (  619): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 4d59900
4
I/DEBUG   (  619):  r0 00000000  r1 0000b000  r2 2aaf762c  r3 00000000
I/DEBUG   (  619):  r4 4d599000  r5 002ec7a8  r6 420a7870  r7 2aaf7474
I/DEBUG   (  619):  r8 4d599008  r9 00000000  10 00000000  fp 7ec7776c
I/DEBUG   (  619):  ip 00000000  sp 7ec77720  lr 2aac15c8  pc 2aac4840  cpsr 200
f0030
I/DEBUG   (  619):  d0  0000000000000000  d1  0000000000000000
I/DEBUG   (  619):  d2  0000000000000000  d3  0000000000000000
I/DEBUG   (  619):  d4  001e3db800000035  d5  0013d53800000036
I/DEBUG   (  619):  d6  001e3ca800000037  d7  001e3d2000000038
I/DEBUG   (  619):  d8  0000000000000000  d9  0000000000000000
I/DEBUG   (  619):  d10 0000000000000000  d11 0000000000000000
I/DEBUG   (  619):  d12 0000000000000000  d13 0000000000000000
I/DEBUG   (  619):  d14 0000000000000000  d15 0000000000000000
I/DEBUG   (  619):  d16 473e2d5d424c475b  d17 55515f4e4f5f424c
I/DEBUG   (  619):  d18 0021c06800000042  d19 00198aa000000044
I/DEBUG   (  619):  d20 001fee1000000045  d21 001feed800000046
I/DEBUG   (  619):  d22 001fefa800000047  d23 001ff07800000048
I/DEBUG   (  619):  d24 3e66376972bea4d0  d25 3fd174646512dc71
I/DEBUG   (  619):  d26 3fefdfde00000000  d27 bed0810fee5b0a9d
I/DEBUG   (  619):  d28 c00005c02b53cb8a  d29 bf66fdec79316df6
I/DEBUG   (  619):  d30 bc0a42cc192d5632  d31 be23e4f5df600000
I/DEBUG   (  619):  scr 20000010
I/DEBUG   (  619):
I/DEBUG   (  619):          #00  pc 00015840  /system/lib/libc.so (dlfree)
I/DEBUG   (  619):          #01  pc 0001649c  /system/lib/libc.so (free)
I/DEBUG   (  619):          #02  pc 0000c07e  /mnt/asec/com.spacefractal.greedymouse-1/lib/libSDL_mixer.so (Mix_FreeChunk)
I/DEBUG   (  619):
I/DEBUG   (  619): code around pc:
I/DEBUG   (  619): 2aac4820 70dcf50c eeb6f7fc f0402800 f8df8307  ...p.....(@....
.
I/DEBUG   (  619): 2aac4830 f1a8761c 447f0408 428c6939 82eef0c0  .v.....D9i.B...
.
I/DEBUG   (  619): 2aac4840 3c04f858 f140079a f02382e9 07db0603  X..<..@...#....
.
I/DEBUG   (  619): 2aac4850 0506eb04 8118f100 3c08f858 d51107d8  ........X..<...
.
I/DEBUG   (  619): 2aac4860 0e01f023 ebce4476 36100004 f7f64631  #...vD.....61F.
.
I/DEBUG   (  619):
I/DEBUG   (  619): code around lr:
I/DEBUG   (  619): 2aac15a8 e2166903 1a000018 e5945000 e1a02004  .i.......P... .
.
I/DEBUG   (  619): 2aac15b8 e2055a02 e1a00005 e3851001 ebffec3f  .Z..........?..
.
I/DEBUG   (  619): 2aac15c8 e3500000 13856002 1a000001 ea000009  ..P..`.........
.
I/DEBUG   (  619): 2aac15d8 ebfffe87 e1a01004 e1a00006 ebffec3f  ............?..
.
I/DEBUG   (  619): 2aac15e8 e1a01005 e1a02006 e3a03000 e1550000  ..... ...0....U
.
I/DEBUG   (  619):
I/DEBUG   (  619): memory map around addr 4d599004:
I/DEBUG   (  619): 4d33e000-4d53e000 /dev/kgsl-3d0
I/DEBUG   (  619): (no map for address)
I/DEBUG   (  619): 502c9000-50b40000 /dev/kgsl-3d0
I/DEBUG   (  619):
I/DEBUG   (  619): stack:
I/DEBUG   (  619):     7ec776e0  4637d138  /mnt/asec/com.spacefractal.greedymouse-1/lib/libmain.so
I/DEBUG   (  619):     7ec776e4  2ab0b9bf  /system/lib/libstdc++.so
I/DEBUG   (  619):     7ec776e8  00008000  /system/bin/app_process
I/DEBUG   (  619):     7ec776ec  00000000
I/DEBUG   (  619):     7ec776f0  001569c8  [heap]
I/DEBUG   (  619):     7ec776f4  2aac1570  /system/lib/libc.so
I/DEBUG   (  619):     7ec776f8  00004000
I/DEBUG   (  619):     7ec776fc  00000000
I/DEBUG   (  619):     7ec77700  4637d138  /mnt/asec/com.spacefractal.greedymouse-1/lib/libmain.so
I/DEBUG   (  619):     7ec77704  002ec7a8  [heap]
I/DEBUG   (  619):     7ec77708  420a7870
I/DEBUG   (  619):     7ec7770c  000000b2
I/DEBUG   (  619):     7ec77710  4d599008
I/DEBUG   (  619):     7ec77714  00000000
I/DEBUG   (  619):     7ec77718  df0027ad
I/DEBUG   (  619):     7ec7771c  00000000
I/DEBUG   (  619): #00 7ec77720  4637d138  /mnt/asec/com.spacefractal.greedymouse-1/lib/libmain.so
I/DEBUG   (  619):     7ec77724  002ec7a8  [heap]
I/DEBUG   (  619):     7ec77728  420a7870
I/DEBUG   (  619):     7ec7772c  000000b2
I/DEBUG   (  619):     7ec77730  00001000
I/DEBUG   (  619):     7ec77734  00000000
I/DEBUG   (  619):     7ec77738  00000000
I/DEBUG   (  619):     7ec7773c  2aac549f  /system/lib/libc.so
I/DEBUG   (  619): #01 7ec77740  4637d138  /mnt/asec/com.spacefractal.greedymouse-1/lib/libmain.so
I/DEBUG   (  619):     7ec77744  46100081  /mnt/asec/com.spacefractal.greedymouse-1/lib/libSDL_mixer.so


Since this happens after Shut down GLB, then its might looking like a bug in glbasic close rutine and I thinks s is a sound and/or music issue. This wont happens if I disable the sound.
#129
While timing that I use seen to work fine on iOS as well Android, I have some annoying frameskips and/or slowdown issues on Windows and I have newer found out why.

in Glbasic v10, LIMITFPS -1 seen ito been much more stable than using LIMITFPS 60. When using LiMITFPS 60, its have tendend to slowdown without reason at all, so its use some sort of wrong timing? In extreme chase its might slowdown to just about 30-40fps (and still not sure what its caused that).

But when I doing the same in  early GlBasic v11 beta, LIMITFPS -1 run insanly 500 fps amd does not sync to the monitor at all. So its nothing other than a timing issues with LIMITFPS.

So hence I want a LIMITFPS that only wait for vsync and its only do that, without trying to do any timing at all (as I could in BlitzMax). When VSYNC is finished, its should just countinue. This should of course only been happens if HZ used is same with FPS set on LIMITFPS.... I dont think that happens for now? etc its still try to do timing, but failed due its should allready do that with vsync.
#130
Today I found out when I disable the music on my HP Touchpad in Greedy Mouse, then there is no lag anymore and run stable. When music is playing, there is some fps drops (while LIMITFPS still wacky on PC, but its not about it in this thread).

I known ogg is the, but does its mix using the main thread, then I guess its why its might slowdown? Its should really use own thread to do?

I just wonder why there framerate is unstable when music is played.

Howover not sure its a glbasic bug, hence its I not posted it in the bug section.
#131
If I run and write #TEMP#, then its would open Explodere with Temp folder directory. Howover I trying to do that with #DROPBOX#, because I think its would been cool if I could get DROPBOX to work on a least iOS, Android, Windows and Mac. Howover Android require Java and then its impossible to due as long you cant call java from inline.

on Windows its would been so simple as #DROPBOX# that get the user folder, but its not working with either SETCURRENTDIR() as well DOESDIREXIST(). If its worked with SETCURRENTDIR$(), then there would been compare with a simple string test.

this is not a glbasic bug, but would been nice if that was possible, eventuelly using inline?

PS. Im trying to use DROPBOX for the game could SYNC with thier devices (regaardless on system, except by now WebOS and Android). If I got success, then I put its in code snippet. But there is no final date on that yet, nor even its would relaese with Greedy Mouse v1.0.

[attachment deleted by admin]
#132
Today I still seen some slow perforcement on example HTC One my own HP Touchpad. Howover something strange, if I set CPU Perforcement to Perfocement under settings, then my game seen to run pretty nice 25fps in medium graphics (LIMITFPS 25) setting and around 28fps with graphics setting (LIMITFPS 30). Sometimes a nice boost. Before its laggede around 18-20fps.

So I think many of those android perforcement issues could been too aggresive battery saver and cpu clocked up/down while playing? Is its a way to force it to performcent max which is important in some games, so CPU speed dosent jump up and down?

Have other have similar issue?

PS. If I update SDK using android.bat, then I got a xcode error. Would been nice to choice a SDK to use.
#133
Icon.icns when exists in project folder is never copied, but instead it use the default icon from the Resource compile instead. All its need to make sure to copy the icon file if exists, then done.

A Very Simple fix and is really and no priotity bug at all, since you could replace it very easy by using Finder. Just a little annoying thing to been noticed.

PS. Here only checked with v10, not with early v11, so its might allready have been fixed?
#134
Its seen I need a debugger and/or stdout info, since Greedy Mouse now crash under loading and I have absolut not a clue why without those info.

IS that possible to do that in MacOS? I use Lion.

Edit: Look like AUTOPAUSE crashed it, but would been nice to have some STDOUT thing for MACOS, but I did found the log file instead.
#135
I have looked into those issues a glbasic app might look like its crashing under assets copy as well missing some info you could use (example detection a Kindle Fire).

To get this to work, you must create a another directly with name "Splash" in "distribute\Android\assets" (DONT create Splash folder in the Media folder, its must been outside that). Inside Splash folder, you can add your splash picture, example splash.jpg. While that splash.jpg is shown, Media assests would copied to the SDCARD in a thread.

Here I then use PLATFORMINFO$("TEMP") info to check if its have been copied or not, and when its finished I got the "temp" path. Howover I do also abused that command to add some info to that as well, so you cannot use PLATFORMINFO$("TEMP") directly to get the temp folder, but you can use StringField(PLATFORMINFO$("TEMP"), 1, "|") instead.

Here is the glbasic code for doing above:

Code (glbasic) Select

AndroidLoading()
AndroidSettings()

FUNCTION AndroidLoading:
STDOUT "WAITCOPY()"
LOCAL file$=GETCURRENTDIR$()+"/Splash/splash.jpg"

IF PLATFORMINFO$("DEVICE")="TOUCHSCREEN" OR PLATFORMINFO$("DEVICE")="KEYBOARD"
SLEEP 250
LIMITFPS 10
LOCAL x, y
GETSCREENSIZE x, y
LOCAL image=0
LOCAL SCALING=y/320
IF SCALING<0.5 THEN SCALING=0.5
IF SCALING>1.0 THEN SCALING=1

WHILE PLATFORMINFO$("TEMP")="INSTALLING" AND PLATFORMINFO$("TEMP")<>""
ControlTilt() // Make sure to set orintation
IF image=0
IF DOESFILEEXIST(file$)=1
LOADSPRITE file$, 1
image=1
ENDIF
ENDIF
IF image=1
// draw rutunes here, example splash icons or such (I used functions here, but you have the idea)
PaintImage(1, 0, 0, 1, 0, 0)
ENDIF
SHOWSCREEN
WEND
ENDIF
LOADSPRITE "", 1
ENDFUNCTION

FUNCTION AndroidSettings:
LOCAL osproduct$
LOCAL osdevice$
LOCAL OSManufacturer$
LOCAL osmodel$
LOCAL info$=PLATFORMINFO$("TEMP")
info$=REPLACE$(info$, "null", "")
FOR i=2 TO 7
LOCAL name$=StringField$(info$, i, "|"); name$=LCASE$(name$); name$=TRIM$(name$)
LOCAL value$=StringField$(name$, 2, "="); value$=LCASE$(value$); value$=TRIM$(value$)
name$=StringField$(name$, 1, "=")
IF name$<>""
IF name$="osproduct" THEN osproduct$=value$
IF name$="osdevice" THEN osdevice$=value$
IF name$="osmanufacturer" THEN OSManufacturer$=value$
IF name$="osmodel" THEN osmodel$=value$
ELSE
BREAK
ENDIF
NEXT

STDOUT "product: "+osproduct$+" "+osdevice$+" "+OSManufacturer$+" "+osmodel$
IF osproduct$="touchpad" AND osdevice$="tenderloin" THEN STDOUT "HP Touchpad"
IF osmodel$="'kindle fire" AND OSManufacturer$="amazon" THEN STDOUT "Amazon Kindle Fire"
ENDFUNCTION

FUNCTION ControlTilt: direct=0 // perform ORIENTATION check before showing the loading image, or its might shown wrong direction.
STATIC COUNTER=0
STATIC ORIN=0
LOCAL x, y
LOCAL NEWRIENTATION
STATIC yres, xres

COUNTER=COUNTER+1
IF COUNTER>100 THEN COUNTER=85
IF (COUNTER=17 OR direct=1)
IF ORIN>-1 AND GETORIENTATION()<>ORIN
SETORIENTATION ORIN
RETURN
ENDIF
ENDIF
IF MOD(COUNTER, 15)<>5 THEN RETURN

IF GETORIENTATION()=0
y=GETJOYY(0)*100
x=GETJOYX(0)*100
ELSEIF GETORIENTATION()=1
y=-GETJOYX(0)*100
x=GETJOYY(0)*100
ELSEIF GETORIENTATION()=2
y=-GETJOYY(0)*100
x=-GETJOYX(0)*100
ELSE
y=GETJOYX(0)*100
x=-GETJOYY(0)*100
ENDIF

IF (y>60 OR KEY(17)=1) AND ORIN<>2
ORIN=2; COUNTER=0;
ELSEIF (y<-60 OR KEY(31)=1) AND ORIN<>0
ORIN=0; COUNTER=0;
ELSEIF (x>60 OR KEY(32)=1) AND ORIN<>3
ORIN=3; COUNTER=0;
ELSEIF (x<-60 OR KEY(30)=1) AND ORIN<>1
ORIN=1; COUNTER=0;
ENDIF
ENDFUNCTION

FUNCTION PaintImage: ID, x#, y#, zoom#, xspot, yspot // paint image with some hotspot features.
LOCAL h#, w#, img, SH, SW, PX#, PY#, PW#, PH#
LOCAL img=ID

GETSPRITESIZE img, w, h
GETSCREENSIZE SW, SH

// math placement for hotspots
IF xspot=-1 THEN PX=x#
IF xspot=0 THEN PX=SW/2.0-(w#*zoom#/2.0)+x#
IF xspot=1 THEN PX=SW-w#*zoom#-x#
IF yspot=-1 THEN PY=y#
IF yspot=0 THEN PY=SH/2.0-(h*zoom#/2.0)+y#
IF yspot=1 THEN PY=SH-h#*zoom#-y#
PW=w*zoom#
PH=h*zoom#

// draw a sprite top on the drawrect box, but its slighty off. Also some rotation support, not finished, but dont think about it.
ZOOMSPRITE img, PX#-((1-zoom#)*w#)/2, PY#-((1-zoom#)*h#)/2, PW#/w#, PH#/h#
ENDFUNCTION

FUNCTION StringField$: TXT$, index%, Delimeter$ // a very handy stringfield function, which is very much missing in glbasic.
LOCAL i, char$
LOCAL RESULT$=""
FOR i=0 TO LEN(TXT$)
LOCAL char$=MID$(TXT$, i, 1)
IF char$=Delimeter$ OR i=LEN(TXT$)
index%=index%-1
IF index%=0 AND i=LEN(TXT$)
RETURN RESULT$+char$
ENDIF
IF index%=0 THEN RETURN RESULT$
IF i=LEN(TXT$) THEN RETURN ""
RESULT$=""
ELSE
RESULT$=RESULT$+char$
ENDIF
NEXT
RETURN ""
ENDFUNCTION


The changed SDLActivity.java is in Attachements and must been in Compiler\platform\android\templateproj\src\com\glbasic\test in glbasic main folder. You can also add more into to the TEMP folder by adding more info in around line 115. Fell free to do that.

Howover this code does NOT fix the surface issue, which I guess Gernot allreadt have fixed (twice?). Also I have only access to the early v11 beta, so its must been tested in the newer as well copied the changed code..... I could do that if I got a never version eventuelly.

[attachment deleted by admin]
#136
I think DOESFILEEXIST() should not return a 1 on a folder, but returning a 2?

I got some crashes on iOS due some confuctions due the command also returned 1 on folder, which is not a file......
#137
today I have trouble to get that command to work, becuase I have no clue its have open the shoebox file or not.

I did that:

- I have a Media/gpx folder that contain all graphics.
- I shoebox that graphics folder and give the result as Media/gpx.sbx.
- I rename the Media/gpx folder to make sure its use the showbox (as testing).
- I trying to set it with SETSHOEBOX "gpx.sbx", "gpx.sbx", but no path, because its allready is open in the Media folder.

When I so LOADSPRITE or such mean, then its failed.

I have also subfolder with some medias (no filename use same name, since I are aware of subfolders not supported) and path using is the same (which its should have removed anyway). But I do more concern how to check, if the SHOEBOX really have been set or I have used some sort wrong path or something with that. So its would been nice its its could return a error as well STOUT which path/file$ its tried to open. Then its would been much easier to debug.

So its might not been a bug in SETSHOWBOX directly itself, but more I want some more ERROR info what its tried.


#138
I removed the previos post because its did have too many edits and confuctions post, thus because I have invistated what its really happens. So sorry about it, but its still a bug, Sorry about it.

BUG:
- When surface is changed by Android due rotation or such when user slide keyboard or such thing, then glGasic does noet reflect that. A example can been seen in this video (when he slide controller in and out):
http://dl.dropbox.com/u/3236515/GreedyMouse/orintation_issue.wmv

If you using android:screenOrientation="sensor" in your manifest.xml, then its happens that too as well (which is much easier to invoke the bug).

What Happens?
- Glbasic does not do a SETSCREEN at all when surface have been changed, and then countinue to use the old resoulution like nothing have been happen. Neither GETSCREENSIZE or GETDESKTOPSIZE have been updated after that surface change, which is very important for Android and on ICS4.

With other word:
- Glbasic is not aware on a surface changes at all, which can been happens on Android. I also think its why its have its own problems on Kindle Fire due this?

To fix (which I cant do my self here):
- Glbasic should return the new resoulution to GETDESKTOPSIZE after a surfaceChanged() call, and then the surface size can then been set on SETSCREEN.
#139
I see on Android there is not possible to call java directly in inline yet? But I do see there is a SDLActivity.java. So I gonna think a idea its could add a INLINE idea to call ONE function, something like this:

USERFUNCTION$(FUNCTION$, ARG$)

In that userfunction its could call a java function directly and then creating a wrapper to call other functions. Yes there is something interpreting here, but those inlines is mostly to possible to hopefully integreate Admon, inapp purchase, more device info and such thing, which dosent require intepreting all time....

the java file could been "user.java" in the same dir where SDLActivity.java is.

All here could been inlines as well.

This is only a idea to been acccepted or not :-D. Its for more advanced topic I know.
#140
this due its not just take argument, but also the whole path, which is not needed at all?

or something I have misunderstanding here?

A easy workaorund is throught do this:
Code (glbasic) Select

GLOBAL commandline$ = GETCOMMANDLINE$()
commandline$=REPLACE$(commandline$, GETCURRENTDIR$(), "")


Then its works as intended. Something you should add to the document file.