Cleaned files and persmissions.
This commit is contained in:
parent
0b5d3892dd
commit
0f9bb7c188
|
|
@ -7,20 +7,21 @@
|
||||||
"${workspaceFolder}/src",
|
"${workspaceFolder}/src",
|
||||||
"${workspaceFolder}/src/components",
|
"${workspaceFolder}/src/components",
|
||||||
"${workspaceFolder}/core",
|
"${workspaceFolder}/core",
|
||||||
"${workspaceFolder}/core/host/generic",
|
"${workspaceFolder}/core/host/linux",
|
||||||
"/usr/include/lua5.4",
|
"/usr/include/lua5.4",
|
||||||
"/usr/include/pipewire-0.3",
|
"/usr/include/pipewire-0.3",
|
||||||
"/usr/include/spa-0.2",
|
"/usr/include/spa-0.2",
|
||||||
"/usr/include/libdrm",
|
"/usr/include/libdrm",
|
||||||
"/usr/include/libdecor-0",
|
"/usr/include/libdecor-0",
|
||||||
"/usr/include/x86_64-linux-gnu",
|
"/usr/include/x86_64-linux-gnu"//,
|
||||||
"${env:HOME}/.local/share/fxsdk/sysroot/sh3eb-elf/include"
|
// "${env:HOME}/.local/share/fxsdk/sysroot/sh3eb-elf/include"
|
||||||
],
|
],
|
||||||
"compilerPath": "/usr/bin/gcc",
|
"compilerPath": "/usr/bin/gcc",
|
||||||
"defines": [
|
"defines": [
|
||||||
"_REENTRANT",
|
"_REENTRANT",
|
||||||
"FXCG50",
|
"FXCG50",
|
||||||
"TARGET_FXCG50"
|
"TARGET_FXCG50",
|
||||||
|
"ASSET_FILE_NAME=\"game.data\""
|
||||||
],
|
],
|
||||||
"cStandard": "c17",
|
"cStandard": "c17",
|
||||||
"browse": {
|
"browse": {
|
||||||
|
|
|
||||||
3
Makefile
3
Makefile
|
|
@ -82,7 +82,6 @@ $(ASSET_OUTPUT): FORCE
|
||||||
|
|
||||||
FORCE:
|
FORCE:
|
||||||
|
|
||||||
.PHONY: clean clean-all run print-var-%
|
|
||||||
clean:
|
clean:
|
||||||
$(Q)rm -rf $(BUILD_DIR)
|
$(Q)rm -rf $(BUILD_DIR)
|
||||||
|
|
||||||
|
|
@ -94,3 +93,5 @@ run: all
|
||||||
|
|
||||||
print-var-% :
|
print-var-% :
|
||||||
@echo $($*)
|
@echo $($*)
|
||||||
|
|
||||||
|
.PHONY: clean clean-all run print-var-%
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
#
|
#
|
||||||
# Project settings no matter current and target hosts
|
# Project settings
|
||||||
#
|
#
|
||||||
|
|
||||||
CONFIG_FILE="config.mk"
|
CONFIG_FILE="config.mk"
|
||||||
|
|
@ -34,19 +34,23 @@ for i in "$@"; do
|
||||||
TARGET_HOST="${i#*=}"
|
TARGET_HOST="${i#*=}"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--current-host=*)
|
--current-host=*)
|
||||||
HOST="${i#*=}"
|
HOST="${i#*=}"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--clean)
|
--clean)
|
||||||
CLEAN=1
|
CLEAN=1
|
||||||
EXIT_AFTER_CLEAN=1
|
EXIT_AFTER_CLEAN=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--reconfigure)
|
--reconfigure)
|
||||||
CLEAN=1
|
CLEAN=1
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-h|--help)
|
-h|--help)
|
||||||
echo "Usage : ./configure [OPTION]..."
|
echo "Usage : ./configure [OPTION]..."
|
||||||
echo "Add submodules depending on target host platform and"
|
echo "Add submodules depending on target host platform and"
|
||||||
|
|
@ -66,9 +70,11 @@ for i in "$@"; do
|
||||||
echo -e "\tshow help and exit"
|
echo -e "\tshow help and exit"
|
||||||
exit 0
|
exit 0
|
||||||
;;
|
;;
|
||||||
|
|
||||||
-*)
|
-*)
|
||||||
exit_error_message "Unknown option $i"
|
exit_error_message "Unknown option $i"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
@ -102,7 +108,7 @@ if [ "${HOST}" = "guess" ]; then
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Configuring for current host: ${HOST}"
|
echo "Configuring for host: ${HOST}"
|
||||||
|
|
||||||
# If target host is guess then configure for host
|
# If target host is guess then configure for host
|
||||||
if [ "${TARGET_HOST}" = "guess" ]; then
|
if [ "${TARGET_HOST}" = "guess" ]; then
|
||||||
|
|
@ -154,13 +160,16 @@ case "${TARGET_HOST}" in
|
||||||
TARGET_HOST_PKG_CONFIG=pkg-config
|
TARGET_HOST_PKG_CONFIG=pkg-config
|
||||||
TARGET_HOST_CFLAGS=(
|
TARGET_HOST_CFLAGS=(
|
||||||
"--std=c17" "-Os"
|
"--std=c17" "-Os"
|
||||||
"-DASSET_FILE_NAME=\\\"\$(notdir \$(ASSET_OUTPUT))\\\"" "-D_GNU_SOURCE=1"
|
"-DASSET_FILE_NAME=\\\"\$(notdir \$(ASSET_OUTPUT))\\\""
|
||||||
|
)
|
||||||
|
TARGET_HOST_LDFLAGS=(
|
||||||
|
"-lm"
|
||||||
)
|
)
|
||||||
TARGET_HOST_LDFLAGS=()
|
|
||||||
OUTPUT_EXT=""
|
OUTPUT_EXT=""
|
||||||
DYNAMIC_LIB_OUTPUT_EXT=".so"
|
DYNAMIC_LIB_OUTPUT_EXT=".so"
|
||||||
STATIC_LIB_OUTPUT_EXT=".a"
|
STATIC_LIB_OUTPUT_EXT=".a"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
exit_error_message "Cross compiling from ${HOST} for ${TARGET_HOST} is not supported yet."
|
exit_error_message "Cross compiling from ${HOST} for ${TARGET_HOST} is not supported yet."
|
||||||
;;
|
;;
|
||||||
|
|
@ -168,7 +177,6 @@ case "${TARGET_HOST}" in
|
||||||
|
|
||||||
TARGET_HOST_LIBS=(
|
TARGET_HOST_LIBS=(
|
||||||
"sdl3|3.2.10"
|
"sdl3|3.2.10"
|
||||||
"lua|5.4.7"
|
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
@ -176,7 +184,7 @@ case "${TARGET_HOST}" in
|
||||||
echo "Configuring for target: ${TARGET_HOST}"
|
echo "Configuring for target: ${TARGET_HOST}"
|
||||||
|
|
||||||
case "${HOST}" in
|
case "${HOST}" in
|
||||||
windows)
|
windows|linux)
|
||||||
TARGET_HOST_CC=x86_64-w64-mingw32-gcc
|
TARGET_HOST_CC=x86_64-w64-mingw32-gcc
|
||||||
TARGET_HOST_AR=x86_64-w64-mingw32-gcc-ar
|
TARGET_HOST_AR=x86_64-w64-mingw32-gcc-ar
|
||||||
TARGET_HOST_PKG_CONFIG=x86_64-w64-mingw32-pkg-config
|
TARGET_HOST_PKG_CONFIG=x86_64-w64-mingw32-pkg-config
|
||||||
|
|
@ -197,7 +205,6 @@ case "${TARGET_HOST}" in
|
||||||
|
|
||||||
TARGET_HOST_LIBS=(
|
TARGET_HOST_LIBS=(
|
||||||
"sdl3|3.3.4"
|
"sdl3|3.3.4"
|
||||||
"lua|5.4.7"
|
|
||||||
)
|
)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
#ifndef DISPLAY_H
|
|
||||||
#define DISPLAY_H
|
|
||||||
|
|
||||||
#include "texture.h"
|
|
||||||
#include "vector2d.h"
|
|
||||||
|
|
||||||
#define C_BLACK 0, 0, 0
|
|
||||||
#define C_RED 255, 0, 0
|
|
||||||
#define C_GREEN 0, 255, 0
|
|
||||||
#define C_BLUE 0, 0, 255
|
|
||||||
#define C_WHITE 255, 255, 255
|
|
||||||
|
|
||||||
#define DISPLAY_WIDTH 720
|
|
||||||
#define DISPLAY_HEIGHT 480
|
|
||||||
|
|
||||||
typedef struct display_t {
|
|
||||||
} display_t;
|
|
||||||
|
|
||||||
int display_init(void);
|
|
||||||
void display_exit(void);
|
|
||||||
|
|
||||||
int display_clear(void);
|
|
||||||
int display_update(void);
|
|
||||||
|
|
||||||
int display_draw_texture(texture_t *texture, const rect_t *src_rect, const rect_t *dst_rect, bool flip);
|
|
||||||
int display_draw_frect(const frect_t *frect, unsigned int r, unsigned int g, unsigned int b, unsigned int a);
|
|
||||||
|
|
||||||
#endif // DISPLAY_H
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
#ifndef KEYBOARD_H
|
|
||||||
#define KEYBOARD_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdbool.h>
|
|
||||||
#include "keycodes.h"
|
|
||||||
|
|
||||||
typedef struct input_event_t {
|
|
||||||
uint32_t type;
|
|
||||||
int key;
|
|
||||||
} input_event_t;
|
|
||||||
|
|
||||||
int poll_event(input_event_t *event);
|
|
||||||
|
|
||||||
typedef struct inputs_t {
|
|
||||||
bool keys[MAX_KEYCODES];
|
|
||||||
} inputs_t;
|
|
||||||
|
|
||||||
#endif // KEYBOARD_H
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
#ifndef KEYCODES_H
|
|
||||||
#define KEYCODES_H
|
|
||||||
|
|
||||||
#define MAX_KEYCODES 0xFF
|
|
||||||
|
|
||||||
#define KEY_UP 0x01
|
|
||||||
#define KEY_DOWN 0x02
|
|
||||||
#define KEY_LEFT 0x03
|
|
||||||
#define KEY_RIGHT 0x04
|
|
||||||
#define KEY_MOD 0x05
|
|
||||||
#define KEY_INTERACT 0x06
|
|
||||||
|
|
||||||
#define INPUT_EVENT_KEY_UP 0x01
|
|
||||||
#define INPUT_EVENT_KEY_DOWN 0x02
|
|
||||||
#define INPUT_EVENT_QUIT 0xFF
|
|
||||||
|
|
||||||
#endif // KEYCODES_H
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#ifndef MEMORY_ALLOC_H
|
|
||||||
#define MEMORY_ALLOC_H
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#endif // MEMORY_ALLOC_H
|
|
||||||
|
|
@ -1,14 +0,0 @@
|
||||||
#ifndef TEXTURE_H
|
|
||||||
#define TEXTURE_H
|
|
||||||
|
|
||||||
#define TEXTURE_TRANSPARENT_COLOR 0x0001
|
|
||||||
|
|
||||||
typedef struct texture_t texture_t;
|
|
||||||
|
|
||||||
#define get_width(T) 1
|
|
||||||
#define get_height(T) 1
|
|
||||||
|
|
||||||
texture_t *load_texture(void);
|
|
||||||
void destroy_texture(texture_t *texture);
|
|
||||||
|
|
||||||
#endif // TEXTURE_H
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
||||||
#ifndef TIME_H
|
|
||||||
#define TIME_H
|
|
||||||
|
|
||||||
void update_time(void);
|
|
||||||
|
|
||||||
#endif // TIME_H
|
|
||||||
|
|
@ -1,163 +0,0 @@
|
||||||
#ifndef VECTOR2D_H
|
|
||||||
#define VECTOR2D_H
|
|
||||||
|
|
||||||
#include <SDL3/SDL_rect.h>
|
|
||||||
#include <math.h>
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Point struct. (int)
|
|
||||||
*
|
|
||||||
* @param x X pos
|
|
||||||
* @param y Y pos
|
|
||||||
*/
|
|
||||||
typedef struct vector2d_t {
|
|
||||||
int x, y;
|
|
||||||
} vector2d_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Point struct. (float)
|
|
||||||
*
|
|
||||||
* @param x X pos
|
|
||||||
* @param y Y pos
|
|
||||||
*/
|
|
||||||
typedef struct fvector2d_t {
|
|
||||||
float x, y;
|
|
||||||
} fvector2d_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Rectangle struct. (int)
|
|
||||||
*
|
|
||||||
* @param x X pos
|
|
||||||
* @param y Y pos
|
|
||||||
* @param w Width
|
|
||||||
* @param h Height
|
|
||||||
*/
|
|
||||||
typedef struct rect_t {
|
|
||||||
int x, y;
|
|
||||||
int w, h;
|
|
||||||
} rect_t;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Rectangle struct. (float)
|
|
||||||
*
|
|
||||||
* @param x X pos
|
|
||||||
* @param y Y pos
|
|
||||||
* @param w Width
|
|
||||||
* @param h Height
|
|
||||||
*/
|
|
||||||
typedef struct frect_t {
|
|
||||||
float x, y;
|
|
||||||
float w, h;
|
|
||||||
} frect_t;
|
|
||||||
|
|
||||||
#define EPSILON 0.0f
|
|
||||||
|
|
||||||
#define f_is_zero(X) (fabsf(X) <= EPSILON)
|
|
||||||
|
|
||||||
#define f_is_not_zero(X) (fabsf(X) > EPSILON)
|
|
||||||
|
|
||||||
void rect_to_frect(const rect_t *rect, frect_t *frect);
|
|
||||||
|
|
||||||
void frect_to_rect(const frect_t *frect, rect_t *rect);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if a point is in a rectangle. (int)
|
|
||||||
*
|
|
||||||
* @param p Vector2d
|
|
||||||
* @param r Rectangle
|
|
||||||
*
|
|
||||||
* @return True if the point is in the rectangle, else false.
|
|
||||||
*/
|
|
||||||
bool point_in_rect(const vector2d_t *p, const rect_t *r);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if a point is in a rectangle. (float)
|
|
||||||
*
|
|
||||||
* @param p Vector2d
|
|
||||||
* @param r Rectangle
|
|
||||||
*
|
|
||||||
* @return True if the point is in the rectangle, else false.
|
|
||||||
*/
|
|
||||||
bool fpoint_in_rect(const fvector2d_t *p, const frect_t *r);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if a rectangle is empty
|
|
||||||
*
|
|
||||||
* @param r Rectangle
|
|
||||||
*
|
|
||||||
* @return True if the rectangle is empty, else false.
|
|
||||||
*/
|
|
||||||
bool rect_empty(const rect_t *r);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if a rectangle is empty
|
|
||||||
*
|
|
||||||
* @param r Rectangle
|
|
||||||
*
|
|
||||||
* @return True if the rectangle is empty, else false.
|
|
||||||
*/
|
|
||||||
bool frect_empty(const frect_t *r);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if there is a intersction between two rectangles. (int)
|
|
||||||
*
|
|
||||||
* @param A Rectangle A
|
|
||||||
* @param B Rectangle B
|
|
||||||
*
|
|
||||||
* @return True if there is an intersection, else false.
|
|
||||||
*/
|
|
||||||
bool has_intersection(const rect_t *a, const rect_t *b);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if there is a intersction between two rectangles. (float)
|
|
||||||
*
|
|
||||||
* @param A Rectangle A
|
|
||||||
* @param B Rectangle B
|
|
||||||
*
|
|
||||||
* @return True if there is an intersection, else false.
|
|
||||||
*/
|
|
||||||
bool fhas_intersection(const frect_t *a, const frect_t *b);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if there is an intersection between two rectangles and get the intersection rectangle. (int)
|
|
||||||
*
|
|
||||||
* @param A Rectangle A
|
|
||||||
* @param B Rectangle B
|
|
||||||
* @param result The intersection rectangle
|
|
||||||
*
|
|
||||||
* @return True if there is an intersection, else false.
|
|
||||||
*/
|
|
||||||
bool intersect_rect(const rect_t *a, const rect_t *b, rect_t *result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Verify if there is an intersection between two rectangles and get the intersection rectangle. (float)
|
|
||||||
*
|
|
||||||
* @param A Rectangle A
|
|
||||||
* @param B Rectangle B
|
|
||||||
* @param result The intersection rectangle
|
|
||||||
*
|
|
||||||
* @return True if there is an intersection, else false.
|
|
||||||
*/
|
|
||||||
bool intersect_frect(const frect_t *a, const frect_t *b, frect_t *result);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Lerp a to b with smoothing factor s.
|
|
||||||
*
|
|
||||||
* @param a Current value
|
|
||||||
* @param b Target value
|
|
||||||
* @param s Smoothing factor
|
|
||||||
*/
|
|
||||||
float lerp(float a, float b, float s);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Lerp a to b with smoothing factor s and time basis t.
|
|
||||||
* Smoothing factor is for 60 fps call time.
|
|
||||||
*
|
|
||||||
* @param a Current value
|
|
||||||
* @param b Target value
|
|
||||||
* @param s Smoothing factor
|
|
||||||
* @param t Delta time
|
|
||||||
*/
|
|
||||||
float lerp_time(float a, float b, float s, float t);
|
|
||||||
|
|
||||||
#endif // VECTOR2D_H
|
|
||||||
Loading…
Reference in New Issue