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

[WIP] Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries #773

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

nullsystem
Copy link
Collaborator

@nullsystem nullsystem commented Oct 30, 2024

Description

TODO:

  • Try out exporting DXT5 instead of DXT1. Seems DXT5 works for spray and can deal with transparency well
  • Change importer behavior from always the same spray.vtf to also applying by filename's basename + .vtf/.vmt
  • Change settings apply behavior to be more like the others settings?
  • Spray now put into the NeoUI settings menu
    • Import button to import sprays
    • Gallery button to pick a spray from current already available set
    • An image on the left to show the current spray
    • Outputs VTF 7.4 DXT1/DXT5 format and 2 VMT files, one for UI and one general
  • Spray fix - fixed for local player's spray not showing up properly
    • The issue affected both default and custom sprays
  • Function to generate VTF 7.4 + DXT1/DXT5 image
    • This is partially because Source SDK's RGBA8888 to DXT conversion was broken, so a "custom" function is done instead
    • It just lays out the VTF headers, the 4 mipmaps from smallest to largest, then DXT1 or DXT5 block per mipmap images
    • It will use DXT5 if there's any transparency/usage of alpha values, otherwise DXT1 will be use if no alpha is needed due to the smaller size
  • NeoUI image/texture support - New Texture and ButtonTexture
    • The texture can be initialized from vmt texture, vtf texture direct, and general images like PNG or JPG
    • Makes sure image aspect ratio and fit is correct within the given bounds
  • NeoUI scrolling fixes
    • Fixed to use y-partition instead of widget indexes
    • Scrollbar is now determined by X-margin
  • New libraries usages:
    • All from: https://github.com/nothings/stb
    • stb_image.h for image reading (PNG, JPG) (used for both spray importer and NeoUI image support)
    • stb_image_resize2.h for image resizing (used for spray importer)
    • stb_dxt.h for outputting DXT1 blocks (used for spray importer)

Toolchain

  • Linux GCC Distro Native Arch/GCC 14

Linked Issues

@nullsystem nullsystem changed the title Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries [WIP] Sprays Importer/Gallery + fixed empty spray + NeoUI Texture/Image button + stb libraries Oct 30, 2024
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

Successfully merging this pull request may close these issues.

[FEATURE] Root NeoUI - Sprays
1 participant