WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
Loading...
Searching...
No Matches
CharTexture.h
Go to the documentation of this file.
1/*
2 * CharTexture.h
3 *
4 * Created on: 26 oct. 2013
5 *
6 */
7
8#pragma once
9
10#include <map>
11
12#include <glad/gl.h>
13
14#include "SoftwareImage.h"
15
16class GameFile;
17
20{
22};
23
26{
28};
29
32{
34 int region;
35 int layer;
37
38 bool operator<(const CharTextureComponent& c) const
39 {
40 return layer < c.layer;
41 }
42};
43
49{
50public:
51 explicit CharTexture(unsigned int _layoutSizeId = 0)
52 : layoutSizeId(_layoutSizeId)
53 {
54 }
55
56 void addLayer(GameFile* file, int region, int layer, int blendMode = 1);
58
59 void compose(GLuint texID);
60
61 void reset(unsigned int _layoutSizeId);
62
63 static void initRegions();
64
65private:
66 void burnComponent(SoftwareImage& destImage, CharTextureComponent&) const;
68 unsigned int layoutSizeId;
69 std::vector<CharTextureComponent> m_components;
70 static std::map<int, std::pair<LayoutSize, std::map<int, CharRegionCoords>>> LAYOUTS;
71};
Composites multiple texture layers into a single character skin texture.
Definition CharTexture.h:49
void reset(unsigned int _layoutSizeId)
std::vector< CharTextureComponent > m_components
Definition CharTexture.h:69
CharTexture(unsigned int _layoutSizeId=0)
Definition CharTexture.h:51
unsigned int layoutSizeId
Definition CharTexture.h:68
void compose(GLuint texID)
void burnComponent(SoftwareImage &destImage, CharTextureComponent &) const
static SoftwareImage * gameFileToQImage(GameFile *file)
void addComponent(CharTextureComponent c)
Definition CharTexture.h:57
static std::map< int, std::pair< LayoutSize, std::map< int, CharRegionCoords > > > LAYOUTS
Definition CharTexture.h:70
static void initRegions()
void addLayer(GameFile *file, int region, int layer, int blendMode=1)
Abstract base class representing a file within the game data archive.
Definition GameFile.h:12
CPU-side image buffer storing BGRA pixel data.
Coordinates of a region within the character texture atlas.
Definition CharTexture.h:20
A single texture layer to be composited onto the character skin.
Definition CharTexture.h:32
bool operator<(const CharTextureComponent &c) const
Definition CharTexture.h:38
Dimensions of a character texture layout.
Definition CharTexture.h:26