Revisión | c1746101e961e2c68282b3ed8d7b9d7fd31d4382 (tree) |
---|---|
Tiempo | 2012-09-13 01:13:13 |
Autor | angeart <angeart@git....> |
Commiter | angeart |
ver0.3.1
@@ -176,7 +176,7 @@ JsonGen::JsonGen() | ||
176 | 176 | DxLib::MATRIX chglcl = {0}; |
177 | 177 | |
178 | 178 | char pmd_model_name_[256] = {0}; |
179 | - char pmd_author_name_[256] = {0}; | |
179 | + TCHAR pmd_author_name_[256] = {0}; | |
180 | 180 | |
181 | 181 | int exist_num_pmd_ = 0; |
182 | 182 |
@@ -211,7 +211,7 @@ JsonGen::JsonGen() | ||
211 | 211 | _tcscpy_s(tcsTmpPath_Pmd,tcsTmpDir); |
212 | 212 | _tcscat_s(tcsTmpPath_Pmd,_T("*.pmd")); |
213 | 213 | hPmdFind = FindFirstFile(tcsTmpPath_Pmd, &win32fd_pmd); |
214 | - if(hPmdFind < 0) | |
214 | + if(hPmdFind == (HANDLE)0xffffffff) | |
215 | 215 | { |
216 | 216 | FindClose(hPmdFind); |
217 | 217 | continue; |
@@ -247,22 +247,26 @@ JsonGen::JsonGen() | ||
247 | 247 | |
248 | 248 | // モデル名取得 |
249 | 249 | strcpy_s(pmd_model_name_,pmd_info+7); |
250 | - | |
251 | - int cnt = 7 + strlen(pmd_info+7); | |
252 | - while(cnt < PMDINFO_SIZE){ | |
253 | - if(!strncmp("モデリング",pmd_info+cnt,10))break; | |
250 | + int cnt = 0x1b; | |
251 | + size_t info_size = ADFUNC_DXconvAnsiToWide(0,0,pmd_info+cnt); | |
252 | + TCHAR *pmd_info_t = new TCHAR[info_size + 1]; | |
253 | + ADFUNC_DXconvAnsiToWide(info_size,pmd_info_t,pmd_info+cnt); | |
254 | + cnt = 0; | |
255 | + while(cnt < info_size){ | |
256 | + if(!_tcsncmp(_T("モデリング"),pmd_info_t+cnt,5))break; | |
254 | 257 | else ++cnt; |
255 | 258 | } |
256 | - if(cnt == PMDINFO_SIZE) | |
259 | + if(cnt == info_size) | |
257 | 260 | { |
258 | - strcpy_s(pmd_author_name_,"Unknown"); | |
261 | + _tcscpy_s(pmd_author_name_,_T("Unknown")); | |
259 | 262 | }else{ |
260 | - for(cnt;cnt<PMDINFO_SIZE && (*(pmd_info+cnt) != 0x46 && *(pmd_info+cnt-1) != 0x81);++cnt); | |
263 | + for(cnt;cnt<info_size && *(pmd_info_t+cnt) != _T(':'); ++cnt); | |
261 | 264 | int tmp_str_cnt = 1; |
262 | - for(tmp_str_cnt;cnt+tmp_str_cnt<PMDINFO_SIZE && (*(pmd_info+cnt+tmp_str_cnt) != 0x0a && *(pmd_info+cnt+tmp_str_cnt) != 0x20);++tmp_str_cnt); | |
265 | + for(tmp_str_cnt;cnt+tmp_str_cnt<info_size && (*(pmd_info_t+cnt+tmp_str_cnt) != _T('\n') && *(pmd_info_t+cnt+tmp_str_cnt) != _T(' ') && *(pmd_info_t+cnt+tmp_str_cnt) != _T('.'));++tmp_str_cnt); | |
263 | 266 | // 作者取得 |
264 | - strncpy_s(pmd_author_name_,pmd_info+cnt+1,tmp_str_cnt-1); | |
267 | + _tcsncpy_s(pmd_author_name_,pmd_info_t+cnt+1,tmp_str_cnt-1); | |
265 | 268 | } |
269 | + delete []pmd_info_t; | |
266 | 270 | |
267 | 271 | TCHAR tmp_mv1_path[MAX_PATH] = {0}; |
268 | 272 | _tcscpy_s(tmp_mv1_path,pmd_paths[i].c_str()); |
@@ -294,10 +298,10 @@ JsonGen::JsonGen() | ||
294 | 298 | ADFUNC_DXconvAnsiToWide(tmp_w_s_m,tmp_w_m,pmd_model_name_); |
295 | 299 | prejson += tmp_w_m; |
296 | 300 | prejson += _T(":"); |
297 | - size_t tmp_w_s_a = ADFUNC_DXconvAnsiToWide(0,0,pmd_author_name_); | |
298 | - TCHAR *tmp_w_a = new TCHAR[tmp_w_s_a + 1]; | |
299 | - ADFUNC_DXconvAnsiToWide(tmp_w_s_a,tmp_w_a,pmd_author_name_); | |
300 | - prejson += tmp_w_a; | |
301 | + //size_t tmp_w_s_a = ADFUNC_DXconvAnsiToWide(0,0,pmd_author_name_); | |
302 | + //TCHAR *tmp_w_a = new TCHAR[tmp_w_s_a + 1]; | |
303 | + //ADFUNC_DXconvAnsiToWide(tmp_w_s_a,tmp_w_a,pmd_author_name_); | |
304 | + prejson += pmd_author_name_; | |
301 | 305 | prejson += _T("式\",\n\t\"character\":\n\t\t{\n\t\t\t\"height\":"); |
302 | 306 | TCHAR tmp_f[32]; |
303 | 307 | _ftot_s(tmp_f,32,floor(prePos.y*2)/10.0f,2); |
@@ -305,13 +309,13 @@ JsonGen::JsonGen() | ||
305 | 309 | prejson += _T(",\n\t\t\t\"motions\":\n\t\t\t\t{\n\t\t\t\t\t\"stand\":\"basic_stand.vmd\",\n\t\t\t\t\t\"walk\": \t\"basic_walk.vmd\",\n\t\t\t\t\t\"run\":\t\"basic_run.vmd\"\n\t\t\t\t}\n\t\t}\n}"); |
306 | 310 | TCHAR tmp_dir[MAX_PATH]; |
307 | 311 | _tcscpy_s(tmp_dir,_T(".\\resources\\models\\")); |
308 | - _tcscat_s(tmp_dir,tmp_w_a); | |
312 | + _tcscat_s(tmp_dir,pmd_author_name_); | |
309 | 313 | _tcscat_s(tmp_dir,_T("式")); |
310 | 314 | _tcscat_s(tmp_dir,tmp_w_m); |
311 | 315 | _tcscat_s(tmp_dir,_T("\\")); |
312 | 316 | _wmkdir(tmp_dir); |
313 | 317 | delete [] tmp_w_m; |
314 | - delete [] tmp_w_a; | |
318 | + //delete [] tmp_w_a; | |
315 | 319 | TCHAR json_path[MAX_PATH]; |
316 | 320 | _tcscpy_s(json_path,tmp_dir); |
317 | 321 | _tcscat_s(json_path,_T("info.json")); |
@@ -350,7 +354,7 @@ JsonGen::JsonGen() | ||
350 | 354 | _tcscat_s(tmp_type,tmp_cpy); |
351 | 355 | CopyFile(pmd_paths[i].c_str(),tmp_type,TRUE); |
352 | 356 | } |
353 | - | |
357 | + pmd_paths.clear(); | |
354 | 358 | DeleteDirectory(tcsTmpDir); |
355 | 359 | } |
356 | 360 | } |
@@ -8,8 +8,8 @@ | ||
8 | 8 | #define MMO_VERSION_TOSTRING(val) MMO_VERSION_TOSTRING_(val) |
9 | 9 | |
10 | 10 | #define MMO_VERSION_MAJOR 0 |
11 | -#define MMO_VERSION_MINOR 2 | |
12 | -#define MMO_VERSION_REVISION 9 | |
11 | +#define MMO_VERSION_MINOR 3 | |
12 | +#define MMO_VERSION_REVISION 1 | |
13 | 13 | |
14 | 14 | #ifdef MMO_VERSION_BUILD |
15 | 15 | #define MMO_VERSION_BUILD_TEXT " Build " MMO_VERSION_TOSTRING(MMO_VERSION_BUILD) |