Documentation ¶
Index ¶
- Constants
- Variables
- func InsideWorld(size int32, vector Vector) bool
- func LoadDefaultSlots(map_ *GameMap) error
- func LoadPartial(p *gIO.Buffer, header Header) (worldio.MapState, error)
- func MapToCXX(cube *Cube) worldio.Cube
- func SaveChildren(p *io.Buffer, cube *Cube, size int32) error
- func SavePartial(p *io.Buffer, header Header, state worldio.MapState) error
- type BVec
- type CCube
- type Cube
- type Entity
- type FileHeader
- type GameMap
- type Header
- type IVec2
- type MergeCompat
- type NewFooter
- type NormalsCompat
- type OldFooter
- type Slot
- type SlotShaderParam
- type SurfaceCompat
- type SurfaceInfo
- type TexSlot
- type VSlot
- type Vec2
- type Vector
Constants ¶
View Source
const ( LMID_AMBIENT byte = 0 LMID_AMBIENT1 LMID_BRIGHT LMID_BRIGHT1 LMID_DARK LMID_DARK1 LMID_RESERVED )
View Source
const ( LAYER_TOP byte = (1 << 5) LAYER_BOTTOM = (1 << 6) LAYER_DUP = (1 << 7) LAYER_BLEND = LAYER_TOP | LAYER_BOTTOM MAXFACEVERTS = 15 )
View Source
const ( ET_EMPTY byte = iota ET_LIGHT = iota ET_MAPMODEL = iota ET_PLAYERSTART = iota ET_ENVMAP = iota ET_PARTICLES = iota ET_SOUND = iota ET_SPOTLIGHT = iota ET_GAMESPECIFIC = iota )
View Source
const ( OCTSAV_CHILDREN byte = iota OCTSAV_EMPTY = iota OCTSAV_SOLID = iota OCTSAV_NORMAL = iota OCTSAV_LODCUB = iota )
View Source
const ( VSLOT_SHPARAM byte = iota VSLOT_SCALE = iota VSLOT_ROTATION = iota VSLOT_OFFSET = iota VSLOT_SCROLL = iota VSLOT_LAYER = iota VSLOT_ALPHA = iota VSLOT_COLOR = iota VSLOT_NUM = iota )
View Source
const ( MATF_INDEX_SHIFT = 0 MATF_VOLUME_SHIFT = 2 MATF_CLIP_SHIFT = 5 MATF_FLAG_SHIFT = 8 MATF_INDEX = 3 << MATF_INDEX_SHIFT MATF_VOLUME = 7 << MATF_VOLUME_SHIFT MATF_CLIP = 7 << MATF_CLIP_SHIFT MATF_FLAGS = 0xFF << MATF_FLAG_SHIFT MAT_AIR = 0 // the default, fill the empty space with air MAT_WATER = 1 << MATF_VOLUME_SHIFT // fill with water, showing waves at the surface MAT_LAVA = 2 << MATF_VOLUME_SHIFT // fill with lava MAT_GLASS = 3 << MATF_VOLUME_SHIFT // behaves like clip but is blended blueish MAT_NOCLIP = 1 << MATF_CLIP_SHIFT // collisions always treat cube as empty MAT_CLIP = 2 << MATF_CLIP_SHIFT // collisions always treat cube as solid MAT_GAMECLIP = 3 << MATF_CLIP_SHIFT // game specific clip material MAT_DEATH = 1 << MATF_FLAG_SHIFT // force player suicide MAT_ALPHA = 4 << MATF_FLAG_SHIFT // alpha blended )
View Source
const ( F_EMPTY uint32 = 0 F_SOLID = 0x80808080 )
View Source
const ( DEFAULT_SKY = iota DEFAULT_GEOM )
hardcoded texture numbers
View Source
const CUBE_FACTOR = 8
Variables ¶
View Source
var DEFAULT_MAP_SLOTS []byte
This is generated using: sourdump -type cfg -index default.textures data/default_map_settings.cfg (that is not the full command, you should be able to infer it though)
Functions ¶
func InsideWorld ¶
func LoadDefaultSlots ¶
Types ¶
type Cube ¶
type Cube struct { Children []*Cube SurfaceInfo [6]SurfaceInfo Edges [12]byte Texture [6]uint16 Material uint16 Merged byte Escaped byte }
func (*Cube) EmptyFaces ¶
func (c *Cube) EmptyFaces()
func (*Cube) IsEntirelySolid ¶
func (*Cube) SolidFaces ¶
func (c *Cube) SolidFaces()
type FileHeader ¶
type GameMap ¶
type GameMap struct { Header Header Entities []Entity Vars V.Variables WorldRoot *Cube VSlots []*VSlot C worldio.MapState }
func BasicsFromGZ ¶
func DecodeBasics ¶
type Header ¶
type NormalsCompat ¶
type NormalsCompat struct {
Normals [4]BVec
}
type SlotShaderParam ¶
type SurfaceCompat ¶
type SurfaceInfo ¶
func (*SurfaceInfo) TotalVerts ¶
func (surface *SurfaceInfo) TotalVerts() byte
type VSlot ¶
type VSlot struct { Index int32 Changed int32 Layer int32 Next *VSlot Slot *Slot Params []SlotShaderParam Linked bool Scale float32 Rotation int32 Offset IVec2 Scroll Vec2 AlphaFront float32 AlphaBack float32 ColorScale Vector GlowColor Vector }
func VSlotsToGo ¶
func (*VSlot) AddVariant ¶
Click to show internal directories.
Click to hide internal directories.