1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-04-11 11:31:52 +02:00

Moved Colors to a separate file, updated includes

This commit is contained in:
Ivan Savenko 2023-02-02 21:15:13 +02:00
parent aab082fd2e
commit 3fef2a5e1f
30 changed files with 128 additions and 78 deletions

View File

@ -54,6 +54,7 @@ set(client_SRCS
render/CFadeAnimation.cpp
render/Canvas.cpp
render/ColorFilter.cpp
render/Colors.cpp
render/Graphics.cpp
render/IFont.cpp
@ -161,6 +162,7 @@ set(client_HEADERS
render/CFadeAnimation.h
render/Canvas.h
render/ColorFilter.h
render/Colors.h
render/Graphics.h
render/ICursor.h
render/IFont.h

View File

@ -67,6 +67,7 @@
#include "../lib/CGameState.h"
#include "gui/NotificationHandler.h"
#include "adventureMap/CInGameConsole.h"
#include "renderSDL/SDL_Extensions.h"
#include <SDL_events.h>

View File

@ -30,6 +30,7 @@
#include "../gui/CGuiHandler.h"
#include "../widgets/TextControls.h"
#include "../widgets/Buttons.h"
#include "../CMT.h"
#include "../../CCallback.h"
#include "../../lib/CConfigHandler.h"

View File

@ -11,7 +11,7 @@
#include "StdInc.h"
#include "CInGameConsole.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../render/Colors.h"
#include "../CGameInfo.h"
#include "../CMusicHandler.h"
#include "../CPlayerInterface.h"

View File

@ -17,6 +17,7 @@
#include "../CGameInfo.h"
#include "../CPlayerInterface.h"
#include "../gui/CGuiHandler.h"
#include "../render/Colors.h"
#include "../renderSDL/SDL_PixelAccess.h"
#include "../../CCallback.h"

View File

@ -12,6 +12,7 @@
#include "../CGameInfo.h"
#include "../CPlayerInterface.h"
#include "../render/Colors.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../gui/CGuiHandler.h"
#include "../widgets/Images.h"

View File

@ -13,6 +13,7 @@
#include "../render/CAnimation.h"
#include "../render/CFadeAnimation.h"
#include "../render/Colors.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../CGameInfo.h"
#include "../render/Graphics.h"

View File

@ -33,6 +33,7 @@
#include "../windows/CSpellWindow.h"
#include "../render/CAnimation.h"
#include "../adventureMap/CInGameConsole.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../CCallback.h"
#include "../../lib/CStack.h"

View File

@ -26,8 +26,9 @@
#include "../CMusicHandler.h"
#include "../CGameInfo.h"
#include "../gui/CGuiHandler.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../render/Colors.h"
#include "../render/Canvas.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../CCallback.h"
#include "../../lib/spells/ISpellMechanics.h"

View File

@ -28,6 +28,7 @@
#include "../render/CAnimation.h"
#include "../render/Canvas.h"
#include "../adventureMap/CInGameConsole.h"
#include "../CMT.h"
#include "../../CCallback.h"
#include "../../lib/CGeneralTextHandler.h"

View File

@ -15,6 +15,7 @@
#include "CursorHandler.h"
#include "../CGameInfo.h"
#include "../render/Colors.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../CMT.h"
#include "../CPlayerInterface.h"

View File

@ -16,25 +16,9 @@
#include "../lobby/CBonusSelection.h"
#include "../lobby/CSelectionBase.h"
#include "../lobby/CLobbyScreen.h"
#include "../../lib/filesystem/Filesystem.h"
#include "../../lib/filesystem/CCompressedStream.h"
#include "../gui/CursorHandler.h"
#include "../CGameInfo.h"
#include "../../lib/CGeneralTextHandler.h"
#include "../../lib/JsonNode.h"
#include "../CMusicHandler.h"
#include "../CVideoHandler.h"
#include "../../lib/serializer/Connection.h"
#include "../../lib/serializer/CTypeList.h"
#include "../../lib/VCMIDirs.h"
#include "../../lib/mapping/CMap.h"
#include "../CMT.h"
#include "../windows/GUIClasses.h"
#include "../CPlayerInterface.h"
#include "../../CCallback.h"
#include "../Client.h"
#include "../gui/CGuiHandler.h"
#include "../widgets/CComponent.h"
#include "../widgets/Buttons.h"
@ -43,6 +27,23 @@
#include "../widgets/TextControls.h"
#include "../windows/InfoWindows.h"
#include "../CServerHandler.h"
#include "../CGameInfo.h"
#include "../CMusicHandler.h"
#include "../CVideoHandler.h"
#include "../CPlayerInterface.h"
#include "../Client.h"
#include "../../CCallback.h"
#include "../../lib/CGeneralTextHandler.h"
#include "../../lib/JsonNode.h"
#include "../../lib/serializer/Connection.h"
#include "../../lib/serializer/CTypeList.h"
#include "../../lib/filesystem/Filesystem.h"
#include "../../lib/filesystem/CCompressedStream.h"
#include "../../lib/VCMIDirs.h"
#include "../../lib/mapping/CMap.h"
#include "../../lib/CStopWatch.h"
#include "../../lib/NetPacksLobby.h"
#include "../../lib/CThreadHelper.h"

View File

@ -16,6 +16,7 @@
#include "../CVideoHandler.h"
#include "../gui/CGuiHandler.h"
#include "../widgets/TextControls.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../lib/mapping/CCampaignHandler.h"

26
client/render/Colors.cpp Normal file
View File

@ -0,0 +1,26 @@
/*
* IFont.cpp, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#include "StdInc.h"
#include "Colors.h"
#include <SDL_pixels.h>
const SDL_Color Colors::YELLOW = { 229, 215, 123, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::WHITE = { 255, 243, 222, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::METALLIC_GOLD = { 173, 142, 66, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::GREEN = { 0, 255, 0, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::ORANGE = { 232, 184, 32, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::BRIGHT_YELLOW = { 242, 226, 110, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::DEFAULT_KEY_COLOR = {0, 255, 255, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::RED = {255, 0, 0, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::PURPLE = {255, 75, 125, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::BLACK = {0, 0, 0, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::TRANSPARENCY = {0, 0, 0, SDL_ALPHA_TRANSPARENT};

50
client/render/Colors.h Normal file
View File

@ -0,0 +1,50 @@
/*
* ICursor.h, part of VCMI engine
*
* Authors: listed in file AUTHORS in main folder
*
* License: GNU General Public License v2.0 or later
* Full text of license available in license.txt file, in main folder
*
*/
#pragma once
struct SDL_Color;
/**
* The colors class defines color constants of type SDL_Color.
*/
class Colors
{
public:
/** the h3 yellow color, typically used for headlines */
static const SDL_Color YELLOW;
/** the standard h3 white color */
static const SDL_Color WHITE;
/** the metallic gold color used mostly as a border around buttons */
static const SDL_Color METALLIC_GOLD;
/** green color used for in-game console */
static const SDL_Color GREEN;
/** the h3 orange color, used for blocked buttons */
static const SDL_Color ORANGE;
/** the h3 bright yellow color, used for selection border */
static const SDL_Color BRIGHT_YELLOW;
/** default key color for all 8 & 24 bit graphics */
static const SDL_Color DEFAULT_KEY_COLOR;
/// Selected creature card
static const SDL_Color RED;
/// Minimap border
static const SDL_Color PURPLE;
static const SDL_Color BLACK;
static const SDL_Color TRANSPARENCY;
};

View File

@ -10,7 +10,8 @@
#include "StdInc.h"
#include "CTrueTypeFont.h"
#include "SDL_Extensions.h"
#include "../render/Colors.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../lib/JsonNode.h"
#include "../../lib/CGeneralTextHandler.h"

View File

@ -11,8 +11,9 @@
#include "StdInc.h"
#include "CursorHardware.h"
#include "SDL_Extensions.h"
#include "../render/Colors.h"
#include "../render/IImage.h"
#include "SDL_Extensions.h"
#include <SDL_render.h>
#include <SDL_events.h>

View File

@ -11,9 +11,9 @@
#include "StdInc.h"
#include "CursorSoftware.h"
#include "SDL_Extensions.h"
#include "../render/Colors.h"
#include "../render/IImage.h"
#include "SDL_Extensions.h"
#include <SDL_render.h>
#include <SDL_events.h>

View File

@ -13,6 +13,7 @@
#include "SDL_PixelAccess.h"
#include "../render/Graphics.h"
#include "../render/Colors.h"
#include <SDL_render.h>
@ -24,18 +25,6 @@
#include "ios/utils.h"
#endif
const SDL_Color Colors::YELLOW = { 229, 215, 123, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::WHITE = { 255, 243, 222, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::METALLIC_GOLD = { 173, 142, 66, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::GREEN = { 0, 255, 0, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::ORANGE = { 232, 184, 32, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::BRIGHT_YELLOW = { 242, 226, 110, SDL_ALPHA_OPAQUE };
const SDL_Color Colors::DEFAULT_KEY_COLOR = {0, 255, 255, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::RED = {255, 0, 0, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::PURPLE = {255, 75, 125, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::BLACK = {0, 0, 0, SDL_ALPHA_OPAQUE};
const SDL_Color Colors::TRANSPARENCY = {0, 0, 0, SDL_ALPHA_TRANSPARENT};
Rect CSDL_Ext::genRect(const int & hh, const int & ww, const int & xx, const int & yy)
{
Rect ret;

View File

@ -32,44 +32,6 @@ class Point;
VCMI_LIB_NAMESPACE_END
/**
* The colors class defines color constants of type SDL_Color.
*/
class Colors
{
public:
/** the h3 yellow color, typically used for headlines */
static const SDL_Color YELLOW;
/** the standard h3 white color */
static const SDL_Color WHITE;
/** the metallic gold color used mostly as a border around buttons */
static const SDL_Color METALLIC_GOLD;
/** green color used for in-game console */
static const SDL_Color GREEN;
/** the h3 orange color, used for blocked buttons */
static const SDL_Color ORANGE;
/** the h3 bright yellow color, used for selection border */
static const SDL_Color BRIGHT_YELLOW;
/** default key color for all 8 & 24 bit graphics */
static const SDL_Color DEFAULT_KEY_COLOR;
/// Selected creature card
static const SDL_Color RED;
/// Minimap border
static const SDL_Color PURPLE;
static const SDL_Color BLACK;
static const SDL_Color TRANSPARENCY;
};
namespace CSDL_Ext
{

View File

@ -21,6 +21,7 @@
#include "../gui/CGuiHandler.h"
#include "../windows/InfoWindows.h"
#include "../render/CAnimation.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../lib/CConfigHandler.h"
#include "../../lib/CGeneralTextHandler.h"

View File

@ -10,7 +10,7 @@
#pragma once
#include "../gui/CIntObject.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../render/Colors.h"
#include "../../lib/FunctionList.h"
#include <SDL_pixels.h>

View File

@ -19,6 +19,7 @@
#include "../windows/CHeroWindow.h"
#include "../windows/CSpellWindow.h"
#include "../windows/GUIClasses.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../CPlayerInterface.h"
#include "../CGameInfo.h"

View File

@ -14,11 +14,11 @@
#include "TextControls.h"
#include "../gui/CGuiHandler.h"
#include "../CGameInfo.h"
#include "../CPlayerInterface.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../windows/CCreatureWindow.h"
#include "../windows/GUIClasses.h"
#include "../CGameInfo.h"
#include "../CPlayerInterface.h"
#include "../../CCallback.h"

View File

@ -17,6 +17,8 @@
#include "../gui/CGuiHandler.h"
#include "../windows/CMessage.h"
#include "../adventureMap/CInGameConsole.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../lib/CGeneralTextHandler.h"
#ifdef VCMI_ANDROID

View File

@ -11,7 +11,7 @@
#include "../gui/CIntObject.h"
#include "../gui/TextAlignment.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../render/Colors.h"
#include "../render/Graphics.h"
#include "../../lib/FunctionList.h"

View File

@ -22,6 +22,7 @@
#include "../widgets/TextControls.h"
#include "../widgets/ObjectLists.h"
#include "../gui/CGuiHandler.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../CCallback.h"
#include "../../lib/CStack.h"

View File

@ -20,6 +20,7 @@
#include "../widgets/TextControls.h"
#include "../render/CAnimation.h"
#include "../render/IImage.h"
#include "../renderSDL/SDL_Extensions.h"
#include <SDL_surface.h>

View File

@ -18,6 +18,7 @@
#include "../adventureMap/CAdvMapInt.h"
#include "../widgets/Buttons.h"
#include "../adventureMap/CMinimap.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../CCallback.h"
#include "../../lib/CArtHandler.h"

View File

@ -28,6 +28,7 @@
#include "../widgets/TextControls.h"
#include "../adventureMap/CAdvMapInt.h"
#include "../render/CAnimation.h"
#include "../renderSDL/SDL_Extensions.h"
#include "../../CCallback.h"