Font Asset: Difference between revisions

From COD Engine Research
No edit summary
No edit summary
 
(5 intermediate revisions by 3 users not shown)
Line 5: Line 5:
[[Category:MW3]]
[[Category:MW3]]
[[Category:Ghosts]]
[[Category:Ghosts]]
[[Category:AW]]
[[Category:WaW]]
[[Category:WaW]]
[[Category:BO1]]
[[Category:BO1]]
[[Category:BO2]]
[[Category:BO2]]
[[Category:BO3]]
Font assets control what else; the fonts! Every Call of Duty game so far has had a font asset type, and it has changed very little.
== Infinity Ward Games & World at War & Black Ops 1 ==
[[File:Gamefonts_ps3.png|90px|thumb|Modern Warfare 2 font image for PS3]]
Note that S1 (Advanced Warfare) is an extension of IW6, therefore it fits here.
<syntaxhighlight lang="cpp">
#pragma pack(push, 2)
struct Glyph
{
  unsigned __int16 letter;
  char x0;
  char y0;
  char dx;
  char pixelWidth;
  char pixelHeight;
  float s0;
  float t0;
  float s1;
  float t1;
};
#pragma pack(pop)
struct Font_s
{
  const char * name;
  int pixelHeight;
  int glyphCount;
  Material * material;
  Material * glowMaterial;
  Glyph * glyphs;
};
</syntaxhighlight>
== Black Ops 2 & 3 ==
Black Ops 2, and subsequently Black Ops 3, are proving to be the only games that change the font structure so far.
<syntaxhighlight lang="cpp">
#pragma pack(push, 2)
struct Glyph
{
  unsigned __int16 letter;
  char x0;
  char y0;
  char dx;
  char pixelWidth;
  char pixelHeight;
  float s0;
  float t0;
  float s1;
  float t1;
};
#pragma pack(pop)


Font assets control what else; the fonts! Every CoD game so far has had a font asset type, and it has changed very little.
struct KerningPairs
{
  unsigned __int16 wFirst;
  unsigned __int16 wSecond;
  int iKernAmount;
};


== Infinity Ward Games & World at War & Black Ops 1 ==
struct Font_s
[[File:Gamefonts_ps3.png|90px|thumb|Modern Warfare 2 font image for PS3]]
{
#pragma pack(push, 2)
  const char *fontName;
struct Glyph
  int pixelHeight;
{
  int isScalingAllowed;
  unsigned __int16 letter;
  int glyphCount;
  char x0;
  int kerningPairsCount;
  char y0;
  Material *material;
  char dx;
  Material *glowMaterial;
  char pixelWidth;
  Glyph *glyphs;
  char pixelHeight;
  KerningPairs *kerningPairs;
  float s0;
};
  float t0;
</syntaxhighlight>
  float s1;
  float t1;
};
#pragma pack(pop)
struct Font_s
{
  const char * name;
  int pixelHeight;
  int glyphCount;
  Material * material;
  Material * glowMaterial;
  Glyph * glyphs;
};
== Black Ops 2 ==
Black Ops 2 is proving to be the only game that changes the font structure so far.
#pragma pack(push, 2)
struct Glyph
{
  unsigned __int16 letter;
  char x0;
  char y0;
  char dx;
  char pixelWidth;
  char pixelHeight;
  float s0;
  float t0;
  float s1;
  float t1;
};
#pragma pack(pop)
struct Font_s
{
  const char * name;
  int pixelHeight;
  int unknown2;
  int glyphCount;
  int unknownCount1;
  Material * material;
  Material * glowMaterial;
  Glyph * glyphs;
  char * unknownData; //Size = unknownCount1 << 3
};

Latest revision as of 07:28, 31 October 2015

Font assets control what else; the fonts! Every Call of Duty game so far has had a font asset type, and it has changed very little.

Infinity Ward Games & World at War & Black Ops 1

Modern Warfare 2 font image for PS3

Note that S1 (Advanced Warfare) is an extension of IW6, therefore it fits here.

#pragma pack(push, 2)
struct Glyph
{
  unsigned __int16 letter;
  char x0;
  char y0;
  char dx;
  char pixelWidth;
  char pixelHeight;
  float s0;
  float t0;
  float s1;
  float t1;
};
#pragma pack(pop)

struct Font_s
{
  const char * name;
  int pixelHeight;
  int glyphCount;
  Material * material;
  Material * glowMaterial;
  Glyph * glyphs;
};

Black Ops 2 & 3

Black Ops 2, and subsequently Black Ops 3, are proving to be the only games that change the font structure so far.

#pragma pack(push, 2)
struct Glyph
{
  unsigned __int16 letter;
  char x0;
  char y0;
  char dx;
  char pixelWidth;
  char pixelHeight;
  float s0;
  float t0;
  float s1;
  float t1;
};
#pragma pack(pop)

struct KerningPairs
{
  unsigned __int16 wFirst;
  unsigned __int16 wSecond;
  int iKernAmount;
};

struct Font_s
{
  const char *fontName;
  int pixelHeight;
  int isScalingAllowed;
  int glyphCount;
  int kerningPairsCount;
  Material *material;
  Material *glowMaterial;
  Glyph *glyphs;
  KerningPairs *kerningPairs;
};