Skip to content

Commit

Permalink
Fix NPE; remove redundant var
Browse files Browse the repository at this point in the history
  • Loading branch information
caiiiycuk committed Feb 22, 2024
1 parent 4f02905 commit 824c4c7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
4 changes: 0 additions & 4 deletions Source/Render/sokol/SokolRenderTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,7 @@ int cSokolRender::CreateTexture(cTexture* Texture, cFileImage* FileImage, bool e
img = new SokolTexture2D(desc);
} else {
desc->usage = SG_USAGE_IMMUTABLE;
std::vector<uint8_t*> buffers;

uint8_t* buf = new uint8_t[tex_len];
buffers.push_back(buf);
memset(buf, 0xFF, tex_len);
//Load in RGBA
FileImage->GetTextureRGB(buf, i * Texture->GetTimePerFrame(), 4, 4 * dx,
Expand Down Expand Up @@ -91,7 +88,6 @@ int cSokolRender::CreateTexture(cTexture* Texture, cFileImage* FileImage, bool e
int mmh = dy >> nMipMap;
size_t bufNextLen = mmw * mmh * 4;
uint8_t *bufNext = new uint8_t[bufNextLen];
buffers.push_back(bufNext);

BuildMipMap(mmw, mmh, 4, 8 * mmw, buf, 4 * mmw, bufNext,
8, 8, 8, 8,
Expand Down
1 change: 1 addition & 0 deletions Source/Render/sokol/SokolResources.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class SokolResource {
if (refcount == 0) {
destroy_res();
delete this;
return 0;
}
}
return refcount;
Expand Down

0 comments on commit 824c4c7

Please sign in to comment.