Skip to content

Commit

Permalink
Merge pull request #1847 from Ghabry/misc
Browse files Browse the repository at this point in the history
Minor fixes before release
  • Loading branch information
fdelapena authored Jul 25, 2019
2 parents 639fb94 + a333de4 commit 47d6c2a
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 13 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^(SDL.*|libretro)$")

if(LIBSNDFILE_FOUND)
message(STATUS "WAV playback: libsndfile")
elseif(SDL2_mixer_FOUND)
elseif(SDL2_MIXER_FOUND)
set(SDL_MIXER_USED ON)
message(STATUS "WAV playback: SDL2_mixer")
else()
Expand All @@ -784,7 +784,7 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^(SDL.*|libretro)$")
elseif(PLAYER_ENABLE_FMMIDI)
message(STATUS "MIDI playback: built-in (FmMidi)")
else()
if(SDL2_mixer_FOUND)
if(SDL2_MIXER_FOUND)
message(STATUS "MIDI playback: SDL2_mixer.")
else()
message(STATUS "MIDI playback: None")
Expand All @@ -793,7 +793,7 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^(SDL.*|libretro)$")

if(MPG123_FOUND)
message(STATUS "MP3 playback: mpg123")
elseif(SDL2_mixer_FOUND)
elseif(SDL2_MIXER_FOUND)
set(SDL_MIXER_USED ON)
message(STATUS "MP3 playback: SDL2_mixer")
else()
Expand All @@ -802,7 +802,7 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^(SDL.*|libretro)$")

if(VORBISFILE_FOUND)
message(STATUS "Ogg Vorbis playback: libvorbis")
elseif(SDL2_mixer_FOUND)
elseif(SDL2_MIXER_FOUND)
set(SDL_MIXER_USED ON)
message(STATUS "Ogg Vorbis playback: SDL2_mixer")
else()
Expand All @@ -811,7 +811,7 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^(SDL.*|libretro)$")

if(XMP_FOUND)
message(STATUS "MOD playback: libxmp")
elseif(SDL2_mixer_FOUND)
elseif(SDL2_MIXER_FOUND)
set(SDL_MIXER_USED ON)
message(STATUS "MOD playback: SDL2_mixer")
else()
Expand All @@ -828,7 +828,7 @@ if(${PLAYER_AUDIO_BACKEND} MATCHES "^(SDL.*|libretro)$")
message(STATUS "Resampler: speexdsp")
elseif(SAMPLERATE_FOUND)
message(STATUS "Resampler: libsamplerate")
elseif(SDL2_mixer_FOUND)
elseif(SDL2_MIXER_FOUND)
set(SDL_MIXER_USED ON)
message(STATUS "Resampler: SDL2")
else()
Expand Down
2 changes: 1 addition & 1 deletion resources/emscripten/emscripten-post.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function parseargs() {
}
ret.push("--" + tmp[0]);
if (tmp.length > 1) {
arg = decodeURI(tmp[1]);
var arg = decodeURI(tmp[1]);
// split except if it's a string
if (arg.length > 0) {
if (arg.slice(0) == "\"" && arg.slice(-1) == "\"") {
Expand Down
5 changes: 5 additions & 0 deletions src/bitmap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,11 @@ void Bitmap::FillRect(Rect const& dst_rect, const Color &color) {
}

void Bitmap::Clear() {
if (!pixels()) {
// Happens when height or width of bitmap are 0
return;
}

memset(pixels(), '\0', height() * pitch());
}

Expand Down
8 changes: 4 additions & 4 deletions src/exe_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ EXEReader::~EXEReader() {
}

static uint32_t djb2_hash(char* str, size_t length) {
uint32_t hash = 5381;
uint32_t hash = 5381;
for (size_t i = 0; i < length; ++i) {
hash = ((hash << 5) + hash) + str[i];
hash = ((hash << 5) + hash) + (uint8_t)str[i];
}
return hash;
return hash;
}

static std::vector<uint8_t> exe_reader_perform_exfont_save(std::istream& corefile, uint32_t position, uint32_t len) {
Expand Down Expand Up @@ -122,7 +122,7 @@ static std::vector<uint8_t> exe_reader_perform_exfont_save(std::istream& corefil
}

// Check if the ExFont is the original through a fast hash function
if (djb2_hash((char*)exfont.data() + header_size, exfont.size() - header_size) != 0xf90c5cde) {
if (djb2_hash((char*)exfont.data() + header_size, exfont.size() - header_size) != 0x491e19de) {
Output::Debug("EXEReader: Custom ExFont found");
}

Expand Down
2 changes: 1 addition & 1 deletion src/game_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void Game_Map::Setup(int _id) {
break;
}
if (parent_index < 0) {
Output::Warning("Map %d has invalid parent id %d!", Data::treemap.maps[current_index].parent_map);
Output::Warning("Map %d has invalid parent id %d!", Data::treemap.maps[current_index].ID, Data::treemap.maps[current_index].parent_map);
break;
}
current_index = parent_index;
Expand Down
1 change: 1 addition & 0 deletions src/scene_gamebrowser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ void Scene_GameBrowser::Continue(SceneType prev_scene) {
AudioSeCache::Clear();
Data::Clear();
Main_Data::Cleanup();
FileFinder::Quit();

Player::game_title = "";
Player::engine = Player::EngineNone;
Expand Down
2 changes: 1 addition & 1 deletion src/window_numberinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ Window_NumberInput::Window_NumberInput(int ix, int iy, int iwidth, int iheight)
// Above the message window
SetZ(Priority_Window + 150);
opacity = 0;
ResetIndex();
active = false;
show_operator = false;

ResetIndex();
Refresh();
UpdateCursorRect();
}
Expand Down

0 comments on commit 47d6c2a

Please sign in to comment.