I'm passing an number by value (200), and it's showing up as 0 inside the function. I'm using Turbo C. No problems until now; written a partial software renderer.
If someone could just trace through this, I would be very appreciative... I cannot debug this.
InitBuffer( 320, 200 );
void InitBuffer( uint32 width, uint32 height )
{
uint32 i;
sprintf( buf, "width: %u, height: %u\n", width, height );
Log( buf );
...
}
Log shows:
width: 320, height: 0
Proj is HERE, with whole environment, just run c.bat to compile. main.c has the call to InitBuffer(), and 2DCanvas.c defines InitBuffer(). Basically I am fine when I animate a shape in the center of the screen, but when I bring it off the lower half of the screen, I get this problem. I do not believe there are any memory leaks (it's too early in main.c for that to happen). Also, when a pixel is to be drawn is out of bounds (SetPixel()), I don't draw it.
What SHOULD happen is, the shape should animate, even though half off-screen.
Regardless of all that... passing by value is pretty fundamental!! :)












