Types
bsp-header: drawablesource
Fields
type: type
id: int16
bsphere: vector
info: file-info
all-visible-list: pointer
visible-list-length: int32
drawable-trees: drawable-tree-array
pat: pointer
pat-length: int32
texture-remap-table: pointer
texture-remap-table-len: int32
texture-ids: pointer
texture-page-count: int32
unk-zero-0: basic
name: symbol
nickname: symbol
vis-info: level-vis-info
actors: drawable-inline-array-actor
cameras: array
nodes: inline-array
level: level
current-leaf-idx: uint16
unk-data-2: uint16
boxes: box8s-array
current-bsp-back-flags: uint32
ambients: drawable-inline-array-ambient
unk-data-4: float
unk-data-5: float
adgifs: adgif-shader-array
actor-birth-order: pointer
split-box-indices: pointer
unk-data-8: uint32
Methods
relocate(obj: bsp-header, dest-heap: kheap, name: pointer) => nonesource
Handle a bsp file load.
birth(obj: bsp-header) => nonesource
Birth everything in the level.
deactivate-entities(obj: bsp-header) => nonesource
bsp-node: structuresource
collide-stats: structuresource
view-frustum: structuresource
Functions
inspect-bsp-tree(arg0: bsp-header, arg1: bsp-node) => nonesource
map-bsp-tree(arg0: function, arg1: bsp-header, arg2: bsp-node) => nonesource
Recursively apply arg0 to all nodes in the bsp tree
Variables
TERRAIN_BSP_SCRATCHPAD: unknownsource
VISIBLE_LIST_SCRATCHPAD: unknownsource
Functions
bsp-camera-asm(bsp-hdr: bsp-header, camera-pos: vector) => nonesource
Look up the camera position in the bsp tree.
The result is stored in the bsp-hdr current-leaf-idx
clear-cl-stat(arg0: cl-stat) => nonesource
Reset stats
level-remap-texture(tex-id: texture-id) => texture-idsource
Levels can request textures to be remapped during login
mem-usage-bsp-tree(header: bsp-header, node: bsp-node, mem-use: memory-usage-block, flags: int) => nonesource
Update the given mem-use for the memory used by the tree structure itself
print-cl-stat(arg0: cl-stat, arg1: string) => nonesource
Print stats for arg1
print-collide-stats() => nonesource
Print and reset collide stats for this frame
Variables
*test-shrub*: intsource
Types
level: basicsource
Fields
type: type
name: symbol
load-name: symbol
nickname: symbol
index: int32
status: symbol
other: level
heap: kheap
bsp: bsp-header
art-group: load-dir-art-group
info: level-load-info
texture-page: texture-page
loaded-texture-page: texture-page
loaded-texture-page-count: int32
tfrag-tex-foreground-sink-group: dma-foreground-sink-group
pris-tex-foreground-sink-group: dma-foreground-sink-group
water-tex-foreground-sink-group: dma-foreground-sink-group
foreground-sink-group: dma-foreground-sink-group
foreground-draw-engine: engine
entity: entity-links-array
ambient: entity-ambient-data-array
closest-object: float
upload-size: int32
level-distance: meters
inside-sphere?: symbol
inside-boxes?: symbol
display?: symbol
meta-inside?: symbol
mood: mood-context
mood-func: function
vis-bits: pointer
all-visible?: symbol
force-all-visible?: symbol
linking: basic
vis-info: level-vis-info
vis-self-index: int32
vis-adj-index: int32
vis-buffer: uint8
mem-usage-block: memory-usage-block
mem-usage: int32
code-memory-start: pointer
code-memory-end: pointer
texture-mask: uint32
force-inside?: symbol
pad: uint8
Methods
deactivate(obj: level) => _type_source
Kill the level. This won't remove it from memory.
is-object-visible?(obj: level, arg0: int) => symbolsource
Is arg0 visible? Note that this will return #f if the visibility data is not loaded.
add-irq-to-tex-buckets!(obj: level) => nonesource
Adds a packet that will cause a VIF interrupt to the end of all texture
buckets for a given level. This will trigger a VU1 profiler bar
unload!(obj: level) => _type_source
Unloads the level. This does not free the heap. The level will be made inactive and ready to be loaded some other time.
compute-memory-usage(obj: level, arg0: object) => memory-usage-blocksource
Compute the memory usage of a level. Arg0 will force a recalculation.
point-in-boxes?(obj: level, arg0: vector) => symbolsource
Is this point in the list of level boxes?
update-vis!(obj: level, vis-info: level-vis-info, arg1: uint, arg2: uint) => symbolsource
Update the vis-bits for the level with the given vis info.
arg1 unused. if the vis-file flag isn't set, will use arg2 as vis data.
load-continue(obj: level) => _type_source
Continue loading a level from where we left off last time.
load-begin(obj: level) => _type_source
Start loading the level. Uses 2 megabyte heaps for loading each object.
login-begin(obj: level) => _type_source
Start the login. This is spread over multiple frames.
vis-load(obj: level) => uintsource
Start the initial load of a VIS file to the IOP VIS buffer. After this is done, we can use
ramdisk-load to load chunks.
unused-21: unknown
level-status-set!(obj: level, want-status: symbol) => _type_source
Change the status of a level, performing any cleanup and prep work as necessary.
Only change loading statuses in order!
Returns the level.
load-required-packages(obj: level) => _type_source
Load required packages for the level. This is mostly useless, but might load common.
This will have no effect most of the time - common is often loaded at boot as part of
game.cgo.
debug-print-splitbox(obj: level, arg0: vector, arg1: string) => nonesource
Print the current splitbox, if we're in one.
art-group-get-by-name(obj: level, arg0: string) => art-groupsource
Get the art group in the given level with the given name.
If it doesn't exist, #f.
level-group: basicsource
Fields
type: type
length: int32
log-in-level-bsp: bsp-header
loading-level: level
entity-link: entity-links
border?: basic
vis?: basic
want-level: basic
receiving-level: basic
load-commands: pair
play?: symbol
_hack-pad: uint8
level0: level
level1: level
level-default: level
level: level
data: level
pad: uint32
Methods
level-get(obj: level-group, name: symbol) => levelsource
Return the level data using its name, if it is available. Returns #f if none are found.
level-get-with-status(obj: level-group, status: symbol) => levelsource
level-get-for-use(obj: level-group, name: symbol, want-status: symbol) => levelsource
Get a level in a playable form, loading it if necessary.
activate-levels!(obj: level-group) => intsource
Try to activate all levels.
debug-print-entities(obj: level-group, mode: symbol, expected-type: type) => nonesource
Print a table of entities. If expected-type is #f, print all. Otherwise, print only entities of the given type.
Modes:
'art-group: print art groups instead.
'entity-meters: print entity location in meters.
'entity-perm: also print entity-perm values.
debug-draw-actors(obj: level-group, arg0: symbol) => nonesource
actors-update(obj: level-group) => objectsource
level-update(obj: level-group) => intsource
level-get-target-inside(obj: level-group) => levelsource
Get the level target is in, or one it is close to.
The distance checks do not work.
alloc-levels!(obj: level-group, compact-level-heaps: symbol) => intsource
Allocate the level heaps and load the common packages for levels.
load-commands-set!(obj: level-group, load-commands: pair) => pairsource
art-group-get-by-name(obj: level-group, arg0: string) => art-groupsource
load-command-get-index(obj: level-group, name: symbol, cmd-idx: int) => pairsource
Get the n-th load command for the given level.
update-vis-volumes(obj: level-group) => nonesource
update-vis-volumes-from-nav-mesh(obj: level-group) => nonesource
Update the visvol to fit the entire nav-mesh. Does this for all actors in bsps.
Probably only used for debugging.
print-volume-sizes(obj: level-group) => nonesource
Loop through all entities and print their visibility.
Excludes crate, fuel-cell and springbox.
level-status(obj: level-group, level-name: symbol) => symbolsource
Get the status of an existing level.
level-get-most-disposable(obj: level-group) => levelsource
Get a level that's least likely to be in use right now. #f = all levels in use.
level-load-info: basicsource
Fields
type: type
name-list: symbol
index: int32
name: symbol
visname: symbol
nickname: symbol
packages: pair
sound-banks: pair
music-bank: symbol
ambient-sounds: pair
mood: symbol
mood-func: symbol
ocean: symbol
sky: symbol
sun-fade: float
continues: pair
tasks: pair
priority: int32
load-commands: pair
alt-load-commands: pair
bsp-mask: uint64
bsphere: sphere
buzzer: int32
bottom-height: meters
run-packages: pair
prev-level: basic
next-level: basic
wait-for-load: symbol
level-vis-info: basicsource
Fields
type: type
level: symbol
from-level: symbol
from-bsp: bsp-header
flags: uint32
length: uint32
allocated-length: uint32
dictionary-length: uint32
dictionary: uint32
string-block: uint32
ramdisk: uint32
vis-bits: pointer
current-vis-string: uint32
vis-string: uint32
Variables
LEVEL_COUNT: unknownsource
Variables
*level-load-list*: pairsource
const halfpipe: level-load-infosource
const jungleb: level-load-infosource
const lavatube: level-load-infosource
const sunkenb: level-load-infosource
const training: level-load-infosource
const village1: level-load-infosource
const village2: level-load-infosource
const village3: level-load-infosource
Functions
add-bsp-drawable(arg0: bsp-header, arg1: level, arg2: symbol, arg3: display-frame) => nonesource
Draw a level!
bg(level-name: symbol) => intsource
Begin game in a given level.
The level name can be the full name (village3), the nickname (vi3), or visname (village3-vis)
If the visname is used (and its a recognized level in level-info), it will use vis mode.
Otherwise, it will use the non-vis DGO name (like VILLAGE3.DGO) which will usually fail.
level-update-after-load(loaded-level: level, level-login-state: login-state) => levelsource
Run some small amount of logins.
This will time itself and stop after some time.
When it's done, it will set the status to loaded.
load-vis-info(vis-name: symbol, old-vis-name: symbol) => intsource
Load a new VIS file and dump the old one. The corresponding level must be active!
lookup-level-info(name: symbol) => level-load-infosource
Get the level-load-info of a level using its name. name can be the level name, the visname or the nickname. First match is returned.
play(use-vis: symbol, init-game: symbol) => intsource
The entry point to the actual game! This allocates the level heaps, loads some data, sets some default parameters and sets the startup level.
remap-level-name(level-info: level-load-info) => symbolsource
Get the canonical name for a level using its level-load-info