Documentation
¶
Overview ¶
Package geodata
These are data files which store information for the game like localization strings, weapons data and globe terrain.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Polygon ¶
type Polygon struct {
// First X coordinate/longitude
X0 int `struct:"int16"`
// First Y coordinate/latitude
Y0 int `struct:"int16"`
// Second X coordinate/longitude
X1 int `struct:"int16"`
// Second Y coordinate/latitude
Y1 int `struct:"int16"`
// Third X coordinate/longitude
X2 int `struct:"int16"`
// Third Y coordinate/latitude
Y2 int `struct:"int16"`
// Fourth* X coordinate/longitude
X3 int `struct:"int16"`
// Fourth* Y coordinate/latitude
Y3 int `struct:"int16"`
// Terrain Type/Texture 0-12
Terrain int `struct:"int32"`
}
func (*Polygon) Type ¶
func (p *Polygon) Type() PolygonType
type WorldFile ¶
type WorldFile struct {
Polygons []Polygon
}
WorldFile describes the terrain on the geoscape screen using quadrilateral polygons and triangles loaded from GEODATA/WORLD.DAT.
The first 16 bytes of file contain the points for the polygon. 4 sets of 2 short (2-byte) integers, designating the 'X' and 'Y' coordinate (or longitude and latitude respectively, if you prefer). If the last set has an x value of -1 then it is to be rendered as a triangle, otherwise it is a quad.
The last 4 bytes in the record contain the terrain type. This could be a long integer or 2 short integers as the last 2 bytes in each record are 0.
See https://www.ufopaedia.org/index.php/WORLD.DAT for more information.