View Single Post
Old 14 December 2017, 14:28   #39
Master484
Registered User
 
Master484's Avatar
 
Join Date: Nov 2015
Location: Vaasa, Finland
Posts: 525
I did a small test with QBlit with one of my programs.

On a 32 color 320*224 screen, with QBlit I could draw about 20 16*16 objects per frame.

And when display update speed was halved to 25 FPS, I could draw about 38 objects.

These results are from WINUAE, using A600 2 MB chip + 8 MB fast, with "cycle exact" ON.

Usually Fast RAM improves the result by some 25 %, so I think that without fast RAM it would be 15 objects at 50 FPS and maybe 30 objects at 25 FPS.

So I think that in your program something is taking lots of extra time.

Most likely the text drawing is the cause of most slowdown; the blitz text drawing command is very slow, especially if you're writing multiple lines every frame.

In my own programs I usually use the texts only for debugging, and always put an ON-OFF button for them, or make it so that the texts are updated only every 10th frame or something.

You can use the text drawing to update things like score displays, but make it so that it only updates the texts when the score itself changes.

---

About low color objects, here is a speed trick that can be used if you have 2 color objects in a 16 color game.

In your 16 color palette, put the 2 colors (transparent + 1 color) to the beginning of the palette (transparent first, then the other color).

Save your 2 color objects to a separate IFF image that contains only these 2 colors. The IFF file itself can be saved as an 8 color IFF (I use XnView on PC and in it 8 colors is the lowest color amount for an IFF file).

Then, when loading these objects to your program, first create a temporary 1 bitplane bitmap, and load them to it from the IFF file, and then GetAShape them from this 1 bitplane bitmap. This should result in the shapes being only 1 bitplane deep, and now they are much faster to draw.

The only downside is that if you draw these 1 bitplane objects over any other graphics, the colors will show up wrong. But if you just have a black background, or use a dual playfield, then the background graphics won't cause broblems.

This method is great for bullets and explosions and stuff like that. And it also works for 4 color (2 bitplanes) and 8 color (3 bitplanes) objects.

There also is a Blitz command to achieve the same thing, I think it was BitPlanesBitmap or something like that, but it's hard command, and I don't have much experience in it's use, so I have just used the above method.
Master484 is offline  
 
Page generated in 0.07513 seconds with 11 queries