roqParam.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #include "../../../idlib/precompiled.h"
  21. #pragma hdrstop
  22. #include "roqParam.h"
  23. //
  24. // read a parameter file in (true I bloddy well had to do this again) (and yet again to c++)
  25. //
  26. int parseRange(const char *rangeStr,int field, int skipnum[], int startnum[], int endnum[],int numfiles[],bool padding[],int numpadding[] );
  27. int parseTimecodeRange(const char *rangeStr,int field, int skipnum[], int startnum[], int endnum[],int numfiles[],bool padding[],int numpadding[] );
  28. void roqParam::InitFromFile( const char *fileName )
  29. {
  30. idParser *src;
  31. idToken token;
  32. int i, readarg;
  33. src = new idParser( fileName, LEXFL_NOSTRINGCONCAT | LEXFL_NOSTRINGESCAPECHARS | LEXFL_ALLOWPATHNAMES );
  34. if ( !src->IsLoaded() ) {
  35. delete src;
  36. common->Printf("Error: can't open param file %s\n", fileName);
  37. return;
  38. }
  39. common->Printf("initFromFile: %s\n", fileName);
  40. fullSearch = false;
  41. scaleDown = false;
  42. encodeVideo = false;
  43. addPath = false;
  44. screenShots = false;
  45. startPalette = false;
  46. endPalette = false;
  47. fixedPalette = false;
  48. keyColor = false;
  49. justDelta = false;
  50. useTimecodeForRange = false;
  51. onFrame = 0;
  52. numInputFiles = 0;
  53. currentPath[0] = '\0';
  54. make3DO = false;
  55. makeVectors = false;
  56. justDeltaFlag = false;
  57. noAlphaAtAll = false;
  58. twentyFourToThirty = false;
  59. hasSound = false;
  60. isScaleable = false;
  61. firstframesize = 56*1024;
  62. normalframesize = 20000;
  63. jpegDefault = 85;
  64. realnum = 0;
  65. while( 1 ) {
  66. if ( !src->ReadToken( &token ) ) {
  67. break;
  68. }
  69. readarg = 0;
  70. // input dir
  71. if (token.Icmp( "input_dir") == 0) {
  72. src->ReadToken( &token );
  73. addPath = true;
  74. currentPath = token;
  75. // common->Printf(" + input directory is %s\n", currentPath );
  76. readarg++;
  77. continue;
  78. }
  79. // input dir
  80. if (token.Icmp( "scale_down") == 0) {
  81. scaleDown = true;
  82. // common->Printf(" + scaling down input\n" );
  83. readarg++;
  84. continue;
  85. }
  86. // full search
  87. if (token.Icmp( "fullsearch") == 0) {
  88. normalframesize += normalframesize/2;
  89. fullSearch = true;
  90. readarg++;
  91. continue;
  92. }
  93. // scaleable
  94. if (token.Icmp( "scaleable") == 0) {
  95. isScaleable = true;
  96. readarg++;
  97. continue;
  98. }
  99. // input dir
  100. if (token.Icmp( "no_alpha") == 0) {
  101. noAlphaAtAll = true;
  102. // common->Printf(" + scaling down input\n" );
  103. readarg++;
  104. continue;
  105. }
  106. if (token.Icmp( "24_fps_in_30_fps_out") == 0) {
  107. twentyFourToThirty = true;
  108. readarg++;
  109. continue;
  110. }
  111. // video in
  112. if (token.Icmp( "video_in") == 0) {
  113. encodeVideo = true;
  114. // common->Printf(" + Using the video port as input\n");
  115. continue;
  116. }
  117. //timecode range
  118. if (token.Icmp( "timecode") == 0) {
  119. useTimecodeForRange = true;
  120. firstframesize = 12*1024;
  121. normalframesize = 4500;
  122. // common->Printf(" + Using timecode as range\n");
  123. continue;
  124. }
  125. // soundfile for making a .RnR
  126. if (token.Icmp( "sound") == 0) {
  127. src->ReadToken( &token );
  128. soundfile = token;
  129. hasSound = true;
  130. // common->Printf(" + Using timecode as range\n");
  131. continue;
  132. }
  133. // soundfile for making a .RnR
  134. if (token.Icmp( "has_sound") == 0) {
  135. hasSound = true;
  136. continue;
  137. }
  138. // outfile
  139. if (token.Icmp( "filename") == 0) {
  140. src->ReadToken( &token );
  141. outputFilename = token;
  142. i = strlen(outputFilename);
  143. // common->Printf(" + output file is %s\n", outputFilename );
  144. readarg++;
  145. continue;
  146. }
  147. // starting palette
  148. if (token.Icmp( "start_palette") == 0) {
  149. src->ReadToken( &token );
  150. sprintf(startPal, "/LocalLibrary/vdxPalettes/%s", token.c_str());
  151. // common->Error(" + starting palette is %s\n", startPal );
  152. startPalette = true;
  153. readarg++;
  154. continue;
  155. }
  156. // ending palette
  157. if (token.Icmp( "end_palette") == 0) {
  158. src->ReadToken( &token );
  159. sprintf(endPal, "/LocalLibrary/vdxPalettes/%s", token.c_str());
  160. // common->Printf(" + ending palette is %s\n", endPal );
  161. endPalette = true;
  162. readarg++;
  163. continue;
  164. }
  165. // fixed palette
  166. if (token.Icmp( "fixed_palette") == 0) {
  167. src->ReadToken( &token );
  168. sprintf(startPal, "/LocalLibrary/vdxPalettes/%s", token.c_str());
  169. // common->Printf(" + fixed palette is %s\n", startPal );
  170. fixedPalette = true;
  171. readarg++;
  172. continue;
  173. }
  174. // these are screen shots
  175. if (token.Icmp( "screenshot") == 0) {
  176. // common->Printf(" + shooting screen shots\n" );
  177. screenShots = true;
  178. readarg++;
  179. continue;
  180. }
  181. // key_color r g b
  182. if (token.Icmp( "key_color") == 0) {
  183. keyR = src->ParseInt();
  184. keyG = src->ParseInt();
  185. keyB = src->ParseInt();
  186. keyColor = true;
  187. // common->Printf(" + key color is %03d %03d %03d\n", keyR, keyG, keyB );
  188. readarg++;
  189. continue;
  190. }
  191. // only want deltas
  192. if (token.Icmp( "just_delta") == 0) {
  193. // common->Printf(" + outputting deltas in the night\n" );
  194. // justDelta = true;
  195. // justDeltaFlag = true;
  196. readarg++;
  197. continue;
  198. }
  199. // doing 3DO
  200. if (token.Icmp( "3DO") == 0) {
  201. make3DO = true;
  202. readarg++;
  203. continue;
  204. }
  205. // makes codebook vector tables
  206. if (token.Icmp( "codebook") == 0) {
  207. makeVectors = true;
  208. readarg++;
  209. continue;
  210. }
  211. // set first frame size
  212. if (token.Icmp( "firstframesize") == 0) {
  213. firstframesize = src->ParseInt();
  214. readarg++;
  215. continue;
  216. }
  217. // set normal frame size
  218. if (token.Icmp( "normalframesize") == 0) {
  219. normalframesize = src->ParseInt();
  220. readarg++;
  221. continue;
  222. }
  223. // set normal frame size
  224. if (token.Icmp( "stillframequality") == 0) {
  225. jpegDefault = src->ParseInt();
  226. readarg++;
  227. continue;
  228. }
  229. if (token.Icmp( "input") == 0) {
  230. int num_files = 255;
  231. range = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  232. padding = (bool *)Mem_ClearedAlloc( num_files * sizeof(bool) );
  233. padding2 = (bool *)Mem_ClearedAlloc( num_files * sizeof(bool) );
  234. skipnum = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  235. skipnum2 = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  236. startnum = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  237. startnum2 = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  238. endnum = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  239. endnum2 = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  240. numpadding = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  241. numpadding2 = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  242. numfiles = (int *)Mem_ClearedAlloc( num_files * sizeof(int) );
  243. idStr empty;
  244. file.AssureSize( num_files, empty );
  245. file.AssureSize( num_files, empty );
  246. field = 0;
  247. realnum = 0;
  248. do {
  249. src->ReadToken(&token);
  250. if ( token.Icmp( "end_input") != 0 ) {
  251. idStr arg1, arg2, arg3;
  252. file[field] = token;
  253. while (src->ReadTokenOnLine( &token ) && token.Icmp( "[" ) ) {
  254. file[field].Append( token );
  255. }
  256. arg1 = token;
  257. while (src->ReadTokenOnLine( &token ) && token.Icmp( "[" ) ) {
  258. arg1 += token;
  259. }
  260. arg2 = token;
  261. while (src->ReadTokenOnLine( &token ) && token.Icmp( "[" ) ) {
  262. arg2 += token;
  263. }
  264. arg3 = token;
  265. while (src->ReadTokenOnLine( &token ) && token.Icmp( "[" ) ) {
  266. arg3 += token;
  267. }
  268. if ( arg1[0] != '[' ) {
  269. // common->Printf(" + reading %s\n", file[field] );
  270. range[field] = 0;
  271. numfiles[field] = 1;
  272. realnum++;
  273. }
  274. else {
  275. if ( arg1[0] == '[' )
  276. {
  277. range[field] = 1;
  278. if (useTimecodeForRange) {
  279. realnum += parseTimecodeRange( arg1, field, skipnum, startnum, endnum, numfiles, padding, numpadding);
  280. // common->Printf(" + reading %s from %d to %d\n", file[field], startnum[field], endnum[field]);
  281. }
  282. else {
  283. realnum += parseRange( arg1, field, skipnum, startnum, endnum, numfiles, padding, numpadding);
  284. // common->Printf(" + reading %s from %d to %d\n", file[field], startnum[field], endnum[field]);
  285. }
  286. }
  287. else if (( arg1[0] != '[' ) && ( arg2[0] == '[') && ( arg3[0] =='[')) { //a double ranger...
  288. int files1,files2;
  289. file2[field] = arg1;
  290. range[field] = 2;
  291. files1 = parseRange(arg2, field, skipnum, startnum, endnum, numfiles, padding, numpadding);
  292. // common->Printf(" + reading %s from %d to %d\n", file[field], startnum[field], endnum[field]);
  293. files2 = parseRange(arg3, field, skipnum2, startnum2, endnum2, numfiles, padding2, numpadding2);
  294. // common->Printf(" + reading %s from %d to %d\n", file2[field], startnum2[field], endnum2[field]);
  295. if (files1 != files2) {
  296. common->Error( "You had %d files for %s and %d for %s!", files1, arg1.c_str(), files2, arg2.c_str() );
  297. }
  298. else {
  299. realnum += files1;//not both, they are parallel
  300. }
  301. }
  302. else {
  303. common->Error("Error: invalid range on open (%s %s %s)\n", arg1.c_str(), arg2.c_str(), arg3.c_str() );
  304. }
  305. }
  306. field++;
  307. }
  308. } while (token.Icmp( "end_input"));
  309. }
  310. }
  311. if (TwentyFourToThirty()) realnum = realnum+(realnum>>2);
  312. numInputFiles = realnum;
  313. common->Printf(" + reading a total of %d frames in %s\n", numInputFiles, currentPath.c_str() );
  314. delete src;
  315. }
  316. void roqParam::GetNthInputFileName( idStr &fileName, int n ) {
  317. int i, myfield, index,hrs,mins,secs,frs;
  318. char tempfile[33], left[256], right[256], *strp;
  319. if ( n > realnum ) n = realnum;
  320. // overcome starting at zero by ++ing and then --ing.
  321. if (TwentyFourToThirty()) { n++; n = (n/5) * 4 + (n % 5); n--; }
  322. i = 0;
  323. myfield = 0;
  324. while (i <= n) {
  325. i += numfiles[myfield++];
  326. }
  327. myfield--;
  328. i -= numfiles[myfield];
  329. if ( range[myfield] == 1 ) {
  330. strcpy( left, file[myfield] );
  331. strp = strstr( left, "*" );
  332. *strp++ = 0;
  333. sprintf(right, "%s", strp);
  334. if ( startnum[myfield] <= endnum[myfield] ) {
  335. index = startnum[myfield] + ((n-i)*skipnum[myfield]);
  336. } else {
  337. index = startnum[myfield] - ((n-i)*skipnum[myfield]);
  338. }
  339. if ( padding[myfield] == true ) {
  340. if (useTimecodeForRange) {
  341. hrs = index/(30*60*60) ;
  342. mins = (index/(30*60)) %60;
  343. secs = (index/(30)) % 60;
  344. frs = index % 30;
  345. sprintf(fileName,"%s%.02d%.02d/%.02d%.02d%.02d%.02d%s",left,hrs,mins,hrs,mins,secs,frs,right);
  346. }
  347. else {
  348. sprintf(tempfile, "%032d", index );
  349. sprintf(fileName, "%s%s%s", left, &tempfile[ 32-numpadding[myfield] ], right );
  350. }
  351. } else {
  352. if (useTimecodeForRange) {
  353. hrs = index/(30*60*60) ;
  354. mins = (index/(30*60)) %60;
  355. secs = (index/(30)) % 60;
  356. frs = index % 30;
  357. sprintf(fileName,"%s%.02d%.02d/%.02d%.02d%.02d%.02d%s",left,hrs,mins,hrs,mins,secs,frs,right);
  358. }
  359. else {
  360. sprintf(fileName, "%s%d%s", left, index, right );
  361. }
  362. }
  363. } else if ( range[myfield] == 2 ) {
  364. strcpy( left, file[myfield] );
  365. strp = strstr( left, "*" );
  366. *strp++ = 0;
  367. sprintf(right, "%s", strp);
  368. if ( startnum[myfield] <= endnum[myfield] ) {
  369. index = startnum[myfield] + ((n-i)*skipnum[myfield]);
  370. } else {
  371. index = startnum[myfield] - ((n-i)*skipnum[myfield]);
  372. }
  373. if ( padding[myfield] == true ) {
  374. sprintf(tempfile, "%032d", index );
  375. sprintf(fileName, "%s%s%s", left, &tempfile[ 32-numpadding[myfield] ], right );
  376. } else {
  377. sprintf(fileName, "%s%d%s", left, index, right );
  378. }
  379. strcpy( left, file2[myfield] );
  380. strp = strstr( left, "*" );
  381. *strp++ = 0;
  382. sprintf(right, "%s", strp);
  383. if ( startnum2[myfield] <= endnum2[myfield] ) {
  384. index = startnum2[myfield] + ((n-i)*skipnum2[myfield]);
  385. } else {
  386. index = startnum2[myfield] - ((n-i)*skipnum2[myfield]);
  387. }
  388. if ( padding2[myfield] == true ) {
  389. sprintf(tempfile, "%032d", index );
  390. fileName += va( "\n%s%s%s", left, &tempfile[ 32-numpadding2[myfield] ], right );
  391. } else {
  392. fileName += va( "\n%s%d%s", left, index, right );
  393. }
  394. } else {
  395. fileName = file[myfield];
  396. }
  397. }
  398. const char* roqParam::GetNextImageFilename( void ) {
  399. idStr tempBuffer;
  400. int i;
  401. int len;
  402. GetNthInputFileName( tempBuffer, onFrame++);
  403. if ( justDeltaFlag == true ) {
  404. onFrame--;
  405. justDeltaFlag = false;
  406. }
  407. if ( addPath == true ) {
  408. currentFile = currentPath + "/" + tempBuffer;
  409. } else {
  410. currentFile = tempBuffer;
  411. }
  412. len = currentFile.Length();
  413. for(i=0;i<len;i++) {
  414. if (currentFile[i] == '^') {
  415. currentFile[i] = ' ';
  416. }
  417. }
  418. return currentFile.c_str();
  419. }
  420. const char* roqParam::RoqFilename( void ) {
  421. return outputFilename.c_str();
  422. }
  423. const char* roqParam::SoundFilename( void ) {
  424. return soundfile.c_str();
  425. }
  426. const char* roqParam::RoqTempFilename( void ) {
  427. int i, j, len;
  428. j = 0;
  429. len = outputFilename.Length();
  430. for(i=0; i<len; i++ )
  431. if ( outputFilename[i] == '/' ) j = i;
  432. sprintf(tempFilename, "/%s.temp", &outputFilename[j+1] );
  433. return tempFilename.c_str();
  434. }
  435. bool roqParam::Timecode( void ) {
  436. return useTimecodeForRange;
  437. }
  438. bool roqParam::OutputVectors( void ) {
  439. return makeVectors;
  440. }
  441. bool roqParam::HasSound( void ) {
  442. return hasSound;
  443. }
  444. bool roqParam::DeltaFrames( void ) {
  445. return justDelta;
  446. }
  447. bool roqParam::NoAlpha( void ) {
  448. return noAlphaAtAll;
  449. }
  450. bool roqParam::SearchType( void ) {
  451. return fullSearch;
  452. }
  453. bool roqParam::MoreFrames( void ) {
  454. if (onFrame < numInputFiles) {
  455. return true;
  456. } else {
  457. return false;
  458. }
  459. }
  460. bool roqParam::TwentyFourToThirty( void ) {
  461. return twentyFourToThirty;
  462. }
  463. int roqParam::NumberOfFrames( void ) {
  464. return numInputFiles;
  465. }
  466. int roqParam::FirstFrameSize( void ) {
  467. return firstframesize;
  468. }
  469. int roqParam::NormalFrameSize( void ) {
  470. return normalframesize;
  471. }
  472. bool roqParam::IsScaleable( void ) {
  473. return isScaleable;
  474. }
  475. int roqParam::JpegQuality( void ) {
  476. return jpegDefault;
  477. }
  478. int parseRange(const char *rangeStr,int field, int skipnum[], int startnum[], int endnum[],int numfiles[],bool padding[],int numpadding[] ) {
  479. char start[64], end[64], skip[64];
  480. char *stptr, *enptr, *skptr;
  481. int i,realnum;
  482. i = 1;
  483. realnum = 0;
  484. stptr = start;
  485. enptr = end;
  486. skptr = skip;
  487. do {
  488. *stptr++ = rangeStr[i++];
  489. } while ( rangeStr[i] >= '0' && rangeStr[i] <= '9' );
  490. *stptr = '\0';
  491. if ( rangeStr[i++] != '-' ) {
  492. common->Error("Error: invalid range on middle \n");
  493. }
  494. do {
  495. *enptr++ = rangeStr[i++];
  496. } while ( rangeStr[i] >= '0' && rangeStr[i] <= '9' );
  497. *enptr = '\0';
  498. if ( rangeStr[i] != ']' ) {
  499. if ( rangeStr[i++] != '+' ) {
  500. common->Error("Error: invalid range on close\n");
  501. }
  502. do {
  503. *skptr++ = rangeStr[i++];
  504. } while ( rangeStr[i] >= '0' && rangeStr[i] <= '9' );
  505. *skptr = '\0';
  506. skipnum[field] = atoi( skip );
  507. } else {
  508. skipnum[field] = 1;
  509. }
  510. startnum[field] = atoi( start );
  511. endnum[field] = atoi( end );
  512. numfiles[field] = (abs( startnum[field] - endnum[field] ) / skipnum[field]) + 1;
  513. realnum += numfiles[field];
  514. if ( start[0] == '0' && start[1] != '\0' ) {
  515. padding[field] = true;
  516. numpadding[field] = strlen( start );
  517. } else {
  518. padding[field] = false;
  519. }
  520. return realnum;
  521. }
  522. int parseTimecodeRange(const char *rangeStr,int field, int skipnum[], int startnum[], int endnum[],int numfiles[],bool padding[],int numpadding[] )
  523. {
  524. char start[64], end[64], skip[64];
  525. char *stptr, *enptr, *skptr;
  526. int i,realnum,hrs,mins,secs,frs;
  527. i = 1;//skip the '['
  528. realnum = 0;
  529. stptr = start;
  530. enptr = end;
  531. skptr = skip;
  532. do {
  533. *stptr++ = rangeStr[i++];
  534. } while ( rangeStr[i] >= '0' && rangeStr[i] <= '9' );
  535. *stptr = '\0';
  536. if ( rangeStr[i++] != '-' ) {
  537. common->Error("Error: invalid range on middle \n");
  538. }
  539. do {
  540. *enptr++ = rangeStr[i++];
  541. } while ( rangeStr[i] >= '0' && rangeStr[i] <= '9' );
  542. *enptr = '\0';
  543. if ( rangeStr[i] != ']' ) {
  544. if ( rangeStr[i++] != '+' ) {
  545. common->Error("Error: invalid range on close\n");
  546. }
  547. do {
  548. *skptr++ = rangeStr[i++];
  549. } while ( rangeStr[i] >= '0' && rangeStr[i] <= '9' );
  550. *skptr = '\0';
  551. skipnum[field] = atoi( skip );
  552. } else {
  553. skipnum[field] = 1;
  554. }
  555. sscanf(start,"%2d%2d%2d%2d",&hrs,&mins,&secs,&frs);
  556. startnum[field] = hrs*30*60*60 + mins *60*30 + secs*30 +frs;
  557. sscanf(end,"%2d%2d%2d%2d",&hrs,&mins,&secs,&frs);
  558. endnum[field] = hrs*30*60*60 + mins *60*30 + secs*30 +frs;
  559. numfiles[field] = (abs( startnum[field] - endnum[field] ) / skipnum[field]) + 1;
  560. realnum += numfiles[field];
  561. if ( start[0] == '0' && start[1] != '\0' ) {
  562. padding[field] = true;
  563. numpadding[field] = strlen( start );
  564. } else {
  565. padding[field] = false;
  566. }
  567. return realnum;
  568. }