Skip to content
Merged
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ $(LIB_DIR)/librenderer.so: cmath3 $(RENDERER_OBJS) $(LIB_DIR)
$(CC) -shared -o $@ $(RENDERER_OBJS) $(LDFLAGS) -lcmath3 -lSDL2 $(MPQ_LIB) -ljpeg

$(BIN_DIR)/openwarcraft3: cmath3 game renderer $(APP_OBJS) $(BIN_DIR)
$(CC) -o $@ $(APP_OBJS) -Wl,-rpath,'$$ORIGIN/../lib' $(LDFLAGS) -lcmath3 -lSDL2 $(MPQ_LIB) -lgame -lrenderer
$(CC) -o $@ $(APP_OBJS) -Wl,-rpath,'$$ORIGIN/../lib' $(LDFLAGS) -lcmath3 -lSDL2 -lSDL2_net $(MPQ_LIB) -lgame -lrenderer

$(OBJ_DIR)/%.o: src/%.c
@mkdir -p $(dir $@)
Expand Down
15 changes: 15 additions & 0 deletions src/common/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

#include "mpq_adapter.h"

#ifndef USE_LOOPBACK
#include <SDL2/SDL_net.h>
#endif

#define MAXPRINTMSG 4096

const LPCSTR WarcraftSheets[] = {
Expand Down Expand Up @@ -232,10 +236,21 @@ void Com_Quit(void) {
CL_Shutdown();
SV_Shutdown();
FS_Shutdown();
#ifndef USE_LOOPBACK
// Cleanup SDL_net
SDLNet_Quit();
#endif
Sys_Quit();
}

void Com_Init(void) {
#ifndef USE_LOOPBACK
// Initialize SDL_net
if (SDLNet_Init() < 0) {
fprintf(stderr, "SDLNet_Init failed: %s\n", SDLNet_GetError());
exit(1);
}
#endif
Cbuf_Init();
FS_Init();
SV_Init();
Expand Down
Loading
Loading