Skip to content

Commit 3006dd1

Browse files
committed
Scale notifications
1 parent aebc217 commit 3006dd1

2 files changed

Lines changed: 1 addition & 15 deletions

File tree

main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func runLoop(vid *video.Video) {
5555
menu.Render()
5656
}
5757
input.ProcessActions()
58-
vid.RenderNotifications()
58+
menu.RenderNotifications()
5959
glfw.SwapInterval(1)
6060
vid.Window.SwapBuffers()
6161
}

video/video.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import (
1414
"github.com/go-gl/glfw/v3.2/glfw"
1515
"github.com/kivutar/glfont"
1616
"github.com/libretro/ludo/libretro"
17-
"github.com/libretro/ludo/notifications"
1817
"github.com/libretro/ludo/settings"
1918
"github.com/libretro/ludo/state"
2019
)
@@ -269,19 +268,6 @@ func (video *Video) FullViewport() {
269268
gl.Viewport(0, 0, int32(w), int32(h))
270269
}
271270

272-
// RenderNotifications draws the list of notification messages on the viewport
273-
func (video *Video) RenderNotifications() {
274-
video.FullViewport()
275-
fbw, fbh := video.Window.GetFramebufferSize()
276-
video.Font.UpdateResolution(fbw, fbh)
277-
for i, n := range notifications.List() {
278-
lw := video.Font.Width(0.7, n.Message)
279-
video.DrawRoundedRect(25, float32(80+80*i)-52, lw+35, 75, 0.25, Color{R: 0.4, G: 0.4, B: 0, A: float32(n.Frames) / 120.0})
280-
video.Font.SetColor(1, 1, 0.85, float32(n.Frames)/120.0)
281-
video.Font.Printf(45, float32(80+80*i), 0.7, n.Message)
282-
}
283-
}
284-
285271
// Render the current frame
286272
func (video *Video) Render() {
287273
if state.Global.CoreRunning {

0 commit comments

Comments
 (0)