Page 1 of 1

Ta3D::String replacement

Posted: Sun May 10, 2009 10:12 am
by milipili
I'am going to replace the current implementation of TA3D::String this afternoon, to fix, I hope, some memory corruption especially under OS X and some Linux distros. if you're using the trunk, you might encounter some problems in the next revisions... :)

Re: Ta3D::String replacement

Posted: Sun May 10, 2009 12:38 pm
by xpoy
Reply when you finshed it :)

Re: Ta3D::String replacement

Posted: Sun May 10, 2009 8:57 pm
by milipili
It is not finished yet, because it seems the string in libyuni is still a bit buggy :)
It seems the new method to extract the pair key/value is not good as it should be. here is a patch if someone would like to debug it ^^ (http://ftn.shikami.org/ta3d/newstring.patch)

Re: Ta3D::String replacement

Posted: Mon May 11, 2009 2:37 pm
by xpoy
:)
i good at Debug,but be able to help you in next weekend

Re: Ta3D::String replacement

Posted: Mon May 11, 2009 2:43 pm
by milipili
Beware ! yuni likes metaprogramming :)

Re: Ta3D::String replacement

Posted: Mon May 11, 2009 5:20 pm
by xpoy
:P
If there are enough documentation for there meta,which is more simple.

Re: Ta3D::String replacement

Posted: Mon May 11, 2009 6:17 pm
by milipili
Constructive criticism welcomed :D

Re: Ta3D::String replacement

Posted: Mon May 11, 2009 9:46 pm
by milipili
The bug has been found. The methods `find_first_of` and `find_first_not_of` were wrong :)

Re: Ta3D::String replacement

Posted: Mon May 11, 2009 9:47 pm
by zuzuf
glad to read that :)
I've just arrived home (train is boring :( ), I'll have a look at it tomorrow :)

Re: Ta3D::String replacement

Posted: Mon May 11, 2009 9:55 pm
by milipili
The method extractKeyValue() (especially used in the TDF parser, tdf.cpp) has been completely redesigned for performance reasons, which is the first test to pass when launching TA3D :)

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 2:31 pm
by milipili
A good and a bad news :)

The good one : It seems with the string replacement that textures corruptions are gone away. I can zoom in/out without any problems

The bad one : Ta3d produces SegV everywhere :( Actually it seems there are a lot of error bounds checking. I have fixed a few one with the following patch but several remains. It seems not all units are loaded. Perhaps a bug remains in the new string.
The patch : http://ftn.shikami.org/ta3d/newstring.patch, to apply from the trunk.

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 3:12 pm
by xpoy
Refueling!
Send xpoy@live.cn something if there are something I need to do

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 5:10 pm
by milipili
No need. Update with the latest revision of Ta3D and libyuni. Apply the patch from the trunk. And find all bugs :D

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 6:00 pm
by xpoy
:(
Should i change all patch in manual?
I Aware that don't how to use the patch while open web

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 6:35 pm
by milipili
Under any unixes :

Code: Select all

cd <where_is_ta3d>/trunk
patch -p0 < whereismypatch,patch
Under Windows :
http://ffmpeg.arrozcru.org/wiki/index.p ... ortoiseSVN
See "Applying a Patch using TortoiseSVN" except the folder will be "trunk"

obviously, If you have already done a checkout from the trunk, it will be the root folder of your checkout.

Note for Debian/Ubuntu : it requires the package "build-essential"

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 7:01 pm
by xpoy
Try to all bug
I used another bad svn soft before now.
It couldn't used patch file

There are a wrong in config.h after patch
Should add a" for string,or couldn't make.
New wrong

Code: Select all

f:/min/home/Owner/trunk/src/ta3d/src/gfx/font.cpp:227: error: `ConvertSlashesIntoAntiSlashes' is not a member of `TA3D::String'
I call one guy that play with me and lost to convincing,to test bug :mrgreen:

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 9:12 pm
by milipili
As you can see in http://trac.libyuni.org/browser/trunk/s ... g/string.h, the equivalent one is convertSlashesIntoBackslashes. I did not notice the specific code to Windows, so please modify it by hand I keep a trace on my code too. Thanks for notifying me.

Re: Ta3D::String replacement

Posted: Sun May 17, 2009 9:17 pm
by milipili
In the same way, if you have any missing method `String::resize()`, the good method to replace it is String::truncate().

Re: Ta3D::String replacement

Posted: Mon May 18, 2009 8:49 am
by xpoy
font.cpp used the TA3D string but not yuni string.
I alway meet scope wrong,keep confused in c++:x

Re: Ta3D::String replacement

Posted: Mon May 18, 2009 10:23 am
by milipili
Hum strange. With the patch Ta3D::String is a typedef (alias) to Yuni::String. Except for std::getline which takes a std::string but Yuni::String have accessors for std::string.

Re: Ta3D::String replacement

Posted: Mon May 18, 2009 11:22 am
by xpoy
Study c++ syntax some day.
Send xpoy#live.cn a bin then i can Kick !@#!&( scope wrong. :o Some guys interesting in TA3D,i will send them the bin for test.

Re: Ta3D::String replacement

Posted: Mon May 18, 2009 3:19 pm
by milipili
Would you prefer a clean tarball with sources and binaries compiled for Windows ?

Re: Ta3D::String replacement

Posted: Mon May 18, 2009 4:55 pm
by xpoy
:P
surely.I prefer a clean tarball with sources and binaries compiled for Windows

Re: Ta3D::String replacement

Posted: Mon May 18, 2009 6:36 pm
by Balthazar
milipili wrote:Would you prefer a clean tarball with sources and binaries compiled for Windows ?
Yep :P

Re: Ta3D::String replacement

Posted: Mon May 18, 2009 9:46 pm
by milipili

Re: Ta3D::String replacement

Posted: Tue May 19, 2009 5:34 am
by xpoy
:lol:
WHY I LOVE YOU.
PS:How to decompression?

Re: Ta3D::String replacement

Posted: Tue May 19, 2009 7:53 am
by milipili
With the latest version of winzip. hum... I think I will follow the zuzuf's way about archives on Windows... 7z only... Working with several softwares is not really a great idea.

By the way, changes will be merged in the trunk, so the next revisions won't be suitable for working with for sure.

Re: Ta3D::String replacement

Posted: Tue May 19, 2009 9:16 am
by xpoy
Bug report:
Main menu Couldn't show" WIP "Words
option couldn't show item
skirmsish setup couldn't show captions
In game,ESC menu could show backgroud (thus PAUSE pic couldn't see when open ESC menu).ESC help botton not work.
the game Finshed Statistics's backgroud couldn't show.(some time)

Re: Ta3D::String replacement

Posted: Tue May 19, 2009 11:58 pm
by milipili
Thanks :)
Changes have been merged in the trunk. It is time to track down [a lot of] bugs :)

Re: Ta3D::String replacement

Posted: Thu Jul 02, 2009 8:15 am
by xpoy
Remove nearly all String::Format
Finshed? :)

Re: Ta3D::String replacement

Posted: Fri Jul 03, 2009 12:33 am
by milipili
I don't think so. However, it is not really a problem. This replacement is for performance reasons only.

Re: Ta3D::String replacement

Posted: Fri Jul 03, 2009 8:43 am
by xpoy
hehe, for performance feel
In game start, show intro at first, then start load.
It always be a halt before game, the screen hold on, the game not start

Re: Ta3D::String replacement

Posted: Fri Jul 03, 2009 6:45 pm
by milipili
I am perfectly aware of this. Don't worry it is planned for my part :p