First push

This commit is contained in:
Anonymus Raccoon
2020-03-25 16:31:50 +01:00
commit d873a59e6b
144 changed files with 4578 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/*
** EPITECH PROJECT, 2020
** Twac
** File description:
** array
*/
#pragma once
void arr_add(int *arr, int n);
int arr_len(int *arr);
+26
View File
@@ -0,0 +1,26 @@
//
// Created by anonymus-raccoon on 3/3/20.
//
#ifndef _TEAMS_COMPONENT_C_
#define _TEAMS_COMPONENT_H_
#include "component.h"
typedef enum display_type
{
HAPPINESS_DISPLAY,
STUPIDITY_DISPLAY,
SELECT_TILE_DISPLAY
} display_type_enum;
struct game_display
{
gc_component base;
display_type_enum type;
};
const struct game_display game_display;
const struct gc_system game_display_system;
#endif //_TEAMS_COMPONENT_C_
+19
View File
@@ -0,0 +1,19 @@
//
// Created by anonymus-raccoon on 3/3/20.
//
#ifndef _TEAMS_COMPONENT_C_
#define _TEAMS_COMPONENT_H_
#include "component.h"
struct game_manager
{
gc_component base;
int happiness;
int stupidity;
};
const struct game_manager game_manager;
#endif //_TEAMS_COMPONENT_C_
@@ -0,0 +1,28 @@
//
// Created by anonymus-raccoon on 3/10/20.
//
#ifndef _MAP_MANAGER_COMPONENT_H_
#define _MAP_MANAGER_COMPONENT_H_
#include "component.h"
enum brush
{
MOVE,
RESET,
ROTATE,
TEXTURE
};
struct map_manager_component
{
gc_component base;
bool tile_mode;
enum brush brush;
void *selected_texture;
};
const struct map_manager_component map_manager_component;
#endif //_MAP_MANAGER_COMPONENT_H_
+25
View File
@@ -0,0 +1,25 @@
//
// Created by anonymus-raccoon on 3/3/20.
//
#ifndef _TEAMS_COMPONENT_C_
#define _TEAMS_COMPONENT_H_
#include "component.h"
struct teams_component
{
gc_component base;
float next_teams;
float delay;
char **prefabs;
int *prefabs_size;
int prefab_count;
};
const struct teams_component teams_component;
bool teams_move_up(gc_scene *scene, float amount, float y_level);
void pm_clicked(gc_engine *engine, gc_entity *entity);
#endif //_TEAMS_COMPONENT_C_
+11
View File
@@ -0,0 +1,11 @@
//
// Created by anonymus-raccoon on 3/6/20.
//
#ifndef _DPR_ERRORS_H_
#define _DPR_ERRORS_H_
#define MULTIPLE_GAME_MGR_ERROR "Warning: two game manager exists, \
behaviors are undefined.\n"
#endif //_DPR_ERRORS_H_
+28
View File
@@ -0,0 +1,28 @@
/*
** EPITECH PROJECT, 2020
** Gamacon
** File description:
** map_interactions
*/
#ifndef MY3D_MAP_INTERACTIONS_H
#define MY3D_MAP_INTERACTIONS_H
#include "engine.h"
#include "components/vertex_component.h"
#include "keybindings.h"
enum modes_on_tile {
VERTEX_0 = 2,
VERTEX_1 = 4,
VERTEX_2 = 8,
VERTEX_3 = 16,
ALL_VERTICES = 30,
INVERT_ADD_VALUE = 1
};
bool map_onclick(gc_engine *engine, gc_entity *entity, gc_vector2 pos, \
enum gc_mousekeys key);
#endif //MY3D_MAP_INTERACTIONS_H
+127
View File
@@ -0,0 +1,127 @@
/*
** EPITECH PROJECT, 2019
** My lib
** File description:
** Header file
*/
#pragma once
char *my_str_replace(char *str, const char *to_replace, char c);
int my_str_islower_or_num(const char *str);
int my_printf(const char *str, ...);
int count_valid_queens_placements(int n);
char *my_strchr(const char *str, char c);
int my_compute_power_it(int n, int p);
int my_compute_power_rec(int n, int p);
int my_compute_factorial_it(int n);
int my_compute_factorial_rec(int n);
int my_compute_square_root(int n);
char *my_evil_str(char *str);
int my_find_prime_sup(int n);
int my_getnbr_base(const char *str, const char *base);
int my_getnbr(const char *str);
int my_isneg(int n);
int my_is_prime(int n);
void my_print_alpha(void);
void my_print_comb2(void);
void my_print_combn(int n);
void my_print_comb(void);
void my_print_digits(void);
void my_print_revalpha(void);
void my_putchar(char c);
void my_putlong_base(long n, const char *base);
void my_putnbr_base(int n, const char *base);
void my_put_nbr(int n);
void my_putstr(const char *str);
void my_revstr(char *str);
void my_showmem(char *str, int);
void my_showstr(const char *str);
void my_sort_int_array(int *array);
int is_letter(char c);
int is_alpha(char c);
int is_num(char c);
int is_digit(char c);
char *my_strcapitalize(char *str);
char *my_strcat(char *dest, const char *src);
int my_strcmp(const char *s1, const char *s2);
char *my_strcpy(char *dest, const char *str);
int my_str_isalpha(const char *str);
int is_lowercase(char c);
int my_str_islower(const char *str);
int my_str_isnum(const char *str);
int is_printable(char c);
int my_str_isprintable(const char *str);
int is_upper(char c);
int my_str_isupper(const char *str);
int my_strlen(const char *str);
int my_strlowcase(const char *str);
char *my_strncat(char *dest, const char *src, int n);
int my_strncmp(const char *s1, const char *s2, int n);
char *my_strncpy(char *dest, const char *src, int n);
char *my_strstr(const char *str, const char *to_find);
int my_strupcase(const char *str);
void my_swap(int *a, int *b);
char *my_strdup(const char *str);
char **my_str_to_word_array(const char *str);
int my_show_word_array(const char **words);
int is_alphanum(char c);
int first_alphanum(const char *str);
int index_of(const char *str, char c);
+30
View File
@@ -0,0 +1,30 @@
/*
** EPITECH PROJECT, 2019
** quadtree
** File description:
** quadtree_internal
*/
#pragma once
#include "quadtree.h"
#include <stddef.h>
void *my_calloc(int capacity, int size);
quadtree *qt_split(quadtree *tree);
bool collision_overlapx(qt_intrect r1, qt_intrect r2);
bool collision_overlapy(qt_intrect r1, qt_intrect r2);
bool collision_can_see(int l1, int l2);
#define MIN(x, y) ((x) < (y) ? (x) : (y))
#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define CAN_BE_SEEN 0b10
#define CAN_SEE 0b01
#define TREEOBJ_AT(x) (&((qt_object *)tree->objects)[i])
#define COLLISION_MAX ((qt_collision){MAXCOL, MAXCOL, MAXCOL, MAXCOL, NULL})
+38
View File
@@ -0,0 +1,38 @@
/*
** EPITECH PROJECT, 2019
** MUL_my_runner_2019
** File description:
** runner
*/
#pragma once
#define ERROR 84
#include "scene.h"
int start_game();
bool start_button(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool options(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool goto_main_menu(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool quit(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool catch(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool toggle_pause(gc_engine *engine, gc_entity *entity, gc_vector2 _);
int checkbox_update(gc_scene *s, gc_entity *entity, bool checked);
void resolution_set_text(gc_entity *entity, gc_engine *engine);
void framerate_set_text(gc_entity *entity, gc_engine *engine);
bool fullscreen(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool resolution_down(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool resolution_up(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool framerate_up(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool framerate_down(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool tile_select(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool vertex_select(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool up_down(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool reset(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool rotate(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool texture(gc_engine *engine, gc_entity *entity, gc_vector2 _);
bool switch_texture(gc_engine *engine, gc_entity *entity, gc_vector2 _);
+12
View File
@@ -0,0 +1,12 @@
//
// Created by anonymus-raccoon on 3/9/20.
//
#ifndef _GAME_MANAGER_SYSTEM_H_
#define _GAME_MANAGER_SYSTEM_H_
#include "system.h"
const gc_system game_manager_system;
#endif //_GAME_MANAGER_SYSTEM_H_
+12
View File
@@ -0,0 +1,12 @@
//
// Created by anonymus-raccoon on 3/3/20.
//
#ifndef _TEAMS_SYSTEM_H_
#define _TEAMS_SYSTEM_H_
#include "system.h"
const gc_system teams_system;
#endif //_TEAMS_SYSTEM_H_
+17
View File
@@ -0,0 +1,17 @@
//
// Created by anonymus-raccoon on 3/9/20.
//
#ifndef _TEAMS_H_
#define _TEAMS_H_
#include <stdbool.h>
#include "engine.h"
bool absent_check(gc_engine *engine, int entity_id, gc_vector2 _);
bool absent_cross(gc_engine *engine, int entity_id, gc_vector2 _);
bool forgot_lmfao(gc_engine *engine, int entity_id, gc_vector2 _);
bool forgot_ok(gc_engine *engine, int entity_id, gc_vector2 _);
#endif //_TEAMS_H_