Skip to content

Instantly share code, notes, and snippets.

View Journeyman1337's full-sized avatar
🏫
I am focusing on my classes.

Daniel Aimé Valcour Journeyman1337

🏫
I am focusing on my classes.
View GitHub Profile
@Journeyman1337
Journeyman1337 / atlas.json
Created February 6, 2020 17:01
atlas for cp437_12x12.png
{
"sheets":
[
{
"File":"cp437_12x12.png",
"TilesWide":"16",
"TilesTall":"16",
"TileWidth":"12",
"TileHeight":"12",
"BackColor":"0,0,0,1",
@Journeyman1337
Journeyman1337 / generational.c
Last active May 18, 2020 22:22
This is a datastructure based on the concept of generational indexing mentioned in this talk: https://www.youtube.com/watch?v=P9u8x13W7UE. This type of datastructure is very useful for use as the backbone of an Entity Component System.
/*
Copyright 2020 Daniel Valcour
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE O
@Journeyman1337
Journeyman1337 / fcolor.cpp
Last active April 28, 2023 12:15
simple rgba float color struct in cpp with conversions and from uint32_t hex codes
/*
Copyright 2020 Daniel Valcour
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT
using System.Collections;
using System.Collections.Generic;
using UnityEditor.Build;
using UnityEngine;
using UnityEngine.Tilemaps;
/// <summary>
/// An experimental chunk made with a procedural mesh.
/// </summary>
[RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))]
@Journeyman1337
Journeyman1337 / mergeSort.h
Last active August 16, 2020 16:55
Templates for merge sorting objects that implemented operator<=
#pragma once
#include<memory>
namespace MergeSort_internal
{
template <typename T>
void merge(T* arr, int l, int m, int r)
{
int i, j, k;
int n1 = m - l + 1;
@Journeyman1337
Journeyman1337 / observer.cpp
Last active April 6, 2021 00:27
observer/listener pattern with template version that publishes the data in an argument to all observers (subscribers).
/*
Copyright 2021 Daniel Valcour
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OT
@Journeyman1337
Journeyman1337 / cmd output
Last active April 1, 2021 02:59
shader preprocessor wip
layout(location = 0) in vec3 aPosition;
layout(location = 1) in vec2 aTexCoord;
out vec2 texCoord;
uniform mat4 _MODEL;
uniform mat4 _VIEW;
uniform mat4 _PROJECTION;
@Journeyman1337
Journeyman1337 / from sprite.cpp
Created November 26, 2020 17:20
atlas building
/*
Copyright (c) 2020 Daniel Valcour
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@Journeyman1337
Journeyman1337 / glDebug.h
Last active January 4, 2021 15:54
An opengl debugging header only library I made a while back.
/*
MIT License
Copyright (c) 2020 Daniel Valcour
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
/*
Copyright (c) 2020 Daniel Valcour
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.