
|
|
Author |
Message |
Andy_Nonymous
Moderator


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015
Topics: 99
Posts: 589
Location: New Jersey, USA

|
Posted: Sun Sep 15, 2013 11:26 am
Subject: [solved] How to convert an SDL ceiling to the DOS format?
[ IP : Logged ]
|

 
|
|
I know this is back-asswards, but I'd like to know how to do this in C/C++
Let's say I have a ceiling color value of 133, read from a map tile. I want to be able to plug that into the DOS EXE so it will display the correct color ceiling. I can do it easily in SDL because there it just uses straight values in drawing the ceilings.
In DOS, because we are using assembly code and for some reason, need to duplicate each color (or else get striped ceilings), it looks like the following needs to be done:
1) convert the decimal value to hex
2) concatenate the hex value with itself
3) plug this result into 'ceiling' in WL_DRAW.C
In this example, 133 is 0x85, and I want to use 0x8585 to draw the DOS version ceiling.
How do I code this in C/C++? And does this even make sense?  |
Last edited by Andy_Nonymous on Mon Sep 16, 2013 10:58 am; edited 1 time in total
|
|
 |
Chris
DieHard Wolfer


Joined: 11 Mar 2003
Last Visit: 13 Apr 2018
Topics: 55
Posts: 2128
Location: Canada

|
Posted: Sun Sep 15, 2013 12:41 pm
Subject: Re: [solved] How to convert an SDL ceiling to the DOS format?
[ IP : Logged ]
|

  
|
|
There's a few code examples here:
http://diehardwolfers.areyep.com/viewtopic.php?t=3594
For reference: 133*256 + 133 (ceiling<<8 + ceiling) = 0x8585 |
|
|
 |
Andy_Nonymous
Moderator


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015
Topics: 99
Posts: 589
Location: New Jersey, USA

|
Posted: Sun Sep 15, 2013 3:42 pm
Subject: [help] How to convert an SDL ceiling to the DOS format?
[ IP : Logged ]
|

 
|
|
Thanks again, Chris!  |
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum
|
|
You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group
|