summaryrefslogtreecommitdiff
path: root/src/T2DLL/T2PeopleLoader.cpp
diff options
context:
space:
mode:
authorAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
committerAsh Wolf <ninji@wuffs.org>2023-07-01 02:43:29 +0100
commit5c6a48b2ff362a70416a6a00fda7d06e0f276f2d (patch)
tree62cf542c68d91aa6f7a4e3bfa9eddca4ab352970 /src/T2DLL/T2PeopleLoader.cpp
parentc0c336500955a23e344651e5412c9d9d441ef4ee (diff)
downloadt2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.tar.gz
t2win-5c6a48b2ff362a70416a6a00fda7d06e0f276f2d.zip
i am in hell
Diffstat (limited to '')
-rw-r--r--src/T2DLL/T2PeopleLoader.cpp46
1 files changed, 26 insertions, 20 deletions
diff --git a/src/T2DLL/T2PeopleLoader.cpp b/src/T2DLL/T2PeopleLoader.cpp
index f2e76a3..e19a554 100644
--- a/src/T2DLL/T2PeopleLoader.cpp
+++ b/src/T2DLL/T2PeopleLoader.cpp
@@ -5,37 +5,43 @@
#include "T2TemplatePluginDB.h"
#include "T2TemplatePluginList.h"
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
/*static*/ void T2PeopleLoader::Load(T2PluginSpecifier* specifier, T2TemplatePluginDB* db) {
LoadSilhouette(specifier, db);
LoadPeople(specifier, db);
}
/*static*/ void T2PeopleLoader::Unload(T2TemplatePluginDB* db) {
- LArrayIterator silhouetteIterator(*db->GetTemplatePluginList('SlDf'));
+ LArrayIterator silhouetteIter(*db->GetTemplatePluginList('SlDf'));
T2SilhouetteDef *silhouetteDef;
- while (silhouetteIterator.Next(&silhouetteDef))
+ while (silhouetteIter.Next(&silhouetteDef))
delete silhouetteDef;
- LArrayIterator peopleIterator(*db->GetTemplatePluginList('PPDf'));
+ LArrayIterator peopleIter(*db->GetTemplatePluginList('PPDf'));
T2PeopleDef *peopleDef;
- while (peopleIterator.Next(&peopleDef))
+ while (peopleIter.Next(&peopleDef))
delete peopleDef;
}
/*static*/ BOOL T2PeopleLoader::LoadSilhouette(T2PluginSpecifier* specifier, T2TemplatePluginDB* db) {
CResFile resFile;
if (resFile.OpenResource(specifier->mInstance, 1, 'SlDf')) {
- T2TemplatePluginList *silhouetteList = db->GetTemplatePluginList('SlDf');
+ T2TemplatePluginList *silhouetteDefList = db->GetTemplatePluginList('SlDf');
- int count;
- resFile >> count;
+ int numOfDefs;
+ resFile >> numOfDefs;
- for (int i = 0; i < count; i++) {
+ for (int index = 0; index < numOfDefs; index++) {
#line 47
- T2SilhouetteDef *silhouetteDef = DEBUG_NEW T2SilhouetteDef('SlDf', *specifier, &resFile);
+ T2SilhouetteDef *silhouetteDef = new T2SilhouetteDef('SlDf', *specifier, &resFile);
- if (!silhouetteList->FindSilhouette(silhouetteDef->GetSilhouetteType()))
- silhouetteList->Add(silhouetteDef);
+ if (!silhouetteDefList->FindSilhouette(silhouetteDef->GetSilhouetteType()))
+ silhouetteDefList->Add(silhouetteDef);
else
delete silhouetteDef;
}
@@ -48,19 +54,19 @@
/*static*/ BOOL T2PeopleLoader::LoadPeople(T2PluginSpecifier* specifier, T2TemplatePluginDB* db) {
CResFile resFile;
if (resFile.OpenResource(specifier->mInstance, 1, 'PPDf')) {
- T2TemplatePluginList *peopleList = db->GetTemplatePluginList('PPDf');
- T2TemplatePluginList *silhouetteList = db->GetTemplatePluginList('SlDf');
+ T2TemplatePluginList *peopleDefList = db->GetTemplatePluginList('PPDf');
+ T2TemplatePluginList *silhouetteDefList = db->GetTemplatePluginList('SlDf');
- int count;
- resFile >> count;
+ int numOfDefs;
+ resFile >> numOfDefs;
- for (int i = 0; i < count; i++) {
+ for (int index = 0; index < numOfDefs; index++) {
#line 70
- T2PeopleDef *peopleDef = DEBUG_NEW T2PeopleDef('PPDf', *specifier, &resFile);
+ T2PeopleDef *peopleDef = new T2PeopleDef('PPDf', *specifier, &resFile);
- if (!peopleList->FindPeopleDef(peopleDef->GetPeopleType())) {
- peopleDef->AssignSilhouette(silhouetteList);
- peopleList->Add(peopleDef);
+ if (!peopleDefList->FindPeopleDef(peopleDef->GetPeopleType())) {
+ peopleDef->AssignSilhouette(silhouetteDefList);
+ peopleDefList->Add(peopleDef);
} else {
delete peopleDef;
}