Merge pull request #174 from GuidoDQR/fix-load-sprite
Fix sprite loading
This commit is contained in:
@@ -211,10 +211,6 @@ void PngLoader::handle8bppPalletized(TextureBuilderData* result,
|
||||
auto* pixel = static_cast<unsigned char*>(result->data);
|
||||
struct PngClut* clut = (struct PngClut*)result->clut;
|
||||
|
||||
for (int i = numPallete; i < 256; i++) {
|
||||
memset(&clut[i], 0, sizeof(clut[i]));
|
||||
}
|
||||
|
||||
for (int i = 0; i < numPallete; i++) {
|
||||
clut[i].r = palette[i].red;
|
||||
clut[i].g = palette[i].green;
|
||||
@@ -273,10 +269,6 @@ void PngLoader::handle4bppPalletized(TextureBuilderData* result,
|
||||
auto* pixel = static_cast<unsigned char*>(result->data);
|
||||
struct PngClut* clut = (struct PngClut*)result->clut;
|
||||
|
||||
for (int i = numPallete; i < 16; i++) {
|
||||
memset(&clut[i], 0, sizeof(clut[i]));
|
||||
}
|
||||
|
||||
for (int i = 0; i < numPallete; i++) {
|
||||
clut[i].r = palette[i].red;
|
||||
clut[i].g = palette[i].green;
|
||||
|
||||
@@ -65,20 +65,20 @@ void Path3::sendTexture(const Texture* texture,
|
||||
const RendererCoreTextureBuffers& texBuffers) {
|
||||
packet2_reset(texturePacket, false);
|
||||
|
||||
int coreWidth = texBuffers.core->width <= 64 ? 64 : texBuffers.core->width;
|
||||
packet2_update(texturePacket,
|
||||
draw_texture_transfer(texturePacket->base, texture->core->data,
|
||||
texture->getWidth(),
|
||||
texture->getHeight(), texture->core->psm,
|
||||
texBuffers.core->address, coreWidth));
|
||||
packet2_update(
|
||||
texturePacket,
|
||||
draw_texture_transfer(texturePacket->base, texture->core->data,
|
||||
texture->getWidth(), texture->getHeight(),
|
||||
texture->core->psm, texBuffers.core->address,
|
||||
texBuffers.core->width));
|
||||
|
||||
if (texBuffers.clut != nullptr) {
|
||||
auto* clut = texture->clut;
|
||||
int clutWidth = texBuffers.clut->width <= 64 ? 64 : texBuffers.clut->width;
|
||||
packet2_update(texturePacket,
|
||||
draw_texture_transfer(texturePacket->next, clut->data,
|
||||
clut->width, clut->height, clut->psm,
|
||||
texBuffers.clut->address, clutWidth));
|
||||
packet2_update(
|
||||
texturePacket,
|
||||
draw_texture_transfer(texturePacket->next, clut->data, clut->width,
|
||||
clut->height, clut->psm, texBuffers.clut->address,
|
||||
texBuffers.clut->width));
|
||||
}
|
||||
|
||||
packet2_chain_open_cnt(texturePacket, 0, 0, 0);
|
||||
|
||||
@@ -58,7 +58,9 @@ texbuffer_t* RendererCoreTextureSender::allocateTextureCore(
|
||||
auto* result = new texbuffer_t;
|
||||
const auto* core = t_texture->core;
|
||||
|
||||
result->width = t_texture->getWidth();
|
||||
int coreWidth = core->width <= 64 ? 64 : core->width;
|
||||
|
||||
result->width = coreWidth;
|
||||
result->psm = core->psm;
|
||||
result->info.components = core->components;
|
||||
|
||||
@@ -77,7 +79,9 @@ texbuffer_t* RendererCoreTextureSender::allocateTextureClut(
|
||||
auto* result = new texbuffer_t;
|
||||
const auto* clut = t_texture->clut;
|
||||
|
||||
result->width = clut->width;
|
||||
int clutWidth = clut->width <= 64 ? 64 : clut->width;
|
||||
|
||||
result->width = clutWidth;
|
||||
result->psm = clut->psm;
|
||||
result->info.components = clut->components;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
{
|
||||
"type": "shell",
|
||||
"label": "1. Copy source code to docker volume",
|
||||
"command": "docker exec -t tyra-game-compiler sh -c 'rsync -ac --delete --exclude \".git\" --exclude \".vscode\" --exclude \"*obj*/**\" --exclude \"*bin*/**\" /host/ /src/'"
|
||||
"command": "docker exec -t tyra-game-compiler sh -c 'rsync -ac --delete --exclude=\".git\" --exclude=\".vscode\" --exclude=\"*obj*/**\" --exclude=\"*bin*/**\" /host/ /src/'"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
@@ -34,7 +34,7 @@
|
||||
{
|
||||
"type": "shell",
|
||||
"label": "3. Copy binaries to host",
|
||||
"command": "docker exec -t tyra-game-compiler sh -c 'rsync -zac --include=\"*/\" --include=\"*bin*/**\" --exclude=\"*\" /src/ /host/'",
|
||||
"command": "docker exec -t tyra-game-compiler sh -c 'rsync -zac --include=\"*/\" --include=\"*bin*/**\" --exclude=\"*\" /src/ /host/'"
|
||||
},
|
||||
{
|
||||
"type": "shell",
|
||||
|
||||
Reference in New Issue
Block a user