Skip to content

Commit

Permalink
Add DrawChunkBordersDEBUG + DrawTestBlock
Browse files Browse the repository at this point in the history
+ Fix #25 by disabling culling + update F3 informations
  • Loading branch information
quentin452 committed Feb 26, 2024
1 parent c5e7500 commit 8cdb0dc
Show file tree
Hide file tree
Showing 10 changed files with 418 additions and 125 deletions.
6 changes: 3 additions & 3 deletions engine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

cpml = require("libs/cpml")

local engine = {}
engine = {}
engine.objFormat = {
{ "VertexPosition", "float", 4 },
{ "VertexTexCoord", "float", 2 },
Expand Down Expand Up @@ -116,7 +116,7 @@ end
-- create a new Scene object with given canvas output size
function engine.newScene(renderWidth, renderHeight)
love.graphics.setDepthMode("lequal", true)
local scene = {}
scene = {}

-- define the shaders used in rendering the scene
scene.threeShader = love.graphics.newShader([[
Expand Down Expand Up @@ -249,7 +249,7 @@ function engine.newScene(renderWidth, renderHeight)
)
end
end

-- renders the given func to the twoCanvas
-- this is useful for drawing 2d HUDS and information on the screen in front of the 3d scene
-- will draw threeCanvas if drawArg is not given or is true (use if you want to scale the game canvas to window)
Expand Down
4 changes: 4 additions & 0 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ gamestateWorldCreationMenu = "WorldCreationMenu"
gamestate = gamestateMainMenu

enableF3 = false
enableF8 = false
enableTESTBLOCK = false
modelalreadycreated = 0
ChunkBorderAlreadyCreated = 0

--modloader
require("src/modloader/structuremodloader")
Expand Down
Binary file added resources/assets/textures/debug/chunkborders.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/client/!draw.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ function DrawGame()
DrawF3()
end

DrawChunkBorders3D()
DrawTestBlock()
DrawCrossHair()

love.graphics.setShader()
Expand Down
Loading

0 comments on commit 8cdb0dc

Please sign in to comment.