I am working on a battle system and it's almost complete, but all of it requires quite a heck of cpu (but is really nifty! :))
It's running fine on most computer so far, but this snippet of code makes even my 3800+ athlon 64 slows down quite a bit, and that's unnacceptable ;).
Basically, I want a red outline around the monster (when it is berserk or whatever) that is glowing from red to black and forth
LucentStatus == % that change back and forth for glowing effect
(it's doing this at each showpage() )
ScaleBlit(-5, -5, ImageWidth(monsterImage) +10, ImageHeight(monsterImage) +10, monsterImage, ImageDest);
Silhouette(0, 0, RGB(1,1,1), ImageDest, ImageDest);
SetLucent(LucentStatus);
Silhouette(0, 0, RGB(255,0,0), ImageDest, ImageDest);
SetLucent(0);
TBlit(0, 0, ImageDest, screen);
It draws the monster a little bit bigger on top of the real monster, then silhouette-black it, then lucent-silhouette-red it, then redraw the original monster on top.
When one monster is berserk, it's actually not too bad! But if I get, say, 4 of them at the same time, it really slows down and it's not the same anymore ;-(
I've found that the Silhouettes takes 9/10 of the processing time.
Is there another way I could do this? Or make it faster?
I believe I could make 2 gifs of the same monster, one that is all black and a little bigger, so I'd save 1 ScaleBlit and 1 Silhouette, but that gets annoying when you have lots of mobs.
Thanks!
(hope to be ready to show a final product real soon! :) Only need status effect and animate player's sprites)
- ErayMan