make PR compile in MSVC6
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Sean Barrett · committed by Sean Barrett · parent cae8e85 · Browse files · 1 file·+21 added−16 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+21 added−16 removed
- other:+21 added−16 removed
Provenance
- Commit
1c81674- Tree
e3eb5f6- Author
Sean Barrett <seanb@radgametools.com>- Committer
Sean Barrett <seanb@radgametools.com>- Parent
cae8e85
1 file changed+21 added−16 removed
modified:stb_dxt.h+21 added-16 removed
414 unmodified lines415 *pmin16 = stb__As16Bit(minp[0],minp[1],minp[2]);416 }417 418 static const float midpoints5[32] = {419- 0.015686f, 0.047059f, 0.078431f, 0.111765f, 0.145098f, 0.176471f, 0.207843f, 0.241176f, 0.274510f, 0.305882f, 0.337255f, 0.370588f, 0.403922f, 0.435294f, 0.466667f, 0.5f,420- 0.533333f, 0.564706f, 0.596078f, 0.629412f, 0.662745f, 0.694118f, 0.725490f, 0.758824f, 0.792157f, 0.823529f, 0.854902f, 0.888235f, 0.921569f, 0.952941f, 0.984314f, 1.0f419+ 0.015686f, 0.047059f, 0.078431f, 0.111765f, 0.145098f, 0.176471f, 0.207843f, 0.241176f, 0.274510f, 0.305882f, 0.337255f, 0.370588f, 0.403922f, 0.435294f, 0.466667f, 0.5f,420+ 0.533333f, 0.564706f, 0.596078f, 0.629412f, 0.662745f, 0.694118f, 0.725490f, 0.758824f, 0.792157f, 0.823529f, 0.854902f, 0.888235f, 0.921569f, 0.952941f, 0.984314f, 1.0f421 };422 423 static const float midpoints6[64] = {424- 0.007843f, 0.023529f, 0.039216f, 0.054902f, 0.070588f, 0.086275f, 0.101961f, 0.117647f, 0.133333f, 0.149020f, 0.164706f, 0.180392f, 0.196078f, 0.211765f, 0.227451f, 0.245098f,425- 0.262745f, 0.278431f, 0.294118f, 0.309804f, 0.325490f, 0.341176f, 0.356863f, 0.372549f, 0.388235f, 0.403922f, 0.419608f, 0.435294f, 0.450980f, 0.466667f, 0.482353f, 0.500000f,426- 0.517647f, 0.533333f, 0.549020f, 0.564706f, 0.580392f, 0.596078f, 0.611765f, 0.627451f, 0.643137f, 0.658824f, 0.674510f, 0.690196f, 0.705882f, 0.721569f, 0.737255f, 0.754902f,427- 0.772549f, 0.788235f, 0.803922f, 0.819608f, 0.835294f, 0.850980f, 0.866667f, 0.882353f, 0.898039f, 0.913725f, 0.929412f, 0.945098f, 0.960784f, 0.976471f, 0.992157f, 1.0f424+ 0.007843f, 0.023529f, 0.039216f, 0.054902f, 0.070588f, 0.086275f, 0.101961f, 0.117647f, 0.133333f, 0.149020f, 0.164706f, 0.180392f, 0.196078f, 0.211765f, 0.227451f, 0.245098f,425+ 0.262745f, 0.278431f, 0.294118f, 0.309804f, 0.325490f, 0.341176f, 0.356863f, 0.372549f, 0.388235f, 0.403922f, 0.419608f, 0.435294f, 0.450980f, 0.466667f, 0.482353f, 0.500000f,426+ 0.517647f, 0.533333f, 0.549020f, 0.564706f, 0.580392f, 0.596078f, 0.611765f, 0.627451f, 0.643137f, 0.658824f, 0.674510f, 0.690196f, 0.705882f, 0.721569f, 0.737255f, 0.754902f,427+ 0.772549f, 0.788235f, 0.803922f, 0.819608f, 0.835294f, 0.850980f, 0.866667f, 0.882353f, 0.898039f, 0.913725f, 0.929412f, 0.945098f, 0.960784f, 0.976471f, 0.992157f, 1.0f428 };429 430-static unsigned short stb__Quantize5(float x) {431- x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate432- unsigned short q = (unsigned short)(x * 31);433- q += (x > midpoints5[q]);434- return q;430+static unsigned short stb__Quantize5(float x)431+{432+ unsigned short q;433+ x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate434+ q = (unsigned short)(x * 31);435+ q += (x > midpoints5[q]);436+ return q;437 }438+439+static unsigned short stb__Quantize6(float x)440+{436-static unsigned short stb__Quantize6(float x) {437- x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate438- unsigned short q = (unsigned short)(x * 63);439- q += (x > midpoints6[q]);440- return q;441+ unsigned short q;442+ x = x < 0 ? 0 : x > 1 ? 1 : x; // saturate443+ q = (unsigned short)(x * 63);444+ q += (x > midpoints6[q]);445+ return q;446 }447 448 // The refinement function. (Clever code, part 2)449 // Tries to optimize colors to suit block contents better.301 unmodified lines