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

#241
Hi,

I hope you guys have been behaving yourselves! ;)

Ive been off for quite a while dealing with some illness.

After a quick look at the forum, it looks a little quiet, also there doesn't seem to be the usual flood of updates from Gernot? I hope everything is OK?

Well, I hope your all doin well otherwise. :)

Cheers,


Ian
#242
Could we have a short cut key for this Gernot...

"CTRL + G", for example.

It's something Im grabbing my mouse for quite a bit?
#243
Im getting this error if I compile my program...

Code (glbasic) Select
In file included from C:\DOCUME~1\DAD\LOCALS~1\Temp\glbasic\gpc_temp.h:6,
                 from C:\DOCUME~1\DAD\LOCALS~1\Temp\glbasic\gpc_tempg.cpp:2:
C:\DOCUME~1\DAD\LOCALS~1\Temp\glbasic\gpc_temp_class.h:84: error: `TSpritePage' does not name a type
C:\DOCUME~1\DAD\LOCALS~1\Temp\glbasic\gpc_temp_class.h: In member function `__GLBASIC__::TGUI& __GLBASIC__::TGUI::operator=(const __GLBASIC__::TGUI&)':
C:\DOCUME~1\DAD\LOCALS~1\Temp\glbasic\gpc_temp_class.h:93: error: 'class __GLBASIC__::TGUI' has no member named 'SpritePage'
C:\DOCUME~1\DAD\LOCALS~1\Temp\glbasic\gpc_temp_class.h:93: error: 'const class __GLBASIC__::TGUI' has no member named 'SpritePage'
It has 3 program files, 1 main,2 libs.

The 2nd file has a type that refers to a type definition from the 3rd file.

The 2nd file does not seem to register the type from the 3rd unless I actually copy it from the 3rd to the 2nd, then it works, this destroys the portability of the 3rd though?
#244
GLBasic - en / Debugger
2008-Mar-11
My debugger Tab window (to the right of the main IDE window), is always blank, no variables show here, even when the debug button is active on the toolbar? Also, when I break execution using a breakpoint. I don't see the current line being executed as well as no variable dump? Actually apart from a few extra compiler messages and being able to continue a run after a breakpoint, the debugger seems to do nothing?

I'm a big stub man, so I rarely need the debugger anyway but lately I could have done with variable viewing at runtime during a particularly nasty bug hunt... without resorting to the DEBUG command?
#245
Can anyone recommend a cheap 2D artist/content package or a source of copyright free, non-ripped graphics for a 2D platformer? Ive googled till Im blue in the face but to no avail? :P

Many thanks,
#246
Bug Reports / MOD bug
2008-Mar-07
Very large numbers cause MOD to return negative numbers...

Code (glbasic) Select
PRINT MOD(3124987331, 100), 30,30...for example.

The number is not out of bounds but its close, I don't know if that's where the problem lies.
#247
Are all new variables, typed records, arrays of types, numeric, locals, globals etc. automatically initialised with 0? My initial tests say they are but it would be nice to have the official word?
#248
GLBasic - en / Remark Blocks
2008-Feb-11
Can we change the way that remaking a block applies its remark can be very frustrating sometimes...

Code (glbasic) Select
GETSCREENSIZE screenwidth,screenheight
sx=screenwidth*.2;sy=screenheight*.5   //start point
//ex=screenwidth*.8;ey=screenheight*.5   //end point
bx=screenwidth*.5;by=screenheight*.5   //curve towards point
//animTime=5000   //animation time of 2 seconds
Block remarked, becomes...

Code (glbasic) Select
//GETSCREENSIZE screenwidth,screenheight
//sx=screenwidth*.2;sy=screenheight*.5   //start point
ex=screenwidth*.8;ey=screenheight*.5   //end point
//bx=screenwidth*.5;by=screenheight*.5   //curve towards point
animTime=5000   //animation time of 2 seconds
What I wanted was...

Code (glbasic) Select
//GETSCREENSIZE screenwidth,screenheight
////sx=screenwidth*.2;sy=screenheight*.5   //start point
//ex=screenwidth*.8;ey=screenheight*.5   //end point
////bx=screenwidth*.5;by=screenheight*.5   //curve towards point
//animTime=5000   //animation time of 2 seconds
and if I reapply block remark...

Code (glbasic) Select
GETSCREENSIZE screenwidth,screenheight
sx=screenwidth*.2;sy=screenheight*.5   //start point
//ex=screenwidth*.8;ey=screenheight*.5   //end point
bx=screenwidth*.5;by=screenheight*.5   //curve towards point
//animTime=5000   //animation time of 2 seconds
Now this allows for large blocks of code to be remarked out, without having to worry if the code has already gotten remarks, 'unremarked' and then causing compilation errors...

How is this done?

This is how it could be applied in pseudo code...

IF first_two_block_chars$ = '//' THEN
BEGIN
   REPEAT
     READBLOCKLINE(Current_line$)
     IF First_Two_Chars_Of_Current_Line$ = '//' THEN
        DELETE First_Two_Chars_Of_Current_Line$
     WRITEBLOCKLINE(Current_line$)
   UNTIL End_Of_Block
END
ELSE
BEGIN
   REPEAT
     READBLOCKLINE(Current_line$)
        Current_line$ =  '//' + Current_Line$
     WRITEBLOCKLINE(Current_line$)
   UNTIL End_Of_Block
END

This is how most languages apply block code remarking. It allows large blocks of code to be remarked in and out without having to worry if the block already contains remarks.
#249
GLBasic - en / Bit Shifts
2008-Feb-07
Some BIT shifting instructions could be a handy addition. In platforms without maths co-processors its a simple and quick way of doing multiplication and division. Its also generally handy for manipulating bit flags in variables.

Not a C++ guy but I think its "a = b >> 2" although I prefer the SHL, SHR, ROR, ROL etc... used by assembly.

Just a thought.
#250
Since I assume the sprites loaded with loadanim are using the same texture but different UVs, are these more efficient to use with modern GFX cards with large amounts of onboard memory? I know from past experience a small amount large cached blocks are slightly more efficient than sending lots of little blocks and thrashing the bus?
#251
Quick question:

I'm using LOADSPRITE(A spritesheet) to grab some sprites from but how do I unload the original sprite (The spritesheet)  from memory once I am finished with it?

I can simply over write the sprite number with some careful planning but I just wondered if there was a more direct approach?
#252
Code (glbasic) Select
TYPE at
 a
 b[0][0]
ENDTYPE

GLOBAL c AS at

REDIM c.b[10][10]
Is this an OK way to store a 2 dimensional array variable name in a type? The reason I ask, is that if I use a 1 dimensional array I would use the code...
Code (glbasic) Select
TYPE at
 a
 b[]
ENDTYPE
Notice the lack of '0', but if I try...

Code (glbasic) Select
TYPE at
 a
 b[][]
ENDTYPE
I get a syntax error.

I don't mind using the
  • s if need be?
#253
How can I grab a sprite from a 32 bit PNG? (RGB+Alpha)

I can load in a PNG as a sprite and then use ALPHAMODE -.999 to display it properly blended against the background.

Now I wish to split this PNG Sprite, into smaller sprites but GRABSPRITE is not grabbing 32 bits properly.

If I use the RGB(255,0,128) as a background, draw the PNG sprite with ALPHAMODE -.999, and then use GRABSPRITE, Im still loosing any Alpha channel that is > 0. That is, the GRABSPRITE command is simply masking the Alpha channel to 1 bit, not 8.

I'm getting a pink blurry border as the blended edges don't have any Alpha channel data?

Not sure thats clear...?
#254
If I have debug on and run into an error, the IDE opens the file and locates the error line. This, on this occasion, was a library file, not the main program.

But if I have that file already opened, it opens a 2nd copy into the IDE when an error occurs.

This is not ideal and can lead to two seperate copies of the same program being edited in the IDE (2 tabs with the same name), which can lead to data loss depending on which copy you last edited then closed.
#255
This is a 2D cross platform physics library.

http://wiki.slembcke.net/main/published/Chipmunk

Its fast, very fast, much faster than 3D physic libs because its optimised for 2 dimensions only. Its also open source and platform independant.

See here for an example...

http://files.slembcke.net/chipmunk/movies/sketches.mov
#256
Bug Reports / Update Error
2008-Jan-07
From the update dialogue...
Code (glbasic) Select
5.129
Opening Update-File
Cannot Write file !?C:\DOCUME~1\Dad\LOCALS~1\Temp\GLBasic_update.zip
Installing Update
Also a MS Visual C++ Runtime Library Error message...

QuoteProgram: C:\Program Files\BLBasic\Update_E.exe

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for information.
#257
Erm... thats it... just halts at 'Loading..."
#258
A few problems with the project file...

I had to delete a file and move a GLBAS lib about.

Now my project file would not let me Delete the filename of the missing file from the "files" tab of the project window... dunno why, seems that the file has to exist before your allowed to delete it from the project.

This was my first problem...

I eventually added the lib to the project file BUT it was now declaring types at the end of the compilation process and there was no way of moving it up the list of files in the project. This file needed to be declared first as other libs after it were expecting types that it defined to be ready (it had to compile 1st)... hope thats not too confusing.

How to solve...

Get rid of the project file (yes I know it defines more than just included files) and use an 'include' command. This would allow the user to specify the files required for a project and the order that they were compiled as well...

So for example the first few lines of the parent program would be...

Code (glbasic) Select
INCLUDE "types_lib.gbas"
INCLUDE "vector_lib.gbas"
INCLUDE "particles_lib.gbas"
#259
Support for...

BYTE , WORD, LONG types, signed and unsigned.

Its very hard to convert code from other languages which have various types that GLBasic does not support. Sometimes its necessary to define the exact size and length of a datastructure in bytes but in GLBasic everything is a float so even if I am storing a byte a float is allocated. There is no SizeOf function for example because of the lack of defined variable types.
#260
Win32: QueryPerformanceCounter()
Win32: QueryPerformanceFrequency()

Any chance of these being supported in some way... I could inline win32 Kernel32.DLL BUT this would make my source only Win32 only, which I'm trying to avoid.

I need this increased timer resolution as the current 1000th of a second is not accurate enough for my needs and I'm converting a Delphi source that uses the above calls.

Any suggestions Gernot?