From 2ea2db396d49a854db0e5faf72847b5b9f55b52f Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Mon, 31 Jan 2022 16:40:29 +0100 Subject: [PATCH] Fixed random alpha values within exportImagesToTrenchBroom cmd --- README.md | 8 +++++--- neo/framework/DeclManager.cpp | 19 +++++++++++++++---- zip-RBDOOM-3-BFG-lite-snapshot.bat | 2 +- 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4e763db8..1bfed817 100644 --- a/README.md +++ b/README.md @@ -650,13 +650,15 @@ r_useFilmicPostProcessing [0, 1] | Apply several post process effects to m Name | Description :--------------------------------------| :------------------------------------------------ dmap mapfile | Command: Compiles a .map to its corresponding BSP .proc, Collision .cm files and Area Awareness System (AI navigation) .aas files. Just type dmap to list all options -dmap `[glfile]` mapfile | DMap option that exports the BSP areas and portals to .obj for debugging purposes +dmap `[glview]` mapfile | DMap option that exports the BSP areas and portals to .obj for debugging purposes bakeEnvironmentProbes | Command after loading a map. Captures all env_probe entities and stores them to disc bakeLightGrids [``...] | `` limit[num] : max probes per BSP area (default 16384) bounce[num] : number of bounces or number of light reuse (default 1) grid( xdim ydim zdim ) : light grid size steps into each direction (default 64 64 128) exportScriptEvents | Command: Generates a new script/doom_events.script that reflects all registered class events in the idClass C++ system. The gamecode still needs to be extended to add the original comments of the events -exportFGD `[nomodels]` | Command: Exports all entity defs to exported/_tb/*.fgd for usage in TrenchBroom +exportFGD `[nomodels]` | Command: Exports all entity defs to exported/_tb/*.fgd for usage in convertMapToValve220 `` | +exportImagesToTrenchBroom | Command: Decompresses and saves all TB relevant .bimage images to _tb/*.png files +exportModelsToTrenchBroom | Command: Saves all .base|.blwo|.bmd5mesh models to _tb/*.obj files exportEntityDefsToBlender | Command: Exports all entity and model defs to exported/entities.json for usage in Blender -postLoadExportModels | Cvar: Export models after loading to OBJ model format. Set it to 1 before loading a map. +before loading a map. exportMapToOBJ | Command: Convert .map file to .obj/.mtl postLoadExportFlashAtlas | Cvar: Set to 1 at startup to dump the Flash images to exported/swf/ postLoadExportFlashToSWF | Cvar: Set to 1 at startup to dump the Flash .bswf files as .swf (WIP) diff --git a/neo/framework/DeclManager.cpp b/neo/framework/DeclManager.cpp index 1b6d9d95..d8beeef6 100644 --- a/neo/framework/DeclManager.cpp +++ b/neo/framework/DeclManager.cpp @@ -2936,6 +2936,11 @@ void idDeclManagerLocal::ExportImagesToTrenchBroom_f( const idCmdArgs& args ) { idDxtDecoder dxt; dxt.DecompressImageDXT1( data, rgba.Ptr(), dxtWidth, dxtHeight ); + + for( int i = 0; i < ( dxtWidth * dxtHeight ); i++ ) + { + rgba[i * 4 + 3] = 255; + } } else if( imgHeader.format == FMT_DXT5 ) { @@ -2944,6 +2949,11 @@ void idDeclManagerLocal::ExportImagesToTrenchBroom_f( const idCmdArgs& args ) if( imgHeader.colorFormat == CFM_NORMAL_DXT5 ) { dxt.DecompressNormalMapDXT5( data, rgba.Ptr(), dxtWidth, dxtHeight ); + + for( int i = 0; i < ( dxtWidth * dxtHeight ); i++ ) + { + rgba[i * 4 + 3] = 255; + } } else if( imgHeader.colorFormat == CFM_YCOCG_DXT5 ) { @@ -2958,6 +2968,11 @@ void idDeclManagerLocal::ExportImagesToTrenchBroom_f( const idCmdArgs& args ) else { dxt.DecompressImageDXT5( data, rgba.Ptr(), dxtWidth, dxtHeight ); + + for( int i = 0; i < ( dxtWidth * dxtHeight ); i++ ) + { + rgba[i * 4 + 3] = 255; + } } } @@ -2976,13 +2991,11 @@ void idDeclManagerLocal::ExportImagesToTrenchBroom_f( const idCmdArgs& args ) // scale DXT sized images back to the original size byte* scaled = R_Dropsample( rgba.Ptr(), dxtWidth, dxtHeight, img.width, img.height ); -#if 1 if( img.width > 16 && img.height > 16 ) { R_WritePNG( exportName, scaled, 4, img.width, img.height, true, "fs_basepath" ); } else -#endif { exportName.SetFileExtension( ".tga" ); R_WriteTGA( exportName, scaled, img.width, img.height, false, "fs_basepath" ); @@ -2992,13 +3005,11 @@ void idDeclManagerLocal::ExportImagesToTrenchBroom_f( const idCmdArgs& args ) } else { -#if 1 if( img.width > 16 && img.height > 16 ) { R_WritePNG( exportName, rgba.Ptr(), 4, img.width, img.height, true, "fs_basepath" ); } else -#endif { exportName.SetFileExtension( ".tga" ); R_WriteTGA( exportName, rgba.Ptr(), img.width, img.height, false, "fs_basepath" ); diff --git a/zip-RBDOOM-3-BFG-lite-snapshot.bat b/zip-RBDOOM-3-BFG-lite-snapshot.bat index 6572ec59..4792ef58 100644 --- a/zip-RBDOOM-3-BFG-lite-snapshot.bat +++ b/zip-RBDOOM-3-BFG-lite-snapshot.bat @@ -1,5 +1,5 @@ REM 7z a RBDOOM-3-BFG-1.3.1.1-lite-win64-20220109-git-xxxxxxx.7z -r base/env/ base/maps/*.lightgrid base/maps/*_extra_ents.map -x!generated -set filename=RBDOOM-3-BFG-1.4.0.2-lite-win64-20220129-git-xxxxxxx.7z +set filename=RBDOOM-3-BFG-1.4.0.3-lite-win64-20220131-git-xxxxxxx.7z 7z a %filename% README.md RELEASE-NOTES.md base/devtools.cfg base/modelviewer.cfg base/extract_resources.cfg base/convert_maps_to_valve220.cfg base/def/*.def base/materials/*.mtr base/textures/common base/textures/editor -x!generated -xr!*.xcf -xr!*.blend 7z a %filename% README.md RELEASE-NOTES.md tools/trenchbroom pause