summaryrefslogtreecommitdiff
path: root/assets.h
diff options
context:
space:
mode:
authorOrangerot <purple@orangerot.dev>2025-06-05 01:40:21 +0200
committerOrangerot <purple@orangerot.dev>2025-06-05 01:40:21 +0200
commitaf5ee99682db1ca8c3d82810ff90499d5c040f61 (patch)
tree9303da8c306e302049d74e91998dbca83de3d5e0 /assets.h
parent603f5da7b7ec8f7a7b6255e887575c9d0f0140d9 (diff)
feat: asset loader
Diffstat (limited to 'assets.h')
-rw-r--r--assets.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/assets.h b/assets.h
new file mode 100644
index 0000000..419795b
--- /dev/null
+++ b/assets.h
@@ -0,0 +1,56 @@
+/*
+ * Tux-Town is a chill life-simulation game.
+ * Copyright (C) 2025 orangerot <me@orangerot.dev>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+#include <raylib.h>
+
+#ifndef ASSETS_H
+#define ASSETS_H
+
+#define ASSET_PATH "assets/kenney_nature-kit/Models/OBJ format/"
+#define ASSETS(ASSET) \
+ ASSET(ground_riverOpen) \
+ ASSET(ground_riverCornerSmall) \
+ ASSET(ground_riverSideOpen) \
+ ASSET(ground_riverSide) \
+ ASSET(ground_riverCross) \
+ ASSET(ground_riverSplit) \
+ ASSET(ground_riverStraight) \
+ ASSET(ground_riverCorner) \
+ ASSET(ground_riverBend) \
+ ASSET(ground_riverEndClosed) \
+ ASSET(ground_riverTile) \
+ ASSET(ground_grass) \
+ ASSET(cliff_top_rock) \
+ ASSET(tree_oak) \
+ ASSET(tent_detailedOpen)
+
+#define AS_ENUM(name) name,
+enum Asset {
+ ASSETS(AS_ENUM)
+ ASSET_LEN
+};
+
+Model assets[ASSET_LEN];
+
+#define AS_ARRAY(name) assets[name] = LoadModel(ASSET_PATH #name ".obj");
+void LoadModels() {
+ ASSETS(AS_ARRAY)
+}
+
+#endif /* ASSETS_H */
+