From: hgn Date: Wed, 29 Oct 2025 01:23:01 +0000 (+0000) Subject: write kv X-Git-Url: https://skaterift.com/git/?a=commitdiff_plain;h=refs%2Fheads%2Fvg4;p=vg.git write kv --- diff --git a/source/engine/vg_engine.c b/source/engine/vg_engine.c index 1c3db8b..3fa992f 100644 --- a/source/engine/vg_engine.c +++ b/source/engine/vg_engine.c @@ -126,7 +126,7 @@ i32 main( i32 argc, const c8 *argv[] ) if( 1 ) { _engine.w = 1280; - _engine.h = 720; + _engine.h = 768; } #ifndef _WIN32 diff --git a/source/foundation/keyvalues.c b/source/foundation/keyvalues.c index 179adea..941433a 100644 --- a/source/foundation/keyvalues.c +++ b/source/foundation/keyvalues.c @@ -681,18 +681,19 @@ b8 keyvalues_read_file( struct keyvalues *kvs, const c8 *path, struct stack_allo else return 0; } -#if 0 -b8 vg_kv_write_file( vg_kvs *kvs, const c8 *path ) +b8 keyvalues_write_file( struct keyvalues *kvs, const char *path ) { - vg_stream stream; - if( vg_file_stream_open( &stream, path, VG_STREAM_WRITE ) ) + struct stream file; + if( stream_open_file( &file, path, k_stream_write ) ) { - vg_kv_write writer; - vg_kv_write_init( &writer, &stream ); - vg_kv_write_tree( &writer, kvs, 0 ); - vg_file_stream_close( &stream ); + keyvalues_write_stream( kvs, &file, 0, 0 ); + stream_close( &file ); + $log( $ok, {"Serialized & written to '"}, {path}, {"'"} ); return 1; } - else return 0; + else + { + $log( $error, {"Save failure to "}, {path} ); + return 0; + } } -#endif