GameBoy\Core::drawPartBgSprite PHP Method

drawPartBgSprite() public method

public drawPartBgSprite ( $tileIndex, $x, $y, $sourceLine, $attribs )
    public function drawPartBgSprite($tileIndex, $x, $y, $sourceLine, $attribs)
    {
        $im = $this->tileData[$tileIndex + $this->tileCount * $attribs] ? $this->tileData[$tileIndex + $this->tileCount * $attribs] : $this->updateImage($tileIndex, $attribs);
        if ($im === true) {
            return;
        }
        $dst = $x + $y * 160;
        $src = $sourceLine * 8;
        $dstEnd = $x > 152 ? ($y + 1) * 160 : $dst + 8;
        // adjust left
        if ($x < 0) {
            $dst -= $x;
            $src -= $x;
        }
        while ($dst < $dstEnd) {
            //if ($im[$src] < 0 && $this->frameBuffer[$dst] >= 0) {
            $this->frameBuffer[$dst] = $im[$src];
            // }
            ++$dst;
            ++$src;
        }
    }