From: SourceForge.net <no...@so...> - 2009-04-18 17:48:14
|
Patches item #2741555, was opened at 2009-04-07 12:22 Message generated for change (Settings changed) made by bullet_catcher You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=303248&aid=2741555&group_id=3248 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: BZFlag Group: None >Status: Closed >Resolution: Accepted Priority: 5 Private: No Submitted By: Phani Krishna (phanikrishna) >Assigned to: Bullet Catcher (bullet_catcher) Summary: The help statement entered is divided into an array of words Initial Comment: The function makeHelpString(*help) in the HUDRenderer.cxx file is implemented in such a manner that it now makes a list of all the words in the given help message rather than forming a new string that has implicit null characters to separate the words. This will help reduce the job (to parse based on null chars) when the message is to be printed. Instead, the formed list of words can be used effectively. ---------------------------------------------------------------------- >Comment By: Bullet Catcher (bullet_catcher) Date: 2009-04-18 10:48 Message: new.patch has been committed to BZFlag as revision 19694. Thanks! ---------------------------------------------------------------------- Comment By: Bullet Catcher (bullet_catcher) Date: 2009-04-17 00:47 Message: With latest.patch I get a segmentation fault in makeHelpString() at the first listOfWords.back()+=word; statement. I suspect this is because the listOfWords vector is empty at that point. To test your next patch, please run bzflag and connect to the "Test Server - Random map" server at bzflag3.norang.ca:10000. Drive around and pick up lots of flags, checking to see that the flag help (just below the mouse box) looks good for each flag. Be sure to test the case where the help message is too long to fit on one line. You may have to increase the font size in the options menu to make that happen. Also, please note part 9 in the Formatting section of the DEVINFO file, which says to put spaces around operators. Thus, the statement above should be formatted as listOfWords.back() += word; With spaces on both sides of "+=". ---------------------------------------------------------------------- Comment By: Bullet Catcher (bullet_catcher) Date: 2009-04-16 10:35 Message: With the current patch, the while loop in makeHelpString() loops infinitely when starting the bzflag program. Less critical, you changed the "position" variable from "unsigned int" to "int" type, which seems to require casting almost every time it is used. Using std::string::size_type will eliminate the need for casting and make the code less error prone. There are a couple of other places in the patch where variable types could be changed to eliminate the need for casting, too. Finally, your most recent patch is against an older Subversion revision. Other changes have occurred to HUDRenderer.cxx that make it difficult to apply your patch to the most recent revision. It is best do a "svn update" command and resolve any conflicts before creating a patch file. ---------------------------------------------------------------------- Comment By: Jeff Myers (jeffm2501) Date: 2009-04-12 13:06 Message: This patch could not have been compiled. It contains many basic syntax and coding errors. ---------------------------------------------------------------------- Comment By: Bullet Catcher (bullet_catcher) Date: 2009-04-11 22:51 Message: There are several compile-time errors in HUDRenderer.cxx with the current version of this patch, including a misspelled variable name and another for which its declaration is commented out by the patch. At the very least, we expect patches to compile successfully. We also hope you would run the program and confirm that your change works as expected. Also, when you replace a section of code as you did in the setFlagHelp() method, please just delete the old code rather than comment it out. We can reference the previous version in the Subversion repository if necessary. Your work is improving. Please try again. ---------------------------------------------------------------------- Comment By: Yassen (yassen) Date: 2009-04-08 15:01 Message: I've tried applying this patch to the trunk (r19628), but it won't compile because: 1) You're using types with out std:: (you should be using std::vector<std::string>, not vector<string>) 2) You're calling some functions that don't exist (fm.getStrLength is not a function, perhaps you want fm.getStrWidth ?) 3) You haven't updated the other functions that use makeHelpString(help) to use the vector, they still think it's a string. -Yassen ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=303248&aid=2741555&group_id=3248 |