Qbasicnews.com

Full Version: Rellib implementation problem...
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
As I stated n the one-key-challenge thread I have now a SCREEN 7
ALPHA verision of my entry.
To make it more beautiful I have decided to use rellib for better gfx
and hopefully earn some extra points in the challenge Smile

However, when I try to include rellib.bi I get problems

[pseudo code]
'$DYNAMIC
[Sub/Function Declarations]
'$INCLUDE: 'rellib.bi'
[some code + a main menu sub call]
DIM SHARED altitude(319)
[rest of program]

[/pseudo code]

The code goes like above but when I try to run it it
says "array not defined" in another sub and if
I deleted '$INCLUDE: 'rellib.bi' then it works as it should.
I have tried to change it to REDIM SHARED but with no
effect...

I use the AFAIK latest rellib verision

Please help...
are you using more than one module?

try putting the include statement before the sub/func definations and after $dynamic. Also tell me what calls are you making?
1) No
2)Do you mean to which subs? or call absolute?

Whatever, it doesn't matter anymore...
I have decided to rewrite all code in my rellib verision to get it
optimized, and I use pp256 to store the gfx as I was recommended
in another thread.
What matters is how do I load put file with >1 picture into a sprite
I can use with relput (using pp256 initimagedata and makeimageindex)?
Can somebody give some example (pseudo)code on how to do
so I can doublecheck my code?
Like:
'$DYNAMIC
DIM SHARED sprite(1 TO 1), index(1 TO 1)
initimagedata "crap.put", sprite()
... ...
... ...
DIM SHARED sprite(1 TO 1), index(1 TO 1)
initimagedata "crap.put", sprite()
Makeimageindex Sprite(),Index()
Don't you think that should be REDIM SHARED sprite(1 TO 1) AS INTEGER, REDIM SHARED... etc?
Yeah, But I forgot. Just copied what he wrote. ;*)
Thanks I gotta doublecheck when I come home (I'm at school right now)

So I should change DIM to REDIM? I thought it just matters when I
come back to that line more than once
ie:

'$DYNAMIC
DIM a(5)
label:
REDIM a(10)
GOTO label:

But appropirate code should be like

'$DYNAMIC
REDIM a(5)
label:
REDIM a(10)
GOTO label:

?



Edit: Now I'm at home...
How do I use the index with the sprite(s) and relsprite
like

relsprite varseg(page(0)), x,y, varseg(sprite(1)), varptr(sprite(index(n)))

?


Edit (A few hours later) (every no-double-posting activist should be proud of me now):
I worked that last part out now thanks everybody... Big Grin
PS it worked with DIM first and REDIM larter, see previous edit.
Cool!!! Can't wait to see the entries. ;*)
I already have a v0.1 alpha (hopefully bug-free but I call it that
because its not (hopefully) the final release) coded for screen 7 Big Grin

But I might have stumbled upon a bug in rellib (latest verision):
I don't know exactly when and why but sometimes, when testing
my code the RelDelay function gets slow like "RelDelay X" will stop
the program for half a second even if the x<100 Sad , and that stops only when I restart QB or the computer (I don't know exactly when...)
Yeah, Lachie constantly complains about that bug but I can't see any problem with my code. Winblows problem prolly. ;*)

Its a standard interrupt I'm using.

As I sidenote, I don't use RelDelay. ;*)
Pages: 1 2 3