aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSefa Eyeoglu <contact@scrumplex.net>2022-03-21 16:58:37 +0100
committerGitHub <noreply@github.com>2022-03-21 16:58:37 +0100
commit64399dd8d619d1a515a72abd06ed47c9c34b94c4 (patch)
treed8b579a7698546d61a8d183da32ef0f4d303cadf
parentf2ca11688ef859cd2257105f39a07318a31c5be6 (diff)
parente8373bbf65c62096588a19c09959f1212ae14403 (diff)
downloadPrismLauncher-64399dd8d619d1a515a72abd06ed47c9c34b94c4.tar.gz
PrismLauncher-64399dd8d619d1a515a72abd06ed47c9c34b94c4.tar.bz2
PrismLauncher-64399dd8d619d1a515a72abd06ed47c9c34b94c4.zip
Merge pull request #322 from oynqr/build/static-rainbow
Build with static rainbow
-rw-r--r--launcher/CMakeLists.txt2
-rw-r--r--libraries/rainbow/CMakeLists.txt14
-rw-r--r--libraries/rainbow/include/rainbow.h20
-rw-r--r--libraries/rainbow/include/rainbow_config.h26
4 files changed, 13 insertions, 49 deletions
diff --git a/launcher/CMakeLists.txt b/launcher/CMakeLists.txt
index 6491ccce..98cb0a3b 100644
--- a/launcher/CMakeLists.txt
+++ b/launcher/CMakeLists.txt
@@ -941,8 +941,8 @@ target_link_libraries(Launcher_logic
Launcher_iconfix
QuaZip::QuaZip
hoedown
- PolyMC_rainbow
LocalPeer
+ Launcher_rainbow
)
target_link_libraries(Launcher_logic)
diff --git a/libraries/rainbow/CMakeLists.txt b/libraries/rainbow/CMakeLists.txt
index a07135c3..e57dbbc2 100644
--- a/libraries/rainbow/CMakeLists.txt
+++ b/libraries/rainbow/CMakeLists.txt
@@ -8,15 +8,7 @@ set(RAINBOW_SOURCES
src/rainbow.cpp
)
-add_definitions(-DRAINBOW_LIBRARY)
-add_library(PolyMC_rainbow SHARED ${RAINBOW_SOURCES})
-target_include_directories(PolyMC_rainbow PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
+add_library(Launcher_rainbow STATIC ${RAINBOW_SOURCES})
+target_include_directories(Launcher_rainbow PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
-target_link_libraries(PolyMC_rainbow Qt5::Core Qt5::Gui)
-
-# Install it
-install(
- TARGETS PolyMC_rainbow
- RUNTIME DESTINATION ${LIBRARY_DEST_DIR}
- LIBRARY DESTINATION ${LIBRARY_DEST_DIR}
-)
+target_link_libraries(Launcher_rainbow Qt5::Core Qt5::Gui)
diff --git a/libraries/rainbow/include/rainbow.h b/libraries/rainbow/include/rainbow.h
index 67c46300..57be87f1 100644
--- a/libraries/rainbow/include/rainbow.h
+++ b/libraries/rainbow/include/rainbow.h
@@ -23,8 +23,6 @@
#pragma once
-#include "rainbow_config.h"
-
#include <QPainter>
class QColor;
@@ -43,13 +41,13 @@ namespace Rainbow
*
* @see http://en.wikipedia.org/wiki/Luma_(video)
*/
-RAINBOW_EXPORT qreal luma(const QColor &);
+qreal luma(const QColor &);
/**
* Calculate hue, chroma and luma of a color in one call.
* @since 5.0
*/
-RAINBOW_EXPORT void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *luma,
+void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *luma,
qreal *alpha = 0);
/**
@@ -64,7 +62,7 @@ RAINBOW_EXPORT void getHcy(const QColor &, qreal *hue, qreal *chroma, qreal *lum
*
* @see Rainbow::luma
*/
-RAINBOW_EXPORT qreal contrastRatio(const QColor &, const QColor &);
+qreal contrastRatio(const QColor &, const QColor &);
/**
* Adjust the luma of a color by changing its distance from white.
@@ -81,7 +79,7 @@ RAINBOW_EXPORT qreal contrastRatio(const QColor &, const QColor &);
* component of the color; 1.0 means no change, 0.0 maximizes chroma
* @see Rainbow::shade
*/
-RAINBOW_EXPORT QColor
+QColor
lighten(const QColor &, qreal amount = 0.5, qreal chromaInverseGain = 1.0);
/**
@@ -99,7 +97,7 @@ lighten(const QColor &, qreal amount = 0.5, qreal chromaInverseGain = 1.0);
* component of the color; 1.0 means no change, 0.0 minimizes chroma
* @see Rainbow::shade
*/
-RAINBOW_EXPORT QColor darken(const QColor &, qreal amount = 0.5, qreal chromaGain = 1.0);
+QColor darken(const QColor &, qreal amount = 0.5, qreal chromaGain = 1.0);
/**
* Adjust the luma and chroma components of a color. The amount is added
@@ -113,7 +111,7 @@ RAINBOW_EXPORT QColor darken(const QColor &, qreal amount = 0.5, qreal chromaGai
* 1.0 maximizes chroma
* @see Rainbow::luma
*/
-RAINBOW_EXPORT QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount = 0.0);
+QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount = 0.0);
/**
* Create a new color by tinting one color with another. This function is
@@ -127,7 +125,7 @@ RAINBOW_EXPORT QColor shade(const QColor &, qreal lumaAmount, qreal chromaAmount
* @param amount how strongly to tint the base; 0.0 gives @p base,
* 1.0 gives @p color
*/
-RAINBOW_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount = 0.3);
+QColor tint(const QColor &base, const QColor &color, qreal amount = 0.3);
/**
* Blend two colors into a new color by linear combination.
@@ -140,7 +138,7 @@ RAINBOW_EXPORT QColor tint(const QColor &base, const QColor &color, qreal amount
* @p bias >= 1 gives @p c2. @p bias == 0.5 gives a 50% blend of @p c1
* and @p c2.
*/
-RAINBOW_EXPORT QColor mix(const QColor &c1, const QColor &c2, qreal bias = 0.5);
+QColor mix(const QColor &c1, const QColor &c2, qreal bias = 0.5);
/**
* Blend two colors into a new color by painting the second color over the
@@ -154,7 +152,7 @@ RAINBOW_EXPORT QColor mix(const QColor &c1, const QColor &c2, qreal bias = 0.5);
* @param paint the color to be overlayed onto the base color.
* @param comp the CompositionMode used to do the blending.
*/
-RAINBOW_EXPORT QColor
+QColor
overlayColors(const QColor &base, const QColor &paint,
QPainter::CompositionMode comp = QPainter::CompositionMode_SourceOver);
}
diff --git a/libraries/rainbow/include/rainbow_config.h b/libraries/rainbow/include/rainbow_config.h
deleted file mode 100644
index 52cc7388..00000000
--- a/libraries/rainbow/include/rainbow_config.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright 2013-2021 MultiMC Contributors
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <QtCore/QtGlobal>
-
-#ifdef RAINBOW_STATIC
- #define RAINBOW_EXPORT
-#else
- #ifdef RAINBOW_LIBRARY
- #define RAINBOW_EXPORT Q_DECL_EXPORT
- #else
- #define RAINBOW_EXPORT Q_DECL_IMPORT
- #endif
-#endif \ No newline at end of file