backend-infra-engineer: Release v0.3.3 snapshot

This commit is contained in:
scawful
2025-11-21 21:35:50 -05:00
parent 3d71417f62
commit 476dd1cd1c
818 changed files with 65706 additions and 35514 deletions

View File

@@ -6,7 +6,8 @@
namespace yaze {
namespace zelda3 {
void Sprite::UpdateMapProperties(uint16_t map_id) {
void Sprite::UpdateMapProperties(uint16_t map_id, const void* context) {
(void)context; // Not used by sprites currently
map_x_ = x_;
map_y_ = y_;
name_ = kSpriteDefaultNames[id_];
@@ -701,8 +702,8 @@ void Sprite::Draw() {
} else if (id_ == 0x8E) // Terrorpin
{
DrawSpriteTile((x * 16), (y * 16), 14, 24, 12);
}
}
if (id_ == 0x8F) // Slime
{
DrawSpriteTile((x * 16), (y * 16), 0, 20, 12);
@@ -876,7 +877,7 @@ void Sprite::DrawSpriteTile(int x, int y, int srcx, int srcy, int pal,
if (sizex <= 0 || sizey <= 0) {
return;
}
if (srcx < 0 || srcy < 0 || pal < 0) {
return;
}
@@ -884,12 +885,12 @@ void Sprite::DrawSpriteTile(int x, int y, int srcx, int srcy, int pal,
x += 16;
y += 16;
int drawid_ = (srcx + (srcy * 16)) + 512;
// Validate drawid_ is within reasonable bounds
if (drawid_ < 0 || drawid_ > 4096) {
return;
}
for (auto yl = 0; yl < sizey * 8; yl++) {
for (auto xl = 0; xl < (sizex * 8) / 2; xl++) {
int mx = xl;
@@ -907,20 +908,20 @@ void Sprite::DrawSpriteTile(int x, int y, int srcx, int srcy, int pal,
int tx = ((drawid_ / 0x10) * 0x400) +
((drawid_ - ((drawid_ / 0x10) * 0x10)) * 8);
// Validate graphics buffer access
int gfx_index = tx + (yl * 0x80) + xl;
if (gfx_index < 0 || gfx_index >= static_cast<int>(current_gfx_.size())) {
continue; // Skip this pixel if out of bounds
continue; // Skip this pixel if out of bounds
}
auto pixel = current_gfx_[gfx_index];
// nx,ny = object position, xx,yy = tile position, xl,yl = pixel
// position
int index = (x) + (y * 64) + (mx + (my * 0x80));
// Validate preview buffer access
if (index >= 0 && index < static_cast<int>(preview_gfx_.size()) &&
if (index >= 0 && index < static_cast<int>(preview_gfx_.size()) &&
index <= 4096) {
preview_gfx_[index] = (uint8_t)((pixel & 0x0F) + 112 + (pal * 8));
}

View File

@@ -331,7 +331,8 @@ class Sprite : public GameEntity {
bool mirror_x = false, bool mirror_y = false,
int sizex = 2, int sizey = 2);
void UpdateMapProperties(uint16_t map_id) override;
void UpdateMapProperties(uint16_t map_id,
const void* context = nullptr) override;
void UpdateCoordinates(int map_x, int map_y);
auto preview_graphics() const { return &preview_gfx_; }

View File

@@ -48,7 +48,8 @@ std::string SpriteBuilder::BuildProperties() const {
// Build the properties
for (int i = 0; i < 27; ++i) {
std::string property = "00";
if (!properties[i].empty()) property = properties[i];
if (!properties[i].empty())
property = properties[i];
ss << kSpriteProperties[i] << " = $" << property << std::endl;
}
return ss.str();
@@ -87,7 +88,9 @@ SpriteAction& SpriteAction::SetNextAction(const std::string& nextActionName) {
return *this;
}
std::string SpriteAction::GetConfiguration() const { return ""; }
std::string SpriteAction::GetConfiguration() const {
return "";
}
// ============================================================================