philazzi44 / DnDCS

DnD Client-Server
3 stars 1 forks source link

Server's NewFog variable is too large #7

Closed philazzi44 closed 10 years ago

philazzi44 commented 10 years ago

When drawing a fog area on the map, it gets saved in the "NewFog" variable. This NewFog bitmap is created as the full size of the map, but I'm not sure we need to bother with that.

We should change it to only be the size of the visible area to the server. They can't scroll or zoom while they're drawing this (or at least shouldn't, so confirm that and fix), then update the NewFog Painting to always render at (0,0) rather than at the translated location. This might get tricky with zooming involved...

philazzi44 commented 10 years ago

Rather than fuss with the translation, I changed it to just create the "NewFog" var when the Map is set, then clear/redraw on top of it as needed rather than re-creating the Bitmap from scratch every time.