From af5ee99682db1ca8c3d82810ff90499d5c040f61 Mon Sep 17 00:00:00 2001 From: Orangerot Date: Thu, 5 Jun 2025 01:40:21 +0200 Subject: feat: asset loader --- assets.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 assets.h (limited to 'assets.h') 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 + * + * 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 . + */ + +#include + +#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 */ + -- cgit v1.2.3