diff options
author | hemagx <hemagx2@gmail.com> | 2016-03-01 08:16:37 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-07-12 20:58:44 +0200 |
commit | d0358265beff02fd9c094ba480f1a9583035cf64 (patch) | |
tree | 6c8433dfda39ba19a721e66f70b0f11fce45eeeb /src/map | |
parent | b0a4a441f582810c91aeec458fdbe7cc6cc78db9 (diff) | |
download | hercules-d0358265beff02fd9c094ba480f1a9583035cf64.tar.gz hercules-d0358265beff02fd9c094ba480f1a9583035cf64.tar.bz2 hercules-d0358265beff02fd9c094ba480f1a9583035cf64.tar.xz hercules-d0358265beff02fd9c094ba480f1a9583035cf64.zip |
Interface grfio.c
Diffstat (limited to 'src/map')
-rw-r--r-- | src/map/clif.c | 5 | ||||
-rw-r--r-- | src/map/map.c | 18 |
2 files changed, 12 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c index 9619a7201..3069e95ad 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) 2012-2016 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -12878,7 +12878,8 @@ bool clif_validate_emblem(const uint8 *emblem, unsigned long emblem_len) { int header = 0, bitmap = 0, offbits = 0, palettesize = 0; nullpo_retr(false, emblem); - if( decode_zip(buf, &buf_len, emblem, emblem_len) != 0 || buf_len < BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE + if (grfio->decode_zip(buf, &buf_len, emblem, emblem_len) != 0 + || buf_len < BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE || RBUFW(buf,0) != 0x4d42 // BITMAPFILEHEADER.bfType (signature) || RBUFL(buf,2) != buf_len // BITMAPFILEHEADER.bfSize (file size) || RBUFL(buf,14) != BITMAPINFOHEADER_SIZE // BITMAPINFOHEADER.biSize (other headers are not supported) diff --git a/src/map/map.c b/src/map/map.c index 30c849ed1..491f6fb59 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2,7 +2,7 @@ * This file is part of Hercules. * http://herc.ws - http://github.com/HerculesWS/Hercules * - * Copyright (C) 2012-2015 Hercules Dev Team + * Copyright (C) 2012-2016 Hercules Dev Team * Copyright (C) Athena Dev Teams * * Hercules is free software: you can redistribute it and/or modify @@ -2851,7 +2851,7 @@ void map_cellfromcache(struct map_data *m) { size = (unsigned long)info->xs*(unsigned long)info->ys; // TO-DO: Maybe handle the scenario, if the decoded buffer isn't the same size as expected? [Shinryo] - decode_zip(decode_buffer, &size, m->cellPos+sizeof(struct map_cache_map_info), info->len); + grfio->decode_zip(decode_buffer, &size, m->cellPos+sizeof(struct map_cache_map_info), info->len); CREATE(m->cell, struct mapcell, size); // Set cell properties @@ -3585,11 +3585,11 @@ int map_waterheight(char* mapname) //Look up for the rsw snprintf(fn, sizeof(fn), "data\\%s.rsw", mapname); - if ( (found = grfio_find_file(fn)) ) + if ((found = grfio->find_file(fn))) safestrncpy(fn, found, sizeof(fn)); // replace with real name // read & convert fn - rsw = (char *) grfio_read (fn); + rsw = grfio_read(fn); if (rsw) { //Load water height from file int wh = (int) *(float*)(rsw+166); @@ -3613,7 +3613,7 @@ int map_readgat (struct map_data* m) nullpo_ret(m); sprintf(filename, "data\\%s.gat", m->name); - gat = (uint8 *) grfio_read(filename); + gat = grfio_read(filename); if (gat == NULL) return 0; @@ -5677,8 +5677,8 @@ int do_final(void) { map->map_db->destroy(map->map_db, map->db_final); mapindex->final(); - if(map->enable_grf) - grfio_final(); + if (map->enable_grf) + grfio->final(); db_destroy(map->id_db); db_destroy(map->pc_db); @@ -6122,8 +6122,8 @@ int do_init(int argc, char *argv[]) } } - if(map->enable_grf) - grfio_init(map->GRF_PATH_FILENAME); + if (map->enable_grf) + grfio->init(map->GRF_PATH_FILENAME); map->readallmaps(); |