Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NPE; remove redundant var #123

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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