This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "network_queue.hpp" | |
#include "service_locator.hpp" | |
#include "udp_network_utility.hpp" | |
#include "SDL/SDL_thread.h" | |
#include <deque> | |
static SDL_sem* lock = SDL_CreateSemaphore(1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright: (c) Kayne Ruse 2013 | |
* | |
* This software is provided 'as-is', without any express or implied | |
* warranty. In no event will the authors be held liable for any damages | |
* arising from the use of this software. | |
* | |
* Permission is granted to anyone to use this software for any purpose, | |
* including commercial applications, and to alter it and redistribute it | |
* freely, subject to the following restrictions: | |
* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void openCustomLibraries(lua_State* L) { | |
//------------------------- | |
// Define the map library for lua | |
//------------------------- | |
//push the initial table | |
lua_newtable(L); | |
lua_pushcfunction(L, [](lua_State* l) -> int { | |
//require 4 parameters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
ECHO USB Backup Utility designed by Kayne Ruse. | |
SET folder=USBBackup | |
ECHO Instructions | |
ECHO. | |
ECHO 1) There must be a folder called "%folder%" in this directory. | |
ECHO 2) The USB must have a copy of this file in it's root directory. | |
ECHO. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int, char**) { | |
try { | |
//set up | |
RegionPager pager; | |
pager.SetWidth(40*32); | |
pager.SetHeight(40*32); | |
pager.SetOnNew([](Region* const ptr){ | |
printf("(%d, %d)\n", ptr->GetX(), ptr->GetY()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum Turn: | |
left, right, straight | |
end | |
enum Direction: | |
north, south, east, west | |
end | |
class Segment: | |
Segment* next = null, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config | |
INCLUDES= | |
CXXFLAGS+=-std=c++11 -DDEBUG $(addprefix -I,$(INCLUDES)) | |
LIB=-lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio | |
#source | |
SRC=$(wildcard *.cpp) | |
#objects | |
OBJDIR=obj |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstring> | |
using namespace std; | |
union Foo { | |
enum class Type { | |
INT, | |
FLOAT | |
}type; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//this checks the pseudo-distance from the edge of the screen | |
function CheckDistance(region): | |
//locations relative to the camera | |
x = region.x - camera.x | |
y = region.y - camera.y | |
//if the region is visible, return 0 | |
if (-pager.w < x < screen.w) return 0 | |
if (-pager.h < y < screen.h) return 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 20 30 40 50 60 70 80 90 100 | |
10 20 61 85 145 169 199 227 301 340 369 | |
20 10 56 92 122 148 164 195 250 266 298 | |
30 7 37 63 91 122 171 219 255 300 337 | |
40 1 30 61 92 111 178 222 268 280 296 | |
50 1 21 65 105 125 137 190 209 296 275 | |
60 1 12 54 94 119 138 165 198 285 244 | |
70 1 1 34 47 78 163 154 187 247 293 | |
80 1 1 17 44 102 122 157 232 254 232 |