patchBattle for Wesnoth - Patches: patch #3621, Square_split optimizations and...

Show feedback again

patch #3621: Square_split optimizations and application to sound file lists

Submitted by:  David Mikos <coffee>
Submitted on:  Mon Jan 28 05:56:09 2013  
Priority: 4Status: Done
Privacy: PublicAssigned to: Jérémy Rosen <boucman>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):

You are not logged in

Please log in, so followups can be emailed to you.


Sat Feb 2 07:51:17 2013, comment #2:

Updated Wiki for the '~' change.

David Mikos <coffee>
Project Member
Wed Jan 30 21:53:24 2013, comment #1:

ok, both commited, please update the wiki so I can close this bug

Jérémy Rosen <boucman>
Project MemberIn charge of this item.
Mon Jan 28 05:56:09 2013, original submission:

This follows the previous patch ( that introduced square bracket expansions for file lists when dealing with animations.

The first attached patch converts the '-' to '~' to be more in line with existing conventions (say for offsets), but also for future use within frames. This patch also optimizes the string_utils.cpp split and related functions by introducing a stip_end function that is used in places where the beginning of a string of text is known to be already white space free. This idea is that if the flags are set to strip white spaces, each time a split function hits a separator it starts after skipping all the spaces -- so at the end it only needs to strip the end spaces. I've replaced the search for a space with the more generic space, newline,and return character function that was already included in this file.

The second patch applies the square split function to sound. This simplifies a great deal sound_utils.cfg macros and some of the elf healing units. Together with the split function for halos, by my testing this saves about .9 Mb of RAM on loading wesnoth (out of 54.8 Mb), and about 3-5 Mb when loading multiplayer with eras. Not much, but if I get if I also get a patch for the unit frames, it may all start to add up to a discernable faster loading time and smaller cache.

Hopefully that all makes sense. I'm happy to clarify anything here or change anything, in case I've broken anything with this (altough I think I've tested reasonably well each aspect).

David Mikos <coffee>
Project Member


(Note: upload size limit is set to 1024 kB, after insertion of the required escape characters.)

Attach File(s):

Attached Files
file #17034:  square_split_sound.patch added by coffee (13kB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by shadowmaster (Updated the item)
  • -unavailable- added by boucman (Posted a comment)
  • -unavailable- added by coffee (Submitted the item)

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.


    Error: not logged in



    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Aug 6 00:44:19 2013shadowmasterOpen/ClosedOpen=>Closed
    Sat Feb 2 09:27:25 2013boucmanStatusIn Progress=>Done
    Wed Jan 30 21:53:24 2013boucmanStatusNone=>In Progress
      Assigned toNone=>boucman
    Mon Jan 28 05:56:09 2013coffeeAttached File-=>Added square_split_to_tilde_with_split_optimizations.patch, #17033
      Attached File-=>Added square_split_sound.patch, #17034
    Show feedback again

    Back to the top

    Powered by Savane 3.1-cleanup