Skip to content

Instantly share code, notes, and snippets.

View mohiji's full-sized avatar

Jonathan Fischer mohiji

View GitHub Profile
@mohiji
mohiji / gist:1367565
Created November 15, 2011 16:46
Very early beginnings of a Legend of the Red Dragon style game.
(defparameter *locations* (make-hash-table :test 'eq))
(defclass location ()
((name :accessor location-name :initarg :name)
(description :accessor location-description :initarg :description)
(exits :accessor location-exits :initarg :exits)))
(defmacro define-location (symbol-name &key name description exits)
`(setf (gethash ',symbol-name *locations*)
(make-instance 'location
@mohiji
mohiji / gist:1203900
Created September 8, 2011 16:55
Pre-processor abuse
#ifdef WIN32
WSADATA g_wsadata;
#define StartSocketLib WSAStartup( MAKEWORD(2, 2), &g_wsadata);
#define CloseSocketLib WSACleanup();
#else
#define StartSocketLib {}
#define CloseSocketLib {}
@mohiji
mohiji / 1VectorTest.cpp
Created August 5, 2011 17:57
C++ vectors do a lot under the hood.
#include <vector>
#include <cstdio>
using namespace std;
class Test
{
public:
Test()
{
printf(" Test being created!\n");
@mohiji
mohiji / Ui.c
Created March 19, 2011 03:47
Egoboo's main menu implementation from Summer 2005
// Egoboo - Ui.c
#include "Ui.h"
#include <string.h>
#include <SDL_opengl.h>
struct UiContext
{
// Tracking control focus stuff
UI_ID active;
@mohiji
mohiji / gist:580235
Created September 15, 2010 04:25
Comparing my menu.c from 2007 with the one currently in Egoboo
#include "egoboo.h"
#include "Ui.h"
#include "Menu.h"
#include "Log.h"
// TEMPORARY!
#define NET_DONE_SENDING_FILES 10009
#define NET_NUM_FILES_TO_SEND 10010
//--------------------------------------------------------------------------------------------