MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
anonymous_namespace{puzzle_drop.cpp} Namespace Reference

Classes

struct  Block
struct  Cell
struct  Piece
class  PuzzleDropWindow

Enumerations

enum class  BlockType {
  Null = 0 , Clear , Red1 , Red2 ,
  Red3 , Green1 , Green2 , Green3 ,
  Blue1 , Blue2 , Blue3 , Match
}
enum class  ShiftDirection { Down , Up }

Functions

bool is_play_block (BlockType type)
bool same_or_match (BlockType actual, BlockType expected)
int texture_index (BlockType type)

Variables

const std::array< glm::vec3, 10 > BLOCK_TINTS
constexpr int BOARD_HEIGHT = 22
constexpr int BOARD_WIDTH = 20
constexpr float CUBE_SCALE = 0.048f
constexpr float CUBE_SPACING = CUBE_SCALE * 1.12f
constexpr std::array< float, 3 > FALL_SECONDS {0.86f, 0.68f, 0.50f}
constexpr size_t FRAME_TEXTURE_INDEX = 10
constexpr Uint32 INTRO_FADE_INTERVAL_MS = 35U
constexpr float INTRO_FADE_STEP = 0.01f
constexpr float INTRO_START_FADE = 1.0f
constexpr size_t LEVEL_GRAPHIC_COUNT = 8
constexpr int MATRIX_RAIN_TEXTURE_HEIGHT = 720
constexpr int MATRIX_RAIN_TEXTURE_WIDTH = 1280
constexpr size_t PREVIEW_BLOCK_TEXTURE_COUNT = 10
const std::array< std::string, PREVIEW_BLOCK_TEXTURE_COUNTPREVIEW_BLOCK_TEXTURE_FILES

Enumeration Type Documentation

◆ BlockType

◆ ShiftDirection

enum class anonymous_namespace{puzzle_drop.cpp}::ShiftDirection
strong
Enumerator
Down 
Up 

Definition at line 58 of file puzzle_drop.cpp.

Function Documentation

◆ is_play_block()

bool anonymous_namespace{puzzle_drop.cpp}::is_play_block ( BlockType type)
nodiscard

◆ same_or_match()

bool anonymous_namespace{puzzle_drop.cpp}::same_or_match ( BlockType actual,
BlockType expected )
nodiscard

Definition at line 193 of file puzzle_drop.cpp.

193 {
194 return actual == expected || actual == BlockType::Match;
195 }

◆ texture_index()

int anonymous_namespace{puzzle_drop.cpp}::texture_index ( BlockType type)
nodiscard

Definition at line 186 of file puzzle_drop.cpp.

186 {
187 if (!is_play_block(type)) {
188 return 0;
189 }
190 return static_cast<int>(type) - static_cast<int>(BlockType::Red1);
191 }

Variable Documentation

◆ BLOCK_TINTS

const std::array<glm::vec3, 10> anonymous_namespace{puzzle_drop.cpp}::BLOCK_TINTS
Initial value:
{{
{1.00f, 0.48f, 0.42f},
{1.00f, 0.58f, 0.50f},
{1.00f, 0.72f, 0.62f},
{0.42f, 0.95f, 0.55f},
{0.55f, 1.00f, 0.65f},
{0.70f, 1.00f, 0.78f},
{0.38f, 0.62f, 1.00f},
{0.50f, 0.74f, 1.00f},
{0.66f, 0.86f, 1.00f},
{1.00f, 0.92f, 0.35f},
}}

Definition at line 156 of file puzzle_drop.cpp.

156 {{
157 {1.00f, 0.48f, 0.42f},
158 {1.00f, 0.58f, 0.50f},
159 {1.00f, 0.72f, 0.62f},
160 {0.42f, 0.95f, 0.55f},
161 {0.55f, 1.00f, 0.65f},
162 {0.70f, 1.00f, 0.78f},
163 {0.38f, 0.62f, 1.00f},
164 {0.50f, 0.74f, 1.00f},
165 {0.66f, 0.86f, 1.00f},
166 {1.00f, 0.92f, 0.35f},
167 }};

◆ BOARD_HEIGHT

int anonymous_namespace{puzzle_drop.cpp}::BOARD_HEIGHT = 22
constexpr

Definition at line 30 of file puzzle_drop.cpp.

◆ BOARD_WIDTH

int anonymous_namespace{puzzle_drop.cpp}::BOARD_WIDTH = 20
constexpr

Definition at line 29 of file puzzle_drop.cpp.

◆ CUBE_SCALE

float anonymous_namespace{puzzle_drop.cpp}::CUBE_SCALE = 0.048f
constexpr

Definition at line 31 of file puzzle_drop.cpp.

◆ CUBE_SPACING

float anonymous_namespace{puzzle_drop.cpp}::CUBE_SPACING = CUBE_SCALE * 1.12f
constexpr

Definition at line 32 of file puzzle_drop.cpp.

◆ FALL_SECONDS

std::array<float, 3> anonymous_namespace{puzzle_drop.cpp}::FALL_SECONDS {0.86f, 0.68f, 0.50f}
constexpr

Definition at line 33 of file puzzle_drop.cpp.

33{0.86f, 0.68f, 0.50f};

◆ FRAME_TEXTURE_INDEX

size_t anonymous_namespace{puzzle_drop.cpp}::FRAME_TEXTURE_INDEX = 10
constexpr

Definition at line 39 of file puzzle_drop.cpp.

◆ INTRO_FADE_INTERVAL_MS

Uint32 anonymous_namespace{puzzle_drop.cpp}::INTRO_FADE_INTERVAL_MS = 35U
constexpr

Definition at line 35 of file puzzle_drop.cpp.

◆ INTRO_FADE_STEP

float anonymous_namespace{puzzle_drop.cpp}::INTRO_FADE_STEP = 0.01f
constexpr

Definition at line 34 of file puzzle_drop.cpp.

◆ INTRO_START_FADE

float anonymous_namespace{puzzle_drop.cpp}::INTRO_START_FADE = 1.0f
constexpr

Definition at line 36 of file puzzle_drop.cpp.

◆ LEVEL_GRAPHIC_COUNT

size_t anonymous_namespace{puzzle_drop.cpp}::LEVEL_GRAPHIC_COUNT = 8
constexpr

Definition at line 40 of file puzzle_drop.cpp.

◆ MATRIX_RAIN_TEXTURE_HEIGHT

int anonymous_namespace{puzzle_drop.cpp}::MATRIX_RAIN_TEXTURE_HEIGHT = 720
constexpr

Definition at line 38 of file puzzle_drop.cpp.

◆ MATRIX_RAIN_TEXTURE_WIDTH

int anonymous_namespace{puzzle_drop.cpp}::MATRIX_RAIN_TEXTURE_WIDTH = 1280
constexpr

Definition at line 37 of file puzzle_drop.cpp.

◆ PREVIEW_BLOCK_TEXTURE_COUNT

size_t anonymous_namespace{puzzle_drop.cpp}::PREVIEW_BLOCK_TEXTURE_COUNT = 10
constexpr

Definition at line 41 of file puzzle_drop.cpp.

◆ PREVIEW_BLOCK_TEXTURE_FILES

const std::array<std::string, PREVIEW_BLOCK_TEXTURE_COUNT> anonymous_namespace{puzzle_drop.cpp}::PREVIEW_BLOCK_TEXTURE_FILES
Initial value:
{{
"red1.png",
"red2.png",
"red3.png",
"green1.png",
"green2.png",
"green3.png",
"blue1.png",
"blue2.png",
"blue3.png",
"red3.png",
}}

Definition at line 169 of file puzzle_drop.cpp.

169 {{
170 "red1.png",
171 "red2.png",
172 "red3.png",
173 "green1.png",
174 "green2.png",
175 "green3.png",
176 "blue1.png",
177 "blue2.png",
178 "blue3.png",
179 "red3.png",
180 }};