MXVK Vulkan Framework 0.24.0
C++20 Vulkan rendering framework for practical 2D and 3D application development with SDL3.
Loading...
Searching...
No Matches
acid.drop.cpp File Reference
#include "mxvk/argz.hpp"
#include "mxvk/mxvk.hpp"
#include "mxvk/mxvk_exception.hpp"
#include <SDL3/SDL.h>
#include <algorithm>
#include <climits>
#include <cmath>
#include <compare>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iostream>
#include <random>
#include <sstream>
#include <string>
#include <vector>

Go to the source code of this file.

Classes

struct  BlockColor
struct  GameBlock
struct  GameData
class  HighScores
class  MasterPieceWindow
struct  Score
struct  TileMatrix

Macros

#define puzzle_ASSET_DIR   "."

Enumerations

enum  {
  BLOCK_BLACK = 0 , BLOCK_YELLOW , BLOCK_ORANGE , BLOCK_LTBLUE ,
  BLOCK_DBLUE , BLOCK_PURPLE , BLOCK_PINK , BLOCK_GRAY ,
  BLOCK_RED , BLOCK_GREEN , BLOCK_CLEAR , BLOCK_COUNT
}
enum  ScreenState {
  SCREEN_INTRO , SCREEN_START , SCREEN_GAME , SCREEN_GAMEOVER ,
  SCREEN_OPTIONS , SCREEN_CREDITS , SCREEN_SCORES
}

Functions

int main (int argc, char **argv)

Variables

constexpr int BLOCK_HEIGHT = 15
constexpr int BLOCK_SIZE = 31
constexpr int BLOCK_SPACING = 1
constexpr int FLASH_DURATION = 300
constexpr int GRID_HEIGHT = 18
constexpr int GRID_WIDTH = 8
constexpr int NEXT_PANEL_X = 450
constexpr int NEXT_PANEL_Y = 180
constexpr int SHADER_LEVEL_COUNT = 4
constexpr int SHADER_LEVEL_LINES = 10
constexpr int STARTX = 184
constexpr int STARTY = 61

Macro Definition Documentation

◆ puzzle_ASSET_DIR

#define puzzle_ASSET_DIR   "."

Definition at line 20 of file acid.drop.cpp.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
BLOCK_BLACK 
BLOCK_YELLOW 
BLOCK_ORANGE 
BLOCK_LTBLUE 
BLOCK_DBLUE 
BLOCK_PURPLE 
BLOCK_PINK 
BLOCK_GRAY 
BLOCK_RED 
BLOCK_GREEN 
BLOCK_CLEAR 
BLOCK_COUNT 

Definition at line 36 of file acid.drop.cpp.

36 {
37 BLOCK_BLACK = 0,
49};
@ BLOCK_COUNT
Definition acid.drop.cpp:48
@ BLOCK_YELLOW
Definition acid.drop.cpp:38
@ BLOCK_PURPLE
Definition acid.drop.cpp:42
@ BLOCK_GRAY
Definition acid.drop.cpp:44
@ BLOCK_GREEN
Definition acid.drop.cpp:46
@ BLOCK_PINK
Definition acid.drop.cpp:43
@ BLOCK_DBLUE
Definition acid.drop.cpp:41
@ BLOCK_RED
Definition acid.drop.cpp:45
@ BLOCK_ORANGE
Definition acid.drop.cpp:39
@ BLOCK_BLACK
Definition acid.drop.cpp:37
@ BLOCK_CLEAR
Definition acid.drop.cpp:47
@ BLOCK_LTBLUE
Definition acid.drop.cpp:40

◆ ScreenState

Enumerator
SCREEN_INTRO 
SCREEN_START 
SCREEN_GAME 
SCREEN_GAMEOVER 
SCREEN_OPTIONS 
SCREEN_CREDITS 
SCREEN_SCORES 

Definition at line 51 of file acid.drop.cpp.

51 {
59};
@ SCREEN_START
Definition acid.drop.cpp:53
@ SCREEN_SCORES
Definition acid.drop.cpp:58
@ SCREEN_GAME
Definition acid.drop.cpp:54
@ SCREEN_OPTIONS
Definition acid.drop.cpp:56
@ SCREEN_INTRO
Definition acid.drop.cpp:52
@ SCREEN_GAMEOVER
Definition acid.drop.cpp:55
@ SCREEN_CREDITS
Definition acid.drop.cpp:57

Function Documentation

◆ main()

int main ( int argc,
char ** argv )

Definition at line 1426 of file acid.drop.cpp.

1426 {
1427 Arguments args = proc_args(argc, argv);
1428 try {
1429 MasterPieceWindow window(args.path, args.width, args.height, args.fullscreen, args.enable_vsync);
1430 window.loop();
1431 } catch (mxvk::Exception &e) {
1432 SDL_Log("mxvk: Exception: %s\n", e.text().c_str());
1433 return EXIT_FAILURE;
1434 } catch (ArgException<std::string> &e) {
1435 std::cerr << std::format("mxvk: Argument Exception: {}\n", e.text());
1436 return EXIT_FAILURE;
1437 }
1438 return EXIT_SUCCESS;
1439}
Arguments proc_args(int &argc, char **argv)
Parse standard libmx2 command-line options from main()'s argv.
Definition argz.hpp:872
Exception thrown by Argz::proc() on unrecognised or malformed options.
Definition argz.hpp:178
String text() const
Definition argz.hpp:182
std::string text() const
Plain data structure returned by proc_args() with all common libmx2 CLI options.
Definition argz.hpp:730
bool fullscreen
Whether fullscreen mode was requested.
Definition argz.hpp:736
bool enable_vsync
Enable FIFO present mode / v-sync (--enable-vsync).
Definition argz.hpp:750
int height
Viewport height in pixels (default: 720).
Definition argz.hpp:733
std::string path
Asset root; proc_args() defaults it to the executable directory.
Definition argz.hpp:735
int width
Viewport width in pixels (default: 1280).
Definition argz.hpp:732

Variable Documentation

◆ BLOCK_HEIGHT

int BLOCK_HEIGHT = 15
constexpr

Definition at line 28 of file acid.drop.cpp.

◆ BLOCK_SIZE

int BLOCK_SIZE = 31
constexpr

Definition at line 27 of file acid.drop.cpp.

◆ BLOCK_SPACING

int BLOCK_SPACING = 1
constexpr

Definition at line 29 of file acid.drop.cpp.

◆ FLASH_DURATION

int FLASH_DURATION = 300
constexpr

Definition at line 32 of file acid.drop.cpp.

◆ GRID_HEIGHT

int GRID_HEIGHT = 18
constexpr

Definition at line 26 of file acid.drop.cpp.

◆ GRID_WIDTH

int GRID_WIDTH = 8
constexpr

Definition at line 25 of file acid.drop.cpp.

◆ NEXT_PANEL_X

int NEXT_PANEL_X = 450
constexpr

Definition at line 30 of file acid.drop.cpp.

◆ NEXT_PANEL_Y

int NEXT_PANEL_Y = 180
constexpr

Definition at line 31 of file acid.drop.cpp.

◆ SHADER_LEVEL_COUNT

int SHADER_LEVEL_COUNT = 4
constexpr

Definition at line 34 of file acid.drop.cpp.

◆ SHADER_LEVEL_LINES

int SHADER_LEVEL_LINES = 10
constexpr

Definition at line 33 of file acid.drop.cpp.

◆ STARTX

int STARTX = 184
constexpr

Definition at line 23 of file acid.drop.cpp.

◆ STARTY

int STARTY = 61
constexpr

Definition at line 24 of file acid.drop.cpp.