Posted: Wed Oct 16, 2013 4:01 pm
Subject: [solved] Remove trailing spaces from mapnames
[ IP : Logged ]
While doing SDL conversions of older (Mapedit-made) mods, I notice the map names in ChaosEdit invariably have spaces at the end of the name, so there's always 16 characters in the name detected when Displaying the Map Name on the Get Psyched Screen. Using the US_CPrint function on a short name causes it to be pushed to the left because it centers the whole 16 characters, not just the visible portion.
I'd like to be able to delete the trailing spaces in the code rather than by editing the GAMEMAPS in ChaosEdit, which I have been doing until this point. BrotherTank once posted some routines which should be helpful, but I'm at a loss how to incorporate them into the Wolf3d code.
The Rtrim function is the one I need, but it depends on several of the preceding functions. Would it be reasonable to make BrotherTank's whole code posting into a header (.H) file and add it to the project? If I do that, does it matter where the include statement for that header file goes? WL_DEF.H?
Andy
Last edited by Andy_Nonymous on Thu Oct 17, 2013 9:40 am; edited 1 time in total
AlumiuN
DieHard Wolfer
Joined: 29 Nov 2007
Last Visit: 2:15 ago.
Topics: 38
Posts: 2536
Location: Christchurch, New Zealand
Posted: Thu Oct 17, 2013 2:31 am
Subject: Re: [solved] Remove trailing spaces from mapnames
[ IP : Logged ]
Well, the easy fix is to just add this after the line "mapname[pos] = 0;":