release mode flag for build script
authorhgn <hgodden00@gmail.com>
Fri, 16 Jul 2021 10:51:31 +0000 (11:51 +0100)
committerhgn <hgodden00@gmail.com>
Fri, 16 Jul 2021 10:51:31 +0000 (11:51 +0100)
build.sh
csRadar.c
csRadar.h
ext_csr_free.c

index 33bbae02e76dda5aab5c8dc6a34f481cbb59c193..51594999c49e5c125ec3ad0bc995405ea096b801 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -1,6 +1,23 @@
+
+flags="-ggdb3 -Wall -fsanitize=address"
+
+while (( "$#" )); do
+       case $1 in
+               -r|--release) 
+                       flags="-Wall -O3"
+                       echo "Release mode" 
+               ;;
+               *) 
+                       echo "Unkown param: $1" 
+                       exit 1
+               ;;
+       esac
+       shift
+done
+
 mkdir -p ext
 mkdir -p ext
-echo gcc -ggdb3 -Wall -fsanitize=address -rdynamic csRadar.c -o csRadar -lm -ldl
-gcc -ggdb3 -Wall -fsanitize=address -rdynamic csRadar.c -o csRadar -lm -ldl
+echo build: csRadar
+gcc $flags -rdynamic csRadar.c -o csRadar -lm -ldl
 
 
-echo -ggdb3 -Wall -fsanitize=address -fpic -shared -o ext/csRadarFree.so ext_csr_free.c -lm
-gcc -ggdb3 -Wall -fsanitize=address -fpic -shared -o ext/csRadarFree.so ext_csr_free.c -lm
+echo build: ext/csRadarFree.so
+gcc $flags -fpic -shared -o ext/csRadarFree.so ext_csr_free.c -lm
index 9af5cdad09b9ed2b9853338c3312982ab01113a0..11253739c13bab5f3b4ec1ea829f63120420e625 100644 (file)
--- a/csRadar.c
+++ b/csRadar.c
@@ -107,6 +107,7 @@ int main( int argc, char *argv[] )
                                "   -g <gameinfo.txt path>         Required if you are loading models\n"
                                "   -r 1024                        Output resolution\n"
                                "   -o <output>                    Specify output name/path\n"
                                "   -g <gameinfo.txt path>         Required if you are loading models\n"
                                "   -r 1024                        Output resolution\n"
                                "   -o <output>                    Specify output name/path\n"
+                               "   -e <classname>                 Same as default arg, but instead filters for entity class\n"
                                "   --padding=128                  When cropping radar, add padding units to border\n"
                                //"   --standard-layers              Use standard TAR layers/groups\n"
                                "   --write-normals                Enable normals as an output stream\n"
                                "   --padding=128                  When cropping radar, add padding units to border\n"
                                //"   --standard-layers              Use standard TAR layers/groups\n"
                                "   --write-normals                Enable normals as an output stream\n"
index 95e1048599418e0c947957c04034916a43cff700..36c00f86412a5c24302d8277eddd3f95eea4ec83 100644 (file)
--- a/csRadar.h
+++ b/csRadar.h
@@ -49,6 +49,9 @@ struct csr_api
        char vmf_name[ 128 ];                   // Just the base name eg. my_map
        EMSAA sampling_mode;
        
        char vmf_name[ 128 ];                   // Just the base name eg. my_map
        EMSAA sampling_mode;
        
+       int write_normals;
+       int write_origins;
+       
        // Main API interface
        vmf_map *map;
        csr_target target;
        // Main API interface
        vmf_map *map;
        csr_target target;
index 587380275f599dc8af27e5302cbb16bedfd32ff4..f6b0b85c1044886899aceff646f6686e2e25a607 100644 (file)
@@ -27,6 +27,17 @@ void csr_ext_main( csr_api *api )
 {
        if( !csr_init( api ) )
                return;
 {
        if( !csr_init( api ) )
                return;
+               
+       // Setup shader variants
+       if( api->write_origins )
+       {
+               // Use origin fragment variant
+       }
+       
+       if( api->write_normals )
+       {
+               // Increase stride 
+       }
        
        csr_create_target( &api->target, api->resolution, api->resolution, api->sampling_mode, &shader_gbuffer );
        csr_rt_clear( &api->target );
        
        csr_create_target( &api->target, api->resolution, api->resolution, api->sampling_mode, &shader_gbuffer );
        csr_rt_clear( &api->target );