Skip to main content
gamedev.net
🔒 Locked

Debug / Release Version!?

Started by Lowspeed 4 replies 900+ views
Original Post
Lowspeed
Lowspeed
Hi all, I have this simple render loop, the problem is that it will only render when using the debug version of the managed directx libraries. public void Render() { Point pointLocation = new Point(0, 0); int intOffset = 0; for(int j=0; j<10; j++) { // Loop through each row, starting a loop to draw the tiles of that row, starting top, ending bottom. pointLocation.Y = j * 9; // Isometric tiles are staggered, so, should we stagger? if ((j % 2) == 0) { intOffset = 16; } else { intOffset = 0; } for(int i=0; i<10; i++) { // Loop through each X tile, drawing a row starting from left, ending right. pointLocation.X = (i * 32) + intOffset; SpriteManager.Instance.Sprite.Draw2D(textureMapTile, Rectangle.Empty, new Rectangle(0, 0, 32, 32), pointLocation, Color.White.ToArgb()); } } } What makes it even more bizarre is that if I comment out the intOffset check (the part where I use the % operator) it works fine in the release version... Any ideas? Thanks in advance,
sirob
sirob
Erm, well, what happens when you use the Release version? Do you get an error? an exception? Does it simply not draw anything?
Sirob Yes.» - status: Work-O-Rama.
Lowspeed
Lowspeed
I get a black scene...

(black is the color I clear the device with)

Thanks for the reply,
Staffan E
Staffan E
Are you calling Sprite.Begin() and Sprite.End() along with the drawing of the sprites? Perhaps it's just omitted in the posted code...

Are you sure it can find and load the texture properly in the release version?
Hack my projects! Oh Yeah! Use an SVN client to check them out.BlockStacker
Lowspeed
Lowspeed
Hi,

SpriteManager is a static class using a singleton implementation. It calls Sprite.Begin(), then calls all it's subclasses (that use the sprite object) to render, then calls sprite.flush() sprite.end()...

I know the texture is being loaded because if I comment out the intOffset part it works fine.

Any other ideas?

Thank you for the reply,
Lowspeed
Lowspeed
Hey guys,

I figured it would be a bit more help if you could see the project in it's entirety (all 80k of it)...

This is just the start of the project but really need help getting rid of/solving this problem...

http://www.chasegale.com/dump/base.zip

Thanks in advance,

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.