2017-07-13 10:26:03 +02:00
|
|
|
/*
|
2023-02-01 16:42:03 +02:00
|
|
|
* CDefFile.cpp, part of VCMI engine
|
2017-07-13 10:26:03 +02:00
|
|
|
*
|
|
|
|
* Authors: listed in file AUTHORS in main folder
|
|
|
|
*
|
|
|
|
* License: GNU General Public License v2.0 or later
|
|
|
|
* Full text of license available in license.txt file, in main folder
|
|
|
|
*
|
|
|
|
*/
|
2014-07-13 20:53:37 +03:00
|
|
|
|
2023-02-01 20:42:06 +02:00
|
|
|
#include "StdInc.h"
|
|
|
|
#include "CDefFile.h"
|
2022-09-18 14:47:49 +02:00
|
|
|
|
2023-02-01 20:42:06 +02:00
|
|
|
#include "IImageLoader.h"
|
2014-07-13 20:53:37 +03:00
|
|
|
|
2023-01-30 00:12:43 +02:00
|
|
|
#include "../../lib/filesystem/Filesystem.h"
|
2023-02-01 20:42:06 +02:00
|
|
|
#include "../../lib/Point.h"
|
2011-10-08 04:23:46 +03:00
|
|
|
|
2023-02-01 20:42:06 +02:00
|
|
|
#include <SDL_pixels.h>
|
2023-01-30 19:55:32 +02:00
|
|
|
|
2012-12-14 22:47:38 +03:00
|
|
|
// Extremely simple file cache. TODO: smarter, more general solution
|
|
|
|
class CFileCache
|
|
|
|
{
|
|
|
|
static const int cacheSize = 50; //Max number of cached files
|
|
|
|
struct FileData
|
|
|
|
{
|
2016-01-29 17:08:44 +02:00
|
|
|
ResourceID name;
|
|
|
|
size_t size;
|
|
|
|
std::unique_ptr<ui8[]> data;
|
2012-12-14 22:47:38 +03:00
|
|
|
|
2016-01-29 16:16:14 +02:00
|
|
|
std::unique_ptr<ui8[]> getCopy()
|
2012-12-14 22:47:38 +03:00
|
|
|
{
|
2016-01-29 16:16:14 +02:00
|
|
|
auto ret = std::unique_ptr<ui8[]>(new ui8[size]);
|
|
|
|
std::copy(data.get(), data.get() + size, ret.get());
|
2012-12-14 22:47:38 +03:00
|
|
|
return ret;
|
|
|
|
}
|
2016-01-29 16:16:14 +02:00
|
|
|
FileData(ResourceID name_, size_t size_, std::unique_ptr<ui8[]> data_):
|
|
|
|
name{std::move(name_)},
|
|
|
|
size{size_},
|
|
|
|
data{std::move(data_)}
|
2012-12-15 16:40:22 +03:00
|
|
|
{}
|
2012-12-14 22:47:38 +03:00
|
|
|
};
|
|
|
|
|
2016-01-29 16:16:14 +02:00
|
|
|
std::deque<FileData> cache;
|
2012-12-14 22:47:38 +03:00
|
|
|
public:
|
2016-01-29 16:16:14 +02:00
|
|
|
std::unique_ptr<ui8[]> getCachedFile(ResourceID rid)
|
2012-12-14 22:47:38 +03:00
|
|
|
{
|
2013-06-29 16:05:48 +03:00
|
|
|
for(auto & file : cache)
|
2012-12-14 22:47:38 +03:00
|
|
|
{
|
|
|
|
if (file.name == rid)
|
|
|
|
return file.getCopy();
|
|
|
|
}
|
|
|
|
// Still here? Cache miss
|
|
|
|
if (cache.size() > cacheSize)
|
|
|
|
cache.pop_front();
|
|
|
|
|
2013-07-28 17:49:50 +03:00
|
|
|
auto data = CResourceHandler::get()->load(rid)->readAll();
|
2016-01-29 16:16:14 +02:00
|
|
|
|
|
|
|
cache.emplace_back(std::move(rid), data.second, std::move(data.first));
|
2012-12-14 22:47:38 +03:00
|
|
|
|
|
|
|
return cache.back().getCopy();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2017-09-04 16:52:36 +02:00
|
|
|
enum class DefType : uint32_t
|
|
|
|
{
|
|
|
|
SPELL = 0x40,
|
2017-09-05 13:32:52 +02:00
|
|
|
SPRITE = 0x41,
|
2017-09-04 16:52:36 +02:00
|
|
|
CREATURE = 0x42,
|
|
|
|
MAP = 0x43,
|
|
|
|
MAP_HERO = 0x44,
|
|
|
|
TERRAIN = 0x45,
|
|
|
|
CURSOR = 0x46,
|
|
|
|
INTERFACE = 0x47,
|
2017-09-05 13:32:52 +02:00
|
|
|
SPRITE_FRAME = 0x48,
|
2017-09-04 16:52:36 +02:00
|
|
|
BATTLE_HERO = 0x49
|
|
|
|
};
|
|
|
|
|
2012-12-14 22:47:38 +03:00
|
|
|
static CFileCache animationCache;
|
|
|
|
|
2011-02-06 19:26:27 +02:00
|
|
|
/*************************************************************************
|
|
|
|
* DefFile, class used for def loading *
|
|
|
|
*************************************************************************/
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2017-09-03 22:38:15 +02:00
|
|
|
bool operator== (const SDL_Color & lhs, const SDL_Color & rhs)
|
|
|
|
{
|
|
|
|
return (lhs.a == rhs.a) && (lhs.b == rhs.b) &&(lhs.g == rhs.g) &&(lhs.r == rhs.r);
|
|
|
|
}
|
|
|
|
|
2011-02-06 19:26:27 +02:00
|
|
|
CDefFile::CDefFile(std::string Name):
|
2013-06-26 14:18:27 +03:00
|
|
|
data(nullptr),
|
|
|
|
palette(nullptr)
|
2011-02-06 19:26:27 +02:00
|
|
|
{
|
|
|
|
//First 8 colors in def palette used for transparency
|
|
|
|
static SDL_Color H3Palette[8] =
|
|
|
|
{
|
2022-12-14 12:04:37 +02:00
|
|
|
{ 0, 0, 0, 0},// transparency ( used in most images )
|
|
|
|
{ 0, 0, 0, 64},// shadow border ( used in battle, adventure map def's )
|
|
|
|
{ 0, 0, 0, 64},// shadow border ( used in fog-of-war def's )
|
|
|
|
{ 0, 0, 0, 128},// shadow body ( used in fog-of-war def's )
|
|
|
|
{ 0, 0, 0, 128},// shadow body ( used in battle, adventure map def's )
|
|
|
|
{ 0, 0, 0, 0},// selection ( used in battle def's )
|
|
|
|
{ 0, 0, 0, 128},// shadow body below selection ( used in battle def's )
|
|
|
|
{ 0, 0, 0, 64} // shadow border below selection ( used in battle def's )
|
2011-02-06 19:26:27 +02:00
|
|
|
};
|
2012-12-14 22:47:38 +03:00
|
|
|
data = animationCache.getCachedFile(ResourceID(std::string("SPRITES/") + Name, EResType::ANIMATION));
|
2011-02-06 19:26:27 +02:00
|
|
|
|
2016-01-29 16:16:14 +02:00
|
|
|
palette = std::unique_ptr<SDL_Color[]>(new SDL_Color[256]);
|
2011-02-06 19:26:27 +02:00
|
|
|
int it = 0;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2016-01-29 16:16:14 +02:00
|
|
|
ui32 type = read_le_u32(data.get() + it);
|
2011-02-06 19:26:27 +02:00
|
|
|
it+=4;
|
2011-10-08 04:23:46 +03:00
|
|
|
//int width = read_le_u32(data + it); it+=4;//not used
|
|
|
|
//int height = read_le_u32(data + it); it+=4;
|
2011-02-06 19:26:27 +02:00
|
|
|
it+=8;
|
2016-01-29 16:16:14 +02:00
|
|
|
ui32 totalBlocks = read_le_u32(data.get() + it);
|
2011-02-06 19:26:27 +02:00
|
|
|
it+=4;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
for (ui32 i= 0; i<256; i++)
|
2011-02-06 19:26:27 +02:00
|
|
|
{
|
|
|
|
palette[i].r = data[it++];
|
|
|
|
palette[i].g = data[it++];
|
|
|
|
palette[i].b = data[it++];
|
2015-09-02 17:49:29 +02:00
|
|
|
palette[i].a = SDL_ALPHA_OPAQUE;
|
2011-02-06 19:26:27 +02:00
|
|
|
}
|
2017-09-03 22:38:15 +02:00
|
|
|
|
2017-09-04 16:52:36 +02:00
|
|
|
switch(static_cast<DefType>(type))
|
|
|
|
{
|
|
|
|
case DefType::SPELL:
|
|
|
|
palette[0] = H3Palette[0];
|
|
|
|
break;
|
2017-09-05 13:32:52 +02:00
|
|
|
case DefType::SPRITE:
|
|
|
|
case DefType::SPRITE_FRAME:
|
|
|
|
for(ui32 i= 0; i<8; i++)
|
|
|
|
palette[i] = H3Palette[i];
|
|
|
|
break;
|
2017-09-04 16:52:36 +02:00
|
|
|
case DefType::CREATURE:
|
|
|
|
palette[0] = H3Palette[0];
|
|
|
|
palette[1] = H3Palette[1];
|
|
|
|
palette[4] = H3Palette[4];
|
|
|
|
palette[5] = H3Palette[5];
|
|
|
|
palette[6] = H3Palette[6];
|
|
|
|
palette[7] = H3Palette[7];
|
|
|
|
break;
|
|
|
|
case DefType::MAP:
|
|
|
|
case DefType::MAP_HERO:
|
|
|
|
palette[0] = H3Palette[0];
|
|
|
|
palette[1] = H3Palette[1];
|
|
|
|
palette[4] = H3Palette[4];
|
|
|
|
//5 = owner flag, handled separately
|
|
|
|
break;
|
|
|
|
case DefType::TERRAIN:
|
|
|
|
palette[0] = H3Palette[0];
|
|
|
|
palette[1] = H3Palette[1];
|
|
|
|
palette[2] = H3Palette[2];
|
|
|
|
palette[3] = H3Palette[3];
|
|
|
|
palette[4] = H3Palette[4];
|
|
|
|
break;
|
|
|
|
case DefType::CURSOR:
|
|
|
|
palette[0] = H3Palette[0];
|
|
|
|
break;
|
|
|
|
case DefType::INTERFACE:
|
|
|
|
palette[0] = H3Palette[0];
|
|
|
|
palette[1] = H3Palette[1];
|
|
|
|
palette[4] = H3Palette[4];
|
2017-09-05 13:32:52 +02:00
|
|
|
//player colors handled separately
|
|
|
|
//TODO: disallow colorizing other def types
|
2017-09-04 16:52:36 +02:00
|
|
|
break;
|
|
|
|
case DefType::BATTLE_HERO:
|
2017-09-05 13:32:52 +02:00
|
|
|
palette[0] = H3Palette[0];
|
|
|
|
palette[1] = H3Palette[1];
|
|
|
|
palette[4] = H3Palette[4];
|
2017-09-04 16:52:36 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
logAnim->error("Unknown def type %d in %s", type, Name);
|
|
|
|
break;
|
2017-09-03 22:38:15 +02:00
|
|
|
}
|
|
|
|
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
for (ui32 i=0; i<totalBlocks; i++)
|
2011-02-06 19:26:27 +02:00
|
|
|
{
|
2016-01-29 16:16:14 +02:00
|
|
|
size_t blockID = read_le_u32(data.get() + it);
|
2011-02-06 19:26:27 +02:00
|
|
|
it+=4;
|
2016-01-29 16:16:14 +02:00
|
|
|
size_t totalEntries = read_le_u32(data.get() + it);
|
2011-02-06 19:26:27 +02:00
|
|
|
it+=12;
|
|
|
|
//8 unknown bytes - skipping
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2011-02-06 19:26:27 +02:00
|
|
|
//13 bytes for name of every frame in this block - not used, skipping
|
2020-10-01 10:38:06 +02:00
|
|
|
it+= 13 * (int)totalEntries;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
for (ui32 j=0; j<totalEntries; j++)
|
2011-02-06 19:26:27 +02:00
|
|
|
{
|
2016-01-29 16:16:14 +02:00
|
|
|
size_t currOffset = read_le_u32(data.get() + it);
|
2011-02-06 19:26:27 +02:00
|
|
|
offset[blockID].push_back(currOffset);
|
|
|
|
it += 4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2023-02-01 20:42:06 +02:00
|
|
|
void CDefFile::loadFrame(size_t frame, size_t group, IImageLoader &loader) const
|
2011-02-06 19:26:27 +02:00
|
|
|
{
|
|
|
|
std::map<size_t, std::vector <size_t> >::const_iterator it;
|
|
|
|
it = offset.find(group);
|
|
|
|
assert (it != offset.end());
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2016-01-29 16:16:14 +02:00
|
|
|
const ui8 * FDef = data.get()+it->second[frame];
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2011-02-06 19:26:27 +02:00
|
|
|
const SSpriteDef sd = * reinterpret_cast<const SSpriteDef *>(FDef);
|
|
|
|
SSpriteDef sprite;
|
|
|
|
|
2013-02-05 22:56:28 +03:00
|
|
|
sprite.format = read_le_u32(&sd.format);
|
|
|
|
sprite.fullWidth = read_le_u32(&sd.fullWidth);
|
|
|
|
sprite.fullHeight = read_le_u32(&sd.fullHeight);
|
|
|
|
sprite.width = read_le_u32(&sd.width);
|
|
|
|
sprite.height = read_le_u32(&sd.height);
|
|
|
|
sprite.leftMargin = read_le_u32(&sd.leftMargin);
|
|
|
|
sprite.topMargin = read_le_u32(&sd.topMargin);
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2011-12-14 00:23:17 +03:00
|
|
|
ui32 currentOffset = sizeof(SSpriteDef);
|
2018-03-22 03:33:15 +02:00
|
|
|
|
|
|
|
//special case for some "old" format defs (SGTWMTA.DEF and SGTWMTB.DEF)
|
|
|
|
|
|
|
|
if(sprite.format == 1 && sprite.width > sprite.fullWidth && sprite.height > sprite.fullHeight)
|
|
|
|
{
|
|
|
|
sprite.leftMargin = 0;
|
|
|
|
sprite.topMargin = 0;
|
|
|
|
sprite.width = sprite.fullWidth;
|
|
|
|
sprite.height = sprite.fullHeight;
|
|
|
|
|
|
|
|
currentOffset -= 16;
|
|
|
|
}
|
|
|
|
|
|
|
|
const ui32 BaseOffset = currentOffset;
|
2010-11-18 15:34:21 +02:00
|
|
|
|
2011-12-22 16:05:19 +03:00
|
|
|
loader.init(Point(sprite.width, sprite.height),
|
2020-10-06 01:27:04 +02:00
|
|
|
Point(sprite.leftMargin, sprite.topMargin),
|
|
|
|
Point(sprite.fullWidth, sprite.fullHeight), palette.get());
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
switch(sprite.format)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
{
|
2011-02-06 19:26:27 +02:00
|
|
|
//pixel data is not compressed, copy data to surface
|
2018-03-22 03:33:15 +02:00
|
|
|
for(ui32 i=0; i<sprite.height; i++)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.load(sprite.width, FDef + currentOffset);
|
2011-02-06 19:26:27 +02:00
|
|
|
currentOffset += sprite.width;
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.endLine();
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
break;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
{
|
2010-11-18 15:34:21 +02:00
|
|
|
//for each line we have offset of pixel data
|
2011-02-09 14:33:58 +02:00
|
|
|
const ui32 * RWEntriesLoc = reinterpret_cast<const ui32 *>(FDef+currentOffset);
|
2011-02-06 19:26:27 +02:00
|
|
|
currentOffset += sizeof(ui32) * sprite.height;
|
2010-11-18 15:34:21 +02:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
for(ui32 i=0; i<sprite.height; i++)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2011-02-06 19:26:27 +02:00
|
|
|
//get position of the line
|
2011-10-08 04:23:46 +03:00
|
|
|
currentOffset=BaseOffset + read_le_u32(RWEntriesLoc + i);
|
2011-12-14 00:23:17 +03:00
|
|
|
ui32 TotalRowLength = 0;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
while(TotalRowLength<sprite.width)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2018-03-22 03:33:15 +02:00
|
|
|
ui8 segmentType = FDef[currentOffset++];
|
|
|
|
ui32 length = FDef[currentOffset++] + 1;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
if(segmentType==0xFF)//Raw data
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.load(length, FDef + currentOffset);
|
2011-02-06 19:26:27 +02:00
|
|
|
currentOffset+=length;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
else// RLE
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.load(length, segmentType);
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
TotalRowLength += length;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
|
|
|
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.endLine();
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
break;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
|
|
|
case 2:
|
|
|
|
{
|
2011-10-08 04:23:46 +03:00
|
|
|
currentOffset = BaseOffset + read_le_u16(FDef + BaseOffset);
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
for(ui32 i=0; i<sprite.height; i++)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2011-12-14 00:23:17 +03:00
|
|
|
ui32 TotalRowLength=0;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
while(TotalRowLength<sprite.width)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2018-03-22 03:33:15 +02:00
|
|
|
ui8 segment=FDef[currentOffset++];
|
|
|
|
ui8 code = segment / 32;
|
|
|
|
ui8 length = (segment & 31) + 1;
|
2011-02-06 19:26:27 +02:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
if(code==7)//Raw data
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.load(length, FDef + currentOffset);
|
2011-02-06 19:26:27 +02:00
|
|
|
currentOffset += length;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
else//RLE
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.load(length, code);
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
TotalRowLength+=length;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.endLine();
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
break;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
|
|
|
case 3:
|
|
|
|
{
|
2018-03-22 03:33:15 +02:00
|
|
|
for(ui32 i=0; i<sprite.height; i++)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2011-10-08 04:23:46 +03:00
|
|
|
currentOffset = BaseOffset + read_le_u16(FDef + BaseOffset+i*2*(sprite.width/32));
|
2011-12-14 00:23:17 +03:00
|
|
|
ui32 TotalRowLength=0;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
while(TotalRowLength<sprite.width)
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2011-12-14 00:23:17 +03:00
|
|
|
ui8 segment = FDef[currentOffset++];
|
|
|
|
ui8 code = segment / 32;
|
|
|
|
ui8 length = (segment & 31) + 1;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2018-03-22 03:33:15 +02:00
|
|
|
if(code==7)//Raw data
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.load(length, FDef + currentOffset);
|
2011-02-06 19:26:27 +02:00
|
|
|
currentOffset += length;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
else//RLE
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.load(length, code);
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
TotalRowLength += length;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2023-02-01 20:42:06 +02:00
|
|
|
loader.endLine();
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
2011-02-06 19:26:27 +02:00
|
|
|
break;
|
2010-10-18 18:08:59 +03:00
|
|
|
}
|
|
|
|
default:
|
2017-08-11 13:38:10 +02:00
|
|
|
logGlobal->error("Error: unsupported format of def file: %d", sprite.format);
|
2010-10-18 18:08:59 +03:00
|
|
|
break;
|
|
|
|
}
|
2017-07-12 21:01:10 +02:00
|
|
|
}
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2016-01-29 16:16:14 +02:00
|
|
|
CDefFile::~CDefFile() = default;
|
2010-10-18 18:08:59 +03:00
|
|
|
|
2011-02-20 11:24:53 +02:00
|
|
|
const std::map<size_t, size_t > CDefFile::getEntries() const
|
2010-10-18 18:08:59 +03:00
|
|
|
{
|
2011-02-20 11:24:53 +02:00
|
|
|
std::map<size_t, size_t > ret;
|
|
|
|
|
2013-06-29 16:05:48 +03:00
|
|
|
for (auto & elem : offset)
|
|
|
|
ret[elem.first] = elem.second.size();
|
2011-02-20 11:24:53 +02:00
|
|
|
return ret;
|
2011-02-06 19:26:27 +02:00
|
|
|
}
|
|
|
|
|