RU
games/dmmotor / src / Dm / Render / Visplane.php · commit 9d248a4
<?php/* * dmmotor — renderer structures (r_defs.h of linuxdoom-1.10). * Copyright (C) 1993-1996 by id Software, Inc.; PHP port for dmmotor. GPL v2 (see LICENSE). */namespace App\Dm\Render;/** A floor or ceiling area of one height, picture and light: its top and bottom row per column. */final class Visplane{    public const EMPTY = 0xFF;    public int $minX;    public int $maxX = -1;    /** @var array<int,int> */    public array $top;    /** @var array<int,int> */    public array $bottom;    public function __construct(public float $height, public int $picNum, public int $lightLevel, int $width)    {        $this->minX = $width;        $this->top = array_fill(-1, $width + 2, self::EMPTY);        $this->bottom = array_fill(-1, $width + 2, 0);    }}