1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-01-29 10:38:04 +01:00

#15 add linux binary

This commit is contained in:
XProger 2017-09-07 02:11:13 +03:00
parent 2b8436be4b
commit b06e415ee0
3 changed files with 21 additions and 11 deletions

Binary file not shown.

View File

@ -186,10 +186,10 @@ namespace Core {
// Texture
#ifdef WIN32
PFNGLACTIVETEXTUREPROC glActiveTexture;
PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
#endif
#if defined(WIN32) || defined(LINUX)
PFNGLGENERATEMIPMAPPROC glGenerateMipmap;
// Profiling
#ifdef PROFILE
PFNGLOBJECTLABELPROC glObjectLabel;
@ -285,7 +285,7 @@ typedef unsigned short Index;
struct Vertex {
short4 coord; // xyz - position, w - joint index (for entities only)
short4 normal; // xyz - vertex normalá w - unused
short4 normal; // xyz - vertex normal, w - unused
short4 texCoord; // xy - texture coordinates, zw - trapezoid warping
ubyte4 param; // xy - anim tex range and frame index, zw - unused
ubyte4 color; // xyz - color, w - intensity
@ -479,10 +479,11 @@ namespace Core {
#if defined(WIN32) || (defined(LINUX) && !defined(__RPI__)) || defined(ANDROID)
#ifdef WIN32
GetProcOGL(glActiveTexture);
GetProcOGL(glGenerateMipmap);
#endif
#if defined(WIN32) || defined(LINUX)
GetProcOGL(glGenerateMipmap);
#ifdef PROFILE
GetProcOGL(glObjectLabel);
GetProcOGL(glPushDebugGroup);

View File

@ -11,6 +11,16 @@
#define WND_TITLE "OpenLara"
// Time
unsigned int startTime;
int getTime() {
timeval t;
gettimeofday(&t, NULL);
return int((t.tv_sec - startTime) * 1000 + t.tv_usec / 1000);
}
// Sound
#define SND_FRAME_SIZE 4
#define SND_DATA_SIZE (1024 * SND_FRAME_SIZE)
@ -70,12 +80,7 @@ void sndFree() {
pthread_mutex_destroy(&sndMutex);
}
int getTime() {
timeval t;
gettimeofday(&t, NULL);
return (t.tv_sec * 1000 + t.tv_usec / 1000);
}
// Input
InputKey keyToInputKey(int code) {
int codes[] = {
113, 114, 111, 116, 65, 23, 36, 9, 50, 37, 64,
@ -147,7 +152,7 @@ void WndProc(const XEvent &e,Display*dpy,Window wnd) {
char Stream::cacheDir[255];
char Stream::contentDir[255];
int main() {
int main(int argc, char **argv) {
Stream::contentDir[0] = Stream::cacheDir[0] = 0;
const char *home;
@ -190,8 +195,12 @@ int main() {
Atom WM_DELETE_WINDOW = XInternAtom(dpy, "WM_DELETE_WINDOW", 0);
XSetWMProtocols(dpy, wnd, &WM_DELETE_WINDOW, 1);
timeval t;
gettimeofday(&t, NULL);
startTime = t.tv_sec;
sndInit();
Game::init();
Game::init(argc > 1 ? argv[1] : NULL);
int lastTime = getTime();