Advertisement

questing about display mode

Started by September 08, 2001 01:45 PM
5 comments, last by taliesin8 23 years, 3 months ago
I recently started reading stuff about DX. My goal is to make a 2D game. Anyway, I was confused about something. Suppose I set my display mode to 8bpp, does it mean that at one time, there can only be a maximum of 256 colors on the screen? It does not seem logical to me. Diablo2 is a 256 color game, and I''m 90% sure there can be more than 256 colors at one time on the screen... Also, would this be possible: I set my display mode to 16bpp. Then I use 8bpp surface to do the blits (blitting a 8bpp surface on a 16 bpp surface). Can this be done? It seems to me it''s the best way to make a 2D game. You get the advantages of palettes, and you can display more than 256 colors on your screen (so I can add cool 16 bit backgrounds). thanks for your help.
Yes, 8bpp means that there can be a maximum of 256 colors on the screen (although in the DOS days, there were some ways of getting around this, like changing the palette in the middle of a refresh, but we won''t go into that ...).

Are you sure Diablo 2 is a 256 color game? I find that hard to beleive.

~~~~~~~~~~
Martee
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Advertisement
Diablo 1 is done in 8bpp mode. (256 colors)
Diablo 2 is done in 16bpp mode. (65536 colors)
I think it may be possible to some extent and the SDK doc
may have restrictions for such a thing if I remember correctly.
I dont think that using paletted and non-paletted types would work. Its more likely that you could mix 32 and 16-bit types
since nither is paletted. If DD doesnt support this directly you could probable create some middle step where you convert
the 8bit image into a 16bit image just before it gets
blitted to the backbuffer. Maby keep the common suffaces converted in memory just for preformance sake. It shouldn't
hurt proformance to bad in a 2D game if done right. It would
be getting called an awful lot so becareful. Do you want to concerve memory? Most Computers have the goods just to make very good games using old skool progaming. Unless you have a lot of large frames or somthing you shouldn't need to worry about extra hastles like that yet. Chances are the first time you wont be coding something so grand you use up all a systems recorces. Its more likey that you would try to bite off more than you can chew and endup getting frustrated trying to make it work or having it run so poorly that you end up tossing your hands in the air.
Yeh, dont do that it hurting my head.Its seaming more and more
like a vet trick. Dealing with palettes for less color depth seams silly to me. I say if your going to make a 2D game go all the way. Thats what I'm going to do. Little reason not to.
reason not to.


Edited by - Goober King on September 8, 2001 4:01:26 PM
------------------------------------------------------------- neglected projects Lore and The KeepersRandom artwork
There are still some things that I dont understand...

First, one of you said that it''s impossible to use palettes and 16bpp surfaces.

However, I know for a fact that diablo2 uses palettes. And Prosper/LOADED says that diablo2 uses 16bpp (I really think this is wrong).

And palettes are cool, because instead of using 2 images (one normal, one frozen, for example), I can use one image and 2 palettes. So you save alot of memory.

So, what do you recommend? Going all the way 16bpp with 8bpp sprites (if it''s possible)?
16bpp with 16bpp sprite (very memory inefficient)
8bpp with 8bpp sprites?
It''s not impossible to use palettes in 16 bit. You could give each sprite its own 256 color palette if you really wanted.

~~~~~~~~~~
Martee
ReactOS - an Open-source operating system compatible with Windows NT apps and drivers
Advertisement
I don''t think any one said its impossible. If you were refering to what I said I just mean that it would probably be more
trouble than its worthright now. 256 colors is in reality plenty
of colors if its on a character to character basis and not over
all. Defenatly a good mem saver tech. Just sain'' Get started
learning the ropes, then work on optimazation tricks. If your
short on memory it cheap. However if your sure you can handle
the extra work or even be easier don''t let anyone stop you.
I also doubt that you would have to have 2 copies of an image
in 16bit mode to freeze someone. There''s got to be at least a
couple of ways. Any one know how one could filter out the red and
green values before blitting? That might work. I wouldn''t mind
knowing, I''m sure I''ll make use of it.
------------------------------------------------------------- neglected projects Lore and The KeepersRandom artwork

This topic is closed to new replies.

Advertisement