Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 06:56 14 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Buffer not in use???

Author Message
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 01:21am 27 Jul 2020
Copy link to clipboard 
Print this post

Hey gang,

Running into a problem that has me stumped...

I'm changing how I'm loading in sprites... What I'm trying to do is the following:

In my loadsprites()  I'm reading in a series of 25 PNG files using load png and putting them onto page 3.  (I even do a page copy 3 to 0 so I can see that they all loaded in ok...)

later in my program when I go to spawn a new AI car, I randomly pick one of the 25 and do a sprite read for the coordinates of the one chosen. That all seem to be ok...

The next line I go to show the sprite I just read and I keep getting back

"Buffer not in use" error on the line where I do the sprite show.

Ideas???  I don't get what could be wrong. I do this in other parts of my program and it works just fine.
 
capsikin
Guru

Joined: 30/06/2020
Location: Australia
Posts: 342
Posted: 01:43am 27 Jul 2020
Copy link to clipboard 
Print this post

Maybe the code is trying to use an invalid sprite number. 0 for example.
Code for picking the number, reading the sprite, and showing it?
 
mkopack73
Senior Member

Joined: 03/07/2020
Location: United States
Posts: 261
Posted: 01:51am 27 Jul 2020
Copy link to clipboard 
Print this post

It's on my other machine... I'll have to post it tomorrow... Been banging my head on this for a good hour plus and I need to get to bed.

I just don't get how I can do a line like:

sprite read i+1, x,y,xsize,ysize,2   'this should be creating the sprite from data on screen 2
sprite show i+1, xpos,ypos,2        'show the sprite as part of layer 2

and the 2nd line fails...

Yet I do the EXACT same thing in 2 other parts of my code to load in PNGs (or draw an area) and then read that into the sprite and show it and it works fine.
 
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025