Rewrite on simdjson with a flat src and smack-style build

This commit is contained in:
shweet committed 2026-11-12 21:43:49 -05:00
1 parent 2d11cddc5e
commit 1a0db1abbd
178 files changed
+5935 -44757

No files matched your search

+66
View File
@@ -0,0 +1,66 @@
#pragma once
#include "common.h"
#include <string>
#include <vector>
enum Measurement
{
MEASUREMENT_METRIC,
MEASUREMENT_IMPERIAL
};
// The game's preferences, kept in settings.txt.
struct Settings
{
std::string lastCharacter;
Color color = {0.12f, 0.515f, 0.115f, 1};
int height = 900;
int volume = 50;
int width = 1600;
Measurement measurement = MEASUREMENT_METRIC;
bool isCharacterColor = true;
bool isConsole = false;
bool isMuted = false;
void load();
void save();
void reset();
template <class Visitor> void visit(Visitor&& visitor);
};
struct SavedItem
{
std::string name;
Vec2 position;
Vec2 velocity;
float rotation = 0;
};
// A character's progress, kept in saves/<character>.txt, and the live state of one being played.
struct Progress
{
std::vector<std::string> discovered;
std::vector<SavedItem> items;
Vec2 pan;
float calories = 0;
float capacity = 0;
float digestionProgress = 0;
float digestionRate = 0;
float playtime = 0;
float totalCalories = 0;
float weight = 0;
float zoom = 0;
int digestionTimer = 0;
int spawnDelay = 0;
int totalConsumed = 0;
int totalSpawned = 0;
bool isAlternate = false;
bool isDigesting = false;
bool isPostgame = false;
bool isValid = false;
void load(const std::string& path);
void save(const std::string& path);
template <class Visitor> void visit(Visitor&& visitor);
};