From b339831354a156f19a6d741a3be54d36e98ce0f9 Mon Sep 17 00:00:00 2001 From: Lucas GAUTHERON Date: Sat, 23 Apr 2011 09:35:18 +0000 Subject: [PATCH] settex command git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6303 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- docs/reference.xml | 10 +++++++++- source/src/editing.cpp | 23 +++++++++++++++++++++++ source/vcpp/cube.sln | 6 +++--- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/docs/reference.xml b/docs/reference.xml index 022c62b1..142360be 100644 --- a/docs/reference.xml +++ b/docs/reference.xml @@ -2724,7 +2724,15 @@ Output: - + + + + + + + + + Default keys are [ and ] for floor level, and o/p for ceiling. diff --git a/source/src/editing.cpp b/source/src/editing.cpp index 9062939a..44ed2523 100644 --- a/source/src/editing.cpp +++ b/source/src/editing.cpp @@ -323,6 +323,8 @@ void editheight(int flr, int amount) COMMAND(editheight, ARG_2INT); +// texture type : 0 floor, 1 wall, 2 ceil, 3 upper wall + void edittexxy(int type, int t, block &sel) { loopselxy(switch(type) @@ -348,6 +350,26 @@ void edittex(int type, int dir) addmsg(SV_EDITT, "ri6", sel.x, sel.y, sel.xs, sel.ys, type, t); } +void settex(int texture, int type) +{ + EDITSEL; + if(type<0 || type>3) return; + int atype = type==3 ? 1 : type; + int t = -1; + loopi(256) if(texture == (int)hdr.texlists[atype][i]) + { + t = (int)hdr.texlists[atype][i]; + break; + } + if(t<0) + { + conoutf("invalid/unavaible texture"); + return; + } + edittexxy(type, t, sel); + addmsg(SV_EDITT, "ri6", sel.x, sel.y, sel.xs, sel.ys, type, t); +} + void replace() { EDITSELMP; @@ -610,3 +632,4 @@ COMMAND(movemap, ARG_3INT); COMMAND(selectionrotate, ARG_1INT); COMMAND(selectionflip, ARG_1STR); COMMAND(countwalls, ARG_1EXP); +COMMAND(settex, ARG_2INT); diff --git a/source/vcpp/cube.sln b/source/vcpp/cube.sln index f895137a..85f2264b 100644 --- a/source/vcpp/cube.sln +++ b/source/vcpp/cube.sln @@ -1,7 +1,7 @@  -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual Studio 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cube", "cube.vcproj", "{1FAF5BB4-C49A-4124-9F23-188528BAE7C8}" +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cube", "cube.vcxproj", "{1FAF5BB4-C49A-4124-9F23-188528BAE7C8}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution