Skip to content

Commit

Permalink
Fix command line logging that uses filepaths
Browse files Browse the repository at this point in the history
  • Loading branch information
kieranmillar committed Feb 3, 2018
1 parent 4dcaa8a commit 723d20a
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/cmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,6 @@ bool Cmp::load(const fs::path ind_filename, const fs::path cmp_filename)
animation.push_back(a);
}

SDL_Log("Loaded %d animations from '%s'\n", animation.size(), cmp_filename.c_str());
SDL_Log("Loaded %d animations from '%s'\n", animation.size(), cmp_filename.generic_string().c_str());
return true;
}
2 changes: 1 addition & 1 deletion src/del.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ bool Del::load(const fs::path din_filename, const fs::path del_filename)
frame.push_back(f);
}

SDL_Log("Loaded %d images from '%s'\n", frame.size(), del_filename);
SDL_Log("Loaded %d images from '%s'\n", frame.size(), del_filename.generic_string().c_str());

return true;
}
14 changes: 7 additions & 7 deletions src/level.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ bool Level::load_objects(int type, const fs::path filename)
ifstream f(filename, ios::binary);
if (!f)
{
SDL_Log("Failed to open '%s'\n", filename);
SDL_Log("Failed to open '%s'\n", filename.generic_string().c_str());
return false;
}

Expand All @@ -230,9 +230,9 @@ bool Level::load_objects(int type, const fs::path filename)
}

if (type == PERM)
SDL_Log("Loaded %d + %d objects from '%s'\n", object[type].size(), object[TOOL].size(), filename);
SDL_Log("Loaded %d + %d objects from '%s'\n", object[type].size(), object[TOOL].size(), filename.generic_string().c_str());
if (type == TEMP)
SDL_Log("Loaded %d objects from '%s'\n", object[type].size(), filename);
SDL_Log("Loaded %d objects from '%s'\n", object[type].size(), filename.generic_string().c_str());
f.close();
return true;
}
Expand Down Expand Up @@ -300,7 +300,7 @@ bool Level::save_level(const fs::path filename)
ofstream f(filename, ios::binary | ios::trunc);
if (!f)
{
SDL_Log("Failed to open '%s'\n", filename);
SDL_Log("Failed to open '%s'\n", filename.generic_string().c_str());
return false;
}

Expand All @@ -321,7 +321,7 @@ bool Level::save_level(const fs::path filename)
f.write((char *)&release_delay, sizeof(release_delay));
f.write((char *)&enemies, sizeof(enemies));

SDL_Log("Wrote level to '%s'\n", filename);
SDL_Log("Wrote level to '%s'\n", filename.generic_string().c_str());
f.close();
return true;
}
Expand All @@ -347,7 +347,7 @@ bool Level::save_objects(int type, const fs::path filename)
ofstream f(filename, ios::binary | ios::trunc);
if (!f)
{
SDL_Log("Failed to open '%s'\n", filename);
SDL_Log("Failed to open '%s'\n", filename.generic_string().c_str());
return false;
}

Expand Down Expand Up @@ -376,7 +376,7 @@ bool Level::save_objects(int type, const fs::path filename)
savingType = TOOL;
}

SDL_Log("Wrote %d objects to '%s'\n", count, filename);
SDL_Log("Wrote %d objects to '%s'\n", count, filename.generic_string().c_str());

f.close();
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/raw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ bool Raw::load_raw(fs::path raw_filename)

delete[] temp;

SDL_Log("Loaded %d images from '%s'\n", frame.size(), raw_filename);
SDL_Log("Loaded %d images from '%s'\n", frame.size(), raw_filename.generic_string().c_str());
return true;
}

Expand Down
8 changes: 4 additions & 4 deletions src/style.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ bool Style::load_objects(int type, const fs::path obj_filename, const fs::path f
}
}
if (type == PERM)
SDL_Log("Loaded %d + %d objects from '%s'\n", object[type].size(), object[TOOL].size(), obj_filename.c_str());
SDL_Log("Loaded %d + %d objects from '%s'\n", object[type].size(), object[TOOL].size(), obj_filename.generic_string().c_str());
if (type == TEMP)
SDL_Log("Loaded %d objects from '%s'\n", object[type].size(), obj_filename.c_str());
SDL_Log("Loaded %d objects from '%s'\n", object[type].size(), obj_filename.generic_string().c_str());
return true;
}

Expand All @@ -412,7 +412,7 @@ bool Style::load_blocks(int type, fs::path blk_filename)
ifstream blk_f(blk_filename.c_str(), ios::binary);
if (!blk_f)
{
SDL_Log("Failed to open '%s'\n", blk_filename.c_str());
SDL_Log("Failed to open '%s'\n", blk_filename.generic_string().c_str());
return false;
}

Expand All @@ -430,7 +430,7 @@ bool Style::load_blocks(int type, fs::path blk_filename)

block[type].push_back(b);
}
SDL_Log("Loaded %d blocks from '%s'\n", block[type].size(), blk_filename.c_str());
SDL_Log("Loaded %d blocks from '%s'\n", block[type].size(), blk_filename.generic_string().c_str());
return true;
}

Expand Down
1 change: 0 additions & 1 deletion src/tribe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@ bool Tribe::load_palette(fs::path pal_filename)
palette[i].b = (255.0f / 63.0f) * b;
}

SDL_Log("1\n");
return true;
}

0 comments on commit 723d20a

Please sign in to comment.