mirror of
https://github.com/badvision/lawless-legends.git
synced 2025-08-15 06:27:24 +00:00
Several bug fixes for the ray caster.
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# This program generates optimized texture expansion code.
|
# This program generates optimized texture expansion code.
|
||||||
|
|
||||||
import copy, os, re, sys
|
import copy, math, os, re, sys
|
||||||
|
|
||||||
# Main control on size vs. speed
|
# Main control on size vs. speed
|
||||||
rowInterval = 5
|
rowInterval = 5
|
||||||
@@ -147,7 +147,14 @@ def makeCmds(dstHeight):
|
|||||||
|
|
||||||
texOff = 0
|
texOff = 0
|
||||||
if y0 < 0 or y1 > screenHeight:
|
if y0 < 0 or y1 > screenHeight:
|
||||||
texOff += int((-y0/2) * srcHeight / dstHeight)
|
texOff = -y0 / 2.0 * srcHeight / dstHeight
|
||||||
|
r = int(((texOff*2) % 1) * dstHeight) # the "*2" here is because each byte stores 2 pixels
|
||||||
|
if (texOff % 1) >= 0.5:
|
||||||
|
cmds.append("L")
|
||||||
|
cmds.append("<")
|
||||||
|
b = 2
|
||||||
|
#print("y0=%d texOff=%.3f r=%d b=%d" % (y0, texOff, r, b))
|
||||||
|
texOff = int(texOff)
|
||||||
y0 = max(0, y0)
|
y0 = max(0, y0)
|
||||||
y1 = min(screenHeight, y1)
|
y1 = min(screenHeight, y1)
|
||||||
|
|
||||||
@@ -207,13 +214,11 @@ for dstHeight in range(128,192,4):
|
|||||||
for dstHeight in range(192,256,8):
|
for dstHeight in range(192,256,8):
|
||||||
makeCmds(dstHeight)
|
makeCmds(dstHeight)
|
||||||
|
|
||||||
# Create the jump tables for sizes 0..127, 128..255
|
# Create the jump table
|
||||||
dstHeight = 0
|
dstHeight = 0
|
||||||
for h in range(0, 256, 2):
|
for h in range(0, 256, 2):
|
||||||
if h == 0:
|
if h == 0:
|
||||||
outFile.write("expand_vec1:\n")
|
outFile.write("expand_vec:\n")
|
||||||
elif h == 128:
|
|
||||||
outFile.write("\nexpand_vec2:\n")
|
|
||||||
if h in dstHeights:
|
if h in dstHeights:
|
||||||
dstHeight = h
|
dstHeight = h
|
||||||
outFile.write(" .addr expand_%d\n" % dstHeight)
|
outFile.write(" .addr expand_%d\n" % dstHeight)
|
||||||
|
@@ -215,8 +215,8 @@ function prepCast(angleNum, x)
|
|||||||
//
|
//
|
||||||
var scaleFactor = 1.116;
|
var scaleFactor = 1.116;
|
||||||
|
|
||||||
rayDirX = (rayDirX / scaleFactor) * 128;
|
rayDirX = (rayDirX / scaleFactor) * 127;
|
||||||
rayDirY = (rayDirY / scaleFactor) * 128;
|
rayDirY = (rayDirY / scaleFactor) * 127;
|
||||||
|
|
||||||
rayDirX = ubyte(Math.round(rayDirX) & 0xFF);
|
rayDirX = ubyte(Math.round(rayDirX) & 0xFF);
|
||||||
rayDirY = ubyte(Math.round(rayDirY) & 0xFF);
|
rayDirY = ubyte(Math.round(rayDirY) & 0xFF);
|
||||||
|
@@ -6,7 +6,7 @@ NLINES = 128
|
|||||||
SKY_COLOR_E = $11 ; blue
|
SKY_COLOR_E = $11 ; blue
|
||||||
SKY_COLOR_O = $11 ; blue
|
SKY_COLOR_O = $11 ; blue
|
||||||
GROUND_COLOR_E = $14 ; orange
|
GROUND_COLOR_E = $14 ; orange
|
||||||
GROUND_COLOR_O = $00 ; black
|
GROUND_COLOR_O = $10 ; hi-bit black
|
||||||
TEX_SIZE = $555 ; 32x32 + 16x16 + 8x8 + 4x4 + 2x2 + 1x1
|
TEX_SIZE = $555 ; 32x32 + 16x16 + 8x8 + 4x4 + 2x2 + 1x1
|
||||||
|
|
||||||
; Byte offset for each pixel in the blit unroll
|
; Byte offset for each pixel in the blit unroll
|
||||||
@@ -59,7 +59,7 @@ resetVec = $3F2
|
|||||||
;---------------------------------
|
;---------------------------------
|
||||||
; The following are all in aux mem...
|
; The following are all in aux mem...
|
||||||
expandVec = $800 ; size of expansion code: $30E9
|
expandVec = $800 ; size of expansion code: $30E9
|
||||||
textures = $3900
|
textures = $4000
|
||||||
; back to main mem
|
; back to main mem
|
||||||
;---------------------------------
|
;---------------------------------
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user