Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Majin Gotenks200

I need help with MySP

This topic is 5573 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Iam a C++/OpenGL Game programmer you might now me from post such as Optimizing and Camera Positioning. But today I bring you yet another problem I need help in. Recently Ive been trying to create my own version of Quakes BSP Format but not as advanced a very simple version. But everytime I run it, it will tell me mysp has caused a error in MYSP.EXE, the program compiles perfectly and everything but I dont know whats the problem. So I went into the debugger and it told me that this line was the problem but I dont know why it could be causing it or maybe its something else? The Line:Temp['i'].Trindex = Trismap.Trindex; I assume the others that look like it might also cause the problem as well. I posted my code in sourcepost so you guys could take a look at it This is the CPP to read MySP and display it: http://sourcepost.sytes.net/sourceview.aspx?source_id=5976 This is the H that goes along with it(Just pay attention to the Quads Structure): http://sourcepost.sytes.net/sourceview.aspx?source_id=5977 And just incase you wanted to see, This is the side app I made to create the Random Access MySP Format saved as a .dat: http://sourcepost.sytes.net/sourceview.aspx?source_id=5978 Please help I tried recreating MySP Engine several times like 3 in all. And I always get this same error. [edited by - Majin Gotenks200 on June 18, 2003 7:29:39 AM] [edited by - Majin Gotenks200 on June 18, 2003 7:30:38 AM]

Share this post


Link to post
Share on other sites
Advertisement
Two things that I could note:
- Make sure your "Temp" structure is valid. If you want the function to load all the data into this structure, then make sure you initialize "Temp" either before the function call or somewhere within the loading function, but before you start writing to it.
- You should error check the file reading. Perhaps the data isn''t properly being read, so garbage is being pushed into "Temp."

When you run through the debugger, check for which iteration of the inner loop is failing. If it fails the first time through the copying of the data from Trismap to Temp, then it is probably the first problem (above), and you forgot to initialize the Temp variable somewhere.

Hope this helps, and hopefully I''m not dead off. =)

Share this post


Link to post
Share on other sites
I did declare it Look at the Reader CPP and youll see that in the function it has void ReadMYSP(char *filename, Quads *Temp). So when I use the function ReadMYSP All i have to do is ReadMYSP("test.dat", Storehere); and itll store all the data in the Storehere quad.

Share this post


Link to post
Share on other sites
Can you show how you are using the LoadMYSP() in code? I can see how it would store the data into whatever variable you pass into the function, but that variable would still have to be initialized before the function call. Something like this:

Quads *data = new Quads[4];
LoadMYSP("test.dat", data);

instead of something like:

Quads *data; (NOT INITIALIZED!)
LoadMYSP("test.dat", data);

Or, you could initialize the variable in the beginning of LoadMYSP();

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!