git repos / blockattack-game

blame: source/code/themes.hpp

normal view · raw

aaba4f1e Poul Sander 2023-07-25 13:34 1
/*
aaba4f1e Poul Sander 2023-07-25 13:34 2
===========================================================================
aaba4f1e Poul Sander 2023-07-25 13:34 3
blockattack - Block Attack - Rise of the Blocks
aaba4f1e Poul Sander 2023-07-25 13:34 4
Copyright (C) 2005-2023 Poul Sander
aaba4f1e Poul Sander 2023-07-25 13:34 5
aaba4f1e Poul Sander 2023-07-25 13:34 6
This program is free software: you can redistribute it and/or modify
aaba4f1e Poul Sander 2023-07-25 13:34 7
it under the terms of the GNU General Public License as published by
aaba4f1e Poul Sander 2023-07-25 13:34 8
the Free Software Foundation, either version 2 of the License, or
aaba4f1e Poul Sander 2023-07-25 13:34 9
(at your option) any later version.
aaba4f1e Poul Sander 2023-07-25 13:34 10
aaba4f1e Poul Sander 2023-07-25 13:34 11
This program is distributed in the hope that it will be useful,
aaba4f1e Poul Sander 2023-07-25 13:34 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
aaba4f1e Poul Sander 2023-07-25 13:34 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
aaba4f1e Poul Sander 2023-07-25 13:34 14
GNU General Public License for more details.
aaba4f1e Poul Sander 2023-07-25 13:34 15
aaba4f1e Poul Sander 2023-07-25 13:34 16
You should have received a copy of the GNU General Public License
aaba4f1e Poul Sander 2023-07-25 13:34 17
along with this program.  If not, see http://www.gnu.org/licenses/
aaba4f1e Poul Sander 2023-07-25 13:34 18
aaba4f1e Poul Sander 2023-07-25 13:34 19
Source information and contacts persons can be found at
aaba4f1e Poul Sander 2023-07-25 13:34 20
https://www.blockattack.net
aaba4f1e Poul Sander 2023-07-25 13:34 21
===========================================================================
aaba4f1e Poul Sander 2023-07-25 13:34 22
*/
aaba4f1e Poul Sander 2023-07-25 13:34 23
aaba4f1e Poul Sander 2023-07-25 13:34 24
#pragma once
aaba4f1e Poul Sander 2023-07-25 13:34 25
aaba4f1e Poul Sander 2023-07-25 13:34 26
#include <string>
a0c212cb Poul Sander 2023-08-13 16:10 27
#include <vector>
aaba4f1e Poul Sander 2023-07-25 13:34 28
883f5498 Poul Sander 2023-11-01 20:58 29
enum class ImgScale {
883f5498 Poul Sander 2023-11-01 20:58 30
	Stretch,
883f5498 Poul Sander 2023-11-01 20:58 31
	Tile,
883f5498 Poul Sander 2023-11-01 20:58 32
	Resize,
883f5498 Poul Sander 2023-11-01 20:58 33
	Cut
883f5498 Poul Sander 2023-11-01 20:58 34
};
081d847a Poul Sander 2023-07-29 19:59 35
081d847a Poul Sander 2023-07-29 19:59 36
struct BackGroundData {
173b1d55 Poul Sander 2023-09-23 21:29 37
	std::string name = "standard";
081d847a Poul Sander 2023-07-29 19:59 38
	std::string background_sprite = "";
081d847a Poul Sander 2023-07-29 19:59 39
	std::string background_sprite_16x9 = "";
6444412c Poul Sander 2023-07-30 22:07 40
	int tileMoveSpeedX = 0; //Move the tiled background every X milliseconds. 0 disables it.
6444412c Poul Sander 2023-07-30 22:07 41
	int tileMoveSpeedY = 0; //Move the tiled background every X milliseconds. 0 disables it.
081d847a Poul Sander 2023-07-29 19:59 42
	ImgScale background_scale = ImgScale::Stretch;
081d847a Poul Sander 2023-07-29 19:59 43
};
081d847a Poul Sander 2023-07-29 19:59 44
2660ccea Poul Sander 2023-09-22 19:25 45
a0c212cb Poul Sander 2023-08-13 16:10 46
struct DecorationData {
a0c212cb Poul Sander 2023-08-13 16:10 47
	std::string name = "smilies";
a0c212cb Poul Sander 2023-08-13 16:10 48
	std::vector<std::string> decoration_sprites = {"smileys0", "smileys1", "smileys2", "smileys3"};
a0c212cb Poul Sander 2023-08-13 16:10 49
};
a0c212cb Poul Sander 2023-08-13 16:10 50
aaba4f1e Poul Sander 2023-07-25 13:34 51
struct Theme {
aaba4f1e Poul Sander 2023-07-25 13:34 52
	std::string theme_name = "standard";
aaba4f1e Poul Sander 2023-07-25 13:34 53
	std::string back_board = "back_board";  // Can also be "back_board_sample_snow" or "trans_cover"
173b1d55 Poul Sander 2023-09-23 21:29 54
	BackGroundData background;  //Serialized as background.background_name
a0c212cb Poul Sander 2023-08-13 16:10 55
	DecorationData decoration;
aaba4f1e Poul Sander 2023-07-25 13:34 56
};
aaba4f1e Poul Sander 2023-07-25 13:34 57
2660ccea Poul Sander 2023-09-22 19:25 58
struct ThemeFileData {
2660ccea Poul Sander 2023-09-22 19:25 59
	std::vector<BackGroundData> background_data;
00759e5a Poul Sander 2023-09-24 20:01 60
	std::vector<DecorationData> decoration_data;
2660ccea Poul Sander 2023-09-22 19:25 61
	std::vector<Theme> themes;
2660ccea Poul Sander 2023-09-22 19:25 62
};
2660ccea Poul Sander 2023-09-22 19:25 63
aaba4f1e Poul Sander 2023-07-25 13:34 64
/**
aaba4f1e Poul Sander 2023-07-25 13:34 65
 * @brief returns a theme from a list
aaba4f1e Poul Sander 2023-07-25 13:34 66
 * @return A copy of a theme
aaba4f1e Poul Sander 2023-07-25 13:34 67
 */
aaba4f1e Poul Sander 2023-07-25 13:34 68
Theme getNextTheme();
081d847a Poul Sander 2023-07-29 19:59 69
081d847a Poul Sander 2023-07-29 19:59 70
/**
081d847a Poul Sander 2023-07-29 19:59 71
 * @brief getTheme returns a specific theme
081d847a Poul Sander 2023-07-29 19:59 72
 * @param theme_number
081d847a Poul Sander 2023-07-29 19:59 73
 * @return
081d847a Poul Sander 2023-07-29 19:59 74
 */
081d847a Poul Sander 2023-07-29 19:59 75
Theme getTheme(size_t theme_number);
1970-01-01 00:00 76