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.


Topics - Crivens

Pages: 1 2 3 [4]
46
IDE/Syntax / Show routine name
« on: 2011-Apr-08 »
Sometimes a routine or a function is very long and you forget where you are (or if you search for something and are now in another routine when you think you are in the routine you first searched from), so it would be nice to be able to see somewhere which function or sub you are inside. Either that or highlight it in the jumps list.

Cheers

47
Bug Reports / IDE jumps
« on: 2011-Mar-25 »
I've only just noticed that sometimes the jumps aren't working at all. I'm not sure exactly when it happened but I upgraded to 9.040 today and I've noticed it all morning. At first I thought it was just jumping to the routine above the one I wanted, but I am getting it go completely wrong now and put me in the middle of a totally random routine! One example I have is two routines away (the one I'm after doesn't even start until at least 20 lines below the bottom of the screen).

Cheers

48
GLBasic - en / Project name
« on: 2011-Mar-23 »
Ok so I'm making a free version of my game, and I copied the project directory to a different name. I also then changed the project name in the project options. However when I load up GLB and it shows the list of projects both the free and full version have the same name (the one from the full version). What am I missing?

Cheers

49
Bug Reports / Savesprite transparency problem
« on: 2011-Mar-18 »
I've written a small routine to automatically load iOS retina sized graphics and resize to the screen size you are actually using (eg. 3GS res). It then saves these using savesprite to a png file so next time it will load faster (and more importantly use less memory) on the non-retina devices (using a version file). This nicely works apart from one thing. Basically anything with transparency I have as pink (255,0,128) and even make sure it is set to pink just incase at the start of the routine. I then fill the screen with pink to make sure if the transparency channel of the png is being used rather than pink then it will make those pixels pink (forget partial transparency for now, even if GLB supports it). I then paste it resized, use grabsprite, and then savesprite.

All this works very well. I have no issues. Apart from transparency. I have a png file that resizes correctly, and keeps the pink that was in the original as pink. They are exactly the same except the resized one is 4 times smaller obviously. However using the resized sprite keeps the pink on the screen, whereas the original is transparent. Interestingly using Paint Shop Pro 8 if I load the resized sprite and then immediately save over itself, then GLB shows the pink as transparent, which leads me to believe that possibly the savesprite command doesn't work correctly with the transparent channel.

I've included the 3 files for comparison. Basically retina.png is the original large sprite. resized.png is what GLB automatically created (on a PC, I haven't tried yet on iOS) which shows transparent instead of pink. And psp8.png is the same resized.png that I just loaded into psp8, saved immediately, and then ran the exact same GLB code again to find it worked with transparency.

Cheers



[attachment deleted by admin]

50
Bug Reports / Shoebox memory leak
« on: 2011-Mar-14 »
I posted this elsewhere but thought here would be better.

This code on the iPhone keeps building up used memory until it eventually crashes:-
Code: (glbasic) [Select]
ttime=GETTIMERALL()
ttotal=0
tsprite=GENSPRITE()
WHILE 1=1
IF GETTIMERALL()-ttime>100 
LOADSPRITE "Media/1-1.png",tsprite
INC ttotal
ttime=GETTIMERALL()
ENDIF
PRINT ttotal,0,0,10
SHOWSCREEN
WEND

If I use a loadsprite "",tsprite directly after the loadsprite command it makes no difference. From the graph in XCode you can see it gives back a little memory when loading the sprite again (seen by spikes in graph), but nowhere near enough.

Cheers

[attachment deleted by admin]

51
Bug Reports / Loadanim problem with iPod
« on: 2011-Mar-04 »
Ok so I've got an image I use with LOADANIM (see attached youwin.png) that is basically an animated "You win". It works perfectly in Windows, and on a 3GS iPhone (4.2.1), but a 2nd gen iPod Touch (4.1) shows the animation incorrectly. Everything else is identical between the 3GS and the iPod. The animgated image looks a little offset. I've included the main file, a screenshot from the 3GS, and a screenshot from the iPod.

The loading code I use is this:-
Code: (glbasic) [Select]
GLOBAL youwinid=100
GLOBAL youwinwidth=220
GLOBAL youwinheight=120
LOADANIM "Media/youwin.png",youwinid,youwinwidth,youwinheight

and the drawing code is this:-
Code: (glbasic) [Select]
SUB youwon:
ALPHAMODE 1
DRAWANIM youwinid,frameno,gamescreenx/2-(youwinwidth/2),gamescreeny/2-(youwinheight)
ALPHAMODE 0
SETFONT 1
LOCAL scorestr$="Score:"+score
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),youwinheight+(gamescreeny/2)-(fonty/2)-fonty,kern
IF showcontinue=1
scorestr$="Continue"
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),screeny-fonty,kern
ENDIF
SETFONT 0
scorestr$="Moves:"+moves
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),youwinheight+(gamescreeny/2)-(fonty/2),kern
SETFONT 3
scorestr$="High:"+oldhigh
IF score>oldhigh THEN scorestr$="Old "+scorestr$
PRINT scorestr$,gamescreenx/2-(LEN(scorestr$,kern)/2),bottombar,kern2
IF GETTIMERALL()-lasttimer>100
INC frameno
IF frameno>5 THEN frameno=0
lasttimer=GETTIMERALL()
ENDIF
ENDSUB

Cheers

[attachment deleted by admin]

52
IDE/Syntax / Toolbar move
« on: 2011-Feb-27 »
Ok, so I have GLB v9 on my desktop and my laptop. They are both widescreen but the laptop is a higher resolution at 1920x1200. I copy the same projects between the 2 main machines depending where I am. Anyway, I've noticed that the toolbar that has the macro icons always moves to below the main toolbar when using the laptop. This every time I restart GLB. There is about half the width of the screen left to put the macro toolbar to the right of the main toolbar, and in fact more width than the desktop has. I can move the macro toolbar to the right of the main toolbar and all is fine, but I have to do this everytime I start GLB on the laptop. As I said, the desktop is absolutely fine and the macro toolbar always appears to the right of the main toolbar on GLB startup.

Cheers 

53
GLBasic - en / iPhone AR games
« on: 2011-Feb-19 »
Ok so it would be brilliant to write an AR (augmented reality) app or game for the iPhone. Obviously this would require access to the camera and be able to interact with that constantly updating image. So not just a plugin to allow access to the camera and then bring a photo back to GLB but to have the view from the camera on screen with full control to GLB so we can overlay it with graphics and the like.

So anyone know how to go about it?

Cheers

54
Bug Reports / V9 print bug
« on: 2011-Feb-13 »
I've found a strange bug with text since installing v9. Basically the following code used to work fine in v8 but now with V9 only the second print command works, with the first one completely missing (GAMENAME text). I've put in debugging and it gets to the line with the correct parameters.
Code: (glbasic) [Select]
IF youhavewon=0
SETFONT 1
textstr$="GAMENAME"
PRINT textstr$,screenx/2-(LEN(textstr$,kern)/2),screeny-fonty+5,kern
IF lastbatt=-1 OR GETTIMERALL()-lastbatt>10000
lastbatt=GETTIMERALL()
//mybatt%=MIN(100,MAX(0,INTEGER(PLATFORMINFO$("BATTERY")))) //Doesn't seem to work on iPhone currently (get 3% lower or so)
mytime$=PLATFORMINFO$("TIME")
mytime$=MID$(mytime$,11,2)+":"+MID$(mytime$,14,2)
ENDIF
SETFONT 2
//textstr$=mybatt%+"%"
//PRINT textstr$,screenx-LEN(textstr$,kern2),screeny-fonty2,kern2
textstr$=mytime$
PRINT textstr$,0,screeny-fonty2,kern2
IF multiplayer=1 THEN PRINT moveinfo$,0,0
ENDIF

Now the stranger bit. I noticed that if I moved the GAMENAME 3 lines of code (SETFONT to the PRINT line) to after the IF then it prints that, but not the text inside the IF (ie. the time).

And an even stranger bit. If I take the "PRINT textstr$,screenx/2-(LEN(textstr$,kern)/2),screeny-fonty+5,kern" line, that is for the "GAMENAME" text, and copy it immediately below the existing command (ie. two identical PRINT commands one line after the other), then it works just fine, with both text appearing. So perhaps a new bug that means the first print in a subroutine (this is in a subroutine in a separate gbas file) does not print? Something is up that's for sure.

Cheers

55
GLBasic - en / Grabsprite query
« on: 2011-Feb-04 »
So Grabsprite allows a portion of the backbuffer to be grabbed, which serves me fine, but I was wondering if there was a way to grab the front buffer (ie. the screen) apart from the really slow getpixel? Either that or copy the frontbuffer to the backbuffer would be fine.

Cheers

Pages: 1 2 3 [4]