Browse Source

Explicit casting

pull/734/head
Anders Jenbo 6 years ago
parent
commit
014308ef01
  1. 2
      Source/lighting.cpp
  2. 2
      Source/loadsave.cpp
  3. 2
      Source/scrollrt.cpp
  4. 4
      SourceX/soundsample.cpp

2
Source/lighting.cpp

@ -962,7 +962,7 @@ void MakeLightTable()
for (j = 0; j < 8; j++) { for (j = 0; j < 8; j++) {
for (k = 0; k < 16; k++) { for (k = 0; k < 16; k++) {
for (l = 0; l < 16; l++) { for (l = 0; l < 16; l++) {
fs = (BYTE)sqrt((8 * l - j) * (8 * l - j) + (8 * k - i) * (8 * k - i)); fs = (BYTE)sqrt((double)(8 * l - j) * (8 * l - j) + (8 * k - i) * (8 * k - i));
if (fs < 0.0) { if (fs < 0.0) {
fa = -0.5; fa = -0.5;
} else { } else {

2
Source/loadsave.cpp

@ -258,7 +258,7 @@ void CopyInts(const void *src, const int n, void *dst)
const auto *s = reinterpret_cast<const unsigned int *>(src); const auto *s = reinterpret_cast<const unsigned int *>(src);
auto *d = reinterpret_cast<unsigned int *>(dst); auto *d = reinterpret_cast<unsigned int *>(dst);
for (int i = 0; i < n; i++) { for (int i = 0; i < n; i++) {
CopyInt(s, d); CopyInt(s, (void*)d);
++d; ++d;
++s; ++s;
} }

2
Source/scrollrt.cpp

@ -904,7 +904,7 @@ static void DrawGame(int x, int y)
y--; y--;
// Keep evaulating untill MicroTiles can't affect screen // Keep evaulating untill MicroTiles can't affect screen
blocks += ceil(MicroTileLen / 2); blocks += ceil((double)MicroTileLen / 2);
if (PANELS_COVER) { if (PANELS_COVER) {
if (zoomflag) { if (zoomflag) {

4
SourceX/soundsample.cpp

@ -30,8 +30,8 @@ void SoundSample::Play(int lVolume, int lPan)
return; return;
} }
Mix_Volume(channel, pow(10, lVolume / 2000.0) * MIX_MAX_VOLUME); Mix_Volume(channel, pow((double)10, (double)lVolume / 2000.0) * MIX_MAX_VOLUME);
int pan = copysign(pow(10, -abs(lPan) / 2000.0) * 255, lPan); int pan = copysign(pow((double)10, -abs(lPan) / 2000.0) * 255, (double)lPan);
Mix_SetPanning(channel, pan > 0 ? pan : 255, pan < 0 ? abs(pan) : 255); Mix_SetPanning(channel, pan > 0 ? pan : 255, pan < 0 ? abs(pan) : 255);
}; };

Loading…
Cancel
Save