Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix compile for linux #311

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ projectx*
libs*
unix*
mingw*
data
configs
logs
pilots
configs/*
logs/*
pilots/*
savegame
*.dll
gmon.out
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "data"]
path = data
url = https://github.com/ForsakenX/forsaken-data
Empty file modified 2dpolys.c
100755 → 100644
Empty file.
Empty file modified 2dpolys.h
100755 → 100644
Empty file.
Empty file modified 2dtextures.c
100755 → 100644
Empty file.
Empty file modified 2dtextures.h
100755 → 100644
Empty file.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ endif
#

# some systems use lua5.1
LUA=$(shell pkg-config lua && echo lua || echo lua5.1)
LUA=lua5.1
MACOSX=$(shell uname -a | grep -qi darwin && echo 1 || echo 0)

# which version of sdl do you want to ask pkgconfig for ?
Expand All @@ -82,7 +82,10 @@ $(if $(shell test "$(GL)" -ge 3 -a "$(SDL)" -lt 2 && echo fail), \
$(error "GL >= 3 only supported with SDL >= 2"))

# library headers
CFLAGS+= `pkg-config --cflags $(SDL_) $(LUA) $(LUA)-socket libenet libpng zlib openal`
CFLAGS+= `pkg-config --cflags $(SDL_)`
CFLAGS+= `pkg-config --cflags $(LUA)`
CFLAGS+= `pkg-config --cflags libenet`
CFLAGS+= `pkg-config --cflags libpng zlib openal`
ifeq ($(MACOSX),1)
CFLAGS += -DMACOSX
endif
Expand All @@ -95,7 +98,9 @@ ifeq ($(STATIC),1)
LIB+= -Wl,-dn
PKG_CFG_OPTS= --static
endif
LIB+= `pkg-config $(PKG_CFG_OPTS) --libs $(LUA) $(LUA)-socket libenet libpng zlib openal` -lm
LIBDIR=`pkg-config --variable=libdir $(LUA)`
LIB+= `pkg-config $(PKG_CFG_OPTS) --libs $(LUA) libenet libpng zlib openal`
LIB+= -L$(LIBDIR)/lua/5.1/ $(LIBDIR)/lua/5.1/mime/core.so $(LIBDIR)/lua/5.1/socket/core.so -lm
ifeq ($(STATIC),1)
LIB+= -Wl,-dy
endif
Expand Down
Empty file modified ProjectX-vs10.README.txt
100755 → 100644
Empty file.
Empty file modified ai.h
100755 → 100644
Empty file.
Empty file modified aicrashandburn.c
100755 → 100644
Empty file.
Empty file modified aidogfight.c
100755 → 100644
Empty file.
Empty file modified aiexogenon.c
100755 → 100644
Empty file.
Empty file modified aifire.c
100755 → 100644
Empty file.
Empty file modified aifleshmorph.c
100755 → 100644
Empty file.
Empty file modified aifollow.c
100755 → 100644
Empty file.
Empty file modified aiformation.c
100755 → 100644
Empty file.
Empty file modified aiidle.c
100755 → 100644
Empty file.
Empty file modified aikillmine.c
100755 → 100644
Empty file.
Empty file modified ailib.c
100755 → 100644
Empty file.
Empty file modified aimain.c
100755 → 100644
Empty file.
Empty file modified aimovet.c
100755 → 100644
Empty file.
Empty file modified aipingoff.c
100755 → 100644
Empty file.
Empty file modified aipsycho.c
100755 → 100644
Empty file.
Empty file modified airetreat.c
100755 → 100644
Empty file.
Empty file modified aiscan.c
100755 → 100644
Empty file.
Empty file modified aispline.c
100755 → 100644
Empty file.
Empty file modified bgobjects.c
100755 → 100644
Empty file.
Empty file modified bgobjects.h
100755 → 100644
Empty file.
Empty file modified bsp.c
100755 → 100644
Empty file.
Empty file modified bsp.h
100755 → 100644
Empty file.
Empty file modified camera.c
100755 → 100644
Empty file.
Empty file modified camera.h
100755 → 100644
Empty file.
Empty file modified collision.c
100755 → 100644
Empty file.
Empty file modified collision.h
100755 → 100644
Empty file.
Empty file modified compobjects.c
100755 → 100644
Empty file.
Empty file modified compobjects.h
100755 → 100644
Empty file.
Empty file modified config.c
100755 → 100644
Empty file.
Empty file modified config.h
100755 → 100644
Empty file.
Empty file modified controls.c
100755 → 100644
Empty file.
Empty file modified controls.h
100755 → 100644
Empty file.
1 change: 1 addition & 0 deletions data
Submodule data added at 52ed2e
Empty file modified demo.c
100755 → 100644
Empty file.
Empty file modified demo.h
100755 → 100644
Empty file.
Empty file modified enemies.c
100755 → 100644
Empty file.
Empty file modified enemies.h
100755 → 100644
Empty file.
Empty file modified englishlocal.h
100755 → 100644
Empty file.
Empty file modified extforce.c
100755 → 100644
Empty file.
Empty file modified extforce.h
100755 → 100644
Empty file.
Empty file modified goal.c
100755 → 100644
Empty file.
Empty file modified goal.h
100755 → 100644
Empty file.
Empty file modified lights.c
100755 → 100644
Empty file.
Empty file modified lights.h
100755 → 100644
Empty file.
Empty file modified lines.c
100755 → 100644
Empty file.
Empty file modified lines.h
100755 → 100644
Empty file.
Empty file modified loadsave.c
100755 → 100644
Empty file.
Empty file modified loadsave.h
100755 → 100644
Empty file.
Empty file modified local.h
100755 → 100644
Empty file.
Empty file modified localtitle.h
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions lua_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

#include <stdio.h>
#include "lua_common.h"
#include "luasocket.h"
#include "mime.h"
#include "luasocket/luasocket.h"
#include "luasocket/mime.h"
#include "main.h"

lua_State *L1;
Expand Down
Empty file modified main.h
100755 → 100644
Empty file.
Empty file modified mload.c
100755 → 100644
Empty file.
Empty file modified mload.h
100755 → 100644
Empty file.
Empty file modified models.c
100755 → 100644
Empty file.
Empty file modified models.h
100755 → 100644
Empty file.
Empty file modified multiplayer.c
100755 → 100644
Empty file.
Empty file modified multiplayer.h
100755 → 100644
Empty file.
Empty file modified mxaload.c
100755 → 100644
Empty file.
Empty file modified mxaload.h
100755 → 100644
Empty file.
Empty file modified mxload.c
100755 → 100644
Empty file.
Empty file modified mxload.h
100755 → 100644
Empty file.
8 changes: 4 additions & 4 deletions net_enet_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ static network_return_t enet_setup( char* str_address, int port )
DebugPrintf("network: enet setup address %s\n",
address_to_str(&address));

enet_host = enet_host_create( &address, max_peers, 0, 0 );
enet_host = enet_host_create( &address, max_peers, 2, 0, 0 );

if ( enet_host == NULL )
{
Expand Down Expand Up @@ -267,7 +267,7 @@ static int enet_connect( char* str_address, int port )
DebugPrintf("network: enet connect to address %s\n",
address_to_str(&address));

peer = enet_host_connect( enet_host, &address, max_channels );
peer = enet_host_connect( enet_host, &address, max_channels, 0 );

if (peer == NULL)
{
Expand Down Expand Up @@ -761,7 +761,7 @@ static void new_connection( ENetPeer * peer )

static void lost_connection( ENetPeer * peer, enet_uint32 data )
{
char* reason = &data;
char* reason = (char*)&data;
network_peer_data_t * peer_data = peer->data;

// print debug info
Expand Down Expand Up @@ -1311,7 +1311,7 @@ static void new_packet( ENetEvent * event )
network_peer_data_t * new_peer_data;
DebugPrintf("network: host told us to connect to player %d address %s\n",
packet->id, address_to_str( address ));
new_peer = enet_host_connect( enet_host, address, max_channels );
new_peer = enet_host_connect( enet_host, address, max_channels, 0 );
if(!new_peer)
{
DebugPrintf("network: enet host connect returned NULL.\n");
Expand Down
Empty file modified net_test/chat/client.c
100755 → 100644
Empty file.
Empty file modified net_test/chat/test.sh
100755 → 100644
Empty file.
Empty file modified net_test/smasher/smasher.c
100755 → 100644
Empty file.
2 changes: 1 addition & 1 deletion networking.c
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#include "net_tracker.h"
#include "timer.h"
#include "oct2.h"

#include "util.h"

BYTE WhoIAm = UNASSIGNED_SHIP;

Expand Down
Empty file modified networking.h
100755 → 100644
Empty file.
Empty file modified new3d.c
100755 → 100644
Empty file.
26 changes: 5 additions & 21 deletions new3d.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -140,24 +140,6 @@ typedef struct VERT2D {
float x;
float y;
} VERT2D;
/*===================================================================
3D Vertices
===================================================================*/
typedef struct VERT {
float x;
float y;
float z;
} VERT;

/*===================================================================
3D Normal
===================================================================*/
typedef struct NORMAL {
union { float nx; float x; };
union { float ny; float y; };
union { float nz; float z; };
} NORMAL;

/*===================================================================
4 X 4 Matrix
===================================================================*/
Expand All @@ -182,10 +164,12 @@ typedef struct MATRIX3X3 {
Vector
===================================================================*/
typedef struct VECTOR {
float x;
float y;
float z;
union { float nx; float x; };
union { float ny; float y; };
union { float nz; float z; };
} VECTOR;
typedef VECTOR VERT;
typedef VECTOR NORMAL;

/*===================================================================
Short Vector
Expand Down
Empty file modified node.c
100755 → 100644
Empty file.
Empty file modified node.h
100755 → 100644
Empty file.
Empty file modified object.h
100755 → 100644
Empty file.
Empty file modified oct2.c
100755 → 100644
Empty file.
Empty file modified pickups.c
100755 → 100644
Empty file.
Empty file modified pickups.h
100755 → 100644
Empty file.
Empty file modified polys.c
100755 → 100644
Empty file.
Empty file modified polys.h
100755 → 100644
Empty file.
Empty file modified primary.c
100755 → 100644
Empty file.
Empty file modified primary.h
100755 → 100644
Empty file.
Empty file modified quat.c
100755 → 100644
Empty file.
Empty file modified quat.h
100755 → 100644
Empty file.
Empty file modified render.h
100755 → 100644
Empty file.
4 changes: 2 additions & 2 deletions render_gl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,9 @@ void light_vert( LVERTEX * vert, u_int8_t * color )
VECTOR world, v = {vert->x,vert->y,vert->z};
MxV( &world_matrix, &v, &world );
if( render_lighting_env_whiteout )
do_whiteout_effect( &world, color );
do_whiteout_effect( &world, (COLOR*)color );
else if( render_lighting_env_water )
do_water_effect( &world, color );
do_water_effect( &world, (COLOR*)color );
#ifndef LIGHT_EVERYTHING
if( render_lighting_enabled )
#endif
Expand Down
2 changes: 1 addition & 1 deletion render_gl_shared.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ static bool set_defaults( void )
return true;
}

static resize_viewport( int width, int height )
static void resize_viewport( int width, int height )
{
render_viewport_t viewport;
viewport.X = 0;
Expand Down
Empty file modified restart.c
100755 → 100644
Empty file.
Empty file modified restart.h
100755 → 100644
Empty file.
Empty file modified rtlight.c
100755 → 100644
Empty file.
Empty file modified rtlight.h
100755 → 100644
Empty file.
Empty file modified screenpolys.c
100755 → 100644
Empty file.
Empty file modified screenpolys.h
100755 → 100644
Empty file.
87 changes: 0 additions & 87 deletions scripts/mime.lua

This file was deleted.

133 changes: 0 additions & 133 deletions scripts/socket.lua

This file was deleted.

Loading
Loading