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.

2D All the way! / need some help with my 2D engine

Author
Message
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 19th Jul 2003 01:31
I've some problem with my code,this is the beginning of a 2D racer, don't worry about the fact you control the road, but focus on the FPS.
DB -> 60
DBP -> 8

Dri
Pour des yeux déformés la vérité peut porter un visage grimaçant.
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 19th Jul 2003 15:29
nobody can help me ? i'll recode it with memblocks, and maybe write a dll to make it run faster

Dri

Pour des yeux déformés la vérité peut porter un visage grimaçant.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 19th Jul 2003 16:33 Edited at: 19th Jul 2003 16:34
There are several things I did with your code that made it a bit faster, but as you are effectively copying a couple of MB around every frame, it's not going to be fast. Basically, you are trying to use DBC techniques in DBPro, and that just won't work if you are after speed.

I managed to get a jump from 5fps to 10fps on my laptop machine.

This is what I did:
Eliminated the backbuffer - everything now draws to the screen directly.
Changed the GET IMAGE commands by adding an extra parameter - this stops DBPro from creating mipmaps of the image.
Removed the on-the-fly creation of bitmap 3

Further things that you can try:
Eliminate bitmap 2 - once you draw it, put it in an image, then you can draw it as a sprite to bitmap 3 by scrolling the sprite texture and paste it to the bitmap instead of doing a COPY BITMAP. This also removes the GET IMAGE commands from your loop - they are slow.
Eliminate the sky bitmap in the same way - scroll the sprite texture horizontally
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 20th Jul 2003 19:25
Thanks, i just don't understand MB (sorry i'm french). i do not use get image with DBP because copy bitmap (and box) is different, it can be used like get image. And one more thing, i never use sprites so i'll test your code and thank you for answering.

Dri

Pour des yeux déformés la vérité peut porter un visage grimaçant.
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 20th Jul 2003 19:31
Oh i forgot i wrote a new version of my engine since i posted... The pther one is too old now.

Dri

Pour des yeux déformés la vérité peut porter un visage grimaçant.
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 20th Jul 2003 20:45
MB = Megabytes

Login to post a reply

Server time is: 2024-04-25 09:29:37
Your offset time is: 2024-04-25 09:29:37