mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 10:37:03 +00:00
[c12536] Happy New Year 2013
Update authorship information and prepare for easier ways next year Signed-off-by: Schmoozerd <schmoozerd@cmangos> (based on commit [12325] - b7dbcda)
This commit is contained in:
parent
86a243c910
commit
a05738717a
542 changed files with 3274 additions and 1846 deletions
24
AUTHORS
24
AUTHORS
|
|
@ -1,9 +1,17 @@
|
|||
SPECIAL THANKS TO THE MAIN CONTRIBUTORS OF THE MaNGOS PROJECT (LISTED BELOW)
|
||||
This file contains authorship information related to the Continued-MaNGOS Project
|
||||
|
||||
Julius "h" Kivimaki
|
||||
Ryan "I'm Sabu" Cleary
|
||||
Chris "Realm of Tearrrroorr" Metzen
|
||||
Jeffrey "Tigole" Kaplan
|
||||
Rob "EnoYls" Pardo
|
||||
Michael "Lamborghini" Morhaime
|
||||
Bobby "I need a raise" Kotick
|
||||
The code of C-MaNGOS is shipped as it is without any form of warenty,
|
||||
and - except for third party libraries - licensed under the GPL 2.0,
|
||||
which you can read from the file "COPYING"
|
||||
|
||||
* The authors are assigned to by git commit authorship information,
|
||||
listed within the git commit messages, or if forgotten before mentioned in the github comments related to a commit.
|
||||
|
||||
* The most recent history can be checked at https://github.com/cmangos/mangos-wotlk
|
||||
|
||||
* The older history (from svn times) is backed up and can be checked at https://github.com/cmangos/mangos-svn
|
||||
|
||||
* Initially the code for this project was written by Wow Daemon team.
|
||||
|
||||
The third party libraries have their own way of addressing authorship, and the authorship of commits importing/ updating
|
||||
a third party library reflects who did the importing instead of who wrote the code within the commit.
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
2
NEWS
2
NEWS
|
|
@ -1,6 +1,6 @@
|
|||
= MaNGOS -- History of visible changes =
|
||||
|
||||
Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
This file is part of the Continued-MaNGOS Project
|
||||
|
||||
See the COPYING file for copying conditions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
|
||||
This small Python script is intended to help with the convertion
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -52,9 +52,10 @@
|
|||
#define NUM_REMOTES 2
|
||||
#define NUM_DATABASES 3
|
||||
|
||||
char remotes[NUM_REMOTES][MAX_REMOTE] = {
|
||||
"git@github.com:mangos/server.git",
|
||||
"git://github.com/mangos/server.git" // used for fetch if present
|
||||
char remotes[NUM_REMOTES][MAX_REMOTE] =
|
||||
{
|
||||
"git@github.com:cmangos/mangos-cata.git",
|
||||
"git://github.com/cmangos/mangos-cata.git" // used for fetch if present
|
||||
};
|
||||
|
||||
char remote_branch[MAX_REMOTE] = "master";
|
||||
|
|
@ -63,30 +64,46 @@ char rev_sql_file[MAX_PATH] = "src/shared/revision_sql.h";
|
|||
char sql_update_dir[MAX_PATH] = "sql/updates";
|
||||
char new_index_file[MAX_PATH] = ".git/git_id_index";
|
||||
|
||||
char databases[NUM_DATABASES][MAX_DB] = {
|
||||
char databases[NUM_DATABASES][MAX_DB] =
|
||||
{
|
||||
"characters",
|
||||
"mangos",
|
||||
"realmd"
|
||||
};
|
||||
|
||||
char db_version_table[NUM_DATABASES][MAX_DB] = {
|
||||
char db_version_table[NUM_DATABASES][MAX_DB] =
|
||||
{
|
||||
"character_db_version",
|
||||
"db_version",
|
||||
"realmd_db_version",
|
||||
};
|
||||
|
||||
char db_sql_file[NUM_DATABASES][MAX_PATH] = {
|
||||
char db_sql_file[NUM_DATABASES][MAX_PATH] =
|
||||
{
|
||||
"sql/characters.sql",
|
||||
"sql/mangos.sql",
|
||||
"sql/realmd.sql"
|
||||
};
|
||||
|
||||
char db_sql_rev_field[NUM_DATABASES][MAX_PATH] = {
|
||||
char db_sql_rev_field[NUM_DATABASES][MAX_PATH] =
|
||||
{
|
||||
"REVISION_DB_CHARACTERS",
|
||||
"REVISION_DB_MANGOS",
|
||||
"REVISION_DB_REALMD"
|
||||
};
|
||||
|
||||
bool db_sql_rev_parent[NUM_DATABASES] =
|
||||
{
|
||||
false,
|
||||
false,
|
||||
true
|
||||
};
|
||||
|
||||
#define REV_PREFIX "c"
|
||||
#define REV_SCAN REV_PREFIX "%d"
|
||||
#define REV_PRINT REV_PREFIX "%04d"
|
||||
#define REV_FORMAT "[" REV_PRINT "]"
|
||||
|
||||
bool allow_replace = false;
|
||||
bool local = false;
|
||||
bool do_fetch = false;
|
||||
|
|
@ -231,8 +248,10 @@ int get_rev(const char *from_msg)
|
|||
{
|
||||
// accept only the rev number format, not the sql update format
|
||||
char nr_str[256];
|
||||
if(sscanf(from_msg, "[%[0123456789]]", nr_str) != 1) return 0;
|
||||
if(from_msg[strlen(nr_str)+1] != ']') return 0;
|
||||
if (sscanf(from_msg, "[" REV_PREFIX "%[0123456789]]", nr_str) != 1) return 0;
|
||||
// ("[")+(REV_PREFIX)+("]")-1
|
||||
if (from_msg[strlen(nr_str) + strlen(REV_PREFIX) + 2 - 1] != ']') return 0;
|
||||
|
||||
return atoi(nr_str);
|
||||
}
|
||||
|
||||
|
|
@ -259,7 +278,7 @@ bool find_rev()
|
|||
pclose(cmd_pipe);
|
||||
}
|
||||
|
||||
if(rev > 0) printf("Found [%d].\n", rev);
|
||||
if (rev > 0) printf("Found " REV_FORMAT ".\n", rev);
|
||||
|
||||
return rev > 0;
|
||||
}
|
||||
|
|
@ -280,7 +299,9 @@ std::string generateSqlHeader()
|
|||
newData << "#ifndef __REVISION_SQL_H__" << std::endl;
|
||||
newData << "#define __REVISION_SQL_H__" << std::endl;
|
||||
for (int i = 0; i < NUM_DATABASES; ++i)
|
||||
{
|
||||
newData << " #define " << db_sql_rev_field[i] << " \"required_" << last_sql_update[i] << "\"" << std::endl;
|
||||
}
|
||||
newData << "#endif // __REVISION_SQL_H__" << std::endl;
|
||||
return newData.str();
|
||||
}
|
||||
|
|
@ -302,7 +323,7 @@ bool write_rev_nr()
|
|||
{
|
||||
printf("+ writing revision_nr.h\n");
|
||||
char rev_str[256];
|
||||
sprintf(rev_str, "%d", rev);
|
||||
sprintf(rev_str, "%04d", rev);
|
||||
std::string header = generateNrHeader(rev_str);
|
||||
|
||||
char prefixed_file[MAX_PATH];
|
||||
|
|
@ -363,7 +384,7 @@ bool find_head_msg()
|
|||
{
|
||||
if (!allow_replace)
|
||||
{
|
||||
printf("Last commit on HEAD is [%d]. Use -r to replace it with [%d].\n", head_rev, rev);
|
||||
printf("Last commit on HEAD is " REV_FORMAT ". Use -r to replace it with " REV_FORMAT ".\n", head_rev, rev);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -389,7 +410,7 @@ bool amend_commit()
|
|||
if ((cmd_pipe = popen(cmd, "w")) == NULL)
|
||||
return false;
|
||||
|
||||
fprintf(cmd_pipe, "[%d] %s", rev, head_message);
|
||||
fprintf(cmd_pipe, REV_FORMAT " %s", rev, head_message);
|
||||
pclose(cmd_pipe);
|
||||
if (use_new_index && putenv(old_index_cmd) != 0) return false;
|
||||
|
||||
|
|
@ -399,6 +420,7 @@ bool amend_commit()
|
|||
struct sql_update_info
|
||||
{
|
||||
int rev;
|
||||
char parentRev[MAX_BUF];
|
||||
int nr;
|
||||
int db_idx;
|
||||
char db[MAX_BUF];
|
||||
|
|
@ -410,11 +432,11 @@ bool get_sql_update_info(const char *buffer, sql_update_info &info)
|
|||
{
|
||||
info.table[0] = '\0';
|
||||
int dummy[3];
|
||||
if(sscanf(buffer, "%d_%d_%d", &dummy[0], &dummy[1], &dummy[2]) == 3)
|
||||
if (sscanf(buffer, REV_SCAN "_%[^_]_%d_%d", &dummy[0], &dummy[1], &dummy[2]) == 3)
|
||||
return false;
|
||||
|
||||
if(sscanf(buffer, "%d_%d_%[^_]_%[^.].sql", &info.rev, &info.nr, info.db, info.table) != 4 &&
|
||||
sscanf(buffer, "%d_%d_%[^.].sql", &info.rev, &info.nr, info.db) != 3)
|
||||
if (sscanf(buffer, REV_SCAN "_%[^_]_%d_%[^_]_%[^.].sql", &info.rev, &info.nr, info.db, info.table) != 4 &&
|
||||
sscanf(buffer, REV_SCAN "_%[^_]_%d_%[^.].sql", &info.rev, &info.nr, info.db) != 3)
|
||||
{
|
||||
info.rev = 0; // this may be set by the first scans, even if they fail
|
||||
if (sscanf(buffer, "%d_%[^_]_%[^.].sql", &info.nr, info.db, info.table) != 3 &&
|
||||
|
|
@ -458,6 +480,14 @@ bool find_sql_updates()
|
|||
|
||||
pclose(cmd_pipe);
|
||||
|
||||
// Add last milestone's file information
|
||||
last_sql_rev[0] = 12300;
|
||||
last_sql_nr[0] = 2;
|
||||
sscanf("12300_02_characters_mail", "%s", last_sql_update[0]);
|
||||
last_sql_rev[2] = 12112;
|
||||
last_sql_nr[2] = 1;
|
||||
sscanf("12112_01_realmd_account_access", "%s", last_sql_update[2]);
|
||||
|
||||
// remove updates from the last commit also found on origin
|
||||
snprintf(cmd, MAX_CMD, "git show %s:%s", origin_hash, sql_update_dir);
|
||||
if ((cmd_pipe = popen(cmd, "r")) == NULL)
|
||||
|
|
@ -632,7 +662,7 @@ bool generate_sql_makefile()
|
|||
if (!fout) { pclose(cmd_pipe); return false; }
|
||||
|
||||
fprintf(fout,
|
||||
"# Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>\n"
|
||||
"# This file is part of the Continued-MaNGOS Project\n"
|
||||
"#\n"
|
||||
"# This program is free software; you can redistribute it and/or modify\n"
|
||||
"# it under the terms of the GNU General Public License as published by\n"
|
||||
|
|
@ -727,6 +757,7 @@ bool change_sql_database()
|
|||
}
|
||||
|
||||
fprintf(fout, " `required_%s` bit(1) default NULL\n", last_sql_update[i]);
|
||||
|
||||
while (fgets(buffer, MAX_BUF, fin))
|
||||
fputs(buffer, fout);
|
||||
|
||||
|
|
@ -803,7 +834,8 @@ bool prepare_new_index()
|
|||
if (!use_new_index) return true;
|
||||
|
||||
// only use a new index if there are staged changes that should be preserved
|
||||
if( (cmd_pipe = popen( "git diff --cached", "r" )) == NULL ) {
|
||||
if ((cmd_pipe = popen("git diff --cached", "r")) == NULL)
|
||||
{
|
||||
use_new_index = false;
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
"""
|
||||
Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
This file is part of the Continued-MaNGOS Project
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# This file is free software; as a special exception the author gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
|
|
@ -12,5 +12,5 @@ cmake_minimum_required (VERSION 2.6)
|
|||
project (MANGOS_IOMAP_EXTRACTOR)
|
||||
|
||||
LINK_DIRECTORIES( ${LINK_DIRECTORIES} ../../../dep/libmpq/libmpq/.libs/ )
|
||||
add_executable(vmapextractor adtfile.cpp dbcfile.cpp model.cpp mpq_libmpq.cpp vmapexport.cpp wdtfile.cpp wmo.cpp)
|
||||
add_executable(vmapextractor adtfile.cpp dbcfile.cpp gameobject_extract.cpp model.cpp mpq_libmpq.cpp vmapexport.cpp wdtfile.cpp wmo.cpp)
|
||||
target_link_libraries(vmapextractor libmpq.a bz2 z)
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -53,7 +53,8 @@ void fixnamen(char *name, size_t len)
|
|||
if (i > 0 && name[i] >= 'A' && name[i] <= 'Z' && isalpha(name[i - 1]))
|
||||
{
|
||||
name[i] |= 0x20;
|
||||
} else if ((i==0 || !isalpha(name[i-1])) && name[i]>='a' && name[i]<='z')
|
||||
}
|
||||
else if ((i == 0 || !isalpha(name[i - 1])) && name[i] >= 'a' && name[i] <= 'z')
|
||||
{
|
||||
name[i] &= ~0x20;
|
||||
}
|
||||
|
|
@ -87,7 +88,7 @@ ADTFile::ADTFile(char* filename): ADT(WorldMpq, filename)
|
|||
Adtfilename.append(filename);
|
||||
}
|
||||
|
||||
bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
|
||||
bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY, StringSet& failedPaths)
|
||||
{
|
||||
if (ADT.isEof())
|
||||
return false;
|
||||
|
|
@ -152,6 +153,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
|
|||
ModelInstansName[t++] = s;
|
||||
|
||||
string path(p);
|
||||
ExtractSingleModel(path, failedPaths);
|
||||
|
||||
p = p + strlen(p) + 1;
|
||||
}
|
||||
|
|
@ -213,6 +215,7 @@ bool ADTFile::init(uint32 map_num, uint32 tileX, uint32 tileY)
|
|||
}
|
||||
ADT.close();
|
||||
fclose(dirfile);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "mpqfile.h"
|
||||
#include "wmo.h"
|
||||
#include "vmapexport.h"
|
||||
#include "model.h"
|
||||
|
||||
#define TILESIZE (533.33333f)
|
||||
|
|
@ -116,7 +117,7 @@ public:
|
|||
int nMDX;
|
||||
string* WmoInstansName;
|
||||
string* ModelInstansName;
|
||||
bool init(uint32 map_num, uint32 tileX, uint32 tileY);
|
||||
bool init(uint32 map_num, uint32 tileX, uint32 tileY, StringSet& failedPaths);
|
||||
//void LoadMapChunks();
|
||||
|
||||
//uint32 wmo_count;
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
111
contrib/vmap_extractor/vmapextract/gameobject_extract.cpp
Normal file
111
contrib/vmap_extractor/vmapextract/gameobject_extract.cpp
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
#include "model.h"
|
||||
#include "dbcfile.h"
|
||||
#include "adtfile.h"
|
||||
#include "vmapexport.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <stdio.h>
|
||||
|
||||
bool ExtractSingleModel(std::string& fname, StringSet& failedPaths)
|
||||
{
|
||||
char* name = GetPlainName((char*)fname.c_str());
|
||||
char* ext = GetExtension(name);
|
||||
|
||||
// < 3.1.0 ADT MMDX section store filename.mdx filenames for corresponded .m2 file
|
||||
if (!strcmp(ext, ".mdx"))
|
||||
{
|
||||
// replace .mdx -> .m2
|
||||
fname.erase(fname.length() - 2, 2);
|
||||
fname.append("2");
|
||||
}
|
||||
// >= 3.1.0 ADT MMDX section store filename.m2 filenames for corresponded .m2 file
|
||||
// nothing do
|
||||
|
||||
std::string output(szWorkDirWmo);
|
||||
output += "/";
|
||||
output += name;
|
||||
|
||||
if (FileExists(output.c_str()))
|
||||
return true;
|
||||
|
||||
Model mdl(fname);
|
||||
if (!mdl.open(failedPaths))
|
||||
return false;
|
||||
|
||||
return mdl.ConvertToVMAPModel(output.c_str());
|
||||
}
|
||||
|
||||
extern HANDLE LocaleMpq;
|
||||
|
||||
void ExtractGameobjectModels()
|
||||
{
|
||||
printf("\n");
|
||||
printf("Extracting GameObject models...\n");
|
||||
DBCFile dbc(LocaleMpq, "DBFilesClient\\GameObjectDisplayInfo.dbc");
|
||||
if (!dbc.open())
|
||||
{
|
||||
printf("Fatal error: Invalid GameObjectDisplayInfo.dbc file format!\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
std::string basepath = szWorkDirWmo;
|
||||
basepath += "/";
|
||||
std::string path;
|
||||
StringSet failedPaths;
|
||||
|
||||
FILE* model_list = fopen((basepath + "temp_gameobject_models").c_str(), "wb");
|
||||
|
||||
for (DBCFile::Iterator it = dbc.begin(); it != dbc.end(); ++it)
|
||||
{
|
||||
path = it->getString(1);
|
||||
|
||||
if (path.length() < 4)
|
||||
continue;
|
||||
|
||||
fixnamen((char*)path.c_str(), path.size());
|
||||
char* name = GetPlainName((char*)path.c_str());
|
||||
fixname2(name, strlen(name));
|
||||
|
||||
char* ch_ext = GetExtension(name);
|
||||
if (!ch_ext)
|
||||
continue;
|
||||
|
||||
strToLower(ch_ext);
|
||||
|
||||
bool result = false;
|
||||
if (!strcmp(ch_ext, ".wmo"))
|
||||
{
|
||||
result = ExtractSingleWmo(path);
|
||||
}
|
||||
else if (!strcmp(ch_ext, ".mdl"))
|
||||
{
|
||||
// TODO: extract .mdl files, if needed
|
||||
continue;
|
||||
}
|
||||
else //if (!strcmp(ch_ext, ".mdx") || !strcmp(ch_ext, ".m2"))
|
||||
{
|
||||
result = ExtractSingleModel(path, failedPaths);
|
||||
}
|
||||
|
||||
if (result)
|
||||
{
|
||||
uint32 displayId = it->getUInt(0);
|
||||
uint32 path_length = strlen(name);
|
||||
fwrite(&displayId, sizeof(uint32), 1, model_list);
|
||||
fwrite(&path_length, sizeof(uint32), 1, model_list);
|
||||
fwrite(name, sizeof(char), path_length, model_list);
|
||||
}
|
||||
}
|
||||
|
||||
fclose(model_list);
|
||||
|
||||
if (!failedPaths.empty())
|
||||
{
|
||||
printf("Warning: Some models could not be extracted, see below\n");
|
||||
for (StringSet::const_iterator itr = failedPaths.begin(); itr != failedPaths.end(); ++itr)
|
||||
printf("Could not find file of model %s\n", itr->c_str());
|
||||
printf("A few of these warnings are expected to happen, so be not alarmed!\n");
|
||||
}
|
||||
|
||||
printf("Done!\n");
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -52,7 +52,8 @@ typedef uint8_t uint8;
|
|||
//
|
||||
struct file_MVER
|
||||
{
|
||||
union{
|
||||
union
|
||||
{
|
||||
uint32 fcc;
|
||||
char fcc_txt[4];
|
||||
};
|
||||
|
|
@ -60,7 +61,8 @@ struct file_MVER
|
|||
uint32 ver;
|
||||
};
|
||||
|
||||
class FileLoader{
|
||||
class FileLoader
|
||||
{
|
||||
uint8* data;
|
||||
uint32 data_size;
|
||||
public:
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -32,7 +32,7 @@ Model::Model(std::string &filename) : filename(filename), vertices(0), indices(0
|
|||
{
|
||||
}
|
||||
|
||||
bool Model::open()
|
||||
bool Model::open(StringSet& failedPaths)
|
||||
{
|
||||
MPQFile f(WorldMpq, filename.c_str());
|
||||
|
||||
|
|
@ -41,8 +41,7 @@ bool Model::open()
|
|||
if (!ok)
|
||||
{
|
||||
f.close();
|
||||
// Do not show this error on console to avoid confusion, the extractor can continue working even if some models fail to load
|
||||
//printf("Error loading model %s\n", filename.c_str());
|
||||
failedPaths.insert(filename);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,8 +23,8 @@
|
|||
//#include "mpq.h"
|
||||
#include "modelheaders.h"
|
||||
#include <vector>
|
||||
#include "vmapexport.h"
|
||||
|
||||
class Model;
|
||||
class WMOInstance;
|
||||
class MPQFile;
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ public:
|
|||
uint16* BB_indices, *indices;
|
||||
size_t nIndices;
|
||||
|
||||
bool open();
|
||||
bool open(StringSet& failedPaths);
|
||||
bool ConvertToVMAPModel(const char* outfilename);
|
||||
|
||||
bool ok;
|
||||
|
|
@ -71,7 +71,6 @@ public:
|
|||
|
||||
ModelInstance() {}
|
||||
ModelInstance(MPQFile& f, const char* ModelInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -54,7 +54,8 @@ size_t MPQFile::read(void* dest, size_t bytes)
|
|||
if (eof) return 0;
|
||||
|
||||
size_t rpos = pointer + bytes;
|
||||
if (rpos > size) {
|
||||
if (rpos > size)
|
||||
{
|
||||
bytes = size - pointer;
|
||||
eof = true;
|
||||
}
|
||||
232
contrib/vmap_extractor/vmapextract/vec3d.h
Normal file
232
contrib/vmap_extractor/vmapextract/vec3d.h
Normal file
|
|
@ -0,0 +1,232 @@
|
|||
#ifndef VEC3D_H
|
||||
#define VEC3D_H
|
||||
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
class Vec3D
|
||||
{
|
||||
public:
|
||||
float x, y, z;
|
||||
|
||||
Vec3D(float x0 = 0.0f, float y0 = 0.0f, float z0 = 0.0f) : x(x0), y(y0), z(z0) {}
|
||||
|
||||
Vec3D(const Vec3D& v) : x(v.x), y(v.y), z(v.z) {}
|
||||
|
||||
Vec3D& operator= (const Vec3D& v)
|
||||
{
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
z = v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D operator+ (const Vec3D& v) const
|
||||
{
|
||||
Vec3D r(x + v.x, y + v.y, z + v.z);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vec3D operator- (const Vec3D& v) const
|
||||
{
|
||||
Vec3D r(x - v.x, y - v.y, z - v.z);
|
||||
return r;
|
||||
}
|
||||
|
||||
float operator* (const Vec3D& v) const
|
||||
{
|
||||
return x * v.x + y * v.y + z * v.z;
|
||||
}
|
||||
|
||||
Vec3D operator* (float d) const
|
||||
{
|
||||
Vec3D r(x * d, y * d, z * d);
|
||||
return r;
|
||||
}
|
||||
|
||||
friend Vec3D operator* (float d, const Vec3D& v)
|
||||
{
|
||||
return v * d;
|
||||
}
|
||||
|
||||
Vec3D operator% (const Vec3D& v) const
|
||||
{
|
||||
Vec3D r(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vec3D& operator+= (const Vec3D& v)
|
||||
{
|
||||
x += v.x;
|
||||
y += v.y;
|
||||
z += v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D& operator-= (const Vec3D& v)
|
||||
{
|
||||
x -= v.x;
|
||||
y -= v.y;
|
||||
z -= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D& operator*= (float d)
|
||||
{
|
||||
x *= d;
|
||||
y *= d;
|
||||
z *= d;
|
||||
return *this;
|
||||
}
|
||||
|
||||
float lengthSquared() const
|
||||
{
|
||||
return x * x + y * y + z * z;
|
||||
}
|
||||
|
||||
float length() const
|
||||
{
|
||||
return sqrt(x * x + y * y + z * z);
|
||||
}
|
||||
|
||||
Vec3D& normalize()
|
||||
{
|
||||
this->operator*= (1.0f / length());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D operator~() const
|
||||
{
|
||||
Vec3D r(*this);
|
||||
r.normalize();
|
||||
return r;
|
||||
}
|
||||
|
||||
friend std::istream& operator>>(std::istream& in, Vec3D& v)
|
||||
{
|
||||
in >> v.x >> v.y >> v.z;
|
||||
return in;
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& out, const Vec3D& v)
|
||||
{
|
||||
out << v.x << " " << v.y << " " << v.z;
|
||||
return out;
|
||||
}
|
||||
|
||||
operator float* ()
|
||||
{
|
||||
return (float*)this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Vec2D
|
||||
{
|
||||
public:
|
||||
float x, y;
|
||||
|
||||
Vec2D(float x0 = 0.0f, float y0 = 0.0f) : x(x0), y(y0) {}
|
||||
|
||||
Vec2D(const Vec2D& v) : x(v.x), y(v.y) {}
|
||||
|
||||
Vec2D& operator= (const Vec2D& v)
|
||||
{
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D operator+ (const Vec2D& v) const
|
||||
{
|
||||
Vec2D r(x + v.x, y + v.y);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vec2D operator- (const Vec2D& v) const
|
||||
{
|
||||
Vec2D r(x - v.x, y - v.y);
|
||||
return r;
|
||||
}
|
||||
|
||||
float operator* (const Vec2D& v) const
|
||||
{
|
||||
return x * v.x + y * v.y;
|
||||
}
|
||||
|
||||
Vec2D operator* (float d) const
|
||||
{
|
||||
Vec2D r(x * d, y * d);
|
||||
return r;
|
||||
}
|
||||
|
||||
friend Vec2D operator* (float d, const Vec2D& v)
|
||||
{
|
||||
return v * d;
|
||||
}
|
||||
|
||||
Vec2D& operator+= (const Vec2D& v)
|
||||
{
|
||||
x += v.x;
|
||||
y += v.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D& operator-= (const Vec2D& v)
|
||||
{
|
||||
x -= v.x;
|
||||
y -= v.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D& operator*= (float d)
|
||||
{
|
||||
x *= d;
|
||||
y *= d;
|
||||
return *this;
|
||||
}
|
||||
|
||||
float lengthSquared() const
|
||||
{
|
||||
return x * x + y * y;
|
||||
}
|
||||
|
||||
float length() const
|
||||
{
|
||||
return sqrt(x * x + y * y);
|
||||
}
|
||||
|
||||
Vec2D& normalize()
|
||||
{
|
||||
this->operator*= (1.0f / length());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D operator~() const
|
||||
{
|
||||
Vec2D r(*this);
|
||||
r.normalize();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
friend std::istream& operator>>(std::istream& in, Vec2D& v)
|
||||
{
|
||||
in >> v.x >> v.y;
|
||||
return in;
|
||||
}
|
||||
|
||||
operator float* ()
|
||||
{
|
||||
return (float*)this;
|
||||
}
|
||||
};
|
||||
|
||||
inline void rotate(float x0, float y0, float* x, float* y, float angle)
|
||||
{
|
||||
float xa = *x - x0, ya = *y - y0;
|
||||
*x = xa * cosf(angle) - ya * sinf(angle) + x0;
|
||||
*y = xa * sinf(angle) + ya * cosf(angle) + y0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -23,7 +23,7 @@
|
|||
#include <list>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef WIN32
|
||||
#if defined WIN32
|
||||
#include <Windows.h>
|
||||
#include <sys/stat.h>
|
||||
#include <direct.h>
|
||||
|
|
@ -49,6 +49,8 @@
|
|||
|
||||
#include "vmapexport.h"
|
||||
|
||||
#include "vmapexport.h"
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Defines
|
||||
|
||||
|
|
@ -105,7 +107,7 @@ bool preciseVectorData = false;
|
|||
|
||||
//static const char * szWorkDirMaps = ".\\Maps";
|
||||
const char* szWorkDirWmo = "./Buildings";
|
||||
const char* szRawVMAPMagic = "VMAP004";
|
||||
const char* szRawVMAPMagic = "VMAPc04";
|
||||
|
||||
bool LoadLocaleMPQFile(int locale)
|
||||
{
|
||||
|
|
@ -405,6 +407,7 @@ void ParsMapFiles()
|
|||
char fn[512];
|
||||
//char id_filename[64];
|
||||
char id[10];
|
||||
StringSet failedPaths;
|
||||
for (unsigned int i = 0; i < map_count; ++i)
|
||||
{
|
||||
sprintf(id, "%03u", map_ids[i].id);
|
||||
|
|
@ -420,7 +423,7 @@ void ParsMapFiles()
|
|||
if (ADTFile* ADT = WDT.GetMap(x, y))
|
||||
{
|
||||
//sprintf(id_filename,"%02u %02u %03u",x,y,map_ids[i].id);//!!!!!!!!!
|
||||
ADT->init(map_ids[i].id, x, y);
|
||||
ADT->init(map_ids[i].id, x, y, failedPaths);
|
||||
delete ADT;
|
||||
}
|
||||
}
|
||||
|
|
@ -430,6 +433,14 @@ void ParsMapFiles()
|
|||
printf("]\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (!failedPaths.empty())
|
||||
{
|
||||
printf("Warning: Some models could not be extracted, see below\n");
|
||||
for (StringSet::const_iterator itr = failedPaths.begin(); itr != failedPaths.end(); ++itr)
|
||||
printf("Could not find file of model %s\n", itr->c_str());
|
||||
printf("A few not found models can be expected and are not alarming.\n");
|
||||
}
|
||||
}
|
||||
|
||||
void getGamePath()
|
||||
|
|
@ -471,7 +482,7 @@ bool scan_patches(char* scanmatch, std::vector<std::string>& pArchiveNames)
|
|||
return(true);
|
||||
}
|
||||
|
||||
bool processArgv(int argc, char ** argv, const char *versionString)
|
||||
bool processArgv(int argc, char** argv)
|
||||
{
|
||||
bool result = true;
|
||||
bool hasInputPathParam = false;
|
||||
|
|
@ -520,7 +531,7 @@ bool processArgv(int argc, char ** argv, const char *versionString)
|
|||
|
||||
if (!result)
|
||||
{
|
||||
printf("Extract %s.\n",versionString);
|
||||
printf("Extract for %s.\n", szRawVMAPMagic);
|
||||
printf("%s [-?][-s][-l][-d <path>]\n", argv[0]);
|
||||
printf(" -s : (default) small size (data size optimization), ~500MB less vmap data.\n");
|
||||
printf(" -l : large size, ~500MB more vmap data. (might contain more details)\n");
|
||||
|
|
@ -548,10 +559,9 @@ bool processArgv(int argc, char ** argv, const char *versionString)
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
bool success = true;
|
||||
const char *versionString = "V4.00 2012_08";
|
||||
|
||||
// Use command line arguments, when some
|
||||
if(!processArgv(argc, argv, versionString))
|
||||
if (!processArgv(argc, argv))
|
||||
return 1;
|
||||
|
||||
// some simple check if working dir is dirty
|
||||
|
|
@ -570,7 +580,7 @@ int main(int argc, char ** argv)
|
|||
}
|
||||
}
|
||||
|
||||
printf("Extract %s. Beginning work ....\n",versionString);
|
||||
printf("Extract for %s. Beginning work ....\n", szRawVMAPMagic);
|
||||
//xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
||||
// Create the working directory
|
||||
if (mkdir(szWorkDirWmo
|
||||
|
|
@ -629,6 +639,8 @@ int main(int argc, char ** argv)
|
|||
ParsMapFiles();
|
||||
delete [] map_ids;
|
||||
//nError = ERROR_SUCCESS;
|
||||
// Extract models, listed in DameObjectDisplayInfo.dbc
|
||||
ExtractGameobjectModels();
|
||||
}
|
||||
|
||||
SFileCloseArchive(LocaleMpq);
|
||||
|
|
@ -637,11 +649,11 @@ int main(int argc, char ** argv)
|
|||
printf("\n");
|
||||
if (!success)
|
||||
{
|
||||
printf("ERROR: Extract %s. Work NOT complete.\n Precise vector data=%d.\nPress any key.\n",versionString, preciseVectorData);
|
||||
printf("ERROR: Extract for %s. Work NOT complete.\n Precise vector data=%d.\nPress any key.\n", szRawVMAPMagic, preciseVectorData);
|
||||
getchar();
|
||||
}
|
||||
|
||||
printf("Extract %s. Work complete. No errors.\n",versionString);
|
||||
printf("Extract for %s. Work complete. No errors.\n", szRawVMAPMagic);
|
||||
delete [] LiqType;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -20,6 +20,9 @@
|
|||
#define VMAPEXPORT_H
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
|
||||
typedef std::set<std::string> StringSet;
|
||||
|
||||
enum ModelFlags
|
||||
{
|
||||
|
|
@ -35,5 +38,8 @@ bool FileExists(const char * file);
|
|||
void strToLower(char* str);
|
||||
|
||||
bool ExtractSingleWmo(std::string& fname);
|
||||
bool ExtractSingleModel(std::string& fname, StringSet& failedPaths);
|
||||
|
||||
void ExtractGameobjectModels();
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
47
contrib/vmap_extractor/vmapextract/wdtfile.h
Normal file
47
contrib/vmap_extractor/vmapextract/wdtfile.h
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
/*
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef WDTFILE_H
|
||||
#define WDTFILE_H
|
||||
|
||||
#include "mpqfile.h"
|
||||
#include "wmo.h"
|
||||
#include <string>
|
||||
#include "stdlib.h"
|
||||
|
||||
class ADTFile;
|
||||
|
||||
class WDTFile
|
||||
{
|
||||
public:
|
||||
WDTFile(char* file_name, char* file_name1);
|
||||
~WDTFile(void);
|
||||
bool init(char* map_id, unsigned int mapID);
|
||||
|
||||
string* gWmoInstansName;
|
||||
int gnWMO, nMaps;
|
||||
|
||||
ADTFile* GetMap(int x, int z);
|
||||
|
||||
private:
|
||||
MPQFile WDT;
|
||||
bool maps[64][64];
|
||||
string filename;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
@ -44,7 +44,7 @@ bool WMORoot::open()
|
|||
MPQFile f(WorldMpq, filename.c_str());
|
||||
if (f.isEof())
|
||||
{
|
||||
printf("No such file.\n");
|
||||
printf("No such file %s.\n", filename.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -184,7 +184,6 @@ bool WMOGroup::open()
|
|||
f.read(&fogIdx, 4);
|
||||
f.read(&liquidType, 4);
|
||||
f.read(&groupWMOID, 4);
|
||||
|
||||
}
|
||||
else if (!strcmp(fourcc, "MOPY"))
|
||||
{
|
||||
136
contrib/vmap_extractor/vmapextract/wmo.h
Normal file
136
contrib/vmap_extractor/vmapextract/wmo.h
Normal file
|
|
@ -0,0 +1,136 @@
|
|||
/*
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef WMO_H
|
||||
#define WMO_H
|
||||
#define TILESIZE (533.33333f)
|
||||
#define CHUNKSIZE ((TILESIZE) / 16.0f)
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include "vec3d.h"
|
||||
#include "mpqfile.h"
|
||||
|
||||
// MOPY flags
|
||||
#define WMO_MATERIAL_NOCAMCOLLIDE 0x01
|
||||
#define WMO_MATERIAL_DETAIL 0x02
|
||||
#define WMO_MATERIAL_NO_COLLISION 0x04
|
||||
#define WMO_MATERIAL_HINT 0x08
|
||||
#define WMO_MATERIAL_RENDER 0x10
|
||||
#define WMO_MATERIAL_COLLIDE_HIT 0x20
|
||||
#define WMO_MATERIAL_WALL_SURFACE 0x40
|
||||
|
||||
class WMOInstance;
|
||||
class WMOManager;
|
||||
class MPQFile;
|
||||
|
||||
/* for whatever reason a certain company just can't stick to one coordinate system... */
|
||||
static inline Vec3D fixCoords(const Vec3D& v) { return Vec3D(v.z, v.x, v.y); }
|
||||
|
||||
class WMORoot
|
||||
{
|
||||
public:
|
||||
uint32 nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootWMOID, liquidType;
|
||||
unsigned int col;
|
||||
float bbcorn1[3];
|
||||
float bbcorn2[3];
|
||||
|
||||
WMORoot(std::string& filename);
|
||||
~WMORoot();
|
||||
|
||||
bool open();
|
||||
bool ConvertToVMAPRootWmo(FILE* output);
|
||||
private:
|
||||
std::string filename;
|
||||
char outfilename;
|
||||
};
|
||||
|
||||
struct WMOLiquidHeader
|
||||
{
|
||||
int xverts, yverts, xtiles, ytiles;
|
||||
float pos_x;
|
||||
float pos_y;
|
||||
float pos_z;
|
||||
short type;
|
||||
};
|
||||
|
||||
struct WMOLiquidVert
|
||||
{
|
||||
uint16 unk1;
|
||||
uint16 unk2;
|
||||
float height;
|
||||
};
|
||||
|
||||
class WMOGroup
|
||||
{
|
||||
public:
|
||||
// MOGP
|
||||
int groupName, descGroupName, mogpFlags;
|
||||
float bbcorn1[3];
|
||||
float bbcorn2[3];
|
||||
uint16 moprIdx;
|
||||
uint16 moprNItems;
|
||||
uint16 nBatchA;
|
||||
uint16 nBatchB;
|
||||
uint32 nBatchC, fogIdx, liquidType, groupWMOID;
|
||||
|
||||
int mopy_size, moba_size;
|
||||
int LiquEx_size;
|
||||
unsigned int nVertices; // number when loaded
|
||||
int nTriangles; // number when loaded
|
||||
char* MOPY;
|
||||
uint16* MOVI;
|
||||
uint16* MoviEx;
|
||||
float* MOVT;
|
||||
uint16* MOBA;
|
||||
int* MobaEx;
|
||||
WMOLiquidHeader* hlq;
|
||||
WMOLiquidVert* LiquEx;
|
||||
char* LiquBytes;
|
||||
uint32 liquflags;
|
||||
|
||||
WMOGroup(std::string& filename);
|
||||
~WMOGroup();
|
||||
|
||||
bool open();
|
||||
int ConvertToVMAPGroupWmo(FILE* output, WMORoot* rootWMO, bool pPreciseVectorData);
|
||||
|
||||
private:
|
||||
std::string filename;
|
||||
char outfilename;
|
||||
};
|
||||
|
||||
class WMOInstance
|
||||
{
|
||||
static std::set<int> ids;
|
||||
public:
|
||||
std::string MapName;
|
||||
int currx;
|
||||
int curry;
|
||||
WMOGroup* wmo;
|
||||
Vec3D pos;
|
||||
Vec3D pos2, pos3, rot;
|
||||
uint32 indx, id, d2, d3;
|
||||
int doodadset;
|
||||
|
||||
WMOInstance(MPQFile& f, const char* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE* pDirfile);
|
||||
|
||||
static void reset();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -12,7 +12,7 @@
|
|||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}</ProjectGuid>
|
||||
<RootNamespace>vmapExtractor4</RootNamespace>
|
||||
<RootNamespace>vmapExtractor</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
|
|
@ -86,6 +86,7 @@
|
|||
<ItemGroup>
|
||||
<ClCompile Include="..\..\vmapextract\adtfile.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\dbcfile.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\gameobject_extract.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\model.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\mpqfile.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\vmapexport.cpp" />
|
||||
113
contrib/vmap_extractor/win/VC110/vmapExtractor.vcxproj
Normal file
113
contrib/vmap_extractor/win/VC110/vmapExtractor.vcxproj
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}</ProjectGuid>
|
||||
<RootNamespace>vmapExtractor</RootNamespace>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup>
|
||||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\..\bin\$(Platform)_$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">..\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
|
||||
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\..\bin\$(Platform)_$(Configuration)\</OutDir>
|
||||
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">..\bin\$(ProjectName)__$(Platform)_$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\dep\StormLib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\..\..\dep\StormLib\bin\StormLib\$(Platform)\$(Configuration)AD;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<RandomizedBaseAddress>false</RandomizedBaseAddress>
|
||||
<DataExecutionPrevention>
|
||||
</DataExecutionPrevention>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>..\..\..\..\dep\StormLib\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>StormLibRAD.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<AdditionalLibraryDirectories>..\..\..\..\dep\StormLib\bin\StormLib\$(Platform)\$(Configuration)AD;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\vmapextract\adtfile.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\dbcfile.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\gameobject_extract.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\model.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\mpqfile.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\vmapexport.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\wdtfile.cpp" />
|
||||
<ClCompile Include="..\..\vmapextract\wmo.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\vmapextract\adtfile.h" />
|
||||
<ClInclude Include="..\..\vmapextract\dbcfile.h" />
|
||||
<ClInclude Include="..\..\vmapextract\model.h" />
|
||||
<ClInclude Include="..\..\vmapextract\modelheaders.h" />
|
||||
<ClInclude Include="..\..\vmapextract\mpqfile.h" />
|
||||
<ClInclude Include="..\..\vmapextract\vec3d.h" />
|
||||
<ClInclude Include="..\..\vmapextract\vmapexport.h" />
|
||||
<ClInclude Include="..\..\vmapextract\wdtfile.h" />
|
||||
<ClInclude Include="..\..\vmapextract\wmo.h" />
|
||||
<ClInclude Include="..\..\vmapextract\loadlib\loadlib.h" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\vmapextract\adtfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\vmapextract\dbcfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\vmapextract\model.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\vmapextract\mpqfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\vmapextract\vmapexport.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\vmapextract\wdtfile.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\vmapextract\wmo.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\vmapextract\gameobject_extract.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\vmapextract\dbcfile.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\adtfile.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\loadlib\loadlib.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\model.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\mpqfile.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\modelheaders.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\vmapexport.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\vec3d.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\wdtfile.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\vmapextract\wmo.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{77920bff-80f2-4d57-8efb-d36d461d04a4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{093fdfc3-8861-4d64-9c5e-4a58337b9c7e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -183,6 +183,10 @@
|
|||
RelativePath="..\..\vmapextract\dbcfile.h"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\vmapextract\gameobject_extract.cpp"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\..\vmapextract\model.cpp"
|
||||
>
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor4", "VC100\vmapExtractor4.vcxproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor", "VC100\vmapExtractor.vcxproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055} = {78424708-1F6E-4D4B-920C-FB6D26847055}
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C} = {B96F612A-C91D-43B3-A4C3-D4294817EC6C}
|
||||
116
contrib/vmap_extractor/win/vmapExtractor_VC110.sln
Normal file
116
contrib/vmap_extractor/win/vmapExtractor_VC110.sln
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor", "VC110\vmapExtractor.vcxproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055} = {78424708-1F6E-4D4B-920C-FB6D26847055}
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C} = {B96F612A-C91D-43B3-A4C3-D4294817EC6C}
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\..\..\win\VC110\zlib.vcxproj", "{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "bzip2", "..\..\..\win\VC110\bzip2.vcxproj", "{B96F612A-C91D-43B3-A4C3-D4294817EC6C}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StormLib", "..\..\..\dep\StormLib\StormLib_vc110.vcxproj", "{78424708-1F6E-4D4B-920C-FB6D26847055}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Win32 = Debug|Win32
|
||||
Debug|x64 = Debug|x64
|
||||
DebugAD|Win32 = DebugAD|Win32
|
||||
DebugAD|x64 = DebugAD|x64
|
||||
DebugAS|Win32 = DebugAS|Win32
|
||||
DebugAS|x64 = DebugAS|x64
|
||||
Release|Win32 = Release|Win32
|
||||
Release|x64 = Release|x64
|
||||
ReleaseAD|Win32 = ReleaseAD|Win32
|
||||
ReleaseAD|x64 = ReleaseAD|x64
|
||||
ReleaseAS|Win32 = ReleaseAS|Win32
|
||||
ReleaseAS|x64 = ReleaseAS|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.DebugAD|Win32.ActiveCfg = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.DebugAD|Win32.Build.0 = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.DebugAD|x64.ActiveCfg = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.DebugAS|Win32.ActiveCfg = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.DebugAS|Win32.Build.0 = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.DebugAS|x64.ActiveCfg = Debug|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Release|Win32.Build.0 = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.Release|x64.ActiveCfg = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.ReleaseAD|Win32.ActiveCfg = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.ReleaseAD|Win32.Build.0 = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.ReleaseAD|x64.ActiveCfg = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.ReleaseAS|Win32.ActiveCfg = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.ReleaseAS|Win32.Build.0 = Release|Win32
|
||||
{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}.ReleaseAS|x64.ActiveCfg = Release|Win32
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Debug|x64.Build.0 = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.DebugAD|Win32.ActiveCfg = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.DebugAD|x64.ActiveCfg = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.DebugAD|x64.Build.0 = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.DebugAS|Win32.ActiveCfg = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.DebugAS|x64.ActiveCfg = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.DebugAS|x64.Build.0 = Debug|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|Win32.Build.0 = Release|Win32
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.ActiveCfg = Release|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.Release|x64.Build.0 = Release|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.ReleaseAD|Win32.ActiveCfg = Release|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.ReleaseAD|x64.ActiveCfg = Release|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.ReleaseAD|x64.Build.0 = Release|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.ReleaseAS|Win32.ActiveCfg = Release|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.ReleaseAS|x64.ActiveCfg = Release|x64
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}.ReleaseAS|x64.Build.0 = Release|x64
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Debug|Win32.ActiveCfg = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Debug|Win32.Build.0 = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Debug|x64.ActiveCfg = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.DebugAD|Win32.ActiveCfg = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.DebugAD|Win32.Build.0 = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.DebugAD|x64.ActiveCfg = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.DebugAS|Win32.ActiveCfg = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.DebugAS|Win32.Build.0 = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.DebugAS|x64.ActiveCfg = Debug|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Release|Win32.ActiveCfg = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Release|Win32.Build.0 = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.Release|x64.ActiveCfg = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.ReleaseAD|Win32.ActiveCfg = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.ReleaseAD|Win32.Build.0 = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.ReleaseAD|x64.ActiveCfg = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.ReleaseAS|Win32.ActiveCfg = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.ReleaseAS|Win32.Build.0 = Release|Win32
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C}.ReleaseAS|x64.ActiveCfg = Release|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|Win32.ActiveCfg = DebugAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|Win32.Build.0 = DebugAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|x64.ActiveCfg = DebugAS|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Debug|x64.Build.0 = DebugAS|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|Win32.ActiveCfg = DebugAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|Win32.Build.0 = DebugAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|x64.ActiveCfg = DebugAD|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAD|x64.Build.0 = DebugAD|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|Win32.ActiveCfg = DebugAS|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|Win32.Build.0 = DebugAS|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|x64.ActiveCfg = DebugAS|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.DebugAS|x64.Build.0 = DebugAS|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Release|Win32.ActiveCfg = ReleaseAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Release|Win32.Build.0 = ReleaseAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Release|x64.ActiveCfg = ReleaseAS|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.Release|x64.Build.0 = ReleaseAS|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|Win32.ActiveCfg = ReleaseAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|Win32.Build.0 = ReleaseAD|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|x64.ActiveCfg = ReleaseAD|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAD|x64.Build.0 = ReleaseAD|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|Win32.ActiveCfg = ReleaseAS|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|Win32.Build.0 = ReleaseAS|Win32
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|x64.ActiveCfg = ReleaseAS|x64
|
||||
{78424708-1F6E-4D4B-920C-FB6D26847055}.ReleaseAS|x64.Build.0 = ReleaseAS|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
Microsoft Visual Studio Solution File, Format Version 10.00
|
||||
# Visual Studio 2008
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor3", "VC90\vmapExtractor3.vcproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vmapExtractor", "VC90\vmapExtractor.vcproj", "{D4624B20-AC1E-4EE9-8C9C-0FB65EEE3393}"
|
||||
ProjectSection(ProjectDependencies) = postProject
|
||||
{B96F612A-C91D-43B3-A4C3-D4294817EC6C} = {B96F612A-C91D-43B3-A4C3-D4294817EC6C}
|
||||
{8F1DEA42-6A5B-4B62-839D-C141A7BFACF2} = {8F1DEA42-6A5B-4B62-839D-C141A7BFACF2}
|
||||
|
|
@ -1,46 +0,0 @@
|
|||
@echo off
|
||||
cls
|
||||
echo.
|
||||
echo Welcome to the vmaps extractor and assembler
|
||||
echo.
|
||||
echo You need 2GB of free space in disk, CTRL+C to stop process
|
||||
echo Hit Enter to start . . .
|
||||
pause>nul
|
||||
cls
|
||||
echo.
|
||||
echo.
|
||||
echo.
|
||||
IF EXIST buildings\dir (ECHO The buildings folder already exist do you want to delete it?
|
||||
echo If YES hit Enter to continue if no CLOSE the program now! . . .
|
||||
pause>nul
|
||||
DEL /S /Q buildings)
|
||||
vmapExtractor4.exe
|
||||
cls
|
||||
echo.
|
||||
echo.
|
||||
echo.
|
||||
IF NOT %ERRORLEVEL% LEQ 1 (echo The vmap extract tool finalized with errors.
|
||||
echo Hit Enter to continue . . .
|
||||
pause>nul)
|
||||
cls
|
||||
echo.
|
||||
echo.
|
||||
echo.
|
||||
echo Vmaps extracted check log.txt for errors, now it's time to assemble the vmaps press any key to continue . . .
|
||||
pause>nul
|
||||
md vmaps
|
||||
vmap_assembler.exe buildings vmaps
|
||||
cls
|
||||
echo.
|
||||
echo.
|
||||
echo.
|
||||
IF NOT %ERRORLEVEL% LEQ 1 (echo The vmap assembler tool finalized with errors.
|
||||
echo Hit Enter to continue . . .
|
||||
pause>nul)
|
||||
cls
|
||||
echo.
|
||||
echo.
|
||||
echo.
|
||||
echo Process done! copy vmaps folder to the MaNGOS main directory
|
||||
echo Press any key to exit . . .
|
||||
pause>nul
|
||||
|
|
@ -1,230 +0,0 @@
|
|||
#ifndef VEC3D_H
|
||||
#define VEC3D_H
|
||||
|
||||
#include <iostream>
|
||||
#include <cmath>
|
||||
|
||||
class Vec3D
|
||||
{
|
||||
public:
|
||||
float x,y,z;
|
||||
|
||||
Vec3D(float x0 = 0.0f, float y0 = 0.0f, float z0 = 0.0f) : x(x0), y(y0), z(z0) {}
|
||||
|
||||
Vec3D(const Vec3D& v) : x(v.x), y(v.y), z(v.z) {}
|
||||
|
||||
Vec3D& operator= (const Vec3D &v) {
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
z = v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D operator+ (const Vec3D &v) const
|
||||
{
|
||||
Vec3D r(x+v.x,y+v.y,z+v.z);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vec3D operator- (const Vec3D &v) const
|
||||
{
|
||||
Vec3D r(x-v.x,y-v.y,z-v.z);
|
||||
return r;
|
||||
}
|
||||
|
||||
float operator* (const Vec3D &v) const
|
||||
{
|
||||
return x*v.x + y*v.y + z*v.z;
|
||||
}
|
||||
|
||||
Vec3D operator* (float d) const
|
||||
{
|
||||
Vec3D r(x*d,y*d,z*d);
|
||||
return r;
|
||||
}
|
||||
|
||||
friend Vec3D operator* (float d, const Vec3D& v)
|
||||
{
|
||||
return v * d;
|
||||
}
|
||||
|
||||
Vec3D operator% (const Vec3D &v) const
|
||||
{
|
||||
Vec3D r(y*v.z-z*v.y, z*v.x-x*v.z, x*v.y-y*v.x);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vec3D& operator+= (const Vec3D &v)
|
||||
{
|
||||
x += v.x;
|
||||
y += v.y;
|
||||
z += v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D& operator-= (const Vec3D &v)
|
||||
{
|
||||
x -= v.x;
|
||||
y -= v.y;
|
||||
z -= v.z;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D& operator*= (float d)
|
||||
{
|
||||
x *= d;
|
||||
y *= d;
|
||||
z *= d;
|
||||
return *this;
|
||||
}
|
||||
|
||||
float lengthSquared() const
|
||||
{
|
||||
return x*x+y*y+z*z;
|
||||
}
|
||||
|
||||
float length() const
|
||||
{
|
||||
return sqrt(x*x+y*y+z*z);
|
||||
}
|
||||
|
||||
Vec3D& normalize()
|
||||
{
|
||||
this->operator*= (1.0f/length());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec3D operator~ () const
|
||||
{
|
||||
Vec3D r(*this);
|
||||
r.normalize();
|
||||
return r;
|
||||
}
|
||||
|
||||
friend std::istream& operator>>(std::istream& in, Vec3D& v)
|
||||
{
|
||||
in >> v.x >> v.y >> v.z;
|
||||
return in;
|
||||
}
|
||||
|
||||
friend std::ostream& operator<<(std::ostream& out, const Vec3D& v)
|
||||
{
|
||||
out << v.x << " " << v.y << " " << v.z;
|
||||
return out;
|
||||
}
|
||||
|
||||
operator float*()
|
||||
{
|
||||
return (float*)this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Vec2D
|
||||
{
|
||||
public:
|
||||
float x,y;
|
||||
|
||||
Vec2D(float x0 = 0.0f, float y0 = 0.0f) : x(x0), y(y0) {}
|
||||
|
||||
Vec2D(const Vec2D& v) : x(v.x), y(v.y) {}
|
||||
|
||||
Vec2D& operator= (const Vec2D &v) {
|
||||
x = v.x;
|
||||
y = v.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D operator+ (const Vec2D &v) const
|
||||
{
|
||||
Vec2D r(x+v.x,y+v.y);
|
||||
return r;
|
||||
}
|
||||
|
||||
Vec2D operator- (const Vec2D &v) const
|
||||
{
|
||||
Vec2D r(x-v.x,y-v.y);
|
||||
return r;
|
||||
}
|
||||
|
||||
float operator* (const Vec2D &v) const
|
||||
{
|
||||
return x*v.x + y*v.y;
|
||||
}
|
||||
|
||||
Vec2D operator* (float d) const
|
||||
{
|
||||
Vec2D r(x*d,y*d);
|
||||
return r;
|
||||
}
|
||||
|
||||
friend Vec2D operator* (float d, const Vec2D& v)
|
||||
{
|
||||
return v * d;
|
||||
}
|
||||
|
||||
Vec2D& operator+= (const Vec2D &v)
|
||||
{
|
||||
x += v.x;
|
||||
y += v.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D& operator-= (const Vec2D &v)
|
||||
{
|
||||
x -= v.x;
|
||||
y -= v.y;
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D& operator*= (float d)
|
||||
{
|
||||
x *= d;
|
||||
y *= d;
|
||||
return *this;
|
||||
}
|
||||
|
||||
float lengthSquared() const
|
||||
{
|
||||
return x*x+y*y;
|
||||
}
|
||||
|
||||
float length() const
|
||||
{
|
||||
return sqrt(x*x+y*y);
|
||||
}
|
||||
|
||||
Vec2D& normalize()
|
||||
{
|
||||
this->operator*= (1.0f/length());
|
||||
return *this;
|
||||
}
|
||||
|
||||
Vec2D operator~ () const
|
||||
{
|
||||
Vec2D r(*this);
|
||||
r.normalize();
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
friend std::istream& operator>>(std::istream& in, Vec2D& v)
|
||||
{
|
||||
in >> v.x >> v.y;
|
||||
return in;
|
||||
}
|
||||
|
||||
operator float*()
|
||||
{
|
||||
return (float*)this;
|
||||
}
|
||||
};
|
||||
|
||||
inline void rotate(float x0, float y0, float *x, float *y, float angle)
|
||||
{
|
||||
float xa = *x - x0, ya = *y - y0;
|
||||
*x = xa*cosf(angle) - ya*sinf(angle) + x0;
|
||||
*y = xa*sinf(angle) + ya*cosf(angle) + y0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
#ifndef WDTFILE_H
|
||||
#define WDTFILE_H
|
||||
|
||||
#include "mpqfile.h"
|
||||
#include "wmo.h"
|
||||
#include <string>
|
||||
#include "stdlib.h"
|
||||
|
||||
class ADTFile;
|
||||
|
||||
class WDTFile
|
||||
{
|
||||
public:
|
||||
WDTFile(char* file_name, char* file_name1);
|
||||
~WDTFile(void);
|
||||
bool init(char *map_id, unsigned int mapID);
|
||||
|
||||
string* gWmoInstansName;
|
||||
int gnWMO, nMaps;
|
||||
|
||||
ADTFile* GetMap(int x, int z);
|
||||
|
||||
private:
|
||||
MPQFile WDT;
|
||||
bool maps[64][64];
|
||||
string filename;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,136 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program 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 this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef WMO_H
|
||||
#define WMO_H
|
||||
#define TILESIZE (533.33333f)
|
||||
#define CHUNKSIZE ((TILESIZE) / 16.0f)
|
||||
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include "vec3d.h"
|
||||
#include "mpqfile.h"
|
||||
|
||||
// MOPY flags
|
||||
#define WMO_MATERIAL_NOCAMCOLLIDE 0x01
|
||||
#define WMO_MATERIAL_DETAIL 0x02
|
||||
#define WMO_MATERIAL_NO_COLLISION 0x04
|
||||
#define WMO_MATERIAL_HINT 0x08
|
||||
#define WMO_MATERIAL_RENDER 0x10
|
||||
#define WMO_MATERIAL_COLLIDE_HIT 0x20
|
||||
#define WMO_MATERIAL_WALL_SURFACE 0x40
|
||||
|
||||
class WMOInstance;
|
||||
class WMOManager;
|
||||
class MPQFile;
|
||||
|
||||
/* for whatever reason a certain company just can't stick to one coordinate system... */
|
||||
static inline Vec3D fixCoords(const Vec3D &v){ return Vec3D(v.z, v.x, v.y); }
|
||||
|
||||
class WMORoot
|
||||
{
|
||||
public:
|
||||
uint32 nTextures, nGroups, nP, nLights, nModels, nDoodads, nDoodadSets, RootWMOID, liquidType;
|
||||
unsigned int col;
|
||||
float bbcorn1[3];
|
||||
float bbcorn2[3];
|
||||
|
||||
WMORoot(std::string &filename);
|
||||
~WMORoot();
|
||||
|
||||
bool open();
|
||||
bool ConvertToVMAPRootWmo(FILE *output);
|
||||
private:
|
||||
std::string filename;
|
||||
char outfilename;
|
||||
};
|
||||
|
||||
struct WMOLiquidHeader
|
||||
{
|
||||
int xverts, yverts, xtiles, ytiles;
|
||||
float pos_x;
|
||||
float pos_y;
|
||||
float pos_z;
|
||||
short type;
|
||||
};
|
||||
|
||||
struct WMOLiquidVert
|
||||
{
|
||||
uint16 unk1;
|
||||
uint16 unk2;
|
||||
float height;
|
||||
};
|
||||
|
||||
class WMOGroup
|
||||
{
|
||||
public:
|
||||
// MOGP
|
||||
int groupName, descGroupName, mogpFlags;
|
||||
float bbcorn1[3];
|
||||
float bbcorn2[3];
|
||||
uint16 moprIdx;
|
||||
uint16 moprNItems;
|
||||
uint16 nBatchA;
|
||||
uint16 nBatchB;
|
||||
uint32 nBatchC, fogIdx, liquidType, groupWMOID;
|
||||
|
||||
int mopy_size,moba_size;
|
||||
int LiquEx_size;
|
||||
unsigned int nVertices; // number when loaded
|
||||
int nTriangles; // number when loaded
|
||||
char *MOPY;
|
||||
uint16 *MOVI;
|
||||
uint16 *MoviEx;
|
||||
float *MOVT;
|
||||
uint16 *MOBA;
|
||||
int *MobaEx;
|
||||
WMOLiquidHeader *hlq;
|
||||
WMOLiquidVert *LiquEx;
|
||||
char *LiquBytes;
|
||||
uint32 liquflags;
|
||||
|
||||
WMOGroup(std::string &filename);
|
||||
~WMOGroup();
|
||||
|
||||
bool open();
|
||||
int ConvertToVMAPGroupWmo(FILE *output, WMORoot *rootWMO, bool pPreciseVectorData);
|
||||
|
||||
private:
|
||||
std::string filename;
|
||||
char outfilename;
|
||||
};
|
||||
|
||||
class WMOInstance
|
||||
{
|
||||
static std::set<int> ids;
|
||||
public:
|
||||
std::string MapName;
|
||||
int currx;
|
||||
int curry;
|
||||
WMOGroup *wmo;
|
||||
Vec3D pos;
|
||||
Vec3D pos2, pos3, rot;
|
||||
uint32 indx,id, d2, d3;
|
||||
int doodadset;
|
||||
|
||||
WMOInstance(MPQFile &f,const char* WmoInstName, uint32 mapID, uint32 tileX, uint32 tileY, FILE *pDirfile);
|
||||
|
||||
static void reset();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2011 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
## Script processing
|
||||
-- --------------------------
|
||||
|
||||
Copyright (C) 2010-2012 MaNGOS <http://getmangos.com/>
|
||||
This file is part of the Continued-MaNGOS Project
|
||||
|
||||
-- --------------------------
|
||||
## id
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
= MaNGOS -- README =
|
||||
|
||||
Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
This file is part of the Continued-MaNGOS Project
|
||||
|
||||
See the COPYING file for copying conditions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
= MaNGOS -- README =
|
||||
|
||||
Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
This file is part of the Continued-MaNGOS Project
|
||||
|
||||
See the COPYING file for copying conditions.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://www.mangosproject.org/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# Copyright (C) 2005-2012 MaNGOS project <http://getmangos.com/>
|
||||
# This file is part of the Continued-MaNGOS Project
|
||||
#
|
||||
# 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (C) 2005-2012 MaNGOS <http://getmangos.com/>
|
||||
* This file is part of the Continued-MaNGOS Project
|
||||
*
|
||||
* 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
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue