tiny fix
This commit is contained in:
parent
5185581f35
commit
cb60240f3f
@ -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");
|
||||
|
@ -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
2
test/resDir/test.txt
Normal file
@ -0,0 +1,2 @@
|
||||
This is a test
|
||||
fefea
|
@ -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;
|
||||
|
@ -1,2 +0,0 @@
|
||||
This is a tessst
|
||||
fefea
|
Loading…
x
Reference in New Issue
Block a user