mirror of
https://github.com/Kugelschieber/go-game.git
synced 2026-01-18 06:40:28 +00:00
Removed shader, added 3D rendering (no demo yet, coming next), started bitmap font rendering, a few fixes and improvements.
This commit is contained in:
18
res_util.go
18
res_util.go
@@ -21,3 +21,21 @@ func GetTex(name string) (*Tex, error) {
|
||||
|
||||
return tex, nil
|
||||
}
|
||||
|
||||
// Finds and returns a Ply resource.
|
||||
// If not found or when the resource is of wrong type, an error will be returned.
|
||||
func GetPly(name string) (*Ply, error) {
|
||||
res := GetResByName(name)
|
||||
|
||||
if res == nil {
|
||||
return nil, errors.New("Resource not found")
|
||||
}
|
||||
|
||||
ply, ok := res.(*Ply)
|
||||
|
||||
if !ok {
|
||||
return nil, errors.New("Resource was not of type *Ply")
|
||||
}
|
||||
|
||||
return ply, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user