Author Topic: GLBasic V12 (was formerly V11 beta)  (Read 111683 times)

Offline Jonás Perusquía

  • Mr. Polyvector
  • ***
  • Posts: 170
    • View Profile
    • Ditrabox
Re: GLBasic V11 public beta
« Reply #135 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:


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

MrTAToad

  • Guest
Re: GLBasic V11 public beta
« Reply #136 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 ?

MrTAToad

  • Guest
Re: GLBasic V11 public beta
« Reply #137 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]

Offline Jonás Perusquía

  • Mr. Polyvector
  • ***
  • Posts: 170
    • View Profile
    • Ditrabox
Re: GLBasic V11 public beta
« Reply #138 on: 2012-Dec-16 »
FIXED!

thank you :D

btw, we will be able to use Java 1.7 for Android compilation?
« Last Edit: 2012-Dec-16 by jonaspm »
<HTML><BASIC><EC>
Be free and do good things

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1634
  • Particle Hawk
    • View Profile
Re: GLBasic V11 public beta
« Reply #139 on: 2012-Dec-16 »
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.


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 ?
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline BdR

  • Dr. Type
  • ****
  • Posts: 303
    • View Profile
    • BdR Games
Re: GLBasic V11 public beta
« Reply #140 on: 2012-Dec-16 »
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.



Offline Jonás Perusquía

  • Mr. Polyvector
  • ***
  • Posts: 170
    • View Profile
    • Ditrabox
Re: GLBasic V11 public beta
« Reply #141 on: 2012-Dec-19 »
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

Offline BdR

  • Dr. Type
  • ****
  • Posts: 303
    • View Profile
    • BdR Games
Re: GLBasic V11 public beta
« Reply #142 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..

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1634
  • Particle Hawk
    • View Profile
Re: GLBasic V11 public beta
« Reply #143 on: 2012-Dec-22 »
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?
Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline BdR

  • Dr. Type
  • ****
  • Posts: 303
    • View Profile
    • BdR Games
Re: GLBasic V11 public beta
« Reply #144 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

Offline Jonás Perusquía

  • Mr. Polyvector
  • ***
  • Posts: 170
    • View Profile
    • Ditrabox
Re: GLBasic V11 public beta
« Reply #145 on: 2012-Dec-22 »
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

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10708
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
GLBasic V11 public beta
« Reply #146 on: 2012-Dec-23 »
I have to check it. How can this be?

Offline Hemlos

  • To boldy go where no pixel has gone before!
  • Global Moderator
  • Prof. Inline
  • *******
  • Posts: 1634
  • Particle Hawk
    • View Profile
Re: GLBasic V11 public beta
« Reply #147 on: 2012-Dec-24 »

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.

Volume_of_Earth(km^3) = 4/3*3.14*POW(6371.392896,3)

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3625
    • View Profile
    • Space Fractal
Re: GLBasic V11 public beta
« Reply #148 on: 2012-Dec-24 »
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.

« Last Edit: 2012-Dec-24 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline Jonás Perusquía

  • Mr. Polyvector
  • ***
  • Posts: 170
    • View Profile
    • Ditrabox
Re: GLBasic V11 public beta
« Reply #149 on: 2012-Dec-26 »
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