Removing member var -> error?

Started by
45 comments, last by ms291052 20 years, 3 months ago
I just did a print of all of them (NumVerts) and they all came up fine. I'm almost starting to wonder if there's not a memory error elsewhere or something... Is that even possible (I have no reason to suspect that other than no one can find any errors in THING or MESH)?

Edited to add: After all the THINGs loaded (with their respective MESHes) I got a dialog box saying "Media 'I' not found" which would be my debugger complaining that it was trying to load a file just called 'I.' More memory garbage, i suppose.

[edited by - ms291052 on January 6, 2004 5:51:03 PM]
Advertisement
Yes, of course. I mean the Indices struct kept enough memory to save a lot of things...

Although, if you are going to check through the rest of the code, bear in mind that EVERY mesh needs an Indices[numFaces * 3] struct, which means the memory error probably has to do with mesh-processing. Double-check all DirectX library functions and see if there are any errors, then check everything else where meshes are involved.

Also, have you tried to set breakpoints to see in which part of the program loading/execution the error happens? That might help a lot.
-----------------------------Final Frontier Trader
I ran through the code with a line-by-line, and ended up actually solving the problem!!! I'm so relieved, but guess what... The problem had NOTHING at all to do with MESH, nor THING. It was a true classic memory bug, that any n00b should have heard of and be able to find. Does anyone see anything wrong with this (the spaces in between the //'s are intentional and were added so that GameDev doesn't go nuts):
HRESULT InitGeometry(){	InitInventory();	ACTOR Player = ACTOR(g_pd3dDevice, "meshes/ /player.x", D3DXVECTOR3(0.0f, 2.44f, 10.0f));	g_Player = &Player	g_Things.push_back(&Player);	THING Room = THING(g_pd3dDevice, "levels/ /level1/ /level.x", D3DXVECTOR3(0.0f, 0.0f, 0.0f), TT_ROOM);	g_Room = &Room	g_Things.push_back(&Room);	...	cout << "Geometry Initialized" << endl;    return S_OK;}


biovenger: Thank you so incredibly much (again!) for helping me through this. I'm sorry for taking up so much of your time over something so stupid. But man, are you the best for support (if only Microsoft's support were half as good...). Thanks again and thanks to everyone else who helped.

[edited by - ms291052 on January 6, 2004 6:17:10 PM]
With a quick glance it seems like both the ACTOR and THING in the function go out of scope and nullify their instances, thus you have no g_Player nor g_Room and it results in a memory error?

Oh and once again, really no need to thank me. I love helping out. Thanks for the nice words though
-----------------------------Final Frontier Trader
Yep they go out of scope and those pointers are left hanging at NULL or some other random address (maybe some THING::Indices :-p) and thanks again ;-)
Fun addition: We actually hit three pages, heh.
-----------------------------Final Frontier Trader
Yes we did... that''s a lot for a stupid scope error.

This topic is closed to new replies.

Advertisement