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 <vector> | |
#include <random> | |
#include <chrono> | |
enum class TileStatus | |
{ | |
Visited, | |
Wall, | |
NotVisited |
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
#pragma once | |
#include <array> | |
template <int width, int height, typename T> | |
class Matrix | |
{ | |
using row_t = std::array<T, width>; | |
using col_t = std::array<T, height>; | |
public: |
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 <vector> | |
#include <cmath> | |
#include <algorithm> | |
struct Point | |
{ | |
int x; | |
int y; | |
}; |
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 "drawable.h" | |
#include <SDL/SDL.h> | |
class SDLDrawable : public Drawable | |
{ | |
public: | |
SDLDrawable(int w, int h); | |
~SDLDrawable(); | |
void setPixel(int x, int y, unsigned int color); | |
unsigned int getPixel(int x, int y); |
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 "SDLDrawable.hpp" | |
SDLDrawable::SDLDrawable(int w, int h) : width(w), height(h) | |
{ | |
SDL_Init(SDL_INIT_VIDEO); | |
screen = SDL_SetVideoMode(width, height, 32, SDL_SWSURFACE); | |
if (SDL_MUSTLOCK(screen)) | |
SDL_LockSurface(screen); | |
} |
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 <SDL/SDL.h> | |
#include <emscripten.h> | |
#include "SDLDrawable.hpp" | |
#include "client.h" | |
int main() | |
{ | |
SDLDrawable drawable(750, 750); | |
Client client(&drawable, "test.simp"); |
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
CXX=emcc | |
all: test.html | |
test.html: | |
$(CXX) -std=c++1z -stdlib=libc++ -O3 *.cpp -o $@ --preload-file test.simp --preload-file teapot.obj -s ALLOW_MEMORY_GROWTH=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
#include <cstdio> | |
using namespace Platform; | |
void doTheThing(const wchar_t* string) | |
{ | |
printf("%ws\n", string); | |
} | |
template <typename T> |
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 <cstdio> | |
#include <type_traits> | |
using namespace Platform; | |
void doTheThing(const wchar_t* string) | |
{ | |
printf("%ws\n", string); | |
} |
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 <vector> | |
#include <iostream> | |
#include <memory> | |
#include <algorithm> | |
#include <type_traits> | |
using namespace std; | |
class EventHandler | |
{ |
OlderNewer