SCI Kernel Documentation/Resource Functions

From SCI Wiki
Revision as of 00:16, 3 December 2015 by Andrew Branscom (talk | contribs)
Jump to navigationJump to search

Official SCI Documentation

Chapter: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | Index


Resource Functions

Author: Jeff Stephenson

Revision by: David Slayback

 


Resource Functions

Resources are the various components of a game: views, pictures, scripts, etc. and, except for the MEMORY resource, reside on disk, waiting to be loaded when needed. Resources are handled automatically by the kernel, but several functions are provided to allow the programmer a bit more control over how the handling is done.


(Load resType resID)

Loads a resource of type resType and ID (number) resID into hunk space. While any attempt to use a resource which is not loaded will cause the resource to be loaded, it is not generally a good idea to rely on this as it may cause a disk-access delay in the midst of a crucial animation sequence. It is best to do an explicit Load of all resources during the initialization phase of a room to insure that everything is in memory. The resource types are:

VIEW
PICTURE
SCRIPT
TEXT
SOUND
MEMORY (used internally by the kernel)
VOCAB (used internally by the kernel)
FONT
CURSOR

Example: (Load SCRIPT forest) loads the script whose number is in the variable forest into memory.


(UnLoad resType resID)



 

Notes


 

Table of Contents

 

< Previous: SCI OverviewNext: List Functions >