DieHard Wolfers Forum Index DieHard Wolfers
A Wolfenstein 3d Fan Community


  Hosted by: MCS & Areyep.com - Designed by: BrotherTank

Original Yahoo Forum - Die Hard Archives

AReyeP HomepageAreyep Homepage DieHard Wolfenstein BunkerDieHard Wolfenstein Bunker Log inLog in RegisterRegister Banlist FAQFAQ Search ForumsSearch

  Username:    Password:      Remember me       

[solved] Remove trailing spaces from mapnames
Page 1 of 1
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page BottomView Next Topic
Post new topicReply to topic
Author Message
Andy_Nonymous
Moderator
<B>Moderator</B>


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015

Topics: 99
Posts: 589
Location: New Jersey, USA
usa.gif

PostPosted: Wed Oct 16, 2013 4:01 pm
   Subject: [solved] Remove trailing spaces from mapnames
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Next PostGoto Bottom of Posts

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
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 0:28 ago.

Topics: 38
Posts: 2459
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Thu Oct 17, 2013 2:31 am
   Subject: Re: [solved] Remove trailing spaces from mapnames
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

Well, the easy fix is to just add this after the line "mapname[pos] = 0;":

::: CODE :::
    while (--pos >= 0 && mapname[pos] == ' ')  mapname[pos] = 0;


I think that should work without any issues.
Andy_Nonymous
Moderator
<B>Moderator</B>


Joined: 02 Apr 2003
Last Visit: 17 Feb 2015

Topics: 99
Posts: 589
Location: New Jersey, USA
usa.gif

PostPosted: Thu Oct 17, 2013 9:40 am
   Subject: [help] Remove trailing spaces from mapnames
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Next PostGoto Bottom of Posts

It works great! Thanks so much, AlumiuN! Very Happy
AlumiuN
DieHard Wolfer
DieHard Wolfer


Joined: 29 Nov 2007
Last Visit: 0:28 ago.

Topics: 38
Posts: 2459
Location: Christchurch, New Zealand
newzealand.gif

PostPosted: Thu Oct 17, 2013 11:01 pm
   Subject: Re: [solved] Remove trailing spaces from mapnames
   [ IP : Logged ]
Reply with quote
Goto Top of PostsGoto Previous PostGoto Bottom of Posts

No problem mate Smile
Display posts from previous:   
Post new topicReply to topic Time synchronized with the forum server time
DieHard Wolfers Forum Index -> SDL Code Crackers View Previous TopicRefresh this PageAdd Topic to your Browser FavoritesSearch ForumsPrint this TopicE-mail TopicGoto Page TopView Next Topic
Page 1 of 1
Jump to:  

Related topics
 Topics   Replies   Views   Last Post 
No new posts Announcement: Wolf3d & Spear of Destiny Shareware SDL Downloads
Author: BrotherTank
10 14640 Tue Aug 24, 2010 10:18 am
dcbasic View latest post
No new posts Sticky: [Tutorial] Compiling Wolf4SDL with Code::Blocks
Author: dcbasic
90 22956 Wed May 24, 2017 7:53 pm
Falcon*93 View latest post
No new posts [Help] Gun Bobbing in SDL
Author: RichterBelmont12
8 2679 Wed Jul 23, 2008 6:37 pm
Tricob View latest post
No new posts [Help] Problem with Checkweaponchange function (wolf4sdl)
Author: Mortimer
4 3026 Sat May 17, 2008 11:26 am
Mortimer View latest post
No new posts [SDL] Apply 2nd ScaleFactor to selected (hi-res) vga gfx
Author: Andy_Nonymous
9 4247 Sun Apr 27, 2008 2:30 am
AlumiuN View latest post
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
   You cannot delete your posts in this forum
You cannot vote in polls in this forum


Copyright ©2003-2008 DieHard Wolfers
A Modified subBunker Theme by BrotherTank
Powered by phpBB © 2001, 2005 phpBB Group