mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +00:00
- fixed the usedcolor array's base type.
The usedcolors array which counts the number of pixels in a given color in a font used bytes as storage, so any color that just happened to have a count that is a multiple of 256 the color was considered not present.
This commit is contained in:
parent
3d4b5ae8a3
commit
e06aa28620
5 changed files with 8 additions and 9 deletions
|
@ -471,7 +471,7 @@ FFont *FFont::FindFont (FName name)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void RecordTextureColors (FImageSource *pic, uint8_t *usedcolors)
|
||||
void RecordTextureColors (FImageSource *pic, uint32_t *usedcolors)
|
||||
{
|
||||
int x;
|
||||
|
||||
|
@ -524,7 +524,7 @@ static int compare (const void *arg1, const void *arg2)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
int FFont::SimpleTranslation (uint8_t *colorsused, uint8_t *translation, uint8_t *reverse, TArray<double> &Luminosity)
|
||||
int FFont::SimpleTranslation (uint32_t *colorsused, uint8_t *translation, uint8_t *reverse, TArray<double> &Luminosity)
|
||||
{
|
||||
double min, max, diver;
|
||||
int i, j;
|
||||
|
@ -889,10 +889,10 @@ int FFont::StringWidth(const uint8_t *string) const
|
|||
void FFont::LoadTranslations()
|
||||
{
|
||||
unsigned int count = LastChar - FirstChar + 1;
|
||||
uint8_t usedcolors[256], identity[256];
|
||||
uint32_t usedcolors[256] = {};
|
||||
uint8_t identity[256];
|
||||
TArray<double> Luminosity;
|
||||
|
||||
memset (usedcolors, 0, 256);
|
||||
for (unsigned int i = 0; i < count; i++)
|
||||
{
|
||||
if (Chars[i].TranslatedPic)
|
||||
|
|
|
@ -39,6 +39,6 @@ extern uint16_t upperforlower[65536];
|
|||
|
||||
class FImageSource;
|
||||
|
||||
void RecordTextureColors (FImageSource *pic, uint8_t *usedcolors);
|
||||
void RecordTextureColors (FImageSource *pic, uint32_t *usedcolors);
|
||||
bool myislower(int code);
|
||||
int stripaccent(int code);
|
||||
|
|
|
@ -153,12 +153,12 @@ FSpecialFont::FSpecialFont (const char *name, int first, int count, FTexture **l
|
|||
void FSpecialFont::LoadTranslations()
|
||||
{
|
||||
int count = LastChar - FirstChar + 1;
|
||||
uint8_t usedcolors[256], identity[256];
|
||||
uint32_t usedcolors[256] = {};
|
||||
uint8_t identity[256];
|
||||
TArray<double> Luminosity;
|
||||
int TotalColors;
|
||||
int i, j;
|
||||
|
||||
memset (usedcolors, 0, 256);
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
if (Chars[i].TranslatedPic)
|
||||
|
|
|
@ -63,7 +63,6 @@
|
|||
#define DEFAULT_LOG_COLOR PalEntry(223,223,223)
|
||||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
void RecordTextureColors (FImageSource *pic, uint8_t *colorsused);
|
||||
|
||||
// EXTERNAL FUNCTION PROTOTYPES --------------------------------------------
|
||||
|
||||
|
|
|
@ -114,7 +114,7 @@ protected:
|
|||
const void *ranges, int total_colors, const PalEntry *palette);
|
||||
void FixXMoves();
|
||||
|
||||
static int SimpleTranslation (uint8_t *colorsused, uint8_t *translation,
|
||||
static int SimpleTranslation (uint32_t *colorsused, uint8_t *translation,
|
||||
uint8_t *identity, TArray<double> &Luminosity);
|
||||
|
||||
void ReadSheetFont(TArray<FolderEntry> &folderdata, int width, int height, const DVector2 &Scale);
|
||||
|
|
Loading…
Reference in a new issue