Trying to find dolphin texture bug
All checks were successful
Build Dusk / run-tests (push) Successful in 1m37s
Build Dusk / build-linux (push) Successful in 1m23s
Build Dusk / build-psp (push) Successful in 1m45s
Build Dusk / build-dolphin (push) Successful in 2m20s

This commit is contained in:
2026-02-09 14:53:27 -06:00
parent a26e51cf46
commit 073ee8dca9
10 changed files with 56 additions and 58 deletions

View File

@@ -20,10 +20,7 @@ camera = cameraCreate(CAMERA_PROJECTION_TYPE_ORTHOGRAPHIC)
tilesetUi = tilesetGetByName("ui")
textureUi = textureLoad(tilesetUi.texture)
tilesetGrid = tilesetGetByName("grid")
textureGrid = textureLoad(tilesetGrid.texture)
gridPiece = tilesetPositionGetUV(tilesetGrid, 0, 0)
gridSlice = tilesetPositionGetUV(tilesetGrid, 11, 3)
textureGrid = textureLoad("minesweeper/grid_bg.dpi")
tilesetCell = tilesetGetByName("cell")
textureCell = textureLoad(tilesetCell.texture)
@@ -65,28 +62,21 @@ function cellDraw(x, y, type)
end
function backgroundDraw()
local t = (TIME.time * 3) % 1
local offXStart = gridPiece.u1 * t
local offYStart = gridPiece.v1 * t
local offXEnd = offXStart + gridPiece.u1
local offYEnd = offYStart + gridPiece.v1
-- Tile background
local cols = math.ceil(screenGetWidth() / tilesetGrid.tileWidth)
local rows = math.ceil(screenGetHeight() / tilesetGrid.tileHeight)
local t = (TIME.time / 20) % 1
local scaleX = screenGetWidth() / textureGrid.width
local scaleY = screenGetHeight() / textureGrid.height
local u0 = t * scaleX
local v0 = t * scaleY
local u1 = scaleX + u0
local v1 = scaleY + v0
for y = 0, rows do
for x = 0, cols do
spriteBatchPush(
textureGrid,
x * tilesetGrid.tileWidth, y * tilesetGrid.tileHeight,
(x + 1) * tilesetGrid.tileWidth, (y + 1) * tilesetGrid.tileHeight,
colorWhite(),
gridSlice.u0 + offXStart, gridSlice.v0 + offYStart,
gridSlice.u1 + offXEnd, gridSlice.v1 + offYEnd
)
end
end
spriteBatchPush(textureGrid,
0, 0,
screenGetWidth(), screenGetHeight(),
colorWhite(),
u0, v0,
u1, v1
)
end
function sceneDispose()
@@ -112,6 +102,7 @@ function sceneRender()
y * tilesetCell.tileHeight + offsetY,
cells[i]
)
break
end
end
spriteBatchFlush()