multiple pictures from a bmp in allegro

This is a discussion on multiple pictures from a bmp in allegro within the Game Programming forums, part of the General Programming Boards category; Okay, ive seen this done in allegro before, so i know its possible. Im making a mech game like Cavedogs ...

  1. #1
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373

    multiple pictures from a bmp in allegro

    Okay, ive seen this done in allegro before, so i know its possible.

    Im making a mech game like Cavedogs Total Annihilation. Its a RTS thats better than C&C. however, i do not wish to make a ton of files.

    Would it be best to rotate the image from on file or make more then on picture on one bmp and go to a position on that?

    The engine uses a typedef struct and its direction an int,

    1=north, 2=northeast, 3=east, 4=southeast, 5=south, 6=southwest, 7=west, 8=northwest.

    And how do i set transparency on the pictures? The backround is white.
    This war, like the next war, is a war to end war.

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    >>Would it be best to rotate the image from on file or make more then on picture on one bmp and go to a position on that?<<
    On most modern systems, you have memory/storage to burn. Clock cycles aren't as easy to get. Translation: store them all in one bmp and reference different parts of the bmp. Don't rotate at run time... bad.
    Away.

  3. #3
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Or if you think the user has lots of ram, get 1 picture, and in your initialization rotate it a whole bunch of times and store the rotated images away for later use. Sort of like when you're generating masks for transparency in GDI. Generate them at program start and store them for later. Not necessarily the prettiest or easiest way to do it, but if you edit the picture it means you don't have to edit all 8 rotated copies of it.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  4. #4
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    I like the rotation idea
    Mainly because i have no idea how to reference a picture from one huge bmp, though my buddy does. But i dont think he can do it this way.

    I have 192 MB of RAM, will that be slow or fast for rotation?
    This war, like the next war, is a war to end war.

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    Not a matter of how fast will it go with that amount of ram, but a matter of will you run out of ram? I'm guessing not. I've actually never rotated and stored them, I usually just use the rotated bitmaps and try not to modify them although that's caused me some headaches.

    Although I'm not sure how you'll go about rotating them... Maybe a pixel-by-pixel algorithm? Or maybe there's a function out there that does it for you... no idea.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #6
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    rotate_sprite does it.

    I just wanted to have whats best.

    We're gonna have realistic light effects, ruthless AI, rate of fire, AOE, and all that. So we're making a little demo that has 2 tanks moving on the screen shooting at each other, both AI.

    We'll see how that runs.

    Thanks guys. Im still taking advice on this, for future readers....
    This war, like the next war, is a war to end war.

  7. #7
    Linux Forever
    Join Date
    Oct 2002
    Posts
    373
    oh and Confuted:

    Your project looks promising. Does it use OpenGL? I haven't trried it out yet, as im on DX 8. I do not feel like updating without my dads consent and screw up the system. But if you need any ideas, PM me.
    This war, like the next war, is a war to end war.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem reading BMP
    By Mortissus in forum C Programming
    Replies: 4
    Last Post: 02-02-2006, 06:32 AM
  2. Game Programming FAQ
    By TechWins in forum Game Programming
    Replies: 5
    Last Post: 09-29-2004, 03:00 AM
  3. Allegro help! EASY LOADING OF BMP class
    By Blizzarddog in forum Game Programming
    Replies: 3
    Last Post: 11-25-2003, 07:50 PM
  4. Need some help choosing a good graphics library
    By dead_cell in forum Game Programming
    Replies: 31
    Last Post: 01-08-2003, 01:30 PM
  5. Special Allegro Information
    By TechWins in forum Game Programming
    Replies: 12
    Last Post: 08-21-2002, 12:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21