|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.kernel.maps.MapDirtyRegions
A class that encapsulates the set of squares in a map that have visually invalidated since the last time the CameraManager refreshed the cameras for that map.
Constructor Summary | |
MapDirtyRegions(BitMatrix changeList)
|
Method Summary | |
void |
clear()
|
boolean |
didLightTurnOff()
Returns true if setLightTurnedOff() was called since the last call to clear(). |
BitMatrix |
getBitMatrix()
Returns the BitMatrix containing the squares that have become visually invalid. |
boolean |
isEmpty()
|
void |
setLightTurnedOff()
Works around a problem with the design of the camera system. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MapDirtyRegions(BitMatrix changeList)
Method Detail |
public boolean isEmpty()
public void clear()
public BitMatrix getBitMatrix()
public void setLightTurnedOff()
The current camera-system design has a problem: the DisplayPolicy optimizes for areas you can't see, so if you turn off a light, you can't see it turn off (because the map is dark). The workaround, until I can think of something more elegant, is to keep track of the fact that the lights are off, so the Frame won't do its can-see optimization on this refresh. If we wanted to use double the memory (per map, and per Frame), we could keep *another* BitMatrix in each map and Frame that indicates areas where a light turned off. It would work, but could potentially be expensive. Maybe not as expensive as the extra network bandwidth used by this approach, though. This bit (lightTurnedOff) is cleared when you call clear().
public boolean didLightTurnOff()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |