I can't draw_sprite
Ricardo Santos

Hi there!

I've been trying to make a draw_lit_sprite effect, but i don't quite get how to work with truecolor images :-/

I don't even can draw a sprite.. when i use draw_sprite nothing happens but with a normal bit i can see the image. What's missing?

Thanks!

   set_color_conversion(COLORCONV_KEEP_TRANS);
   BITMAP *test = load_bitmap("table.pcx", pal);
   BITMAP *buffer = create_bitmap(screen->w, screen->h);
   
   draw_sprite(test, buffer, 0, 0); // it works if i do a blit
   blit(buffer, screen, 0, 0, 0, 0, buffer->w, buffer->h);

X-G

Someone needs to RTFM more closely. In particular, actually look at what each argument is.

Ricardo Santos

Oops, you're right. I was playing with blit and draw_sprite and forgot to switch the args. But still I can't get anything good.

The sprite looks like EGA and zoomed with scanlines. Is it colordepth problem? I tried to force colordepth to 8,16 and 32 and won't help anyway.

Todd Cope
Quote:

Is it colordepth problem?

Sounds like it. Make sure you set the color depth before setting the graphics mode.

X-G

Probably, yes. Make sure the bitmap is of the same color depth as what you're actually running. Draw_sprite won't work well with mixed color depths.

Ricardo Santos

Oh i got it!

It was the set_color_conversion(COLORCONV_KEEP_TRANS);

Without conversion all goes well. Thanks

Evert
Quote:

It was the set_color_conversion(COLORCONV_KEEP_TRANS);

Without conversion all goes well. Thanks

Eh?
What colour depth is your program and what colour depth are your bitmaps?

James Stanley

Before calling set_gfx_mode, use set_color_depth(n), where n is an int that is the colour depth you require.

LennyLen
Quote:

Before calling set_gfx_mode, use set_color_depth(n), where n is an int that is the colour depth you require.

Read before you post! It's already been established that the problem lay elsewhere.

Thread #587876. Printed from Allegro.cc