Jump to content

testter

Members
  • Posts

    6
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by testter

  1. Use: CMakeLists.txt file for allowing the build of vmap_assembler on non-windoze platforms (linux,bsd,osx).

    Patch against: (not a patch

    stupid-ul:mangos imbecile$ git log -1
    commit 14f969c72bcd18989e6234f2cfdc99c78d2f712c
    Author: VladimirMangos <[email protected]>
    Date:   Mon Mar 8 01:07:05 2010 +0300
    
       [9549] One more typo 

    Devs: Imbecile (me by another name)

    Code: Code is on paste2.org here

    diff --git a/contrib/vmap_assembler/CMakeLists.txt b/contrib/vmap_assembler/CMakeLists.txt
    new file mode 100644
    index 0000000..bef5e31
    --- /dev/null
    +++ b/contrib/vmap_assembler/CMakeLists.txt
    @@ -0,0 +1,40 @@
    +# Copyright (C) 2005-2010 MaNGOS project <http://getmangos.eu/>
    +#
    +# 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.
    +
    +cmake_minimum_required (VERSION 2.6)
    +project (VMAP_ASSEMBLER)
    +
    +if(DIST_ROOT_DIR)
    +message(STATUS "Using dist root dir : ${DIST_ROOT_DIR}")
    +include_directories (${DIST_ROOT_DIR}/src/shared/vmap) 
    +include_directories (${DIST_ROOT_DIR}/dep/include/g3dlite) 
    +else(DIST_ROOT_DIR)
    +message(SEND_ERROR "** Distributtion's root directory not found. Please specify")
    +message(SEND_ERROR "** mangos/trinitycore distrib root directory with -DDIST_ROOT_DIR")
    +return()
    +endif(DIST_ROOT_DIR)
    +
    +if(G3D_LIB)
    +message(STATUS "Using G3D lib : ${G3D_LIB}")
    +else(G3D_LIB)
    +message(SEND_ERROR "** G3D lib not found. Please specify with -DG3D_LIB")
    +return()
    +endif(G3D_LIB)
    +
    +if(VMAP_LIB)
    +message(STATUS "Using G3D lib : ${VMAP_LIB}")
    +else(VMAP_LIB)
    +message(SEND_ERROR "** VMAP lib not found. Please specify with -DVMAP_LIB")
    +return()
    +endif(VMAP_LIB)
    +
    +add_executable (vmap_assembler vmap_assembler.cpp)
    +
    +target_link_libraries(vmap_assembler ${G3D_LIB} ${VMAP_LIB})

  2. It is not critical, but then it's about the mindset :)

    Reason: This gives a small runtime speed boost (0.01%) to the extractor, along with

    Patch against 9541

    commit b156b0b4525cb9f406ba06a07f08c8716348c006
    Author: pasdVn <[email protected]>
    Date:   Sat Mar 6 22:20:03 2010 +0300
    
       [9541] Implement first target of spell 1064 and ranks boost from 61301.
    
       Signed-off-by: VladimirMangos <[email protected]>

    Devs: imbecile

    The patch is here

    diff --git a/contrib/extractor/libmpq/common.cpp b/contrib/extractor/libmpq/common.cpp
    index 8ce8646..e43a716 100644
    --- a/contrib/extractor/libmpq/common.cpp
    +++ b/contrib/extractor/libmpq/common.cpp
    @@ -34,17 +34,6 @@
    #include "common.h"
    #include <ctype.h>
    
    -unsigned int libmpq_lseek(mpq_archive* mpq_a, unsigned int pos)
    -{
    -#ifdef WIN32
    -    return (unsigned int)_lseeki64(mpq_a->fd, pos, SEEK_SET);
    -#elif defined(__APPLE__)
    -    return (unsigned int)lseek(mpq_a->fd, pos, SEEK_SET);
    -#else
    -    return (unsigned int)lseek64(mpq_a->fd, pos, SEEK_SET);
    -#endif
    -}
    -
    /*
     *  This function decrypts a MPQ block.
     */
    @@ -411,7 +400,7 @@ int libmpq_read_hashtable(mpq_archive *mpq_a) {
        /* Read the hash table into the buffer */
        bytes = mpq_a->header->hashtablesize * sizeof(mpq_hash);
    
    -    libmpq_lseek(mpq_a, mpq_a->header->hashtablepos);
    +    libmpq_lseek(mpq_a->fd, mpq_a->header->hashtablepos,SEEK_SET);
    
        rb = _read(mpq_a->fd, mpq_a->hashtable, bytes);
        if (rb != bytes) {
    @@ -466,7 +455,7 @@ int libmpq_read_blocktable(mpq_archive *mpq_a) {
        bytes = mpq_a->header->blocktablesize * sizeof(mpq_block);
        memset(mpq_a->blocktable, 0, mpq_a->header->blocktablesize * sizeof(mpq_block));
    
    -    libmpq_lseek(mpq_a, mpq_a->header->blocktablepos);
    +    libmpq_lseek(mpq_a->fd, mpq_a->header->blocktablepos,SEEK_SET);
    
        rb = _read(mpq_a->fd, mpq_a->blocktable, bytes);
        if (rb != bytes) {
    @@ -526,7 +515,7 @@ int libmpq_file_read_block(mpq_archive *mpq_a, mpq_file *mpq_f, unsigned int blo
            unsigned int nread;
    
            if (mpq_f->mpq_b->filepos != mpq_a->filepos) {
    -            libmpq_lseek(mpq_a, mpq_f->mpq_b->filepos);
    +            libmpq_lseek(mpq_a->fd, mpq_f->mpq_b->filepos,SEEK_SET);
            }
    
            /* Read block positions from begin of file. */
    @@ -571,7 +560,7 @@ int libmpq_file_read_block(mpq_archive *mpq_a, mpq_file *mpq_f, unsigned int blo
                if (mpq_f->blockpos[0] != nread) {
    
                    /* Try once again to detect file seed and decrypt the blocks */
    -                libmpq_lseek(mpq_a, mpq_f->mpq_b->filepos);
    +                libmpq_lseek(mpq_a->fd, mpq_f->mpq_b->filepos,SEEK_SET);
    
                    nread = _read(mpq_a->fd, mpq_f->blockpos, (mpq_f->nblocks + 1) * sizeof(int));
                    mpq_f->seed = libmpq_detect_fileseed(mpq_a, mpq_f->blockpos, nread);
    @@ -608,7 +597,7 @@ int libmpq_file_read_block(mpq_archive *mpq_a, mpq_file *mpq_f, unsigned int blo
    
        /* Set file pointer, if necessary. */
        if (mpq_a->filepos != readpos) {
    -        mpq_a->filepos = libmpq_lseek(mpq_a, readpos);
    +        mpq_a->filepos = libmpq_lseek(mpq_a->fd, readpos,SEEK_SET);
        }
    
        /* 15018F87 - Read all requested blocks. */
    diff --git a/contrib/extractor/libmpq/common.h b/contrib/extractor/libmpq/common.h
    index 57b34e9..c7a0cb6 100644
    --- a/contrib/extractor/libmpq/common.h
    +++ b/contrib/extractor/libmpq/common.h
    @@ -71,4 +71,10 @@ int libmpq_conf_get_array(FILE *fp, char *search_value, char ***filelist, int *e
    int libmpq_free_listfile(char **filelist);
    int libmpq_read_listfile(mpq_archive *mpq_a, FILE *fp);
    
    -unsigned int libmpq_lseek(mpq_archive* mpq_a, unsigned int pos);
    +#ifdef WIN32
    +    #define libmpq_lseek _lseeki64
    +#elif defined(__APPLE__)
    +    #define libmpq_lseek lseek
    +#else
    +    #define libmpq_lseek lseek64
    +#endif
    diff --git a/contrib/extractor/libmpq/mpq.cpp b/contrib/extractor/libmpq/mpq.cpp
    index 9d60258..4c73983 100644
    --- a/contrib/extractor/libmpq/mpq.cpp
    +++ b/contrib/extractor/libmpq/mpq.cpp
    @@ -77,7 +77,7 @@ int libmpq_archive_open(mpq_archive *mpq_a, unsigned char *mpq_filename) {
        while (!ncnt) {
            mpq_a->header->id = 0;
    
    -        libmpq_lseek(mpq_a, mpq_a->mpqpos);
    +        libmpq_lseek(mpq_a->fd, mpq_a->mpqpos,SEEK_SET);
    
            rb = _read(mpq_a->fd, mpq_a->header, sizeof(mpq_header));

  3. Fix for: This patch fixes the compilation of the map and dbc extractor on linux, allowing for Mac OSX users to build the extractor and extract the DBCs and maps, without need of access to linux or windows.

    Version:

    stupid-ul:mangos imbecile$ git log -r -1
    commit c365a17a8f66a4a83b429ef6cb746d6f43afa9d6
    Author: VladimirMangos <[email protected]>
    Date:   Thu Mar 4 04:04:47 2010 +0300
    
       [9510] Gameobject casting improvements.
    
       * Add IsHostileTo/IsFriendlyTo and implement expected way checks for diff. world object types.
         For controlled object check redirected to specific owner, for wild gameobject base at gameobject faction.
         If faction not set expected to be hostile to anyone.
       * Update grid searchers to be usable with world object instead only unit case.
         Some grid searches lost redundent second object arg, AnyAoETargetUnitInObjectRangeCheck lost hitHidden arg
         (for hitHidden==true case added new AnyAoEVisibleTargetUnitInObjectRangeCheck)
       * Updated grid searchers used with gameobject area casts now.
         Note: Gameobject area spell cast animation will still wrong show around cast triggering target instead
         center around gameobject.
       * In case gameobject aura apply to target for restored use target itself as caster because
         we not have currently another way apply aura form wild gameobject.
    

    Lighthouse reference: None

    Devs: imbecile (my inaccessable alternate id on the forums)

    Code: paste2.org URL

    http://paste2.org/p/700261

    diff --git a/contrib/extractor/libmpq/common.cpp b/contrib/extractor/libmpq/common.cpp
    index 7b90208..9daf307 100644
    --- a/contrib/extractor/libmpq/common.cpp
    +++ b/contrib/extractor/libmpq/common.cpp
    @@ -22,7 +22,7 @@
    #define _CRT_SECURE_NO_DEPRECATE
    //#include <dirent.h>
    #include <sys/stat.h>
    -//#include <unistd.h>
    +#include <unistd.h>
    #include <stdlib.h>
    #include <string.h>
    #include <stdio.h>
    @@ -398,6 +398,8 @@ int libmpq_read_hashtable(mpq_archive *mpq_a) {
    
        #ifdef WIN32
            _lseeki64(mpq_a->fd, mpq_a->header->hashtablepos, SEEK_SET);
    +    #elif defined(__APPLE__)
    +        lseek(mpq_a->fd, mpq_a->header->hashtablepos, SEEK_SET);
        #else
            lseek64(mpq_a->fd, mpq_a->header->hashtablepos, SEEK_SET);
        #endif
    @@ -457,6 +459,8 @@ int libmpq_read_blocktable(mpq_archive *mpq_a) {
    
        #ifdef WIN32
            _lseeki64(mpq_a->fd, mpq_a->header->blocktablepos, SEEK_SET);
    +    #elif defined(__APPLE__)
    +        lseek(mpq_a->fd, mpq_a->header->blocktablepos, SEEK_SET);
        #else
            lseek64(mpq_a->fd, mpq_a->header->blocktablepos, SEEK_SET);
        #endif    
    @@ -521,6 +525,8 @@ int libmpq_file_read_block(mpq_archive *mpq_a, mpq_file *mpq_f, unsigned int blo
            if (mpq_f->mpq_b->filepos != mpq_a->filepos) {
            #ifdef WIN32
                _lseeki64(mpq_a->fd, mpq_f->mpq_b->filepos, SEEK_SET);
    +        #elif defined(__APPLE__)
    +            lseek(mpq_a->fd, mpq_f->mpq_b->filepos, SEEK_SET);
            #else
                lseek64(mpq_a->fd, mpq_f->mpq_b->filepos, SEEK_SET);
    
    @@ -572,6 +578,8 @@ int libmpq_file_read_block(mpq_archive *mpq_a, mpq_file *mpq_f, unsigned int blo
    
                    #ifdef WIN32
                        _lseeki64(mpq_a->fd, mpq_f->mpq_b->filepos, SEEK_SET);
    +                #elif defined(__APPLE__)
    +                    lseek(mpq_a->fd, mpq_f->mpq_b->filepos, SEEK_SET);
                    #else
                        lseek64(mpq_a->fd, mpq_f->mpq_b->filepos, SEEK_SET);
                    #endif                
    @@ -614,6 +622,8 @@ int libmpq_file_read_block(mpq_archive *mpq_a, mpq_file *mpq_f, unsigned int blo
    
            #ifdef WIN32
                mpq_a->filepos = _lseeki64(mpq_a->fd, readpos, SEEK_SET);
    +        #elif defined(__APPLE__)
    +            mpq_a->filepos = lseek(mpq_a->fd, readpos, SEEK_SET);
            #else
                mpq_a->filepos = lseek64(mpq_a->fd, readpos, SEEK_SET);
            #endif    
    diff --git a/contrib/extractor/libmpq/mpq.cpp b/contrib/extractor/libmpq/mpq.cpp
    index e40f15d..be78a0e 100644
    --- a/contrib/extractor/libmpq/mpq.cpp
    +++ b/contrib/extractor/libmpq/mpq.cpp
    @@ -78,6 +78,8 @@ int libmpq_archive_open(mpq_archive *mpq_a, unsigned char *mpq_filename) {
            mpq_a->header->id = 0;
            #ifdef WIN32
                _lseeki64(mpq_a->fd, mpq_a->mpqpos, SEEK_SET);
    +        #elif defined(__APPLE__)
    +            lseek(mpq_a->fd, mpq_a->mpqpos, SEEK_SET);
            #else
                lseek64(mpq_a->fd, mpq_a->mpqpos, SEEK_SET);
            #endif

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use