Mosaic
======

A simple 2D platform game using my
[Itty Bitty](https://git.gay/Quirky/itty-bitty) library and assets from yet
another of my games.

Mostly this is an experiment in good coding practices and maintanability, since
I'm too much into overengineering stuff.

Installation
------------

The code is written in 2020 ISO C++.  It uses the libraries `stdc++`, `GL`,
`Epoxy`, `SDL3`, `SDL3_image`, and `SDL3_mixer`.
It has been tested natively in Debian 12, and successfully cross-compiled for
Windows.

Installing dependencies in Debian 12:

```shell
sudo apt install build-essential
sudo apt install libgl1-mesa-dev libepoxy-dev

git clone --recursive https://github.com/libsdl-org/SDL
cd SDL && cmake . && make && sudo make install
cd ..

git clone --recursive https://github.com/libsdl-org/SDL_image
cd SDL_image && cmake . && make && sudo make install
cd ..

git clone --recursive https://github.com/libsdl-org/SDL_mixer
cd SDL_mixer && cmake . && make && sudo make install
cd ..
```

Installing dependencies in Debian 13:

```shell
sudo apt install build-essential
sudo apt install libgl1-mesa-dev libepoxy-dev
sudo apt install libsdl3-dev libsdl3-image-dev

git clone --recursive https://github.com/libsdl-org/SDL_mixer
cd SDL_mixer && cmake . && make && sudo make install
cd ..
```

Installing dependencies in Arch:

```shell
sudo pacman -S libepoxy sdl3
yay -S sdl3_image sdl3_mixer
```

To compile and install the game itself:

```shell
git clone --recursive https://git.gay/Quirky/mosaic
cd mosaic && make all install
```

By default, the make scripts installs everything in `prefix=$(HOME)/.local`,
with the executable in `bindir=$(prefix)/bin` and the data in
`datadir=$(prefix)/share/mosaic`; this can be changed by providing alternative
values for `prefix`, `bindir`, or `datadir` to make, but note below about the
paths where the executable searches for data.

To launch the game:

```shell
mosaic
```

The executable searches for data in a `mosaic` directory on paths according to
the XDG base directory specification, in order:

- wherever `$XDG_DATA_HOME` says, or if not defined `$HOME/.local/share`;
- wherever `$XDG_DATA_DIRS` says, or if not defined `/usr/local/share:/usr/share`.

