Ta3D::String replacement

Everything related to the code /
Tout ce qui touche au code
Post Reply
milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Ta3D::String replacement

Post by milipili » Sun May 10, 2009 10:12 am

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... :)
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Sun May 10, 2009 12:38 pm

Reply when you finshed it :)

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Sun May 10, 2009 8:57 pm

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)
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Mon May 11, 2009 2:37 pm

:)
i good at Debug,but be able to help you in next weekend

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Mon May 11, 2009 2:43 pm

Beware ! yuni likes metaprogramming :)
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Mon May 11, 2009 5:20 pm

:P
If there are enough documentation for there meta,which is more simple.

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Mon May 11, 2009 6:17 pm

Constructive criticism welcomed :D
Damien Gerard
Ta3d & Yuni Developer

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Mon May 11, 2009 9:46 pm

The bug has been found. The methods `find_first_of` and `find_first_not_of` were wrong :)
Damien Gerard
Ta3d & Yuni Developer

User avatar
zuzuf
Administrateur - Site Admin
Posts: 3281
Joined: Mon Oct 30, 2006 8:49 pm
Location: Toulouse, France
Contact:

Re: Ta3D::String replacement

Post by zuzuf » Mon May 11, 2009 9:47 pm

glad to read that :)
I've just arrived home (train is boring :( ), I'll have a look at it tomorrow :)
=>;-D Penguin Powered

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Mon May 11, 2009 9:55 pm

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 :)
Damien Gerard
Ta3d & Yuni Developer

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Sun May 17, 2009 2:31 pm

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.
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Sun May 17, 2009 3:12 pm

Refueling!
Send xpoy@live.cn something if there are something I need to do

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Sun May 17, 2009 5:10 pm

No need. Update with the latest revision of Ta3D and libyuni. Apply the patch from the trunk. And find all bugs :D
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Sun May 17, 2009 6:00 pm

:(
Should i change all patch in manual?
I Aware that don't how to use the patch while open web

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Sun May 17, 2009 6:35 pm

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"
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Sun May 17, 2009 7:01 pm

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:

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Sun May 17, 2009 9:12 pm

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.
Damien Gerard
Ta3d & Yuni Developer

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Sun May 17, 2009 9:17 pm

In the same way, if you have any missing method `String::resize()`, the good method to replace it is String::truncate().
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Mon May 18, 2009 8:49 am

font.cpp used the TA3D string but not yuni string.
I alway meet scope wrong,keep confused in c++:x

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Mon May 18, 2009 10:23 am

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.
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Mon May 18, 2009 11:22 am

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.

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Mon May 18, 2009 3:19 pm

Would you prefer a clean tarball with sources and binaries compiled for Windows ?
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Mon May 18, 2009 4:55 pm

:P
surely.I prefer a clean tarball with sources and binaries compiled for Windows

User avatar
Balthazar
Moderator
Posts: 2055
Joined: Wed Nov 01, 2006 4:31 pm
Location: Russian Federation
Contact:

Re: Ta3D::String replacement

Post by Balthazar » Mon May 18, 2009 6:36 pm

milipili wrote:Would you prefer a clean tarball with sources and binaries compiled for Windows ?
Yep :P

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Mon May 18, 2009 9:46 pm

Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Tue May 19, 2009 5:34 am

:lol:
WHY I LOVE YOU.
PS:How to decompression?

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Tue May 19, 2009 7:53 am

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.
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Tue May 19, 2009 9:16 am

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)

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Tue May 19, 2009 11:58 pm

Thanks :)
Changes have been merged in the trunk. It is time to track down [a lot of] bugs :)
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Thu Jul 02, 2009 8:15 am

Remove nearly all String::Format
Finshed? :)

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Fri Jul 03, 2009 12:33 am

I don't think so. However, it is not really a problem. This replacement is for performance reasons only.
Damien Gerard
Ta3d & Yuni Developer

xpoy
Posts: 669
Joined: Mon Sep 22, 2008 3:55 am

Re: Ta3D::String replacement

Post by xpoy » Fri Jul 03, 2009 8:43 am

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

milipili
Posts: 545
Joined: Thu Nov 02, 2006 8:52 am
Location: Paris (France)
Contact:

Re: Ta3D::String replacement

Post by milipili » Fri Jul 03, 2009 6:45 pm

I am perfectly aware of this. Don't worry it is planned for my part :p
Damien Gerard
Ta3d & Yuni Developer

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests