Archived

This topic is now archived and is closed to further replies.

henthoven

Multiple resolutions in a game

Recommended Posts

Hi, Currently I am still working on my platform game and I want to make my game run in both 640x480 and 800x600 resolutions. I use the Allegro game Libary and there is a fucntion to set the resolution, so this is not very difficult. But, I want all the images in the game to be the same size in each resolution. This means that all the images have to be 0.8 times the size in 640x480 than in 800x600 (640/800 = 0.8). Is there anyone who knows an easy way to convert the BITMAP''s (allegro specific) to another size? I read all my BITMAP''s from a datafile. Thanks in advance! Hans.

Share this post


Link to post
Share on other sites
Afraid I don't know Allegro but you are either texturing polygons with your images or drawing them directly to the screen. If the former, just multiply up the sizes of the polygons. Otherwise you have two options. You must be able to load the bitmap file specifying what size you want it to be (overriding the actual image size) unless Allegro really sucks. That would then give you bigger images. Or when you draw a bitmap to the surface can you specify the size of the rectangle it's drawn into?

I guess if you limit yourself to a definate set of resolutions ie 640x480, 800x600 & 1024x768 then you could just make 3 sets of images - start with the big version for the high-resolution mode and make scaled-down copies in a paint program.

Oh and check the height ratio as well as width for modes - these are not always the same (ie 640x480 Vs 1280x1024)

[edited by - d000hg on May 26, 2004 7:31:50 AM]

Share this post


Link to post
Share on other sites
before you start hard-coding things like multiplying the sizes of all the images by 0.8, you should think long and hard if you will ever want to run it in any other resolutions other than 640x480 and 800x600... Either way i would suggest you have two global/member variables, height and width. And calculate the sizes of your images on the fly rather than hard-coding things.

Share this post


Link to post
Share on other sites