big update, add goroutine sdl render

replace a lot of self.Screen.Draw() to self.Screen.Refresh()
This commit is contained in:
cuu
2023-01-23 14:04:11 +00:00
parent 057bcc86f1
commit 7814f9ca6f
40 changed files with 358 additions and 403 deletions

View File

@@ -16,7 +16,7 @@ import (
//"github.com/cuu/gogame/draw"
"github.com/cuu/gogame/color"
"github.com/cuu/gogame/event"
"github.com/cuu/gogame/time"
//"github.com/cuu/gogame/time"
"github.com/clockworkpi/LauncherGoDev/sysgo/UI"
"github.com/cuu/grab"
)
@@ -84,8 +84,7 @@ func (self *LoadHousePage) OnLoadCb() {
return
}
self.ClearCanvas()
self.Screen.Draw()
self.Screen.SwapAndShow()
self.Screen.Refresh()
//parts := strings.Split(self.URL,"/")
//filename := strings.TrimSpace(parts[len(parts)-1])
@@ -198,10 +197,7 @@ L:
} else {
fmt.Println(err)
self.Screen.MsgBox.SetText("Fetch house failed")
self.Screen.MsgBox.Draw()
self.Screen.SwapAndShow()
time.BlockDelay(500)
self.Screen.ShowMsg("Fetch house failed",500)
}
}
@@ -211,8 +207,7 @@ func (self *LoadHousePage) Leave() {
self.SetDownloading(false)
self.ReturnToUpLevelPage()
self.Screen.Draw()
self.Screen.SwapAndShow()
self.Screen.Refresh()
self.URL = ""
}