Loading

Coding style genworld_gui

  1. # HG changeset patch
  2. # User chillcore
  3. # Date 1423430735 -3600
  4. #      zo feb 08 22:25:35 2015 +0100
  5. # Node ID 3a112fa300c7e566a64ce2554b104d2f103bf87c
  6. # Parent  57d01e891aafaae33c048ea60c97b09e452bc812
  7. Fix: Coding style genworld gui
  8.  
  9. diff -r 57d01e891aaf -r 3a112fa300c7 src/genworld_gui.cpp
  10. --- a/src/genworld_gui.cpp  zo feb 08 21:05:48 2015 +0000
  11. +++ b/src/genworld_gui.cpp  zo feb 08 22:25:35 2015 +0100
  12. @@ -44,8 +44,8 @@
  13.  };
  14.  
  15.  /**
  16. - * Changes landscape type and sets genworld window dirty
  17. - * @param landscape new landscape type
  18. + * Changes landscape type and sets genworld window dirty.
  19. + * @param landscape new landscape type.
  20.   */
  21.  void SetNewLandscapeType(byte landscape)
  22.  {
  23. @@ -54,7 +54,7 @@
  24.     InvalidateWindowClassesData(WC_GENERATE_LANDSCAPE);
  25.  }
  26.  
  27. -/** Widgets of GenerateLandscapeWindow when generating world */
  28. +/** Widgets of GenerateLandscapeWindow when generating world. */
  29.  static const NWidgetPart _nested_generate_landscape_widgets[] = {
  30.     NWidget(NWID_HORIZONTAL),
  31.         NWidget(WWT_CLOSEBOX, COLOUR_BROWN),
  32. @@ -172,7 +172,7 @@
  33.     EndContainer(),
  34.  };
  35.  
  36. -/** Widgets of GenerateLandscapeWindow when loading heightmap */
  37. +/** Widgets of GenerateLandscapeWindow when loading heightmap. */
  38.  static const NWidgetPart _nested_heightmap_load_widgets[] = {
  39.     /* Window header. */
  40.     NWidget(NWID_HORIZONTAL),
  41. @@ -263,7 +263,7 @@
  42.     DeleteAllNonVitalWindows();
  43.     ClearErrorMessages();
  44.  
  45. -   /* Copy all XXX_newgame to XXX when coming from outside the editor */
  46. +   /* Copy all XXX_newgame to XXX when coming from outside the editor. */
  47.     MakeNewgameSettingsLive();
  48.     ResetGRFConfig(true);
  49.  
  50. @@ -322,7 +322,7 @@
  51.  
  52.         this->mode = (GenerateLandscapeWindowMode)this->window_number;
  53.  
  54. -       /* Disable town, industry and trees in SE */
  55. +       /* Disable town, industry and trees pulldown in Scenario Editor. */
  56.         this->SetWidgetDisabledState(WID_GL_TOWN_PULLDOWN,     _game_mode == GM_EDITOR);
  57.         this->SetWidgetDisabledState(WID_GL_INDUSTRY_PULLDOWN, _game_mode == GM_EDITOR);
  58.         this->SetWidgetDisabledState(WID_GL_TREE_PULLDOWN,     _game_mode == GM_EDITOR);
  59. @@ -395,13 +395,13 @@
  60.     virtual void OnInvalidateData(int data = 0, bool gui_scope = true)
  61.     {
  62.         if (!gui_scope) return;
  63. -       /* Update the climate buttons */
  64. +       /* Update the climate buttons. */
  65.         this->SetWidgetLoweredState(WID_GL_TEMPERATE, _settings_newgame.game_creation.landscape == LT_TEMPERATE);
  66.         this->SetWidgetLoweredState(WID_GL_ARCTIC,    _settings_newgame.game_creation.landscape == LT_ARCTIC);
  67.         this->SetWidgetLoweredState(WID_GL_TROPICAL,  _settings_newgame.game_creation.landscape == LT_TROPIC);
  68.         this->SetWidgetLoweredState(WID_GL_TOYLAND,   _settings_newgame.game_creation.landscape == LT_TOYLAND);
  69.  
  70. -       /* You can't select smoothness / non-water borders if not terragenesis */
  71. +       /* You can't select smoothness / non-water borders if not terragenesis. */
  72.         if (mode == GLWM_GENERATE) {
  73.             this->SetWidgetDisabledState(WID_GL_SMOOTHNESS_PULLDOWN, _settings_newgame.game_creation.land_generator == 0);
  74.             this->SetWidgetDisabledState(WID_GL_VARIETY_PULLDOWN, _settings_newgame.game_creation.land_generator == 0);
  75. @@ -420,10 +420,10 @@
  76.                     WID_GL_TERRAIN_PULLDOWN, WID_GL_WATER_PULLDOWN, WIDGET_LIST_END);
  77.         }
  78.  
  79. -       /* Disable snowline if not arctic */
  80. +       /* Disable snowline if not arctic. */
  81.         this->SetWidgetDisabledState(WID_GL_SNOW_LEVEL_TEXT, _settings_newgame.game_creation.landscape != LT_ARCTIC);
  82.  
  83. -       /* Update availability of decreasing / increasing start date and snow level */
  84. +       /* Update availability of decreasing / increasing start date and snow level. */
  85.         this->SetWidgetDisabledState(WID_GL_MAX_HEIGHTLEVEL_DOWN, _settings_newgame.construction.max_heightlevel <= MIN_MAX_HEIGHTLEVEL);
  86.         this->SetWidgetDisabledState(WID_GL_MAX_HEIGHTLEVEL_UP, _settings_newgame.construction.max_heightlevel >= MAX_MAX_HEIGHTLEVEL);
  87.         this->SetWidgetDisabledState(WID_GL_START_DATE_DOWN, _settings_newgame.game_creation.starting_year <= MIN_YEAR);
  88. @@ -537,23 +537,23 @@
  89.                 SetNewLandscapeType(widget - WID_GL_TEMPERATE);
  90.                 break;
  91.  
  92. -           case WID_GL_MAPSIZE_X_PULLDOWN: // Mapsize X
  93. +           case WID_GL_MAPSIZE_X_PULLDOWN: // Mapsize X.
  94.                 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_x, WID_GL_MAPSIZE_X_PULLDOWN);
  95.                 break;
  96.  
  97. -           case WID_GL_MAPSIZE_Y_PULLDOWN: // Mapsize Y
  98. +           case WID_GL_MAPSIZE_Y_PULLDOWN: // Mapsize Y.
  99.                 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, WID_GL_MAPSIZE_Y_PULLDOWN);
  100.                 break;
  101.  
  102. -           case WID_GL_TOWN_PULLDOWN: // Number of towns
  103. +           case WID_GL_TOWN_PULLDOWN: // Number of towns.
  104.                 ShowDropDownMenu(this, _num_towns, _settings_newgame.difficulty.number_towns, WID_GL_TOWN_PULLDOWN, 0, 0);
  105.                 break;
  106.  
  107. -           case WID_GL_INDUSTRY_PULLDOWN: // Number of industries
  108. +           case WID_GL_INDUSTRY_PULLDOWN: // Number of industries.
  109.                 ShowDropDownMenu(this, _num_inds, _settings_newgame.difficulty.industry_density, WID_GL_INDUSTRY_PULLDOWN, 0, 0);
  110.                 break;
  111.  
  112. -           case WID_GL_GENERATE_BUTTON: { // Generate
  113. +           case WID_GL_GENERATE_BUTTON: { // Generate.
  114.                 /* Get rotated map size. */
  115.                 uint map_x;
  116.                 uint map_y;
  117. @@ -581,8 +581,8 @@
  118.             }
  119.  
  120.             case WID_GL_MAX_HEIGHTLEVEL_DOWN:
  121. -           case WID_GL_MAX_HEIGHTLEVEL_UP: // Height level buttons
  122. -               /* Don't allow too fast scrolling */
  123. +           case WID_GL_MAX_HEIGHTLEVEL_UP: // Height level buttons.
  124. +               /* Don't allow too fast scrolling. */
  125.                 if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
  126.                     this->HandleButtonClick(widget);
  127.  
  128. @@ -592,7 +592,7 @@
  129.                 _left_button_clicked = false;
  130.                 break;
  131.  
  132. -           case WID_GL_MAX_HEIGHTLEVEL_TEXT: // Height level text
  133. +           case WID_GL_MAX_HEIGHTLEVEL_TEXT: // Height level text.
  134.                 this->widget_id = WID_GL_MAX_HEIGHTLEVEL_TEXT;
  135.                 SetDParam(0, _settings_newgame.construction.max_heightlevel);
  136.                 ShowQueryString(STR_JUST_INT, STR_MAPGEN_MAX_HEIGHTLEVEL_QUERY_CAPT, 4, this, CS_NUMERAL, QSF_ENABLE_DEFAULT);
  137. @@ -600,8 +600,8 @@
  138.  
  139.  
  140.             case WID_GL_START_DATE_DOWN:
  141. -           case WID_GL_START_DATE_UP: // Year buttons
  142. -               /* Don't allow too fast scrolling */
  143. +           case WID_GL_START_DATE_UP: // Year buttons.
  144. +               /* Don't allow too fast scrolling. */
  145.                 if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
  146.                     this->HandleButtonClick(widget);
  147.  
  148. @@ -611,15 +611,15 @@
  149.                 _left_button_clicked = false;
  150.                 break;
  151.  
  152. -           case WID_GL_START_DATE_TEXT: // Year text
  153. +           case WID_GL_START_DATE_TEXT: // Year text.
  154.                 this->widget_id = WID_GL_START_DATE_TEXT;
  155.                 SetDParam(0, _settings_newgame.game_creation.starting_year);
  156.                 ShowQueryString(STR_JUST_INT, STR_MAPGEN_START_DATE_QUERY_CAPT, 8, this, CS_NUMERAL, QSF_ENABLE_DEFAULT);
  157.                 break;
  158.  
  159.             case WID_GL_SNOW_LEVEL_DOWN:
  160. -           case WID_GL_SNOW_LEVEL_UP: // Snow line buttons
  161. -               /* Don't allow too fast scrolling */
  162. +           case WID_GL_SNOW_LEVEL_UP: // Snow line buttons.
  163. +               /* Don't allow too fast scrolling. */
  164.                 if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
  165.                     this->HandleButtonClick(widget);
  166.  
  167. @@ -629,30 +629,30 @@
  168.                 _left_button_clicked = false;
  169.                 break;
  170.  
  171. -           case WID_GL_SNOW_LEVEL_TEXT: // Snow line text
  172. +           case WID_GL_SNOW_LEVEL_TEXT: // Snow line text.
  173.                 this->widget_id = WID_GL_SNOW_LEVEL_TEXT;
  174.                 SetDParam(0, _settings_newgame.game_creation.snow_line_height);
  175.                 ShowQueryString(STR_JUST_INT, STR_MAPGEN_SNOW_LINE_QUERY_CAPT, 4, this, CS_NUMERAL, QSF_ENABLE_DEFAULT);
  176.                 break;
  177.  
  178. -           case WID_GL_TREE_PULLDOWN: // Tree placer
  179. +           case WID_GL_TREE_PULLDOWN: // Tree placer.
  180.                 ShowDropDownMenu(this, _tree_placer, _settings_newgame.game_creation.tree_placer, WID_GL_TREE_PULLDOWN, 0, 0);
  181.                 break;
  182.  
  183. -           case WID_GL_LANDSCAPE_PULLDOWN: // Landscape generator
  184. +           case WID_GL_LANDSCAPE_PULLDOWN: // Landscape generator.
  185.                 ShowDropDownMenu(this, _landscape, _settings_newgame.game_creation.land_generator, WID_GL_LANDSCAPE_PULLDOWN, 0, 0);
  186.                 break;
  187.  
  188. -           case WID_GL_HEIGHTMAP_ROTATION_PULLDOWN: // Heightmap rotation
  189. +           case WID_GL_HEIGHTMAP_ROTATION_PULLDOWN: // Heightmap rotation.
  190.                 ShowDropDownMenu(this, _rotation, _settings_newgame.game_creation.heightmap_rotation, WID_GL_HEIGHTMAP_ROTATION_PULLDOWN, 0, 0);
  191.                 break;
  192.  
  193. -           case WID_GL_TERRAIN_PULLDOWN: // Terrain type
  194. +           case WID_GL_TERRAIN_PULLDOWN: // Terrain type.
  195.                 /* For the original map generation only the first four are valid. */
  196.                 ShowDropDownMenu(this, _elevations, _settings_newgame.difficulty.terrain_type, WID_GL_TERRAIN_PULLDOWN, 0, _settings_newgame.game_creation.land_generator == LG_ORIGINAL ? ~0xF : 0);
  197.                 break;
  198.  
  199. -           case WID_GL_WATER_PULLDOWN: { // Water quantity
  200. +           case WID_GL_WATER_PULLDOWN: { // Water quantity.
  201.                 uint32 hidden_mask = 0;
  202.                 /* Disable custom water level when the original map generator is active. */
  203.                 if (_settings_newgame.game_creation.land_generator == 0) {
  204. @@ -662,19 +662,19 @@
  205.                 break;
  206.             }
  207.  
  208. -           case WID_GL_RIVER_PULLDOWN: // Amount of rivers
  209. +           case WID_GL_RIVER_PULLDOWN: // Amount of rivers.
  210.                 ShowDropDownMenu(this, _rivers, _settings_newgame.game_creation.amount_of_rivers, WID_GL_RIVER_PULLDOWN, 0, 0);
  211.                 break;
  212.  
  213. -           case WID_GL_SMOOTHNESS_PULLDOWN: // Map smoothness
  214. +           case WID_GL_SMOOTHNESS_PULLDOWN: // Map smoothness.
  215.                 ShowDropDownMenu(this, _smoothness, _settings_newgame.game_creation.tgen_smoothness, WID_GL_SMOOTHNESS_PULLDOWN, 0, 0);
  216.                 break;
  217.  
  218. -           case WID_GL_VARIETY_PULLDOWN: // Map variety
  219. +           case WID_GL_VARIETY_PULLDOWN: // Map variety.
  220.                 ShowDropDownMenu(this, _variety, _settings_newgame.game_creation.variety, WID_GL_VARIETY_PULLDOWN, 0, 0);
  221.                 break;
  222.  
  223. -           /* Freetype map borders */
  224. +           /* Freeform map borders. */
  225.             case WID_GL_WATER_NW:
  226.                 _settings_newgame.game_creation.water_borders = ToggleBit(_settings_newgame.game_creation.water_borders, BORDER_NW);
  227.                 this->InvalidateData();
  228. @@ -766,7 +766,7 @@
  229.         if (!StrEmpty(str)) {
  230.             value = atoi(str);
  231.         } else {
  232. -           /* An empty string means revert to the default */
  233. +           /* An empty string means revert to the default. */
  234.             switch (this->widget_id) {
  235.                 case WID_GL_MAX_HEIGHTLEVEL_TEXT: value = DEF_MAX_HEIGHTLEVEL; break;
  236.                 case WID_GL_START_DATE_TEXT: value = DEF_START_YEAR; break;
  237. @@ -827,11 +827,11 @@
  238.  
  239.     DeleteWindowByClass(WC_GENERATE_LANDSCAPE);
  240.  
  241. -   /* Generate a new seed when opening the window */
  242. +   /* Generate a new seed when opening the window. */
  243.     _settings_newgame.game_creation.generation_seed = InteractiveRandom();
  244.  
  245.     if (mode == GLWM_HEIGHTMAP) {
  246. -       /* If the function returns negative, it means there was a problem loading the heightmap */
  247. +       /* If the function returns negative, it means there was a problem loading the heightmap. */
  248.         if (!GetHeightmapDimensions(_file_to_saveload.name, &x, &y)) return;
  249.     }
  250.  
  251. @@ -871,7 +871,7 @@
  252.   */
  253.  void StartNewGameWithoutGUI(uint seed)
  254.  {
  255. -   /* GenerateWorld takes care of the possible GENERATE_NEW_SEED value in 'seed' */
  256. +   /* GenerateWorld takes care of the possible GENERATE_NEW_SEED value in 'seed'. */
  257.     _settings_newgame.game_creation.generation_seed = seed;
  258.  
  259.     StartGeneratingLandscape(GLWM_GENERATE);
  260. @@ -960,25 +960,25 @@
  261.                 SetNewLandscapeType(widget - WID_CS_TEMPERATE);
  262.                 break;
  263.  
  264. -           case WID_CS_MAPSIZE_X_PULLDOWN: // Mapsize X
  265. +           case WID_CS_MAPSIZE_X_PULLDOWN: // Mapsize X.
  266.                 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_x, WID_CS_MAPSIZE_X_PULLDOWN);
  267.                 break;
  268.  
  269. -           case WID_CS_MAPSIZE_Y_PULLDOWN: // Mapsize Y
  270. +           case WID_CS_MAPSIZE_Y_PULLDOWN: // Mapsize Y.
  271.                 ShowDropDownList(this, BuildMapsizeDropDown(), _settings_newgame.game_creation.map_y, WID_CS_MAPSIZE_Y_PULLDOWN);
  272.                 break;
  273.  
  274. -           case WID_CS_EMPTY_WORLD: // Empty world / flat world
  275. +           case WID_CS_EMPTY_WORLD: // Empty world / flat world.
  276.                 StartGeneratingLandscape(GLWM_SCENARIO);
  277.                 break;
  278.  
  279. -           case WID_CS_RANDOM_WORLD: // Generate
  280. +           case WID_CS_RANDOM_WORLD: // Generate.
  281.                 ShowGenerateLandscape();
  282.                 break;
  283.  
  284.             case WID_CS_START_DATE_DOWN:
  285. -           case WID_CS_START_DATE_UP: // Year buttons
  286. -               /* Don't allow too fast scrolling */
  287. +           case WID_CS_START_DATE_UP: // Year buttons.
  288. +               /* Don't allow too fast scrolling. */
  289.                 if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
  290.                     this->HandleButtonClick(widget);
  291.                     this->SetDirty();
  292. @@ -988,15 +988,15 @@
  293.                 _left_button_clicked = false;
  294.                 break;
  295.  
  296. -           case WID_CS_START_DATE_TEXT: // Year text
  297. +           case WID_CS_START_DATE_TEXT: // Year text.
  298.                 this->widget_id = WID_CS_START_DATE_TEXT;
  299.                 SetDParam(0, _settings_newgame.game_creation.starting_year);
  300.                 ShowQueryString(STR_JUST_INT, STR_MAPGEN_START_DATE_QUERY_CAPT, 8, this, CS_NUMERAL, QSF_NONE);
  301.                 break;
  302.  
  303.             case WID_CS_FLAT_LAND_HEIGHT_DOWN:
  304. -           case WID_CS_FLAT_LAND_HEIGHT_UP: // Height level buttons
  305. -               /* Don't allow too fast scrolling */
  306. +           case WID_CS_FLAT_LAND_HEIGHT_UP: // Height level buttons.
  307. +               /* Don't allow too fast scrolling. */
  308.                 if (!(this->flags & WF_TIMEOUT) || this->timeout_timer <= 1) {
  309.                     this->HandleButtonClick(widget);
  310.                     this->SetDirty();
  311. @@ -1006,7 +1006,7 @@
  312.                 _left_button_clicked = false;
  313.                 break;
  314.  
  315. -           case WID_CS_FLAT_LAND_HEIGHT_TEXT: // Height level text
  316. +           case WID_CS_FLAT_LAND_HEIGHT_TEXT: // Height level text.
  317.                 this->widget_id = WID_CS_FLAT_LAND_HEIGHT_TEXT;
  318.                 SetDParam(0, _settings_newgame.game_creation.se_flat_world_height);
  319.                 ShowQueryString(STR_JUST_INT, STR_SE_MAPGEN_FLAT_WORLD_HEIGHT_QUERY_CAPT, 4, this, CS_NUMERAL, QSF_NONE);
  320. @@ -1076,7 +1076,7 @@
  321.                 NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_CS_EMPTY_WORLD), SetDataTip(STR_SE_MAPGEN_FLAT_WORLD, STR_SE_MAPGEN_FLAT_WORLD_TOOLTIP), SetFill(1, 1),
  322.                 NWidget(WWT_PUSHTXTBTN, COLOUR_GREEN, WID_CS_RANDOM_WORLD), SetDataTip(STR_SE_MAPGEN_RANDOM_LAND, STR_TERRAFORM_TOOLTIP_GENERATE_RANDOM_LAND), SetFill(1, 1),
  323.             EndContainer(),
  324. -           /* Labels + setting drop-downs */
  325. +           /* Labels + setting drop-downs. */
  326.             NWidget(NWID_VERTICAL), SetPIP(10, 6, 10),
  327.                 /* Map size. */
  328.                 NWidget(NWID_HORIZONTAL),
  329. @@ -1207,7 +1207,7 @@
  330.             case WID_GP_PROGRESS_BAR: {
  331.                 SetDParamMaxValue(0, 100);
  332.                 *size = GetStringBoundingBox(STR_GENERATION_PROGRESS);
  333. -               /* We need some spacing for the 'border' */
  334. +               /* We need some spacing for the 'border'. */
  335.                 size->height += 8;
  336.                 size->width += 8;
  337.                 break;
  338. @@ -1226,7 +1226,7 @@
  339.     {
  340.         switch (widget) {
  341.             case WID_GP_PROGRESS_BAR:
  342. -               /* Draw the % complete with a bar and a text */
  343. +               /* Draw the % complete with a bar and a text. */
  344.                 DrawFrameRect(r.left, r.top, r.right, r.bottom, COLOUR_GREY, FR_BORDERONLY);
  345.                 DrawFrameRect(r.left + 1, r.top + 1, (int)((r.right - r.left - 2) * _gws.percent / 100) + r.left + 1, r.bottom - 1, COLOUR_MAUVE, FR_NONE);
  346.                 SetDParam(0, _gws.percent);
  347. @@ -1234,10 +1234,10 @@
  348.                 break;
  349.  
  350.             case WID_GP_PROGRESS_TEXT:
  351. -               /* Tell which class we are generating */
  352. +               /* Tell which class we are generating. */
  353.                 DrawString(r.left, r.right, r.top, _gws.cls, TC_FROMSTRING, SA_HOR_CENTER);
  354.  
  355. -               /* And say where we are in that class */
  356. +               /* And say where we are in that class. */
  357.                 SetDParam(0, _gws.current);
  358.                 SetDParam(1, _gws.total);
  359.                 DrawString(r.left, r.right, r.top + FONT_HEIGHT_NORMAL + WD_PAR_VSEP_NORMAL, STR_GENERATION_PROGRESS_NUM, TC_FROMSTRING, SA_HOR_CENTER);
  360. @@ -1254,7 +1254,7 @@
  361.     _gws.current = 0;
  362.     _gws.total   = 0;
  363.     _gws.percent = 0;
  364. -   _gws.timer   = 0; // Forces to paint the progress window immediately
  365. +   _gws.timer   = 0; // Forces to paint the progress window immediately.
  366.  }
  367.  
  368.  /**
  369. @@ -1272,7 +1272,7 @@
  370.     assert_compile(lengthof(percent_table) == GWP_CLASS_COUNT + 1);
  371.     assert(cls < GWP_CLASS_COUNT);
  372.  
  373. -   /* Do not run this function if we aren't in a thread */
  374. +   /* Do not run this function if we aren't in a thread. */
  375.     if (!IsGenerateWorldThreaded() && !_network_dedicated) return;
  376.  
  377.     if (IsGeneratingWorldAborted()) HandleGeneratingWorldAbortion();
  378. @@ -1288,28 +1288,28 @@
  379.         _gws.percent = percent_table[cls];
  380.     }
  381.  
  382. -   /* Don't update the screen too often. So update it once in every once in a while... */
  383. +   /* Don't update the screen too often. So update it once every once in a while. */
  384.     if (!_network_dedicated && _gws.timer != 0 && _realtime_tick - _gws.timer < MODAL_PROGRESS_REDRAW_TIMEOUT) return;
  385.  
  386. -   /* Percentage is about the number of completed tasks, so 'current - 1' */
  387. +   /* Percentage is about the number of completed tasks, so 'current - 1'. */
  388.     _gws.percent = percent_table[cls] + (percent_table[cls + 1] - percent_table[cls]) * (_gws.current == 0 ? 0 : _gws.current - 1) / _gws.total;
  389.  
  390.     if (_network_dedicated) {
  391.         static uint last_percent = 0;
  392.  
  393. -       /* Never display 0% */
  394. +       /* Never display 0%. */
  395.         if (_gws.percent == 0) return;
  396. -       /* Reset if percent is lower than the last recorded */
  397. +       /* Reset if percent is lower than the last recorded. */
  398.         if (_gws.percent < last_percent) last_percent = 0;
  399. -       /* Display every 5%, but 6% is also very valid.. just not smaller steps than 5% */
  400. +       /* Display every 5%, but 6% is also very valid.. just not smaller steps than 5%. */
  401.         if (_gws.percent % 5 != 0 && _gws.percent <= last_percent + 5) return;
  402. -       /* Never show steps smaller than 2%, even if it is a mod 5% */
  403. +       /* Never show steps smaller than 2%, even if it is a mod 5%. */
  404.         if (_gws.percent <= last_percent + 2) return;
  405.  
  406.         DEBUG(net, 1, "Map generation percentage complete: %d", _gws.percent);
  407.         last_percent = _gws.percent;
  408.  
  409. -       /* Don't continue as dedicated never has a thread running */
  410. +       /* Don't continue as dedicated never has a thread running. */
  411.         return;
  412.     }
  413.  
  414. @@ -1319,7 +1319,7 @@
  415.     /* Release the rights to the map generator, and acquire the rights to the
  416.      * paint thread. The 'other' thread already has the paint thread rights so
  417.      * this ensures us that we are waiting until the paint thread is done
  418. -    * before we reacquire the mapgen rights */
  419. +    * before we reacquire the mapgen rights. */
  420.     _modal_progress_work_mutex->EndCritical();
  421.     _modal_progress_paint_mutex->BeginCritical();
  422.     _modal_progress_work_mutex->BeginCritical();
  423. @@ -1352,6 +1352,6 @@
  424.   */
  425.  void IncreaseGeneratingWorldProgress(GenWorldProgress cls)
  426.  {
  427. -   /* In fact the param 'class' isn't needed.. but for some security reasons, we want it around */
  428. +   /* In fact the param 'class' isn't needed.. but for some security reasons, we want it around. */
  429.     _SetGeneratingWorldProgress(cls, 1, 0);
  430.  }

Comments