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

#76
Quote from: PeeJay on 2011-Dec-20

The code is as follows:-

Code (glbasic) Select
FUNCTION LoadHiScore:

IF DOESFILEEXIST("hiscore.dat")
OPENFILE(0,"hiscore.dat",TRUE)
READWORD 0,hiscore
CLOSEFILE 0
ELSE
hiscore=0
ENDIF

ENDFUNCTION



Aww dont tease like that, GLB manic Miner is one program I would love to see the source for, i.e. how to code a classic old school platformer with a modern language :)

Good to see you getting back into coding again though
#77
not sure if its best practice but I have specified the full path for the wav file in PLAYMUSIC, could this cause implications elsewhere in directories getting changed?
#78
Hopefully someone here can give me a simple solution to this problem

I have a sound that is loaded as a wav file at program start up that I want to play as a continuous loop at certain times. Currently I am using PLAYSOUND and checking if the channel is still playing and restarting if it isn't but my problem is if the music stops when it is out of the loop doing something else I get a pause. I see that PLAYMUSIC can be set to run and just play in the background as a looping tune but from the docs it looks like PLAYMUSIC requires the sample to be loaded at the time of playing rather than specifying a sound number that is already loaded. This would be difficult to use as I jump all over the place saving files.

I also notice that you can set a buffer value on LOADSOUND between 1 and 4 that states the number of times the sample can be played without interruption, I assume it just duplicates the sound x number of times. Setting this to 4 cures the problem a little bit but not totally.

Can PLAYMUSIC be used with a preloaded sample or is there any way that PLAYSOUND can be set to loop and forget until the sample is killed with a HUSH?

Thanks
Gary
#79
Nice app Kitty, might have to get it tomorrow as Im off for an op on Wednesday as it could be useful to have a play about on while Im waiting to go under the knife :)

Maybe I could produce the first app while still groggy from the anesthetic

How are you producing the stand alone games? does it output GLBasic source code?
#80
GLBasic - en / GLB Debugger
2011-Nov-15
Is there any page anywhere that details the proper use of the debugger?

I have had call to use it for the first time in over a year of using GLB and am finding new things out about it. At first I thought that it was cumbersome to have to keep scrolling up and down the debug window to find out a current value of a variable but then I left my mouse pointer over the source code and up popped the current value of a variable!!.

What other little timesaving tips are there in the debugger that I have not found yet?

Gary
#81
found it

Of course if the thread takes more than 20ms to run then you end up with

20-(number larger than 20)

Which gives a negative sleep value and the thread halts

Thanks for the tips anyway
#82
Its actually a very strange bug. as I want to run the thread approximately every 20ms I do something like this

Code (glbasic) Select

WHILE TRUE
threadstart=GETTIMERALL()
.
.
. thread code in here
.
.
sleeptime=20-(GETTIMERALL()-threadstart)
DEBUG "sleeptime = "+sleeptime+"\n"
SLEEP sleeptime // have a little rest for now
               WEND


Now most of the time sleeptime is returning 14-16 ms but when it locks up it has returned a negative number. It can lock out when the focus is on the window or when its off it. Nothing is trashing threadstart, its almost like GETTIMERALL() is returning a false value
#83
Just run a few more tests and it is the thread locking out or getting stuck in a loop somewhere. So can the debugger be forced to run the code in the thread rather than the main program?
#84
I have made a few major changes to a project im working on and am now experiencing random crashes.

If I have debug on then the code seems to crash at random places anywhere between 10 and 30 seconds after starting up. According to the debugger its still running as I can pause it and step through each line.

If debug is off then it seems to be fine until I remove focus from the program and then it locks up and even clicking back on the app does not restore it running (I have AUTOPAUSE FALSE at the top of the program)

Also when running in debug in the thread that is running I have put in a debug message that is displayed every loop, this also stops making me think the thread is the part of the program that has hung (all of my graphic updates and button detection is done in the thread so this would give the impression of the main program locking up.

Has anyone else noticed anything similar when using threads recently? Or if not is there any way I can debug the thread that is running with the debugger?

Thanks
Gary
#85
I just tried consolas but hated the capital N and M on it at any size under 13. I see others are not looking the same as mine so maybe its a windows setting issue.

So its back to lucida console size 8 for me
#86
so my new transformer is redundant now :(

Seriously though if its anywhere near as good as the original then its a must buy. Or if you want a cheaper slightly slower version then go for the original, it will see to all your android tablet needs and more
#87
On an Xperia play it looks like the screen has been zoomed in a lot, the ship is about a 3rd of the width of the screen, the menu text is badly cropped and you can hardly get out of the way of the rocks.

I will get some screen shots if you need them

Gary
#88
I have a couple of projects that always returns an Illegal exception error if I have debug turned on or a ring bill error if its non debug, no idea why it does it either :( But that has been doing that for a couple of years now, its not recent
#89
here is the output of the latest test

Code (glbasic) Select

--------- beginning of /dev/log/system
--------- beginning of /dev/log/main
I/glbasic ( 1158): onCreate
I/glbasic ( 1158): Updating media files
I/glbasic ( 1158): assets found, copying...
I/glbasic ( 1158): assets still up to date, proceed to main...
I/glbasic ( 1158): done with updating
I/glbasic ( 1158): external files dir is /data/data/com.glbasic.glbasicenginetes
t/files
I/glbasic ( 1158): external storage /mnt/sdcard/Download
I/glbasic ( 1158): onResume()
I/SDL     ( 1158): pixel format RGB_565
I/SDL     ( 1158): SDL_Android_Init()
I/glbasic ( 1158): timer
I/glbasic ( 1158): rbow
I/glbasic ( 1158): rbow init
I/glbasic ( 1158): SDL_init video
I/glbasic ( 1158): SDL_GetVideoInfo = 800x1232 @ 16 bpp
I/glbasic ( 1158): Setting video mode: 800x1232x16 fl=4800000
I/SDL     ( 1158): [STUB] GL_LoadLibrary
I/SDL     ( 1158): Starting up OpenGL ES 1.1
I/glbasic ( 1158): SDL_SetVideoMode seems to be 1
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/OpenGLRainbows.cpp(5633) : error OGL1281: A numeric ar
gument is out of range. The offending function is ignored, having no side effect
other than to set the error flag.
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/OpenGLRainbows.cpp(5633) : error OGL1281: A numeric ar
gument is out of range. The offending function is ignored, having no side effect
other than to set the error flag.
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/OpenGLRainbows.cpp(5633) : error OGL1281: A numeric ar
gument is out of range. The offending function is ignored, having no side effect
other than to set the error flag.
I/glbasic ( 1158): get accurate timer - 1st call
I/glbasic ( 1158): flip - 1st call
I/glbasic ( 1158): BGRA ext supported
I/glbasic ( 1158): Texture size limit: 2048
I/glbasic ( 1158): init fbo
I/glbasic ( 1158): 2D VP
I/glbasic ( 1158): OGRB init [OK]
I/glbasic ( 1158): Cptn
I/glbasic ( 1158): Network
I/glbasic ( 1158): Input
I/glbasic ( 1158): Window mode
I/glbasic ( 1158): Create DXin
I/glbasic ( 1158): sdl_grab
I/glbasic ( 1158): reptr
I/glbasic ( 1158): getexe
I/glbasic ( 1158): cd
I/glbasic ( 1158): set cdir to: /data/data/com.glbasic.glbasicenginetest
I/glbasic ( 1158): exepath=curdir= /data/data/com.glbasic.glbasicenginetest
I/glbasic ( 1158): set cdir to: files
I/glbasic ( 1158): Init Finalized
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/FBuffers.cpp(281) : error OGL1280: An unacceptable val
ue is specified for an enumerated argument. The offending function is ignored, h
aving no side effect other than to set the error flag.
I/glbasic ( 1158): depth 24 failed, try 32
I/glbasic ( 1158): depth 32 failed, try 16
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/OpenGLRainbows.cpp(4511) : error OGL1282: The specifie
d operation is not allowed in the current state. The offending function is ignor
ed, having no side effect other than to set the error flag.
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/OpenGLRainbows.cpp(4755) : error OGL1282: The specifie
d operation is not allowed in the current state. The offending function is ignor
ed, having no side effect other than to set the error flag.
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/FBuffers.cpp(281) : error OGL1280: An unacceptable val
ue is specified for an enumerated argument. The offending function is ignored, h
aving no side effect other than to set the error flag.
I/glbasic ( 1158): glBindRenderbufferExt failed 8cd6
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/FBuffers.cpp(281) : error OGL1280: An unacceptable val
ue is specified for an enumerated argument. The offending function is ignored, h
aving no side effect other than to set the error flag.
I/glbasic ( 1158): depth 24 failed, try 32
I/glbasic ( 1158): depth 32 failed, try 16
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/FBuffers.cpp(281) : error OGL1280: An unacceptable val
ue is specified for an enumerated argument. The offending function is ignored, h
aving no side effect other than to set the error flag.
I/glbasic ( 1158): C:/Users/gf/Documents/SourceCode/frisch/fun/GLBasic/Compiler/
platform/Win32/Bin/Hidden/FBuffers.cpp(281) : error OGL1280: An unacceptable val
ue is specified for an enumerated argument. The offending function is ignored, h
aving no side effect other than to set the error flag.
I/glbasic ( 1158): solid  grab != on screen
I/glbasic ( 1158): polyvec 1,1 != white
I/glbasic ( 1158): Shut down GLB
I/glbasic ( 1158): glb is shut down
I/SDL     ( 1158): [STUB] GL_UnloadLibrary


and attatched is the screen shot, not sure if its what you expected Gernot



[attachment deleted by admin]
#90
Im not certain but I am sure I saw a q drive error when I didnt have the paths set correctly. It seemed to use Q as a default path. I would check you have all paths are as per the manual.