From 720f7c465140a0cd0d02b5556356932028f97955 Mon Sep 17 00:00:00 2001 From: ac_stef Date: Tue, 3 Mar 2009 13:53:17 +0000 Subject: [PATCH] convenient moving of map entities git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4240 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- config/resetbinds.cfg | 2 +- config/scripts.cfg | 1 + source/src/editing.cpp | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config/resetbinds.cfg b/config/resetbinds.cfg index 909a2765..3fff8b94 100644 --- a/config/resetbinds.cfg +++ b/config/resetbinds.cfg @@ -64,7 +64,7 @@ bind I "heightfield 2" bind J "" bind K "corner" bind L [ if $editing [ showmenu Lighting ] ] -bind M "" +bind M [ if $editing [ domodifier 6 ] ] bind N "" bind O "editheight 2 -1" bind P "editheight 2 1" diff --git a/config/scripts.cfg b/config/scripts.cfg index b6977adb..45faec78 100644 --- a/config/scripts.cfg +++ b/config/scripts.cfg @@ -130,6 +130,7 @@ alias delta_edit_2 [ edittex $flrceil $arg1 ] // Change floor/ceiling textur alias delta_edit_3 [ edittex (+ $flrceil 1) $arg1 ] // Change wall/upper-wall textures... alias delta_edit_4 [ equalize $flrceil ] // Equalize floor/ceiling... alias delta_edit_5 [ entproperty 0 $arg1 ] // Changes the frist value on entities... +alias delta_edit_6 [ entproperty $editaxis $arg1 ] // Move map entity... // HUD toggles alias toggleshowmap [ showmap 1; onrelease [ showmap 0 ] ] diff --git a/source/src/editing.cpp b/source/src/editing.cpp index d204a654..935185a8 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -113,6 +113,7 @@ void makesel() } VAR(flrceil,0,0,2); +VAR(editaxis,0,0,13); // VC8 optimizer screws up rendering somehow if this is an actual function #define sheight(s,t,z) (!flrceil ? (s->type==FHF ? s->floor-t->vdelta/4.0f : (float)s->floor) : (s->type==CHF ? s->ceil+t->vdelta/4.0f : (float)s->ceil)) @@ -120,6 +121,8 @@ VAR(flrceil,0,0,2); void cursorupdate() // called every frame from hud { flrceil = ((int)(camera1->pitch>=0))*2; + int cyaw = ((int) camera1->yaw) % 180; + editaxis = editmode ? (fabs(camera1->pitch) > 65 ? 13 : (cyaw < 45 || cyaw > 135 ? 12 : 11)) : 0; volatile float x = worldpos.x; // volatile needed to prevent msvc7 optimizer bug? volatile float y = worldpos.y;