Open main menu

UESPWiki β

Daggerfall Mod:DFRemake/DFEGetFirst3dMemblock

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

integer DFEGetFirst3dMemblock ( DWORD MemblockPtr )Edit

InputsEdit

  • MemblockPtr: The pointer to a memblock from the GET MEMBLOCK PTR command.

OutputsEdit

Returns -1 if there are no objects to iterate through. On success the result is a combination of the texture and image indices:

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

DescriptionEdit

Use this function to start iterating through all faces with the same texture in the current 3d object. On success, the given memblock will contain object data for all faces with the same texture image. Memblocks should be allocated with the DFEGet3dSize() function (which will over-allocate which is fine). See DFEGetNext3dMemblock for more information.

ExampleEdit

  Local ErrResult  as integer
  Local Size       as DWORD
  local TexValue   as integer
  Local TexIndex   as DWORD
  Local ImageIndex as DWORD
  
  Size = DFEGet3dObjectSize()
  make memblock 1, Size
  
  TexValue   = DFEGetFirst3dMemblock(get memblock ptr(1))
  if (TexValue = 1) then End
  TexIndex   = TexValue >> 16
  ImageIndex = TexValue && 65535