delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/04/02/12:34:08

From: "Al Amzeen (Alexandr Amzin)" <amzeen AT mtu-net DOT ru>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: bitmap reversing?
Date: Sun, 2 Apr 2000 14:05:14 +0400
Organization: Fidolook Express page http://fidolook.da.ru
Lines: 46
Message-ID: <8c76cb$21ed$3@gavrilo.mtu.ru>
References: <1hyF4.4670$pR DOT 33119 AT carnaval DOT risq DOT qc DOT ca>
NNTP-Posting-Host: ppp101-237.dialup.mtu-net.ru
X-Trace: gavrilo.mtu.ru 954670284 67021 212.188.101.237 (2 Apr 2000 10:11:24 GMT)
X-Complaints-To: usenet-abuse AT mtu DOT ru
NNTP-Posting-Date: 2 Apr 2000 10:11:24 GMT
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Fidolook Express V1.51rus for MS OE 5.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Greetings, Yannick Benoit <yannick DOT benoit AT dr DOT cgocable DOT ca>! You wrote:
> hey guys,
>
> I have this bitmap loaded into my game but all i have drawn is the left
side
> of it
> i was wondering if someone could tell me how to reverse a bitmap so that I
> could
> use the same images on left and rigth side?
Use that synopsis (from allegro docs):
void draw_sprite(BITMAP *bmp, BITMAP *sprite, int x, int y);
Draws a copy of the sprite bitmap onto the destination bitmap at the
specified position. This is almost the same as blit(sprite, bmp, 0, 0, x, y,
sprite->w, sprite->h), but it uses a masked drawing mode where transparent
pixels are skipped, so the background image will show through the masked
parts of the sprite. Transparent pixels are marked by a zero in 256 color
modes or bright pink for truecolor data (maximum red and blue, zero green).

If the GFX_HW_VRAM_BLIT_MASKED bit in the gfx_capabilities flag is set, the
current driver supports hardware accelerated sprite drawing when the source
image is a video memory bitmap or a sub-bitmap of the screen. This is
extremely fast, so when this flag is set it may be worth storing some of
your more frequently used sprites in an offscreen portion of the video
memory.

Warning: if the hardware acceleration flag is not set, draw_sprite() will
not work correctly when used with a video memory source image, and the input
graphic must always be a memory bitmap!

Although generally not supporting graphics of mixed color depths, as a
special case this function can be used to draw 256 color source images onto
truecolor destination bitmaps, so you can use palette effects on specific
sprites within a truecolor program.

void draw_sprite_v_flip(BITMAP *bmp, BITMAP *sprite, int x, int y);
void draw_sprite_h_flip(BITMAP *bmp, BITMAP *sprite, int x, int y);
void draw_sprite_vh_flip(BITMAP *bmp, BITMAP *sprite, int x, int y);
These are like draw_sprite(), but they flip the image about the vertical,
horizontal, or diagonal, axis. This produces exact mirror images, which is
not the same as rotating the sprite (and it is a lot faster than the
rotation routine). The sprite must be a memory bitmap.

> thanx
not at all


- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019