GLBasic V12 (was formerly V11 beta)

Previous topic - Next topic

Jonás Perusquía

I´ve got a problem, GLBasic v10 compiles well my game, but v11 doesn´t... it says a FUNCTION inside a TYPE returns void value... see:

Code (glbasic) Select
compiling:
C:\Users\JonasPm\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `void __GLBASIC__::game()':
C:\Users\JonasPm\AppData\Local\Temp\glbasic\gpc_temp0.cpp:2404: error: return-statement with a value, in function returning 'void'
*** FATAL ERROR - Please post this output in the forum


here is the source:


[attachment deleted by admin]
<HTML><BASIC><EC>
Be free and do good things

MrTAToad

I haven't seen default values for functions produce any errors.

Code (glbasic) Select

FUNCTION SpacerTest: someSpacer$=" $%^&"
ENDFUNCTION


does compile okay...

Any chance of seeing some of the errors ?

MrTAToad

Quote from: jonaspm on 2012-Dec-16
I´ve got a problem, GLBasic v10 compiles well my game, but v11 doesn´t... it says a FUNCTION inside a TYPE returns void value... see:

Code (glbasic) Select
compiling:
C:\Users\JonasPm\AppData\Local\Temp\glbasic\gpc_temp0.cpp: In function `void __GLBASIC__::game()':
C:\Users\JonasPm\AppData\Local\Temp\glbasic\gpc_temp0.cpp:2404: error: return-statement with a value, in function returning 'void'
*** FATAL ERROR - Please post this output in the forum


here is the source:

The problem seems to be the game subroutine - you had GLOBAL variables and TYPEs defined there, which isn't a terrible good thing - move them to the start of the program and all is well...

[attachment deleted by admin]

Jonás Perusquía

#138
FIXED!

thank you :D

btw, we will be able to use Java 1.7 for Android compilation?
<HTML><BASIC><EC>
Be free and do good things

Hemlos

Applogies for not coming back with feedback on resolved issue nik.
It turns out i installed an older version of v11.
I uninstalled it, and reinstalled the latest one, All fixed.


Quote from: MrTAToad on 2012-Dec-16
I haven't seen default values for functions produce any errors.

Code (glbasic) Select

FUNCTION SpacerTest: someSpacer$=" $%^&"
ENDFUNCTION


does compile okay...

Any chance of seeing some of the errors ?
Bing ChatGpt is pretty smart :O

BdR

I downloaded the new IDE v11.261 and everything works on Windows. The CONSTANT for strings also seems to work again. :)

However, I still get 320x480 on my iPod4. Also, I noticed the libPROGRAM.a doubled in size for my project, from (I think) ~770kb to now it is 1570kb ? But my GLB project hasn't changed.



Jonás Perusquía

Issue found:

In v10 i could compile projects with SYSTEMPOINTER TRUE for Android

In latest  v11 Android app crashes before new loading animation
<HTML><BASIC><EC>
Be free and do good things

BdR

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..

Hemlos

Quote from: BdR on 2012-Dec-21
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..

Could this be a problem in your code caused by type casting?
Bing ChatGpt is pretty smart :O

BdR

Quote from: Hemlos on 2012-Dec-22
Could this be a problem in your code caused by type casting?

That's the first thing I checked, I don't think that's it. At first I used xPos%, yPos% but changing this to xPos#, yPos# didn't help. Here is my code, it run correct when compiling with GLBasic v10 but not in v11.

Code (glbasic) Select
// -------------------------------------
// tilt test
// -------------------------------------
FUNCTION RunTiltTest:

  LOCAL xAccel#, yAccel#, zAccel#
  //LOCAL xPos%, yPos%
  LOCAL xPos#, yPos#

  // loop
  WHILE (1=1)

    xAccel = GETJOYX(0)
    yAccel = GETJOYY(0)
    zAccel = GETJOYZ(0)

    PRINT "Name(0)="+GETJOYNAME$(0), 10, 20
    PRINT "xAccel="+xAccel, 10, 40
    PRINT "yAccel="+yAccel, 10, 60
    PRINT "zAccel="+zAccel, 10, 80

    // draw lines
    xPos = 240.0 + (240.0 * xAccel)
    yPos = 400.0 - (400.0 * yAccel)

    DRAWRECT 0, yPos, 480,  1, RGB(255, 255, 0) // horizontal line
    DRAWRECT xPos, 0, 1, 800, RGB(255, 255, 0) // vertical line

    SHOWSCREEN
  WEND

ENDFUNCTION

Jonás Perusquía

try to delete the 0 inside the GETJOYX,Y,X like:

Code (glbasic) Select
GETJOYX()
GETJOYY()
GETJOYZ()
<HTML><BASIC><EC>
Be free and do good things

Kitty Hello

I have to check it. How can this be?

Hemlos


BdR stil no resolution?

Personally, i had some other unrelated issues with GLBasic IDE, Version: 11.261.
I solved them by completely uninstalling the older v11 first, then reinstalling the latest one.

Bing ChatGpt is pretty smart :O

spacefractal

#148
confirmed bug, same happens here as well (hope that orientation bug could been moved to the bug section?).

EDIT:
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 interger, which its should not.

An alternative could use the java communication I have set up earlier, but that is for after christmas. Should been pretty easy to do.

Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Jonás Perusquía

Found out that in Windows and Android PLAYSOUND command works different... In Windows, it is played and cannot be played again after the one that is iplaying ends.. (talking about a loop of the same sound) and in Android, making a loop of the same sound works well, many sounds at the same time...

In my game when a shooting reaches an asteroid, a sound is played, in Windows,, not all collisions get a sound since they cannot be played at.the same.time... Im Android, all collisions get the same sound and are played at the same time
<HTML><BASIC><EC>
Be free and do good things