Archived

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

Metus

First Debug-Release

Recommended Posts

Can someone find some errors in my code? I've got it to work once, but then, by some reason, it didn't work anymore. The biggest creep is within my WaveLoader (CWaveFile->Load), but if You could take a look at my Targa-Loader as well I'd be very pleased. The entire source is here [edited by - metus on April 29, 2002 4:06:20 PM]

Share this post


Link to post
Share on other sites
Learning to debug programs is extremely important, and you shouldn''t just post your code and hope for someone else to fix the bugs for you.

It''s perfectly alright to post asking specific questions about some problem you have, but please try to at least state what the problem is. The information you have given isn''t particularly informative (and most people are lazy and can''t be bothered to download your source without knowing (roughly) what your problem is).

Share this post


Link to post
Share on other sites
why would someone fix your code when they need to fix their own. unless you post specific questions on problems, you are merely being stupid. it also shows that you are being a cut and paste coder since you would be able to debug and at least track down the general cause (maybe not the solution) of the problem. though in this way you dont even show you uinderstand the code you are using. please go over your own code, and post specific questions (with small related clips of code).

i highly suggest you halt game development for the time being and learn some basics of coding and debugging. otherwise you will never be able to handle an original game, and be limited to VERY simple games.

Share this post


Link to post
Share on other sites
Well, It seems that you''ve been misunderstanding me; The code works perfectly (The WaveLoader) Until the wave goes bigger that about 300Kb. I''ve debugged every line of code; but even what I do, the only data I can read is about 300Kb (285Kb Actually) no matter if the wave is 15Mb (By Wavefile for testing) or 3Mb, Just 285Kb of data is READ FROM THE WAVE.

I''m sorry if I made you thik you''d do the coding for me.

a person -> As I told you before; I''m not a Cut-And-Paste person. I''ve been doing some hobby-coding for about 3 years (Hasn''t taken any coding class at school yet) and I HATE using others code.

I Won''t even use FMOD for sound; I''d like to write everything my own.

Share this post


Link to post
Share on other sites
Now that''s better, this time you actually stated the problem.

Have you tested it with several different large wave files?
Does it always fail?

Perhaps the ''fmt '' and ''data'' chunks are not the first chunks in the file you''ve tested with (or perhaps there are other chunks between the ''fmt '' and ''data'').

AFAIK the wave standard only guarantees that ''fmt '' comes before ''data'' (and that both exist). Other than that you don''t know where the chunks are in the file. Check if g_SWaveHeader.szFormatSig and g_SWaveHeader.szDataSig contains the correct chunk signatures after reading them.

What you should really do is have a loop that reads chunks and discards everything you can''t handle (i.e. discard everything but ''fmt '' and ''data'' chunks).

The filesize alone shouldn''t affect the things I''ve suggested, but chunk locations may vary among different wave files.

Share this post


Link to post
Share on other sites
Thank you! But I''ve already solved it (I Think)
If I read lDataSize where i read lChunkSize everything works perfectly..

But maybe that was just a coincidense (spelling)

Share this post


Link to post
Share on other sites