Jump to content

  • Log In with Google      Sign In   
  • Create Account


Player Colors


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Tank2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 23 September 1999 - 01:44 AM

I am working on a 2D tile-based game and I would like to create
different player colors for my units like Warcraft II. I thought
I could use 2 different transparency colors, one for the player
color on the unit, and one for the background color around the unit.
I could then blt the player color on the unit surface (using a source
colorkey), and the blt the complete unit to the background (using a
dest colorkey).

However DirectX tells me it does not support source colorkey blts,
only dest colorkey blts!

Well, I really don't want to do this in software, as it would be
simply too slow. Does anyone have advice how I would do this? Is it
still possible in hardware (DirectX)?

-Tank2k


Sponsor:

#2 VirtualNext   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 September 1999 - 01:07 AM

Hello Tank2k

When your graphics card doesn't support source colorkeys than DirectDraw will emulate it in software. To do this in hardware you have to buy a graphics card which supports that.

VirtualNext


#3 NuFAN   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 September 1999 - 05:51 AM

Hi,
it DOES support both destination and source color keying, have a look at your documentation and change the flags. I guess nearly every card built after 1997 should support this, so this doesn't seem to be a problem to me.

It's not possible to do in hardware when your hardware doesn't support it, that's life, but I guess it normally should support it.

CU

------------------
Skullpture Entertainment
#40842461


#4 Tank2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 September 1999 - 11:11 AM

Thanks, that gives me some hope. I'll look at it again.

BTW, does everything default to software emulation if your hardware
doesn't support it? I remember trying to to use Blt and DDBLTFX to do
some surface stretching, but the function failed on me, so I had to write
it myself to get around it. Should this also be emulated in software?

It was setup like this as I remember it:

ZeroMemory( &ddbltfx, sizeof(DDBLTFX) );
ddbltfx.dwSize = sizeof(DDBLTFX);
ddbltfx.dwDDFX = DDBLTFX_ARITHSTRETCHY;

// Stretch the test_surface to the entire back surface
back_surface->Blt(NULL, test_surface, NULL, DDBLT_DDFX | DDBLT_WAIT, &ddbltfx);

-Tank2k


#5 Dave Astle   Senior Staff   -  Reputation: 2305

Like
Likes
Like

Posted 22 September 1999 - 11:33 AM

quote:

does everything default to software emulation if your hardware doesn't support it?

No. There are some things that are just too slow in software to make it worth doing. Overlays are one example. For others, you'll have to check the DX documentation.


#6 Tank2k   Members   -  Reputation: 122

Like
Likes
Like

Posted 22 September 1999 - 01:20 PM

I got it to work finally. Thanks! (couldn't get DirectX
stretching to work however, oh well).

-Tank2k


#7 Pseudo   Members   -  Reputation: 100

Like
Likes
Like

Posted 23 September 1999 - 01:44 AM

DirectDraw streatching sucks anyways. It doesn't do any filtering, so it looks all blocky.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS