Skip to content

Commit

Permalink
Fix compilation on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
mniip committed May 9, 2018
1 parent 32aaafe commit 12e79ea
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
12 changes: 6 additions & 6 deletions data/font.h
@@ -1,11 +1,11 @@
#pragma once
#define FONT_H 12
#ifndef FONTEDITOR
extern unsigned char font_data[];
extern unsigned short font_ptrs[];
extern unsigned int font_ranges[][2];
extern const unsigned char font_data[];
extern const unsigned short font_ptrs[];
extern const unsigned int font_ranges[][2];
#else
extern unsigned char *font_data;
extern unsigned short *font_ptrs;
extern unsigned int (*font_ranges)[2];
extern const unsigned char *font_data;
extern const unsigned short *font_ptrs;
extern const unsigned int (*font_ranges)[2];
#endif
2 changes: 0 additions & 2 deletions src/graphics/Font.cpp

This file was deleted.

7 changes: 4 additions & 3 deletions src/graphics/Font.h → src/graphics/FontReader.h
@@ -1,23 +1,24 @@
#pragma once
#include <cstddef>

#include "common/String.h"
#include "font.h"

class FontReader
{
unsigned char *pointer;
unsigned char const *pointer;
int width;
int pixels;
int data;

inline FontReader(unsigned char *_pointer):
inline FontReader(unsigned char const *_pointer):
pointer(_pointer + 1),
width(*_pointer),
pixels(0),
data(0)
{}

static inline unsigned char *lookupChar(String::value_type ch)
static inline unsigned char const *lookupChar(String::value_type ch)
{
size_t offset = 0;
for(int i = 0; font_ranges[i][1]; i++)
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/Graphics.cpp
Expand Up @@ -5,7 +5,7 @@
#include "Config.h"
#include "Misc.h"
#include "Graphics.h"
#include "Font.h"
#include "FontReader.h"
#ifdef HIGH_QUALITY_RESAMPLE
#include "resampler/resampler.h"
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/graphics/OpenGLGraphics.cpp
@@ -1,5 +1,5 @@
#include "Graphics.h"
#include "Font.h"
#include "FontReader.h"
#include "common/tpt-thread.h"
#ifdef OGLI

Expand Down
2 changes: 1 addition & 1 deletion src/graphics/RasterDrawMethods.inl
@@ -1,5 +1,5 @@
#include <cmath>
#include "Font.h"
#include "FontReader.h"

int PIXELMETHODS_CLASS::drawtext_outline(int x, int y, String s, int r, int g, int b, int a)
{
Expand Down

0 comments on commit 12e79ea

Please sign in to comment.