Skip to content

Commit

Permalink
Fixes GL3 on Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshDreamland committed Jan 18, 2014
1 parent cb0dd44 commit b539ff0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
Empty file.
20 changes: 16 additions & 4 deletions ENIGMAsystem/SHELL/Graphics_Systems/OpenGL3/GL3ModelStruct.h
Expand Up @@ -20,6 +20,7 @@
#include "Universal_System/var4.h"
#include "Universal_System/roomsystem.h"
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>

Expand Down Expand Up @@ -127,12 +128,23 @@ namespace enigma {
}
}

template<int x> struct intmatch { };
template<int x> struct uintmatch { };
template<> struct intmatch<1> { typedef int8_t type; };
template<> struct intmatch<2> { typedef int16_t type; };
template<> struct intmatch<4> { typedef int32_t type; };
template<> struct intmatch<8> { typedef int64_t type; };
template<> struct uintmatch<1> { typedef uint8_t type; };
template<> struct uintmatch<2> { typedef uint16_t type; };
template<> struct uintmatch<4> { typedef uint32_t type; };
template<> struct uintmatch<8> { typedef uint64_t type; };
typedef uintmatch<sizeof(gs_scalar)>::type color_t;
union VertexElement {
unsigned long d;
color_t d;
gs_scalar f;

VertexElement(gs_scalar v): f(v) {}
VertexElement(unsigned long v): d(v) {}
VertexElement(color_t v): d(v) {}
};

//NOTE: This class handles batching, indexing, and other optimization for you and is very very efficient.
Expand Down Expand Up @@ -314,8 +326,8 @@ class Mesh

void AddColor(int col, double alpha)
{
unsigned long final = col + ((unsigned char)(alpha*255) << 24);
vertices.push_back(final);
color_t finalcol = col + ((unsigned char)(alpha*255) << 24);
vertices.push_back(finalcol);
useColors = true;
}

Expand Down
16 changes: 8 additions & 8 deletions ENIGMAsystem/SHELL/Platforms/xlib/XLIBmain.cpp
Expand Up @@ -127,14 +127,14 @@ namespace enigma
//screen_refresh();
return 0;
}
case FocusIn:
gameFroze = false;
return 0;
case FocusOut:
if (enigma::freezeOnLoseFocus) {
gameFroze = true;
}
return 0;
case FocusIn:
gameFroze = false;
return 0;
case FocusOut:
if (enigma::freezeOnLoseFocus) {
//gameFroze = true;
}
return 0;
case ClientMessage:
if ((unsigned)e.xclient.data.l[0] == (unsigned)wm_delwin) //For some reason, this line warns whether we cast to unsigned or not.
return 1;
Expand Down

0 comments on commit b539ff0

Please sign in to comment.