Open main menu

UESPWiki β

Daggerfall Mod:DFRemake/DFEGetNext3dTexture

< Mod / Daggerfall: Daggerfall Mod: DFRemake(Redirected from Daggerfall:DFRemake/DFEGetNext3dTexture)

integer DFEGetNext3dTexture ( )Edit

InputsEdit

None

OutputsEdit

Returns -1 if there are no textures left to iterate through in the current object. On success the combined texture and image indices are returned in the format:

    Bytes 0-1: ImageIndex
    Bytes 2-3: TextureIndex

DescriptionEdit

Use this function to continue iterating through all textures in the current 3d object file after an initial call to DFEGetFirst3dTexture. These functions can be used to pre-load the textures used in a DF object.

NotesEdit

These two functions are used since it is impossible/difficult to construct a single object using multiple diffuse textures in DarkBasic. To get around this, 3d objects in DB are constructed using a base object for the first texture, and then limbs for each additional texture used in the object. This lets the model be handled as a single object but easily allow multiple textures.

ExampleEdit

Local TexValue   as integer
Local TexIndex   as DWORD
Local ImageIndex as DWORD

TexValue = DFEGetFirst3dTexture()

while ( TexValue <> -1)
   TexIndex   = TexValue >> 16
   ImageIndex = TexValue && 65535
 
   print "Object uses texture ", TexIndex, " image ", ImageIndex
   TexValue = DFEGetNext3dTexture()
endwhile