mirror of
https://github.com/simtactics/niotso.git
synced 2025-03-22 02:52:18 +00:00
Support for SPR# and SPR2 was added to iff2html. *NOTE: The default exporter used is the PNG one, since web browsers don't like targa. However, since there is a bug in my PNG exporter, I would recommend that you use the targa exporter for a precise representation of the loaded sprite frame(s). Feel free to fix the PNG exporter, btw :)
46 lines
No EOL
1,000 B
C++
46 lines
No EOL
1,000 B
C++
int dummy = 0;
|
|
char *someString = &dummy;
|
|
|
|
someString += '(';
|
|
int currentParamIdx = 0;
|
|
unsigned short currentParam;
|
|
unsigned short param0;
|
|
do
|
|
{
|
|
currentParam = *(¶m0 + currentParamIdx);
|
|
if (currentParamIdx > 0)
|
|
someString += ' ';
|
|
|
|
// Now, we iterate through the nibbles, starting at the high nibble and working our way down
|
|
int shiftingAmountForCurrentNibble = 12;
|
|
do
|
|
{
|
|
char nibbleType = 0;
|
|
int currentNibble = (currentParam >> shiftingAmountForCurrentNibble) & 0xF;
|
|
if (currentNibble > 9)
|
|
{
|
|
if (currentNibble > 15) //((currentNibble - 10) > 5)
|
|
nibbleType = 120;
|
|
else
|
|
nibbleType = currentNibble + 55;
|
|
}
|
|
else
|
|
nibbleType = currentNibble + 48;
|
|
|
|
char *unk = &nibbleType;
|
|
char oldVal;
|
|
do
|
|
{
|
|
oldVal = *unk;
|
|
}
|
|
while (*unk)
|
|
|
|
|
|
bool outOfBounds = shiftingAmountForCurrentNibble - 4 < 0;
|
|
shiftingAmountForCurrentNibble -= 4;
|
|
}
|
|
while (!outOfBounds);
|
|
|
|
}
|
|
while (currentParamIdx < 4);
|
|
someString += ')'; |