This commit is contained in:
Anselme 2016-04-24 15:28:28 +02:00
parent 5185581f35
commit cb60240f3f
5 changed files with 7 additions and 5 deletions

View File

@ -58,9 +58,9 @@ int main(int argc, char *argv[])
string outFilename(argv[1]);
string packName = outFilename.substr(outFilename.find_last_of('/')+1);
packName = packName.substr(0, packName.find_first_of('.'));
if(!regex_match(packName, regex("[a-zA-Z0-9]+")))
if(!regex_match(packName, regex("[a-zA-Z0-9]+")))
{
printf("error : \"%s\" is an invalid resource pack name, it must match this regex : [a-zA-Z0-9]+\n", packName.c_str());
printf("error : \"%s\" is an invalid resource pack name, it must match this regex : [a-zA-Z0-9]+\n", packName.c_str());
return EXIT_SUCCESS;
}
FILE *out = fopen(outFilename.c_str(), "w");

View File

@ -6,7 +6,7 @@ set(CMAKE_TEMPLATE_PATH "..")
#SET(RESOURCE_DIRS /shaders)
#SET(RES_SRC_FILE ${CMAKE_CURRENT_SOURCE_DIR}/plop.txt ${CMAKE_CURRENT_SOURCE_DIR}/plop2.txt)
FILE(GLOB RES_SRC_FILE hello.txt test.txt)
FILE(GLOB RES_SRC_FILE hello.txt resDir/test.txt)
SET(RESOURCE_DST_FILE res.cpp)
# choose source file

2
test/resDir/test.txt Normal file
View File

@ -0,0 +1,2 @@
This is a test
fefea

View File

@ -10,6 +10,8 @@ int main()
Resource::ResourceMap resMap;
Resource::getResourcePack_res(resMap);
cout << resMap["hello.txt"] << endl;
cout << "resources available : " << endl << endl;
for(auto it : resMap)
cout << it.first << " -> " << it.second << endl;

View File

@ -1,2 +0,0 @@
This is a tessst
fefea