OK, so my animator’s gone a bit overboard and has produced 86 megabytes of SMDs. When we run studiomdl, it grabs all the smds but at the point where it should be displaying the BMP file names, it crashes out with:

 

d:/ani/HI/histealth//H6AœFBðVCDgD˜wEì‡F@˜G”¨Hè¸I<ÉJÙKäéL8úMŒ

OàP4+Qˆ;RÜKS0\T„lUØ|V,W€XÔ­Y(¾Z|Î[ÐÞ\$ï]xÿ^Ì`  at0bÈ@cQdpaeÄqf‚gl’hÀ¢i³jhÃk
 not found

 

OK, obvious sort of memory error. The problem is something is overwriting texture[] with its own values. I track down the source, and I find that it is line 2754 in studiomdl.c that is overwriting the values:

 

            for (i = 0; i < numblends; i++)

            {

                        panimation[numani] = kalloc( 1, sizeof( s_animation_t ) );  ß This is the bad line here

                        sequence[numseq].panim[i] = panimation[numani];

                        sequence[numseq].panim[i]->startframe = start;

                        sequence[numseq].panim[i]->endframe = end;

                        sequence[numseq].panim[i]->flags = 0;

                        Option_Animation( smdfilename[i], panimation[numani] );

                        numani++;

            }

 

kalloc being the following function:

 

void *kalloc( int num, int size )

{

            // printf( "calloc( %d, %d )\n", num, size );

            // printf( "%d ", num * size );

            k_memtotal += num * size;

            return calloc( num, size );

}

The problem seems to generally occur when k_memtotal is around 78,000,000.

 

OK, so I have several questions. First, the value kalloc returns is 0x0595caf8, nowhere near the 0x0b00790 values that it is overwriting (the actual values, of course, change every now and then, but they don’t seem very close at all). So why the hell is it overwriting my texture values? Secondly, how can I fix it?

 

Another seemingly very odd thing is the tendency of the program to overwrite texture[x].ppicture with the name of an animation, like hold_car_down_center. I suppose this is probably because it’s overwriting it with a pointer, but again, the pointer is always something like 0x059b1df0. I’m just not as up on C memory management as I should be, I admit. Is this fixable? Anyone?

 

Of course, if you have any questions whatsoever about the problem, please let me know.

 

 

Persuter

Coding Lead

Hostile Intent

 

 



Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com

Reply via email to