diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-29 17:24:52 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-29 17:59:57 +0300 |
commit | f315432679f760b71505e74dcb2185b7aef7a906 (patch) | |
tree | 07d45620464a2542cb28fbe773f652501e6ee6fb /src | |
parent | cccb3e11663eb415b9b6c9a184e1c17762a2d989 (diff) | |
download | plus-f315432679f760b71505e74dcb2185b7aef7a906.tar.gz plus-f315432679f760b71505e74dcb2185b7aef7a906.tar.bz2 plus-f315432679f760b71505e74dcb2185b7aef7a906.tar.xz plus-f315432679f760b71505e74dcb2185b7aef7a906.zip |
change smaller letter literalt into capital letter.
Diffstat (limited to 'src')
52 files changed, 207 insertions, 207 deletions
diff --git a/src/animatedsprite.cpp b/src/animatedsprite.cpp index 0bcb78713..8940b1060 100644 --- a/src/animatedsprite.cpp +++ b/src/animatedsprite.cpp @@ -49,7 +49,7 @@ AnimatedSprite::AnimatedSprite(SpriteDef *const sprite): mDelayLoad(nullptr), mTerminated(false) { - mAlpha = 1.0f; + mAlpha = 1.0F; // Take possession of the sprite if (mSprite) diff --git a/src/being/being.cpp b/src/being/being.cpp index b9d720671..949a691c1 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1004,7 +1004,7 @@ void Being::fireMissile(Being *const victim, const std::string &particle) const if (missile) { - target->moveBy(Vector(0.0f, 0.0f, 32.0f)); + target->moveBy(Vector(0.0F, 0.0F, 32.0F)); target->setLifetime(1000); victim->controlParticle(target); @@ -1415,7 +1415,7 @@ void Being::logic() const float nominalLength = dir.length(); // When we've not reached our destination, move to it. - if (nominalLength > 0.0f && !mWalkSpeed.isNull()) + if (nominalLength > 0.0F && !mWalkSpeed.isNull()) { // The deplacement of a point along a vector is calculated // using the Unit Vector (รข) multiplied by the point speed. @@ -1446,7 +1446,7 @@ void Being::logic() // Update the player sprite direction. // N.B.: We only change this if the distance is more than one pixel. - if (nominalLength > 1.0f) + if (nominalLength > 1.0F) { int direction = 0; const float dx = std::abs(dir.x); diff --git a/src/being/being.h b/src/being/being.h index ddc083c34..04e32ae61 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -539,7 +539,7 @@ class Being : public ActorSprite, public ConfigListener * @see setPosition(const Vector &pos) */ inline void setPosition(const float x, const float y, - const float z = 0.0f) + const float z = 0.0F) { setPosition(Vector(x, y, z)); } /** diff --git a/src/being/compoundsprite.cpp b/src/being/compoundsprite.cpp index 9bf691d9a..261532be8 100644 --- a/src/being/compoundsprite.cpp +++ b/src/being/compoundsprite.cpp @@ -63,7 +63,7 @@ CompoundSprite::CompoundSprite() : mDisableAdvBeingCaching(config.getBoolValue("disableAdvBeingCaching")), mDisableBeingCaching(config.getBoolValue("disableBeingCaching")) { - mAlpha = 1.0f; + mAlpha = 1.0F; } CompoundSprite::~CompoundSprite() @@ -119,7 +119,7 @@ bool CompoundSprite::draw(Graphics *const graphics, if (mSprites.empty()) // Nothing to draw return false; - if (mAlpha == 1.0f && mImage) + if (mAlpha == 1.0F && mImage) { return graphics->drawImage(mImage, posX + mOffsetX, posY + mOffsetY); } diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index f1c4c49e2..f8a13f8a0 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -138,7 +138,7 @@ LocalPlayer::LocalPlayer(const int id, const int subtype) : mTestParticle(nullptr), mTestParticleName(), mTestParticleTime(0), - mTestParticleHash(0l), + mTestParticleHash(0L), mWalkingDir(0), mUpdateName(true), mBlockAdvert(false), diff --git a/src/client.cpp b/src/client.cpp index bba942e7d..a14e36198 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -313,7 +313,7 @@ Client::Client(const Options &options) : mButtonSpacing(3), mKeyboardHeight(0), mOldUpdates(), - mGuiAlpha(1.0f), + mGuiAlpha(1.0F), mLimitFps(false), mConfigAutoSaved(false), mIsMinimized(false), @@ -601,12 +601,12 @@ void Client::gameInit() OpenGLImageHelper::setBlur(config.getBoolValue("blur")); SurfaceImageHelper::SDLSetEnableAlphaCache( config.getBoolValue("alphaCache") && !openGLMode); - ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f + ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F || openGLMode); #else SurfaceImageHelper::SDLSetEnableAlphaCache( config.getBoolValue("alphaCache")); - ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0f); + ImageHelper::setEnableAlpha(config.getFloatValue("guialpha") != 1.0F); #endif logVars(); Cpu::detect(); @@ -1310,7 +1310,7 @@ int Client::gameExec() { // Don't allow an alpha opacity // lower than the default value - Theme::instance()->setMinimumOpacity(0.8f); + Theme::instance()->setMinimumOpacity(0.8F); mCurrentDialog = new ServerDialog(&mCurrentServer, mConfigDir); @@ -1350,7 +1350,7 @@ int Client::gameExec() logger->log1("State: LOGIN"); // Don't allow an alpha opacity // lower than the default value - Theme::instance()->setMinimumOpacity(0.8f); + Theme::instance()->setMinimumOpacity(0.8F); loginData.updateType = serverConfig.getValue("updateType", 1); @@ -1547,7 +1547,7 @@ int Client::gameExec() logger->log1("State: CHAR SELECT"); // Don't allow an alpha opacity // lower than the default value - Theme::instance()->setMinimumOpacity(0.8f); + Theme::instance()->setMinimumOpacity(0.8F); mCurrentDialog = new CharSelectDialog(&loginData); @@ -1613,7 +1613,7 @@ int Client::gameExec() soundManager.fadeOutMusic(1000); // Allow any alpha opacity - Theme::instance()->setMinimumOpacity(-1.0f); + Theme::instance()->setMinimumOpacity(-1.0F); if (chatLogger) chatLogger->setServerName(mServerName); @@ -1870,7 +1870,7 @@ void Client::optionChanged(const std::string &name) { const float alpha = config.getFloatValue("guialpha"); setGuiAlpha(alpha); - ImageHelper::setEnableAlpha(alpha != 1.0f); + ImageHelper::setEnableAlpha(alpha != 1.0F); } else if (name == "gamma" || name == "enableGamma") { @@ -2157,7 +2157,7 @@ void Client::initConfiguration() const #endif config.setValue("screen", false); config.setValue("sound", true); - config.setValue("guialpha", 0.8f); + config.setValue("guialpha", 0.8F); // config.setValue("remember", true); config.setValue("sfxVolume", 100); config.setValue("musicVolume", 60); diff --git a/src/configuration.cpp b/src/configuration.cpp index 66615d12d..3fb323dd2 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -514,7 +514,7 @@ std::string Configuration::getStringValue(const std::string &key) const float Configuration::getFloatValue(const std::string &key) const { GETLOG(); - float defaultValue = 0.0f; + float defaultValue = 0.0F; const Options::const_iterator iter = mOptions.find(key); if (iter == mOptions.end()) { diff --git a/src/defaults.cpp b/src/defaults.cpp index aa9697a05..4b62ca062 100644 --- a/src/defaults.cpp +++ b/src/defaults.cpp @@ -70,7 +70,7 @@ DefaultsData* getConfigDefaults() { DefaultsData *const configData = new DefaultsData; AddDEF("OverlayDetail", 2); - AddDEF("speechBubbleAlpha", 1.0f); + AddDEF("speechBubbleAlpha", 1.0F); AddDEF("MostUsedServerName0", "server.themanaworld.org"); AddDEF("visiblenames", true); AddDEF("speech", static_cast<int>(Being::TEXT_OVERHEAD)); @@ -148,7 +148,7 @@ DefaultsData* getConfigDefaults() AddDEF("rightTolerance", 100); AddDEF("logNpcInGui", true); AddDEF("download-music", false); - AddDEF("guialpha", 0.8f); + AddDEF("guialpha", 0.8F); AddDEF("ChatLogLength", 0); AddDEF("enableChatLog", true); AddDEF("whispertab", true); diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp index 24c4302f2..9e4438393 100644 --- a/src/gui/equipmentwindow.cpp +++ b/src/gui/equipmentwindow.cpp @@ -224,7 +224,7 @@ void EquipmentWindow::draw(gcn::Graphics *graphics) Image *const image = item->getImage(); if (image) { - image->setAlpha(1.0f); // Ensure the image is drawn + image->setAlpha(1.0F); // Ensure the image is drawn // with maximum opacity g->drawImage(image, box->x + mItemPadding, box->y + mItemPadding); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 694010f8b..18cc061b2 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -91,7 +91,7 @@ Gui::Gui(Graphics *const graphics) : mSecureFont(), mNpcFont(), mMouseCursors(nullptr), - mMouseCursorAlpha(1.0f), + mMouseCursorAlpha(1.0F), mMouseInactivityTimer(0), mCursorType(Cursor::CURSOR_POINTER), #ifdef ANDROID @@ -309,11 +309,11 @@ void Gui::slowLogic() if (mMouseInactivityTimer < 100 * 15) { ++mMouseInactivityTimer; - mMouseCursorAlpha = std::min(1.0f, mMouseCursorAlpha + 0.05f); + mMouseCursorAlpha = std::min(1.0F, mMouseCursorAlpha + 0.05F); } else { - mMouseCursorAlpha = std::max(0.0f, mMouseCursorAlpha - 0.005f); + mMouseCursorAlpha = std::max(0.0F, mMouseCursorAlpha - 0.005F); } if (mGuiFont) mGuiFont->slowLogic(0); @@ -450,7 +450,7 @@ void Gui::draw() const uint8_t button = SDL_GetMouseState(&mouseX, &mouseY); if ((client->getMouseFocused() || button & SDL_BUTTON(1)) - && mMouseCursors && mCustomCursor && mMouseCursorAlpha > 0.0f) + && mMouseCursors && mCustomCursor && mMouseCursorAlpha > 0.0F) { Graphics *g2 = static_cast<Graphics*>(mGraphics); const Image *const image = dragDrop.getItemImage(); diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index f8b688dee..d36c52e61 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -119,7 +119,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): mRetrieveButton(nullptr), mInvCloseButton(nullptr), mWeightBar(nullptr), - mSlotsBar(new ProgressBar(this, 0.0f, 100, 0, Theme::PROG_INVY_SLOTS)), + mSlotsBar(new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_INVY_SLOTS)), mFilter(nullptr), mSortModel(new SortListModelInv), mSortDropDown(new DropDown(this, mSortModel, false, false, this, "sort")), @@ -209,7 +209,7 @@ InventoryWindow::InventoryWindow(Inventory *const inventory): mShopButton = new Button(this, _("Shop"), "shop", this); // TRANSLATORS: inventory button mEquipmentButton = new Button(this, _("Equipment"), "equipment", this); - mWeightBar = new ProgressBar(this, 0.0f, 100, 0, Theme::PROG_WEIGHT); + mWeightBar = new ProgressBar(this, 0.0F, 100, 0, Theme::PROG_WEIGHT); place(0, 0, mWeightBar, 4); mSlotsBarCell = &place(4, 0, mSlotsBar, 5); diff --git a/src/gui/killstats.cpp b/src/gui/killstats.cpp index a5e70a30d..d289c1e27 100644 --- a/src/gui/killstats.cpp +++ b/src/gui/killstats.cpp @@ -241,7 +241,7 @@ void KillStats::gainXp(int xp) mLine2->setCaption(strprintf(_("Exp: %d/%d Left: %d"), exp, xpNextLevel, xpNextLevel - exp)); - if (AvgExp >= 0.001f && AvgExp <= 0.001f) + if (AvgExp >= 0.001F && AvgExp <= 0.001F) { // TRANSLATORS: kill stats window label mLine3->setCaption(strprintf(_("1%% = %d exp, avg mob for 1%%: %s"), diff --git a/src/gui/sdlfont.cpp b/src/gui/sdlfont.cpp index 65ba14fc6..01e2c568f 100644 --- a/src/gui/sdlfont.cpp +++ b/src/gui/sdlfont.cpp @@ -461,7 +461,7 @@ void SDLFont::drawString(gcn::Graphics *const graphics, gcn::Color col = g->getColor(); const gcn::Color &col2 = g->getColor2(); - const float alpha = static_cast<float>(col.a) / 255.0f; + const float alpha = static_cast<float>(col.a) / 255.0F; /* The alpha value is ignored at string generation so avoid caching the * same text with different alpha values. diff --git a/src/gui/serverdialog.cpp b/src/gui/serverdialog.cpp index fcebad81d..2b3f7c697 100644 --- a/src/gui/serverdialog.cpp +++ b/src/gui/serverdialog.cpp @@ -168,11 +168,11 @@ public: updateAlpha(); - mHighlightColor.a = static_cast<int>(mAlpha * 255.0f); + mHighlightColor.a = static_cast<int>(mAlpha * 255.0F); g->setColor(mHighlightColor); const int height = getRowHeight(); - mNotSupportedColor.a = static_cast<int>(mAlpha * 255.0f); + mNotSupportedColor.a = static_cast<int>(mAlpha * 255.0F); // Draw filled rectangle around the selected list element if (mSelected >= 0) @@ -268,7 +268,7 @@ ServerDialog::ServerDialog(ServerInfo *const serverInfo, mDir(dir), mDownloadStatus(DOWNLOADING_UNKNOWN), mDownload(nullptr), - mDownloadProgress(-1.0f), + mDownloadProgress(-1.0F), mServerInfo(serverInfo), mPersistentIPCheckBox(nullptr) { @@ -821,10 +821,10 @@ int ServerDialog::downloadUpdate(void *ptr, DownloadStatus status, if (total) progress /= static_cast<float>(total); - if (progress != progress || progress < 0.0f) + if (progress != progress || progress < 0.0F) progress = 0.0f; - else if (progress > 1.0f) - progress = 1.0f; + else if (progress > 1.0F) + progress = 1.0F; MutexLocker lock1(&sd->mMutex); sd->mDownloadStatus = DOWNLOADING_IN_PROGRESS; diff --git a/src/gui/setup_theme.cpp b/src/gui/setup_theme.cpp index 850068fd9..ca38a76d8 100644 --- a/src/gui/setup_theme.cpp +++ b/src/gui/setup_theme.cpp @@ -508,7 +508,7 @@ void Setup_Theme::apply() if (size >= 0) mNpcFontSizeDropDown->setSelected(size); } - if (mInfo->guiAlpha > 0.01f) + if (mInfo->guiAlpha > 0.01F) config.setValue("guialpha", mInfo->guiAlpha); } config.setValue("theme", mTheme); diff --git a/src/gui/setup_touch.cpp b/src/gui/setup_touch.cpp index f930c8a8f..1de4686df 100644 --- a/src/gui/setup_touch.cpp +++ b/src/gui/setup_touch.cpp @@ -106,22 +106,22 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) : "screenButtonsSizeEvent", mSizeList, 100); // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 1u), "", + new SetupActionDropDown(strprintf(_("Button %u action"), 1U), "", "screenActionButton0", this, "screenActionButton0Event", mActionsList, 250); // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 2u), "", + new SetupActionDropDown(strprintf(_("Button %u action"), 2U), "", "screenActionButton1", this, "screenActionButton1Event", mActionsList, 250); // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 3u), "", + new SetupActionDropDown(strprintf(_("Button %u action"), 3U), "", "screenActionButton2", this, "screenActionButton2Event", mActionsList, 250); // TRANSLATORS: settings option - new SetupActionDropDown(strprintf(_("Button %u action"), 4u), "", + new SetupActionDropDown(strprintf(_("Button %u action"), 4U), "", "screenActionButton3", this, "screenActionButton3Event", mActionsList, 250); diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 672928551..94ac10fc6 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -104,7 +104,7 @@ class SkillListBox final : public ListBox Graphics *const graphics = static_cast<Graphics *const>( gcnGraphics); - mHighlightColor.a = static_cast<int>(mAlpha * 255.0f); + mHighlightColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mHighlightColor); // Draw filled rectangle around the selected list element diff --git a/src/gui/statuswindow.cpp b/src/gui/statuswindow.cpp index 0f00cb95c..767b4f537 100644 --- a/src/gui/statuswindow.cpp +++ b/src/gui/statuswindow.cpp @@ -238,7 +238,7 @@ StatusWindow::StatusWindow() : mJobLvlLabel = new Label(this, strprintf(_("Job: %d"), 0)); // TRANSLATORS: status window label mJobLabel = new Label(this, _("Job:")); - mJobBar = new ProgressBar(this, 0.0f, 80, 0, Theme::PROG_JOB); + mJobBar = new ProgressBar(this, 0.0F, 80, 0, Theme::PROG_JOB); place(3, 0, mJobLvlLabel, 3); place(5, 2, mJobLabel).setPadding(3); @@ -512,7 +512,7 @@ void StatusWindow::updateMPBar(ProgressBar *const bar, const bool showMax) else bar->setText(toString(mp)); - float prog = 1.0f; + float prog = 1.0F; if (maxMp > 0) prog = static_cast<float>(mp) / static_cast<float>(maxMp); diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index 8f65b6671..f523df908 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -177,7 +177,7 @@ int Skin::getMinHeight() const Theme::Theme() : Palette(THEME_COLORS_END * THEME_PALETTES), mSkins(), - mMinimumOpacity(-1.0f), + mMinimumOpacity(-1.0F), mProgressColors(ProgressColors(THEME_PROG_END)) { initDefaultThemePath(); @@ -361,7 +361,7 @@ void Theme::unload(Skin *const skin) void Theme::setMinimumOpacity(const float minimumOpacity) { - if (minimumOpacity > 1.0f) + if (minimumOpacity > 1.0F) return; mMinimumOpacity = minimumOpacity; diff --git a/src/gui/theme.h b/src/gui/theme.h index 3e1c525d7..5ff94ca77 100644 --- a/src/gui/theme.h +++ b/src/gui/theme.h @@ -56,7 +56,7 @@ struct ThemeInfo final japanFont(), fontSize(0), npcfontSize(0), - guiAlpha(0.0f) + guiAlpha(0.0F) { } std::string name; @@ -129,7 +129,7 @@ class Skin final /** * Updates the alpha value of the skin */ - void updateAlpha(const float minimumOpacityAllowed = 0.0f); + void updateAlpha(const float minimumOpacityAllowed = 0.0F); int getPadding() const A_WARN_UNUSED { return mPadding; } diff --git a/src/gui/updaterwindow.cpp b/src/gui/updaterwindow.cpp index 8b0dab6b3..7eda825ad 100644 --- a/src/gui/updaterwindow.cpp +++ b/src/gui/updaterwindow.cpp @@ -158,7 +158,7 @@ UpdaterWindow::UpdaterWindow(const std::string &updateHost, mUpdatesDirReal(updatesDir), mCurrentFile("news.txt"), mNewLabelCaption(), - mDownloadProgress(0.0f), + mDownloadProgress(0.0F), mDownloadMutex(), mCurrentChecksum(0), mStoreInMemory(true), @@ -451,12 +451,12 @@ int UpdaterWindow::updateProgress(void *ptr, DownloadStatus status, static_cast<float>(dt); if (progress != progress) - progress = 0.0f; // check for NaN - if (progress < 0.0f) - progress = 0.0f; // no idea how this could ever happen, + progress = 0.0F; // check for NaN + if (progress < 0.0F) + progress = 0.0F; // no idea how this could ever happen, // but why not check for it anyway. - if (progress > 1.0f) - progress = 1.0f; + if (progress > 1.0F) + progress = 1.0F; uw->setLabel(std::string(uw->mCurrentFile).append(" (") .append(toString(static_cast<int>(progress * 100))).append("%)")); diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index c477b2b3e..61b5f5f6d 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -296,7 +296,7 @@ void Viewport::_drawDebugPath(Graphics *const graphics) SDL_GetMouseState(&mMouseX, &mMouseY); static Path debugPath; - static Vector lastMouseDestination = Vector(0.0f, 0.0f); + static Vector lastMouseDestination = Vector(0.0F, 0.0F); const int mousePosX = mMouseX + mPixelViewX; const int mousePosY = mMouseY + mPixelViewY; Vector mouseDestination(mousePosX, mousePosY); diff --git a/src/gui/widgets/colorpage.cpp b/src/gui/widgets/colorpage.cpp index 2fb3a50bc..fce2227aa 100644 --- a/src/gui/widgets/colorpage.cpp +++ b/src/gui/widgets/colorpage.cpp @@ -52,7 +52,7 @@ void ColorPage::draw(gcn::Graphics *graphics) mListModel); Graphics *const g = static_cast<Graphics *const>(graphics); - mHighlightColor.a = static_cast<int>(mAlpha * 255.0f); + mHighlightColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mHighlightColor); updateAlpha(); gcn::Font *const font = getFont(); diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 76ae575de..99438a2ce 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -225,7 +225,7 @@ void DropDown::draw(gcn::Graphics* graphics) updateAlpha(); - const int alpha = static_cast<int>(mAlpha * 255.0f); + const int alpha = static_cast<int>(mAlpha * 255.0F); const int pad = 2 * mPadding; mHighlightColor.a = alpha; mShadowColor.a = alpha; diff --git a/src/gui/widgets/dropshortcutcontainer.cpp b/src/gui/widgets/dropshortcutcontainer.cpp index 5f1364fc7..115fcb192 100644 --- a/src/gui/widgets/dropshortcutcontainer.cpp +++ b/src/gui/widgets/dropshortcutcontainer.cpp @@ -139,7 +139,7 @@ void DropShortcutContainer::draw(gcn::Graphics *graphics) else if (item->isEquipped()) caption = "Eq."; - image->setAlpha(1.0f); + image->setAlpha(1.0F); g->drawImage(image, itemX, itemY); if (item->isEquipped()) g->setColorAll(mEquipedColor, mEquipedColor2); diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index cdfafc480..45497ae0a 100644 --- a/src/gui/widgets/extendedlistbox.cpp +++ b/src/gui/widgets/extendedlistbox.cpp @@ -125,7 +125,7 @@ void ExtendedListBox::draw(gcn::Graphics *graphics) if (minY != -1) { - mHighlightColor.a = static_cast<int>(mAlpha * 255.0f); + mHighlightColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mHighlightColor); graphics->fillRectangle(gcn::Rectangle(mPadding, minY + mPadding, width - pad2, maxY - minY + height)); diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 42e68db55..96aabc873 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -308,7 +308,7 @@ void GuiTable::draw(gcn::Graphics* graphics) const int y = rect.y; if (mOpaque) { - mBackgroundColor.a = static_cast<int>(mAlpha * 255.0f); + mBackgroundColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mBackgroundColor); graphics->fillRectangle(gcn::Rectangle(0, 0, width, height)); } @@ -359,7 +359,7 @@ void GuiTable::draw(gcn::Graphics* graphics) if (mSelectedRow > 0) { - mHighlightColor.a = static_cast<int>(mAlpha * 255.0f); + mHighlightColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mHighlightColor); if (mLinewiseMode && r == static_cast<unsigned>( diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp index 5151e44fd..0def0ad9e 100644 --- a/src/gui/widgets/itemcontainer.cpp +++ b/src/gui/widgets/itemcontainer.cpp @@ -279,7 +279,7 @@ void ItemContainer::draw(gcn::Graphics *graphics) if (mSelImg) g->drawImage(mSelImg, itemX, itemY); } - image->setAlpha(1.0f); // ensure the image if fully drawn... + image->setAlpha(1.0F); // ensure the image if fully drawn... g->drawImage(image, itemX + mPaddingItemX, itemY + mPaddingItemY); if (mProtectedImg && PlayerInfo::isItemProtected( diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp index 554be07c1..3334a42e5 100644 --- a/src/gui/widgets/itemshortcutcontainer.cpp +++ b/src/gui/widgets/itemshortcutcontainer.cpp @@ -169,7 +169,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) else if (item->isEquipped()) caption = "Eq."; - image->setAlpha(1.0f); + image->setAlpha(1.0F); g->drawImage(image, itemX, itemY); if (item->isEquipped()) g->setColorAll(mEquipedColor, mEquipedColor2); @@ -193,7 +193,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { - image->setAlpha(1.0f); + image->setAlpha(1.0F); g->drawImage(image, itemX, itemY); } } @@ -212,7 +212,7 @@ void ItemShortcutContainer::draw(gcn::Graphics *graphics) if (image) { - image->setAlpha(1.0f); + image->setAlpha(1.0F); g->drawImage(image, itemX, itemY); } diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index 0889bac15..4dd1da8d9 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -92,7 +92,7 @@ void ListBox::draw(gcn::Graphics *graphics) updateAlpha(); Graphics *const g = static_cast<Graphics*>(graphics); - mHighlightColor.a = static_cast<int>(mAlpha * 255.0f); + mHighlightColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mHighlightColor); gcn::Font *const font = getFont(); const int rowHeight = getRowHeight(); diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index b5af0360d..b0972a314 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -57,8 +57,8 @@ ProgressBar::ProgressBar(const Widget2 *const widget, float progress, mRedraw(true) { // The progress value is directly set at load time: - if (mProgress > 1.0f || mProgress < 0.0f) - mProgress = 1.0f; + if (mProgress > 1.0F || mProgress < 0.0F) + mProgress = 1.0F; mForegroundColor = getThemeColor(Theme::PROGRESS_BAR); addWidgetListener(this); @@ -120,9 +120,9 @@ void ProgressBar::logic() { // Smoothly showing the progressbar changes. if (mProgressToGo > mProgress) - mProgress = std::min(1.0f, mProgress + 0.005f); + mProgress = std::min(1.0F, mProgress + 0.005F); if (mProgressToGo < mProgress) - mProgress = std::max(0.0f, mProgress - 0.005f); + mProgress = std::max(0.0F, mProgress - 0.005F); } BLOCK_END("ProgressBar::logic") } @@ -145,7 +145,7 @@ void ProgressBar::draw(gcn::Graphics *graphics) void ProgressBar::setProgress(const float progress) { - const float p = std::min(1.0f, std::max(0.0f, progress)); + const float p = std::min(1.0F, std::max(0.0F, progress)); mProgressToGo = p; if (!mSmoothProgress) diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h index 4d30c015d..e8d8986e7 100644 --- a/src/gui/widgets/progressbar.h +++ b/src/gui/widgets/progressbar.h @@ -49,7 +49,7 @@ class ProgressBar final : public gcn::Widget, /** * Constructor, initializes the progress with the given value. */ - ProgressBar(const Widget2 *const widget, float progress = 0.0f, + ProgressBar(const Widget2 *const widget, float progress = 0.0F, const int width = 40, const int height = 7, const int color = -1); diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index cd83d23db..f719d132e 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -93,7 +93,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) if (client->getGuiAlpha() != mAlpha) mAlpha = client->getGuiAlpha(); - const int alpha = static_cast<int>(mAlpha * 255.0f); + const int alpha = static_cast<int>(mAlpha * 255.0F); Graphics *graphics = static_cast<Graphics*>(gcnGraphics); gcn::Font *const font = getFont(); @@ -153,7 +153,7 @@ void ShopListBox::draw(gcn::Graphics *gcnGraphics) Image *const icon = item->getImage(); if (icon) { - icon->setAlpha(1.0f); + icon->setAlpha(1.0F); graphics->drawImage(icon, mPadding, y + mPadding); } } diff --git a/src/gui/widgets/skillinfo.cpp b/src/gui/widgets/skillinfo.cpp index d71b88e85..48ead9c6c 100644 --- a/src/gui/widgets/skillinfo.cpp +++ b/src/gui/widgets/skillinfo.cpp @@ -37,7 +37,7 @@ SkillInfo::SkillInfo() : skillLevel(), skillExp(), - progress(0.0f), + progress(0.0F), color(), dataMap(), model(nullptr), @@ -101,7 +101,7 @@ void SkillInfo::update() else { skillExp.clear(); - progress = 0.0f; + progress = 0.0F; } color = Theme::getProgressColor(Theme::PROG_EXP, progress); diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 4319bd145..cf3fc937b 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -130,7 +130,7 @@ void SpellShortcutContainer::draw(gcn::Graphics *graphics) if (image) { - image->setAlpha(1.0f); + image->setAlpha(1.0F); g->drawImage(image, itemX, itemY); } } diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index f78c48894..bb31993bd 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -86,7 +86,7 @@ void TextPreview::draw(gcn::Graphics* graphics) mAlpha = client->getGuiAlpha(); Graphics *const g = static_cast<Graphics*>(graphics); - const int intAlpha = static_cast<int>(mAlpha * 255.0f); + const int intAlpha = static_cast<int>(mAlpha * 255.0F); const int alpha = mTextAlpha ? intAlpha : 255; if (mOpaque) @@ -94,7 +94,7 @@ void TextPreview::draw(gcn::Graphics* graphics) g->setColor(gcn::Color(static_cast<int>(mBGColor->r), static_cast<int>(mBGColor->g), static_cast<int>(mBGColor->b), - static_cast<int>(mAlpha * 255.0f))); + static_cast<int>(mAlpha * 255.0F))); g->fillRectangle(gcn::Rectangle(0, 0, mDimension.width, mDimension.height)); } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 8733bb737..12e2f74dd 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -1114,7 +1114,7 @@ int Window::getGuiAlpha() const { const float alpha = std::max(client->getGuiAlpha(), Theme::instance()->getMinimumOpacity()); - return static_cast<int>(alpha * 255.0f); + return static_cast<int>(alpha * 255.0F); } Layout &Window::getLayout() diff --git a/src/map.cpp b/src/map.cpp index 2154cf66c..69a59b0b1 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -141,8 +141,8 @@ Map::Map(const int width, const int height, mOnOpenList(2), mBackgrounds(), mForegrounds(), - mLastAScrollX(0.0f), - mLastAScrollY(0.0f), + mLastAScrollX(0.0F), + mLastAScrollY(0.0F), mParticleEffects(), mMapPortals(), mTileAnimations(), @@ -189,7 +189,7 @@ Map::Map(const int width, const int height, config.addListener("guialpha", this); config.addListener("beingopacity", this); - if (mOpacity != 1.0f) + if (mOpacity != 1.0F) mBeingOpacity = config.getBoolValue("beingopacity"); else mBeingOpacity = false; @@ -240,14 +240,14 @@ void Map::optionChanged(const std::string &value) else if (value == "guialpha") { mOpacity = config.getFloatValue("guialpha"); - if (mOpacity != 1.0f) + if (mOpacity != 1.0F) mBeingOpacity = config.getBoolValue("beingopacity"); else mBeingOpacity = false; } else if (value == "beingopacity") { - if (mOpacity != 1.0f) + if (mOpacity != 1.0F) mBeingOpacity = config.getBoolValue("beingopacity"); else mBeingOpacity = false; @@ -474,7 +474,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) } // Don't draw if gui opacity == 1 - if (mBeingOpacity && mOpacity != 1.0f) + if (mBeingOpacity && mOpacity != 1.0F) { // Draws beings with a lower opacity to make them visible // even when covered by a wall or some other elements... @@ -497,9 +497,9 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) // For now, just draw actors with only one layer. if (actor->getNumberOfLayers() == 1) { - actor->setAlpha(0.3f); + actor->setAlpha(0.3F); actor->draw(graphics, -scrollX, -scrollY); - actor->setAlpha(1.0f); + actor->setAlpha(1.0F); } } ++ai; @@ -585,7 +585,7 @@ void Map::updateAmbientLayers(const float scrollX, const float scrollY) BLOCK_START("Map::updateAmbientLayers") static int lastTick = tick_time; - if (mLastAScrollX == 0.0f && mLastAScrollY == 0.0f) + if (mLastAScrollX == 0.0F && mLastAScrollY == 0.0F) { // First call - initialisation mLastAScrollX = scrollX; diff --git a/src/mumblemanager.cpp b/src/mumblemanager.cpp index 0b067ff42..3bd961bac 100644 --- a/src/mumblemanager.cpp +++ b/src/mumblemanager.cpp @@ -76,11 +76,11 @@ uint16_t MumbleManager::getMapId(std::string mapName) const void MumbleManager::setMapBase(uint16_t mapid) { - mMapBase[0] = 10000.0f * (mapid & 0x1f); + mMapBase[0] = 10000.0F * (mapid & 0x1F); mapid >>= 5; - mMapBase[1] = 1000.0f * (mapid & 0x3f); + mMapBase[1] = 1000.0F * (mapid & 0x3F); mapid >>= 6; - mMapBase[2] = 10000.0f * (mapid & 0x1f); + mMapBase[2] = 10000.0F * (mapid & 0x1F); } void MumbleManager::init() @@ -151,22 +151,22 @@ void MumbleManager::init() // Unit vector pointing out of the avatars eyes // (here Front looks into scene). /* no way to look "up", 2d */ - mLinkedMemCache.fAvatarFront[1] = 0.0f; + mLinkedMemCache.fAvatarFront[1] = 0.0F; // Unit vector pointing out of the top of the avatars head // (here Top looks straight up). /* no way to change this in tmw */ - mLinkedMemCache.fAvatarTop[0] = 0.0f; - mLinkedMemCache.fAvatarTop[1] = 1.0f; - mLinkedMemCache.fAvatarTop[2] = 0.0f; + mLinkedMemCache.fAvatarTop[0] = 0.0F; + mLinkedMemCache.fAvatarTop[1] = 1.0F; + mLinkedMemCache.fAvatarTop[2] = 0.0F; - mLinkedMemCache.fCameraFront[0] = 0.0f; - mLinkedMemCache.fCameraFront[1] = 0.0f; - mLinkedMemCache.fCameraFront[2] = 1.0f; + mLinkedMemCache.fCameraFront[0] = 0.0F; + mLinkedMemCache.fCameraFront[1] = 0.0F; + mLinkedMemCache.fCameraFront[2] = 1.0F; - mLinkedMemCache.fCameraTop[0] = 0.0f; - mLinkedMemCache.fCameraTop[1] = 1.0f; - mLinkedMemCache.fCameraTop[2] = 0.0f; + mLinkedMemCache.fCameraTop[0] = 0.0F; + mLinkedMemCache.fCameraTop[1] = 1.0F; + mLinkedMemCache.fCameraTop[2] = 0.0F; mLinkedMemCache.uiTick++; } @@ -194,14 +194,14 @@ void MumbleManager::setAction(const int action) case 1: /* WALK */ case 2: /* ATTACK */ case 5: /* HURT */ - mLinkedMemCache.fAvatarPosition[1] = 1.5f; + mLinkedMemCache.fAvatarPosition[1] = 1.5F; break; case 3: /* SIT */ - mLinkedMemCache.fAvatarPosition[1] = 1.0f; + mLinkedMemCache.fAvatarPosition[1] = 1.0F; break; case 4: /* DEAD */ default: - mLinkedMemCache.fAvatarPosition[1] = 0.0f; + mLinkedMemCache.fAvatarPosition[1] = 0.0F; break; } mLinkedMemCache.fAvatarPosition[1] += mMapBase[1]; @@ -238,20 +238,20 @@ void MumbleManager::setPos(const int tileX, const int tileY, switch (direction) { case 4: /* UP */ - mLinkedMemCache.fAvatarFront[0] = 0.0f; - mLinkedMemCache.fAvatarFront[2] = 1.0f; + mLinkedMemCache.fAvatarFront[0] = 0.0F; + mLinkedMemCache.fAvatarFront[2] = 1.0F; break; case 1: /* DOWN */ - mLinkedMemCache.fAvatarFront[0] = 0.0f; - mLinkedMemCache.fAvatarFront[2] = -1.0f; + mLinkedMemCache.fAvatarFront[0] = 0.0F; + mLinkedMemCache.fAvatarFront[2] = -1.0F; break; case 2: /* LEFT */ - mLinkedMemCache.fAvatarFront[0] = 1.0f; - mLinkedMemCache.fAvatarFront[2] = 0.0f; + mLinkedMemCache.fAvatarFront[0] = 1.0F; + mLinkedMemCache.fAvatarFront[2] = 0.0F; break; case 8: /* RIGHT */ - mLinkedMemCache.fAvatarFront[0] = -1.0f; - mLinkedMemCache.fAvatarFront[2] = 0.0f; + mLinkedMemCache.fAvatarFront[0] = -1.0F; + mLinkedMemCache.fAvatarFront[2] = 0.0F; break; default: break; diff --git a/src/particle/particle.cpp b/src/particle/particle.cpp index 70c9a367c..1427ffae0 100644 --- a/src/particle/particle.cpp +++ b/src/particle/particle.cpp @@ -40,7 +40,7 @@ #include "debug.h" -static const float SIN45 = 0.707106781f; +static const float SIN45 = 0.707106781F; class Graphics; class Image; @@ -50,11 +50,11 @@ int Particle::maxCount = 0; int Particle::fastPhysics = 0; int Particle::emitterSkip = 1; bool Particle::enabled = true; -const float Particle::PARTICLE_SKY = 800.0f; +const float Particle::PARTICLE_SKY = 800.0F; Particle::Particle(Map *const map) : Actor(), - mAlpha(1.0f), + mAlpha(1.0F), mLifetimeLeft(-1), mLifetimePast(0), mFadeOut(0), @@ -64,11 +64,11 @@ Particle::Particle(Map *const map) : mChildEmitters(), mChildParticles(), mDeathEffect(), - mGravity(0.0f), - mBounce(0.0f), - mAcceleration(0.0f), - mInvDieDistance(-1.0f), - mMomentum(1.0f), + mGravity(0.0F), + mBounce(0.0F), + mAcceleration(0.0F), + mInvDieDistance(-1.0F), + mMomentum(1.0F), mTarget(nullptr), mRandomness(0), mDeathEffectConditions(0x00), @@ -117,10 +117,10 @@ bool Particle::update() if (mAlive == ALIVE) { // calculate particle movement - if (mMomentum != 1.0f) + if (mMomentum != 1.0F) mVelocity *= mMomentum; - if (mTarget && mAcceleration != 0.0f) + if (mTarget && mAcceleration != 0.0F) { Vector dist = mPos - mTarget->mPos; dist.x *= SIN45; @@ -139,19 +139,19 @@ bool Particle::update() break; } - invHypotenuse = 2.0f / (static_cast<float>(fabs(dist.x)) + invHypotenuse = 2.0F / (static_cast<float>(fabs(dist.x)) + static_cast<float>(fabs(dist.y)) + static_cast<float>(fabs(dist.z))); break; default: - invHypotenuse = 1.0f / static_cast<float>(sqrt( + invHypotenuse = 1.0F / static_cast<float>(sqrt( dist.x * dist.x + dist.y * dist.y + dist.z * dist.z)); break; } if (invHypotenuse) { - if (mInvDieDistance > 0.0f && invHypotenuse > mInvDieDistance) + if (mInvDieDistance > 0.0F && invHypotenuse > mInvDieDistance) mAlive = DEAD_IMPACT; const float accFactor = invHypotenuse * mAcceleration; mVelocity -= dist * accFactor; @@ -161,11 +161,11 @@ bool Particle::update() if (mRandomness > 0) { mVelocity.x += static_cast<float>((rand() % mRandomness - rand() - % mRandomness)) / 1000.0f; + % mRandomness)) / 1000.0F; mVelocity.y += static_cast<float>((rand() % mRandomness - rand() - % mRandomness)) / 1000.0f; + % mRandomness)) / 1000.0F; mVelocity.z += static_cast<float>((rand() % mRandomness - rand() - % mRandomness)) / 1000.0f; + % mRandomness)) / 1000.0F; } mVelocity.z -= mGravity; @@ -181,9 +181,9 @@ bool Particle::update() mLifetimePast++; - if (mPos.z < 0.0f) + if (mPos.z < 0.0F) { - if (mBounce > 0.0f) + if (mBounce > 0.0F) { mPos.z *= -mBounce; mVelocity *= mBounce; @@ -419,12 +419,12 @@ Particle *Particle::addTextSplashEffect(const std::string &text, mMap, text, color, font, outline); newParticle->moveTo(static_cast<float>(x), static_cast<float>(y)); newParticle->setVelocity( - static_cast<float>((rand() % 100) - 50) / 200.0f, // X - static_cast<float>((rand() % 100) - 50) / 200.0f, // Y - (static_cast<float>((rand() % 100)) / 200.0f) + 4.0f); // Z + static_cast<float>((rand() % 100) - 50) / 200.0F, // X + static_cast<float>((rand() % 100) - 50) / 200.0F, // Y + (static_cast<float>((rand() % 100)) / 200.0F) + 4.0F); // Z - newParticle->setGravity(0.1f); - newParticle->setBounce(0.5f); + newParticle->setGravity(0.1F); + newParticle->setBounce(0.5F); newParticle->setLifetime(200); newParticle->setFadeOut(100); @@ -442,8 +442,8 @@ Particle *Particle::addTextRiseFadeOutEffect(const std::string &text, Particle *const newParticle = new TextParticle( mMap, text, color, font, outline); newParticle->moveTo(static_cast<float>(x), static_cast<float>(y)); - newParticle->setVelocity(0.0f, 0.0f, 0.5f); - newParticle->setGravity(0.0015f); + newParticle->setVelocity(0.0F, 0.0F, 0.5F); + newParticle->setGravity(0.0015F); newParticle->setLifetime(300); newParticle->setFadeOut(100); newParticle->setFadeIn(0); diff --git a/src/particle/particle.h b/src/particle/particle.h index dd89e717e..7c891dd86 100644 --- a/src/particle/particle.h +++ b/src/particle/particle.h @@ -246,7 +246,7 @@ class Particle : public Actor * particle has been set using setDestination. */ void setDieDistance(const float dist) - { mInvDieDistance = 1.0f / dist; } + { mInvDieDistance = 1.0F / dist; } /** * Changes the size of the emitters so that the effect fills a @@ -284,7 +284,7 @@ class Particle : public Actor { return 1; } virtual float getAlpha() const - { return 1.0f; } + { return 1.0F; } virtual void setAlpha(const float alpha A_UNUSED) override { } diff --git a/src/particle/particleemitter.cpp b/src/particle/particleemitter.cpp index 9e273e4a1..74aec293a 100644 --- a/src/particle/particleemitter.cpp +++ b/src/particle/particleemitter.cpp @@ -36,8 +36,8 @@ #include "debug.h" -static const float SIN45 = 0.707106781f; -static const float DEG_RAD_FACTOR = 0.017453293f; +static const float SIN45 = 0.707106781F; +static const float DEG_RAD_FACTOR = 0.017453293F; typedef std::vector<ImageSet*>::const_iterator ImageSetVectorCIter; typedef std::list<ParticleEmitter>::const_iterator ParticleEmitterListCIter; @@ -54,24 +54,24 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, mParticleFollow(false) { // Initializing default values - mParticlePosX.set(0.0f); - mParticlePosY.set(0.0f); - mParticlePosZ.set(0.0f); - mParticleAngleHorizontal.set(0.0f); - mParticleAngleVertical.set(0.0f); - mParticlePower.set(0.0f); - mParticleGravity.set(0.0f); + mParticlePosX.set(0.0F); + mParticlePosY.set(0.0F); + mParticlePosZ.set(0.0F); + mParticleAngleHorizontal.set(0.0F); + mParticleAngleVertical.set(0.0F); + mParticlePower.set(0.0F); + mParticleGravity.set(0.0F); mParticleRandomness.set(0); - mParticleBounce.set(0.0f); - mParticleAcceleration.set(0.0f); - mParticleDieDistance.set(-1.0f); - mParticleMomentum.set(1.0f); + mParticleBounce.set(0.0F); + mParticleAcceleration.set(0.0F); + mParticleDieDistance.set(-1.0F); + mParticleMomentum.set(1.0F); mParticleLifetime.set(-1); mParticleFadeOut.set(0); mParticleFadeIn.set(0); mOutput.set(1); mOutputPause.set(0); - mParticleAlpha.set(1.0f); + mParticleAlpha.set(1.0F); for_each_xml_child_node(propertyNode, emitterNode) { @@ -82,18 +82,18 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, if (name == "position-x") { - mParticlePosX = readParticleEmitterProp(propertyNode, 0.0f); + mParticlePosX = readParticleEmitterProp(propertyNode, 0.0F); } else if (name == "position-y") { - mParticlePosY = readParticleEmitterProp(propertyNode, 0.0f); + mParticlePosY = readParticleEmitterProp(propertyNode, 0.0F); mParticlePosY.minVal *= SIN45; mParticlePosY.maxVal *= SIN45; mParticlePosY.changeAmplitude *= SIN45; } else if (name == "position-z") { - mParticlePosZ = readParticleEmitterProp(propertyNode, 0.0f); + mParticlePosZ = readParticleEmitterProp(propertyNode, 0.0F); mParticlePosZ.minVal *= SIN45; mParticlePosZ.maxVal *= SIN45; mParticlePosZ.changeAmplitude *= SIN45; @@ -144,7 +144,7 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, else if (name == "horizontal-angle") { mParticleAngleHorizontal = - readParticleEmitterProp(propertyNode, 0.0f); + readParticleEmitterProp(propertyNode, 0.0F); mParticleAngleHorizontal.minVal += static_cast<float>(rotation); mParticleAngleHorizontal.minVal *= DEG_RAD_FACTOR; @@ -156,18 +156,18 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, else if (name == "vertical-angle") { mParticleAngleVertical = - readParticleEmitterProp(propertyNode, 0.0f); + readParticleEmitterProp(propertyNode, 0.0F); mParticleAngleVertical.minVal *= DEG_RAD_FACTOR; mParticleAngleVertical.maxVal *= DEG_RAD_FACTOR; mParticleAngleVertical.changeAmplitude *= DEG_RAD_FACTOR; } else if (name == "power") { - mParticlePower = readParticleEmitterProp(propertyNode, 0.0f); + mParticlePower = readParticleEmitterProp(propertyNode, 0.0F); } else if (name == "gravity") { - mParticleGravity = readParticleEmitterProp(propertyNode, 0.0f); + mParticleGravity = readParticleEmitterProp(propertyNode, 0.0F); } else if (name == "randomnes" || name == "randomness") // legacy bug @@ -176,7 +176,7 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, } else if (name == "bounce") { - mParticleBounce = readParticleEmitterProp(propertyNode, 0.0f); + mParticleBounce = readParticleEmitterProp(propertyNode, 0.0F); } else if (name == "lifetime") { @@ -196,17 +196,17 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, else if (name == "acceleration") { mParticleAcceleration = readParticleEmitterProp( - propertyNode, 0.0f); + propertyNode, 0.0F); } else if (name == "die-distance") { mParticleDieDistance = readParticleEmitterProp( - propertyNode, 0.0f); + propertyNode, 0.0F); } else if (name == "momentum") { mParticleMomentum = readParticleEmitterProp( - propertyNode, 1.0f); + propertyNode, 1.0F); } else if (name == "fade-out") { @@ -218,7 +218,7 @@ ParticleEmitter::ParticleEmitter(const XmlNodePtr emitterNode, } else if (name == "alpha") { - mParticleAlpha = readParticleEmitterProp(propertyNode, 1.0f); + mParticleAlpha = readParticleEmitterProp(propertyNode, 1.0F); } else if (name == "follow-parent") { diff --git a/src/particle/textparticle.cpp b/src/particle/textparticle.cpp index ecab98068..35bef33d5 100644 --- a/src/particle/textparticle.cpp +++ b/src/particle/textparticle.cpp @@ -60,7 +60,7 @@ bool TextParticle::draw(Graphics *const graphics, const int screenY = static_cast<int>(mPos.y) - static_cast<int>(mPos.z) + offsetY; - float alpha = mAlpha * 255.0f; + float alpha = mAlpha * 255.0F; if (mFadeOut && mLifetimeLeft > -1 && mLifetimeLeft < mFadeOut) { diff --git a/src/properties.h b/src/properties.h index d6d2eb01b..fab5304c7 100644 --- a/src/properties.h +++ b/src/properties.h @@ -66,12 +66,12 @@ class Properties * Gets a map property as a float. * * @param name The name of the property. - * @param def Default value, 0.0f by default. + * @param def Default value, 0.0F by default. * @return the value of the given property or the given default when it * doesn't exist. */ float getFloatProperty(const std::string &name, - const float def = 0.0f) const A_WARN_UNUSED + const float def = 0.0F) const A_WARN_UNUSED { const PropertyMap::const_iterator i = mProperties.find(name); float ret = def; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 18f036f48..b5e1cb883 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -52,7 +52,7 @@ MobileOpenGLGraphics::MobileOpenGLGraphics(): mTexture(false), mIsByteColor(false), mByteColor(), - mFloatColor(1.0f), + mFloatColor(1.0F), mMaxVertices(500), mColorAlpha(false), #ifdef DEBUG_BIND_TEXTURE @@ -276,7 +276,7 @@ bool MobileOpenGLGraphics::drawRescaledImage(const Image *const image, if (smooth) // A basic smooth effect... { - setColorAlpha(0.2f); + setColorAlpha(0.2F); drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, desiredWidth + 1, desiredHeight + 1); drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, @@ -873,7 +873,7 @@ void MobileOpenGLGraphics::_beginDraw() #endif #endif -// glScalef(0.5f, 0.5f, 0.5f); +// glScalef(0.5F, 0.5F, 0.5F); pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); } @@ -1242,7 +1242,7 @@ void MobileOpenGLGraphics::setColorAlpha(const float alpha) if (!mIsByteColor && mFloatColor == alpha) return; - glColor4f(1.0f, 1.0f, 1.0f, alpha); + glColor4f(1.0F, 1.0F, 1.0F, alpha); mIsByteColor = false; mFloatColor = alpha; } diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index fe5d14e12..b5abcf30e 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -54,7 +54,7 @@ NormalOpenGLGraphics::NormalOpenGLGraphics(): mTexture(false), mIsByteColor(false), mByteColor(), - mFloatColor(1.0f), + mFloatColor(1.0F), mMaxVertices(500), mColorAlpha(false), #ifdef DEBUG_BIND_TEXTURE @@ -323,7 +323,7 @@ bool NormalOpenGLGraphics::drawRescaledImage(const Image *const image, if (smooth) // A basic smooth effect... { - setColorAlpha(0.2f); + setColorAlpha(0.2F); drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, desiredWidth + 1, desiredHeight + 1); drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, @@ -1214,10 +1214,10 @@ void NormalOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) setTexturingAndBlending(false); restoreColor(); - mFloatTexArray[0] = static_cast<float>(x1) + 0.5f; - mFloatTexArray[1] = static_cast<float>(y1) + 0.5f; - mFloatTexArray[2] = static_cast<float>(x2) + 0.5f; - mFloatTexArray[3] = static_cast<float>(y2) + 0.5f; + mFloatTexArray[0] = static_cast<float>(x1) + 0.5F; + mFloatTexArray[1] = static_cast<float>(y1) + 0.5F; + mFloatTexArray[2] = static_cast<float>(x2) + 0.5F; + mFloatTexArray[3] = static_cast<float>(y2) + 0.5F; drawLineArrayf(4); } @@ -1281,7 +1281,7 @@ void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") - const float offset = filled ? 0 : 0.5f; + const float offset = filled ? 0 : 0.5F; const float x = static_cast<float>(rect.x); const float y = static_cast<float>(rect.y); const float width = static_cast<float>(rect.width); @@ -1469,7 +1469,7 @@ void NormalOpenGLGraphics::setColorAlpha(const float alpha) if (!mIsByteColor && mFloatColor == alpha) return; - glColor4f(1.0f, 1.0f, 1.0f, alpha); + glColor4f(1.0F, 1.0F, 1.0F, alpha); mIsByteColor = false; mFloatColor = alpha; } diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index f7909b7bf..ed3dcd02f 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -46,7 +46,7 @@ NullOpenGLGraphics::NullOpenGLGraphics(): mTexture(false), mIsByteColor(false), mByteColor(), - mFloatColor(1.0f), + mFloatColor(1.0F), mMaxVertices(500), mColorAlpha(false), #ifdef DEBUG_BIND_TEXTURE @@ -226,7 +226,7 @@ bool NullOpenGLGraphics::drawRescaledImage(const Image *const image, if (smooth) // A basic smooth effect... { - setColorAlpha(0.2f); + setColorAlpha(0.2F); drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, desiredWidth + 1, desiredHeight + 1); drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, @@ -986,10 +986,10 @@ void NullOpenGLGraphics::drawLine(int x1, int y1, setTexturingAndBlending(false); restoreColor(); - mFloatTexArray[0] = static_cast<float>(x1) + 0.5f; - mFloatTexArray[1] = static_cast<float>(y1) + 0.5f; - mFloatTexArray[2] = static_cast<float>(x2) + 0.5f; - mFloatTexArray[3] = static_cast<float>(y2) + 0.5f; + mFloatTexArray[0] = static_cast<float>(x1) + 0.5F; + mFloatTexArray[1] = static_cast<float>(y1) + 0.5F; + mFloatTexArray[2] = static_cast<float>(x2) + 0.5F; + mFloatTexArray[3] = static_cast<float>(y2) + 0.5F; drawLineArrayf(4); } diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index 7f0e375b6..cd3338188 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -41,7 +41,7 @@ SafeOpenGLGraphics::SafeOpenGLGraphics(): mTexture(false), mIsByteColor(false), mByteColor(), - mFloatColor(1.0f), + mFloatColor(1.0F), mColorAlpha(false), mFbo() { @@ -220,7 +220,7 @@ bool SafeOpenGLGraphics::drawRescaledImage(const Image *const image, int srcX, if (smooth) // A basic smooth effect... { - setColorAlpha(0.2f); + setColorAlpha(0.2F); drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height, desiredWidth + 1, desiredHeight + 1); drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height, @@ -531,12 +531,12 @@ void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) restoreColor(); glBegin(GL_LINES); - glVertex2f(static_cast<float>(x1) + 0.5f, static_cast<float>(y1) + 0.5f); - glVertex2f(static_cast<float>(x2) + 0.5f, static_cast<float>(y2) + 0.5f); + glVertex2f(static_cast<float>(x1) + 0.5F, static_cast<float>(y1) + 0.5F); + glVertex2f(static_cast<float>(x2) + 0.5F, static_cast<float>(y2) + 0.5F); glEnd(); glBegin(GL_POINTS); - glVertex2f(static_cast<float>(x2) + 0.5f, static_cast<float>(y2) + 0.5f); + glVertex2f(static_cast<float>(x2) + 0.5F, static_cast<float>(y2) + 0.5F); glEnd(); } @@ -597,7 +597,7 @@ void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") - const float offset = filled ? 0 : 0.5f; + const float offset = filled ? 0 : 0.5F; setTexturingAndBlending(false); restoreColor(); @@ -629,7 +629,7 @@ void SafeOpenGLGraphics::setColorAlpha(const float alpha) if (!mIsByteColor && mFloatColor == alpha) return; - glColor4f(1.0f, 1.0f, 1.0f, alpha); + glColor4f(1.0F, 1.0F, 1.0F, alpha); mIsByteColor = false; mFloatColor = alpha; } diff --git a/src/resources/image.cpp b/src/resources/image.cpp index ac23a7c13..b217db683 100644 --- a/src/resources/image.cpp +++ b/src/resources/image.cpp @@ -46,7 +46,7 @@ Image::Image(SDL_Texture *const image, const int width, const int height) : mTexHeight(0), #endif mBounds(), - mAlpha(1.0f), + mAlpha(1.0F), mSDLSurface(nullptr), mTexture(image), mAlphaChannel(nullptr), @@ -90,7 +90,7 @@ Image::Image(SDL_Surface *const image, const bool hasAlphaChannel0, mTexHeight(0), #endif mBounds(), - mAlpha(1.0f), + mAlpha(1.0F), mSDLSurface(image), #ifdef USE_SDL2 mTexture(nullptr), @@ -134,7 +134,7 @@ Image::Image(const GLuint glimage, const int width, const int height, mTexWidth(texWidth), mTexHeight(texHeight), mBounds(), - mAlpha(1.0f), + mAlpha(1.0F), mSDLSurface(nullptr), #ifdef USE_SDL2 mTexture(nullptr), @@ -254,7 +254,7 @@ void Image::setAlpha(const float alpha) if (mAlpha == alpha || !ImageHelper::mEnableAlpha) return; - if (alpha < 0.0f || alpha > 1.0f) + if (alpha < 0.0F || alpha > 1.0F) return; if (mSDLSurface) diff --git a/src/test/testmain.cpp b/src/test/testmain.cpp index 4c45af989..d9d003f93 100644 --- a/src/test/testmain.cpp +++ b/src/test/testmain.cpp @@ -58,7 +58,7 @@ void TestMain::initConfig() mConfig.setValue("hwaccel", false); mConfig.setValue("screen", false); mConfig.setValue("sound", false); - mConfig.setValue("guialpha", 0.8f); + mConfig.setValue("guialpha", 0.8F); // mConfig.setValue("remember", true); mConfig.setValue("sfxVolume", 50); mConfig.setValue("musicVolume", 60); diff --git a/src/utils/mathutils.h b/src/utils/mathutils.h index 924a26fc4..094ae984c 100644 --- a/src/utils/mathutils.h +++ b/src/utils/mathutils.h @@ -100,23 +100,23 @@ inline uint16_t getCrc16(const std::string &str) inline float fastInvSqrt(float x) { union { int i; float x; } tmp; - const float xhalf = 0.5f * x; + const float xhalf = 0.5F * x; tmp.x = x; tmp.i = 0x5f375a86 - (tmp.i >> 1); x = tmp.x; - x = x * (1.5f - xhalf * x * x); + x = x * (1.5F - xhalf * x * x); return x; } inline float fastSqrt(const float x) { - return 1.0f / fastInvSqrt(x); + return 1.0F / fastInvSqrt(x); } constexpr inline float weightedAverage(const float n1, const float n2, const float w) { - return w < 0.0f ? n1 : (w > 1.0f ? n2 : w * n2 + (1.0f - w) * n1); + return w < 0.0F ? n1 : (w > 1.0F ? n2 : w * n2 + (1.0F - w) * n1); } constexpr inline int roundDouble(const double v) diff --git a/src/vector.h b/src/vector.h index 02d53d893..4ba524c0d 100644 --- a/src/vector.h +++ b/src/vector.h @@ -40,15 +40,15 @@ class Vector final * Constructor. */ Vector(): - x(0.0f), - y(0.0f), - z(0.0f) + x(0.0F), + y(0.0F), + z(0.0F) {} /** * Constructor. */ - Vector(const float x0, const float y0, const float z0 = 0.0f) : + Vector(const float x0, const float y0, const float z0 = 0.0F) : x(x0), y(y0), z(z0) @@ -69,7 +69,7 @@ class Vector final */ bool isNull() const A_WARN_UNUSED { - return x == 0.0f && y == 0.0f && z == 0.0f; + return x == 0.0F && y == 0.0F && z == 0.0F; } /** |