Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / 16 bit graphics and memblocks

Author
Message
wargamer
21
Years of Service
User Offline
Joined: 7th Jan 2003
Location: United Kingdom
Posted: 11th Jun 2004 00:52
If you want to do fast 2D it has to be via memblocks. There is already some good code on the snippets board to show you how to do this. However, if you are using only 16 bit graphics (looks horrible, but if you have a laptop or relatively poor graphics card, then it'll run abt twice as fast) then this won't work. With a bit of help (thanks IanM) I've come up with the following, which will work with 32 or 16 bit graphics. It doubles in speed if you remove the bounds-checking IFs. This function returns the colour value, after you have created a memblock using MAKE MEMBLOCK FROM BITMAP. Basically does the same as POINT.

Enjoy, fellow lunchtime laptop programmers!

AMD Athlon 1600+, 512MB, GeForce 3
DarkPhear
21
Years of Service
User Offline
Joined: 15th Oct 2003
Location: Brazil
Posted: 11th Jun 2004 07:49
Great function. Congratulations!


Cleber de Mattos Casali, game programmer.
DarkPhear is a full freeware RPG developed by me. You can download it and some game demos for free at my page: http://darkphear.cjb.net

Login to post a reply

Server time is: 2024-11-23 21:57:43
Your offset time is: 2024-11-23 21:57:43