Skip to content

Commit

Permalink
fix: info logging updated to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kyjor committed Dec 29, 2024
1 parent fa65bb6 commit e133748
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/Main.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ module MainLoop
end

if !this.shouldChangeScene
@info "Closing window"
@debug "Closing window"
SDL2.SDL_DestroyRenderer(JulGame.Renderer::Ptr{SDL2.SDL_Renderer})
SDL2.SDL_DestroyWindow(this.window)
SDL2.Mix_Quit()
Expand Down Expand Up @@ -188,7 +188,7 @@ module MainLoop

if this.scene.camera !== nothing
this.scene.camera.startingCoordinates = Math.Vector2f(round(x/2) - round(this.scene.camera.size.x/2*this.zoom), round(y/2) - round(this.scene.camera.size.y/2*this.zoom))
@info string("Set viewport to: ", this.scene.camera.startingCoordinates)
@debug string("Set viewport to: ", this.scene.camera.startingCoordinates)
SDL2.SDL_RenderSetViewport(JulGame.Renderer::Ptr{SDL2.SDL_Renderer}, Ref(SDL2.SDL_Rect(this.scene.camera.startingCoordinates.x, this.scene.camera.startingCoordinates.y, round(this.scene.camera.size.x*this.zoom), round(this.scene.camera.size.y*this.zoom))))
end

Expand Down Expand Up @@ -232,7 +232,7 @@ module MainLoop

if this.scene.camera !== nothing
this.scene.camera.startingCoordinates = Math.Vector2f(round(size.x/2) - round(this.scene.camera.size.x/2*this.zoom), round(size.y/2) - round(this.scene.camera.size.y/2*this.zoom))
@info string("Set viewport to: ", this.scene.camera.startingCoordinates)
@debug string("Set viewport to: ", this.scene.camera.startingCoordinates)
SDL2.SDL_RenderSetViewport(JulGame.Renderer::Ptr{SDL2.SDL_Renderer}, Ref(SDL2.SDL_Rect(this.scene.camera.startingCoordinates.x, this.scene.camera.startingCoordinates.y, round(this.scene.camera.size.x*this.zoom), round(this.scene.camera.size.y*this.zoom))))
end

Expand Down Expand Up @@ -590,7 +590,7 @@ function game_loop(this::Main, startTime::Ref{UInt64} = Ref(UInt64(0)), lastPhys
try
JulGame.update(entity, deltaTime)
if this.close && !this.isGameModeRunningInEditor
@info "Closing game"
@debug "Closing game"
return
end
catch e
Expand Down
4 changes: 2 additions & 2 deletions src/editor/JulGameEditor/Components/ComponentInputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,7 @@ function show_screenbutton_fields1(screenButton)
elseif fieldString == "buttonUpSpritePath"
imageMenuValue = display_files(joinpath(JulGame.BasePath, "assets", "images"), "images", "button up")
if imageMenuValue != ""
@info String("loading button up: $imageMenuValue")
@debug String("loading button up: $imageMenuValue")
# remove joinpath("assets", "images") from imageMenuValue and set it to imagePath
imagePath = replace(imageMenuValue, joinpath(JulGame.BasePath, "assets", "images") => "")
# remove leading / or \\ from imagePath
Expand All @@ -455,7 +455,7 @@ function show_screenbutton_fields1(screenButton)
elseif fieldString == "buttonDownSpritePath"
imageMenuValue = display_files(joinpath(JulGame.BasePath, "assets", "images"), "images", "button down")
if imageMenuValue != ""
@info String("loading button up: $imageMenuValue")
@debug String("loading button up: $imageMenuValue")
# remove joinpath("assets", "images") from imageMenuValue and set it to imagePath
imagePath = replace(imageMenuValue, joinpath(JulGame.BasePath, "assets", "images") => "")
# remove leading / or \\ from imagePath
Expand Down
12 changes: 6 additions & 6 deletions src/editor/JulGameEditor/Editor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ module Editor
end

if JulGame.InputModule.get_button_held_down(currentSceneMain.input, "LCTRL") && JulGame.InputModule.get_button_pressed(currentSceneMain.input, "S")
@info string("Saving scene")
@debug string("Saving scene")
events["Save"]()
end
# delete selected entity
Expand All @@ -536,13 +536,13 @@ module Editor
if JulGame.InputModule.get_button_held_down(currentSceneMain.input, "LCTRL") && JulGame.InputModule.get_button_held_down(currentSceneMain.input, "LSHIFT") && JulGame.InputModule.get_button_pressed(currentSceneMain.input, "D") && currentSceneMain.selectedEntity !== nothing
duplicationMode = !duplicationMode
if duplicationMode
@info "Duplication mode on"
@debug "Duplication mode on"
copy = deepcopy(currentSceneMain.selectedEntity)
copy.id = JulGame.generate_uuid()
push!(currentSceneMain.scene.entities, copy)
currentSceneMain.selectedEntity = copy
else
@info "Duplication mode off"
@debug "Duplication mode off"
JulGame.destroy_entity(currentSceneMain, currentSceneMain.selectedEntity)
end
end
Expand Down Expand Up @@ -582,7 +582,7 @@ module Editor
end
catch e
backup_file_name = backup_file_name = "$(replace(currentSceneName, ".json" => ""))-backup-$(replace(Dates.format(Dates.now(), "yyyy-mm-ddTHH:MM:SS"), ":" => "-")).json"
@info string("Backup file name: ", backup_file_name)
@debug string("Backup file name: ", backup_file_name)
SceneWriterModule.serialize_entities(currentSceneMain.scene.entities, currentSceneMain.scene.uiElements, gameCamera, currentSelectedProjectPath[], backup_file_name)
Base.show_backtrace(stderr, catch_backtrace())
@warn "Error in renderloop!" exception=e
Expand Down Expand Up @@ -611,7 +611,7 @@ module Editor
file = top_frame.file
line = top_frame.line
else
@info("Stack trace is empty.")
@debug("Stack trace is empty.")
end

log_exceptions(error_location, latest_exceptions, e, "$(file):$(line)", is_test_mode)
Expand Down Expand Up @@ -689,7 +689,7 @@ module Editor
end
end

@info "Saved config file to $(filename)"
@debug "Saved config file to $(filename)"
end

function load_project_config(currentSelectedProjectPath)
Expand Down
2 changes: 1 addition & 1 deletion src/editor/JulGameEditor/Utils/EditorUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function init_sdl_and_imgui(windowTitle::String)
ver = pointer(SDL2.SDL_version[SDL2.SDL_version(0,0,0)])
SDL2.SDL_GetVersion(ver)
global sdlVersion = string(unsafe_load(ver).major, ".", unsafe_load(ver).minor, ".", unsafe_load(ver).patch)
@info "SDL version: $(sdlVersion)"
@debug "SDL version: $(sdlVersion)"
sdlVersion = parse(Int32, replace(sdlVersion, "." => ""))

ctx = CImGui.CreateContext()
Expand Down
4 changes: 2 additions & 2 deletions src/engine/SceneManagement/SceneWriter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module SceneWriterModule
"""
function serialize_entities(entities::Array, uiElements::Array, camera, projectPath, sceneName)
@info String("Serializing entities")
@debug String("Serializing entities")
entitiesDict = []
uiElementsDict = []

Expand Down Expand Up @@ -70,7 +70,7 @@ module SceneWriterModule
)
try
name = split(sceneName,".")[1]
@info "writing to $(joinpath(projectPath, "scenes", "$(sceneName)"))"
@debug "writing to $(joinpath(projectPath, "scenes", "$(sceneName)"))"

open(joinpath(projectPath, "scenes", "$(name)-saving"), "w") do io
JSON3.pretty(io, entitiesJson)
Expand Down
2 changes: 1 addition & 1 deletion src/engine/UI/TextBox.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ module TextBoxModule
end

function UI.load_font(this::TextBox, basePath::String, fontPath::String)
@info string("loading font from $(basePath)\\$(fontPath)")
@debug string("loading font from $(basePath)\\$(fontPath)")
this.font = CallSDLFunction(SDL2.TTF_OpenFont, joinpath(basePath, fontPath), this.fontSize)
if this.font == C_NULL
error("Failed to load font")
Expand Down

0 comments on commit e133748

Please sign in to comment.