Replace unsigned int, and char with uint and uchar.

This commit is contained in:
mfeemster
2014-12-05 21:05:09 -08:00
parent 8a3521206b
commit 47dd9fe35c
63 changed files with 2013 additions and 2007 deletions

View File

@ -39,7 +39,7 @@ public:
/// <param name="index">The index in the palette file</param>
/// <param name="size">The size of the palette which should be 256</param>
/// <param name="xmlPaletteEntries">A pointer to 256 color entries</param>
Palette(const string& name, int index, unsigned int size, v4T* xmlPaletteEntries)
Palette(const string& name, int index, uint size, v4T* xmlPaletteEntries)
{
m_Name = name;
m_Index = index;
@ -52,7 +52,7 @@ public:
else//They passed in null, so just fill with hard coded values so they at least have something.
{
//Palette 15 used in the test ember file.
unsigned char palette15[COLORMAP_LENGTH * 4] = {
byte palette15[COLORMAP_LENGTH * 4] = {
0x00, 0xda, 0xde, 0xbc, 0x00, 0xee, 0xe6, 0xc5, 0x00, 0xee, 0xf2, 0xce, 0x00, 0xee, 0xf2, 0xcf, 0x00, 0xe6, 0xee, 0xe1, 0x00, 0xea, 0xee, 0xd8, 0x00, 0xf2, 0xf1, 0xeb, 0x00, 0xf2, 0xf5, 0xd8,
0x00, 0xe6, 0xf2, 0xce, 0x00, 0xde, 0xea, 0xc5, 0x00, 0xd6, 0xda, 0xc6, 0x00, 0xce, 0xd2, 0xbc, 0x00, 0xc2, 0xca, 0xa9, 0x00, 0xbe, 0xca, 0xa0, 0x00, 0xce, 0xd6, 0xaa, 0x00, 0xde, 0xe2, 0xc5,
0x00, 0xea, 0xed, 0xce, 0x00, 0xea, 0xf2, 0xc5, 0x00, 0xde, 0xe2, 0xc5, 0x00, 0xc2, 0xca, 0xaa, 0x00, 0xae, 0xbe, 0xaa, 0x00, 0xa5, 0xb2, 0x96, 0x00, 0xa2, 0xa9, 0x8d, 0x00, 0x96, 0xa2, 0x84,
@ -86,7 +86,7 @@ public:
0x00, 0x81, 0x96, 0x8d, 0x00, 0x81, 0x9a, 0x8d, 0x00, 0x85, 0x9a, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x89, 0x9e, 0x8d, 0x00, 0x8d, 0xa2, 0x97, 0x00, 0x95, 0xa2, 0x97, 0x00, 0x8d, 0xa2, 0x97,
0x00, 0x96, 0xa6, 0x8d, 0x00, 0x9a, 0xa1, 0x8d, 0x00, 0x9e, 0xa9, 0x84, 0x00, 0x9e, 0xa6, 0x7a, 0x00, 0xa2, 0xa5, 0x71, 0x00, 0x9e, 0xa6, 0x71, 0x00, 0x9a, 0xa6, 0x71, 0x00, 0x95, 0x9d, 0x71 };
for (unsigned int i = 0; i < size; i++)
for (uint i = 0; i < size; i++)
{
m_Entries[i].a = (T)palette15[i * 4 + 0];
m_Entries[i].r = (T)palette15[i * 4 + 1];
@ -206,7 +206,7 @@ public:
palette.m_Name = m_Name;
palette.m_Entries.resize(Size());
for (unsigned int i = 0; i < Size(); i++)
for (uint i = 0; i < Size(); i++)
{
size_t ii = (i * 256) / COLORMAP_LENGTH;
T rgb[3], hsv[3];
@ -241,7 +241,7 @@ public:
/// <param name="cont">Contrast -1 - 2</param>
/// <param name="blur">Blur 0 - 127</param>
/// <param name="freq">Frequency 1 - 10</param>
void MakeAdjustedPalette(Palette<T>& palette, int rot, T hue, T sat, T bright, T cont, unsigned int blur, unsigned int freq)
void MakeAdjustedPalette(Palette<T>& palette, int rot, T hue, T sat, T bright, T cont, uint blur, uint freq)
{
T rgb[3], hsv[3];
@ -344,7 +344,7 @@ public:
if (palette.Size() != Size())
palette.m_Entries.resize(Size());
for (unsigned int j = 0; j < palette.Size(); j++)
for (uint j = 0; j < palette.Size(); j++)
{
palette.m_Entries[j] = m_Entries[j] * colorScalar;
palette.m_Entries[j].a = 1;
@ -358,20 +358,20 @@ public:
/// </summary>
/// <param name="height">The height of the output block</param>
/// <returns>A vector holding the color values</returns>
vector<unsigned char> MakeRgbPaletteBlock(unsigned int height)
vector<byte> MakeRgbPaletteBlock(uint height)
{
size_t width = Size();
vector<unsigned char> v(height * width * 3);
vector<byte> v(height * width * 3);
if (v.size() == (height * Size() * 3))
{
for (unsigned int i = 0; i < height; i++)
for (uint i = 0; i < height; i++)
{
for (unsigned int j = 0; j < width; j++)
for (uint j = 0; j < width; j++)
{
v[(width * 3 * i) + (j * 3)] = (unsigned char)(m_Entries[j][0] * T(255));//Palettes are as [0..1], so convert to [0..255] here since it's for GUI display.
v[(width * 3 * i) + (j * 3) + 1] = (unsigned char)(m_Entries[j][1] * T(255));
v[(width * 3 * i) + (j * 3) + 2] = (unsigned char)(m_Entries[j][2] * T(255));
v[(width * 3 * i) + (j * 3)] = (byte)(m_Entries[j][0] * T(255));//Palettes are as [0..1], so convert to [0..255] here since it's for GUI display.
v[(width * 3 * i) + (j * 3) + 1] = (byte)(m_Entries[j][1] * T(255));
v[(width * 3 * i) + (j * 3) + 2] = (byte)(m_Entries[j][2] * T(255));
}
}
}