mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
refactor & fix random deleting texture
This commit is contained in:
parent
e158b384fa
commit
8bb03a004f
7 changed files with 65 additions and 64 deletions
|
|
@ -60,17 +60,17 @@ void Batch2D::vertex(
|
|||
index++;
|
||||
}
|
||||
|
||||
void Batch2D::texture(const Texture* new_texture){
|
||||
if (currentTexture == new_texture) {
|
||||
void Batch2D::texture(const Texture* newTexture){
|
||||
if (currentTexture == newTexture) {
|
||||
return;
|
||||
}
|
||||
flush();
|
||||
currentTexture = new_texture;
|
||||
if (new_texture == nullptr) {
|
||||
currentTexture = newTexture;
|
||||
if (newTexture == nullptr) {
|
||||
blank->bind();
|
||||
region = blank->getUVRegion();
|
||||
} else {
|
||||
new_texture->bind();
|
||||
newTexture->bind();
|
||||
region = currentTexture->getUVRegion();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue