Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract controller icon modes & autogenerate them & add slots for custom icons #49

Open
xan1242 opened this issue Feb 2, 2023 · 0 comments
Assignees

Comments

@xan1242
Copy link
Owner

xan1242 commented Feb 2, 2023

Abstract controller icons

Currently the hardcoded icons have to be manually put in the code due to the nature of hashes.

This step can be automated and abstracted to its own header file before compilation. It will ensure easier modification and/or expansion of the hardcoded controller icon pool.

Here's an example of one part of it being abstracted - TPK generation.

This is the first version of the script.

@echo off
:: TPK Generator for XNFSTPKTool
set ININAME=test.ini

ECHO [TPK]> %ININAME%
ECHO Name = XTENDEDINPUTBUTTONS>> %ININAME%
<nul (set/p nlv=Version = 4)>> %ININAME%
ECHO(>> %ININAME%
ECHO Filename = XtendedInputButtons>> %ININAME%
<nul (set/p nlv=FilenameHash = 0x)>> %ININAME%
strhash XtendedInputButtons>> %ININAME%
ECHO(>> %ININAME%
<nul (set/p nlv=Animations = 0)>> %ININAME%
ECHO(>> %ININAME%
ECHO(>> %ININAME%
FOR /R . %%T IN (*.dds) DO (
<nul (set/p nlv=[)>> %ININAME%
strhash %%~nT>> %ININAME%
ECHO ] >> %ININAME%
ECHO File = %%~dpnT.dds>> %ININAME%
ECHO Name = %%~nT>> %ININAME%
ECHO ClassNameHash = 0x1A93CF >> %ININAME%
ECHO ImageCompressionType = 0x24 >> %ININAME%
ECHO PaletteCompressionType = 0x0 >> %ININAME%
ECHO NumPaletteEntries = 0 >> %ININAME%
ECHO TilableUV = 0 >> %ININAME%
ECHO BiasLevel = 0 >> %ININAME%
ECHO RenderingOrder = 5 >> %ININAME%
ECHO ScrollType = 0 >> %ININAME%
ECHO UsedFlag = 0 >> %ININAME%
ECHO ApplyAlphaSorting = 0 >> %ININAME%
ECHO AlphaUsageType = 2 >> %ININAME%
ECHO AlphaBlendType = 1 >> %ININAME%
ECHO Flags = 0x0 >> %ININAME%
ECHO ScrollTimeStep = 0 >> %ININAME%
ECHO ScrollSpeedS = 0 >> %ININAME%
ECHO ScrollSpeedT = 0 >> %ININAME%
ECHO OffsetS = 0 >> %ININAME%
ECHO OffsetT = 256 >> %ININAME%
ECHO ScaleS = 256 >> %ININAME%
ECHO ScaleT = 0 >> %ININAME%
ECHO PixelFormatUnk1 = 0x1 >> %ININAME%
ECHO PixelFormatUnk2 = 0x5 >> %ININAME%
ECHO PixelFormatUnk3 = 0x6 >> %ININAME%
ECHO( >> %ININAME%
)

Add custom slots

This would ensure users can load their own custom controller TPKs without having to edit the existing hardcoded pool (and therefore no need to recompile the program).

So for each controller button there will be an appropriate slot that can be used. This will be based on the existing DualShock 2 references in the code.

Example: CUSTOM0_CROSS, CUSTOM0_CIRCLE, CUSTOM1_CROSS, CUSTOM1_CIRCLE, etc.

@xan1242 xan1242 self-assigned this Feb 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant