Skip to content

Commit

Permalink
Merge mangos/master into mangos/400 Thanks Xfurry =)
Browse files Browse the repository at this point in the history
Signed-off-by: Salja <salja2012@hotmail.de>
  • Loading branch information
Salja committed Aug 4, 2012
1 parent 035f4f9 commit e119408
Show file tree
Hide file tree
Showing 1,001 changed files with 145,816 additions and 23,677 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -109,3 +109,5 @@ dep/ACE_wrappers/ace/config.h
!dep/ACE_wrappers/lib/.empty
!dep/tbb/src/Makefile

# recastnavigation directory needs exception
!dep/recastnavigation/RecastDemo/Build/
2 changes: 1 addition & 1 deletion CMakeLists.txt
@@ -1,5 +1,5 @@
#
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion NEWS
@@ -1,6 +1,6 @@
= MaNGOS -- History of visible changes =

Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>

See the COPYING file for copying conditions.

Expand Down
2 changes: 1 addition & 1 deletion README
@@ -1,6 +1,6 @@
= MaNGOS -- README =

Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>

MaNGOS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmake/ImportACE.cmake
@@ -1,5 +1,5 @@
#
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion cmake/ImportTBB.cmake
@@ -1,5 +1,5 @@
#
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
Expand Down
2 changes: 1 addition & 1 deletion contrib/extractor/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
Expand Down
34 changes: 31 additions & 3 deletions contrib/extractor/System.cpp
Expand Up @@ -62,6 +62,7 @@ enum Extract
// Select data for extract
int CONF_extract = EXTRACT_MAP | EXTRACT_DBC;
// This option allow limit minimum height to some value (Allow save some memory)
// see contrib/mmap/src/Tilebuilder.h, INVALID_MAP_LIQ_HEIGHT
bool CONF_allow_height_limit = true;
float CONF_use_minHeight = -500.0f;

Expand Down Expand Up @@ -374,7 +375,7 @@ void ReadLiquidTypeTableDBC(int const locale)

// Map file format data
static char const* MAP_MAGIC = "MAPS";
static char const* MAP_VERSION_MAGIC = "v1.1";
static char const* MAP_VERSION_MAGIC = "v1.2";
static char const* MAP_AREA_MAGIC = "AREA";
static char const* MAP_HEIGHT_MAGIC = "MHGT";
static char const* MAP_LIQUID_MAGIC = "MLIQ";
Expand All @@ -390,6 +391,8 @@ struct map_fileheader
uint32 heightMapSize;
uint32 liquidMapOffset;
uint32 liquidMapSize;
uint32 holesOffset;
uint32 holesSize;
};

#define MAP_AREA_NO_AREA 0x0001
Expand Down Expand Up @@ -886,8 +889,8 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
liquidHeader.liquidType = 0;
liquidHeader.offsetX = minX;
liquidHeader.offsetY = minY;
liquidHeader.width = maxX - minX + 1;
liquidHeader.height = maxY - minY + 1;
liquidHeader.width = maxX - minX + 1 + 1;
liquidHeader.height = maxY - minY + 1 + 1;
liquidHeader.liquidLevel = minHeight;

if (maxHeight == minHeight)
Expand All @@ -909,6 +912,28 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
map.liquidMapSize += sizeof(float)*liquidHeader.width*liquidHeader.height;
}

// map hole info
uint16 holes[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];

if(map.liquidMapOffset)
map.holesOffset = map.liquidMapOffset + map.liquidMapSize;
else
map.holesOffset = map.heightMapOffset + map.heightMapSize;

map.holesSize = sizeof(holes);
memset(holes, 0, map.holesSize);

for(int i = 0; i < ADT_CELLS_PER_GRID; ++i)
{
for(int j = 0; j < ADT_CELLS_PER_GRID; ++j)
{
adt_MCNK * cell = cells->getMCNK(i,j);
if(!cell)
continue;
holes[i][j] = cell->holes;
}
}

// Ok all data prepared - store it
FILE *output=fopen(filename2, "wb");
if(!output)
Expand Down Expand Up @@ -956,6 +981,9 @@ bool ConvertADT(char *filename, char *filename2, int cell_y, int cell_x, uint32
}
}

// store hole data
fwrite(holes, map.holesSize, 1, output);

fclose(output);

return true;
Expand Down
13 changes: 13 additions & 0 deletions contrib/extractor/libmpq/CMakeLists.txt
@@ -0,0 +1,13 @@
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

add_library (libmpq common.cpp explode.cpp extract.cpp huffman.cpp mpq.cpp parser.cpp wave.cpp )
# link libmpq with zlib
target_link_libraries (libmpq z)
2 changes: 1 addition & 1 deletion contrib/extractor/loadlib/CMakeLists.txt
@@ -1,4 +1,4 @@
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
Expand Down
5 changes: 4 additions & 1 deletion contrib/extractor/loadlib/adt.h
Expand Up @@ -94,7 +94,8 @@ class adt_MCNK
uint32 sizeMCSH;
uint32 areaid;
uint32 nMapObjRefs;
uint32 holes;
uint16 holes; // locations where models pierce the heightmap
uint16 pad;
uint16 s[2];
uint32 data1;
uint32 data2;
Expand Down Expand Up @@ -290,4 +291,6 @@ class ADT_file : public FileLoader{
adt_MCNK* cells[ADT_CELLS_PER_GRID][ADT_CELLS_PER_GRID];
};

bool isHole(int holes, int i, int j);

#endif
162 changes: 162 additions & 0 deletions contrib/extractor_binary/ExtractResources.sh
@@ -0,0 +1,162 @@
#!/bin/sh

# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

## Expected param 1 to be 'a' for all, else ask some questions

## Normal log file (if not overwritten by second param
LOG_FILE="MaNGOSExtractor.log"
## Detailed log file
DETAIL_LOG_FILE="MaNGOSExtractor_detailed.log"

## Change this to a value fitting for your sys!
NUM_CPU="2"

## ! Use below only for finetuning or if you know what you are doing !

USE_AD="0"
USE_VMAPS="0"
USE_MMAPS="0"
USE_MMAPS_OFFMESH="0"

if [ "$1" = "a" ]
then
## extract all
USE_AD="1"
USE_VMAPS="1"
USE_MMAPS="1"
else
## do some questioning!
echo
echo "Welcome to helper script to extract required dataz for MaNGOS!"
echo "Should all dataz (dbc, maps, vmaps and mmaps be extracted? (y/n)"
read line
if [ "$line" = "y" ]
then
## extract all
USE_AD="1"
USE_VMAPS="1"
USE_MMAPS="1"
else
echo
echo "Should dbc and maps be extracted? (y/n)"
read line
if [ "$line" = "y" ]; then USE_AD="1"; fi

echo
echo "Should vmaps be extracted? (y/n)"
read line
if [ "$line" = "y" ]; then USE_VMAPS="1"; fi

echo
echo "Should mmaps be extracted? (y/n)"
echo "WARNING! This will take several hours!"
read line
if [ "$line" = "y" ]
then
USE_MMAPS="1";
else
echo "Only reextract offmesh tiles for mmaps?"
read line
if [ "$line" = "y" ]
then
USE_MMAPS_OFFMESH="1";
fi
fi
fi
fi

## Special case: Only reextract offmesh tiles
if [ "$USE_MMAPS_OFFMESH" = "1" ]
then
echo "Only extracting offmesh meshes"
MoveMapGen.sh offmesh $LOG_FILE $DETAIL_LOG_FILE
exit 0
fi

## Obtain numbe ob processes
if [ "$USE_MMAPS" = "1" ]
then
echo "How many CPUs should be used for extracting mmaps? (1-4)"
read line
if [ "$line" -ge "1" -a "$line" -le "4" ]
then
NUM_CPU=$line
else
echo "Only number between 1 and 4 supported!"
exit 1
fi
fi

## Give some status
echo "Current Settings: Extract DBCs/maps: $USE_AD, Extract vmaps: $USE_VMAPS, Extract mmaps: $USE_MMAPS on $NUM_CPU processes"
if [ "$1" != "a" ]
then
echo "If you don't like this settings, interrupt with CTRL+C"
read line
fi

echo "`date`: Start extracting dataz for MaNGOS" | tee $LOG_FILE

## Handle log messages
if [ "$USE_AD" = "1" ];
then
echo "DBC and map files will be extracted" | tee -a $LOG_FILE
else
echo "DBC and map files won't be extracted!" | tee -a $LOG_FILE
fi
if [ "$USE_VMAPS" = "1" ]
then
echo "Vmaps will be extracted" | tee -a $LOG_FILE
else
echo "Vmaps won't be extracted!" | tee -a $LOG_FILE
fi
if [ "$USE_MMAPS" = "1" ]
then
echo "Mmaps will be extracted with $NUM_CPU processes" | tee -a $LOG_FILE
else
echo "Mmaps files won't be extracted!" | tee -a $LOG_FILE
fi
echo | tee -a $LOG_FILE

echo "`date`: Start extracting dataz for MaNGOS, DBCs/maps $USE_AD, vmaps $USE_VMAPS, mmaps $USE_MMAPS on $NUM_CPU processes" | tee $DETAIL_LOG_FILE
echo | tee -a $DETAIL_LOG_FILE

## Extract dbcs and maps
if [ "$USE_AD" = "1" ]
then
echo "`date`: Start extraction of DBCs and map files..." | tee -a $LOG_FILE
ad | tee -a $DETAIL_LOG_FILE
echo "`date`: Extracting of DBCs and map files finished" | tee -a $LOG_FILE
echo | tee -a $LOG_FILE
echo | tee -a $DETAIL_LOG_FILE
fi

## Extract vmaps
if [ "$USE_VMAPS" = "1" ]
then
echo "`date`: Start extraction of vmaps..." | tee -a $LOG_FILE
vmapExtractor3 | tee -a $DETAIL_LOG_FILE
echo "`date`: Extracting of vmaps finished" | tee -a $LOG_FILE
mkdir vmaps
echo "`date`: Start assembling of vmaps..." | tee -a $LOG_FILE
vmap_assembler.exe buildings vmaps | tee -a $DETAIL_LOG_FILE
echo "`date`: Assembling of vmaps finished" | tee -a $LOG_FILE

echo | tee -a $LOG_FILE
echo | tee -a $DETAIL_LOG_FILE
fi

## Extract mmaps
if [ "$USE_MMAPS" = "1" ]
then
MoveMapGen.sh $NUM_CPU $LOG_FILE $DETAIL_LOG_FILE
fi

3 comments on commit e119408

@LordJZ
Copy link
Contributor

@LordJZ LordJZ commented on e119408 Aug 4, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Massive.

@xfurry
Copy link
Contributor

@xfurry xfurry commented on e119408 Aug 5, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you merged this in a wrong way. Now all the 300 commits which I've merged are lost. :(

It should be better if you revert this commit, and wait for a pull request from my side, so we can still keep the original Mangos commits.

PS. This is merged up to [11950]. There are still about 130 commits to merge, but I didn't continue because of some heavy changes in the Spell system.

@xfurry
Copy link
Contributor

@xfurry xfurry commented on e119408 Aug 5, 2012

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git reverse this commit and add this pull request please:
#74

Please sign in to comment.