BakePortrait
function · ui · orchestration
- Address
0x524f60· 2355 bytes, up to0x525892- Meaning
- Draws a unit's model into a cached 64 by 64 texture and binds it to a widget
- Confidence
- verified, proof one
- Finding
- ui/portraits#the-bake
- Test
ui::glue_512_524f60_scale_ratios
Finding: The bake in ui: unit portraits
The bake draws a fresh copy of the unit's model (0x707400 of the model +0xd8) in a new scene (0x706e10), with the attachments removed (0x47a230) and the animation set to sequence 0 (0x7121a0). The lights are an ambient 0.45 grey and a white directional light along (-1, 0, -1) (callback 0x525b10).
The camera is the model's own camera 0 (0x713540), built with 0x7ada40 over a rectangle (0, 0, 1, D). The viewport is 64 by 64 pixels in the corner of the render surface. The surface is cleared to 0, the scene is drawn twice (passes 0 and 1), the corner is read back into the texture Portrait1, and the device's matrices and viewport are restored.
The derivation is in the doc.
Callers 2
Callees 48
- _atexit crt
- UnscaleScreenXY screencoord
- MultiplyByScreenScaleX screencoord
- MultiplyByScreenScaleY screencoord
- TextureCreateWithCallback gx
- GetTextureDeviceObject gx
- UpdateCharacterComponent charactermodel
- DetachAllItemModels charactermodel
- MarkPortraitDirty ui
- GetPortraitAlphaMask ui
- AddNode526ad0 ui
- AddNode526d70 ui
- LinkOrEnd5272b0 ui
- LinkOrEnd527360 ui
- 0x589cf0 gx
- GxMasterEnableSet gx
- 0x58a210 gx
- GxCapsScreenSize gx
- 0x58a260 gx
- 0x58a280 gx
- SetClearColorDevice gx
- ClearDevice gx
- CGxTexFlags::CGxTexFlags gx
- GxTexMarkRectDirty gx
- SetDeviceViewport gx
- SetDeviceProjection gx
- SetDeviceView gx
- GetDeviceViewport gx
- GetDeviceProjection gx
- GetDeviceView gx
- M2CreateScene models
- M2SceneRelease models
- CreateModelFromModel models
- M2SceneAnimateAndCollect models
- M2SceneDraw models
- HandleClose2 models
- CM2Model::IsLoaded models
- CM2Model::IsReady models
- CM2Model::SetAnimated models
- CM2Model::SetVisible models
- CM2Model::PlayAnimation models
- CM2Model::SetLightingCallback models
- CM2Model::GetCameraCount models
- CM2Model::GetCameraById models
- CSimpleTexture::SetTexture ui
- CSimpleTexture::SetImage ui
- GetVectorProperty camera
- CameraSetDeviceTransforms camera
Calls and jumps by a bare address, from tables/calls.tsv.