From 58deb3a54a19624b098bb5e4afd4ef9922b49274 Mon Sep 17 00:00:00 2001 From: CraigCraig Date: Thu, 11 May 2017 04:45:59 -0500 Subject: [PATCH] Grammar, readability, and spelling fixes [ci skip] --- src/openrct2/OpenRCT2.cpp | 4 +-- src/openrct2/drawing/line.c | 36 ++++++++++---------- src/openrct2/input.c | 2 +- src/openrct2/interface/screenshot.c | 2 +- src/openrct2/localisation/LanguagePack.cpp | 2 +- src/openrct2/localisation/convert.c | 2 +- src/openrct2/localisation/language.cpp | 2 +- src/openrct2/object/ObjectManager.cpp | 2 +- src/openrct2/paint/map_element/map_element.c | 2 +- src/openrct2/peep/peep.c | 4 +-- src/openrct2/rct2/addresses.h | 8 ++--- src/openrct2/rct2/interop.c | 2 +- src/openrct2/ride/ride.c | 6 ++-- src/openrct2/windows/guest.c | 28 +++++++-------- src/openrct2/windows/ride_construction.c | 2 +- src/openrct2/windows/shortcut_key_change.c | 2 +- src/openrct2/world/mapgen.c | 4 +-- src/openrct2/world/park.c | 2 +- src/openrct2/world/sprite.c | 2 +- 19 files changed, 57 insertions(+), 57 deletions(-) diff --git a/src/openrct2/OpenRCT2.cpp b/src/openrct2/OpenRCT2.cpp index bfa3e6721f..db5a198f96 100644 --- a/src/openrct2/OpenRCT2.cpp +++ b/src/openrct2/OpenRCT2.cpp @@ -169,8 +169,8 @@ extern "C" objRepo->LoadOrConstruct(); // TODO Like objects, this can take a while if there are a lot of track designs - // its also really something really we might want to do in the background - // as its not required until the player wants to place a new ride. + // it's also really something we might want to do in the background + // as it's not required until the player wants to place a new ride. tdRepo->Scan(); scenarioRepo->Scan(); diff --git a/src/openrct2/drawing/line.c b/src/openrct2/drawing/line.c index ee5ec7439f..bad30e151b 100644 --- a/src/openrct2/drawing/line.c +++ b/src/openrct2/drawing/line.c @@ -24,35 +24,35 @@ static void gfx_draw_line_on_buffer(rct_drawpixelinfo *dpi, char colour, sint32 { y -= dpi->y; - //Check to make sure point is in the y range + // Check to make sure point is in the y range if (y < 0)return; if (y >= dpi->height)return; - //Check to make sure we are drawing at least a pixel + // Check to make sure we are drawing at least a pixel if (!no_pixels) no_pixels++; x -= dpi->x; - //If x coord outside range leave + // If x coord outside range leave if (x < 0){ - //Unless the number of pixels is enough to be in range + // Unless the number of pixels is enough to be in range no_pixels += x; if (no_pixels <= 0)return; - //Resets starting point to 0 as we don't draw outside the range + // Resets starting point to 0 as we don't draw outside the range x = 0; } - //Ensure that the end point of the line is within range + // Ensure that the end point of the line is within range if (x + no_pixels - dpi->width > 0){ - //If the end point has any pixels outside range - //cut them off. If there are now no pixels return. + // If the end point has any pixels outside range + // cut them off. If there are now no pixels return. no_pixels -= x + no_pixels - dpi->width; if (no_pixels <= 0)return; } - //Get the buffer we are drawing to and move to the first coordinate. + // Get the buffer we are drawing to and move to the first coordinate. uint8* bits_pointer = dpi->bits + y*(dpi->pitch + dpi->width) + x; - //Draw the line to the specified colour + // Draw the line to the specified colour for (; no_pixels > 0; --no_pixels, ++bits_pointer){ *bits_pointer = colour; } @@ -87,9 +87,9 @@ void gfx_draw_line_software(rct_drawpixelinfo *dpi, sint32 x1, sint32 y1, sint32 return; } - //Bresenhams algorithm + // Bresenham's algorithm - //If vertical plot points upwards + // If vertical plot points upwards sint32 steep = abs(y2 - y1) > abs(x2 - x1); if (steep){ sint32 temp_y2 = y2; @@ -100,7 +100,7 @@ void gfx_draw_line_software(rct_drawpixelinfo *dpi, sint32 x1, sint32 y1, sint32 x1 = temp_y2; } - //If line is right to left swap direction + // If line is right to left swap direction if (x1 > x2){ sint32 temp_y2 = y2; sint32 temp_x2 = x2; @@ -116,27 +116,27 @@ void gfx_draw_line_software(rct_drawpixelinfo *dpi, sint32 x1, sint32 y1, sint32 sint32 y_step; sint32 y = y1; - //Direction of step + // Direction of step if (y1 < y2)y_step = 1; else y_step = -1; for (sint32 x = x1, x_start = x1, no_pixels = 1; x < x2; ++x,++no_pixels){ - //Vertical lines are drawn 1 pixel at a time + // Vertical lines are drawn 1 pixel at a time if (steep)gfx_draw_line_on_buffer(dpi, colour, x, y, 1); error -= delta_y; if (error < 0){ - //Non vertical lines are drawn with as many pixels in a horizontal line as possible + // Non vertical lines are drawn with as many pixels in a horizontal line as possible if (!steep)gfx_draw_line_on_buffer(dpi, colour, y, x_start, no_pixels); - //Reset non vertical line vars + // Reset non vertical line vars x_start = x + 1; no_pixels = 1; y += y_step; error += delta_x; } - //Catch the case of the last line + // Catch the case of the last line if (x + 1 == x2 && !steep){ gfx_draw_line_on_buffer(dpi, colour, y, x_start, no_pixels); } diff --git a/src/openrct2/input.c b/src/openrct2/input.c index 5de4eb0512..72a267c783 100644 --- a/src/openrct2/input.c +++ b/src/openrct2/input.c @@ -1072,7 +1072,7 @@ void process_mouse_over(sint32 x, sint32 y) ebx = 0; edi = cursorId; // Window event WE_UNKNOWN_0E was called here, but no windows actually implemented a handler and - // its not known what it was for + // it's not known what it was for cursorId = edi; if ((ebx & 0xFF) != 0) { diff --git a/src/openrct2/interface/screenshot.c b/src/openrct2/interface/screenshot.c index af45a9c394..30d517feb5 100644 --- a/src/openrct2/interface/screenshot.c +++ b/src/openrct2/interface/screenshot.c @@ -81,7 +81,7 @@ static sint32 screenshot_get_next_path(char *path, size_t size) char park_name[128]; format_string(park_name, 128, gParkName, &gParkNameArgs); - // retrieve current time + // Retrieve current time rct2_date currentDate; platform_get_date_local(¤tDate); rct2_time currentTime; diff --git a/src/openrct2/localisation/LanguagePack.cpp b/src/openrct2/localisation/LanguagePack.cpp index 5f90c1c417..a1848ad332 100644 --- a/src/openrct2/localisation/LanguagePack.cpp +++ b/src/openrct2/localisation/LanguagePack.cpp @@ -326,7 +326,7 @@ public: //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Parsing //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // Partial support to open a uncompiled language file which parses tokens and converts them to the corresponding character + // Partial support to open an uncompiled language file which parses tokens and converts them to the corresponding character // code. Due to resource strings (strings in scenarios and objects) being written to the original game's string table, // get_string will use those if the same entry in the loaded language is empty. // diff --git a/src/openrct2/localisation/convert.c b/src/openrct2/localisation/convert.c index 85c64e81bd..9df0b04db5 100644 --- a/src/openrct2/localisation/convert.c +++ b/src/openrct2/localisation/convert.c @@ -87,7 +87,7 @@ static wchar_t encoding_convert_x_to_unicode(wchar_t code, const encoding_conver wchar_t encoding_convert_unicode_to_rct2(wchar_t unicode) { - // Can't do a binary search as its sorted by RCT2 code, not unicode + // Can't do a binary search as it's sorted by RCT2 code, not unicode for (sint32 i = 0; i < countof(RCT2ToUnicodeTable); i++) { if (RCT2ToUnicodeTable[i].unicode == unicode) return RCT2ToUnicodeTable[i].code; } diff --git a/src/openrct2/localisation/language.cpp b/src/openrct2/localisation/language.cpp index f746201207..e45af5637f 100644 --- a/src/openrct2/localisation/language.cpp +++ b/src/openrct2/localisation/language.cpp @@ -111,7 +111,7 @@ bool language_open(sint32 id) gCurrentLanguage = id; TryLoadFonts(); - // Objects and their localized strings need to be refreshed + // Objects and their localised strings need to be refreshed GetObjectManager()->ResetObjects(); return true; } diff --git a/src/openrct2/object/ObjectManager.cpp b/src/openrct2/object/ObjectManager.cpp index 2d0fdf0d85..257f9f6bcf 100644 --- a/src/openrct2/object/ObjectManager.cpp +++ b/src/openrct2/object/ObjectManager.cpp @@ -297,7 +297,7 @@ private: object->Unload(); delete object; - // Because its possible to have the same loaded object for multiple + // Because it's possible to have the same loaded object for multiple // slots, we have to make sure find and set all of them to nullptr if (_loadedObjects != nullptr) { diff --git a/src/openrct2/paint/map_element/map_element.c b/src/openrct2/paint/map_element/map_element.c index c549ee0dae..de035300cd 100644 --- a/src/openrct2/paint/map_element/map_element.c +++ b/src/openrct2/paint/map_element/map_element.c @@ -255,7 +255,7 @@ static void sub_68B3FB(sint32 x, sint32 y) rct_xy16 dword_9DE574 = gPaintMapPosition; g_currently_drawn_item = map_element; - //setup the painting of for example: the underground, signs, rides, scenery, etc. + // Setup the painting of for example: the underground, signs, rides, scenery, etc. switch (map_element_get_type(map_element)) { case MAP_ELEMENT_TYPE_SURFACE: diff --git a/src/openrct2/peep/peep.c b/src/openrct2/peep/peep.c index c09741b961..b4d0accb42 100644 --- a/src/openrct2/peep/peep.c +++ b/src/openrct2/peep/peep.c @@ -4056,7 +4056,7 @@ static void peep_update_ride_sub_state_20(rct_peep* peep){ return; } - // Do not play toilet flush sound on title screen as its considered loud and annoying + // Do not play toilet flush sound on title screen as it's considered loud and annoying if (!(gScreenFlags & SCREEN_FLAGS_TITLE_DEMO)) { audio_play_sound_at_location(SOUND_TOILET_FLUSH, peep->x, peep->y, peep->z); } @@ -4838,7 +4838,7 @@ static void peep_update_queuing(rct_peep* peep){ // Fix #4819: Occasionally the peep->next_in_queue is incorrectly set // to prevent this from causing the peeps to enter a loop // first check if the next in queue is actually nearby - // if they are not then its safe to assume that this is + // if they are not then it's safe to assume that this is // the front of the queue. rct_peep* next_peep = GET_PEEP(peep->next_in_queue); if (abs(next_peep->x - peep->x) < 32 && diff --git a/src/openrct2/rct2/addresses.h b/src/openrct2/rct2/addresses.h index 2e66b25130..4f4d9f6c52 100644 --- a/src/openrct2/rct2/addresses.h +++ b/src/openrct2/rct2/addresses.h @@ -83,7 +83,7 @@ #define RCT2_ADDRESS_SPRITE_LISTS_HEAD 0x013573BC #define RCT2_ADDRESS_SPRITE_LISTS_COUNT 0x013573C8 -//How many ticks the scenario has existed for +// How many ticks the scenario has existed for #define RCT2_ADDRESS_SAVED_VIEW_X 0x0138869A #define RCT2_ADDRESS_SAVED_VIEW_Y 0x0138869C #define RCT2_ADDRESS_SAVED_VIEW_ZOOM 0x0138869E @@ -298,9 +298,9 @@ #define RCT2_ADDRESS_PARK_ENTRANCE_GHOST_EXISTS 0x009E32D2 #define RCT2_ADDRESS_PARK_ENTRANCE_GHOST_PRICE 0x009E32D3 -//Every pixel changed by rain is stored. -//32bit (pixel_offset 24 bit)(pixel_colour 8 bit) -//Use the rainPixels[] global in drawing.c from now on +// Every pixel changed by rain is stored. +// 32bit (pixel_offset 24 bit)(pixel_colour 8 bit) +// Use the rainPixels[] global in drawing.c from now on #define RCT2_ADDRESS_RAIN_PIXEL_STORE 0x00EDF850 #define RCT2_ADDRESS_UNCOMPLETED_RESEARCH_TYPES 0x00EE787C diff --git a/src/openrct2/rct2/interop.c b/src/openrct2/rct2/interop.c index e427bbb175..3378edc84b 100644 --- a/src/openrct2/rct2/interop.c +++ b/src/openrct2/rct2/interop.c @@ -183,7 +183,7 @@ bool rct2_interop_setup_segment() rct2_interop_get_segment_data_path(segmentDataPath, sizeof(segmentDataPath)); // Warning: for Windows this will fail if given a non-ASCII path, - // but given this code is temporary - its not worth resolving. + // but given this code is temporary - it's not worth resolving. FILE * file = fopen(segmentDataPath, "rb"); if (file == NULL) { diff --git a/src/openrct2/ride/ride.c b/src/openrct2/ride/ride.c index 89d2d8d8e9..b67638404b 100644 --- a/src/openrct2/ride/ride.c +++ b/src/openrct2/ride/ride.c @@ -453,7 +453,7 @@ bool ride_try_get_origin_element(sint32 rideIndex, rct_xy_element *output) // Found a track piece for target ride - // Check if its not the station or ??? (but allow end piece of station) + // Check if it's not the station or ??? (but allow end piece of station) bool specialTrackPiece = ( it.element->properties.track.type != TRACK_ELEM_BEGIN_STATION && it.element->properties.track.type != TRACK_ELEM_MIDDLE_STATION && @@ -2303,7 +2303,7 @@ static sint32 ride_get_new_breakdown_problem(rct_ride *ride) sint32 availableBreakdownProblems, monthsOld, totalProbability, randomProbability, problemBits, breakdownProblem; rct_ride_entry *entry; - // Brake failure is more likely when its raining + // Brake failure is more likely when it's raining _breakdownProblemProbabilities[BREAKDOWN_BRAKES_FAILURE] = gClimateCurrentRainLevel == 0 ? 3 : 20; entry = get_ride_entry_by_ride(ride); @@ -5294,7 +5294,7 @@ static sint32 ride_is_valid_for_open(sint32 rideIndex, sint32 goingToBeOpen, sin ride = get_ride(rideIndex); - // Check to see if construction tool in use. If it is close the construction window + // Check to see if construction tool is in use. If it is close the construction window // to set the track to its final state and clean up ghosts. // We can't just call close as it would cause a stack overflow during shop creation // with auto open on. diff --git a/src/openrct2/windows/guest.c b/src/openrct2/windows/guest.c index 81489bf271..8e22d2e606 100644 --- a/src/openrct2/windows/guest.c +++ b/src/openrct2/windows/guest.c @@ -1132,7 +1132,7 @@ void window_guest_overview_update(rct_window* w){ else w->highlighted_item++; - // Disable peep watching thought for multiplayer as its client specific + // Disable peep watching thought for multiplayer as it's client specific if (network_get_mode() == NETWORK_MODE_NONE) { // Create the "I have the strangest feeling I am being watched thought" if ((w->highlighted_item & 0xFFFF) >= 3840) { @@ -1369,16 +1369,16 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi) window_guest_thoughts_tab_paint(w, dpi); window_guest_inventory_tab_paint(w, dpi); - //ebx + // ebx rct_peep* peep = GET_PEEP(w->number); // Not sure why this is not stats widgets - //cx + // cx sint32 x = w->x + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].left + 4; - //dx + // dx sint32 y = w->y + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].top + 4; - //Happiness + // Happiness gfx_draw_string_left(dpi, STR_GUEST_STAT_HAPPINESS_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y); sint32 happiness = peep->happiness; @@ -1389,7 +1389,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi) } window_guest_stats_bars_paint(happiness, x, y, w, dpi, ebp); - //Energy + // Energy y += 10; gfx_draw_string_left(dpi, STR_GUEST_STAT_ENERGY_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y); @@ -1401,7 +1401,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi) if (energy < 10)energy = 10; window_guest_stats_bars_paint(energy, x, y, w, dpi, ebp); - //Hunger + // Hunger y += 10; gfx_draw_string_left(dpi, STR_GUEST_STAT_HUNGER_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y); @@ -1420,7 +1420,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi) } window_guest_stats_bars_paint(hunger, x, y, w, dpi, ebp); - //Thirst + // Thirst y += 10; gfx_draw_string_left(dpi, STR_GUEST_STAT_THIRST_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y); @@ -1439,7 +1439,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi) } window_guest_stats_bars_paint(thirst, x, y, w, dpi, ebp); - //Nausea + // Nausea y += 10; gfx_draw_string_left(dpi, STR_GUEST_STAT_NAUSEA_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y); @@ -1455,7 +1455,7 @@ void window_guest_stats_paint(rct_window *w, rct_drawpixelinfo *dpi) } window_guest_stats_bars_paint(nausea, x, y, w, dpi, ebp); - //Bathroom + // Bathroom y += 10; gfx_draw_string_left(dpi, STR_GUEST_STAT_TOILET_LABEL, gCommonFormatArgs, COLOUR_BLACK, x, y); @@ -1680,9 +1680,9 @@ void window_guest_rides_paint(rct_window *w, rct_drawpixelinfo *dpi) rct_peep* peep = GET_PEEP(w->number); - //cx + // cx sint32 x = w->x + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].left + 2; - //dx + // dx sint32 y = w->y + window_guest_rides_widgets[WIDX_PAGE_BACKGROUND].top + 2; gfx_draw_string_left(dpi, STR_GUEST_LABEL_RIDES_BEEN_ON, NULL, COLOUR_BLACK, x, y); @@ -1947,9 +1947,9 @@ void window_guest_thoughts_paint(rct_window *w, rct_drawpixelinfo *dpi) rct_peep* peep = GET_PEEP(w->number); - //cx + // cx sint32 x = w->x + window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].left + 4; - //dx + // dx sint32 y = w->y + window_guest_thoughts_widgets[WIDX_PAGE_BACKGROUND].top + 4; gfx_draw_string_left(dpi, STR_GUEST_RECENT_THOUGHTS_LABEL, NULL, COLOUR_BLACK, x, y); diff --git a/src/openrct2/windows/ride_construction.c b/src/openrct2/windows/ride_construction.c index 7861813d1e..f2d67acc4f 100644 --- a/src/openrct2/windows/ride_construction.c +++ b/src/openrct2/windows/ride_construction.c @@ -1802,7 +1802,7 @@ static void window_ride_construction_mouseup_demolish(rct_window* w) _rideConstructionState2 = RIDE_CONSTRUCTION_STATE_BACK; } - // Invalidate the selected track element or make sure its at origin??? + // Invalidate the selected track element or make sure it's at origin??? x = _currentTrackBeginX; y = _currentTrackBeginY; z = _currentTrackBeginZ; diff --git a/src/openrct2/windows/shortcut_key_change.c b/src/openrct2/windows/shortcut_key_change.c index 1845ab4bcb..84abe19c70 100644 --- a/src/openrct2/windows/shortcut_key_change.c +++ b/src/openrct2/windows/shortcut_key_change.c @@ -44,7 +44,7 @@ static void window_shortcut_change_mouseup(rct_window *w, rct_widgetindex widget static void window_shortcut_change_invalidate(rct_window *w); static void window_shortcut_change_paint(rct_window *w, rct_drawpixelinfo *dpi); -//0x9A3F7C +// 0x9A3F7C static rct_window_event_list window_shortcut_change_events = { NULL, window_shortcut_change_mouseup, diff --git a/src/openrct2/world/mapgen.c b/src/openrct2/world/mapgen.c index d61fd1f3a5..1242e794dd 100644 --- a/src/openrct2/world/mapgen.c +++ b/src/openrct2/world/mapgen.c @@ -200,7 +200,7 @@ void mapgen_generate(mapgen_settings *settings) // Small blobs, small hills and lakes mapgen_blobs(32, _heightSize / 32, _heightSize / 16, 4, 18); - // Smooth the land so that their aren't cliffs round every blob. + // Smooth the land so that there aren't cliffs round every blob. mapgen_smooth_height(2); } @@ -488,7 +488,7 @@ static void mapgen_blob_fill(sint32 height) for (sint32 y = top; y <= bottom; y++) { if (y >= firstLand && y <= lastLand && landX[x * _heightSize + y]) { - // Not only do we know its landlocked to both x and y + // Not only do we know it's landlocked to both x and y // we can change the land too set_height(x, y, BLOB_HEIGHT); } diff --git a/src/openrct2/world/park.c b/src/openrct2/world/park.c index 323cba9b16..c11ac09383 100644 --- a/src/openrct2/world/park.c +++ b/src/openrct2/world/park.c @@ -359,7 +359,7 @@ void reset_park_entry() /** * Calculates the probability of a new guest. Also sets total ride value and suggested guest maximum. - * Total ride value should probably be set else where, as its not just used for guest generation. + * Total ride value should probably be set elsewhere, as it's not just used for guest generation. * Suggested guest maximum should probably be an output result, not a global. * @returns A probability out of 65535 * rct2: 0x0066730A diff --git a/src/openrct2/world/sprite.c b/src/openrct2/world/sprite.c index d0e8127212..47ad51e5f5 100644 --- a/src/openrct2/world/sprite.c +++ b/src/openrct2/world/sprite.c @@ -697,7 +697,7 @@ void litter_remove_at(sint32 x, sint32 y, sint32 z) } /** - * Determines whether its worth tweening a sprite or not when frame smoothing is on. + * Determines whether it's worth tweening a sprite or not when frame smoothing is on. */ static bool sprite_should_tween(rct_sprite *sprite) {