I draw the map using a scissor rect during spriteBatch and later I draw my paperdoll however the scissor rect for the map is cutting off the paperdoll model somehow. Here's an example of it:
I'm drawing part of the map via:
[source lang="csharp"]sb.Begin(SpriteSortMode.Deferred, BlendState.NonPremultiplied, SamplerState.LinearWrap, DepthStencilState.None, scissorRS);scissorRect.X = mapElementRect.X;scissorRect.Y = mapElementRect.Y;scissorRect.Width = mapElementRect.Width;scissorRect.Height = mapElementRect.Height;// Make sure rect doesn't go out of bounds of screenif (scissorRect.X + scissorRect.Width > screenWidth - 1) scissorRect.Width = screenWidth - scissorRect.X;if (scissorRect.Y + scissorRect.Height > screenHeight - 1) scissorRect.Height = screenHeight - scissorRect.Y;sb.GraphicsDevice.ScissorRectangle = scissorRect;[/source]
The paperdoll is drawn after the map. I believe it has to do with depth as setting device.DepthStencilState to none draws the model fully but of course it's inside out at that point. However I set depth to none when drawing the map.
EDIT : Ok I feel silly. After combing my code for the past two hours there was one line when drawing the map outline that was setting DepthStencilState to Default during spritebatch.Begin() that I kept missing. Case closed!
Edited by belgreth, 27 August 2012 - 07:17 PM.