--- /dev/null
+all: libcxr.so libnbvtf.so
+
+libcxr.so: src/convexer.c src/cxr_math.h src/cxr_mem.h
+ gcc -ggdb -O1 -Wall -fPIC -shared src/convexer.c -o libcxr.so -lm -Wno-unused-variable -Wno-unused-function -DDEBUG_WRITE_MESH -std=c99 -pedantic
+
+tovtf: src/obj/librgbcx.o src/obj/tovtf.o
+ g++ -O3 src/obj/tovtf.o src/obj/librgbcx.o -o tovtf
+
+src/obj/librgbcx.o: src/nbvtf/librgbcx.cc src/nbvtf/rgbcx.h
+ g++ -O3 -c src/nbvtf/librgbcx.cc -o src/obj/librgbcx.o
+
+src/obj/tovtf.o: src/nbvtf/vtf_cmd.c src/nbvtf/nbvtf.h
+ gcc -O3 -DUSE_LIBRGBCX -c -I./src/nbvtf/ src/nbvtf/vtf_cmd.c -o src/obj/tovtf.o
+
+src/obj/libnbvtf.o: src/nbvtf/nbvtf.h
+ gcc -O3 -fPIC -x c -c -DNBVTF_AS_SO src/nbvtf/nbvtf.h -o src/obj/libnbvtf.o
+
+libnbvtf.so: src/obj/librgbcx.o src/obj/libnbvtf.o
+ g++ -O3 -shared src/obj/librgbcx.o src/obj/libnbvtf.o -o libnbvtf.so
+
+test: src/convexer.c src/test.c src/cxr_math.h src/solid.h
+ gcc -ggdb -O1 -Wall src/test.c -o test -lm -Wno-unused-variable -Wno-unused-function -fsanitize=address -Werror=vla
- Freely form displacements without limits
- Build your entire map in Blender
- Compile models and model groups easily
+ - It runs at an ok speed!
- Light patch BSP files; remove unwanted realtime effects
- Fastest VTF compressor (thanks to Richgel999 and stb)
fputs(buf,stdout);
}
+/*
+ * Public API
+ */
+
+/*
+ * Main function
+ * Breaks up geometry into solid pieces
+ * Turns marked mesh segments into displacements
+ */
+CXR_API i32 cxr_convert_mesh_to_vmf(cxr_input_mesh *src, cxr_vdf *output);
+
+/* Context management */
+CXR_API void cxr_context_reset(void);
+CXR_API void cxr_set_offset(double offset);
+CXR_API void cxr_set_scale_factor(double scale);
+CXR_API void cxr_settings_update( struct cxr_settings *settings );
+
+/* VDF interface */
+CXR_API cxr_vdf *cxr_vdf_open(const char *path);
+CXR_API void cxr_vdf_close(cxr_vdf *vdf);
+CXR_API void cxr_vdf_put(cxr_vdf *vdf, const char *str);
+CXR_API void cxr_vdf_node(cxr_vdf *vdf, const char *str);
+CXR_API void cxr_vdf_edon( cxr_vdf *vdf );
+CXR_API void cxr_vdf_kv( cxr_vdf *vdf, const char *strk, const char *strv );
+
+/* Debugging */
+CXR_API void cxr_set_log_function( void (*func)(const char *str) );
+CXR_API void cxr_set_line_function( void (*func)(v3f p0, v3f p1, v4f colour) );
+CXR_API cxr_input_mesh *cxr_write_test_data( cxr_input_mesh *src );
+
+/* Other tools */
+CXR_API int cxr_lightpatch_bsp( const char *path );
+
+/*
+ * Implementation
+ */
CXR_API void cxr_context_reset(void)
{