mirror of
https://github.com/zoriya/My3D.git
synced 2025-12-06 06:26:14 +00:00
Coding style
This commit is contained in:
Submodule lib/gamacon updated: 576221a8e2...0062aa990e
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 2/27/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** my_str_replace
|
||||
*/
|
||||
|
||||
#include "my.h"
|
||||
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2019
|
||||
** Tests
|
||||
** File description:
|
||||
** test_disp_stdarg
|
||||
*/
|
||||
|
||||
#include <criterion/criterion.h>
|
||||
#include <criterion/redirect.h>
|
||||
#include "my.h"
|
||||
|
||||
Test(disp, first, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("Insane %s, %c, %d, %s\n", "Yes", '8', 15, "Nope");
|
||||
cr_assert_stdout_eq_str("Insane Yes, 8, 15, Nope\n");
|
||||
}
|
||||
|
||||
Test(disp, faketag, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("Insane %Y, %c, %d, %s\n", '8', 15, "Nope");
|
||||
cr_assert_stdout_eq_str("Insane %Y, 8, 15, Nope\n");
|
||||
}
|
||||
|
||||
Test(disp, str, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("Insane %s\n", "156615");
|
||||
cr_assert_stdout_eq_str("Insane 156615\n");
|
||||
}
|
||||
|
||||
Test(disp, uints, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("Insane %u\n", 156615);
|
||||
cr_assert_stdout_eq_str("Insane 156615\n");
|
||||
}
|
||||
|
||||
Test(disp, characters, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("Insane %c\n", '^');
|
||||
cr_assert_stdout_eq_str("Insane ^\n");
|
||||
}
|
||||
|
||||
Test(disp, ints, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("Insane %d, %i\n", 15, -15);
|
||||
cr_assert_stdout_eq_str("Insane 15, -15\n");
|
||||
}
|
||||
|
||||
Test(disp, ptr, .init = cr_redirect_stdout)
|
||||
{
|
||||
int ptr = 15;
|
||||
char *str = malloc(sizeof(char) * 25);
|
||||
|
||||
my_printf("Insane %p\n", &ptr);
|
||||
sprintf(str, "Insane %p\n", &ptr);
|
||||
cr_assert_stdout_eq_str(str);
|
||||
}
|
||||
|
||||
Test(disp, nonprintable, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("Insane %S\n", "\aYes\a");
|
||||
cr_assert_stdout_eq_str("Insane \\007Yes\\007\n");
|
||||
}
|
||||
|
||||
Test(disp, binary, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%b\n", 153152);
|
||||
cr_assert_stdout_eq_str("100101011001000000\n");
|
||||
}
|
||||
|
||||
Test(disp, octal, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%o\n", 153152);
|
||||
cr_assert_stdout_eq_str("453100\n");
|
||||
}
|
||||
|
||||
Test(disp, hexa, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%x\n", 1561356523);
|
||||
cr_assert_stdout_eq_str("5d1068eb\n");
|
||||
}
|
||||
|
||||
Test(disp, bighexa, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%X\n", 1561356523);
|
||||
cr_assert_stdout_eq_str("5D1068EB\n");
|
||||
}
|
||||
|
||||
Test(disp, uintneg, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%u\n", -500);
|
||||
cr_assert_stdout_eq_str("4294966796\n");
|
||||
}
|
||||
|
||||
Test(disp, noformat, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%%\n");
|
||||
cr_assert_stdout_eq_str("%\n");
|
||||
}
|
||||
|
||||
Test(disp, floats, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%f\n", 13.684);
|
||||
cr_assert_stdout_eq_str("13.684\n");
|
||||
}
|
||||
|
||||
Test(disp, morefloat, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%f\n", 18.138613);
|
||||
cr_assert_stdout_eq_str("18.138613\n");
|
||||
}
|
||||
|
||||
Test(my_printf, mouliS, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%S", "mouline\atte\n");
|
||||
cr_assert_stdout_eq_str("mouline\\007tte\\012");
|
||||
}
|
||||
|
||||
Test(my_printf, simplePtr, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%p", 3456789);
|
||||
cr_assert_stdout_eq_str("0x34bf15");
|
||||
}
|
||||
|
||||
Test(my_printf, intLength, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%05i", 15);
|
||||
cr_assert_stdout_eq_str("00015");
|
||||
}
|
||||
|
||||
Test(my_printf, intPlusSize, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%0+5i", 15);
|
||||
cr_assert_stdout_eq_str("+0015");
|
||||
}
|
||||
|
||||
Test(my_printf, intLengthSpace, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("% 05i", 15);
|
||||
cr_assert_stdout_eq_str(" 0015");
|
||||
}
|
||||
|
||||
Test(my_printf, intLengthSpacePlus, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("% 0+5i", -15);
|
||||
cr_assert_stdout_eq_str("-0015");
|
||||
}
|
||||
|
||||
Test(my_printf, xLength, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%05X", 15);
|
||||
cr_assert_stdout_eq_str("0000F");
|
||||
}
|
||||
|
||||
Test(my_printf, xPlusSize, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%0+5X", 15);
|
||||
cr_assert_stdout_eq_str("0000F");
|
||||
}
|
||||
|
||||
Test(my_printf, xLengthSpace, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%#X", -15);
|
||||
cr_assert_stdout_eq_str("0XFFFFFFF1");
|
||||
}
|
||||
|
||||
Test(my_printf, xLengthSpacePlus, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%# +X", -15);
|
||||
cr_assert_stdout_eq_str("0XFFFFFFF1");
|
||||
}
|
||||
|
||||
Test(my_printf, stringWithMax, .init = cr_redirect_stdout)
|
||||
{
|
||||
my_printf("%# +03s", "ABCDEFG");
|
||||
cr_assert_stdout_eq_str("ABC");
|
||||
}
|
||||
Submodule lib/xmlparser updated: 91f3604772...edee81e3ae
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/10/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** map_manager_component
|
||||
*/
|
||||
|
||||
#include <components/isometry/map_manager_component.h>
|
||||
#include "engine.h"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/11/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** framerate
|
||||
*/
|
||||
|
||||
#include "entity.h"
|
||||
#include "engine.h"
|
||||
@@ -33,7 +36,6 @@ void framerate_set_text(gc_entity *entity, gc_engine *engine)
|
||||
((gc_text *)renderer->data)->text = framerate;
|
||||
}
|
||||
|
||||
|
||||
bool framerate_down(gc_engine *engine, gc_entity *entity, gc_vector2 _)
|
||||
{
|
||||
struct sfml_renderer_system *rend = GETSYS(engine, sfml_renderer_system);
|
||||
|
||||
@@ -72,7 +72,7 @@ int create_game_scene(gc_engine *engine)
|
||||
return (0);
|
||||
}
|
||||
|
||||
int start_game()
|
||||
int start_game(void)
|
||||
{
|
||||
gc_engine *engine = engine_create();
|
||||
sfClock *clock = sfClock_create();
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 2/24/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** main_menu
|
||||
*/
|
||||
|
||||
#include <systems/sfml_renderer_system.h>
|
||||
#include "engine.h"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/2/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** options
|
||||
*/
|
||||
|
||||
#include "engine.h"
|
||||
#include "setup.h"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/11/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** selectors
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <components/isometry/map_manager_component.h>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/9/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** game_manager_system
|
||||
*/
|
||||
|
||||
#include <components/tag_component.h>
|
||||
#include <systems/sfml_renderer_system.h>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/6/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** absent
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "components/game_manager.h"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/6/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** forgot
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include "components/game_manager.h"
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
//
|
||||
// Created by anonymus-raccoon on 3/11/20.
|
||||
//
|
||||
/*
|
||||
** EPITECH PROJECT, 2020
|
||||
** My3D
|
||||
** File description:
|
||||
** toolbar
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <components/isometry/map_manager_component.h>
|
||||
|
||||
Reference in New Issue
Block a user