Commit graph

85 commits

Author SHA1 Message Date
marauder2k7 1b528b818e Update bitmapUtils.h
the conversion functions were making assumptions that were wrong based on mant being 0 and the out being 0 completely on small numbers also if the sign was flipped it rounded to 0. Also simplified
2026-01-02 11:37:36 +00:00
marauder2k7 848219e226 Update bitmapUtils.cpp
add conversions for packed texture formats
2026-01-01 15:07:33 +00:00
marauder2k7 7f351ef429 Restore LIBPNG for png files
Restores the use of libpng for png files as stb does not support writing out 16bit png files.
2025-12-31 11:00:07 +00:00
AzaezelX 17326b2d8c add optional mip and face lookups for gbitmap::getcolor 2025-12-22 16:45:27 -06:00
marauder2k7 3aef90a6bc Update GFXTextureManager and GBitmap
GBitmap Changes:
Added all other formats to gbitmap that we support
gbitmap now supports cubemaps
added converters for all these other formats
added stb_image_resize for extrudemips so we can extrude mipmaps for all other formats

GFXTextureManager
Can now directly make cubemaps and texture arrays based on the GFXTextureProfile
API implementations for all functions that cubemaps and arrays needed
2025-12-22 10:29:01 +00:00
AzaezelX ba18fdbe6d PROFILE_START_IF profiler macro
sig is an action, a stringtable variable, and an unquoted string to compare against
demonstrated with bitmapSTB
2025-10-16 18:11:29 -05:00
marauder2k7 ea751eb62f Update bitmapSTB.cpp 2025-05-30 04:00:45 +01:00
AzaezelX 2f19db7607 overflow avoidance 2025-05-26 15:17:01 -05:00
marauder2k7 bfe2401ebb get image metadata
adds ability to get image metadata without loading the texture
since we are using the getOwned parameter correctly now new assets must have the full path to the image file when being created
when the asset becomes owned again the image file path will be updated.
2025-03-28 11:14:21 +00:00
AzaezelX afeb957601 fix malformed GBitmap::getColor 2024-09-16 12:40:18 -05:00
Sven ada83d9a6a
Remove redundant cstdint include 2024-04-25 18:10:26 +00:00
Sven ac56258c9f
Revert "Remove redundant include" 2024-04-25 18:09:54 +00:00
Sven 51be14645d
Remove redundant include 2024-04-25 19:58:50 +02:00
Sven ba5351180b
Add cstdint to ies_loader 2024-04-25 11:27:09 +00:00
marauder2k7 33094397c2 Update bitmapSTB.cpp
stb loader was spamming NO SOI with the function of stbi_info_from_memory because it checks for a jpeg first. This will always return an error if you are sending any other format. Remove this check and just load the memory stream. if it fails to return pixeldata then we have an error.
2024-03-27 07:32:59 +00:00
Brian Roberts 05a083ca6f
Merge pull request #1234 from marauder2k9-torque/virtuals-override
Virtuals override
2024-03-21 10:43:26 -05:00
AzaezelX c337d5a9d2 clang tidy misc fixes
adress mixed || plus && concerns raised
2024-03-18 20:11:44 -05:00
marauder2k7 2b295fb7f0 rest of virtuals removed
virtuals removed and replaced with override where necessary on the rest of the code base, clang-tidy to the rescue.
2024-03-18 18:40:22 +00:00
marauder2k7 efbe5e90f5 virtuals removed
virtuals removed and replaced with override where necessary, clang-tidy to the rescue.
2024-03-18 18:13:00 +00:00
marauder2k7 e6c653c441 warnings cleanup
cleanup and some warning fixes
2024-03-14 08:28:11 +00:00
marauder2k7 6355da5df6 various fixes
STB probably shouldn't fail on failed info, just continue.
Assimp only add sequences if there are any.
Update kork chan asset.
2024-03-01 15:01:47 +00:00
marauder2k7 cd6656be35 Fix archive
Incorrect cmake directory was messing up reading from zips
STB was failing to read from zips, it was failing to get the file info, something we were using as an early out, now if that files on the filepath, we use the memory read instead since stream needs to be a success to get to that point.
2024-03-01 10:06:18 +00:00
marauder2k7 ad64b4f2df IES Loader
Updated IES loader to use torque math functions and calls in the problem areas for mac and linux.

New F32_MIN_EX which is lower than F32_MIN (required for ies profiles)
2024-02-21 09:36:37 +00:00
marauder2k7 a12d915180 Loads an IES Photometric profile.
ADDED: Ability to add IES profile as the cookie texture slot in both point lights and spot lights

TODO:
Have the IES Profile also drive the settings for the lights.
Make it work with Cookie textures. IES profiles are to be another slot in the advanced light section.
2024-02-21 06:22:37 +00:00
marauder2k7 d87199f5da Final Cleanup
-Removed LPNG
-Removed LJPEG
-Re-Added DefferredPNGWriter from rextimmy stb work

Commented out lines about file saving and reading in gfont, these are good for debugging font saves.
2024-01-23 08:47:26 +00:00
marauder2k7 8632468a9c Set format in read stream
Forgot to pass the decided format in read from stream
2024-01-21 20:10:29 +00:00
marauder2k7 43c2c918c7 Expanded Features
Added ability to set format dynamically on read from stream.
Added other formats to write to a stream.
2024-01-20 22:47:58 +00:00
marauder2k7 106346630d STB Memory functions for fonts
Add the ability to read and write to a stream.
2024-01-20 22:15:17 +00:00
marauder2k7 7216ba8530 Revert "revert #1148 as prematurely incorporated"
This reverts commit f946088214.
2024-01-20 18:01:57 +00:00
AzaezelX f946088214 revert #1148 as prematurely incorporated
it's getting there, but there have been a few spots noted where it eroneously corrupts text, so we'll have to pull this back out for a bit barring a proper resolution
2024-01-11 13:33:03 -06:00
marauder2k7 5f8c59a8df MacOSX fixes 2023-12-04 00:16:07 +00:00
marauder2k7 a91b19d4dc Added hdr and bypass 16bit when png.
Added support for .hdr format, atm just being converted to ldr after the exposure is applied.

cleanup dds file

PNG skips 16bit altogether at the moment for textureArray issues.
2023-12-01 14:50:59 +00:00
marauder2k7 c18c14b415 Update gBitmap.h
typo
2023-11-30 15:58:41 +00:00
marauder2k7 6ed0374768 Added documentation
CompressionLevel argument now used to set jpeg quality as well. Values need to be 0-100 range for jpeg and 0-10 for png.
2023-11-30 15:57:59 +00:00
marauder2k7 63682c43ec Bug fixes:
Generating image previews of image assets was failing

DDS remove redundant check for stream status.

STB requires the file to be free before being written to, move check to make sure we can open the path into gBitmap and remove FileStream checks from everywhere else.
2023-11-30 10:46:51 +00:00
marauder2k7 108ba34c08 STBImage
STB used for loading and writing images.
2023-11-30 09:09:13 +00:00
Brian Roberts a6f03897ed
Merge pull request #1016 from Azaezel/alpha41/mangledMath
clean up math varsize complaints
2023-05-08 21:28:49 -05:00
AzaezelX 0d4221fa59 uninitialized and unused value cleanups
(cherry picked from commit 1f08602cf0ad84409cd8b3520510f9c6ce7d5f9c)
2023-05-01 10:40:02 -05:00
AzaezelX 0ce2da3a23 clean up math varsize complaints 2023-04-27 16:10:04 -05:00
AzaezelX 7872f01689 since we do in fact allow arbitrary tack on variables to scriptobject derivatives, and thus tamls, reporting theres a non hardcoded variable entry is actively counterproductive to flexibility.
plus minor format fix
2023-03-07 16:10:46 -06:00
Johan Mattsson 70a464b3f4 Fix corruption of file encoding. 2023-03-05 11:56:47 +01:00
Johan Mattsson 3c0a251f71
Release memory 2023-03-04 21:58:16 +01:00
Johan Mattsson 390be98140
Release memory 2023-03-04 21:55:39 +01:00
AzaezelX 7284d44833 bump up max allowable texture dimensions 2023-01-10 17:44:17 -06:00
AzaezelX 880ac5a264 bump down saveScaledImage default to 256
also add a "Assets/Browser/PreviewImageSize" value lookup, which if left blank defaults to 256
2022-04-12 19:46:19 -05:00
JeffR dff83182e2 Added sanity check to ensure that the requested file to be scaled via saveScaledImage actually exists
Shifts integration of other modules with the OptionsMenu so other modules can inject their own options categories to a callOnModules hook
Updated ExampleModule to use new options menu integration angle to show example option
Deleted unneeded dropdown_textEdit_image asset def from baseUI
Fixed incorrect internal values for the terrainIcon_image asset def that made it present as a redundant terrain material asset
Cleaned up old, bad loadFilters calls and replaced them with the proper refresh() calls.
Removed old, bad calls for jumping through the asset browser's tree from when it was still hardcoded organization, which cuts down a lot of error spam
Cleaned up some of the asset type's preview image assignment code to be more reliable
Made terrain materials now use a similar preview proxy shape as regular materials
Fixed erroneous duplicate GuiInspectorTypeShapeAssetPtr::onControlDropped, which was breaking drag-n-drop actions of shapeAssets into inspector fields
Added proper logic for drag-n-drop actions of imageAssets into inspector fields
Add sanity check after creating new asset to avoid redundant attempts at initialization of the new asset
Fixed ConvexShape Editor tooling so you can now use the UI to apply the selected material to the selected surface
Added tools menu to the menubar with the Project Importer entry so the PI can be launched from either tool
Implemented ability to drag-n-drop imageAssets onto MaterialEditor map fields and have it work
Implemented ability to drag-n-drop imageAssets onto TerrainMaterial Editor map fields and have it work
Made the TerrainMaterial editor dialogue have a non-modal background so you can interact with the editor as normal while it's up
Add sanity check to avoid attempting to mark EditorTree items if we couldn't find it's id
renamed BaseMap references in terrain material editor to diffuseMap for consistency
2022-03-27 03:05:48 -05:00
JeffR f1f73e41bd Fixes handlong of loading non-DDS images to better handle pointer references with the GBitmap resources.
Also adds a sanity check for the source or dest strings so they can't be empty strings
2022-03-06 22:55:05 -06:00
JeffR 7fe85ab7d5 Fixes saveScaledImage to handle DDS format files, since DDS's go through a separate resource loader 2022-02-25 16:55:05 -06:00
AzaezelX 0527865462 set cubemapsaver profile to one that preserves sizes
also aug size mismatches for the popup so they're reported
2021-11-21 14:28:51 -06:00
Robert MacGregor 2586e73145 * BugFix: Correct a few memory leaks. 2021-10-14 19:40:16 -04:00