Allow a sheet buffer to be released without error, even if unbuffered.
This commit is contained in:
@@ -154,16 +154,6 @@ namespace OpenRA.Graphics
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void CommitData()
|
public void CommitData()
|
||||||
{
|
|
||||||
CommitData(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void ReleaseBuffer()
|
|
||||||
{
|
|
||||||
CommitData(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
void CommitData(bool releaseBuffer)
|
|
||||||
{
|
{
|
||||||
lock (textureLock)
|
lock (textureLock)
|
||||||
{
|
{
|
||||||
@@ -174,8 +164,17 @@ namespace OpenRA.Graphics
|
|||||||
"If you need to make only small changes to the texture data consider creating a buffered sheet instead.");
|
"If you need to make only small changes to the texture data consider creating a buffered sheet instead.");
|
||||||
|
|
||||||
dirty = true;
|
dirty = true;
|
||||||
if (releaseBuffer)
|
}
|
||||||
releaseBufferOnCommit = true;
|
}
|
||||||
|
|
||||||
|
public void ReleaseBuffer()
|
||||||
|
{
|
||||||
|
lock (textureLock)
|
||||||
|
{
|
||||||
|
if (!Buffered)
|
||||||
|
return;
|
||||||
|
dirty = true;
|
||||||
|
releaseBufferOnCommit = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user