Qbasicnews.com
March 21, 2019, 07:25:09 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: *grrrowl* :)  (Read 7369 times)
Rokkuman
Na_th_an
*****
Posts: 1973



« on: December 14, 2003, 05:08:44 PM »

I compiled my sprite editor. And at first it was giving me String Space Corrupt errors whenever I tried to load a file (not good). So I added Dynamic before it all, and now, when I try to load a file, the sprite editor just closes out. WTF!
Logged
Anonymous
Guest
« Reply #1 on: December 14, 2003, 05:25:51 PM »

are you ABSOLUTELY sure your writing ALL data to the exact right place in memory? If so, i have no idea... i just know when i get that its USUALLY that. Wink
Logged
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #2 on: December 14, 2003, 05:27:36 PM »

Uh, I don't really know how to write memory to any other places...
Logged
Anonymous
Guest
« Reply #3 on: December 14, 2003, 05:32:11 PM »

well i mean say ur loading a sprite to Sprite(1000).

if you do
Code:
defseg = varseg(spirte())
bload "sprite.spr", varptr(sprte(0))


or any number of simple typos like that, it can wreak major havoc... even renderins your prog unsaveabl Sad

next tip: SAVE OFTEN Smiley
Logged
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #4 on: December 14, 2003, 05:34:14 PM »

Nope. If there was a typo like that, it wouldn't run in the IDE well either.

This problem only occurs when it's COMPILED though.
Logged
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #5 on: December 14, 2003, 05:36:40 PM »

ALRIGHT, the problem is that when I add the '$DYNAMIC bit, I get a subscript out of range error in the IDE, so when it's compiled, it just shuts off.

When '$DYNAMIC is gone however, it works fine, but won't compile.

Any ideas?
Logged
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #6 on: December 14, 2003, 06:29:26 PM »

We need scope. Post the exact SUB where this happens, post also the declaration of the array.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
barok
Na_th_an
*****
Posts: 1727


How about a tasty lead sandwich?


« Reply #7 on: December 14, 2003, 07:34:27 PM »

kinda reminds me of my prog i'm working on.  works fine in ide, but when i compile it won't work.  during the compiling process, it says there's over 900 bugs  Shocked
Logged

Jumping Jahoolipers!
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #8 on: December 14, 2003, 09:04:34 PM »

Here's where it happens.
Code:

SUB PutSprite (X, Y, Image(), Index)

FOR A = 0 TO Image(1, Index) 'ERROR OCCURS HERE
        FOR B = 0 TO Image(0, Index) - 1
                IF GetPixelImage(B, A, Image(), Index) <> 13 THEN
                        PutPixel X + B, Y + A, GetPixelImage(B, A, Image(), Index)
                END IF
        NEXT
NEXT


END SUB


And here are the only two arrays that are interacted with by that sub.

Code:

DIM SHARED EditSprite(2000, 5)
DIM SHARED Sprite(2000, 5)
Logged
Anonymous
Guest
« Reply #9 on: December 14, 2003, 09:38:12 PM »

It might help to have sample input data, and also to know what the 'index' sub itself does, too...
Logged
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #10 on: December 14, 2003, 09:40:32 PM »

"index" isn't a sub. It's a variable that determines which image to display from the array. And it's not going that high. As I said, it works perfectly in the IDE, but faggs up in the compilation.
Logged
Anonymous
Guest
« Reply #11 on: December 14, 2003, 09:48:32 PM »

<----- Dumbass.

i meant to say 'image' but thats an array, anyways Tongue

maybe are your sprites not saved -AS INTEGER- ? thats one of the only things i could think of.

and... your sprites arent get, put compatible, are they? cause i thought they could only have one dimension
Logged
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #12 on: December 14, 2003, 11:28:23 PM »

Nope, not GET and PUT compatible. And I tried putting DEFINT A-Z at the top, but I kept getting retarded "paremeter" errors.

Please help me someone. I've come too far in this program..
Logged
Neo
Na_th_an
*****
Posts: 2150



« Reply #13 on: December 15, 2003, 06:15:46 AM »

Shouldn't you add a '-1' after the FOR A = 0 TO .... line? Wink Just saying...

Like this:
Code:
FOR A = 0 TO Image(1, Index) - 1 'ERROR OCCURS HERE


Cheesy

Also, if you like info about the GET/PUT format, look here:
Code:
GET PUT Format
Offset  Type     Description
  0      Int      Width of the sprite * 8 (= x)
  2      Int      Height of the sprite (= y)
  ?      Byte     Pixel data, starts with upperleft corner, advancing right.


EDIT: wt is GetPixelImage Huh Btw, to make your code slightly faster, store the result of this function in a variable.
Logged
Rokkuman
Na_th_an
*****
Posts: 1973



« Reply #14 on: December 15, 2003, 08:24:58 AM »

Quote from: "Neo"
Shouldn't you add a '-1' after the FOR A = 0 TO .... line? Wink Just saying...

Like this:
Code:
FOR A = 0 TO Image(1, Index) - 1 'ERROR OCCURS HERE


Cheesy

Didn't work...

Quote

Also, if you like info about the GET/PUT format, look here:
Code:
GET PUT Format
Offset  Type     Description
  0      Int      Width of the sprite * 8 (= x)
  2      Int      Height of the sprite (= y)
  ?      Byte     Pixel data, starts with upperleft corner, advancing right.


EDIT: wt is GetPixelImage Huh Btw, to make your code slightly faster, store the result of this function in a variable.

Get pixel image is what gets the color of the pixel. The problem is that it is giving me subscript out of range, ONLY when I add '$DYNAMIC.
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!