Two things that need to be implemented...
Displaying 1-6 of 6 total.
1
blues_zodiakos
|
I was thinking about my battle system the other day, when I realized... There's no way short of a messy hack to blit a mirrored or flipped sprite! Is there some command that I'm missing, or do we actually have to manually transform the sprite?
Posted on 2004-03-12 06:09:09
|
Omni
|
Create a new image buffer.
If flip:
Run through every horizontal line in the image (use CopySprite with a height of 1) and blit all the lines from bottom to top.
If mirror:
Run through every vertical line in the image (use Copysprite with a width of 1) and blit all the lines from right to left.
Then return the buffer.
The new Copysprite may be a bit different, but this idea worked like a charm in Verge2.
Posted on 2004-03-13 19:17:20
|
blues_zodiakos
|
There are two main problems that I saw with those techniques when I tried them.
1.) Your memory usage increases every time you do that. If you have a flipped copy of every sprite in memory, you use two times as much memory. That isn't so bad, I guess, if you aren't really using much to begin with.
2.) If you do it in real time, it's slow. I realize that some people don't have 1ghz+ computers yet. :( (Not me, hehe! I couldn't care less!)
That's the reason I would like to see these implemented.
Posted on 2004-03-13 22:59:42
|
Omni
|
No, no--no need to worry about these problems.
You see, you use GetFlipImage() or whatever to retrieve a flipped copy of your image only ONCE. Then you just blit that flipping image wherever you need it. This does not take up much memory (only one buffer, and you can get rid of it whenever you need to) and is fast as blitting anything else with CopySprite.
The alternative is to make a FlipImageBlit(), which creates the aforesaid buffer in real time and then blits the buffer. This would not have memory problems (because the local buffer would be discarded when the function returns), and even speed shouldn't be an issue (if you blit an image a line at a time, instead of a pixel at a time, it should still be quite competently fast).
If you are a speed junkie and don't care about a second copy of your images, make a GetFlipImage(). But for all intents and purposes a FlipImageBlit() will work fine with only a marginal decrease in speed, and no extra memory usage.
Posted on 2004-03-14 14:15:32
|
anonymous
|
I would recommend the prebuffered solution. Memory is a cheaper coin than CPU.
Also, as a general rule, gameplayers aren't doing anything other than background tasks when they're playing games. So everyone should feel free to use memory.
Posted on 2004-03-14 15:24:42
|
mcgrue
|
You know, I even knew I was logged out... and yet I posted anyways.
Posted on 2004-03-14 15:25:31
|