Mercurial > mm7
diff mm7_2.cpp @ 701:d5b16a44d9b3
frame_table parser, new files for UI func
author | Gloval |
---|---|
date | Mon, 18 Mar 2013 22:53:56 +0400 |
parents | 1d05543f522d |
children | a9c1fb7483c2 |
line wrap: on
line diff
--- a/mm7_2.cpp Sun Mar 17 22:46:18 2013 +0200 +++ b/mm7_2.cpp Mon Mar 18 22:53:56 2013 +0400 @@ -2491,196 +2491,6 @@ } } -//----- (004BE3BF) -------------------------------------------------------- -FrameTableTxtLine *texture_frame_table_txt_parser(const char *_this, FrameTableTxtLine *a2) -{ - char *v2; // eax@3 - signed int v3; // edx@3 - unsigned int v4; // edi@3 - char v5; // cl@4 - FrameTableTxtLine *result; // eax@21 - signed int v7; // [sp+Ch] [bp-4h]@3 - - static struct FrameTableTxtLine static_stru_F8BA58; // weak - static_stru_F8BA58.field_0 = 0; - if ( _this && *_this ) - { - int i = 0; - v2 = (char *)&array_F8B668; - v3 = 1; - v7 = 0; - v4 = _this - (char *)&array_F8B668; - do - { - v5 = v2[v4]; - *v2 = v5; - if ( !v5 ) - break; - if ( v5 != 32 && v5 != 44 && v5 != 9 || v7 ) - { - if ( v5 == 34 ) - { - *v2 = 0; - v3 = 1; - if ( v7 ) - { - v7 = 0; - } - else - { - v7 = 1; - if ( v2[v4 + 1] == 34 ) - { - static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2; - ++static_stru_F8BA58.field_0; - } - } - } - else - { - if ( v3 ) - { - static_stru_F8BA58.pProperties[static_stru_F8BA58.field_0] = v2; - ++static_stru_F8BA58.field_0; - } - v3 = 0; - } - } - else - { - *v2 = 0; - v3 = 1; - } - if ( static_stru_F8BA58.field_0 >= 30 ) - break; - ++v2; - ++i; - } - while (i < 1000); - *v2 = 0; - } - result = a2; - memcpy(a2, &static_stru_F8BA58, 0x7Cu); - return result; -} -// F8BA58: using guessed type FrameTableTxtLine static_stru_F8BA58; - -//----- (004BE485) -------------------------------------------------------- -FrameTableTxtLine *__thiscall frame_table_txt_parser(const char *pString, FrameTableTxtLine *a2) -{ - char *v2; // eax@3 - signed int v3; // edi@3 - signed int v4; // edx@3 - char v5; // cl@4 - FrameTableTxtLine *result; // eax@24 - unsigned int v7; // [sp+Ch] [bp-4h]@3 - - stru_F8B5E8.field_0 = 0; - if ( pString && *pString ) - { - v2 = (char *)&unk_F8B1F8; - v3 = 0; - v7 = pString - (const char *)&unk_F8B1F8; - v4 = 1; - while ( 1 ) - { - v5 = v2[v7]; - *v2 = v5; - if ( !v5 ) - { -//LABEL_23: - *v2 = 0; - break; - } - if ( v5 == ',' ) - { - if ( v3 ) - { - if ( v4 ) - { - stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2; - ++stru_F8B5E8.field_0; - } - v4 = 0; - } - else - { - *v2 = 0; - v4 = 1; - } - } - else - { - if ( v5 != '\t' ) - { - if ( v5 == '"' ) - { - *v2 = 0; - v4 = 1; - if ( v3 ) - { - v3 = 0; - } - else - { - v3 = 1; - if ( v2[v7 + 1] == 34 ) - { - stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2; - ++stru_F8B5E8.field_0; - } - } - } - else - { -//LABEL_18: - if ( v4 ) - { - stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2; - ++stru_F8B5E8.field_0; - } - v4 = 0; - } - } - else - { - if ( v3 ) - { - if ( v4 ) - { - stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2; - ++stru_F8B5E8.field_0; - } - v4 = 0; - } - else - { - *v2 = 0; - if ( v4 ) - { - stru_F8B5E8.pProperties[stru_F8B5E8.field_0] = v2; - ++stru_F8B5E8.field_0; - } - v4 = 1; - } - } - } -//LABEL_21: - if ( stru_F8B5E8.field_0 < 30 ) - { - ++v2; - if ( (unsigned int)v2 < (unsigned int)&unk_F8B5E0 ) - continue; - } - *v2 = 0; - break; - } - } - result = a2; - memcpy(a2, &stru_F8B5E8, 0x7Cu); - return result; -} -// F8B5E8: using guessed type FrameTableTxtLine stru_F8B5E8; @@ -7263,7 +7073,7 @@ { *strchr(&Buf, 10) = 0; memcpy(&v42, frame_table_txt_parser(&Buf, &v41), sizeof(v42)); - if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 ) + if ( v42.uPropCount && *v42.pProperties[0] != 47 && v42.uPropCount >= 3 ) ++Argsa; } while ( fgets(&Buf, 490, File) ); @@ -7281,7 +7091,7 @@ { *strchr(&Buf, 10) = 0; memcpy(&v42, frame_table_txt_parser(&Buf, &v38), sizeof(v42)); - if ( v42.field_0 && *v42.pProperties[0] != 47 && v42.field_0 >= 3 ) + if ( v42.uPropCount && *v42.pProperties[0] != 47 && v42.uPropCount >= 3 ) { strcpy(v2->pDecorations[v2->uNumDecorations].pName, v42.pProperties[1]); v8 = pSpriteFrameTable->FastFindSprite(v2->pDecorations[v2->uNumDecorations].pName); @@ -7309,15 +7119,15 @@ v22 = v42.pProperties[9]; v2->pDecorations[v2->uNumDecorations].uColoredLightBlue = v21; v2->pDecorations[v2->uNumDecorations].uSoundID = atoi(v22); - v25 = __OFSUB__(v42.field_0, 10); - v23 = v42.field_0 == 10; - v24 = v42.field_0 - 10 < 0; + v25 = __OFSUB__(v42.uPropCount, 10); + v23 = v42.uPropCount == 10; + v24 = v42.uPropCount - 10 < 0; v2->pDecorations[v2->uNumDecorations].uFlags = 0; if ( !((unsigned __int8)(v24 ^ v25) | v23) ) { strcpy(&Dest, v42.pProperties[10]); memcpy(&v41, frame_table_txt_parser(&Dest, &v37), sizeof(v41)); - for ( j = 0; j < v41.field_0; ++j ) + for ( j = 0; j < v41.uPropCount; ++j ) { v27 = v41.pProperties[j]; if ( _strcmpi(v41.pProperties[j], "NBM") ) @@ -7505,7 +7315,7 @@ { *strchr(&Buf, 10) = 0; memcpy(&v45, frame_table_txt_parser(&Buf, &v44), sizeof(v45)); - if ( v45.field_0 && *v45.pProperties[0] != '/' ) + if ( v45.uPropCount && *v45.pProperties[0] != '/' ) ++Argsa; } while ( fgets(&Buf, 490, File) ); @@ -7525,7 +7335,7 @@ { *strchr(&Buf, 10) = 0; memcpy(&v45, frame_table_txt_parser(&Buf, &v41), sizeof(v45)); - if ( v45.field_0 && *v45.pProperties[0] != 47 ) + if ( v45.uPropCount && *v45.pProperties[0] != 47 ) { strcpy(v2->pObjects[v2->uNumObjects].field_0, v45.pProperties[0]); v9 = pSpriteFrameTable->FastFindSprite((char *)v45.pProperties[1]); @@ -7548,9 +7358,9 @@ v2->pObjects[v2->uNumObjects].uSpeed = v19; strcpy(&Dest, v20); memcpy(&v44, frame_table_txt_parser(&Dest, &v40), sizeof(v44)); - if ( v45.field_0 > 7 ) - { - for ( Argsb = 0; Argsb < v44.field_0; ++Argsb ) + if ( v45.uPropCount > 7 ) + { + for ( Argsb = 0; Argsb < v44.uPropCount; ++Argsb ) { v21 = Argsb; v22 = v44.pProperties[Argsb];