Skip to content

[TRANSFER STATE NOTE] Last state on transfer of repository #2

Description

@TheRedDaemon

Intention was basically a state based render API.

Basically done already:

  • state system
  • text
  • simple form and pixel draws

Open:

  • Texture not yet started
    • Idea was to allow laoding GM1s and TGX into a state holder, allowing to manage resources for this. The would be freed on request or if the context would be returned.
    • Intended to prototype the struct in SHCResourceConverterCLI (which also contains them). Idea there was to not really do anything, just load them into memory together with a known struct that receives ptr to the specific parts of the file. For the unique ptr loader that would do this, also see SHCResourceConverterCLI.
  • no handing to place something in "map"-space
    • Maybe this should also not be task of this API?
  • There is a flag in many texture drawers that switches between a logic that can draw on both offscreen surfaces (menu and in-game) and one that only draws on map. What does it do?

Would need a lot of research still.
Uses C++-modules. Support as of now for them is so so.


My notes file for interesting functions. Not original, German notes are translated.

TextFunctions:
- TextManager: 02157578
  - check purpose of this->field12_0x30
  - field2_0x8 and field3_0xc might be x range borders
  - textSurfaceTarget_0x1c ? 
- renderInGameText: 00424420
- renderInGameText: 00475e00
- renderMultilineText?: 00424500
- renderMultilineText?: 00473a70
- renderMultilineText?: 00424580
- renderMultilineText?: 00473ac0
- renderNumber: 00474390
- renderNumberToScreen: 00474430
- renderTextFromTextGroup: 00424470
- renderTextToScreen: 00474250
--> DONE FOR NOW

TextureRender:
- TextureRenderCore: 01fea090
  - drawBufferChoiceValue?_0x4 and currentRenderSurfaceIdentifier?_0x8 should both be saved and set?
  - what does drawBufferChoiceValue?_0x4 actually do, considering almost all functions override it?
  - rendering Rect
  - both hight ranges
  - TextureRenderCoreObj.field54_0x54 has implications for the rendering, if it is 1, it can only render to the game/map surface... but why?
- drawBitmapFace: 0044cd40
- drawBitmapFace: 0044ceb0
- renderFacesSmall?: 0044ce00
- drawGfxOnFlaggedSurface: 004558e0
- drawGfxOnFlaggedSurface: 00454a60
- drawTgxGmOnFlaggedSurface: 004554a0
- loadGfxFile: 00454620
  - the buffer is reseted by setting the specific index to 0, overflows can happen
- loadGfxAtBufferEnd: 004547c0
  - the buffer is reseted by setting the specific index to 0, overflows can happen
- renderFunctionResponsibleForManyGameObjects: 0044d3d0
- renderGfxTgxWithBlending: 004549f0
- renderGM: 00455300
- renderGMWithAlphaMask: 004557b0
- renderGMWithBlending: 00455390
- renderInterfaceOrBuildingOccupationArea: 0044e630
- renderLoadedGfx: 00454900
  - this one sets drawBufferChoiceValue, which in turns seems to be the lowest level: everything (text, texture and pencil) seem to have their own target setting, but this seems to be the lowest
  - using only the high level parts, I probably would not need to care about drawBufferChoiceValue, but since I expose lower levels, it might be needed
- renderTgxWithColor?: 0044f6f0
- renderTgxWithColorAndBlending?: 0044f850
- renderUnitAnimation?: 0044fbf0
- renderUnitAnimationWithBlending?: 00451e00

-> With Enough work, I can create a generic resource loader for GM and tgx and functions to freely use them
-- GM loading can be complicated
--- I already did this for the replacer -> either copy logic or use the GM replacer in some way:
---- alternative -> special resource loader to handle resources (GM, TGX) and exposes metadata
---- the gm resource might also be changed to hold an array of single image resources (although, these are not optimized for swapping, which could be a problem regarding the swapper)
----- no doupt, all those jumps would make the coping really slow
-- maybe a copy of the code would be ok?
-- maybe the replacer could be extended or superceeded?

Pencil (AndMenuStuff?):
- PencilRenderCore: 0191d720
  - wichtig sind hier
- dimBox: 00471050
- drawBlendedBlackBox: 00471000
- drawBorderBox: 004711b0
- drawBorderedBoxWithBlendedBackground: 00471340
- drawBorderedBoxWithBlendedBackground: 00471440
- drawBoxWithRoundedEdges: 00470ee0
- drawBoxWithRoundedEdges: 004710a0
- drawColorBox: 00470e90
- drawLine: 00472b20

What to do with these, since they are more menu, but use values from the renderer?
- drawScrollbar: 004690e0
- drawHeaderBanner: 00468fe0
- drawHeaderTextBanner: 00475cc0

Those rely on menu globals and PencilRenderCore?:
- drawTableCellBackground: 004692e0
- renderUpDownButton?: 00469290

Utility:
- computeTextWidth: 00471690
- computeTextWidth: 004246b0

Bink?:
???

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions