summaryrefslogtreecommitdiff
path: root/src/editor/editor.cpp
diff options
context:
space:
mode:
authorday <day@national.shitposting.agency>2026-03-16 16:25:49 +0100
committerday <day@national.shitposting.agency>2026-03-16 16:25:49 +0100
commit7f85c9fc75bd62ac09ea4457d3b17f85988fca66 (patch)
tree15248e42bfafc6bd19e50c9010b701057958ff3a /src/editor/editor.cpp
parent872c39b24ecf4063f785ff3e8b2f940acd8c2d59 (diff)
parent991352b0d2767e6bd1a46f554db4ac9d208c13ad (diff)
Merge remote-tracking branch 'origin/master' into obj
Diffstat (limited to 'src/editor/editor.cpp')
-rw-r--r--src/editor/editor.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/editor/editor.cpp b/src/editor/editor.cpp
index dee5080..ba61961 100644
--- a/src/editor/editor.cpp
+++ b/src/editor/editor.cpp
@@ -56,7 +56,6 @@ static U8 editor_clr_eq( const CLR& a, const CLR& b ) {
static U8 editor_vertex_eq( const MAP_VERTEX& a, const MAP_VERTEX& b ) {
return a.pos == b.pos
- && a.normal == b.normal
&& a.uv == b.uv
&& editor_clr_eq( a.clr, b.clr );
}
@@ -604,15 +603,15 @@ STAT editor_new_map( GAME_EDITOR* e, const char* mapname ) {
WORLD_MAP* m = new WORLD_MAP;
defer( map_free( e->game, m ) );
- strcpy( m->name, mapname );
- strcat( m->name, ".hmap" );
+ m->name = mapname;
+ m->name += ".hmap";
m->startpos = { 10.f, 10.f, 0.f };
m->props.push( { .clr = { 1.f, 1.f, 1.f, 1.f } } );
m->walls.push( {
+ .propid = 0,
.start = { 0 , 0, -40.f },
.end = { 10.f, 0, 80.f },
- .propid = 0
} );
CFG_SECTION* map_cfg = map_serialize( m );
@@ -641,11 +640,10 @@ STAT editor_save_map( GAME_EDITOR* e ) {
if( !serialized ) return STAT_ERR;
defer( cfg_free( serialized ) );
- char full_path[256];
- sprintf( full_path, "../assets/maps/%s", e->map->name );
+ STR full_path = { "../assets/maps/%s", e->map->name.data };
if( !OK( cfg_save( serialized, full_path ) ) ) {
- dlog( "failed to save map %s", full_path );
+ dlog( "failed to save map %s", full_path.data );
return STAT_ERR;
}