Work around issue 457, not fully fixed.
This commit is contained in:
@@ -64,7 +64,13 @@ hgeParticleSystem::hgeParticleSystem(const char *filename, JQuad *sprite)
|
|||||||
//memcpy(&info, psi, sizeof(hgeParticleSystemInfo));
|
//memcpy(&info, psi, sizeof(hgeParticleSystemInfo));
|
||||||
//hge->Resource_Free(psi);
|
//hge->Resource_Free(psi);
|
||||||
|
|
||||||
fileSys->ReadFile(&info, sizeof(hgeParticleSystemInfo));
|
// Skip reading the pointer as it may be larger than 4 bytes in the structure
|
||||||
|
void *dummyPointer;
|
||||||
|
fileSys->ReadFile(&dummyPointer, 4);
|
||||||
|
// we're actually trying to read more than the file size now, but it's no problem.
|
||||||
|
// Note that this fix is only to avoid the largest problems, filling a structure
|
||||||
|
// by directly reading a file, is really a bad idea ...
|
||||||
|
fileSys->ReadFile(&(info.nEmission), sizeof(hgeParticleSystemInfo));
|
||||||
fileSys->CloseFile();
|
fileSys->CloseFile();
|
||||||
|
|
||||||
info.sprite=sprite;
|
info.sprite=sprite;
|
||||||
|
|||||||
Reference in New Issue
Block a user