comparison mm7_4.cpp @ 703:a9c1fb7483c2

monster parser almost complete.
author Gloval
date Tue, 19 Mar 2013 01:33:35 +0400
parents d5b16a44d9b3
children ef4d646d738d
comparison
equal deleted inserted replaced
701:d5b16a44d9b3 703:a9c1fb7483c2
1941 Abortf("TileTable::load - Unable to open file: %s."); 1941 Abortf("TileTable::load - Unable to open file: %s.");
1942 v4 = 0; 1942 v4 = 0;
1943 for ( i = v3; fgets(&Buf, 490, i); i = File ) 1943 for ( i = v3; fgets(&Buf, 490, i); i = File )
1944 { 1944 {
1945 *strchr(&Buf, 10) = 0; 1945 *strchr(&Buf, 10) = 0;
1946 memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84)); 1946 memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84));
1947 if ( v84.uPropCount && *v84.pProperties[0] != 47 ) 1947 if ( v84.uPropCount && *v84.pProperties[0] != 47 )
1948 ++v4; 1948 ++v4;
1949 } 1949 }
1950 v2->uNumTiles = v4; 1950 v2->uNumTiles = v4;
1951 v5 = pAllocator->AllocNamedChunk(v2->pTiles, 26 * v4, "Tile Descrip"); 1951 v5 = pAllocator->AllocNamedChunk(v2->pTiles, 26 * v4, "Tile Descrip");
1958 if ( fgets(&Buf, 490, File) ) 1958 if ( fgets(&Buf, 490, File) )
1959 { 1959 {
1960 while ( 1 ) 1960 while ( 1 )
1961 { 1961 {
1962 *strchr(&Buf, 10) = 0; 1962 *strchr(&Buf, 10) = 0;
1963 memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84)); 1963 memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84));
1964 if ( v84.uPropCount ) 1964 if ( v84.uPropCount )
1965 { 1965 {
1966 if ( *v84.pProperties[0] != 47 ) 1966 if ( *v84.pProperties[0] != 47 )
1967 break; 1967 break;
1968 } 1968 }
4424 if ( fgets(&Buf, 490, v3) ) 4424 if ( fgets(&Buf, 490, v3) )
4425 { 4425 {
4426 do 4426 do
4427 { 4427 {
4428 *strchr(&Buf, 10) = 0; 4428 *strchr(&Buf, 10) = 0;
4429 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24)); 4429 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24));
4430 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) 4430 if ( v24.uPropCount && *v24.pProperties[0] != 47 )
4431 { 4431 {
4432 if ( v24.uPropCount < 3 ) 4432 if ( v24.uPropCount < 3 )
4433 Abortf("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26); 4433 Abortf("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26);
4434 ++v25; 4434 ++v25;
4447 v2->uNumFrames = 0; 4447 v2->uNumFrames = 0;
4448 fseek(v6, 0, 0); 4448 fseek(v6, 0, 0);
4449 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) 4449 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
4450 { 4450 {
4451 *strchr(&Buf, 10) = 0; 4451 *strchr(&Buf, 10) = 0;
4452 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24)); 4452 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24));
4453 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) 4453 if ( v24.uPropCount && *v24.pProperties[0] != 47 )
4454 { 4454 {
4455 v8 = atoi(v24.pProperties[0]); 4455 v8 = atoi(v24.pProperties[0]);
4456 v9 = v24.pProperties[1]; 4456 v9 = v24.pProperties[1];
4457 v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8; 4457 v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8;