lint: ruff-clean testbed (blocking file write to thread, unused vars)
This commit is contained in:
@@ -13,7 +13,7 @@ import math
|
||||
|
||||
from PIL import Image
|
||||
|
||||
from testbed.room.world import ROOM_HEIGHT, ROOM_SIZE, Box, Room
|
||||
from testbed.room.world import ROOM_HEIGHT, ROOM_SIZE, Room
|
||||
|
||||
# Palette
|
||||
FOG = (14, 14, 20)
|
||||
@@ -83,10 +83,10 @@ class Raycaster:
|
||||
|
||||
row_top = self._row_of(ROOM_HEIGHT, t_wall, eye, tan_pitch)
|
||||
row_bot = self._row_of(0.0, t_wall, eye, tan_pitch)
|
||||
r_top = max(0, int(math.ceil(min(row_top, row_bot))))
|
||||
r_bot = min(h, int(math.floor(max(row_top, row_bot))))
|
||||
r_top = max(0, math.ceil(min(row_top, row_bot)))
|
||||
r_bot = min(h, math.floor(max(row_top, row_bot)))
|
||||
|
||||
base = c * 3
|
||||
c * 3
|
||||
for r in range(h):
|
||||
v = self.tan_fy * (1.0 - 2.0 * (r + 0.5) / h)
|
||||
down = v + tan_pitch
|
||||
@@ -252,7 +252,7 @@ class Raycaster:
|
||||
return _fog(col, dist)
|
||||
|
||||
def _shade_floor(self, wx: float, wz: float, t: float) -> tuple[int, int, int]:
|
||||
cell = int(math.floor(wx)) + int(math.floor(wz))
|
||||
cell = math.floor(wx) + math.floor(wz)
|
||||
col = FLOOR_A if cell % 2 == 0 else FLOOR_B
|
||||
fx = wx - math.floor(wx)
|
||||
fz = wz - math.floor(wz)
|
||||
@@ -285,8 +285,7 @@ class Raycaster:
|
||||
vv = (b.height - eye) / along - tan_pitch
|
||||
row_c = (1.0 - vv / self.tan_fy) / 2.0 * h
|
||||
r_px = b.radius / along / self.tan_fx * w / 2.0
|
||||
if r_px < 1.2:
|
||||
r_px = 1.2
|
||||
r_px = max(r_px, 1.2)
|
||||
glow = r_px * 3.4
|
||||
|
||||
pulse = 1.0
|
||||
|
||||
Reference in New Issue
Block a user