[Release]DBC Converter

04/26/2012 12:29 Kiyono#31
Quote:
Originally Posted by _DreadNought_ View Post
Should probably fix your minor unnecessary codes..
for ex
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              else 
                    return false;
why the else?
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              return false;
I may simply be ignorant but don't those things function in exactly the same way? I always thought that it was merely an aesthetic thing.
04/26/2012 12:35 _DreadNought_#32
Yes they do, but its bad coding practice to add code where the function will still have the same result without it.
04/26/2012 12:42 Kiyono#33
Quote:
Originally Posted by _DreadNought_ View Post
Yes they do, but its bad coding practice to add code where the function will still have the same result without it.
I see, re-uploaded with the "else" removed.
04/26/2012 12:45 Korvacs#34
Quote:
Originally Posted by Kiyono View Post
I see, re-uploaded with the "else" removed.
Just so your aware, its not really bad practice to do what you did, its to the point where you should consider which is more readable as the time saved is on the NS scale, not MS.
04/26/2012 16:57 _DreadNought_#35
Quote:
Originally Posted by Korvacs View Post
Just so your aware, its not really bad practice to do what you did, its to the point where you should consider which is more readable as the time saved is on the NS scale, not MS.
The difference in time is irrelevant in this case, the fact is you shouldn't have extra code that serves no point of being there.

It's like saying:
Code:
if (radioStations > 5)
     Volume = 100;
else if (RadioStations < 5)
     Volume = 0;
else
    Volume = 0;
the else if statement is totally useless, It's still nanoseconds saved by removing either the else or the else if, but its the same result removing one of the other, its bad practice...
04/26/2012 18:51 Korvacs#36
And in that case i agree with you, but in Kiyono's case even your return false isnt required as that is the last line in the method, unless of course it returns bool, but then i would prefer Kiyono's.

Having if/else rather than simply an if has no bearings on performance, and is entirely down to readability, i would not consider what Kiyono wrote to be bad practice and would challenge you to find an example where removing else return false and just having return false is considered good practice.

No offence but you dont work in the industry, so you saying its considered bad practice has no relevance to me, so unless you can find examples of it then Kiyono is free to do whichever they are most comfortable with, especially given it has no bearings on performance.
04/26/2012 19:24 CptSky#37
Removing a if/else is like removing 2-3 cycles and clocked a 2-3GHz, it represents nothing.

Between the two.
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              else 
                    return false;
I would use this:
Code:
              if (path.EndsWith(".dbc"))
                    return true;
              return false;
But, the best thing would be:
Code:
return path.EndsWith(".dbc");
Actually, in the industry using or not the else is not so important. But, we shouldn't have multiple return statement. In C#, it can be less important due to the memory management. In C/C++, it is less recommended due to the complex memory management (it can cause memory leak). Also, it's harder to debug. In case of little check at the start of the function, it's not important. But, later it's not recommended. Anyway, in this case, it's not a problem to have multiple return statement, but, we can write the function in one line and possibly, make it inline in C/C++ to avoid useless call that will slow of a few cycle :rolleyes:
04/26/2012 19:25 _DreadNought_#38
Quote:
Originally Posted by Korvacs View Post
And in that case i agree with you, but in Kiyono's case even your return false isnt required as that is the last line in the method, unless of course it returns bool, but then i would prefer Kiyono's.

Having if/else rather than simply an if has no bearings on performance, and is entirely down to readability, i would not consider what Kiyono wrote to be bad practice and would challenge you to find an example where removing else return false and just having return false is considered good practice.

No offence but you dont work in the industry, so you saying its considered bad practice has no relevance to me, so unless you can find examples of it then Kiyono is free to do whichever they are most comfortable with, especially given it has no bearings on performance.
I do not work in the coding industry, and I never wanted it to be, of course Kiyono is free todo what he wants.

Let's put it this way; In my opinion what he did was bad coding practice. with that its not a global fact but simply my opinion, ok?
04/26/2012 19:33 Korvacs#39
Quote:
Originally Posted by _DreadNought_ View Post
I do not work in the coding industry, and I never wanted it to be, of course Kiyono is free todo what he wants.

Let's put it this way; In my opinion what he did was bad coding practice. with that its not a global fact but simply my opinion, ok?
Exactly, so its not considered bad coding practice at all.

And CptSky, thank you for an informative post your absolutely right about the single line return, a much more elegant solution to the problem.
08/15/2012 08:35 AlexLane10#40
Just wondering if anyone is able to make this work on 3DEffect, 3DEffectObj and 3dtexture for the newest tq patch, fiddled around for a couple hours using multiple diff variations of the CO2_CORE_DLL x64 and x86 and every time editing 3DEffect makes all the effects in-game disappear (go off-screen, you can still see trails of weapons go to the top left corner of the screen)
06/27/2015 09:47 -impulse-#41
Here's an updated DBC Converter. It allows drag and drop and its a lot faster for EFFE.

Use EFFE.zip to update your copy of CpySky's CO2_CORE_DLL project.
06/29/2015 09:42 michiko023#42
can you teach me the steps to convert please
06/29/2015 11:03 -impulse-#43
sure.
1. open convertor
2. drag and drop dbc file over the text box of the convertor
3. click convert
4. edit file
5. drag and drop text file over the text box of the convertor
6. click convert

Done.
06/29/2015 11:25 Spirited#44
Quote:
Originally Posted by -impulse- View Post
sure.
1. open convertor
2. drag and drop dbc file over the text box of the convertor
3. click convert
4. edit file
5. drag and drop text file over the text box of the convertor
6. click convert

Done.
[Only registered and activated users can see links. Click Here To Register...]
07/01/2015 15:05 priboy16#45
i didnt understand what it dose