Yay, kittens! Also some license cleanup, IO thread usage, more SDL wrapping and ability to run reveal from DFHack console.

develop
Petr Mrázek 2011-06-16 23:53:39 +02:00
parent 7136ac7aa4
commit 93be1eb1fb
56 changed files with 809 additions and 249 deletions

@ -58,10 +58,6 @@ SET( DFHACK_INSTALL ${DFHACK_INST_DEFAULT} CACHE STRING
'linux' for generic packaging and system installs on linux (linux default) 'linux' for generic packaging and system installs on linux (linux default)
'ubuntu-10.10' for ubuntu maverick package.") 'ubuntu-10.10' for ubuntu maverick package.")
SET( MEMXML_DATA_PATH . CACHE PATH
"Path to a valid Memory.xml file.
This is baked into the library, so when you package DFHack for linux, set it to the right path.")
IF(${DFHACK_INSTALL} STREQUAL "portable") IF(${DFHACK_INSTALL} STREQUAL "portable")
# the dfhack libraries will be installed here: # the dfhack libraries will be installed here:
SET(DFHACK_LIBRARY_DESTINATION .) SET(DFHACK_LIBRARY_DESTINATION .)

@ -805,7 +805,7 @@
<Address name="current_cursor_creature" description="A vector? of creatures currently under the cursor."/> <Address name="current_cursor_creature" description="A vector? of creatures currently under the cursor."/>
<Address name="current_menu_state" description="A numeric value that describes the state of the current GUI element (switching between menus will change this)."/> <Address name="current_menu_state" description="A numeric value that describes the state of the current GUI element (switching between menus will change this)."/>
<Address name="view_screen" description="Pointer to the current view screen object (GUI screen)."/> <Address name="view_screen" description="Pointer to the current view screen object (GUI screen)."/>
<Address name="hotkeys" description="Address where the array of hotkeys starts."> <Address name="hotkeys" description="Address where the array of hotkeys starts." />
</Group> </Group>
<Group name="Maps" description="Offsets used by the Maps module."> <Group name="Maps" description="Offsets used by the Maps module.">
<Address name="map_data" description="Pointer to the start of the map structure."/> <Address name="map_data" description="Pointer to the start of the map structure."/>
@ -1129,7 +1129,7 @@
<Address name="current_cursor_creature" value="0xae82cc" valid="false" /> <Address name="current_cursor_creature" value="0xae82cc" valid="false" />
<Address name="current_menu_state" value="0x017f6f38" /> <Address name="current_menu_state" value="0x017f6f38" />
<Address name="view_screen" value="0xae82cc" valid="false" /> <Address name="view_screen" value="0xae82cc" valid="false" />
<Address name="hotkeys" value="0x01476ecc"> <Address name="hotkeys" value="0x01476ecc" />
</Group> </Group>
<Group name="Maps"> <Group name="Maps">
<Address name="map_data" value="0x016AD718" /> <Address name="map_data" value="0x016AD718" />
@ -2236,7 +2236,7 @@
<PETimeStamp value="0x4D90764F" /> <PETimeStamp value="0x4D90764F" />
<MD5 value="6ada05fc94785b53efe6aa5728b3756b" /> <MD5 value="6ada05fc94785b53efe6aa5728b3756b" />
<Offsets> <Offsets>
<Group name="Gui"> <Group name="GUI">
<Address name="hotkeys" value="0x14f5cc8" /> <Address name="hotkeys" value="0x14f5cc8" />
</Group> </Group>
<Group name="Creatures"> <Group name="Creatures">
@ -3017,7 +3017,7 @@
<MD5 value="fc15065c4d1977ca019c6dad220413d1" /> <MD5 value="fc15065c4d1977ca019c6dad220413d1" />
<Offsets> <Offsets>
WORLD: 0x93f77a0 WORLD: 0x93f77a0
<Group name="Gui"> <Group name="GUI">
<Address name="hotkeys" value="0x93f740c" /> <Address name="hotkeys" value="0x93f740c" />
</Group> </Group>
<Group name="Creatures"> <Group name="Creatures">

@ -112,12 +112,6 @@ SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE )
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS}) LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})
# Are we 64bit? (Damn you, ptrace()!)
IF( CMAKE_SIZEOF_VOID_P MATCHES 8 )
ADD_DEFINITIONS(-DHAVE_64_BIT)
ENDIF()
ADD_DEFINITIONS(-DMEMXML_DATA_PATH="${MEMXML_DATA_PATH}")
ADD_DEFINITIONS(-DBUILD_DFHACK_LIB) ADD_DEFINITIONS(-DBUILD_DFHACK_LIB)
IF(UNIX) IF(UNIX)
@ -159,7 +153,7 @@ if(BUILD_DFHACK_DEVEL)
install(TARGETS dfhack install(TARGETS dfhack
ARCHIVE DESTINATION ${DFHACK_DEVLIB_DESTINATION}) ARCHIVE DESTINATION ${DFHACK_DEVLIB_DESTINATION})
endif() endif()
# note the ending '/'. This means *constents* of the directory are installed # note the ending '/'. This means *contents* of the directory are installed
# without the '/', the directory itself is installed # without the '/', the directory itself is installed
install(DIRECTORY include/ install(DIRECTORY include/
DESTINATION ${DFHACK_INCLUDES_DESTINATION} DESTINATION ${DFHACK_INCLUDES_DESTINATION}

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2011 Petr Mrázek (peterix) Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include <stdio.h> #include <stdio.h>
#include <dlfcn.h> #include <dlfcn.h>
#include <stdint.h> #include <stdint.h>
@ -39,13 +40,15 @@ distribution.
#include "DFHack.h" #include "DFHack.h"
#include "dfhack/Core.h" #include "dfhack/Core.h"
#include "dfhack/FakeSDL.h"
#include <iostream> #include <iostream>
#define DFhackCExport extern "C" __attribute__ ((visibility("default")))
/******************************************************************************* /*******************************************************************************
* SDL part starts here * * SDL part starts here *
*******************************************************************************/ *******************************************************************************/
bool FirstCall(void);
bool inited = false;
DFhackCExport int SDL_NumJoysticks(void) DFhackCExport int SDL_NumJoysticks(void)
{ {
DFHack::Core & c = DFHack::Core::getInstance(); DFHack::Core & c = DFHack::Core::getInstance();
@ -56,6 +59,7 @@ DFhackCExport int SDL_NumJoysticks(void)
//static void (*_SDL_GL_SwapBuffers)(void) = 0; //static void (*_SDL_GL_SwapBuffers)(void) = 0;
static void (*_SDL_Quit)(void) = 0; static void (*_SDL_Quit)(void) = 0;
static int (*_SDL_Init)(uint32_t flags) = 0; static int (*_SDL_Init)(uint32_t flags) = 0;
static DFThread * (*_SDL_CreateThread)(int (*fn)(void *), void *data) = 0;
//static int (*_SDL_Flip)(void * some_ptr) = 0; //static int (*_SDL_Flip)(void * some_ptr) = 0;
/* /*
// hook - called every tick in OpenGL mode of DF // hook - called every tick in OpenGL mode of DF
@ -89,6 +93,30 @@ DFhackCExport int SDL_Flip(void * some_ptr)
} }
*/ */
static DFMutex * (*_SDL_CreateMutex)(void) = 0;
DFhackCExport DFMutex * SDL_CreateMutex(void)
{
return _SDL_CreateMutex();
}
static int (*_SDL_mutexP)(DFMutex * mutex) = 0;
DFhackCExport int SDL_mutexP(DFMutex * mutex)
{
return _SDL_mutexP(mutex);
}
static int (*_SDL_mutexV)(DFMutex * mutex) = 0;
DFhackCExport int SDL_mutexV(DFMutex * mutex)
{
return _SDL_mutexV(mutex);
}
static void (*_SDL_DestroyMutex)(DFMutex * mutex) = 0;
DFhackCExport void SDL_DestroyMutex(DFMutex * mutex)
{
_SDL_DestroyMutex(mutex);
}
// hook - called at program exit // hook - called at program exit
DFhackCExport void SDL_Quit(void) DFhackCExport void SDL_Quit(void)
{ {
@ -108,9 +136,14 @@ DFhackCExport int SDL_Init(uint32_t flags)
_SDL_Init = (int (*)( uint32_t )) dlsym(RTLD_NEXT, "SDL_Init"); _SDL_Init = (int (*)( uint32_t )) dlsym(RTLD_NEXT, "SDL_Init");
//_SDL_Flip = (int (*)( void * )) dlsym(RTLD_NEXT, "SDL_Flip"); //_SDL_Flip = (int (*)( void * )) dlsym(RTLD_NEXT, "SDL_Flip");
_SDL_Quit = (void (*)( void )) dlsym(RTLD_NEXT, "SDL_Quit"); _SDL_Quit = (void (*)( void )) dlsym(RTLD_NEXT, "SDL_Quit");
_SDL_CreateThread = (DFThread* (*)(int (*fn)(void *), void *data))dlsym(RTLD_NEXT, "SDL_CreateThread");
_SDL_CreateMutex = (DFMutex*(*)())dlsym(RTLD_NEXT,"SDL_CreateMutex");
_SDL_DestroyMutex = (void (*)(DFMutex*))dlsym(RTLD_NEXT,"SDL_DestroyMutex");
_SDL_mutexP = (int (*)(DFMutex*))dlsym(RTLD_NEXT,"SDL_mutexP");
_SDL_mutexV = (int (*)(DFMutex*))dlsym(RTLD_NEXT,"SDL_mutexV");
// check if we got them // check if we got them
if(/*_SDL_GL_SwapBuffers &&*/ _SDL_Init && _SDL_Quit) if(_SDL_Init && _SDL_Quit && _SDL_CreateThread && _SDL_CreateMutex && _SDL_DestroyMutex && _SDL_mutexP && _SDL_mutexV)
{ {
fprintf(stderr,"dfhack: hooking successful\n"); fprintf(stderr,"dfhack: hooking successful\n");
} }
@ -122,57 +155,3 @@ DFhackCExport int SDL_Init(uint32_t flags)
} }
return _SDL_Init(flags); return _SDL_Init(flags);
} }
/*******************************************************************************
* NCURSES part starts here *
*******************************************************************************/
/*
static int (*_refresh)(void) = 0;
DFhackCExport int refresh (void)
{
if(_refresh)
{
return _refresh();
}
return 0;
}
static int (*_endwin)(void) = 0;
DFhackCExport int endwin (void)
{
if(!errorstate)
{
HOOK_Shutdown();
errorstate = true;
}
if(_endwin)
{
return _endwin();
}
return 0;
}
typedef void WINDOW;
static WINDOW * (*_initscr)(void) = 0;
DFhackCExport WINDOW * initscr (void)
{
// find real functions
//_refresh = (int (*)( void )) dlsym(RTLD_NEXT, "refresh");
_endwin = (int (*)( void )) dlsym(RTLD_NEXT, "endwin");
_initscr = (WINDOW * (*)( void )) dlsym(RTLD_NEXT, "initscr");
// check if we got them
if(_refresh && _endwin && _initscr)
{
fprintf(stderr,"dfhack: hooking successful\n");
}
else
{
// bail, this would be a disaster otherwise
fprintf(stderr,"dfhack: something went horribly wrong\n");
exit(1);
}
//SHM_Init();
return _initscr();
}
*/

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix) Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
/** /**
* This is the source for the DF <-> dfhack shm bridge, * This is the source for the DF <-> dfhack shm bridge,
* to be used with SDL 1.2 and DF 40d16. Windows sucks * to be used with SDL 1.2 and DF 40d16. Windows sucks
@ -110,6 +111,7 @@ void RedirectIOToConsole()
#include <vector> #include <vector>
#include <string> #include <string>
#include "dfhack/Core.h" #include "dfhack/Core.h"
#include "dfhack/FakeSDL.h"
#include <stdio.h> #include <stdio.h>
/*************************************************************************/ /*************************************************************************/
@ -120,10 +122,6 @@ void RedirectIOToConsole()
bool FirstCall(void); bool FirstCall(void);
bool inited = false; bool inited = false;
// function and variable pointer... we don't try to understand what SDL does here
typedef void * fPtr;
typedef void * vPtr;
/// wrappers for SDL 1.2 functions used in 40d16 /// wrappers for SDL 1.2 functions used in 40d16
/***** Condition variables /***** Condition variables
@ -181,6 +179,12 @@ DFhackCExport int SDL_mutexP(vPtr mutex)
return _SDL_mutexP(mutex); return _SDL_mutexP(mutex);
} }
static int (*_SDL_mutexV)(vPtr mutex) = 0;
DFhackCExport int SDL_mutexV(vPtr mutex)
{
return _SDL_mutexV(mutex);
}
static void (*_SDL_DestroyMutex)(vPtr mutex) = 0; static void (*_SDL_DestroyMutex)(vPtr mutex) = 0;
DFhackCExport void SDL_DestroyMutex(vPtr mutex) DFhackCExport void SDL_DestroyMutex(vPtr mutex)
{ {
@ -793,6 +797,7 @@ bool FirstCall()
_SDL_WM_SetCaption = (void (*)(const char*, const char*))GetProcAddress(realSDLlib,"SDL_WM_SetCaption"); _SDL_WM_SetCaption = (void (*)(const char*, const char*))GetProcAddress(realSDLlib,"SDL_WM_SetCaption");
_SDL_WM_SetIcon = (void (*)(void*, uint8_t*))GetProcAddress(realSDLlib,"SDL_WM_SetIcon"); _SDL_WM_SetIcon = (void (*)(void*, uint8_t*))GetProcAddress(realSDLlib,"SDL_WM_SetIcon");
_SDL_mutexP = (int (*)(void*))GetProcAddress(realSDLlib,"SDL_mutexP"); _SDL_mutexP = (int (*)(void*))GetProcAddress(realSDLlib,"SDL_mutexP");
_SDL_mutexV = (int (*)(void*))GetProcAddress(realSDLlib,"SDL_mutexV");
_SDL_strlcpy = (size_t (*)(char*, const char*, size_t))GetProcAddress(realSDLlib,"SDL_strlcpy"); _SDL_strlcpy = (size_t (*)(char*, const char*, size_t))GetProcAddress(realSDLlib,"SDL_strlcpy");
// stuff for SDL_Image // stuff for SDL_Image

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include "Internal.h" #include "Internal.h"
#include "PlatformInternal.h" #include "PlatformInternal.h"
@ -17,11 +41,122 @@ using namespace std;
#include "dfhack/modules/Gui.h" #include "dfhack/modules/Gui.h"
#include "dfhack/modules/Vegetation.h" #include "dfhack/modules/Vegetation.h"
#include "dfhack/modules/Maps.h" #include "dfhack/modules/Maps.h"
#include <dfhack/modules/World.h>
using namespace DFHack; using namespace DFHack;
DFHack::Gui * gui = 0; struct hideblock
DFHack::Maps * maps = 0; {
DFHack::Vegetation * veg = 0; uint32_t x;
uint32_t y;
uint32_t z;
uint8_t hiddens [16][16];
};
int reveal (void)
{
Core & c = DFHack::Core::getInstance();
Context * DF = c.getContext();
c.Suspend();
DFHack::Maps *Maps =DF->getMaps();
DFHack::World *World =DF->getWorld();
// init the map
if(!Maps->Start())
{
cerr << "Can't init map." << endl;
c.Resume();
return 1;
}
cout << "Revealing, please wait..." << endl;
uint32_t x_max, y_max, z_max;
DFHack::designations40d designations;
Maps->getSize(x_max,y_max,z_max);
vector <hideblock> hidesaved;
for(uint32_t x = 0; x< x_max;x++)
{
for(uint32_t y = 0; y< y_max;y++)
{
for(uint32_t z = 0; z< z_max;z++)
{
if(Maps->isValidBlock(x,y,z))
{
hideblock hb;
hb.x = x;
hb.y = y;
hb.z = z;
// read block designations
Maps->ReadDesignations(x,y,z, &designations);
// change the hidden flag to 0
for (uint32_t i = 0; i < 16;i++) for (uint32_t j = 0; j < 16;j++)
{
hb.hiddens[i][j] = designations[i][j].bits.hidden;
designations[i][j].bits.hidden = 0;
}
hidesaved.push_back(hb);
// write the designations back
Maps->WriteDesignations(x,y,z, &designations);
}
}
}
}
World->SetPauseState(true);
c.Resume();
cout << "Map revealed. The game has been paused for you." << endl;
cout << "Unpausing can unleash the forces of hell!" << endl << endl;
cout << "Press any key to unreveal." << endl;
cout << "Close to keep the map revealed !!FOREVER!!" << endl;
cin.ignore();
cout << "Unrevealing... please wait." << endl;
// FIXME: do some consistency checks here!
c.Suspend();
Maps = DF->getMaps();
Maps->Start();
for(size_t i = 0; i < hidesaved.size();i++)
{
hideblock & hb = hidesaved[i];
Maps->ReadDesignations(hb.x,hb.y,hb.z, &designations);
for (uint32_t i = 0; i < 16;i++) for (uint32_t j = 0; j < 16;j++)
{
designations[i][j].bits.hidden = hb.hiddens[i][j];
}
Maps->WriteDesignations(hb.x,hb.y,hb.z, &designations);
}
c.Resume();
return 0;
}
int fIOthread(void * _core)
{
Core * core = (Core *) _core;
cout << "Hello from the IO thread. Have a nice day!" << endl;
while (true)
{
string command = "";
cout <<"[DFHack]# ";
getline(cin, command);
if (std::cin.eof())
{
command = "q";
std::cout << std::endl; // No newline from the user here!
}
if(command=="help" || command == "?")
{
cout << "It's simple really. You can run reveal with 'reveal'." << endl;
}
else if(command == "reveal")
{
reveal();
}
else
{
cout << "WHAT?" << endl;
}
}
}
Core::Core() Core::Core()
{ {
@ -31,80 +166,43 @@ Core::Core()
{ {
std::cerr << "Couldn't identify this version of DF." << std::endl; std::cerr << "Couldn't identify this version of DF." << std::endl;
errorstate = true; errorstate = true;
return;
} }
c = new DFHack::Context(p); c = new DFHack::Context(p);
AccessMutex = SDL_CreateMutex();
if(!AccessMutex)
{
std::cerr << "Mutex creation failed." << std::endl;
errorstate = true;
return;
}
errorstate = false; errorstate = false;
// bullcrud, push it back to a tool // lock mutex
gui = c->getGui(); SDL_mutexP(AccessMutex);
gui->Start(); // create IO thread
veg = c->getVegetation(); DFThread * IO = SDL_CreateThread(fIOthread, 0);
veg->Start(); // and let DF do its thing.
maps = c->getMaps();
maps->Start();
}; };
// more bullcrud void Core::Suspend()
int32_t x = 0,y = 0,z = 0;
int32_t xo = 0,yo = 0,zo = 0;
void print_tree( DFHack::df_plant & tree)
{ {
//DFHack::Materials * mat = DF->getMaterials(); SDL_mutexP(AccessMutex);
printf("%d:%d = ",tree.type,tree.material); }
if(tree.watery)
{ void Core::Resume()
std::cout << "near-water "; {
} SDL_mutexV(AccessMutex);
//std::cout << mat->organic[tree.material].id << " ";
if(!tree.is_shrub)
{
std::cout << "tree";
}
else
{
std::cout << "shrub";
}
std::cout << std::endl;
printf("Grow counter: 0x%08x\n", tree.grow_counter);
printf("temperature 1: %d\n", tree.temperature_1);
printf("temperature 2: %d\n", tree.temperature_2);
printf("On fire: %d\n", tree.is_burning);
printf("hitpoints: 0x%08x\n", tree.hitpoints);
printf("update order: %d\n", tree.update_order);
printf("Address: 0x%x\n", &tree);
//hexdump(DF,tree.address,13*16);
} }
int Core::Update() int Core::Update()
{ {
if(errorstate) if(errorstate)
return -1; return -1;
// And more bullcrud. Predictable! // do persistent stuff here
maps->Start(); SDL_mutexV(AccessMutex);
gui->getCursorCoords(x,y,z); // other threads can claim the mutex here and use DFHack.
if(x != xo || y!= yo || z != zo) // NO CODE SHOULD EVER BE PLACED HERE
{ SDL_mutexP(AccessMutex);
xo = x;
yo = y;
zo = z;
std::cout << "Cursor: " << x << "/" << y << "/" << z << std::endl;
if(x != -30000)
{
std::vector <DFHack::df_plant *> * vec;
if(maps->ReadVegetation(x/16,y/16,z,vec))
{
for(size_t i = 0; i < vec->size();i++)
{
DFHack::df_plant * p = vec->at(i);
if(p->x == x && p->y == y && p->z == z)
{
print_tree(*p);
}
}
}
else
std::cout << "No veg vector..." << std::endl;
}
}
return 0; return 0;
}; };

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2011 Petr Mrázek (peterix) Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -21,6 +21,7 @@ must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source 3. This notice may not be removed or altered from any source
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include "PlatformInternal.h" #include "PlatformInternal.h"

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -21,6 +21,7 @@ must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source 3. This notice may not be removed or altered from any source
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include "PlatformInternal.h" #include "PlatformInternal.h"
#include <cstring> #include <cstring>

@ -1,4 +1,27 @@
// vim: sts=4 sta et shiftwidth=4: /*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#include "Internal.h" #include "Internal.h"
#include "dfhack/TileTypes.h" #include "dfhack/TileTypes.h"
#include "dfhack/Export.h" #include "dfhack/Export.h"

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#ifndef DFHACK_API_H #ifndef DFHACK_API_H
#define DFHACK_API_H #define DFHACK_API_H

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#pragma once #pragma once
#ifndef CONTEXT_H_INCLUDED #ifndef CONTEXT_H_INCLUDED

@ -1,7 +1,32 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#include "dfhack/Pragma.h" #include "dfhack/Pragma.h"
#include "dfhack/Export.h" #include "dfhack/Export.h"
#include "dfhack/FakeSDL.h"
namespace DFHack namespace DFHack
{ {
class VersionInfoFactory; class VersionInfoFactory;
@ -12,6 +37,8 @@ namespace DFHack
// Better than tracking some weird variables all over the place. // Better than tracking some weird variables all over the place.
class DFHACK_EXPORT Core class DFHACK_EXPORT Core
{ {
friend int ::SDL_NumJoysticks(void);
friend void ::SDL_Quit(void);
public: public:
static Core& getInstance() static Core& getInstance()
{ {
@ -19,13 +46,20 @@ namespace DFHack
static Core instance; static Core instance;
return instance; return instance;
} }
int Update (void); void Suspend(void);
int Shutdown (void); void Resume(void);
DFHack::Context *getContext()
{
return c;
}
private: private:
Core(); Core();
int Update (void);
int Shutdown (void);
Core(Core const&); // Don't Implement Core(Core const&); // Don't Implement
void operator=(Core const&); // Don't implement void operator=(Core const&); // Don't implement
bool errorstate; bool errorstate;
DFMutex * AccessMutex;
// legacy mess. // legacy mess.
DFHack::VersionInfoFactory * vif; DFHack::VersionInfoFactory * vif;
DFHack::Process * p; DFHack::Process * p;

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#pragma once #pragma once
#ifdef LINUX_BUILD #ifdef LINUX_BUILD

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef DF_MISCUTILS #ifndef DF_MISCUTILS

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef DFHACK_TRANQUILITY #ifndef DFHACK_TRANQUILITY

@ -1,6 +1,6 @@
/* /*
https://github.com/peterix/dfhack https://github.com/peterix/dfhack
Copyright (c) 2011 Petr Mrázek (peterix) Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#pragma once #pragma once
#ifndef PROCESS_H_INCLUDED #ifndef PROCESS_H_INCLUDED

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#pragma once #pragma once
#ifndef TYPES_H_INCLUDED #ifndef TYPES_H_INCLUDED

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#pragma once #pragma once
#ifndef DFVECTOR_H_INCLUDED #ifndef DFVECTOR_H_INCLUDED

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#pragma once #pragma once
#ifndef MEMINFO_H_INCLUDED #ifndef MEMINFO_H_INCLUDED

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#pragma once #pragma once
#ifndef MEMINFO_MANAGER_H_INCLUDED #ifndef MEMINFO_MANAGER_H_INCLUDED

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef MAPEXTRAS_H #ifndef MAPEXTRAS_H
#define MAPEXTRAS_H #define MAPEXTRAS_H

@ -1,3 +1,28 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once
#ifndef TERMUTIL_H #ifndef TERMUTIL_H
#define TERMUTIL_H #define TERMUTIL_H

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_BUILDINGS #ifndef CL_MOD_BUILDINGS
#define CL_MOD_BUILDINGS #define CL_MOD_BUILDINGS

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_CONSTRUCTIONS #ifndef CL_MOD_CONSTRUCTIONS
#define CL_MOD_CONSTRUCTIONS #define CL_MOD_CONSTRUCTIONS

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_CREATURES #ifndef CL_MOD_CREATURES
#define CL_MOD_CREATURES #define CL_MOD_CREATURES

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_ENGRAVINGS #ifndef CL_MOD_ENGRAVINGS
#define CL_MOD_ENGRAVINGS #define CL_MOD_ENGRAVINGS

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_GUI #ifndef CL_MOD_GUI
#define CL_MOD_GUI #define CL_MOD_GUI

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_ITEMS #ifndef CL_MOD_ITEMS
#define CL_MOD_ITEMS #define CL_MOD_ITEMS

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
/******************************************************************************* /*******************************************************************************
M A P S M A P S
Read and write DF's map Read and write DF's map

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_MATERIALS #ifndef CL_MOD_MATERIALS
#define CL_MOD_MATERIALS #define CL_MOD_MATERIALS

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_TRANSLATION #ifndef CL_MOD_TRANSLATION
#define CL_MOD_TRANSLATION #define CL_MOD_TRANSLATION

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_VEGETATION #ifndef CL_MOD_VEGETATION
#define CL_MOD_VEGETATION #define CL_MOD_VEGETATION

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -21,6 +21,7 @@ must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source 3. This notice may not be removed or altered from any source
distribution. distribution.
*/ */
#pragma once #pragma once
#ifndef KEYS_H_INCLUDED #ifndef KEYS_H_INCLUDED
#define KEYS_H_INCLUDED #define KEYS_H_INCLUDED

@ -1,3 +1,27 @@
/*
https://github.com/peterix/dfhack
Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#pragma once #pragma once
#ifndef CL_MOD_WORLD #ifndef CL_MOD_WORLD
#define CL_MOD_WORLD #define CL_MOD_WORLD

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <stddef.h> #include <stddef.h>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
@ -22,6 +22,7 @@ must not be misrepresented as being the original software.
distribution. distribution.
*/ */
#include "Internal.h" #include "Internal.h"
#include <string> #include <string>
#include <vector> #include <vector>

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any

@ -1,6 +1,6 @@
/* /*
www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any

@ -1,26 +1,26 @@
/* /*
w ww.so*urceforge.net/projects/dfhack https://github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
damages arising from the use of this software. damages arising from the use of this software.
Permission is granted to anyone to use this software for any Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions: redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must 1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation software in a product, an acknowledgment in the product documentation
would be appreciated but is not required. would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and 2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software. must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source 3. This notice may not be removed or altered from any source
distribution. distribution.
*/ */
#pragma once #pragma once

@ -1,26 +1,26 @@
/* /*
* www.sourceforge.net/projects/dfhack https://github.com/peterix/dfhack
* Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009-2011 Petr Mrázek (peterix@gmail.com)
*
* This software is provided 'as-is', without any express or implied This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any warranty. In no event will the authors be held liable for any
* damages arising from the use of this software. damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions: redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must 1. The origin of this software must not be misrepresented; you must
* not claim that you wrote the original software. If you use this not claim that you wrote the original software. If you use this
* software in a product, an acknowledgment in the product documentation software in a product, an acknowledgment in the product documentation
* would be appreciated but is not required. would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software. must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source 3. This notice may not be removed or altered from any source
* distribution. distribution.
*/ */
#pragma once #pragma once