mirror of
https://github.com/thepigeongenerator/mcaselector-lite.git
synced 2025-12-18 20:35:45 +01:00
Compare commits
2 Commits
87541d5789
...
8d0e825157
| Author | SHA1 | Date | |
|---|---|---|---|
| 8d0e825157 | |||
| 5f909d1d65 |
@@ -1,5 +1,6 @@
|
||||
# Copyright (c) 2025 Quinn
|
||||
# Licensed under the MIT Licence. See LICENSE for details
|
||||
# Copyright (c) 2025 Quinn.
|
||||
# This is a file from the project MCA-Selector-Lite and is
|
||||
# licensed under the MIT Licence. See included LICENSE file for details.
|
||||
#
|
||||
---
|
||||
# ---------------------------
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Copyright (c) 2025 Quinn
|
||||
# Licensed under the MIT Licence. See LICENSE for details
|
||||
# Copyright (c) 2025 Quinn.
|
||||
# This is a file from the project MCA-Selector-Lite and is
|
||||
# licensed under the MIT Licence. See included LICENSE file for details.
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
|
||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,5 +1,6 @@
|
||||
# Copyright (c) 2025 Quinn
|
||||
# Licensed under the MIT Licence. See LICENSE for details
|
||||
# Copyright (c) 2025 Quinn.
|
||||
# This is a file from the project MCA-Selector-Lite and is
|
||||
# licensed under the MIT Licence. See included LICENSE file for details.
|
||||
|
||||
# ignore all dotfiles by default
|
||||
.*
|
||||
|
||||
5
.gitmodules
vendored
5
.gitmodules
vendored
@@ -1,6 +1,11 @@
|
||||
# Copyright (c) 2025 Quinn.
|
||||
# This is a file from the project MCA-Selector-Lite and is
|
||||
# licensed under the MIT Licence. See included LICENSE file for details.
|
||||
|
||||
[submodule "lib/glfw"]
|
||||
path = lib/glfw
|
||||
url = https://github.com/glfw/glfw
|
||||
|
||||
[submodule "lib/libarchive"]
|
||||
path = lib/libarchive
|
||||
url = https://github.com/libarchive/libarchive
|
||||
|
||||
21
Makefile
21
Makefile
@@ -1,9 +1,12 @@
|
||||
# Copyright (c) 2025 Quinn
|
||||
# Licensed under the MIT Licence. See LICENSE for details
|
||||
# Copyright (c) 2025 Quinn.
|
||||
# This is a file from the project MCA-Selector-Lite and is
|
||||
# licensed under the MIT Licence. See included LICENSE file for details.
|
||||
|
||||
SHELL = /bin/sh
|
||||
.SUFFIXES:
|
||||
|
||||
NAME = mcaselector-lite
|
||||
|
||||
CC ?= cc
|
||||
RM ?= rm -vf
|
||||
CMAKE ?= cmake -G 'Unix Makefiles'
|
||||
@@ -11,10 +14,13 @@ CMAKE ?= cmake -G 'Unix Makefiles'
|
||||
CPPFLAGS ?= -DNDEBUG
|
||||
CFLAGS ?= -O2
|
||||
LDFLAGS ?= -flto
|
||||
CPPFLAGS += -DGLFW_INCLUDE_NONE -Iinclude -Ilib/glad/include -Ilib/glfw/include -Ilib/libarchive/libarchive
|
||||
CFLAGS += -std=gnu99 -g -Wall -Wextra -Wpedantic -Wno-pointer-arith -MMD -MP
|
||||
|
||||
CPPFLAGS += -DGLFW_INCLUDE_NONE
|
||||
CPPFLAGS += -Iinclude -Ilib/glad/include -Ilib/glfw/include -Ilib/libarchive/libarchive
|
||||
LDFLAGS += -Llib/obj/glfw/src -Llib/obj/libarchive/libarchive
|
||||
LDLIBS += -lglfw3 -larchive -lm
|
||||
CFLAGS += -std=gnu99 -g -MMD -MP
|
||||
CFLAGS += -Wall -Wextra -Wpedantic -Wno-pointer-arith
|
||||
|
||||
# detect if we're compiling on Windows, meaning
|
||||
# a lot of things considered "standard" are unavailable.
|
||||
@@ -22,15 +28,18 @@ ifeq ($(OS),Windows_NT)
|
||||
NAME := $(NAME).exe
|
||||
LDLIBS += -lopengl32 -lgdi32
|
||||
$(warning Detected Windows_NT, please refer to the documentation if you encounter issues.)
|
||||
# in the case of Mac OS X
|
||||
else ifeq ($(shell uname -s),Darwin)
|
||||
LDLIBS += -framework Cocoa -framework OpenGL -framework IOKit
|
||||
LDLIBS += -framework Coca -framework OpenGL -framework IOKit
|
||||
$(info Mac OS X detected.)
|
||||
endif
|
||||
|
||||
# find all the source files using wildcards
|
||||
# TODO: find a better method to find all source files
|
||||
# NOTE: MS-DOS and MS-Windows uses backslash `\`, this might break.
|
||||
RES := $(wildcard res/*)
|
||||
SRC := $(wildcard src/*.c src/*/*.c src/*/*/*.c src/*/*/*/*.c src/*/*/*/*/*.c src/*/*/*/*/*/*.c src/*/*/*/*/*/*/*.c src/*/*/*/*/*/*/*/*.c) lib/glad/src/gl.c
|
||||
SRC := $(wildcard src/*.c src/*/*.c src/*/*/*.c src/*/*/*/*.c src/*/*/*/*/*.c src/*/*/*/*/*/*.c src/*/*/*/*/*/*/*.c src/*/*/*/*/*/*/*/*.c)
|
||||
SRC += lib/glad/src/gl.c
|
||||
TSRC := $(wildcard test/*.c test/*/*.c test/*/*/*.c test/*/*/*/*.c test/*/*/*/*/*.c test/*/*/*/*/*/*.c test/*/*/*/*/*/*/*.c test/*/*/*/*/*/*/*/*.c)
|
||||
|
||||
OBJ := $(RES:%=obj/%.o) $(SRC:%.c=obj/%.o)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "mcx.h"
|
||||
|
||||
#include <archive.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "nbt.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "input.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "render.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "mapcolour.h"
|
||||
|
||||
#include "../../util/vec.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include "../../util/vec.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "shader.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include <glad/gl.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "window.h"
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
/* Set up the window, enabling OpenGL, and
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include <GLFW/glfw3.h>
|
||||
#include <glad/gl.h>
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
typedef signed long long int llong;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#if defined(__GNUC__)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#if defined __unix__
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#if defined(__unix__)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "conf.h"
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "error.h"
|
||||
|
||||
#include <stdarg.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#define WIDTHOF(t) (sizeof(t) * 8) // gets the bit width of a type
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
/* Acquires the next power of two of value `x`.
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include "../types.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "test.h"
|
||||
|
||||
#include "../src/types.h"
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#include "test_conf.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/* Copyright (c) 2025 Quinn
|
||||
* Licensed under the MIT Licence. See LICENSE for details */
|
||||
/* Copyright (c) 2025 Quinn.
|
||||
* This is a file from the project MCA-Selector-Lite and is
|
||||
* licensed under the MIT Licence. See included LICENSE file for details. */
|
||||
#pragma once
|
||||
|
||||
#include "../src/types.h"
|
||||
|
||||
Reference in New Issue
Block a user