LICENSE stuff, some offsets, some search tool tweaks

develop
Petr Mrázek 2011-02-22 22:20:16 +01:00
parent f2f79e0c09
commit fd831eb2a8
6 changed files with 150 additions and 19 deletions

@ -1,3 +1,5 @@
----------------------------------------------------------------------
License of dfhack
github.com/peterix/dfhack github.com/peterix/dfhack
Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf
@ -19,3 +21,120 @@ 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.
----------------------------------------------------------------------
License of library/include/dfhack/DFstdint_win.h
ISO C9x compliant stdint.h for Microsoft Visual Studio
Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
Copyright (c) 2006-2008 Alexander Chemeris
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the author may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
----------------------------------------------------------------------------
License of argstream (used by some utilities for parsing command line params)
Copyright (C) 2004 Xavier Decoret <Xavier.Decoret@imag.fr>
argsteam is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Foobar is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foobar; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This library is used by:
tools/playground/catsplosion.cpp
tools/playground/digger.cpp
tools/supported/vdig.cpp
----------------------------------------------------------------------------
License of "RSA Data Security, Inc. MD5 Message-Digest Algorithm"
Used to identify DF binaries.
Copyright (C) 1991-2, RSA Data Security, Inc. Created 1991. All
rights reserved.
License to copy and use this software is granted provided that it
is identified as the "RSA Data Security, Inc. MD5 Message-Digest
Algorithm" in all material mentioning or referencing this software
or this function.
License is also granted to make and use derivative works provided
that such works are identified as "derived from the RSA Data
Security, Inc. MD5 Message-Digest Algorithm" in all material
mentioning or referencing the derived work.
RSA Data Security, Inc. makes no representations concerning either
the merchantability of this software or the suitability of this
software for any particular purpose. It is provided "as is"
without express or implied warranty of any kind.
These notices must be retained in any copies of any part of this
documentation and/or software.
-----------------------------------------------------------------
License of the "RSA Data Security, Inc. MD5 Message-Digest Algorithm" C++ wrapper:
This is my wrapper-class to create
a MD5 Hash from a string and a file.
This code is completly free, you
can copy it, modify it, or do
what ever you want with it.
Feb. 2005
Benjamin Grüdelbach
------------------------------------------------------------------
License of the used XML reader library
www.sourceforge.net/projects/tinyxml
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.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.

@ -1939,10 +1939,10 @@
</Group> </Group>
<Group name="Materials" valid="false" > <Group name="Materials" valid="false" >
<Address name="creature_type_vector" value="0x171e880" valid="true" /> <Address name="creature_type_vector" value="0x171e880" valid="true" />
<Address name="inorganics" value="0x171e790 0x16e527C" valid="true" /> <Address name="inorganics" value="0x171e790" valid="true" />
<Address name="organics_all" value="0x171e7B0 0x16e529C" valid="true" /> <Address name="organics_all" value="0x171e7B0" valid="true" />
<Address name="organics_plants" value="0x171e7C0 0x16e52AC" valid="true" /> <Address name="organics_plants" value="0x171e7C0" valid="true" />
<Address name="organics_trees" value="0x171e7E0 0x16e52CC" valid="true" /> <Address name="organics_trees" value="0x171e7E0" valid="true" />
</Group> </Group>
<Group name="GUI" valid="false"> <Group name="GUI" valid="false">
<Address name="pause_state" value="0x14c9be1" valid="true" /> <Address name="pause_state" value="0x14c9be1" valid="true" />
@ -2476,14 +2476,14 @@
<Address name="region_x" value="0x93c045c" /> <Address name="region_x" value="0x93c045c" />
<Address name="region_y" value="0x93c0460" /> <Address name="region_y" value="0x93c0460" />
<Address name="region_z" value="0x93c0464" /> <Address name="region_z" value="0x93c0464" />
<Address name="world_size_x" value="0x93c1ab0" />
<Address name="world_size_y" value="0x93c1ab2" />
<Address name="x_count" value="0x93c0450" />
<Address name="x_count_block" value="0x93c0444" /> <Address name="x_count_block" value="0x93c0444" />
<Address name="y_count" value="0x93c0454" />
<Address name="y_count_block" value="0x93c0448" /> <Address name="y_count_block" value="0x93c0448" />
<Address name="z_count" value="0x93c0458" />
<Address name="z_count_block" value="0x93c044c" /> <Address name="z_count_block" value="0x93c044c" />
<Address name="x_count" value="0x93c0450" />
<Address name="y_count" value="0x93c0454" />
<Address name="z_count" value="0x93c0458" />
<Address name="world_size_x" value="0x93c1ab0" />
<Address name="world_size_y" value="0x93c1ab2" />
<Group name="block" valid="true" /> <Group name="block" valid="true" />
<Group name="features" valid="false" /> <Group name="features" valid="false" />
<Group name="geology" valid="false" /> <Group name="geology" valid="false" />
@ -2496,9 +2496,13 @@
<Group name="name" valid="true" /> <Group name="name" valid="true" />
</Offsets> </Offsets>
</Version> </Version>
<Version name="v0.31.19 linux" os="linux" base="v0.31.18 linux"> <Version name="v0.31.19 linux" os="linux" base="v0.31.18 linux" rebase="-0x77738">
<MD5 value="8fcb1f10af9cc2bda47d2acf42e1db54" /> <MD5 value="8fcb1f10af9cc2bda47d2acf42e1db54" />
<Offsets valid="false" /> <Offsets>
<Group name="Position">
... stuff
</Group>
</Offsets>
</Version> </Version>
</DFHack> </DFHack>

@ -21,7 +21,6 @@
#include <assert.h> #include <assert.h>
using namespace std; using namespace std;
#include <argstream.h>
#include <DFHack.h> #include <DFHack.h>
#include <dfhack/DFTileTypes.h> #include <dfhack/DFTileTypes.h>
#define BLOCK_SIZE 16 #define BLOCK_SIZE 16

@ -395,6 +395,7 @@ public:
Allocate((d->length+sizeof(T)) * 2); Allocate((d->length+sizeof(T)) * 2);
(*(T *)( (uint64_t)d->object + d->length)) = what; (*(T *)( (uint64_t)d->object + d->length)) = what;
d->length += sizeof(T); d->length += sizeof(T);
return true;
} }
Bytestreamdata * d; Bytestreamdata * d;
bool constant; bool constant;

@ -749,8 +749,11 @@ void autoSearch(DFHack::Context * DF, vector <DFHack::t_memrange>& ranges)
// organics vector // organics vector
to_filter = filtVectors; to_filter = filtVectors;
sf.Filter<uint32_t,vecTriplet>(52 * 4,to_filter,vectorLength<uint32_t>); sf.Filter<const char * ,vecTriplet>("MUSHROOM_HELMET_PLUMP",to_filter, vectorString);
sf.Filter<const char * ,vecTriplet>("MUSHROOM_HELMET_PLUMP",to_filter, vectorStringFirst); sf.Filter<const char * ,vecTriplet>("MEADOW-GRASS",to_filter, vectorString);
sf.Filter<const char * ,vecTriplet>("TUNNEL_TUBE",to_filter, vectorString);
sf.Filter<const char * ,vecTriplet>("WEED_BLADE",to_filter, vectorString);
sf.Filter<const char * ,vecTriplet>("EYEBALL",to_filter, vectorString);
printFound(to_filter,"organics"); printFound(to_filter,"organics");
// tree vector // tree vector

@ -10,7 +10,7 @@ using namespace std;
#include <DFHack.h> #include <DFHack.h>
#include <dfhack/DFTileTypes.h> #include <dfhack/DFTileTypes.h>
#include <argstream.h> //#include <argstream.h>
#define MAX_DIM 0x300 #define MAX_DIM 0x300
@ -271,10 +271,12 @@ int main (int argc, char* argv[])
{ {
// Command line options // Command line options
bool updown = false; bool updown = false;
/*
argstream as(argc,argv); argstream as(argc,argv);
as >>option('x',"updown",updown,"Dig up and down stairs to reach other z-levels.") as >>option('x',"updown",updown,"Dig up and down stairs to reach other z-levels.")
>>help(); >>help();
// sane check // sane check
if (!as.isOk()) if (!as.isOk())
@ -282,6 +284,9 @@ int main (int argc, char* argv[])
cout << as.errorLog(); cout << as.errorLog();
return 1; return 1;
} }
*/
if(argc > 1 && strcmp(argv[1],"-x") == 0)
updown = true;
DFHack::ContextManager DFMgr("Memory.xml"); DFHack::ContextManager DFMgr("Memory.xml");
DFHack::Context * DF; DFHack::Context * DF;
@ -298,12 +303,12 @@ int main (int argc, char* argv[])
#endif #endif
return 1; return 1;
} }
uint32_t x_max,y_max,z_max; uint32_t x_max,y_max,z_max;
DFHack::Maps * Maps = DF->getMaps(); DFHack::Maps * Maps = DF->getMaps();
DFHack::Materials * Mats = DF->getMaterials(); DFHack::Materials * Mats = DF->getMaterials();
DFHack::Position * Pos = DF->getPosition(); DFHack::Position * Pos = DF->getPosition();
// init the map // init the map
if(!Maps->Start()) if(!Maps->Start())
{ {
@ -314,12 +319,12 @@ int main (int argc, char* argv[])
#endif #endif
return 1; return 1;
} }
int32_t cx, cy, cz; int32_t cx, cy, cz;
Maps->getSize(x_max,y_max,z_max); Maps->getSize(x_max,y_max,z_max);
uint32_t tx_max = x_max * 16; uint32_t tx_max = x_max * 16;
uint32_t ty_max = y_max * 16; uint32_t ty_max = y_max * 16;
Pos->getCursorCoords(cx,cy,cz); Pos->getCursorCoords(cx,cy,cz);
while(cx == -30000) while(cx == -30000)
{ {