New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro. #887
Replaced a ton of ConsoleMethods with the DefineConsoleMethod Macro. #887
Conversation
Awesome work, and thanks for the PR! This is a big step forwards. Ubuntu fails because of including |
static const U32 bufSize = 256; | ||
char *returnBuffer = Con::getReturnBuffer( bufSize ); | ||
dSprintf( returnBuffer, bufSize, "%f %f %f", movePoint.x, movePoint.y, movePoint.z ); | ||
char *returnBuffer = Con::getReturnBuffer( 256 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Erm... This change and several others in this PR are undoing proper return buffersize handling. They need to be fixed.
Thanks @dottools for the detailed review! Hadn't gotten around to it myself. I'm curious whether all those |
Yeah... I wouldn't trust "" to point to the same memory location at all times since it is per compiler and compiler settings specific as to how that'll work. Not to mention with optimizations you just can't trust "" to be in the same memory location as another empty string ("") used in another source file. An idea to tackle this situation, Andrew Mac suggested introducing a new #define dStrcmpEmpty(_var) (*_var == '\0')
// Usage examples
if(dStrcmpEmpty(MissionAreaName))
{
// MissionAreaName is an empty string
}
if(!dStrcmpEmpty(MissionAreaName))
{
// MissionAreaName is not an empty string
} I'm sure somebody could also come up with a C++ inlined template variant with type safety to ensure only variables of type Anyway, there's probably other problems I haven't spotted that hopefully others will take the initiative to review this PR as well, so we can make sure no other problems are left unnoticed. |
I’m going to be updating the pr here in a bit (I removed some quoted text. @eightyeight) |
@dottools if it's only applicable to @Winterleaf seems like |
So what failed on this in linux? I have no idea how to read the log. |
All fixed now! Let me know if you all find anything else with it. |
{ | ||
if ( argc < 4 ) | ||
if ( delimiter == "" ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops.
@Winterleaf note that I'd prefer all these strinc comparisons to use |
Fixed |
DefineEngineFunction(calcExplosionCoverage, F32, (Point3F pos, S32 id, U32 covMask),(Point3F(0.0f,0.0f,0.0f), NULL, NULL), | ||
//I could possible see a use with passing in a null covMask, but even that | ||
//sounds flaky because it will be 100 percent if your saying not to take | ||
//any thing in consideration for coverage. So I'm removing these defaults they are just bad. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove comment and add it to the GitHub issue (either in the description or as a comment). It will be recoverable using git blame if someone notices that the defaults have changed, and if nobody notices then they don't need to know that there used to be defaults.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How exactly do you do that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use git blame?
Resubmitted with merge and fixes. |
Cleaned up the ConsoleMethods and converted them to DefineConsoleMethods. Mainly the ConsoleMethods left are the ones that take a variable amount of parameters. They will need to be cleaned up in a later pass.