@@ -278,7 +278,9 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLDisplayListV0::ReadResource(s
278
278
279
279
g.words .w0 &= 0x00FFFFFF ;
280
280
g.words .w0 += (G_MTX_OTR2 << 24 );
281
- g.words .w1 = (uintptr_t )malloc (fName .size () + 1 );
281
+ char * str = (char *)malloc (fName .size () + 1 );
282
+ g.words .w1 = (uintptr_t )str;
283
+ dl->Strings .push_back (str);
282
284
strcpy ((char *)g.words .w1 , fName .data ());
283
285
}
284
286
} else if (childName == " SetCycleType" ) {
@@ -395,10 +397,11 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLDisplayListV0::ReadResource(s
395
397
std::string fName = child->Attribute (" Path" );
396
398
// fName = ">" + fName;
397
399
398
- char * filePath = (char *)malloc (fName .size () + 1 );
399
- strcpy (filePath, fName .data ());
400
+ char * str = (char *)malloc (fName .size () + 1 );
401
+ dl->Strings .push_back (str);
402
+ strcpy ((char *)str, fName .data ());
400
403
401
- g = GsSpVertexOtR2P1 (filePath );
404
+ g = GsSpVertexOtR2P1 (str );
402
405
403
406
dl->Instructions .push_back (g);
404
407
@@ -450,7 +453,9 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLDisplayListV0::ReadResource(s
450
453
g = { gsDPSetTextureImage (fmtVal, sizVal, width + 1 , 0 ) };
451
454
g.words .w0 &= 0x00FFFFFF ;
452
455
g.words .w0 += (G_SETTIMG_OTR_FILEPATH << 24 );
453
- g.words .w1 = (uintptr_t )malloc (fName .size () + 1 );
456
+ char * str = (char *)malloc (fName .size () + 1 );
457
+ dl->Strings .push_back (str);
458
+ g.words .w1 = (uintptr_t )str;
454
459
strcpy ((char *)g.words .w1 , fName .data ());
455
460
}
456
461
@@ -893,7 +898,9 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLDisplayListV0::ReadResource(s
893
898
g = { gsDPSetTextureImage (fmt, siz, width + 1 , 0 ) };
894
899
g.words .w0 &= 0x00FFFFFF ;
895
900
g.words .w0 += (G_SETTIMG_OTR_FILEPATH << 24 );
896
- g.words .w1 = (uintptr_t )malloc (fName .size () + 1 );
901
+ char * str = (char *)malloc (fName .size () + 1 );
902
+ dl->Strings .push_back (str);
903
+ g.words .w1 = (uintptr_t )str;
897
904
strcpy ((char *)g.words .w1 , fName .data ());
898
905
899
906
dl->Instructions .push_back (g);
@@ -952,6 +959,7 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLDisplayListV0::ReadResource(s
952
959
g = { gsSPBranchListOTRHash (seg | 1 ) };
953
960
} else {
954
961
char * dlPath2 = (char *)malloc (strlen (dlPath.c_str ()) + 1 );
962
+ dl->Strings .push_back (dlPath2);
955
963
strcpy (dlPath2, dlPath.c_str ());
956
964
957
965
g = gsSPBranchListOTRFilePath (dlPath2);
@@ -963,6 +971,7 @@ std::shared_ptr<Ship::IResource> ResourceFactoryXMLDisplayListV0::ReadResource(s
963
971
g = { gsSPDisplayList (seg | 1 ) };
964
972
} else {
965
973
char * dlPath2 = (char *)malloc (strlen (dlPath.c_str ()) + 1 );
974
+ dl->Strings .push_back (dlPath2);
966
975
strcpy (dlPath2, dlPath.c_str ());
967
976
968
977
g = gsSPDisplayListOTRFilePath (dlPath2);
0 commit comments