Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 739a140

Browse files
committed
Changed FrameMan methods that took strings to take const string references
Made PerformanceMan global pitch setting pass no parameters so it won't affect immobile sounds or music Snuck in a little change to default settings so loading screen defaults to off for speed purposes
1 parent 4be220b commit 739a140

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Managers/FrameMan.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -438,13 +438,13 @@ namespace RTE {
438438

439439
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
440440

441-
unsigned short FrameMan::CalculateTextHeight(std::string text, unsigned short maxWidth, bool isSmall) {
441+
unsigned short FrameMan::CalculateTextHeight(const std::string &text, unsigned short maxWidth, bool isSmall) {
442442
return isSmall ? GetSmallFont()->CalculateHeight(text, maxWidth) : GetLargeFont()->CalculateHeight(text, maxWidth);
443443
}
444444

445445
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
446446

447-
unsigned short FrameMan::CalculateTextWidth(std::string text, bool isSmall) {
447+
unsigned short FrameMan::CalculateTextWidth(const std::string &text, bool isSmall) {
448448
return isSmall ? GetSmallFont()->CalculateWidth(text) : GetLargeFont()->CalculateWidth(text);
449449
}
450450

@@ -522,7 +522,7 @@ namespace RTE {
522522

523523
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
524524

525-
bool FrameMan::LoadPalette(std::string palettePath) {
525+
bool FrameMan::LoadPalette(const std::string &palettePath) {
526526
PALETTE newPalette;
527527
BITMAP *tempBitmap = load_bitmap(palettePath.c_str(), newPalette);
528528
RTEAssert(tempBitmap, ("Failed to load palette from bitmap with following path:\n\n" + palettePath).c_str());

Managers/FrameMan.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ namespace RTE {
279279
/// <param name="text">Text string.</param>
280280
/// <param name="isSmall">Whether to use small or large font.</param>
281281
/// <returns>Width of the text string.</returns>
282-
unsigned short CalculateTextWidth(std::string text, bool isSmall);
282+
unsigned short CalculateTextWidth(const std::string &text, bool isSmall);
283283

284284
/// <summary>
285285
/// Calculates the height of a text string using the given font size.
@@ -288,7 +288,7 @@ namespace RTE {
288288
/// <param name="maxWidth">Maximum width of the text string.</param>
289289
/// <param name="isSmall">Whether to use small or large font.</param>
290290
/// <returns>Height of the text string.</returns>
291-
unsigned short CalculateTextHeight(std::string text, unsigned short maxWidth, bool isSmall);
291+
unsigned short CalculateTextHeight(const std::string &text, unsigned short maxWidth, bool isSmall);
292292

293293
/// <summary>
294294
/// Gets the message to be displayed on top of each player's screen.
@@ -486,7 +486,7 @@ namespace RTE {
486486
/// </summary>
487487
/// <param name="palettePath">String with the path to the palette bitmap file.</param>
488488
/// <returns>Whether palette loaded successfully or not.</returns>
489-
bool LoadPalette(std::string palettePath);
489+
bool LoadPalette(const std::string &palettePath);
490490

491491
/// <summary>
492492
/// Gets the ContentFile describing the location of the color palette.

Managers/PerformanceMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ namespace RTE {
8383
// Soften the ratio of the pitch adjustment so it's not such an extreme effect on the audio
8484
// TODO: This coefficient should probably move to SettingsMan and be loaded from ini. That way this effect can be lessened or even turned off entirely by users. 0.35 is a good default value though.
8585
float pitch = m_SimSpeed + (1.0F - m_SimSpeed) * 0.35;
86-
g_AudioMan.SetGlobalPitch(pitch, true);
86+
g_AudioMan.SetGlobalPitch(pitch);
8787
} else {
8888
m_SimSpeed = 1.0;
8989
}

Managers/SettingsMan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ void SettingsMan::Clear()
8080
m_ServerBoxHeight = 44;
8181

8282
m_UseNATService = false;
83-
m_DisableLoadingScreen = false;
83+
m_DisableLoadingScreen = true;
8484
}
8585

8686

0 commit comments

Comments
 (0)