Skip to content

Commit

Permalink
Adapted to latest lpp-vita syntax changes.
Browse files Browse the repository at this point in the history
Adapted to latest lpp-vita syntax changes.
  • Loading branch information
Rinnegatamante committed Jul 31, 2017
1 parent 1845c7f commit d483ad4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions samples/RayCasting/raycast3d.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ local function WallRender(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y)
end
end
local function WallRenderShad(x,y,stride,top_wall,wh,cell_idx,offs)
Expand All @@ -136,7 +136,7 @@ local function WallRenderShad(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy+1, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy+1, getHeight(tmp), 0, 1.0, scale_y)
end
scale_y = wh / tile_size
drawRect(x+stride-2,x+stride+accuracy+2,y+top_wall,y+top_wall+wh,genColor(shad_r,shad_g,shad_b,doMin(255,floor_num(shad_val / scale_y))))
Expand All @@ -152,7 +152,7 @@ local function WallFloorRender(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y)
end
end
local function WallFloorRenderShad(x,y,stride,top_wall,wh,cell_idx,offs)
Expand All @@ -166,7 +166,7 @@ local function WallFloorRenderShad(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y)
end
scale_y = wh / tile_size
drawRect(x+stride-2,x+stride+accuracy+2,y+top_wall,y+top_wall+wh,genColor(shad_r,shad_g,shad_b,doMin(255,floor_num(shad_val / scale_y))))
Expand All @@ -181,7 +181,7 @@ local function WallSkyRender(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y)
end
scale_y = wh / tile_size
drawRect(x+stride,x+stride+accuracy,y+top_wall,y,floor_c)
Expand All @@ -197,7 +197,7 @@ local function WallSkyRenderShad(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y)
end
scale_y = wh / tile_size
drawRect(x+stride-2,x+stride+accuracy+2,y+top_wall,y+top_wall+wh,genColor(shad_r,shad_g,shad_b,doMin(255,floor_num(shad_val / scale_y))))
Expand All @@ -212,7 +212,7 @@ local function WallFloorSkyRender(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y)
end
drawRect(x+stride,x+stride+accuracy,y+top_wall+wh,vheight,floor_c)
drawRect(x+stride,x+stride+accuracy,y+top_wall,y,sky_c)
Expand All @@ -229,7 +229,7 @@ local function WallFloorSkyRenderShad(x,y,stride,top_wall,wh,cell_idx,offs)
else
scale_y = wh / getHeight(tmp)
scale_x = getWidth(tmp) / tile_size
drawImage(x+stride,y+top_wall+wh/2, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y, tmp)
drawImage(x+stride,y+top_wall+wh/2, tmp, offs * scale_x, 0, accuracy, getHeight(tmp), 0, 1.0, scale_y)
end
scale_y = wh / tile_size
drawRect(x+stride-2,x+stride+accuracy+2,y+top_wall,y+top_wall+wh,genColor(shad_r,shad_g,shad_b,doMin(255,floor_num(shad_val / scale_y))))
Expand Down

0 comments on commit d483ad4

Please sign in to comment.