Files
TrinityCore/contrib/libmpq/FAQ
click e777161888 HIGHLY EXPERIMENTAL - USE AT YOUR OWN RISK
Implement the use of the new vmap3-format by Lynx3d (mad props to you for this, and thanks for the talks earlier)
+ reduced Vmap size to less than one third, and improve precision
+ indoor/outdoor check which allows automatic unmounting of players
+ additional area information from WMOAreaTable.dbc, removed existing "hacks"
+ WMO liquid information for swimming and fishing correctly in buildings/cities/caves/instances (lava and slime WILL hurt from now on!)
- buildfiles for windows are not properly done, and will need to be sorted out
NOTE: Do NOT annoy Lynx3d about this, any issues with this "port" is entirely our fault !
THIS REVISION IS CONSIDERED UNSTABLE AND CONTAINS WORK IN PROGRESS - USE AT YOUR OWN RISK!

--HG--
branch : trunk
2010-06-05 00:59:25 +02:00

69 lines
2.1 KiB
Plaintext

FAQ - Frequently Asked Questions
================================
Q: What is libmpq?
A: libmpq is a library for manipulating MoPaQ mpq archives mostly used
used by Blizzard in their games.
Q: What can i do with libmpq?
A: With libmpq you can write applications which can extract, create
and manipulate mpq archives.
Q: Is it legal?
A: Yes, i think so. I have no idea why it should not, all informations
about the fileformat are available.
Q: Is there a description of the functions?
A: Since version 0.4.0 libmpq comes with a API documentation for
developers. The documentation is written as manual pages.
Q: Can i help?
A: Yes, help is needed, not only with developing, also with testing.
A good point to start is using a recent SVN version of libmpq and
trying to use it with every mpq archive you could get :)
Q: Can you give a small example to demonstrate the usage?
A: Of course :) The example below takes first parameter as mpq archive
and extracts the first file to a buffer.
/*
* Compile with:
*
* x86_32:
*
* gcc \
* -D_FILE_OFFSET_BITS=64 \
* -D_LARGE_FILES=1 \
* -D_LARGEFILE_SOURCE=1 \
* mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq
*
* x86_64:
*
* gcc \
* -D_LARGE_FILES=1 \
* mpq-example.c -o mpq-example -lmpq -lz -lbz2 -I/usr/local/include/libmpq
*/
#include <mpq.h>
#include <stdlib.h>
#include <limits.h>
int main(int argc, char **argv) {
mpq_archive_s *mpq_archive;
off_t out_size;
char *out_buf;
/* open the mpq archive given as first parameter. */
libmpq__archive_open(&mpq_archive, argv[1], -1);
/* get size of first file (0) and malloc output buffer. */
libmpq__file_unpacked_size(mpq_archive, 0, &out_size);
out_buf = malloc(out_size);
/* read, decrypt and unpack file to output buffer. */
libmpq__file_read(mpq_archive, 0, out_buf, out_size, NULL);
/* close the mpq archive. */
libmpq__archive_close(mpq_archive);
}