Index: Daodan/src/BFW_LocalInput.h
===================================================================
--- Daodan/src/BFW_LocalInput.h	(revision 691)
+++ 	(revision )
@@ -1,7 +1,0 @@
-#pragma once
-#ifndef BFW_LOCALINPUT_H
-#define BFW_LOCALINPUT_H
-
-
-
-#endif
Index: Daodan/src/BFW_Motoko_Draw.h
===================================================================
--- Daodan/src/BFW_Motoko_Draw.h	(revision 691)
+++ Daodan/src/BFW_Motoko_Draw.h	(revision 692)
@@ -1,7 +1,4 @@
-#pragma once
 #ifndef BFW_MOTOKO_DRAW_H
 #define BFW_MOTOKO_DRAW_H
-
-#include "Daodan.h"
 
 typedef struct
Index: Daodan/src/BFW_ScriptLang.h
===================================================================
--- Daodan/src/BFW_ScriptLang.h	(revision 691)
+++ Daodan/src/BFW_ScriptLang.h	(revision 692)
@@ -1,10 +1,6 @@
-#pragma once
 #ifndef BFW_SCRIPTLANG_H
 #define BFW_SCRIPTLANG_H
 
-#include "Daodan.h"
-
-//#include <stdint.h>
-#include "bool.h"
+#include "stdint.h"
 
 typedef enum {
@@ -33,7 +29,3 @@
 } sl_callinfo;
 
-
-
-
-
 #endif
Index: Daodan/src/BFW_Utility.h
===================================================================
--- Daodan/src/BFW_Utility.h	(revision 691)
+++ Daodan/src/BFW_Utility.h	(revision 692)
@@ -1,11 +1,6 @@
-#pragma once
 #ifndef BFW_UTILITY_H
 #define BFW_UTILITY_H
 
-#include <stdio.h>
-//#include <stdint.h>
-#include "Daodan.h"
-
-//void __cdecl UUrStartupMessage(const char* fmt, ...);
+#include "stdint.h"
 
 typedef struct {
@@ -16,12 +11,3 @@
 } OniRectangle;
 
-
-void* TestContext;
-//void ONICALL COrTextArea_Print(uint32_t area, uint32_t priority, uint32_t textshade, uint32_t textshadowshade, const char* text, uint32_t unk_alwaws_0, uint32_t fadetime);
-
-void ONICALL COrMessage_Remove(char* Key);
-//int16_t ONICALL TMrInstance_GetDataPtr(int, char*, void*);	//int TMrInstance_GetDataPtr( Type 'TSFF', char* "Tahoma", ptr);
-
-//int __cdecl AUrMessageBox(int Buttons, char *Message, ...);
-
 #endif
Index: Daodan/src/Bink.h
===================================================================
--- Daodan/src/Bink.h	(revision 691)
+++ 	(revision )
@@ -1,66 +1,0 @@
-//for IDirectSound we need
-//#include <dsound.h>
-//http://ccrma.stanford.edu/software/stk/Misc/dsound.h
-
-typedef struct {
-	uint32_t Width;
-	uint32_t Height;
-	uint32_t FrameCount;
-	uint32_t CurrentFrame;
-	uint32_t LastFrame;
-	uint32_t FPS_Multiplier;
-	uint32_t FPS_Divisor;
-	uint32_t Unknown1;
-	uint32_t Flags;
-	uint32_t Unknown2[65];
-	uint32_t CurrentPlane;
-	void*	 Plane0_Ptr;
-	void*	 Plane1_Ptr;
-	uint32_t Unknown3[2];
-	uint32_t YPlane_Width;
-	uint32_t UnVPlane_Width;
-	uint32_t UnVPlane_Height;
-} BinkStruct;
-
-//_stdcall
-	//opens the bink file
-	BinkStruct CALLBACK *BinkOpen(HANDLE BinkFile, uint32_t Flags);
-	
-	//SoundFunction: This appears to be the function that will be invoked in order to playback the audio. 
-	//MPC passes in BinkOpenDirectSound as the parameter. BinkOpenDirectSound must meet the qualifications to be a SOUND_FUNC 
-	//(contrived for this description).
-	//I renamed SOUND_FUNC to void*
-	int CALLBACK BinkSetSoundSystem(void* SoundFunction, IDirectSound *pDS);
-	
-	//changes the frame the video is on...we dont need it.
-	void CALLBACK BinkGoto(BinkStruct *Bink, uint32_t FrameNumber, uint32_t unknown);
-	
-	//processes the next frame in the Bink file.
-	int CALLBACK BinkDoFrame(BinkStruct *Bink);
-
-	//advance the playback engine to the next frame
-	void CALLBACK BinkNextFrame(BinkStruct *Bink);
-
-	//gracefully closes a Bink file and releases any allocated resources.
-	void CALLBACK BinkClose(BinkStruct *Bink);
-
-/*
-bytes 0-3      video width
-bytes 4-7      video height
-bytes 8-11     frame count
-bytes 12-15    current frame
-bytes 16-19    last frame
-bytes 20-23    frames/second multiplier
-bytes 24-27    frames/second divisor
-bytes 28-31    unknown
-bytes 32-35    flags
-bytes 36-295   unknown
-bytes 296-299  current plane
-bytes 300-303  pointer to plane 0
-bytes 304-307  pointer to plane 1
-bytes 308-315  unknown
-bytes 316-319  Y plane width
-bytes 320-323  Y plane height
-bytes 324-327  U&V plane width
-bytes 328-331  U&V plane height
-*/
Index: Daodan/src/Daodan.c
===================================================================
--- Daodan/src/Daodan.c	(revision 691)
+++ Daodan/src/Daodan.c	(revision 692)
@@ -1,2 +1,3 @@
+#include <windows.h>
 #include <string.h>
 
@@ -12,12 +13,9 @@
 
 #include "Oni.h"
-#include "Oni_Persistence.h"
-
-#include "BFW_Utility.h"
-
-#include "oni_gl.h"
-#include "daodan_gl.h"
-
-#include "inifile.h"
+
+#include "Oni_GL.h"
+#include "Daodan_GL.h"
+
+#include "Inifile_Reader.h"
 
 HMODULE DDrDLLModule;
@@ -329,6 +327,4 @@
 			else if (!_stricmp(name, "switch"))
 				M3gResolutionSwitch = !_stricmp(inifile_cleanstr(value), "true");
-			//else if (!_stricmp(name, "devmode"))
-				//turn_dev_mode_on = !_stricmp(inifile_cleanstr(value), "true");
 			else
 				DDrStartupMessage("unrecognised option \"%s\"", name);
@@ -681,7 +677,5 @@
 	}
 
-	//DDrPatch_MakeJump((void*)(OniExe + 0x000378c0, (void*)DDrException);
 	DDrPatch_MakeJump((void*)(OniExe + 0x000245A0), (void*)DDrPrintWarning);
-	//init_daodan_gl();
 	
  	ONiMain(argc, argv);
Index: Daodan/src/Daodan.h
===================================================================
--- Daodan/src/Daodan.h	(revision 691)
+++ Daodan/src/Daodan.h	(revision 692)
@@ -1,8 +1,7 @@
-#pragma once
 #ifndef DAODAN_H
 #define DAODAN_H
 
 #include <windows.h>
-#include "bool.h"
+#include "stdint.h"
 
 #define ONICALL __fastcall
@@ -14,6 +13,3 @@
 extern bool opt_topmost;
 
-
-
-
 #endif
Index: Daodan/src/Daodan_BSL.c
===================================================================
--- Daodan/src/Daodan_BSL.c	(revision 691)
+++ Daodan/src/Daodan_BSL.c	(revision 692)
@@ -1,8 +1,7 @@
 #include <stdio.h>
-#include "bool.h"
+#include "stdint.h"
 #include <time.h>
-//#include <ffi.h>
 #include <math.h>
-#include "inifile.h"
+#include "Inifile_Reader.h"
 #include "Daodan_BSL.h"
 #include "Daodan_Utility.h"
@@ -12,7 +11,6 @@
 #include "Oni.h"
 #include "Oni_Character.h"
-#include "oni_gl.h"
+#include "Oni_GL.h"
 #include "Daodan_Character.h"
-#include "BFW_Utility.h"
 
 
Index: Daodan/src/Daodan_BSL.h
===================================================================
--- Daodan/src/Daodan_BSL.h	(revision 691)
+++ Daodan/src/Daodan_BSL.h	(revision 692)
@@ -1,7 +1,4 @@
-#pragma once
 #ifndef DAODAN_BSL_H
 #define DAODAN_BSL_H
-
-#include "Daodan.h"
 
 void SLrDaodan_Initalize();
Index: Daodan/src/Daodan_Character.c
===================================================================
--- Daodan/src/Daodan_Character.c	(revision 691)
+++ Daodan/src/Daodan_Character.c	(revision 692)
@@ -2,5 +2,4 @@
 #include "Daodan_Character.h"
 #include "Oni_Character.h"
-#include "BFW_Utility.h"
 #include "Oni.h"
 
@@ -28,33 +27,5 @@
 			}
 	}
-return -1;													//not found :(
+	return -1;													//not found :(
 }
-/*
-OniRectangle TestRect;
-void CHARTest()
-{
-	
-	CharacterObject* TestCHAR = malloc(sizeof(CharacterObject));
-	memset(TestCHAR, 0, sizeof(CharacterObject));
-	
-	int type = 0x43484152;
-	TestCHAR->Header.Type = type;
-	memcpy(TestCHAR->OSD.Name, "Gumby", 6);
-	memcpy(TestCHAR->OSD.Class, "striker_easy_1", 15);
-	memcpy(TestCHAR->OSD.ScriptSpawn, "dmsg", 20);	
-	//TestCHAR->OSD.Options = chr_unkillable;
-	TestCHAR->OSD.TeamID = team_syndicate;
-	//int* ptr = 0x005ECE70;
-	TestRect.Top = 10;
-	TestRect.Left = 10;
-	TestRect.Right = 100;
-	TestRect.Bottom = 100;
-	
-	char str[5] = "hi";
-	str[2] = '\0';
-	AUrMessageBox(0, "%8x", &TestRect);
-	int16_t a = TSrContext_DrawText(TestContext, str, 0xFF, &TestRect, &TestRect);
-	//ONrGameState_NewCharacter(TestCHAR, NULL, NULL, NULL);
-	return;
-}
-*/
+
Index: Daodan/src/Daodan_Character.h
===================================================================
--- Daodan/src/Daodan_Character.h	(revision 691)
+++ Daodan/src/Daodan_Character.h	(revision 692)
@@ -1,11 +1,9 @@
-#pragma once
 #ifndef DAODAN_CHARACTER_H
 #define DAODAN_CHARACTER_H
 
-#include "Daodan.h"
-//#include <stdint.h>
+#include "stdint.h"
 
 int DDr_TeamToTeamID(const char* team_string);
-void CHARTest();
 uint32_t DDrGetCharacterIndexFromName(char* );
+
 #endif
Index: Daodan/src/Daodan_Cheater.c
===================================================================
--- Daodan/src/Daodan_Cheater.c	(revision 691)
+++ Daodan/src/Daodan_Cheater.c	(revision 692)
@@ -1,4 +1,4 @@
 #include <string.h>
-#include "bool.h"
+#include "stdint.h"
 #include <math.h>
 #include "Oni.h"
Index: Daodan/src/Daodan_Cheater.h
===================================================================
--- Daodan/src/Daodan_Cheater.h	(revision 691)
+++ Daodan/src/Daodan_Cheater.h	(revision 692)
@@ -1,7 +1,6 @@
-#pragma once
 #ifndef DAODAN_CHEATER_H
 #define DAODAN_CHEATER_H
 
-//#include <stdint.h>
+#include "Daodan.h"
 
 typedef struct {
@@ -12,5 +11,6 @@
 } oniCheatCode;
 
-enum { 	cheat_shapeshifter,
+enum {
+		cheat_shapeshifter,
 		cheat_liveforever,
 		cheat_touchofdeath,
@@ -46,5 +46,4 @@
 
 extern oniCheatCode DDr_CheatTable[];
-extern int turn_dev_mode_on;
 uint8_t ONICALL DDrCheater(uint32_t cheat);
 void __stdcall FallingFrames(void* Ebp);
Index: Daodan/src/Daodan_Console.c
===================================================================
--- Daodan/src/Daodan_Console.c	(revision 691)
+++ Daodan/src/Daodan_Console.c	(revision 692)
@@ -1,8 +1,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
-//#include <stdint.h>
 
 #include "Daodan_Console.h"
-#include "BFW_Utility.h"
 #include "Oni_Symbols.h"
 
Index: Daodan/src/Daodan_Console.h
===================================================================
--- Daodan/src/Daodan_Console.h	(revision 691)
+++ Daodan/src/Daodan_Console.h	(revision 692)
@@ -1,23 +1,20 @@
-#pragma once
 #ifndef DAODAN_CONSOLE_H
 #define DAODAN_CONSOLE_H
-
-//#include <stdint.h>
 
 #include "Daodan.h"
 
 typedef struct {
-char B;
-char G;
-char R;
-char A;
+	char B;
+	char G;
+	char R;
+	char A;
 } RGBA;
 
 
 typedef struct {
-char A;
-char R;
-char G;
-char B;
+	char A;
+	char R;
+	char G;
+	char B;
 } ARGB;
 
@@ -31,17 +28,8 @@
 extern TStColorFormattingCharacter DDrDSayColors[];
 
-#ifdef __cplusplus
-extern "C"
-#endif
 void DDrConsole_Print(const char* text);
 
-#ifdef __cplusplus
-extern "C"
-#endif
 void DDrConsole_PrintColored(const char* text, int priority, RGBA color, RGBA shade);
 
-#ifdef __cplusplus
-extern "C"
-#endif
 void DDrConsole_PrintF(const char* fmt, ...);
 
Index: Daodan/src/Daodan_GL.c
===================================================================
--- Daodan/src/Daodan_GL.c	(revision 692)
+++ Daodan/src/Daodan_GL.c	(revision 692)
@@ -0,0 +1,267 @@
+#include <windows.h>
+#include <math.h>
+
+#include "Oni.h"
+#include "Daodan_Utility.h"
+#include <GL/gl.h>
+#include <GL/glu.h>
+#include "Daodan_Win32.h"
+
+#include "Daodan_GL.h"
+#include "Oni_GL.h"
+
+#define max_modes (104) // Dirty hack to add more resolutions, it really should only be 16 ^_^
+#define builtin_modes  (sizeof(daodan_reslist) / sizeof(M3tDisplayMode))
+#define builtin_depths (sizeof(daodan_resdepths) / sizeof(short))
+
+bool daodan_testmode(M3tDisplayMode mode);
+
+const M3tDisplayMode daodan_reslist[] = {
+	{ 720 , 480,  0, 0 },
+	{ 720 , 576,  0, 0 },
+	{ 768 , 480,  0, 0 },
+	{ 800 , 480,  0, 0 },
+	{ 800 , 600,  0, 0 },
+	{ 852 , 480,  0, 0 },
+	{ 856 , 480,  0, 0 },
+	{ 960 , 540,  0, 0 },
+	{ 960 , 720,  0, 0 },
+	{ 1024, 576,  0, 0 },
+	{ 1024, 600,  0, 0 },
+	{ 1024, 640,  0, 0 },
+	{ 1024, 768,  0, 0 },
+	{ 1152, 768,  0, 0 },
+	{ 1152, 864,  0, 0 },
+	{ 1280, 720,  0, 0 },
+	{ 1280, 768,  0, 0 },
+	{ 1280, 800,  0, 0 },
+	{ 1280, 960,  0, 0 },
+	{ 1280, 1024, 0, 0 },
+	{ 1366, 768,  0, 0 },
+	{ 1400, 1050, 0, 0 },
+	{ 1440, 900,  0, 0 },
+	{ 1600, 900,  0, 0 },
+	{ 1600, 1200, 0, 0 },
+	{ 1920, 1080, 0, 0 },
+	{ 1920, 1200, 0, 0 },
+	{ 1920, 1440, 0, 0 },
+};
+//Just going to always use 32 bits for now...
+//short daodan_resdepths[] = { 16, 32 };
+short daodan_resdepths[] = { 32 };
+DEVMODE orig_devmode, cur_devmode, new_devmode;
+
+/* Never called
+void init_daodan_gl()
+{
+	DDrStartupMessage("initalizing daodan gl");
+	
+	memset(&orig_devmode, 0, sizeof(orig_devmode));
+	orig_devmode.dmSize = sizeof(orig_devmode);
+	
+	if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &orig_devmode))
+	{
+		orig_devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+		orig_devmode.dmBitsPerPel = 32;
+		orig_devmode.dmPelsWidth  = GetSystemMetrics(SM_CXSCREEN);
+		orig_devmode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
+	}
+	
+	memcpy(&cur_devmode, &orig_devmode, sizeof(orig_devmode));
+	memcpy(&new_devmode, &orig_devmode, sizeof(orig_devmode));
+}
+*/
+
+void update_cdmode()
+{
+	if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &cur_devmode))
+	{
+		cur_devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+		cur_devmode.dmBitsPerPel = 32;
+		cur_devmode.dmPelsWidth  = GetSystemMetrics(SM_CXSCREEN);
+		cur_devmode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
+	}
+}
+
+unsigned int ONICALL daodan_enumerate_valid_display_modes(M3tDisplayMode modes[max_modes])
+{
+	unsigned int vmodes = 0;
+	unsigned int screen_x = GetSystemMetrics(SM_CXSCREEN);
+	unsigned int screen_y = GetSystemMetrics(SM_CYSCREEN);
+	
+	uint16_t i, j;
+	
+	DDrStartupMessage("listing display modes");
+	/*
+	if (!M3gResolutionSwitch)
+		daodan_resdepths[0] = orig_devmode.dmBitsPerPel;
+	*/
+	for (i = 0; i < builtin_depths; i ++)
+	{
+		bool scrInsert = false;
+		
+		modes[vmodes].Width  = 640;
+		modes[vmodes].Height = 480;
+		modes[vmodes].Depth  = daodan_resdepths[i];
+		
+		if (++vmodes == max_modes - builtin_modes + i)
+			goto modesfull;
+		
+		for (j = 0; j < builtin_modes; j ++)
+			if (!(daodan_reslist[j].Width == 640 && daodan_reslist[j].Height == 480) && !(daodan_reslist[j].Width == screen_x && daodan_reslist[j].Height == screen_y) &&
+				((daodan_reslist[j].Width < screen_x && daodan_reslist[j].Height < screen_y) || (M3gResolutionSwitch && daodan_testmode(daodan_reslist[j]))))
+			{
+				if (!scrInsert && (daodan_reslist[j].Width > screen_x || (daodan_reslist[j].Width == screen_x &&  daodan_reslist[j].Height > screen_y)))
+				{
+					modes[vmodes].Width  = screen_x;
+					modes[vmodes].Height = screen_y;
+					modes[vmodes].Depth  = daodan_resdepths[i];
+					
+					if (++vmodes == max_modes - builtin_modes + i)
+						goto modesfull;
+					
+					scrInsert = true;
+				}
+				
+				modes[vmodes].Width  = daodan_reslist[j].Width;
+				modes[vmodes].Height = daodan_reslist[j].Height;
+				modes[vmodes].Depth  = daodan_resdepths[i];
+				
+				if (++vmodes == max_modes - builtin_modes + i)
+					goto modesfull;
+			}
+		
+		if (!scrInsert)
+		{
+			modes[vmodes].Width  = screen_x;
+			modes[vmodes].Height = screen_y;
+			modes[vmodes].Depth  = daodan_resdepths[i];
+			
+			if (++vmodes == max_modes - builtin_modes + i)
+				goto modesfull;
+		}
+		
+		if (!M3gResolutionSwitch)
+			goto modesfull;
+	}
+	
+	modesfull:
+	DDrStartupMessage("%d modes available", vmodes);
+	return vmodes;
+}
+
+bool daodan_testmode(M3tDisplayMode mode)
+{
+	DEVMODE devmode;
+	memset(&devmode, 0, sizeof(devmode));
+	
+	devmode.dmSize = sizeof(devmode);
+	devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
+	devmode.dmBitsPerPel = mode.Depth;
+	devmode.dmPelsWidth  = mode.Width;
+	devmode.dmPelsHeight = mode.Height;
+	
+	return (ChangeDisplaySettings(&devmode, CDS_TEST | CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
+}
+
+int daodan_set_display_mode(short width, short height, short depth)
+{
+	if (M3gResolutionSwitch)
+	{
+		DEVMODE new_devmode;
+		new_devmode.dmSize = sizeof(new_devmode);
+		new_devmode.dmFields = DM_BITSPERPEL | DM_PELSHEIGHT | DM_PELSWIDTH;
+		new_devmode.dmPelsWidth = width;
+		new_devmode.dmPelsHeight = height;
+		new_devmode.dmBitsPerPel = depth;
+		
+		if (ChangeDisplaySettings(&new_devmode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
+			return 0;
+		
+		if (ChangeDisplaySettings(&new_devmode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
+			return 0;
+		
+		update_cdmode();
+		gl_eng->DisplayMode.Width = cur_devmode.dmPelsWidth;
+		gl_eng->DisplayMode.Height = cur_devmode.dmPelsHeight;
+		if (cur_devmode.dmBitsPerPel > (unsigned short)depth)
+			gl_eng->DisplayMode.Depth = cur_devmode.dmBitsPerPel;
+	}
+	else
+	{
+		update_cdmode();
+		if (cur_devmode.dmBitsPerPel > (unsigned short)depth)
+			gl_eng->DisplayMode.Depth = cur_devmode.dmBitsPerPel;
+	}
+	return 1;
+}
+int ONICALL daodangl_platform_initialize()
+{
+	static M3tDisplayMode lastmode = {0, 0, 0, 0};
+	
+	if (lastmode.Width != gl_eng->DisplayMode.Width || lastmode.Height != gl_eng->DisplayMode.Height || lastmode.Depth != gl_eng->DisplayMode.Depth)
+		if (!daodan_set_display_mode(gl_eng->DisplayMode.Width, gl_eng->DisplayMode.Height, gl_eng->DisplayMode.Depth))
+			if (gl_eng->DisplayMode.Width != 640 || gl_eng->DisplayMode.Height != 480 || gl_eng->DisplayMode.Depth != 16)
+			{
+				gl_eng->DisplayMode.Width = 640;
+				gl_eng->DisplayMode.Height = 480;
+				if (!daodan_set_display_mode(640, 480, 16))
+					goto exit_err;
+			}
+
+	if (lastmode.Width != gl_eng->DisplayMode.Width || lastmode.Height != gl_eng->DisplayMode.Height)
+	{
+		RECT Rect;
+		Rect.left = (GetSystemMetrics(SM_CXSCREEN) / 2) - (gl_eng->DisplayMode.Width / 2);
+		Rect.top = (GetSystemMetrics(SM_CYSCREEN) / 2) - (gl_eng->DisplayMode.Height / 2);
+		Rect.right = Rect.left + gl_eng->DisplayMode.Width;
+		Rect.bottom = Rect.top + gl_eng->DisplayMode.Height;
+		AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_CAPTION |WS_TILEDWINDOW , FALSE);
+		
+		SetWindowPos(ONgPlatformData.Window, NULL, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, SWP_NOACTIVATE | SWP_NOZORDER);
+	}
+
+	if (gl_eng->HDC == NULL)
+		if ((gl_eng->HDC = GetDC(ONgPlatformData.Window)) == NULL)
+			goto exit_err;
+	
+	if (gl_api->wglGetDeviceGammaRamp3DFX != NULL)
+	{
+		DDrStartupMessage("Using 3DFX gamma adjustment");
+
+		if (gl_api->wglGetDeviceGammaRamp3DFX(gl_eng->HDC, gl_gamma_ramp))
+			gl_gamma_ramp_valid = 1;
+	}
+	else
+	{
+		DDrStartupMessage("Using standard Windows gamma adjustment");
+
+//WINE CRASH!		if (GetDeviceGammaRamp(gl_eng->HDC, gl_gamma_ramp))
+			gl_gamma_ramp_valid = 1;
+	}
+	
+	/*if (gl_gamma_ramp_valid)
+		daodan_set_gamma(ONrPersist_GetGamma());  
+	else*/
+		DDrStartupMessage("gamma adjustment not supported");
+	
+	if (!gl_platform_set_pixel_format(gl_eng->HDC))
+		if (gl_eng->DisplayMode.Depth != 16)
+		{
+			if (!daodan_set_display_mode(gl_eng->DisplayMode.Width, gl_eng->DisplayMode.Height, 16))
+				goto exit_err;
+			
+			if (!gl_platform_set_pixel_format(gl_eng->HDC))
+				goto exit_err;
+		}
+
+	lastmode.Width = gl_eng->DisplayMode.Width;
+	lastmode.Height = gl_eng->DisplayMode.Height;
+	lastmode.Depth = gl_eng->DisplayMode.Depth;
+	return 1;
+
+exit_err:
+	AUrMessageBox(1, "Failed to initialize OpenGL contexts; Oni will now exit.");
+	exit(0);
+	return 0;
+}
Index: Daodan/src/Daodan_GL.h
===================================================================
--- Daodan/src/Daodan_GL.h	(revision 692)
+++ Daodan/src/Daodan_GL.h	(revision 692)
@@ -0,0 +1,10 @@
+#ifndef DAODAN_GL_H
+#define DAODAN_GL_H
+
+#include "Daodan.h"
+#include "BFW_Motoko_Draw.h"
+
+unsigned int ONICALL daodan_enumerate_valid_display_modes(M3tDisplayMode modes[16]);
+int ONICALL daodangl_platform_initialize();
+
+#endif
Index: Daodan/src/Daodan_Patch.h
===================================================================
--- Daodan/src/Daodan_Patch.h	(revision 691)
+++ Daodan/src/Daodan_Patch.h	(revision 692)
@@ -1,7 +1,6 @@
-#pragma once
 #ifndef DAODAN_PATCH_H
 #define DAODAN_PATCH_H
 
-#include "bool.h"
+#include "stdint.h"
 
 #define DDrPatch_Const(d, c) DDrPatch_String(d, c, sizeof(c))
Index: Daodan/src/Daodan_Persistence.c
===================================================================
--- Daodan/src/Daodan_Persistence.c	(revision 691)
+++ Daodan/src/Daodan_Persistence.c	(revision 692)
@@ -6,2 +6,3 @@
 	return 1;
 }
+
Index: Daodan/src/Daodan_Persistence.h
===================================================================
--- Daodan/src/Daodan_Persistence.h	(revision 691)
+++ Daodan/src/Daodan_Persistence.h	(revision 692)
@@ -1,7 +1,4 @@
-#pragma once
 #ifndef DAODAN_PERSISTENCE_H
 #define DAODAN_PERSISTENCE_H
-
-//#include <stdint.h>
 
 #include "Daodan.h"
Index: Daodan/src/Daodan_Utility.c
===================================================================
--- Daodan/src/Daodan_Utility.c	(revision 691)
+++ Daodan/src/Daodan_Utility.c	(revision 692)
@@ -2,9 +2,6 @@
 #include <stdlib.h>
 #include <stdarg.h>
-//#include <stdint.h>
-#include "oni_stdio.h"
 
 #include "Daodan_Utility.h"
-#include "BFW_Utility.h"
 #include "Oni.h"
 
@@ -33,24 +30,4 @@
 	return;
 }
-
-/*
-int64_t ONICALL DDrMachineTime_Sixtieths()
-{
-	static int64_t LastTime, Time;
-	int64_t Current;
-
-	Current = LastTime + GetTickCount();
-
-	if (Current > Time)
-	{
-		LastTime += 1;
-		Current += 1;
-	}
-
-	Time = Current;
-
-	return (Time * 3) / 50;
-}
-*/
 
 int64_t ONICALL DDrMachineTime_Sixtieths()
Index: Daodan/src/Daodan_Utility.h
===================================================================
--- Daodan/src/Daodan_Utility.h	(revision 691)
+++ Daodan/src/Daodan_Utility.h	(revision 692)
@@ -1,12 +1,7 @@
-#pragma once
 #ifndef DAODAN_UTILITY_H
 #define DAODAN_UTILITY_H
 
-//#include <stdint.h>
 #include "Daodan.h"
 
-#ifdef __cplusplus
-extern "C"
-#endif
 void __cdecl DDrStartupMessage(const char* fmt, ...);
 int64_t ONICALL DDrMachineTime_High();
Index: Daodan/src/Daodan_Win32.c
===================================================================
--- Daodan/src/Daodan_Win32.c	(revision 691)
+++ Daodan/src/Daodan_Win32.c	(revision 692)
@@ -4,8 +4,8 @@
 #include "Daodan_Win32.h"
 
-#include "BFW_Utility.h"
+#include "Oni.h"
 
-#include "Oni.h"
 extern HWND onihwnd;
+
 short ONICALL DDrPlatform_Initialize(ONtPlatformData *PlatformData)
 {
@@ -50,2 +50,3 @@
 	return 0;
 }
+
Index: Daodan/src/Daodan_Win32.h
===================================================================
--- Daodan/src/Daodan_Win32.h	(revision 691)
+++ Daodan/src/Daodan_Win32.h	(revision 692)
@@ -1,3 +1,2 @@
-#pragma once
 #ifndef DAODAN_WIN32_H
 #define DAODAN_WIN32_H
Index: Daodan/src/Daodan_WindowHack.c
===================================================================
--- Daodan/src/Daodan_WindowHack.c	(revision 691)
+++ Daodan/src/Daodan_WindowHack.c	(revision 692)
@@ -2,9 +2,7 @@
 #include "Daodan_WindowHack.h"
 #include "Daodan_Patch.h"
-#include "Daodan_Character.h"
 
 #include "Oni.h"
-#include "BFW_Motoko_Draw.h"
-#include "oni_gl.h"
+#include "Oni_GL.h"
 
 volatile HWND onihwnd, boxhwnd = NULL;
Index: Daodan/src/Daodan_WindowHack.h
===================================================================
--- Daodan/src/Daodan_WindowHack.h	(revision 691)
+++ Daodan/src/Daodan_WindowHack.h	(revision 692)
@@ -1,5 +1,6 @@
-#pragma once
 #ifndef DAODAN_WINDOWHACK_H
 #define DAODAN_WINDOWHACK_H
+
+#include <windows.h>
 
 void DDrWindowHack_Install();
Index: Daodan/src/Inifile_Reader.c
===================================================================
--- Daodan/src/Inifile_Reader.c	(revision 692)
+++ Daodan/src/Inifile_Reader.c	(revision 692)
@@ -0,0 +1,149 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "stdint.h"
+#include <string.h>
+#include <ctype.h>
+
+#include "Inifile_Reader.h"
+
+char* inifile_cleanstr(char* str)
+{
+	int i;
+	for (i = strlen(str) - 1; i >= 0; i --)
+		if (isspace(str[i]))
+			str[i] = '\0';
+		else
+			break;
+	
+	while (isspace(*str))
+		str++;
+	
+	return str;
+}
+
+int64_t inifile_parseint(const char* str, bool issigned)
+{
+	int64_t ret = 0;
+	bool neg = false;
+	if (str[0] == '0' && str[1] == 'x')
+	{
+		int i;
+		if (str[2] == '\0')
+			return 0x100000000LL;
+		
+		for (i = 0, str += 2; *str; i++, str++)
+		{
+			if (i == 8)
+				return 0x100000000LL;
+			
+			ret <<= 4;
+			if (*str >= '0' && *str <= '9')
+				ret |= *str - '0';
+			else if (*str >= 'a' && *str <= 'f')
+				ret |= *str - 'a' + 10;
+			else if (*str >= 'A' && *str <= 'F')
+				ret |= *str - 'A' + 10;
+			else
+				return 0x100000000LL;
+		}
+		return ret;
+	}
+	else if ((*str >= '0' && *str <= '9') || (neg = (*str == '-')))
+	{
+		int i;
+		if (neg)
+			str++;
+		for (i = 0; *str; i++, str++)
+		{
+			if (i == 10)
+				return 0x100000000LL;
+			else if (i == 9 && !issigned && (ret > 429496729LL || (ret == 429496729LL && *str > '5')))
+				return 0x100000000LL;
+			else if (i == 9 && issigned && (ret > 214748364LL || (ret == 214748364LL && *str > (neg ? '8' : '7'))))
+				return 0x100000000LL;
+			
+			ret *= 10;
+			if (*str >= '0' && *str <= '9')
+				ret += *str - '0';
+			else
+				return 0x100000000LL;
+		}
+		if (neg)
+			ret *= -1;
+		return ret;
+	}
+	else
+		return 0x100000000LL;
+}
+
+bool inifile_read(const char* filename, inifile_callback callback)
+{
+	FILE* fp = fopen(filename, "r");
+	char* inisection = "";
+	char readbuf[4096] = "";
+	char* readptr;
+	bool success = true;
+	bool newsection = false;
+	
+	if (!fp)
+		return inifile_cantread;
+	
+	while ((readptr = fgets(readbuf, sizeof(readbuf), fp))) // Loop through each line.
+	{
+		while (isspace(readptr[0])) // Skip whitespace.
+			readptr++;
+		
+		if (readptr[0] == '\0' || readptr[0] == '#' || readptr[0] == '!') // Skip empty lines and comments.
+			continue;
+		else if (readptr[0] == '[' && readptr[1] != ']') // It's a section header.
+		{
+			int i;
+			for (i = 2; readptr[i]; i ++) // Look for the ]
+				if (readptr[i] == ']')
+					break;
+			
+			if (readptr[i]) // Replace with a null or crash with error.
+				readptr[i] = '\0';
+			else
+			{
+				success = false;
+				break;
+			}
+			
+			if (inisection[0])
+				free(inisection);
+			inisection = _strdup(readptr + 1); // Skip the first [
+			newsection = true;
+		}
+		else // It's a value.
+		{
+			int i;
+			int equals = 0;
+			for (i = 0; readptr[i]; i ++) // Find the =
+				if (readptr[i] == '=')
+					equals = i;
+			
+			if (readptr[i - 1] == '\n')
+				readptr[i - 1] = '\0'; // Remove the trailing newline.
+			
+			if (equals)
+			{
+				readptr[equals] = '\0';
+				if (!callback(inisection, newsection, readptr, readptr + equals + 1)) // If the callback is false, exit.
+					break;
+				newsection = false;
+			}
+			else // If there's no equals, crash with error.
+			{
+				success = false;
+				break;
+			}
+		}
+	}
+	
+	if (inisection[0])
+		free(inisection);
+	
+	fclose(fp);
+	return success;
+}
Index: Daodan/src/Inifile_Reader.h
===================================================================
--- Daodan/src/Inifile_Reader.h	(revision 692)
+++ Daodan/src/Inifile_Reader.h	(revision 692)
@@ -0,0 +1,16 @@
+#ifndef INIFILE_H
+#define INIFILE_H
+
+#include "stdint.h"
+
+enum {
+	inifile_cantread = -20
+};
+
+typedef bool (*inifile_callback)(char* section, bool newsection, char* name, char* value);
+
+char* inifile_cleanstr(char* str);
+int64_t inifile_parseint(const char* str, bool issigned);
+bool inifile_read(const char* filename, inifile_callback callback);
+
+#endif
Index: Daodan/src/Oni.h
===================================================================
--- Daodan/src/Oni.h	(revision 691)
+++ Daodan/src/Oni.h	(revision 692)
@@ -1,15 +1,13 @@
-#pragma once
 #ifndef ONI_H
 #define ONI_H
 
 #include "Daodan.h"
-#include "oni_gl.h"
-//#include <stdint.h>
+#include "Oni_GL.h"
 #include <windows.h>
 #include "Oni_GameState.h"
+
 typedef unsigned char onibool;
 
-typedef struct
-{
+typedef struct {
 	HINSTANCE Instance;
 	HWND Window;
@@ -22,5 +20,5 @@
 	void** PointerList, //Where the found pointers go
 	int* FoundCount		//Where the number of pointers found go.
-	); 
+); 
 
 #include "Oni_Symbols.h"
Index: Daodan/src/Oni_Character.h
===================================================================
--- Daodan/src/Oni_Character.h	(revision 691)
+++ Daodan/src/Oni_Character.h	(revision 692)
@@ -1,8 +1,6 @@
-#pragma once
 #ifndef ONI_CHARACTER_H
 #define ONI_CHARACTER_H
 
-//#include <stdint.h>
-#include "bool.h"
+#include "stdint.h"
 
 enum {
@@ -16,22 +14,5 @@
 	team_syndicateaccessory,
 };
-/*
-int16_t ONICALL ONrGameState_NewCharacter(CharacterObject* CHAR, void* AISA, void* flag, uint32_t* list_location);
-int32_t* ONICALL ONrGetActiveCharacter(void* CharacterPtr);
-//int16_t ONICALL ONrGameState_GetPlayerCharacter();
-*/
-//probably need to name these better.
-/*
-#define char_unkillable        (1 <<  5)
-#define char_superammo         (1 <<  6)
-#define char_unstoppable       (1 <<  8)
-#define char_deathlock         (1 << 10)
-#define char_dontaim           (1 << 13)
-#define char_nocollision       (1 << 17)
-#define char_noshadow          (1 << 24)
-#define char_invincible        (1 << 25)
-#define char_bossshield        (1 << 30)
-#define char_weaponimmune      (1 << 31)
-*/
+
 
 //We need a Oni_Structs #include file.
Index: Daodan/src/Oni_GL.h
===================================================================
--- Daodan/src/Oni_GL.h	(revision 692)
+++ Daodan/src/Oni_GL.h	(revision 692)
@@ -0,0 +1,442 @@
+#ifndef ONI_GL_H
+#define ONI_GL_H
+
+#include <windows.h>
+#include <GL/gl.h>
+
+#include "BFW_Motoko_Draw.h"
+
+typedef struct 
+{
+	int a;
+	M3tDrawEngineCaps DrawEngineCaps;
+	M3tDrawEngine DrawEngine;
+	M3tDrawContext DrawContext;
+	M3tDisplayMode DisplayMode;
+	int b;
+	int Textures[2];
+	short c;
+	short d;
+	int IntState;
+	M3tDrawPtrState *PtrState;
+	int e;
+	int Color;
+	int MaxTetxureSize;
+	int DoubleBufferSupported;
+	int MaxTextureUnits;
+	char *VendorString;
+	char *RendererString;
+	char *VersionString;
+	char *ExtensionsString;
+	int MultipassCapable;
+	int f_0588;
+	char f_058C;
+	char SupportsDepthReads;
+	char FogDisabled;
+	char f_058F;
+	int CompressedTextureFormats[16];
+	int NumCompressedTextureFormats;
+	int f_05D4;
+	float FogStart;
+	float FogEnd;
+	char FogStartChanged;
+	char FogEndChanged;
+	short f_05E2;
+	int f_05E4[4];
+	float FogColor_R;
+	float FogColor_G;
+	float FogColor_B;
+	int Fog_1_;
+	char Fog_2_;
+	char f_0605[3];
+	float ClearColor[4];
+	int LastError;
+	char *LastErrorString;
+	short RenderMode;
+	char BufferClear;
+	char DoubleBuffer;
+	int f_0624;
+	char *TextureBuffer;
+	HDC HDC;
+	HGLRC HGLRC;
+	char vsync;
+	char f_0635[3];
+	void (*DisplayBackBuffer)(void);
+} gl_engine_t;
+
+typedef struct
+{
+	void (WINAPI *glAccum)(GLenum op, GLfloat value);
+	void (WINAPI *glAlphaFunc)(GLenum func, GLclampf ref);
+	GLboolean (WINAPI *glAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
+	void (WINAPI *glArrayElement)(GLint i);
+	void (WINAPI *glBegin)(GLenum mode);
+	void (WINAPI *glBindTexture)(GLenum target, GLuint texture);
+	void (WINAPI *glBitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
+	void (WINAPI *glBlendFunc)(GLenum sfactor, GLenum dfactor);
+	void (WINAPI *glCallList)(GLuint list);
+	void (WINAPI *glCallLists)(GLsizei n, GLenum type, const GLvoid *lists);
+	void (WINAPI *glClear)(GLbitfield mask);
+	void (WINAPI *glClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+	void (WINAPI *glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
+	void (WINAPI *glClearDepth)(GLclampd depth);
+	void (WINAPI *glClearIndex)(GLfloat c);
+	void (WINAPI *glClearStencil)(GLint s);
+	void (WINAPI *glClipPlane)(GLenum plane, const GLdouble *equation);
+	void (WINAPI *glColor3b)(GLbyte red, GLbyte green, GLbyte blue);
+	void (WINAPI *glColor3bv)(const GLbyte *v);
+	void (WINAPI *glColor3d)(GLdouble red, GLdouble green, GLdouble blue);
+	void (WINAPI *glColor3dv)(const GLdouble *v);
+	void (WINAPI *glColor3f)(GLfloat red, GLfloat green, GLfloat blue);
+	void (WINAPI *glColor3fv)(const GLfloat *v);
+	void (WINAPI *glColor3i)(GLint red, GLint green, GLint blue);
+	void (WINAPI *glColor3iv)(const GLint *v);
+	void (WINAPI *glColor3s)(GLshort red, GLshort green, GLshort blue);
+	void (WINAPI *glColor3sv)(const GLshort *v);
+	void (WINAPI *glColor3ub)(GLubyte red, GLubyte green, GLubyte blue);
+	void (WINAPI *glColor3ubv)(const GLubyte *v);
+	void (WINAPI *glColor3ui)(GLuint red, GLuint green, GLuint blue);
+	void (WINAPI *glColor3uiv)(const GLuint *v);
+	void (WINAPI *glColor3us)(GLushort red, GLushort green, GLushort blue);
+	void (WINAPI *glColor3usv)(const GLushort *v);
+	void (WINAPI *glColor4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
+	void (WINAPI *glColor4bv)(const GLbyte *v);
+	void (WINAPI *glColor4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
+	void (WINAPI *glColor4dv)(const GLdouble *v);
+	void (WINAPI *glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
+	void (WINAPI *glColor4fv)(const GLfloat *v);
+	void (WINAPI *glColor4i)(GLint red, GLint green, GLint blue, GLint alpha);
+	void (WINAPI *glColor4iv)(const GLint *v);
+	void (WINAPI *glColor4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
+	void (WINAPI *glColor4sv)(const GLshort *v);
+	void (WINAPI *glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
+	void (WINAPI *glColor4ubv)(const GLubyte *v);
+	void (WINAPI *glColor4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
+	void (WINAPI *glColor4uiv)(const GLuint *v);
+	void (WINAPI *glColor4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
+	void (WINAPI *glColor4usv)(const GLushort *v);
+	void (WINAPI *glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
+	void (WINAPI *glColorMaterial)(GLenum face, GLenum mode);
+	void (WINAPI *glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+	void (WINAPI *glCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
+	void (WINAPI *glCopyTexImage1D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
+	void (WINAPI *glCopyTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
+	void (WINAPI *glCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
+	void (WINAPI *glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	void (WINAPI *glCullFace)(GLenum mode);
+	void (WINAPI *glDeleteLists)(GLuint list, GLsizei range);
+	void (WINAPI *glDeleteTextures)(GLsizei n, const GLuint *textures);
+	void (WINAPI *glDepthFunc)(GLenum func);
+	void (WINAPI *glDepthMask)(GLboolean flag);
+	void (WINAPI *glDepthRange)(GLclampd zNear, GLclampd zFar);
+	void (WINAPI *glDisable)(GLenum cap);
+	void (WINAPI *glDisableClientState)(GLenum array);
+	void (WINAPI *glDrawArrays)(GLenum mode, GLint first, GLsizei count);
+	void (WINAPI *glDrawBuffer)(GLenum mode);
+	void (WINAPI *glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
+	void (WINAPI *glDrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+	void (WINAPI *glEdgeFlag)(GLboolean flag);
+	void (WINAPI *glEdgeFlagPointer)(GLsizei stride, const GLvoid *pointer);
+	void (WINAPI *glEdgeFlagv)(const GLboolean *flag);
+	void (WINAPI *glEnable)(GLenum cap);
+	void (WINAPI *glEnableClientState)(GLenum array);
+	void (WINAPI *glEnd)(void);
+	void (WINAPI *glEndList)(void);
+	void (WINAPI *glEvalCoord1d)(GLdouble u);
+	void (WINAPI *glEvalCoord1dv)(const GLdouble *u);
+	void (WINAPI *glEvalCoord1f)(GLfloat u);
+	void (WINAPI *glEvalCoord1fv)(const GLfloat *u);
+	void (WINAPI *glEvalCoord2d)(GLdouble u, GLdouble v);
+	void (WINAPI *glEvalCoord2dv)(const GLdouble *u);
+	void (WINAPI *glEvalCoord2f)(GLfloat u, GLfloat v);
+	void (WINAPI *glEvalCoord2fv)(const GLfloat *u);
+	void (WINAPI *glEvalMesh1)(GLenum mode, GLint i1, GLint i2);
+	void (WINAPI *glEvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
+	void (WINAPI *glEvalPoint1)(GLint i);
+	void (WINAPI *glEvalPoint2)(GLint i, GLint j);
+	void (WINAPI *glFeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer);
+	void (WINAPI *glFinish)(void);
+	void (WINAPI *glFlush)(void);
+	void (WINAPI *glFogf)(GLenum pname, GLfloat param);
+	void (WINAPI *glFogfv)(GLenum pname, const GLfloat *params);
+	void (WINAPI *glFogi)(GLenum pname, GLint param);
+	void (WINAPI *glFogiv)(GLenum pname, const GLint *params);
+	void (WINAPI *glFrontFace)(GLenum mode);
+	void (WINAPI *glFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	GLuint (WINAPI *glGenLists)(GLsizei range);
+	void (WINAPI *glGenTextures)(GLsizei n, GLuint *textures);
+	void (WINAPI *glGetBooleanv)(GLenum pname, GLboolean *params);
+	void (WINAPI *glGetClipPlane)(GLenum plane, GLdouble *equation);
+	void (WINAPI *glGetDoublev)(GLenum pname, GLdouble *params);
+	GLenum (WINAPI *glGetError)(void);
+	void (WINAPI *glGetFloatv)(GLenum pname, GLfloat *params);
+	void (WINAPI *glGetIntegerv)(GLenum pname, GLint *params);
+	void (WINAPI *glGetLightfv)(GLenum light, GLenum pname, GLfloat *params);
+	void (WINAPI *glGetLightiv)(GLenum light, GLenum pname, GLint *params);
+	void (WINAPI *glGetMapdv)(GLenum target, GLenum query, GLdouble *v);
+	void (WINAPI *glGetMapfv)(GLenum target, GLenum query, GLfloat *v);
+	void (WINAPI *glGetMapiv)(GLenum target, GLenum query, GLint *v);
+	void (WINAPI *glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params);
+	void (WINAPI *glGetMaterialiv)(GLenum face, GLenum pname, GLint *params);
+	void (WINAPI *glGetPixelMapfv)(GLenum map, GLfloat *values);
+	void (WINAPI *glGetPixelMapuiv)(GLenum map, GLuint *values);
+	void (WINAPI *glGetPixelMapusv)(GLenum map, GLushort *values);
+	void (WINAPI *glGetPointerv)(GLenum pname, GLvoid* *params);
+	void (WINAPI *glGetPolygonStipple)(GLubyte *mask);
+	const GLubyte * (WINAPI *glGetString)(GLenum name);
+	void (WINAPI *glGetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params);
+	void (WINAPI *glGetTexEnviv)(GLenum target, GLenum pname, GLint *params);
+	void (WINAPI *glGetTexGendv)(GLenum coord, GLenum pname, GLdouble *params);
+	void (WINAPI *glGetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params);
+	void (WINAPI *glGetTexGeniv)(GLenum coord, GLenum pname, GLint *params);
+	void (WINAPI *glGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
+	void (WINAPI *glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
+	void (WINAPI *glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
+	void (WINAPI *glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
+	void (WINAPI *glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
+	void (WINAPI *glHint)(GLenum target, GLenum mode);
+	void (WINAPI *glIndexMask)(GLuint mask);
+	void (WINAPI *glIndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
+	void (WINAPI *glIndexd)(GLdouble c);
+	void (WINAPI *glIndexdv)(const GLdouble *c);
+	void (WINAPI *glIndexf)(GLfloat c);
+	void (WINAPI *glIndexfv)(const GLfloat *c);
+	void (WINAPI *glIndexi)(GLint c);
+	void (WINAPI *glIndexiv)(const GLint *c);
+	void (WINAPI *glIndexs)(GLshort c);
+	void (WINAPI *glIndexsv)(const GLshort *c);
+	void (WINAPI *glIndexub)(GLubyte c);
+	void (WINAPI *glIndexubv)(const GLubyte *c);
+	void (WINAPI *glInitNames)(void);
+	void (WINAPI *glInterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer);
+	GLboolean (WINAPI *glIsEnabled)(GLenum cap);
+	GLboolean (WINAPI *glIsList)(GLuint list);
+	GLboolean (WINAPI *glIsTexture)(GLuint texture);
+	void (WINAPI *glLightModelf)(GLenum pname, GLfloat param);
+	void (WINAPI *glLightModelfv)(GLenum pname, const GLfloat *params);
+	void (WINAPI *glLightModeli)(GLenum pname, GLint param);
+	void (WINAPI *glLightModeliv)(GLenum pname, const GLint *params);
+	void (WINAPI *glLightf)(GLenum light, GLenum pname, GLfloat param);
+	void (WINAPI *glLightfv)(GLenum light, GLenum pname, const GLfloat *params);
+	void (WINAPI *glLighti)(GLenum light, GLenum pname, GLint param);
+	void (WINAPI *glLightiv)(GLenum light, GLenum pname, const GLint *params);
+	void (WINAPI *glLineStipple)(GLint factor, GLushort pattern);
+	void (WINAPI *glLineWidth)(GLfloat width);
+	void (WINAPI *glListBase)(GLuint base);
+	void (WINAPI *glLoadIdentity)(void);
+	void (WINAPI *glLoadMatrixd)(const GLdouble *m);
+	void (WINAPI *glLoadMatrixf)(const GLfloat *m);
+	void (WINAPI *glLoadName)(GLuint name);
+	void (WINAPI *glLogicOp)(GLenum opcode);
+	void (WINAPI *glMap1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
+	void (WINAPI *glMap1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
+	void (WINAPI *glMap2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
+	void (WINAPI *glMap2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
+	void (WINAPI *glMapGrid1d)(GLint un, GLdouble u1, GLdouble u2);
+	void (WINAPI *glMapGrid1f)(GLint un, GLfloat u1, GLfloat u2);
+	void (WINAPI *glMapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
+	void (WINAPI *glMapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
+	void (WINAPI *glMaterialf)(GLenum face, GLenum pname, GLfloat param);
+	void (WINAPI *glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params);
+	void (WINAPI *glMateriali)(GLenum face, GLenum pname, GLint param);
+	void (WINAPI *glMaterialiv)(GLenum face, GLenum pname, const GLint *params);
+	void (WINAPI *glMatrixMode)(GLenum mode);
+	void (WINAPI *glMultMatrixd)(const GLdouble *m);
+	void (WINAPI *glMultMatrixf)(const GLfloat *m);
+	void (WINAPI *glNewList)(GLuint list, GLenum mode);
+	void (WINAPI *glNormal3b)(GLbyte nx, GLbyte ny, GLbyte nz);
+	void (WINAPI *glNormal3bv)(const GLbyte *v);
+	void (WINAPI *glNormal3d)(GLdouble nx, GLdouble ny, GLdouble nz);
+	void (WINAPI *glNormal3dv)(const GLdouble *v);
+	void (WINAPI *glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz);
+	void (WINAPI *glNormal3fv)(const GLfloat *v);
+	void (WINAPI *glNormal3i)(GLint nx, GLint ny, GLint nz);
+	void (WINAPI *glNormal3iv)(const GLint *v);
+	void (WINAPI *glNormal3s)(GLshort nx, GLshort ny, GLshort nz);
+	void (WINAPI *glNormal3sv)(const GLshort *v);
+	void (WINAPI *glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
+	void (WINAPI *glOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+	void (WINAPI *glPassThrough)(GLfloat token);
+	void (WINAPI *glPixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values);
+	void (WINAPI *glPixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values);
+	void (WINAPI *glPixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values);
+	void (WINAPI *glPixelStoref)(GLenum pname, GLfloat param);
+	void (WINAPI *glPixelStorei)(GLenum pname, GLint param);
+	void (WINAPI *glPixelTransferf)(GLenum pname, GLfloat param);
+	void (WINAPI *glPixelTransferi)(GLenum pname, GLint param);
+	void (WINAPI *glPixelZoom)(GLfloat xfactor, GLfloat yfactor);
+	void (WINAPI *glPointSize)(GLfloat size);
+	void (WINAPI *glPolygonMode)(GLenum face, GLenum mode);
+	void (WINAPI *glPolygonOffset)(GLfloat factor, GLfloat units);
+	void (WINAPI *glPolygonStipple)(const GLubyte *mask);
+	void (WINAPI *glPopAttrib)(void);
+	void (WINAPI *glPopClientAttrib)(void);
+	void (WINAPI *glPopMatrix)(void);
+	void (WINAPI *glPopName)(void);
+	void (WINAPI *glPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
+	void (WINAPI *glPushAttrib)(GLbitfield mask);
+	void (WINAPI *glPushClientAttrib)(GLbitfield mask);
+	void (WINAPI *glPushMatrix)(void);
+	void (WINAPI *glPushName)(GLuint name);
+	void (WINAPI *glRasterPos2d)(GLdouble x, GLdouble y);
+	void (WINAPI *glRasterPos2dv)(const GLdouble *v);
+	void (WINAPI *glRasterPos2f)(GLfloat x, GLfloat y);
+	void (WINAPI *glRasterPos2fv)(const GLfloat *v);
+	void (WINAPI *glRasterPos2i)(GLint x, GLint y);
+	void (WINAPI *glRasterPos2iv)(const GLint *v);
+	void (WINAPI *glRasterPos2s)(GLshort x, GLshort y);
+	void (WINAPI *glRasterPos2sv)(const GLshort *v);
+	void (WINAPI *glRasterPos3d)(GLdouble x, GLdouble y, GLdouble z);
+	void (WINAPI *glRasterPos3dv)(const GLdouble *v);
+	void (WINAPI *glRasterPos3f)(GLfloat x, GLfloat y, GLfloat z);
+	void (WINAPI *glRasterPos3fv)(const GLfloat *v);
+	void (WINAPI *glRasterPos3i)(GLint x, GLint y, GLint z);
+	void (WINAPI *glRasterPos3iv)(const GLint *v);
+	void (WINAPI *glRasterPos3s)(GLshort x, GLshort y, GLshort z);
+	void (WINAPI *glRasterPos3sv)(const GLshort *v);
+	void (WINAPI *glRasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+	void (WINAPI *glRasterPos4dv)(const GLdouble *v);
+	void (WINAPI *glRasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void (WINAPI *glRasterPos4fv)(const GLfloat *v);
+	void (WINAPI *glRasterPos4i)(GLint x, GLint y, GLint z, GLint w);
+	void (WINAPI *glRasterPos4iv)(const GLint *v);
+	void (WINAPI *glRasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w);
+	void (WINAPI *glRasterPos4sv)(const GLshort *v);
+	void (WINAPI *glReadBuffer)(GLenum mode);
+	void (WINAPI *glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
+	void (WINAPI *glRectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
+	void (WINAPI *glRectdv)(const GLdouble *v1, const GLdouble *v2);
+	void (WINAPI *glRectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
+	void (WINAPI *glRectfv)(const GLfloat *v1, const GLfloat *v2);
+	void (WINAPI *glRecti)(GLint x1, GLint y1, GLint x2, GLint y2);
+	void (WINAPI *glRectiv)(const GLint *v1, const GLint *v2);
+	void (WINAPI *glRects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
+	void (WINAPI *glRectsv)(const GLshort *v1, const GLshort *v2);
+	GLint (WINAPI *glRenderMode)(GLenum mode);
+	void (WINAPI *glRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+	void (WINAPI *glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+	void (WINAPI *glScaled)(GLdouble x, GLdouble y, GLdouble z);
+	void (WINAPI *glScalef)(GLfloat x, GLfloat y, GLfloat z);
+	void (WINAPI *glScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
+	void (WINAPI *glSelectBuffer)(GLsizei size, GLuint *buffer);
+	void (WINAPI *glShadeModel)(GLenum mode);
+	void (WINAPI *glStencilFunc)(GLenum func, GLint ref, GLuint mask);
+	void (WINAPI *glStencilMask)(GLuint mask);
+	void (WINAPI *glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
+	void (WINAPI *glTexCoord1d)(GLdouble s);
+	void (WINAPI *glTexCoord1dv)(const GLdouble *v);
+	void (WINAPI *glTexCoord1f)(GLfloat s);
+	void (WINAPI *glTexCoord1fv)(const GLfloat *v);
+	void (WINAPI *glTexCoord1i)(GLint s);
+	void (WINAPI *glTexCoord1iv)(const GLint *v);
+	void (WINAPI *glTexCoord1s)(GLshort s);
+	void (WINAPI *glTexCoord1sv)(const GLshort *v);
+	void (WINAPI *glTexCoord2d)(GLdouble s, GLdouble t);
+	void (WINAPI *glTexCoord2dv)(const GLdouble *v);
+	void (WINAPI *glTexCoord2f)(GLfloat s, GLfloat t);
+	void (WINAPI *glTexCoord2fv)(const GLfloat *v);
+	void (WINAPI *glTexCoord2i)(GLint s, GLint t);
+	void (WINAPI *glTexCoord2iv)(const GLint *v);
+	void (WINAPI *glTexCoord2s)(GLshort s, GLshort t);
+	void (WINAPI *glTexCoord2sv)(const GLshort *v);
+	void (WINAPI *glTexCoord3d)(GLdouble s, GLdouble t, GLdouble r);
+	void (WINAPI *glTexCoord3dv)(const GLdouble *v);
+	void (WINAPI *glTexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
+	void (WINAPI *glTexCoord3fv)(const GLfloat *v);
+	void (WINAPI *glTexCoord3i)(GLint s, GLint t, GLint r);
+	void (WINAPI *glTexCoord3iv)(const GLint *v);
+	void (WINAPI *glTexCoord3s)(GLshort s, GLshort t, GLshort r);
+	void (WINAPI *glTexCoord3sv)(const GLshort *v);
+	void (WINAPI *glTexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
+	void (WINAPI *glTexCoord4dv)(const GLdouble *v);
+	void (WINAPI *glTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
+	void (WINAPI *glTexCoord4fv)(const GLfloat *v);
+	void (WINAPI *glTexCoord4i)(GLint s, GLint t, GLint r, GLint q);
+	void (WINAPI *glTexCoord4iv)(const GLint *v);
+	void (WINAPI *glTexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q);
+	void (WINAPI *glTexCoord4sv)(const GLshort *v);
+	void (WINAPI *glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+	void (WINAPI *glTexEnvf)(GLenum target, GLenum pname, GLfloat param);
+	void (WINAPI *glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
+	void (WINAPI *glTexEnvi)(GLenum target, GLenum pname, GLint param);
+	void (WINAPI *glTexEnviv)(GLenum target, GLenum pname, const GLint *params);
+	void (WINAPI *glTexGend)(GLenum coord, GLenum pname, GLdouble param);
+	void (WINAPI *glTexGendv)(GLenum coord, GLenum pname, const GLdouble *params);
+	void (WINAPI *glTexGenf)(GLenum coord, GLenum pname, GLfloat param);
+	void (WINAPI *glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
+	void (WINAPI *glTexGeni)(GLenum coord, GLenum pname, GLint param);
+	void (WINAPI *glTexGeniv)(GLenum coord, GLenum pname, const GLint *params);
+	void (WINAPI *glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+	void (WINAPI *glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
+	void (WINAPI *glTexParameterf)(GLenum target, GLenum pname, GLfloat param);
+	void (WINAPI *glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
+	void (WINAPI *glTexParameteri)(GLenum target, GLenum pname, GLint param);
+	void (WINAPI *glTexParameteriv)(GLenum target, GLenum pname, const GLint *params);
+	void (WINAPI *glTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
+	void (WINAPI *glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
+	void (WINAPI *glTranslated)(GLdouble x, GLdouble y, GLdouble z);
+	void (WINAPI *glTranslatef)(GLfloat x, GLfloat y, GLfloat z);
+	void (WINAPI *glVertex2d)(GLdouble x, GLdouble y);
+	void (WINAPI *glVertex2dv)(const GLdouble *v);
+	void (WINAPI *glVertex2f)(GLfloat x, GLfloat y);
+	void (WINAPI *glVertex2fv)(const GLfloat *v);
+	void (WINAPI *glVertex2i)(GLint x, GLint y);
+	void (WINAPI *glVertex2iv)(const GLint *v);
+	void (WINAPI *glVertex2s)(GLshort x, GLshort y);
+	void (WINAPI *glVertex2sv)(const GLshort *v);
+	void (WINAPI *glVertex3d)(GLdouble x, GLdouble y, GLdouble z);
+	void (WINAPI *glVertex3dv)(const GLdouble *v);
+	void (WINAPI *glVertex3f)(GLfloat x, GLfloat y, GLfloat z);
+	void (WINAPI *glVertex3fv)(const GLfloat *v);
+	void (WINAPI *glVertex3i)(GLint x, GLint y, GLint z);
+	void (WINAPI *glVertex3iv)(const GLint *v);
+	void (WINAPI *glVertex3s)(GLshort x, GLshort y, GLshort z);
+	void (WINAPI *glVertex3sv)(const GLshort *v);
+	void (WINAPI *glVertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
+	void (WINAPI *glVertex4dv)(const GLdouble *v);
+	void (WINAPI *glVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
+	void (WINAPI *glVertex4fv)(const GLfloat *v);
+	void (WINAPI *glVertex4i)(GLint x, GLint y, GLint z, GLint w);
+	void (WINAPI *glVertex4iv)(const GLint *v);
+	void (WINAPI *glVertex4s)(GLshort x, GLshort y, GLshort z, GLshort w);
+	void (WINAPI *glVertex4sv)(const GLshort *v);
+	void (WINAPI *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
+	void (WINAPI *glViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
+
+	BOOL  (WINAPI *wglCopyContext)(HGLRC, HGLRC, UINT);
+	HGLRC (WINAPI *wglCreateContext)(HDC);
+	HGLRC (WINAPI *wglCreateLayerContext)(HDC, int);
+	BOOL  (WINAPI *wglDeleteContext)(HGLRC);
+	HGLRC (WINAPI *wglGetCurrentContext)(VOID);
+	HDC   (WINAPI *wglGetCurrentDC)(VOID);
+	PROC  (WINAPI *wglGetProcAddress)(LPCSTR);
+	BOOL  (WINAPI *wglMakeCurrent)(HDC, HGLRC);
+	BOOL  (WINAPI *wglShareLists)(HGLRC, HGLRC);
+
+	int f_0564;
+
+	int glActiveTextureARB;
+	int glClientActiveTextureARB;
+	int glMultiTexCoord4fARB;
+	int glMultiTexCoord2fvARB;
+	int glBlendColor;
+	int f_057C;
+	int f_0580;
+	int f_0584;
+	int f_0588;
+	int glCompressedTexImaged3DARB;
+	int glCompressedTexImaged2DARB;
+	int glCompressedTexImage1DARB;
+	int glCompressedTexSubImage3DARB;
+	int glCompressedTexSubImage2DARB;
+	int glCompressedTexSubImage1DARB;
+	int glCompressedTexImageARB;
+
+	GLboolean (WINAPI *wglSwapIntervalEXT)(GLint interval);
+
+	GLint (WINAPI *wglSetDeviceGammaRamp3DFX)(HDC, GLvoid *);
+	GLint (WINAPI *wglGetDeviceGammaRamp3DFX)(HDC, GLvoid *);
+} gl_api_t;
+
+
+#endif
Index: Daodan/src/Oni_GameState.h
===================================================================
--- Daodan/src/Oni_GameState.h	(revision 691)
+++ Daodan/src/Oni_GameState.h	(revision 692)
@@ -1,6 +1,6 @@
 #ifndef ONI_GAMESTATE_H
 #define ONI_GAMESTATE_H
+
 #include "Oni_Character.h"
-
 
 typedef struct {
@@ -420,21 +420,5 @@
 	chr_weaponimmune      = 1 << 31,
 } chr_flags;
-/*
-enum {
-chr_isplayer			=		0x00000001,	//is player character
-chr_randomskin			=		0x00000002,	//gets random skin from ONCV
-chr_notprespawned		=		0x00000004,	//isn't spawned at level creation
-chr_noncombatant		=		0x00000008,	//doesn't fight
-chr_multispawnable		=		0x00000010,	//can spawn up to 5 without forcing
-chr_unknown				=		0x00000020,	//
-chr_unkillable			=		0x00000040,	//can only be brought to 1 hp
-chr_superammo			=		0x00000080,	//infinite ammo
-chr_omniscient			=		0x00000100,	//touchofdeath
-chr_haslsi				=		0x00000200,	//drops an lsi
-chr_boss				=		0x00000400,	//is a boss character
-chr_upgradedifficulty	=		0x00000800,	//upgrade the difficulty if you play on med\hard
-chr_noautodrop			=		0x00001000,	//uses drop fields instead of has fields on death
-}; //
-*/
+
 
 typedef struct {
@@ -1474,3 +1458,5 @@
 			int blah3;
 } COtTextArea;
+
 #endif
+
Index: Daodan/src/Oni_Persistence.h
===================================================================
--- Daodan/src/Oni_Persistence.h	(revision 691)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#pragma once
-#ifndef ONI_PERSISTENCE_H
-#define ONI_PERSISTENCE_H
-
-//#include <stdint.h>
-#include "Daodan.h"
-/*
-float ONICALL ONrPersist_GetGamma();
-uint8_t ONICALL ONrPersist_GetWonGame();
-*/
-#endif
Index: Daodan/src/Oni_Symbols.h
===================================================================
--- Daodan/src/Oni_Symbols.h	(revision 691)
+++ Daodan/src/Oni_Symbols.h	(revision 692)
@@ -1,8 +1,8 @@
 #ifndef ONI_SYMBOLS_H 
 #define ONI_SYMBOLS_H
-#include "bool.h"
+#include "stdint.h"
 #include <stdio.h>
 #include "Oni.h"
-#include "oni_gl.h"
+#include "Oni_GL.h"
 #include "Oni_Character.h"
 #include "BFW_ScriptLang.h"
@@ -41,8 +41,8 @@
 #define gl_gamma_ramp_valid	(*((int*)0x005603fc))
 
-// OpenGL whatev?
+// OpenGL: list of pointers to opengl32.dll functions (and a few functions from GL extensions)
 #define gl_api				(*((gl_api_t**)0x00560604))
 
-// OpenGL whatev?
+// OpenGL render engine descriptor (resolutions, flags, context methods)
 #define gl_eng				(*((gl_engine_t**)0x00560600))
 
@@ -107,41 +107,77 @@
 DefFunc(int, gl_platform_initialize, ONICALL, (), 0x00407da0);
 
+// Retrieve gamma value from settings
 DefFunc(float, ONrPersist_GetGamma, ONICALL, (), 0x0050f450);
+
+// Retrieve if the game was completed
 DefFunc(uint8_t, ONrPersist_GetWonGame, ONICALL, (), 0x0050f660);
 
+// Print a message to the startup.txt log
 DefFunc(void, UUrStartupMessage, __cdecl, (const char* fmt, ...), 0x00424860);
+
+// Probably to spawn a new character
 DefFunc(int16_t, ONrGameState_NewCharacter, ONICALL, (void* CHAR, void* AISA, void* flag, uint32_t* list_location), 0x004dac50);
+
+// Remove character
+DefFunc(void, ONrGameState_DeleteCharacter, ONICALL, (Character *inCharacter), 0x004DC480);
+
+DefFunc(void, ONrGameState_Timer_Start, ONICALL, (char* function, int time), 0x004FD370);
+
+// Get active (player?) character
 DefFunc(ActiveCharacter*, ONrGetActiveCharacter, ONICALL, (void* CharacterPtr), 0x004f1180);
+
+DefFunc(uint32_t, ONrCharacter_GetHealthShade, ONICALL, (uint32_t health, uint32_t maxhealth), 0x004EF450);
 DefFunc(void, ONrCharacter_NewAnimationHook, ONICALL, (Character *ioCharacter, ActiveCharacter *ioActiveCharacter), 0x004E97A0);
 DefFunc(void, ONrCharacter_SetAnimationExternal, ONICALL, (Character *ioCharacter, short state, void* animation, int interpolation), 0x004EB340);
-
+DefFunc(void, ONrCharacter_SetHitPoints, ONICALL, (Character *ioCharacter, uint32_t inHitPoints), 0x004EB220);
+DefFunc(void, ONrCharacter_SetCharacterClass, ONICALL, (Character* Char, ONCC* Class), 0x004D7C30);
+DefFunc(void, ONrCorpse_Create, ONICALL, (Character* Character), 0x004EF340);
+
+
+// Print message to console
 DefFunc(void, COrTextArea_Print, ONICALL, (uint32_t area, uint32_t priority, uint32_t textshade, uint32_t textshadowshade, const char* text, uint32_t unk_alwaws_0, uint32_t fadetime), 0x00431340);
+
+// Original cheat function
 DefFunc(uint8_t, ONrCheater, ONICALL, (uint32_t cheat), 0x004f5c30);
+
+// ?
 DefFunc(int, AUrMessageBox, __cdecl, (int Buttons, char *Message, ...), 0x004378c0);
 DefFunc(char*, SSrMessage_Find, ONICALL, (char* message_key), 0x0047F550);
 DefFunc(void, ONiGameState_FindAutoPromptMessage, ONICALL, (char* Note, void* ptr), 0x004FDBE0);
 
+// Register a BSL function with a return type
 DefFunc(uint16_t, SLrScript_Command_Register_ReturnType, ONICALL, (char* name, char* desc, char* argfmt, sl_type type, sl_func callback), 0x00477b20);
+
+// Register a BSL function without a return value
 DefFunc(uint16_t, SLrScript_Command_Register_Void, ONICALL, (char* name, char* desc, char* argfmt, sl_func callback), 0x00477b40);
+
+// Register a global BSL variable
 DefFunc(uint16_t, SLrGlobalVariable_Register_Int32, ONICALL, (char* name, char* desc, int32_t* data), 0x00477e30);
 DefFunc(uint16_t, SLrGlobalVariable_Register_Float, ONICALL, (char* name, char* desc, float* data), 0x00477ec0);
 DefFunc(uint16_t, SLrGlobalVariable_Register_String, ONICALL, (char* name, char* desc, char* data), 0x00477fe0);
 
+// Print message to console ?
 DefFunc(int, COrMessage_Print, ONICALL, (char* Message, char* Key, void* noidea), 0x004304B0);
+
 DefFunc(void, COrConsole_StatusLine_Display, ONICALL, (), 0x00431E70);
+
+// Get pointer to specified data instance
 DefFunc(int16_t, TMrInstance_GetDataPtr, ONICALL, (int tag, char* name, void* pointer), 0x004232E0);
+
+// Get name of data instance pointed to
 DefFunc(char*, TMrInstance_GetInstanceName, ONICALL, (void* InstancePointer), 0x00423D90);
 
+DefFunc(short, TMrInstance_GetDataPtr_ByNumber, ONICALL, (int tag, int number, void** out), 0x00423680);
+DefFunc(uint32_t, TMrInstance_GetTagCount, ONICALL, (int tag), 0x004236F0);
+
+// Draw text on the screen
 DefFunc(int16_t, TSrContext_DrawText, ONICALL, (uint32_t TSrContext, char* Text, char alpha, uint32_t usuallyzero, void* pRect), 0x0042DF00);
 DefFunc(int16_t, TSrContext_New, ONICALL, (void* FontInstance, int size, int hthsik1,int hthsik2,int hthsik3, void* TSrContext), 0x0042EA30);
 
 DefFunc(int16_t, TSrContext_SetShade, ONICALL, (void *ioTextContext, uint32_t inShade), 0x0042EE50);
-DefFunc(void, ONrGameState_Timer_Start, ONICALL, (char* function, int time), 0x004FD370);
+
 DefFunc(uint16_t, TRrAnimation_GetDuration, ONICALL, (void* Animation), 0x00428740);
 DefFunc(uint16_t, TRrAnimation_GetTo, ONICALL, (void* Animation), 0x00428730);
 DefFunc(uint16_t, TRrAnimation_GetFrom, ONICALL, (void* Animation), 0x00428720);
-
-DefFunc(void, ONrCharacter_SetHitPoints, ONICALL, (Character *ioCharacter, uint32_t inHitPoints), 0x004EB220);
-DefFunc(void, ONrCorpse_Create, ONICALL, (Character* Character), 0x004EF340);
 
 DefFunc(uint16_t, iSetCharacterClass, ONICALL, (sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret), 0x004D99D0);
@@ -150,6 +186,4 @@
 //NOT USED: DefFunc(int, OBJiObjectGroup_GetNumObjects, ONICALL, (void *inObjectGroup), );
 
-DefFunc(void, ONrGameState_DeleteCharacter, ONICALL, (Character *inCharacter), 0x004DC480);
-
 DefFunc(int, OBJrObjectType_EnumerateObjects, ONICALL, (int inObjectType, OBJtEnumCallback_Object inEnumCallback, int inUserData), 0x004D0080);
 
@@ -160,8 +194,4 @@
 
 
-DefFunc(void, ONrCharacter_SetCharacterClass, ONICALL, (Character* Char, ONCC* Class), 0x004D7C30);
-DefFunc(short, TMrInstance_GetDataPtr_ByNumber, ONICALL, (int tag, int number, void** out), 0x00423680);
-DefFunc(uint32_t, TMrInstance_GetTagCount, ONICALL, (int tag), 0x004236F0);
-DefFunc(uint32_t, ONrCharacter_GetHealthShade, ONICALL, (uint32_t health, uint32_t maxhealth), 0x004EF450);
 DefFunc(void, ONiDrawWeaponSight, ONICALL, (Character* Char), 0x004E1900);
 DefFunc(void, AI2rDisplayDebuggingInfo, ONICALL, (Character* Char), 0x0048C5F0);
Index: Daodan/src/bool.h
===================================================================
--- Daodan/src/bool.h	(revision 691)
+++ 	(revision )
@@ -1,210 +1,0 @@
-#define bool int
-#define false 0
-#define true 1
-
-/* ISO C9x  7.18  Integer types <stdint.h>
- * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
- *
- *  THIS SOFTWARE IS NOT COPYRIGHTED
- *
- *  Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
- *
- *  This source code is offered for use in the public domain. You may
- *  use, modify or distribute it freely.
- *
- *  This code is distributed in the hope that it will be useful but
- *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
- *  DISCLAIMED. This includes but is not limited to warranties of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- *  Date: 2000-12-02
- */
-
-
-#ifndef _STDINT_H
-#define _STDINT_H
-#define __need_wint_t
-#define __need_wchar_t
-#include <stddef.h>
-
-/* 7.18.1.1  Exact-width integer types */
-typedef signed char int8_t;
-typedef unsigned char   uint8_t;
-typedef short  int16_t;
-typedef unsigned short  uint16_t;
-typedef int  int32_t;
-typedef unsigned   uint32_t;
-typedef long long  int64_t;
-typedef unsigned long long   uint64_t;
-
-/* 7.18.1.2  Minimum-width integer types */
-typedef signed char int_least8_t;
-typedef unsigned char   uint_least8_t;
-typedef short  int_least16_t;
-typedef unsigned short  uint_least16_t;
-typedef int  int_least32_t;
-typedef unsigned   uint_least32_t;
-typedef long long  int_least64_t;
-typedef unsigned long long   uint_least64_t;
-
-/*  7.18.1.3  Fastest minimum-width integer types 
- *  Not actually guaranteed to be fastest for all purposes
- *  Here we use the exact-width types for 8 and 16-bit ints. 
- */
-typedef char int_fast8_t;
-typedef unsigned char uint_fast8_t;
-typedef short  int_fast16_t;
-typedef unsigned short  uint_fast16_t;
-typedef int  int_fast32_t;
-typedef unsigned  int  uint_fast32_t;
-typedef long long  int_fast64_t;
-typedef unsigned long long   uint_fast64_t;
-
-/* 7.18.1.4  Integer types capable of holding object pointers */
-
-#ifndef _INTPTR_T_DEFINED
-#define _INTPTR_T_DEFINED
-#ifdef _WIN64
-  typedef __int64 intptr_t;
-#else
-  typedef int intptr_t;
-#endif
-#endif
-
-#ifndef _UINTPTR_T_DEFINED
-#define _UINTPTR_T_DEFINED
-#ifdef _WIN64
-  typedef unsigned __int64 uintptr_t;
-#else
-  typedef unsigned int uintptr_t;
-#endif
-#endif
-
-/* 7.18.1.5  Greatest-width integer types */
-typedef long long  intmax_t;
-typedef unsigned long long uintmax_t;
-
-/* 7.18.2  Limits of specified-width integer types */
-#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
-
-/* 7.18.2.1  Limits of exact-width integer types */
-#define INT8_MIN (-128) 
-#define INT16_MIN (-32768)
-#define INT32_MIN (-2147483647 - 1)
-#define INT64_MIN  (-9223372036854775807LL - 1)
-
-#define INT8_MAX 127
-#define INT16_MAX 32767
-#define INT32_MAX 2147483647
-#define INT64_MAX 9223372036854775807LL
-
-#define UINT8_MAX 0xff /* 255U */
-#define UINT16_MAX 0xffff /* 65535U */
-#define UINT32_MAX 0xffffffff  /* 4294967295U */
-#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
-
-/* 7.18.2.2  Limits of minimum-width integer types */
-#define INT_LEAST8_MIN INT8_MIN
-#define INT_LEAST16_MIN INT16_MIN
-#define INT_LEAST32_MIN INT32_MIN
-#define INT_LEAST64_MIN INT64_MIN
-
-#define INT_LEAST8_MAX INT8_MAX
-#define INT_LEAST16_MAX INT16_MAX
-#define INT_LEAST32_MAX INT32_MAX
-#define INT_LEAST64_MAX INT64_MAX
-
-#define UINT_LEAST8_MAX UINT8_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-/* 7.18.2.3  Limits of fastest minimum-width integer types */
-#define INT_FAST8_MIN INT8_MIN
-#define INT_FAST16_MIN INT16_MIN
-#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST64_MIN INT64_MIN
-
-#define INT_FAST8_MAX INT8_MAX
-#define INT_FAST16_MAX INT16_MAX
-#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MAX INT64_MAX
-
-#define UINT_FAST8_MAX UINT8_MAX
-#define UINT_FAST16_MAX UINT16_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-/* 7.18.2.4  Limits of integer types capable of holding
-    object pointers */
-#ifdef _WIN64
-#define INTPTR_MIN INT64_MIN
-#define INTPTR_MAX INT64_MAX
-#define UINTPTR_MAX UINT64_MAX
-#else
-#define INTPTR_MIN INT32_MIN
-#define INTPTR_MAX INT32_MAX
-#define UINTPTR_MAX UINT32_MAX
-#endif
-
-/* 7.18.2.5  Limits of greatest-width integer types */
-#define INTMAX_MIN INT64_MIN
-#define INTMAX_MAX INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-/* 7.18.3  Limits of other integer types */
-#define PTRDIFF_MIN INTPTR_MIN
-#define PTRDIFF_MAX INTPTR_MAX
-
-#define SIG_ATOMIC_MIN INTPTR_MIN
-#define SIG_ATOMIC_MAX INTPTR_MAX
-
-//#define SIZE_MAX UINTPTR_MAX
-
-#ifndef WCHAR_MIN  /* also in wchar.h */ 
-#define WCHAR_MIN 0
-#define WCHAR_MAX 0xffff /* UINT16_MAX */
-#endif
-
-/*
- * wint_t is unsigned short for compatibility with MS runtime
- */
-#define WINT_MIN 0
-#define WINT_MAX 0xffff /* UINT16_MAX */
-
-#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
-
-
-/* 7.18.4  Macros for integer constants */
-#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
-
-/* 7.18.4.1  Macros for minimum-width integer constants
-
-    Accoding to Douglas Gwyn <gwyn@arl.mil>:
-	"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
-	9899:1999 as initially published, the expansion was required
-	to be an integer constant of precisely matching type, which
-	is impossible to accomplish for the shorter types on most
-	platforms, because C99 provides no standard way to designate
-	an integer constant with width less than that of type int.
-	TC1 changed this to require just an integer constant
-	*expression* with *promoted* type."
-*/
-
-#define INT8_C(val) ((int8_t) + (val))
-#define UINT8_C(val) ((uint8_t) + (val##U))
-#define INT16_C(val) ((int16_t) + (val))
-#define UINT16_C(val) ((uint16_t) + (val##U))
-
-#define INT32_C(val) val##L
-#define UINT32_C(val) val##UL
-#define INT64_C(val) val##LL
-#define UINT64_C(val) val##ULL
-
-/* 7.18.4.2  Macros for greatest-width integer constants */
-#define INTMAX_C(val)  INT64_C(val)
-#define UINTMAX_C(val) UINT64_C(val)
-
-#endif  /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
-
-#endif
Index: Daodan/src/daodan_gl.c
===================================================================
--- Daodan/src/daodan_gl.c	(revision 691)
+++ 	(revision )
@@ -1,265 +1,0 @@
-#include <windows.h>
-#include <math.h>
-
-#include "Oni.h"
-#include "Oni_Persistence.h"
-#include "Daodan_Utility.h"
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include "Daodan_Win32.h"
-#include "BFW_Utility.h"
-
-#include "daodan_gl.h"
-#include "oni_gl.h"
-
-#define max_modes (104) // Dirty hack to add more resolutions, it really should only be 16 ^_^
-#define builtin_modes  (sizeof(daodan_reslist) / sizeof(M3tDisplayMode))
-#define builtin_depths (sizeof(daodan_resdepths) / sizeof(short))
-
-const M3tDisplayMode daodan_reslist[] = {
-	{ 720 , 480,  0, 0 },
-	{ 720 , 576,  0, 0 },
-	{ 768 , 480,  0, 0 },
-	{ 800 , 480,  0, 0 },
-	{ 800 , 600,  0, 0 },
-	{ 852 , 480,  0, 0 },
-	{ 856 , 480,  0, 0 },
-	{ 960 , 540,  0, 0 },
-	{ 960 , 720,  0, 0 },
-	{ 1024, 576,  0, 0 },
-	{ 1024, 600,  0, 0 },
-	{ 1024, 640,  0, 0 },
-	{ 1024, 768,  0, 0 },
-	{ 1152, 768,  0, 0 },
-	{ 1152, 864,  0, 0 },
-	{ 1280, 720,  0, 0 },
-	{ 1280, 768,  0, 0 },
-	{ 1280, 800,  0, 0 },
-	{ 1280, 960,  0, 0 },
-	{ 1280, 1024, 0, 0 },
-	{ 1366, 768,  0, 0 },
-	{ 1400, 1050, 0, 0 },
-	{ 1440, 900,  0, 0 },
-	{ 1600, 900,  0, 0 },
-	{ 1600, 1200, 0, 0 },
-	{ 1920, 1080, 0, 0 },
-	{ 1920, 1200, 0, 0 },
-	{ 1920, 1440, 0, 0 },
-};
-//Just going to always use 32 bits for now...
-//short daodan_resdepths[] = { 16, 32 };
-short daodan_resdepths[] = { 32 };
-DEVMODE orig_devmode, cur_devmode, new_devmode;
-
-void init_daodan_gl()
-{
-	DDrStartupMessage("initalizing daodan gl");
-	
-	memset(&orig_devmode, 0, sizeof(orig_devmode));
-	orig_devmode.dmSize = sizeof(orig_devmode);
-	
-	if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &orig_devmode))
-	{
-		orig_devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
-		orig_devmode.dmBitsPerPel = 32;
-		orig_devmode.dmPelsWidth  = GetSystemMetrics(SM_CXSCREEN);
-		orig_devmode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
-	}
-	
-	memcpy(&cur_devmode, &orig_devmode, sizeof(orig_devmode));
-	memcpy(&new_devmode, &orig_devmode, sizeof(orig_devmode));
-}
-
-void update_cdmode()
-{
-	if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &cur_devmode))
-	{
-		cur_devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
-		cur_devmode.dmBitsPerPel = 32;
-		cur_devmode.dmPelsWidth  = GetSystemMetrics(SM_CXSCREEN);
-		cur_devmode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
-	}
-}
-
-unsigned int ONICALL daodan_enumerate_valid_display_modes(M3tDisplayMode modes[max_modes])
-{
-	unsigned int vmodes = 0;
-	unsigned int screen_x = GetSystemMetrics(SM_CXSCREEN);
-	unsigned int screen_y = GetSystemMetrics(SM_CYSCREEN);
-	
-	uint16_t i, j;
-	
-	DDrStartupMessage("listing display modes");
-	/*
-	if (!M3gResolutionSwitch)
-		daodan_resdepths[0] = orig_devmode.dmBitsPerPel;
-	*/
-	for (i = 0; i < builtin_depths; i ++)
-	{
-		bool scrInsert = false;
-		
-		modes[vmodes].Width  = 640;
-		modes[vmodes].Height = 480;
-		modes[vmodes].Depth  = daodan_resdepths[i];
-		
-		if (++vmodes == max_modes - builtin_modes + i)
-			goto modesfull;
-		
-		for (j = 0; j < builtin_modes; j ++)
-			if (!(daodan_reslist[j].Width == 640 && daodan_reslist[j].Height == 480) && !(daodan_reslist[j].Width == screen_x && daodan_reslist[j].Height == screen_y) &&
-				((daodan_reslist[j].Width < screen_x && daodan_reslist[j].Height < screen_y) || (M3gResolutionSwitch && daodan_testmode(daodan_reslist[j]))))
-			{
-				if (!scrInsert && (daodan_reslist[j].Width > screen_x || (daodan_reslist[j].Width == screen_x &&  daodan_reslist[j].Height > screen_y)))
-				{
-					modes[vmodes].Width  = screen_x;
-					modes[vmodes].Height = screen_y;
-					modes[vmodes].Depth  = daodan_resdepths[i];
-					
-					if (++vmodes == max_modes - builtin_modes + i)
-						goto modesfull;
-					
-					scrInsert = true;
-				}
-				
-				modes[vmodes].Width  = daodan_reslist[j].Width;
-				modes[vmodes].Height = daodan_reslist[j].Height;
-				modes[vmodes].Depth  = daodan_resdepths[i];
-				
-				if (++vmodes == max_modes - builtin_modes + i)
-					goto modesfull;
-			}
-		
-		if (!scrInsert)
-		{
-			modes[vmodes].Width  = screen_x;
-			modes[vmodes].Height = screen_y;
-			modes[vmodes].Depth  = daodan_resdepths[i];
-			
-			if (++vmodes == max_modes - builtin_modes + i)
-				goto modesfull;
-		}
-		
-		if (!M3gResolutionSwitch)
-			goto modesfull;
-	}
-	
-	modesfull:
-	DDrStartupMessage("%d modes available", vmodes);
-	return vmodes;
-}
-
-bool daodan_testmode(M3tDisplayMode mode)
-{
-	DEVMODE devmode;
-	memset(&devmode, 0, sizeof(devmode));
-	
-	devmode.dmSize = sizeof(devmode);
-	devmode.dmFields = DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT;
-	devmode.dmBitsPerPel = mode.Depth;
-	devmode.dmPelsWidth  = mode.Width;
-	devmode.dmPelsHeight = mode.Height;
-	
-	return (ChangeDisplaySettings(&devmode, CDS_TEST | CDS_FULLSCREEN) == DISP_CHANGE_SUCCESSFUL);
-}
-
-int daodan_set_display_mode(short width, short height, short depth)
-{
-	if (M3gResolutionSwitch)
-	{
-		DEVMODE new_devmode;
-		new_devmode.dmSize = sizeof(new_devmode);
-		new_devmode.dmFields = DM_BITSPERPEL | DM_PELSHEIGHT | DM_PELSWIDTH;
-		new_devmode.dmPelsWidth = width;
-		new_devmode.dmPelsHeight = height;
-		new_devmode.dmBitsPerPel = depth;
-		
-		if (ChangeDisplaySettings(&new_devmode, CDS_TEST) != DISP_CHANGE_SUCCESSFUL)
-			return 0;
-		
-		if (ChangeDisplaySettings(&new_devmode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
-			return 0;
-		
-		update_cdmode();
-		gl_eng->DisplayMode.Width = cur_devmode.dmPelsWidth;
-		gl_eng->DisplayMode.Height = cur_devmode.dmPelsHeight;
-		if (cur_devmode.dmBitsPerPel > (unsigned short)depth)
-			gl_eng->DisplayMode.Depth = cur_devmode.dmBitsPerPel;
-	}
-	else
-	{
-		update_cdmode();
-		if (cur_devmode.dmBitsPerPel > (unsigned short)depth)
-			gl_eng->DisplayMode.Depth = cur_devmode.dmBitsPerPel;
-	}
-	return 1;
-}
-int ONICALL daodangl_platform_initialize()
-{
-	static M3tDisplayMode lastmode = {0, 0, 0, 0};
-	
-	if (lastmode.Width != gl_eng->DisplayMode.Width || lastmode.Height != gl_eng->DisplayMode.Height || lastmode.Depth != gl_eng->DisplayMode.Depth)
-		if (!daodan_set_display_mode(gl_eng->DisplayMode.Width, gl_eng->DisplayMode.Height, gl_eng->DisplayMode.Depth))
-			if (gl_eng->DisplayMode.Width != 640 || gl_eng->DisplayMode.Height != 480 || gl_eng->DisplayMode.Depth != 16)
-			{
-				gl_eng->DisplayMode.Width = 640;
-				gl_eng->DisplayMode.Height = 480;
-				if (!daodan_set_display_mode(640, 480, 16))
-					goto exit_err;
-			}
-
-	if (lastmode.Width != gl_eng->DisplayMode.Width || lastmode.Height != gl_eng->DisplayMode.Height)
-	{
-		RECT Rect;
-		Rect.left = (GetSystemMetrics(SM_CXSCREEN) / 2) - (gl_eng->DisplayMode.Width / 2);
-		Rect.top = (GetSystemMetrics(SM_CYSCREEN) / 2) - (gl_eng->DisplayMode.Height / 2);
-		Rect.right = Rect.left + gl_eng->DisplayMode.Width;
-		Rect.bottom = Rect.top + gl_eng->DisplayMode.Height;
-		AdjustWindowRect(&Rect, WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_CAPTION |WS_TILEDWINDOW , FALSE);
-		
-		SetWindowPos(ONgPlatformData.Window, NULL, Rect.left, Rect.top, Rect.right - Rect.left, Rect.bottom - Rect.top, SWP_NOACTIVATE | SWP_NOZORDER);
-	}
-
-	if (gl_eng->HDC == NULL)
-		if ((gl_eng->HDC = GetDC(ONgPlatformData.Window)) == NULL)
-			goto exit_err;
-	
-	if (gl_api->wglGetDeviceGammaRamp3DFX != NULL)
-	{
-		DDrStartupMessage("Using 3DFX gamma adjustment");
-
-		if (gl_api->wglGetDeviceGammaRamp3DFX(gl_eng->HDC, gl_gamma_ramp))
-			gl_gamma_ramp_valid = 1;
-	}
-	else
-	{
-		DDrStartupMessage("Using standard Windows gamma adjustment");
-
-//WINE CRASH!		if (GetDeviceGammaRamp(gl_eng->HDC, gl_gamma_ramp))
-			gl_gamma_ramp_valid = 1;
-	}
-	
-	if (gl_gamma_ramp_valid)
-		daodan_set_gamma(ONrPersist_GetGamma());  
-	else
-		DDrStartupMessage("gamma adjustment not supported");
-	
-	if (!gl_platform_set_pixel_format(gl_eng->HDC))
-		if (gl_eng->DisplayMode.Depth != 16)
-		{
-			if (!daodan_set_display_mode(gl_eng->DisplayMode.Width, gl_eng->DisplayMode.Height, 16))
-				goto exit_err;
-			
-			if (!gl_platform_set_pixel_format(gl_eng->HDC))
-				goto exit_err;
-		}
-
-	lastmode.Width = gl_eng->DisplayMode.Width;
-	lastmode.Height = gl_eng->DisplayMode.Height;
-	lastmode.Depth = gl_eng->DisplayMode.Depth;
-	return 1;
-
-exit_err:
-	AUrMessageBox(1, "Failed to initialize OpenGL contexts; Oni will now exit.");
-	exit(0);
-	return 0;
-}
Index: Daodan/src/daodan_gl.h
===================================================================
--- Daodan/src/daodan_gl.h	(revision 691)
+++ 	(revision )
@@ -1,17 +1,0 @@
-#pragma once
-#ifndef DAODAN_GL_H
-#define DAODAN_GL_H
-
-#include "Daodan.h"
-#include "BFW_Motoko_Draw.h"
-
-#include "oni_gl.h"
-
-void init_daodan_gl();
-void update_cdmode();
-unsigned int ONICALL daodan_enumerate_valid_display_modes(M3tDisplayMode modes[16]);
-bool daodan_testmode(M3tDisplayMode mode);
-int daodan_set_display_mode(short width, short height, short depth);
-void daodan_set_gamma(float gamma);
-int ONICALL daodangl_platform_initialize();
-#endif
Index: Daodan/src/defs.h
===================================================================
--- Daodan/src/defs.h	(revision 691)
+++ 	(revision )
@@ -1,140 +1,0 @@
-/*
-
-   This file contains definitions used by the Hex-Rays decompiler output.
-   It has type definitions and convenience macros to make the
-   output more readable.
-
-   Copyright (c) 2007 Hex-Rays sprl
-
-*/
-
-#if defined(__GNUC__)
-#define FMT_64 "ll"
-typedef          long long ll;
-typedef unsigned long long ull;
-#elif defined(_MSC_VER)
-typedef          __int64 ll;
-typedef unsigned __int64 ull;
-#define FMT_64 "I64"
-#elif defined (__BORLANDC__)
-typedef          __int64 ll;
-typedef unsigned __int64 ull;
-#define FMT_64 "L"
-#else
-#error "unknown compiler"
-#endif
-typedef unsigned int uint;
-typedef unsigned char uchar;
-typedef unsigned short ushort;
-typedef unsigned long ulong;
-
-// Partially defined types:
-#define _BYTE  char
-#define _WORD  short
-#define _DWORD long
-#define _QWORD ll
-#define _LONGLONG __int128
-
-#ifndef _WINDOWS_
-typedef char BYTE;
-typedef short WORD;
-typedef long DWORD;
-typedef long LONG;
-#endif
-typedef ll QWORD;
-#ifndef __cplusplus
-//typedef int bool;       // we want to use bool in our C programs
-#endif
-
-// Some convenience macros to make partial accesses nicer
-// first unsigned macros:
-#define LOBYTE(x)   (*((_BYTE*)&(x)))   // low byte
-#define LOWORD(x)   (*((_WORD*)&(x)))   // low word
-#define LODWORD(x)  (*((_DWORD*)&(x)))  // low dword
-#define HIBYTE(x)   (*((_BYTE*)&(x)+1))
-#define HIWORD(x)   (*((_WORD*)&(x)+1))
-#define HIDWORD(x)  (*((_DWORD*)&(x)+1))
-#define BYTEn(x, n)   (*((_BYTE*)&(x)+n))
-#define WORDn(x, n)   (*((_WORD*)&(x)+n))
-#define BYTE1(x)   BYTEn(x,  1)         // byte 1 (counting from 0)
-#define BYTE2(x)   BYTEn(x,  2)
-#define BYTE3(x)   BYTEn(x,  3)
-#define BYTE4(x)   BYTEn(x,  4)
-#define BYTE5(x)   BYTEn(x,  5)
-#define BYTE6(x)   BYTEn(x,  6)
-#define BYTE7(x)   BYTEn(x,  7)
-#define BYTE8(x)   BYTEn(x,  8)
-#define BYTE9(x)   BYTEn(x,  9)
-#define BYTE10(x)  BYTEn(x, 10)
-#define BYTE11(x)  BYTEn(x, 11)
-#define BYTE12(x)  BYTEn(x, 12)
-#define BYTE13(x)  BYTEn(x, 13)
-#define BYTE14(x)  BYTEn(x, 14)
-#define BYTE15(x)  BYTEn(x, 15)
-#define WORD1(x)   WORDn(x,  1)
-#define WORD2(x)   WORDn(x,  2)         // third word of the object, unsigned
-#define WORD3(x)   WORDn(x,  3)
-#define WORD4(x)   WORDn(x,  4)
-#define WORD5(x)   WORDn(x,  5)
-#define WORD6(x)   WORDn(x,  6)
-#define WORD7(x)   WORDn(x,  7)
-
-// now signed macros (the same but with sign extension)
-#define SLOBYTE(x)   (*((char*)&(x)))
-#define SLOWORD(x)   (*((short*)&(x)))
-#define SLODWORD(x)  (*((long*)&(x)))
-#define SHIBYTE(x)   (*((char*)&(x)+1))
-#define SHIWORD(x)   (*((short*)&(x)+1))
-#define SHIDWORD(x)  (*((long*)&(x)+1))
-#define SBYTEn(x, n)   (*((char*)&(x)+n))
-#define SWORDn(x, n)   (*((short*)&(x)+n))
-#define SBYTE1(x)   SBYTEn(x,  1)
-#define SBYTE2(x)   SBYTEn(x,  2)
-#define SBYTE3(x)   SBYTEn(x,  3)
-#define SBYTE4(x)   SBYTEn(x,  4)
-#define SBYTE5(x)   SBYTEn(x,  5)
-#define SBYTE6(x)   SBYTEn(x,  6)
-#define SBYTE7(x)   SBYTEn(x,  7)
-#define SBYTE8(x)   SBYTEn(x,  8)
-#define SBYTE9(x)   SBYTEn(x,  9)
-#define SBYTE10(x)  SBYTEn(x, 10)
-#define SBYTE11(x)  SBYTEn(x, 11)
-#define SBYTE12(x)  SBYTEn(x, 12)
-#define SBYTE13(x)  SBYTEn(x, 13)
-#define SBYTE14(x)  SBYTEn(x, 14)
-#define SBYTE15(x)  SBYTEn(x, 15)
-#define SWORD1(x)   SWORDn(x,  1)
-#define SWORD2(x)   SWORDn(x,  2)
-#define SWORD3(x)   SWORDn(x,  3)
-#define SWORD4(x)   SWORDn(x,  4)
-#define SWORD5(x)   SWORDn(x,  5)
-#define SWORD6(x)   SWORDn(x,  6)
-#define SWORD7(x)   SWORDn(x,  7)
-
-// Macros to represent some assembly instructions
-// Feel free to modify them
-
-#define __ROL__(x, y) __rotl__(x, y)       // Rotate left
-#define __ROR__(x, y) __rotr__(x, y)       // Rotate right
-#define __RCL__(x, y) invalid_operation    // Rotate left thru carry
-#define __RCR__(x, y) invalid_operation    // Rotate right thru carry
-#define __MKCADD__(x, y) invalid_operation // Generate carry flag for an addition
-#define __MKOADD__(x, y) invalid_operation // Generate overflow flag for an addition
-#define __MKCSHL__(x, y) invalid_operation // Generate carry flag for a shift left
-#define __MKCSHR__(x, y) invalid_operation // Generate carry flag for a shift right
-#define __MKCRCL__(x, y) invalid_operation // Generate carry flag for a RCL
-#define __MKCRCR__(x, y) invalid_operation // Generate carry flag for a RCR
-#define __SETO__(x, y)   invalid_operation // Generate overflow flags for (x-y)
-
-
-// In the decompilation listing there are some objects declarared as _UNKNOWN
-// because we could not determine their types. Since the C compiler does not
-// accept void item declarations, we replace them by anything of our choice,
-// for example a char:
-
-#define _UNKNOWN char
-
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#define vsnprintf _vsnprintf
-#endif
Index: Daodan/src/inifile.h
===================================================================
--- Daodan/src/inifile.h	(revision 691)
+++ 	(revision )
@@ -1,16 +1,0 @@
-#pragma once
-#ifndef INIFILE_H
-#define INIFILE_H
-
-#include "bool.h"
-//#include <stdint.h>
-
-enum {inifile_cantread = -20};
-
-typedef bool (*inifile_callback)(char* section, bool newsection, char* name, char* value);
-
-char* inifile_cleanstr(char* str);
-int64_t inifile_parseint(const char* str, bool issigned);
-bool inifile_read(const char* filename, inifile_callback callback);
-
-#endif
Index: Daodan/src/inifile_reader.c
===================================================================
--- Daodan/src/inifile_reader.c	(revision 691)
+++ 	(revision )
@@ -1,149 +1,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include "bool.h"
-#include <string.h>
-#include <ctype.h>
-
-#include "inifile.h"
-
-char* inifile_cleanstr(char* str)
-{
-	int i;
-	for (i = strlen(str) - 1; i >= 0; i --)
-		if (isspace(str[i]))
-			str[i] = '\0';
-		else
-			break;
-	
-	while (isspace(*str))
-		str++;
-	
-	return str;
-}
-
-int64_t inifile_parseint(const char* str, bool issigned)
-{
-	int64_t ret = 0;
-	bool neg = false;
-	if (str[0] == '0' && str[1] == 'x')
-	{
-		int i;
-		if (str[2] == '\0')
-			return 0x100000000LL;
-		
-		for (i = 0, str += 2; *str; i++, str++)
-		{
-			if (i == 8)
-				return 0x100000000LL;
-			
-			ret <<= 4;
-			if (*str >= '0' && *str <= '9')
-				ret |= *str - '0';
-			else if (*str >= 'a' && *str <= 'f')
-				ret |= *str - 'a' + 10;
-			else if (*str >= 'A' && *str <= 'F')
-				ret |= *str - 'A' + 10;
-			else
-				return 0x100000000LL;
-		}
-		return ret;
-	}
-	else if ((*str >= '0' && *str <= '9') || (neg = (*str == '-')))
-	{
-		int i;
-		if (neg)
-			str++;
-		for (i = 0; *str; i++, str++)
-		{
-			if (i == 10)
-				return 0x100000000LL;
-			else if (i == 9 && !issigned && (ret > 429496729LL || (ret == 429496729LL && *str > '5')))
-				return 0x100000000LL;
-			else if (i == 9 && issigned && (ret > 214748364LL || (ret == 214748364LL && *str > (neg ? '8' : '7'))))
-				return 0x100000000LL;
-			
-			ret *= 10;
-			if (*str >= '0' && *str <= '9')
-				ret += *str - '0';
-			else
-				return 0x100000000LL;
-		}
-		if (neg)
-			ret *= -1;
-		return ret;
-	}
-	else
-		return 0x100000000LL;
-}
-
-bool inifile_read(const char* filename, inifile_callback callback)
-{
-	FILE* fp = fopen(filename, "r");
-	char* inisection = "";
-	char readbuf[4096] = "";
-	char* readptr;
-	bool success = true;
-	bool newsection = false;
-	
-	if (!fp)
-		return inifile_cantread;
-	
-	while ((readptr = fgets(readbuf, sizeof(readbuf), fp))) // Loop through each line.
-	{
-		while (isspace(readptr[0])) // Skip whitespace.
-			readptr++;
-		
-		if (readptr[0] == '\0' || readptr[0] == '#' || readptr[0] == '!') // Skip empty lines and comments.
-			continue;
-		else if (readptr[0] == '[' && readptr[1] != ']') // It's a section header.
-		{
-			int i;
-			for (i = 2; readptr[i]; i ++) // Look for the ]
-				if (readptr[i] == ']')
-					break;
-			
-			if (readptr[i]) // Replace with a null or crash with error.
-				readptr[i] = '\0';
-			else
-			{
-				success = false;
-				break;
-			}
-			
-			if (inisection[0])
-				free(inisection);
-			inisection = _strdup(readptr + 1); // Skip the first [
-			newsection = true;
-		}
-		else // It's a value.
-		{
-			int i;
-			int equals = 0;
-			for (i = 0; readptr[i]; i ++) // Find the =
-				if (readptr[i] == '=')
-					equals = i;
-			
-			if (readptr[i - 1] == '\n')
-				readptr[i - 1] = '\0'; // Remove the trailing newline.
-			
-			if (equals)
-			{
-				readptr[equals] = '\0';
-				if (!callback(inisection, newsection, readptr, readptr + equals + 1)) // If the callback is false, exit.
-					break;
-				newsection = false;
-			}
-			else // If there's no equals, crash with error.
-			{
-				success = false;
-				break;
-			}
-		}
-	}
-	
-	if (inisection[0])
-		free(inisection);
-	
-	fclose(fp);
-	return success;
-}
Index: Daodan/src/oni_gl.h
===================================================================
--- Daodan/src/oni_gl.h	(revision 691)
+++ 	(revision )
@@ -1,445 +1,0 @@
-#pragma once
-#ifndef ONI_GL_H
-#define ONI_GL_H
-
-#include <GL/gl.h>
-
-#include "Daodan.h"
-#include "BFW_Motoko_Draw.h"
-
-typedef struct 
-{
-	int a;
-	M3tDrawEngineCaps DrawEngineCaps;
-	M3tDrawEngine DrawEngine;
-	M3tDrawContext DrawContext;
-	M3tDisplayMode DisplayMode;
-	int b;
-	int Textures[2];
-	short c;
-	short d;
-	int IntState;
-	M3tDrawPtrState *PtrState;
-	int e;
-	int Color;
-	int MaxTetxureSize;
-	int DoubleBufferSupported;
-	int MaxTextureUnits;
-	char *VendorString;
-	char *RendererString;
-	char *VersionString;
-	char *ExtensionsString;
-	int MultipassCapable;
-	int f_0588;
-	char f_058C;
-	char SupportsDepthReads;
-	char FogDisabled;
-	char f_058F;
-	int CompressedTextureFormats[16];
-	int NumCompressedTextureFormats;
-	int f_05D4;
-	float FogStart;
-	float FogEnd;
-	char FogStartChanged;
-	char FogEndChanged;
-	short f_05E2;
-	int f_05E4[4];
-	float FogColor_R;
-	float FogColor_G;
-	float FogColor_B;
-	int Fog_1_;
-	char Fog_2_;
-	char f_0605[3];
-	float ClearColor[4];
-	int LastError;
-	char *LastErrorString;
-	short RenderMode;
-	char BufferClear;
-	char DoubleBuffer;
-	int f_0624;
-	char *TextureBuffer;
-	HDC HDC;
-	HGLRC HGLRC;
-	char vsync;
-	char f_0635[3];
-	void (*DisplayBackBuffer)(void);
-} gl_engine_t;
-
-typedef struct
-{
-	void (WINAPI *glAccum)(GLenum op, GLfloat value);
-	void (WINAPI *glAlphaFunc)(GLenum func, GLclampf ref);
-	GLboolean (WINAPI *glAreTexturesResident)(GLsizei n, const GLuint *textures, GLboolean *residences);
-	void (WINAPI *glArrayElement)(GLint i);
-	void (WINAPI *glBegin)(GLenum mode);
-	void (WINAPI *glBindTexture)(GLenum target, GLuint texture);
-	void (WINAPI *glBitmap)(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap);
-	void (WINAPI *glBlendFunc)(GLenum sfactor, GLenum dfactor);
-	void (WINAPI *glCallList)(GLuint list);
-	void (WINAPI *glCallLists)(GLsizei n, GLenum type, const GLvoid *lists);
-	void (WINAPI *glClear)(GLbitfield mask);
-	void (WINAPI *glClearAccum)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-	void (WINAPI *glClearColor)(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
-	void (WINAPI *glClearDepth)(GLclampd depth);
-	void (WINAPI *glClearIndex)(GLfloat c);
-	void (WINAPI *glClearStencil)(GLint s);
-	void (WINAPI *glClipPlane)(GLenum plane, const GLdouble *equation);
-	void (WINAPI *glColor3b)(GLbyte red, GLbyte green, GLbyte blue);
-	void (WINAPI *glColor3bv)(const GLbyte *v);
-	void (WINAPI *glColor3d)(GLdouble red, GLdouble green, GLdouble blue);
-	void (WINAPI *glColor3dv)(const GLdouble *v);
-	void (WINAPI *glColor3f)(GLfloat red, GLfloat green, GLfloat blue);
-	void (WINAPI *glColor3fv)(const GLfloat *v);
-	void (WINAPI *glColor3i)(GLint red, GLint green, GLint blue);
-	void (WINAPI *glColor3iv)(const GLint *v);
-	void (WINAPI *glColor3s)(GLshort red, GLshort green, GLshort blue);
-	void (WINAPI *glColor3sv)(const GLshort *v);
-	void (WINAPI *glColor3ub)(GLubyte red, GLubyte green, GLubyte blue);
-	void (WINAPI *glColor3ubv)(const GLubyte *v);
-	void (WINAPI *glColor3ui)(GLuint red, GLuint green, GLuint blue);
-	void (WINAPI *glColor3uiv)(const GLuint *v);
-	void (WINAPI *glColor3us)(GLushort red, GLushort green, GLushort blue);
-	void (WINAPI *glColor3usv)(const GLushort *v);
-	void (WINAPI *glColor4b)(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha);
-	void (WINAPI *glColor4bv)(const GLbyte *v);
-	void (WINAPI *glColor4d)(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha);
-	void (WINAPI *glColor4dv)(const GLdouble *v);
-	void (WINAPI *glColor4f)(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
-	void (WINAPI *glColor4fv)(const GLfloat *v);
-	void (WINAPI *glColor4i)(GLint red, GLint green, GLint blue, GLint alpha);
-	void (WINAPI *glColor4iv)(const GLint *v);
-	void (WINAPI *glColor4s)(GLshort red, GLshort green, GLshort blue, GLshort alpha);
-	void (WINAPI *glColor4sv)(const GLshort *v);
-	void (WINAPI *glColor4ub)(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
-	void (WINAPI *glColor4ubv)(const GLubyte *v);
-	void (WINAPI *glColor4ui)(GLuint red, GLuint green, GLuint blue, GLuint alpha);
-	void (WINAPI *glColor4uiv)(const GLuint *v);
-	void (WINAPI *glColor4us)(GLushort red, GLushort green, GLushort blue, GLushort alpha);
-	void (WINAPI *glColor4usv)(const GLushort *v);
-	void (WINAPI *glColorMask)(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
-	void (WINAPI *glColorMaterial)(GLenum face, GLenum mode);
-	void (WINAPI *glColorPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-	void (WINAPI *glCopyPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type);
-	void (WINAPI *glCopyTexImage1D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border);
-	void (WINAPI *glCopyTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
-	void (WINAPI *glCopyTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width);
-	void (WINAPI *glCopyTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
-	void (WINAPI *glCullFace)(GLenum mode);
-	void (WINAPI *glDeleteLists)(GLuint list, GLsizei range);
-	void (WINAPI *glDeleteTextures)(GLsizei n, const GLuint *textures);
-	void (WINAPI *glDepthFunc)(GLenum func);
-	void (WINAPI *glDepthMask)(GLboolean flag);
-	void (WINAPI *glDepthRange)(GLclampd zNear, GLclampd zFar);
-	void (WINAPI *glDisable)(GLenum cap);
-	void (WINAPI *glDisableClientState)(GLenum array);
-	void (WINAPI *glDrawArrays)(GLenum mode, GLint first, GLsizei count);
-	void (WINAPI *glDrawBuffer)(GLenum mode);
-	void (WINAPI *glDrawElements)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices);
-	void (WINAPI *glDrawPixels)(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-	void (WINAPI *glEdgeFlag)(GLboolean flag);
-	void (WINAPI *glEdgeFlagPointer)(GLsizei stride, const GLvoid *pointer);
-	void (WINAPI *glEdgeFlagv)(const GLboolean *flag);
-	void (WINAPI *glEnable)(GLenum cap);
-	void (WINAPI *glEnableClientState)(GLenum array);
-	void (WINAPI *glEnd)(void);
-	void (WINAPI *glEndList)(void);
-	void (WINAPI *glEvalCoord1d)(GLdouble u);
-	void (WINAPI *glEvalCoord1dv)(const GLdouble *u);
-	void (WINAPI *glEvalCoord1f)(GLfloat u);
-	void (WINAPI *glEvalCoord1fv)(const GLfloat *u);
-	void (WINAPI *glEvalCoord2d)(GLdouble u, GLdouble v);
-	void (WINAPI *glEvalCoord2dv)(const GLdouble *u);
-	void (WINAPI *glEvalCoord2f)(GLfloat u, GLfloat v);
-	void (WINAPI *glEvalCoord2fv)(const GLfloat *u);
-	void (WINAPI *glEvalMesh1)(GLenum mode, GLint i1, GLint i2);
-	void (WINAPI *glEvalMesh2)(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2);
-	void (WINAPI *glEvalPoint1)(GLint i);
-	void (WINAPI *glEvalPoint2)(GLint i, GLint j);
-	void (WINAPI *glFeedbackBuffer)(GLsizei size, GLenum type, GLfloat *buffer);
-	void (WINAPI *glFinish)(void);
-	void (WINAPI *glFlush)(void);
-	void (WINAPI *glFogf)(GLenum pname, GLfloat param);
-	void (WINAPI *glFogfv)(GLenum pname, const GLfloat *params);
-	void (WINAPI *glFogi)(GLenum pname, GLint param);
-	void (WINAPI *glFogiv)(GLenum pname, const GLint *params);
-	void (WINAPI *glFrontFace)(GLenum mode);
-	void (WINAPI *glFrustum)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-	GLuint (WINAPI *glGenLists)(GLsizei range);
-	void (WINAPI *glGenTextures)(GLsizei n, GLuint *textures);
-	void (WINAPI *glGetBooleanv)(GLenum pname, GLboolean *params);
-	void (WINAPI *glGetClipPlane)(GLenum plane, GLdouble *equation);
-	void (WINAPI *glGetDoublev)(GLenum pname, GLdouble *params);
-	GLenum (WINAPI *glGetError)(void);
-	void (WINAPI *glGetFloatv)(GLenum pname, GLfloat *params);
-	void (WINAPI *glGetIntegerv)(GLenum pname, GLint *params);
-	void (WINAPI *glGetLightfv)(GLenum light, GLenum pname, GLfloat *params);
-	void (WINAPI *glGetLightiv)(GLenum light, GLenum pname, GLint *params);
-	void (WINAPI *glGetMapdv)(GLenum target, GLenum query, GLdouble *v);
-	void (WINAPI *glGetMapfv)(GLenum target, GLenum query, GLfloat *v);
-	void (WINAPI *glGetMapiv)(GLenum target, GLenum query, GLint *v);
-	void (WINAPI *glGetMaterialfv)(GLenum face, GLenum pname, GLfloat *params);
-	void (WINAPI *glGetMaterialiv)(GLenum face, GLenum pname, GLint *params);
-	void (WINAPI *glGetPixelMapfv)(GLenum map, GLfloat *values);
-	void (WINAPI *glGetPixelMapuiv)(GLenum map, GLuint *values);
-	void (WINAPI *glGetPixelMapusv)(GLenum map, GLushort *values);
-	void (WINAPI *glGetPointerv)(GLenum pname, GLvoid* *params);
-	void (WINAPI *glGetPolygonStipple)(GLubyte *mask);
-	const GLubyte * (WINAPI *glGetString)(GLenum name);
-	void (WINAPI *glGetTexEnvfv)(GLenum target, GLenum pname, GLfloat *params);
-	void (WINAPI *glGetTexEnviv)(GLenum target, GLenum pname, GLint *params);
-	void (WINAPI *glGetTexGendv)(GLenum coord, GLenum pname, GLdouble *params);
-	void (WINAPI *glGetTexGenfv)(GLenum coord, GLenum pname, GLfloat *params);
-	void (WINAPI *glGetTexGeniv)(GLenum coord, GLenum pname, GLint *params);
-	void (WINAPI *glGetTexImage)(GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels);
-	void (WINAPI *glGetTexLevelParameterfv)(GLenum target, GLint level, GLenum pname, GLfloat *params);
-	void (WINAPI *glGetTexLevelParameteriv)(GLenum target, GLint level, GLenum pname, GLint *params);
-	void (WINAPI *glGetTexParameterfv)(GLenum target, GLenum pname, GLfloat *params);
-	void (WINAPI *glGetTexParameteriv)(GLenum target, GLenum pname, GLint *params);
-	void (WINAPI *glHint)(GLenum target, GLenum mode);
-	void (WINAPI *glIndexMask)(GLuint mask);
-	void (WINAPI *glIndexPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
-	void (WINAPI *glIndexd)(GLdouble c);
-	void (WINAPI *glIndexdv)(const GLdouble *c);
-	void (WINAPI *glIndexf)(GLfloat c);
-	void (WINAPI *glIndexfv)(const GLfloat *c);
-	void (WINAPI *glIndexi)(GLint c);
-	void (WINAPI *glIndexiv)(const GLint *c);
-	void (WINAPI *glIndexs)(GLshort c);
-	void (WINAPI *glIndexsv)(const GLshort *c);
-	void (WINAPI *glIndexub)(GLubyte c);
-	void (WINAPI *glIndexubv)(const GLubyte *c);
-	void (WINAPI *glInitNames)(void);
-	void (WINAPI *glInterleavedArrays)(GLenum format, GLsizei stride, const GLvoid *pointer);
-	GLboolean (WINAPI *glIsEnabled)(GLenum cap);
-	GLboolean (WINAPI *glIsList)(GLuint list);
-	GLboolean (WINAPI *glIsTexture)(GLuint texture);
-	void (WINAPI *glLightModelf)(GLenum pname, GLfloat param);
-	void (WINAPI *glLightModelfv)(GLenum pname, const GLfloat *params);
-	void (WINAPI *glLightModeli)(GLenum pname, GLint param);
-	void (WINAPI *glLightModeliv)(GLenum pname, const GLint *params);
-	void (WINAPI *glLightf)(GLenum light, GLenum pname, GLfloat param);
-	void (WINAPI *glLightfv)(GLenum light, GLenum pname, const GLfloat *params);
-	void (WINAPI *glLighti)(GLenum light, GLenum pname, GLint param);
-	void (WINAPI *glLightiv)(GLenum light, GLenum pname, const GLint *params);
-	void (WINAPI *glLineStipple)(GLint factor, GLushort pattern);
-	void (WINAPI *glLineWidth)(GLfloat width);
-	void (WINAPI *glListBase)(GLuint base);
-	void (WINAPI *glLoadIdentity)(void);
-	void (WINAPI *glLoadMatrixd)(const GLdouble *m);
-	void (WINAPI *glLoadMatrixf)(const GLfloat *m);
-	void (WINAPI *glLoadName)(GLuint name);
-	void (WINAPI *glLogicOp)(GLenum opcode);
-	void (WINAPI *glMap1d)(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points);
-	void (WINAPI *glMap1f)(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points);
-	void (WINAPI *glMap2d)(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points);
-	void (WINAPI *glMap2f)(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points);
-	void (WINAPI *glMapGrid1d)(GLint un, GLdouble u1, GLdouble u2);
-	void (WINAPI *glMapGrid1f)(GLint un, GLfloat u1, GLfloat u2);
-	void (WINAPI *glMapGrid2d)(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2);
-	void (WINAPI *glMapGrid2f)(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2);
-	void (WINAPI *glMaterialf)(GLenum face, GLenum pname, GLfloat param);
-	void (WINAPI *glMaterialfv)(GLenum face, GLenum pname, const GLfloat *params);
-	void (WINAPI *glMateriali)(GLenum face, GLenum pname, GLint param);
-	void (WINAPI *glMaterialiv)(GLenum face, GLenum pname, const GLint *params);
-	void (WINAPI *glMatrixMode)(GLenum mode);
-	void (WINAPI *glMultMatrixd)(const GLdouble *m);
-	void (WINAPI *glMultMatrixf)(const GLfloat *m);
-	void (WINAPI *glNewList)(GLuint list, GLenum mode);
-	void (WINAPI *glNormal3b)(GLbyte nx, GLbyte ny, GLbyte nz);
-	void (WINAPI *glNormal3bv)(const GLbyte *v);
-	void (WINAPI *glNormal3d)(GLdouble nx, GLdouble ny, GLdouble nz);
-	void (WINAPI *glNormal3dv)(const GLdouble *v);
-	void (WINAPI *glNormal3f)(GLfloat nx, GLfloat ny, GLfloat nz);
-	void (WINAPI *glNormal3fv)(const GLfloat *v);
-	void (WINAPI *glNormal3i)(GLint nx, GLint ny, GLint nz);
-	void (WINAPI *glNormal3iv)(const GLint *v);
-	void (WINAPI *glNormal3s)(GLshort nx, GLshort ny, GLshort nz);
-	void (WINAPI *glNormal3sv)(const GLshort *v);
-	void (WINAPI *glNormalPointer)(GLenum type, GLsizei stride, const GLvoid *pointer);
-	void (WINAPI *glOrtho)(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
-	void (WINAPI *glPassThrough)(GLfloat token);
-	void (WINAPI *glPixelMapfv)(GLenum map, GLsizei mapsize, const GLfloat *values);
-	void (WINAPI *glPixelMapuiv)(GLenum map, GLsizei mapsize, const GLuint *values);
-	void (WINAPI *glPixelMapusv)(GLenum map, GLsizei mapsize, const GLushort *values);
-	void (WINAPI *glPixelStoref)(GLenum pname, GLfloat param);
-	void (WINAPI *glPixelStorei)(GLenum pname, GLint param);
-	void (WINAPI *glPixelTransferf)(GLenum pname, GLfloat param);
-	void (WINAPI *glPixelTransferi)(GLenum pname, GLint param);
-	void (WINAPI *glPixelZoom)(GLfloat xfactor, GLfloat yfactor);
-	void (WINAPI *glPointSize)(GLfloat size);
-	void (WINAPI *glPolygonMode)(GLenum face, GLenum mode);
-	void (WINAPI *glPolygonOffset)(GLfloat factor, GLfloat units);
-	void (WINAPI *glPolygonStipple)(const GLubyte *mask);
-	void (WINAPI *glPopAttrib)(void);
-	void (WINAPI *glPopClientAttrib)(void);
-	void (WINAPI *glPopMatrix)(void);
-	void (WINAPI *glPopName)(void);
-	void (WINAPI *glPrioritizeTextures)(GLsizei n, const GLuint *textures, const GLclampf *priorities);
-	void (WINAPI *glPushAttrib)(GLbitfield mask);
-	void (WINAPI *glPushClientAttrib)(GLbitfield mask);
-	void (WINAPI *glPushMatrix)(void);
-	void (WINAPI *glPushName)(GLuint name);
-	void (WINAPI *glRasterPos2d)(GLdouble x, GLdouble y);
-	void (WINAPI *glRasterPos2dv)(const GLdouble *v);
-	void (WINAPI *glRasterPos2f)(GLfloat x, GLfloat y);
-	void (WINAPI *glRasterPos2fv)(const GLfloat *v);
-	void (WINAPI *glRasterPos2i)(GLint x, GLint y);
-	void (WINAPI *glRasterPos2iv)(const GLint *v);
-	void (WINAPI *glRasterPos2s)(GLshort x, GLshort y);
-	void (WINAPI *glRasterPos2sv)(const GLshort *v);
-	void (WINAPI *glRasterPos3d)(GLdouble x, GLdouble y, GLdouble z);
-	void (WINAPI *glRasterPos3dv)(const GLdouble *v);
-	void (WINAPI *glRasterPos3f)(GLfloat x, GLfloat y, GLfloat z);
-	void (WINAPI *glRasterPos3fv)(const GLfloat *v);
-	void (WINAPI *glRasterPos3i)(GLint x, GLint y, GLint z);
-	void (WINAPI *glRasterPos3iv)(const GLint *v);
-	void (WINAPI *glRasterPos3s)(GLshort x, GLshort y, GLshort z);
-	void (WINAPI *glRasterPos3sv)(const GLshort *v);
-	void (WINAPI *glRasterPos4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-	void (WINAPI *glRasterPos4dv)(const GLdouble *v);
-	void (WINAPI *glRasterPos4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-	void (WINAPI *glRasterPos4fv)(const GLfloat *v);
-	void (WINAPI *glRasterPos4i)(GLint x, GLint y, GLint z, GLint w);
-	void (WINAPI *glRasterPos4iv)(const GLint *v);
-	void (WINAPI *glRasterPos4s)(GLshort x, GLshort y, GLshort z, GLshort w);
-	void (WINAPI *glRasterPos4sv)(const GLshort *v);
-	void (WINAPI *glReadBuffer)(GLenum mode);
-	void (WINAPI *glReadPixels)(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels);
-	void (WINAPI *glRectd)(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2);
-	void (WINAPI *glRectdv)(const GLdouble *v1, const GLdouble *v2);
-	void (WINAPI *glRectf)(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2);
-	void (WINAPI *glRectfv)(const GLfloat *v1, const GLfloat *v2);
-	void (WINAPI *glRecti)(GLint x1, GLint y1, GLint x2, GLint y2);
-	void (WINAPI *glRectiv)(const GLint *v1, const GLint *v2);
-	void (WINAPI *glRects)(GLshort x1, GLshort y1, GLshort x2, GLshort y2);
-	void (WINAPI *glRectsv)(const GLshort *v1, const GLshort *v2);
-	GLint (WINAPI *glRenderMode)(GLenum mode);
-	void (WINAPI *glRotated)(GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
-	void (WINAPI *glRotatef)(GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
-	void (WINAPI *glScaled)(GLdouble x, GLdouble y, GLdouble z);
-	void (WINAPI *glScalef)(GLfloat x, GLfloat y, GLfloat z);
-	void (WINAPI *glScissor)(GLint x, GLint y, GLsizei width, GLsizei height);
-	void (WINAPI *glSelectBuffer)(GLsizei size, GLuint *buffer);
-	void (WINAPI *glShadeModel)(GLenum mode);
-	void (WINAPI *glStencilFunc)(GLenum func, GLint ref, GLuint mask);
-	void (WINAPI *glStencilMask)(GLuint mask);
-	void (WINAPI *glStencilOp)(GLenum fail, GLenum zfail, GLenum zpass);
-	void (WINAPI *glTexCoord1d)(GLdouble s);
-	void (WINAPI *glTexCoord1dv)(const GLdouble *v);
-	void (WINAPI *glTexCoord1f)(GLfloat s);
-	void (WINAPI *glTexCoord1fv)(const GLfloat *v);
-	void (WINAPI *glTexCoord1i)(GLint s);
-	void (WINAPI *glTexCoord1iv)(const GLint *v);
-	void (WINAPI *glTexCoord1s)(GLshort s);
-	void (WINAPI *glTexCoord1sv)(const GLshort *v);
-	void (WINAPI *glTexCoord2d)(GLdouble s, GLdouble t);
-	void (WINAPI *glTexCoord2dv)(const GLdouble *v);
-	void (WINAPI *glTexCoord2f)(GLfloat s, GLfloat t);
-	void (WINAPI *glTexCoord2fv)(const GLfloat *v);
-	void (WINAPI *glTexCoord2i)(GLint s, GLint t);
-	void (WINAPI *glTexCoord2iv)(const GLint *v);
-	void (WINAPI *glTexCoord2s)(GLshort s, GLshort t);
-	void (WINAPI *glTexCoord2sv)(const GLshort *v);
-	void (WINAPI *glTexCoord3d)(GLdouble s, GLdouble t, GLdouble r);
-	void (WINAPI *glTexCoord3dv)(const GLdouble *v);
-	void (WINAPI *glTexCoord3f)(GLfloat s, GLfloat t, GLfloat r);
-	void (WINAPI *glTexCoord3fv)(const GLfloat *v);
-	void (WINAPI *glTexCoord3i)(GLint s, GLint t, GLint r);
-	void (WINAPI *glTexCoord3iv)(const GLint *v);
-	void (WINAPI *glTexCoord3s)(GLshort s, GLshort t, GLshort r);
-	void (WINAPI *glTexCoord3sv)(const GLshort *v);
-	void (WINAPI *glTexCoord4d)(GLdouble s, GLdouble t, GLdouble r, GLdouble q);
-	void (WINAPI *glTexCoord4dv)(const GLdouble *v);
-	void (WINAPI *glTexCoord4f)(GLfloat s, GLfloat t, GLfloat r, GLfloat q);
-	void (WINAPI *glTexCoord4fv)(const GLfloat *v);
-	void (WINAPI *glTexCoord4i)(GLint s, GLint t, GLint r, GLint q);
-	void (WINAPI *glTexCoord4iv)(const GLint *v);
-	void (WINAPI *glTexCoord4s)(GLshort s, GLshort t, GLshort r, GLshort q);
-	void (WINAPI *glTexCoord4sv)(const GLshort *v);
-	void (WINAPI *glTexCoordPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-	void (WINAPI *glTexEnvf)(GLenum target, GLenum pname, GLfloat param);
-	void (WINAPI *glTexEnvfv)(GLenum target, GLenum pname, const GLfloat *params);
-	void (WINAPI *glTexEnvi)(GLenum target, GLenum pname, GLint param);
-	void (WINAPI *glTexEnviv)(GLenum target, GLenum pname, const GLint *params);
-	void (WINAPI *glTexGend)(GLenum coord, GLenum pname, GLdouble param);
-	void (WINAPI *glTexGendv)(GLenum coord, GLenum pname, const GLdouble *params);
-	void (WINAPI *glTexGenf)(GLenum coord, GLenum pname, GLfloat param);
-	void (WINAPI *glTexGenfv)(GLenum coord, GLenum pname, const GLfloat *params);
-	void (WINAPI *glTexGeni)(GLenum coord, GLenum pname, GLint param);
-	void (WINAPI *glTexGeniv)(GLenum coord, GLenum pname, const GLint *params);
-	void (WINAPI *glTexImage1D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-	void (WINAPI *glTexImage2D)(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
-	void (WINAPI *glTexParameterf)(GLenum target, GLenum pname, GLfloat param);
-	void (WINAPI *glTexParameterfv)(GLenum target, GLenum pname, const GLfloat *params);
-	void (WINAPI *glTexParameteri)(GLenum target, GLenum pname, GLint param);
-	void (WINAPI *glTexParameteriv)(GLenum target, GLenum pname, const GLint *params);
-	void (WINAPI *glTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels);
-	void (WINAPI *glTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels);
-	void (WINAPI *glTranslated)(GLdouble x, GLdouble y, GLdouble z);
-	void (WINAPI *glTranslatef)(GLfloat x, GLfloat y, GLfloat z);
-	void (WINAPI *glVertex2d)(GLdouble x, GLdouble y);
-	void (WINAPI *glVertex2dv)(const GLdouble *v);
-	void (WINAPI *glVertex2f)(GLfloat x, GLfloat y);
-	void (WINAPI *glVertex2fv)(const GLfloat *v);
-	void (WINAPI *glVertex2i)(GLint x, GLint y);
-	void (WINAPI *glVertex2iv)(const GLint *v);
-	void (WINAPI *glVertex2s)(GLshort x, GLshort y);
-	void (WINAPI *glVertex2sv)(const GLshort *v);
-	void (WINAPI *glVertex3d)(GLdouble x, GLdouble y, GLdouble z);
-	void (WINAPI *glVertex3dv)(const GLdouble *v);
-	void (WINAPI *glVertex3f)(GLfloat x, GLfloat y, GLfloat z);
-	void (WINAPI *glVertex3fv)(const GLfloat *v);
-	void (WINAPI *glVertex3i)(GLint x, GLint y, GLint z);
-	void (WINAPI *glVertex3iv)(const GLint *v);
-	void (WINAPI *glVertex3s)(GLshort x, GLshort y, GLshort z);
-	void (WINAPI *glVertex3sv)(const GLshort *v);
-	void (WINAPI *glVertex4d)(GLdouble x, GLdouble y, GLdouble z, GLdouble w);
-	void (WINAPI *glVertex4dv)(const GLdouble *v);
-	void (WINAPI *glVertex4f)(GLfloat x, GLfloat y, GLfloat z, GLfloat w);
-	void (WINAPI *glVertex4fv)(const GLfloat *v);
-	void (WINAPI *glVertex4i)(GLint x, GLint y, GLint z, GLint w);
-	void (WINAPI *glVertex4iv)(const GLint *v);
-	void (WINAPI *glVertex4s)(GLshort x, GLshort y, GLshort z, GLshort w);
-	void (WINAPI *glVertex4sv)(const GLshort *v);
-	void (WINAPI *glVertexPointer)(GLint size, GLenum type, GLsizei stride, const GLvoid *pointer);
-	void (WINAPI *glViewport)(GLint x, GLint y, GLsizei width, GLsizei height);
-
-	BOOL  (WINAPI *wglCopyContext)(HGLRC, HGLRC, UINT);
-	HGLRC (WINAPI *wglCreateContext)(HDC);
-	HGLRC (WINAPI *wglCreateLayerContext)(HDC, int);
-	BOOL  (WINAPI *wglDeleteContext)(HGLRC);
-	HGLRC (WINAPI *wglGetCurrentContext)(VOID);
-	HDC   (WINAPI *wglGetCurrentDC)(VOID);
-	PROC  (WINAPI *wglGetProcAddress)(LPCSTR);
-	BOOL  (WINAPI *wglMakeCurrent)(HDC, HGLRC);
-	BOOL  (WINAPI *wglShareLists)(HGLRC, HGLRC);
-
-	int f_0564;
-
-	int glActiveTextureARB;
-	int glClientActiveTextureARB;
-	int glMultiTexCoord4fARB;
-	int glMultiTexCoord2fvARB;
-	int glBlendColor;
-	int f_057C;
-	int f_0580;
-	int f_0584;
-	int f_0588;
-	int glCompressedTexImaged3DARB;
-	int glCompressedTexImaged2DARB;
-	int glCompressedTexImage1DARB;
-	int glCompressedTexSubImage3DARB;
-	int glCompressedTexSubImage2DARB;
-	int glCompressedTexSubImage1DARB;
-	int glCompressedTexImageARB;
-
-	GLboolean (WINAPI *wglSwapIntervalEXT)(GLint interval);
-
-	GLint (WINAPI *wglSetDeviceGammaRamp3DFX)(HDC, GLvoid *);
-	GLint (WINAPI *wglGetDeviceGammaRamp3DFX)(HDC, GLvoid *);
-} gl_api_t;
-
-
-
-
-#endif
Index: Daodan/src/oni_stdio.h
===================================================================
--- Daodan/src/oni_stdio.h	(revision 691)
+++ 	(revision )
@@ -1,11 +1,0 @@
-#pragma once
-#ifndef ONI_STDIO_H
-#define ONI_STDIO_H
-
-#include <stdio.h>
-/*
-FILE* __cdecl oni_fopen(const char*, const char*);
-int   __cdecl oni_fprintf(FILE*, const char*, ...);
-int   __cdecl oni_fflush(FILE*);
-*/
-#endif
Index: Daodan/src/stdint.h
===================================================================
--- Daodan/src/stdint.h	(revision 692)
+++ Daodan/src/stdint.h	(revision 692)
@@ -0,0 +1,210 @@
+#define bool int
+#define false 0
+#define true 1
+
+/* ISO C9x  7.18  Integer types <stdint.h>
+ * Based on ISO/IEC SC22/WG14 9899 Committee draft (SC22 N2794)
+ *
+ *  THIS SOFTWARE IS NOT COPYRIGHTED
+ *
+ *  Contributor: Danny Smith <danny_r_smith_2001@yahoo.co.nz>
+ *
+ *  This source code is offered for use in the public domain. You may
+ *  use, modify or distribute it freely.
+ *
+ *  This code is distributed in the hope that it will be useful but
+ *  WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
+ *  DISCLAIMED. This includes but is not limited to warranties of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ *  Date: 2000-12-02
+ */
+
+
+#ifndef _STDINT_H
+#define _STDINT_H
+#define __need_wint_t
+#define __need_wchar_t
+#include <stddef.h>
+
+/* 7.18.1.1  Exact-width integer types */
+typedef signed char int8_t;
+typedef unsigned char   uint8_t;
+typedef short  int16_t;
+typedef unsigned short  uint16_t;
+typedef int  int32_t;
+typedef unsigned   uint32_t;
+typedef long long  int64_t;
+typedef unsigned long long   uint64_t;
+
+/* 7.18.1.2  Minimum-width integer types */
+typedef signed char int_least8_t;
+typedef unsigned char   uint_least8_t;
+typedef short  int_least16_t;
+typedef unsigned short  uint_least16_t;
+typedef int  int_least32_t;
+typedef unsigned   uint_least32_t;
+typedef long long  int_least64_t;
+typedef unsigned long long   uint_least64_t;
+
+/*  7.18.1.3  Fastest minimum-width integer types 
+ *  Not actually guaranteed to be fastest for all purposes
+ *  Here we use the exact-width types for 8 and 16-bit ints. 
+ */
+typedef char int_fast8_t;
+typedef unsigned char uint_fast8_t;
+typedef short  int_fast16_t;
+typedef unsigned short  uint_fast16_t;
+typedef int  int_fast32_t;
+typedef unsigned  int  uint_fast32_t;
+typedef long long  int_fast64_t;
+typedef unsigned long long   uint_fast64_t;
+
+/* 7.18.1.4  Integer types capable of holding object pointers */
+
+#ifndef _INTPTR_T_DEFINED
+#define _INTPTR_T_DEFINED
+#ifdef _WIN64
+  typedef __int64 intptr_t;
+#else
+  typedef int intptr_t;
+#endif
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#define _UINTPTR_T_DEFINED
+#ifdef _WIN64
+  typedef unsigned __int64 uintptr_t;
+#else
+  typedef unsigned int uintptr_t;
+#endif
+#endif
+
+/* 7.18.1.5  Greatest-width integer types */
+typedef long long  intmax_t;
+typedef unsigned long long uintmax_t;
+
+/* 7.18.2  Limits of specified-width integer types */
+#if !defined ( __cplusplus) || defined (__STDC_LIMIT_MACROS)
+
+/* 7.18.2.1  Limits of exact-width integer types */
+#define INT8_MIN (-128) 
+#define INT16_MIN (-32768)
+#define INT32_MIN (-2147483647 - 1)
+#define INT64_MIN  (-9223372036854775807LL - 1)
+
+#define INT8_MAX 127
+#define INT16_MAX 32767
+#define INT32_MAX 2147483647
+#define INT64_MAX 9223372036854775807LL
+
+#define UINT8_MAX 0xff /* 255U */
+#define UINT16_MAX 0xffff /* 65535U */
+#define UINT32_MAX 0xffffffff  /* 4294967295U */
+#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
+
+/* 7.18.2.2  Limits of minimum-width integer types */
+#define INT_LEAST8_MIN INT8_MIN
+#define INT_LEAST16_MIN INT16_MIN
+#define INT_LEAST32_MIN INT32_MIN
+#define INT_LEAST64_MIN INT64_MIN
+
+#define INT_LEAST8_MAX INT8_MAX
+#define INT_LEAST16_MAX INT16_MAX
+#define INT_LEAST32_MAX INT32_MAX
+#define INT_LEAST64_MAX INT64_MAX
+
+#define UINT_LEAST8_MAX UINT8_MAX
+#define UINT_LEAST16_MAX UINT16_MAX
+#define UINT_LEAST32_MAX UINT32_MAX
+#define UINT_LEAST64_MAX UINT64_MAX
+
+/* 7.18.2.3  Limits of fastest minimum-width integer types */
+#define INT_FAST8_MIN INT8_MIN
+#define INT_FAST16_MIN INT16_MIN
+#define INT_FAST32_MIN INT32_MIN
+#define INT_FAST64_MIN INT64_MIN
+
+#define INT_FAST8_MAX INT8_MAX
+#define INT_FAST16_MAX INT16_MAX
+#define INT_FAST32_MAX INT32_MAX
+#define INT_FAST64_MAX INT64_MAX
+
+#define UINT_FAST8_MAX UINT8_MAX
+#define UINT_FAST16_MAX UINT16_MAX
+#define UINT_FAST32_MAX UINT32_MAX
+#define UINT_FAST64_MAX UINT64_MAX
+
+/* 7.18.2.4  Limits of integer types capable of holding
+    object pointers */
+#ifdef _WIN64
+#define INTPTR_MIN INT64_MIN
+#define INTPTR_MAX INT64_MAX
+#define UINTPTR_MAX UINT64_MAX
+#else
+#define INTPTR_MIN INT32_MIN
+#define INTPTR_MAX INT32_MAX
+#define UINTPTR_MAX UINT32_MAX
+#endif
+
+/* 7.18.2.5  Limits of greatest-width integer types */
+#define INTMAX_MIN INT64_MIN
+#define INTMAX_MAX INT64_MAX
+#define UINTMAX_MAX UINT64_MAX
+
+/* 7.18.3  Limits of other integer types */
+#define PTRDIFF_MIN INTPTR_MIN
+#define PTRDIFF_MAX INTPTR_MAX
+
+#define SIG_ATOMIC_MIN INTPTR_MIN
+#define SIG_ATOMIC_MAX INTPTR_MAX
+
+//#define SIZE_MAX UINTPTR_MAX
+
+#ifndef WCHAR_MIN  /* also in wchar.h */ 
+#define WCHAR_MIN 0
+#define WCHAR_MAX 0xffff /* UINT16_MAX */
+#endif
+
+/*
+ * wint_t is unsigned short for compatibility with MS runtime
+ */
+#define WINT_MIN 0
+#define WINT_MAX 0xffff /* UINT16_MAX */
+
+#endif /* !defined ( __cplusplus) || defined __STDC_LIMIT_MACROS */
+
+
+/* 7.18.4  Macros for integer constants */
+#if !defined ( __cplusplus) || defined (__STDC_CONSTANT_MACROS)
+
+/* 7.18.4.1  Macros for minimum-width integer constants
+
+    Accoding to Douglas Gwyn <gwyn@arl.mil>:
+	"This spec was changed in ISO/IEC 9899:1999 TC1; in ISO/IEC
+	9899:1999 as initially published, the expansion was required
+	to be an integer constant of precisely matching type, which
+	is impossible to accomplish for the shorter types on most
+	platforms, because C99 provides no standard way to designate
+	an integer constant with width less than that of type int.
+	TC1 changed this to require just an integer constant
+	*expression* with *promoted* type."
+*/
+
+#define INT8_C(val) ((int8_t) + (val))
+#define UINT8_C(val) ((uint8_t) + (val##U))
+#define INT16_C(val) ((int16_t) + (val))
+#define UINT16_C(val) ((uint16_t) + (val##U))
+
+#define INT32_C(val) val##L
+#define UINT32_C(val) val##UL
+#define INT64_C(val) val##LL
+#define UINT64_C(val) val##ULL
+
+/* 7.18.4.2  Macros for greatest-width integer constants */
+#define INTMAX_C(val)  INT64_C(val)
+#define UINTMAX_C(val) UINT64_C(val)
+
+#endif  /* !defined ( __cplusplus) || defined __STDC_CONSTANT_MACROS */
+
+#endif
