added info to bin2h
This commit is contained in:
parent
4c752e08ce
commit
ace79d13f1
1 changed files with 6 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
//Bin2h by Cucky
|
||||||
|
//Converts files to the .h's expected by Cave Story Engine for resources.
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -12,15 +15,15 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
std::string filename = argv[1];
|
std::string filename = argv[1];
|
||||||
|
|
||||||
// Remove directory if present.
|
//Remove directory if present.
|
||||||
// Do this before extension removal incase directory has a period character.
|
//Do this before extension removal incase directory has a period character.
|
||||||
const size_t last_slash_idx = filename.find_last_of("\\/");
|
const size_t last_slash_idx = filename.find_last_of("\\/");
|
||||||
if (std::string::npos != last_slash_idx)
|
if (std::string::npos != last_slash_idx)
|
||||||
{
|
{
|
||||||
filename.erase(0, last_slash_idx + 1);
|
filename.erase(0, last_slash_idx + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove extension if present.
|
//Remove extension if present.
|
||||||
const size_t period_idx = filename.rfind('.');
|
const size_t period_idx = filename.rfind('.');
|
||||||
if (std::string::npos != period_idx)
|
if (std::string::npos != period_idx)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue