コード例 #1
0
ファイル: los.go プロジェクト: genbattle/haunts
func (gdt *gameDataTransient) alloc() {
	if gdt.los.denizens.tex != nil {
		return
	}
	gdt.los.denizens.tex = house.MakeLosTexture()
	gdt.los.intruders.tex = house.MakeLosTexture()
	gdt.los.full_merger = make([]bool, house.LosTextureSizeSquared)
	gdt.los.merger = make([][]bool, house.LosTextureSize)
	for i := range gdt.los.merger {
		gdt.los.merger[i] = gdt.los.full_merger[i*house.LosTextureSize : (i+1)*house.LosTextureSize]
	}

	gdt.comm.script_to_game = make(chan interface{}, 1)
	gdt.comm.game_to_script = make(chan interface{}, 1)

	gdt.script = &gameScript{}
	base.Log().Printf("script = %p", gdt.script)
}
コード例 #2
0
ファイル: move.go プロジェクト: genbattle/haunts
func (a *Move) RenderOnFloor() {
	if a.ent == nil {
		return
	}
	if path_tex == nil {
		path_tex = house.MakeLosTexture()
	}
	path_tex.Remap()
	path_tex.Bind()
	gl.Color4ub(255, 255, 255, 128)
	base.EnableShader("path")
	base.SetUniformF("path", "threshold", float32(a.threshold)/255)
	base.SetUniformF("path", "size", house.LosTextureSize)
	texture.RenderAdvanced(0, 0, house.LosTextureSize, house.LosTextureSize, 3.1415926535, false)
	base.EnableShader("")
}