- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextureModelFileMaker.c
More file actions
Latest commit
32 lines (28 loc) · 809 Bytes
/
Copy pathTextureModelFileMaker.c
File metadata and controls
32 lines (28 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include<stdio.h>
#include<string.h>
intmain(void){
inti, start, end;
charfilename[10], itemname[30], parent[15], extension[] =".json";
FILE*fp;
printf("最初のModel番号:");
scanf( "%d", &start);
printf("最後のModel番号:");
scanf( "%d", &end);
printf("元アイテムのID:");
scanf( "%s", itemname);
printf("parent名:");
scanf( "%s", parent);
for (i=start; i <= end; i++){
snprintf(filename, 10, "%d", i);
strcat(filename, extension);
printf("%s\n", filename);
fp=fopen(filename, "w");
fprintf(fp, "{\n");
fprintf(fp, " \"parent\": \"item/%s\",\n", parent);
fprintf(fp, " \"textures\": {\n");
fprintf(fp, " \"layer0\": \"item/%s/%d\"\n", itemname, i);
fprintf(fp, " }\n");
fprintf(fp, "}\n");
fclose(fp);
}
}