1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-06-21 14:45:24 +00:00
OpenDiablo2/d2game/d2gamescreen/blizzard_intro.go
Gürkan Kaymak 473a0b3b19
Remaining lint fixes for the d2gamescreen package (#550)
* lint fixes for the game.go

* lint fixes for the gui_testing.go

* lint fixes for the blizzard_intro.go, map_engine_testing.go and select_hero_class.go

* added package comment for the d2gamescreen package

* fixes after merge
2020-07-06 20:13:55 -04:00

31 lines
786 B
Go

package d2gamescreen
import (
"github.com/OpenDiablo2/OpenDiablo2/d2common/d2data/d2video"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2asset"
"github.com/OpenDiablo2/OpenDiablo2/d2core/d2screen"
)
// BlizzardIntro represents the Blizzard Intro screen
type BlizzardIntro struct {
videoDecoder *d2video.BinkDecoder
}
// CreateBlizzardIntro creates a Blizzard Intro screen
func CreateBlizzardIntro() *BlizzardIntro {
return &BlizzardIntro{}
}
// OnLoad loads the resources for the Blizzard Intro screen
func (v *BlizzardIntro) OnLoad(loading d2screen.LoadingState) {
videoBytes, err := d2asset.LoadFile("/data/local/video/BlizNorth640x480.bik")
if err != nil {
loading.Error(err)
return
}
loading.Progress(0.5)
v.videoDecoder = d2video.CreateBinkDecoder(videoBytes)
}