Skip to content

Commit

Permalink
fix linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
wootguy committed May 10, 2020
1 parent c9ac102 commit 47619a2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 22 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ if(MSVC)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT bspguy)

else()
set(CMAKE_CXX_FLAGS "-Wall")
set(CMAKE_CXX_FLAGS "-Wall -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
set(CMAKE_CXX_FLAGS_RELEASE "-Os -fno-exceptions -w -Wfatal-errors")
endif()
Expand Down
1 change: 1 addition & 0 deletions src/Bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "Entity.h"
#include "bsplimits.h"
#include "rad.h"
#include <string.h>

#define BSP_MODEL_BYTES 64 // size of a BSP model in bytes

Expand Down
5 changes: 4 additions & 1 deletion src/Wad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@
#include "util.h"
#include <iostream>
#include <fstream>
#include <string.h>

#define strcasecmp _stricmp
#ifdef WIN32
#define strcasecmp _stricmp
#endif

Wad::Wad(void)
{
Expand Down
18 changes: 0 additions & 18 deletions src/Wad.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,6 @@ typedef unsigned int uint;
struct COLOR3
{
unsigned char r, g, b;

COLOR3 lerp(COLOR3& other, float frac) {
COLOR3 ret;

int r = round((float)this->r + ((float)other.r - (float)this->r) * frac);
int g = round((float)this->g + ((float)other.g - (float)this->g) * frac);
int b = round((float)this->b + ((float)other.b - (float)this->b) * frac);

CLAMP(r, 0, 255);
CLAMP(g, 0, 255);
CLAMP(b, 0, 255);

ret.r = r;
ret.g = g;
ret.b = b;

return ret;
}
};

struct WADHEADER
Expand Down
5 changes: 3 additions & 2 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <string>
#include <algorithm>
#include <cctype>
#include <string.h>

bool fileExists(const string& fileName)
{
Expand Down Expand Up @@ -119,8 +120,8 @@ void print_color(int colors)
printf("\x1B[0m");
return;
}
char* mode = colors & PRINT_BRIGHT ? "1" : "0";
char* color = "37";
const char* mode = colors & PRINT_BRIGHT ? "1" : "0";
const char* color = "37";
switch (colors & ~PRINT_BRIGHT)
{
case PRINT_RED: color = "31"; break;
Expand Down
1 change: 1 addition & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <vector>
#include <iostream>
#include <fstream>
#include <cmath>

#define PRINT_BLUE 1
#define PRINT_GREEN 2
Expand Down

0 comments on commit 47619a2

Please sign in to comment.