Mercurial > mm7
comparison Render.cpp @ 1162:79fd2fb7a3ab
RenderHWLContainer::Release cleanup
author | Grumpy7 |
---|---|
date | Tue, 04 Jun 2013 01:40:53 +0200 |
parents | da80e03c677c |
children | 6b911d7e09a5 |
comparison
equal
deleted
inserted
replaced
1159:da80e03c677c | 1162:79fd2fb7a3ab |
---|---|
10865 } | 10865 } |
10866 | 10866 |
10867 //----- (0045271F) -------------------------------------------------------- | 10867 //----- (0045271F) -------------------------------------------------------- |
10868 bool RenderHWLContainer::Release() | 10868 bool RenderHWLContainer::Release() |
10869 { | 10869 { |
10870 RenderHWLContainer *v1; // esi@1 | |
10871 int v2; // ebx@1 | |
10872 void **v3; // edi@3 | |
10873 __int32 v4; // eax@6 | 10870 __int32 v4; // eax@6 |
10874 FILE *v5; // ST24_4@6 | 10871 FILE *v5; // ST24_4@6 |
10875 size_t *v6; // edi@6 | |
10876 int v7; // ebx@7 | |
10877 signed int v9; // [sp+0h] [bp-8h]@6 | |
10878 FILE *File; // [sp+4h] [bp-4h]@6 | 10872 FILE *File; // [sp+4h] [bp-4h]@6 |
10879 | 10873 |
10880 v1 = this; | 10874 if ( this->bDumpDebug) |
10881 v2 = 0; | |
10882 if ( this->bDumpDebug ) | |
10883 { | 10875 { |
10884 File = fopen("logd3d.txt", "w"); | 10876 File = fopen("logd3d.txt", "w"); |
10885 v4 = ftell(v1->pFile); | 10877 v4 = ftell(this->pFile); |
10886 v5 = v1->pFile; | 10878 v5 = this->pFile; |
10887 v6 = &v1->uNumItems; | 10879 this->uDataOffset = v4; |
10888 v1->uDataOffset = v4; | 10880 fwrite(&this->uNumItems, 4u, 1u, v5); |
10889 fwrite(&v1->uNumItems, 4u, 1u, v5); | 10881 for (int i = 0; i < this->uNumItems; i++) |
10890 v9 = 0; | 10882 { |
10891 if ( (signed int)v1->uNumItems > 0 ) | 10883 fwrite(this->pSpriteNames[i], 1u, 0x14u, this->pFile); |
10892 { | 10884 fprintf(File, "D3D texture name: %s\t\toffset: %x\n", this->pSpriteNames[i], *(unsigned int *)(&(this->pSpriteNames[i]) + 200000/sizeof(char*))); |
10893 v7 = (int)v1->pSpriteNames; | 10885 } |
10894 do | 10886 fwrite(this->pSpriteOffsets, 4u, this->uNumItems, this->pFile); |
10895 { | 10887 fseek(this->pFile, 4, 0); |
10896 fwrite(*(const void **)v7, 1u, 0x14u, v1->pFile); | 10888 fwrite(&this->uDataOffset, 4u, 1u, this->pFile); |
10897 fprintf(File, "D3D texture name: %s\t\toffset: %x\n", *(unsigned int *)v7, *(unsigned int *)(v7 + 200000)); | 10889 fclose(this->pFile); |
10898 ++v9; | |
10899 v7 += 4; | |
10900 } | |
10901 while ( v9 < (signed int)*v6 ); | |
10902 v2 = 0; | |
10903 } | |
10904 fwrite(v1->pSpriteOffsets, 4u, *v6, v1->pFile); | |
10905 fseek(v1->pFile, 4, v2); | |
10906 fwrite(&v1->uDataOffset, 4u, 1u, v1->pFile); | |
10907 fclose(v1->pFile); | |
10908 fclose(File); | 10890 fclose(File); |
10909 } | 10891 } |
10910 else | 10892 else |
10911 { | 10893 { |
10912 fclose(this->pFile); | 10894 fclose(this->pFile); |
10913 if ( (signed int)v1->uNumItems > 0 ) | 10895 for (int i = 0; i < this->uNumItems; i++) |
10914 { | 10896 { |
10915 v3 = (void **)v1->pSpriteNames; | 10897 free(this->pSpriteNames[i]); |
10916 do | |
10917 { | |
10918 free(*v3); | |
10919 ++v2; | |
10920 ++v3; | |
10921 } | |
10922 while ( v2 < (signed int)v1->uNumItems ); | |
10923 } | 10898 } |
10924 } | 10899 } |
10925 return true; | 10900 return true; |
10926 } | 10901 } |
10927 | 10902 |