stuff
This commit is contained in:
parent
2dbfa1b99e
commit
b1230534c5
22 changed files with 547 additions and 429 deletions
22
alyson/includes/alargs.h
Normal file
22
alyson/includes/alargs.h
Normal file
|
@ -0,0 +1,22 @@
|
|||
#ifndef ALARGS_H_INCLUDED
|
||||
#define ALARGS_H_INCLUDED
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
int argc;
|
||||
char** argv;
|
||||
} alyson_args_t, *ALArgs;
|
||||
|
||||
ALArgs al_args_create(int argc, char** argv);
|
||||
void al_args_destroy(ALArgs args);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ALARGS_H_INCLUDED
|
|
@ -6,8 +6,6 @@
|
|||
#define ASSETS_PATH "./assets/"
|
||||
#endif
|
||||
|
||||
#define MANGLE_RES_PATH(path) ASSETS_PATH "/" path
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -18,45 +16,19 @@ extern "C" {
|
|||
|
||||
#define ALYSIS_ENGINE_WINDOW_TITLE "Alyson Engine"
|
||||
|
||||
typedef struct {
|
||||
char type[4 + 1];
|
||||
char group[26 + 1];
|
||||
char* name;
|
||||
char* path;
|
||||
} alyson_path_t, *ALPath;
|
||||
#include "alargs.h"
|
||||
|
||||
/*
|
||||
* @function: demangle_path
|
||||
* @description: Demangles a path
|
||||
* @param path: path to resource
|
||||
* @return: ALPath
|
||||
*/
|
||||
ALPath al_demangle_path(const char* path);
|
||||
char* al_mangle_path(const ALPath path);
|
||||
ALPath al_create_path(
|
||||
const char* type,
|
||||
const char* path,
|
||||
const char* name,
|
||||
const char* group
|
||||
);
|
||||
void al_destroy_path(ALPath path);
|
||||
#include "resources/alpath.h"
|
||||
|
||||
typedef struct {
|
||||
int argc;
|
||||
char** argv;
|
||||
} alyson_args_t, *ALArgs;
|
||||
#include "resources/alresource.h"
|
||||
|
||||
ALArgs al_args_create(int argc, char** argv);
|
||||
void al_args_destroy(ALArgs args);
|
||||
#if defined(RAYLIB_BACKEND)
|
||||
#include <raylib.h>
|
||||
#include <raymath.h>
|
||||
|
||||
typedef struct {
|
||||
usx id;
|
||||
alyson_path_t path;
|
||||
} alyson_resource_t, *ALResource;
|
||||
#include <rlyson.h>
|
||||
#endif
|
||||
|
||||
ALResource al_resource_create(ALPath path);
|
||||
ALResource al_resource_create_from_file(char* name, char* path);
|
||||
void al_resource_destroy(ALResource resource);
|
||||
|
||||
/* TODO : implement
|
||||
typedef struct {
|
||||
|
|
|
@ -23,7 +23,7 @@ typedef struct {
|
|||
float time;
|
||||
} sprite_animation_t, *SpriteAnimation;
|
||||
|
||||
SpriteAnimation CreateSpriteAnimation(Texture2D texture, Vector2 sprite_texture_dimentions, Vector2 sprite_size, float rotation, float scale, int frameCount);
|
||||
SpriteAnimation CreateSpriteAnimation(Texture2D texture, Vector2 sprite_texture_dimentions, Vector2 sprite_size, float rotation, float scale, int frameCount, float speed);
|
||||
|
||||
void UpdateSpriteAnimation(SpriteAnimation spriteAnimation, float dt);
|
||||
|
||||
|
@ -35,4 +35,4 @@ void DestroySpriteAnimation(SpriteAnimation spriteAnimation);
|
|||
}
|
||||
#endif
|
||||
|
||||
#endif // ANIMATION_SPRITE_H
|
||||
#endif // ANIMATION_SPRITE_H
|
||||
|
|
36
alyson/includes/resources/alpath.h
Normal file
36
alyson/includes/resources/alpath.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
#ifndef ALPATH_H_INCLUDED
|
||||
#define ALPATH_H_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "../types.h"
|
||||
|
||||
typedef struct {
|
||||
char type[4 + 1];
|
||||
char group[26 + 1];
|
||||
char* name;
|
||||
char* path;
|
||||
} alyson_path_t, *ALPath;
|
||||
|
||||
/*
|
||||
* @function: demangle_path
|
||||
* @description: Demangles a path
|
||||
* @param path: path to resource
|
||||
* @return: ALPath
|
||||
*/
|
||||
ALPath al_demangle_path(const char* path);
|
||||
char* al_mangle_path(const ALPath path);
|
||||
ALPath al_create_path(
|
||||
const char* type,
|
||||
const char* path,
|
||||
const char* name,
|
||||
const char* group
|
||||
);
|
||||
void al_destroy_path(ALPath path);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ALPATH_H_INCLUDED
|
26
alyson/includes/resources/alresource.h
Normal file
26
alyson/includes/resources/alresource.h
Normal file
|
@ -0,0 +1,26 @@
|
|||
#ifndef ALRESOURCE_H_INCLUDED
|
||||
#define ALRESOURCE_H_INCLUDED
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "../types.h"
|
||||
#include "alpath.h"
|
||||
|
||||
typedef struct {
|
||||
usx id;
|
||||
alyson_path_t path;
|
||||
} alyson_resource_t, *ALResource;
|
||||
|
||||
ALResource al_resource_create(ALPath path);
|
||||
ALResource al_resource_create_from_file(char* name, char* path);
|
||||
void al_resource_destroy(ALResource resource);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // ALRESOURCE_H_INCLUDED
|
0
alyson/includes/resources/alresource_manager.h
Normal file
0
alyson/includes/resources/alresource_manager.h
Normal file
|
@ -12,7 +12,7 @@ extern "C" {
|
|||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include <stdbool.h>
|
||||
/*
|
||||
* Basic types
|
||||
*
|
||||
|
@ -48,6 +48,8 @@ extern "C" {
|
|||
typedef size_t usx;
|
||||
typedef ptrdiff_t isx;
|
||||
|
||||
typedef bool boolean;
|
||||
|
||||
/*
|
||||
* Vectors and Matrices
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue