Skip to content

Commit

Permalink
Merge branch 'master' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
MonsterIestyn committed Dec 4, 2018
2 parents 42cb597 + e6e5856 commit f2b0db5
Show file tree
Hide file tree
Showing 43 changed files with 944 additions and 47 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ add_subdirectory(assets)
## config.h generation
set(GIT_EXECUTABLE "git" CACHE FILEPATH "Path to git binary")
include(GitUtilities)
git_describe(SRB2_GIT_DESCRIBE "${CMAKE_SOURCE_DIR}")
git_latest_commit(SRB2_COMP_COMMIT "${CMAKE_SOURCE_DIR}")
git_current_branch(SRB2_GIT_BRANCH "${CMAKE_SOURCE_DIR}")
set(SRB2_COMP_BRANCH "${SRB2_GIT_BRANCH}")
set(SRB2_COMP_REVISION "${SRB2_GIT_DESCRIBE}")
set(SRB2_COMP_REVISION "${SRB2_COMP_COMMIT}")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)

##### PACKAGE CONFIGURATION #####
Expand Down
Binary file removed bin/Resources/i686/exchndl.dll
Binary file not shown.
12 changes: 12 additions & 0 deletions cmake/Modules/GitUtilities.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,17 @@ function(git_current_branch variable path)
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(${variable} "${output}" PARENT_SCOPE)
endfunction()

function(git_latest_commit variable path)
execute_process(COMMAND ${GIT_EXECUTABLE} "rev-parse" "--short" "HEAD"
WORKING_DIRECTORY "${path}"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)

set(${variable} "${output}" PARENT_SCOPE)
endfunction()
43 changes: 43 additions & 0 deletions libs/DLL-README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# SRB2 - Which DLLs do I need to bundle?

Updated 12/4/2018 (v2.1.21)

Here are the required DLLs, per build. For each architecture, copy all the binaries from these folders:

* libs\dll-binaries\[i686/x86_64]
* libs\SDL2\[i686/x86_64]...\bin
* libs\SDL2_mixer\[i686/x86_64]...\bin

and don't forget to build r_opengl.dll for srb2dd.

## srb2win, 32-bit

* libs\dll-binaries\i686\exchndl.dll
* libs\dll-binaries\i686\libgme.dll
* libs\dll-binaries\i686\mgwhelp.dll (depend for exchndl.dll)
* libs\SDL2\i686-w64-mingw32\bin\SDL2.dll
* libs\SDL2_mixer\i686-w64-mingw32\bin\*.dll (get everything)

## srb2win, 64-bit

* libs\dll-binaries\x86_64\exchndl.dll
* libs\dll-binaries\x86_64\libgme.dll
* libs\dll-binaries\x86_64\mgwhelp.dll (depend for exchndl.dll)
* libs\SDL2\x86_64-w64-mingw32\bin\SDL2.dll
* libs\SDL2_mixer\x86_64-w64-mingw32\bin\*.dll (get everything)

## srb2dd, 32-bit

* libs\dll-binaries\i686\exchndl.dll
* libs\dll-binaries\i686\fmodex.dll
* libs\dll-binaries\i686\libgme.dll
* libs\dll-binaries\i686\mgwhelp.dll (depend for exchndl.dll)
* r_opengl.dll (build this from make)

## srb2dd, 64-bit

* libs\dll-binaries\x86_64\exchndl.dll
* libs\dll-binaries\x86_64\fmodex.dll
* libs\dll-binaries\x86_64\libgme.dll
* libs\dll-binaries\x86_64\mgwhelp.dll (depend for exchndl.dll)
* r_opengl.dll (build this from make)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Binary file added libs/dll-binaries/i686/exchndl.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added libs/dll-binaries/i686/mgwhelp.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added libs/dll-binaries/x86_64/exchndl.dll
Binary file not shown.
File renamed without changes.
File renamed without changes.
Binary file added libs/dll-binaries/x86_64/mgwhelp.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Makefile.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ GCC64=1
endif

ifdef GCC64
GCC64=1
GCC63=1
endif

ifdef GCC63
Expand Down
2 changes: 0 additions & 2 deletions src/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@

#define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}"
#define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}"
#define SRB2_GIT_DESCRIBE "${SRB2_GIT_DESCRIBE}"
#define SRB2_GIT_BRANCH "${SRB2_GIT_BRANCH}"

#define CMAKE_ASSETS_DIR "${CMAKE_SOURCE_DIR}/assets"

Expand Down
2 changes: 1 addition & 1 deletion src/d_netcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ INT32 cv_debug;
consvar_t cv_usemouse = {"use_mouse", "On", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usemouse2 = {"use_mouse2", "Off", CV_SAVE|CV_CALL,usemouse_cons_t, I_StartupMouse2, 0, NULL, NULL, 0, 0, NULL};

#if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) //joystick 1 and 2
#if defined (DC) || defined (_XBOX) || defined (WMINPUT) || defined (_WII) || defined(HAVE_SDL) || defined(_WIN32) //joystick 1 and 2
consvar_t cv_usejoystick = {"use_joystick", "1", CV_SAVE|CV_CALL, usejoystick_cons_t,
I_InitJoystick, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_usejoystick2 = {"use_joystick2", "2", CV_SAVE|CV_CALL, usejoystick_cons_t,
Expand Down
4 changes: 2 additions & 2 deletions src/m_anigif.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,8 +492,8 @@ static void GIF_framewrite(void)

// screen regions are handled in GIF_lzw
{
int d1 = (int)((100.0/NEWTICRATE)*(gif_frames+1));
int d2 = (int)((100.0/NEWTICRATE)*(gif_frames));
int d1 = (int)((100.0f/NEWTICRATE)*(gif_frames+1));
int d2 = (int)((100.0f/NEWTICRATE)*(gif_frames));
UINT16 delay = d1-d2;
INT32 startline;

Expand Down
75 changes: 47 additions & 28 deletions src/m_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@
#include "st_stuff.h"
#include "i_sound.h"

#include "i_joy.h" // for joystick menu controls

// Condition Sets
#include "m_cond.h"

Expand Down Expand Up @@ -160,7 +162,7 @@ typedef enum
levellist_mode_t levellistmode = LLM_CREATESERVER;
UINT8 maplistoption = 0;

static char joystickInfo[8][25];
static char joystickInfo[8][29];
#ifndef NONET
static UINT32 serverlistpage;
#endif
Expand Down Expand Up @@ -2074,6 +2076,7 @@ boolean M_Responder(event_t *ev)
INT32 ch = -1;
// INT32 i;
static tic_t joywait = 0, mousewait = 0;
static INT32 pjoyx = 0, pjoyy = 0;
static INT32 pmousex = 0, pmousey = 0;
static INT32 lastx = 0, lasty = 0;
void (*routine)(INT32 choice); // for some casting problem
Expand Down Expand Up @@ -2128,26 +2131,45 @@ boolean M_Responder(event_t *ev)
}
else if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime())
{
if (ev->data3 == -1)
{
ch = KEY_UPARROW;
joywait = I_GetTime() + NEWTICRATE/7;
}
else if (ev->data3 == 1)
const INT32 jdeadzone = JOYAXISRANGE/4;
if (ev->data3 != INT32_MAX)
{
ch = KEY_DOWNARROW;
joywait = I_GetTime() + NEWTICRATE/7;
if (Joystick.bGamepadStyle || abs(ev->data3) > jdeadzone)
{
if (ev->data3 < 0 && pjoyy >= 0)
{
ch = KEY_UPARROW;
joywait = I_GetTime() + NEWTICRATE/7;
}
else if (ev->data3 > 0 && pjoyy <= 0)
{
ch = KEY_DOWNARROW;
joywait = I_GetTime() + NEWTICRATE/7;
}
pjoyy = ev->data3;
}
else
pjoyy = 0;
}

if (ev->data2 == -1)
if (ev->data2 != INT32_MAX)
{
ch = KEY_LEFTARROW;
joywait = I_GetTime() + NEWTICRATE/17;
}
else if (ev->data2 == 1)
{
ch = KEY_RIGHTARROW;
joywait = I_GetTime() + NEWTICRATE/17;
if (Joystick.bGamepadStyle || abs(ev->data2) > jdeadzone)
{
if (ev->data2 < 0 && pjoyx >= 0)
{
ch = KEY_LEFTARROW;
joywait = I_GetTime() + NEWTICRATE/17;
}
else if (ev->data2 > 0 && pjoyx <= 0)
{
ch = KEY_RIGHTARROW;
joywait = I_GetTime() + NEWTICRATE/17;
}
pjoyx = ev->data2;
}
else
pjoyx = 0;
}
}
else if (ev->type == ev_mouse && mousewait < I_GetTime())
Expand Down Expand Up @@ -6726,35 +6748,32 @@ static void M_DrawJoystick(void)

M_DrawGenericMenu();

for (i = 0;i < 8; i++)
for (i = 0;i < 7; i++)
{
M_DrawSaveLoadBorder(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i);
M_DrawTextBox(OP_JoystickSetDef.x-8, OP_JoystickSetDef.y+LINEHEIGHT*i-12, 28, 1);
//M_DrawSaveLoadBorder(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i);

if ((setupcontrols_secondaryplayer && (i == cv_usejoystick2.value))
|| (!setupcontrols_secondaryplayer && (i == cv_usejoystick.value)))
V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i,V_GREENMAP,joystickInfo[i]);
V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i-4,V_GREENMAP,joystickInfo[i]);
else
V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i,0,joystickInfo[i]);
V_DrawString(OP_JoystickSetDef.x, OP_JoystickSetDef.y+LINEHEIGHT*i-4,0,joystickInfo[i]);
}
}

static void M_SetupJoystickMenu(INT32 choice)
{
INT32 i = 0;
const char *joyname = "None";
const char *joyNA = "Unavailable";
INT32 n = I_NumJoys();
(void)choice;

strcpy(joystickInfo[i], joyname);
strcpy(joystickInfo[i], "None");

for (i = 1; i < 8; i++)
{
if (i <= n && (joyname = I_GetJoyName(i)) != NULL)
{
strncpy(joystickInfo[i], joyname, 24);
joystickInfo[i][24] = '\0';
}
if (i <= n && (I_GetJoyName(i)) != NULL)
strncpy(joystickInfo[i], I_GetJoyName(i), 28);
else
strcpy(joystickInfo[i], joyNA);
}
Expand Down
25 changes: 19 additions & 6 deletions src/sdl/i_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,8 @@ void I_GetJoystickEvents(void)
UINT64 joyhats = 0;
#if 0
UINT64 joybuttons = 0;
#endif
Sint16 axisx, axisy;
#endif

if (!joystick_started) return;

Expand Down Expand Up @@ -963,6 +963,7 @@ void I_GetJoystickEvents(void)
}
}

#if 0
// send joystick axis positions
event.type = ev_joystick;

Expand Down Expand Up @@ -1013,6 +1014,7 @@ void I_GetJoystickEvents(void)
}
D_PostEvent(&event);
}
#endif
}

/** \brief Open joystick handle
Expand Down Expand Up @@ -1176,8 +1178,8 @@ void I_GetJoystick2Events(void)
UINT64 joyhats = 0;
#if 0
INT64 joybuttons = 0;
#endif
INT32 axisx, axisy;
#endif

if (!joystick2_started)
return;
Expand Down Expand Up @@ -1247,6 +1249,7 @@ void I_GetJoystick2Events(void)
}
}

#if 0
// send joystick axis positions
event.type = ev_joystick2;

Expand Down Expand Up @@ -1297,7 +1300,7 @@ void I_GetJoystick2Events(void)
}
D_PostEvent(&event);
}

#endif
}

/** \brief Open joystick handle
Expand Down Expand Up @@ -1453,18 +1456,28 @@ INT32 I_NumJoys(void)
return numjoy;
}

static char joyname[255]; // MAX_PATH; joystick name is straight from the driver

const char *I_GetJoyName(INT32 joyindex)
{
const char *joyname = "NA";
const char *tempname = NULL;
joyindex--; //SDL's Joystick System starts at 0, not 1
if (SDL_WasInit(SDL_INIT_JOYSTICK) == 0)
{
if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != -1)
joyname = SDL_JoystickNameForIndex(joyindex);
{
tempname = SDL_JoystickNameForIndex(joyindex);
if (tempname)
strncpy(joyname, tempname, 255);
}
SDL_QuitSubSystem(SDL_INIT_JOYSTICK);
}
else
joyname = SDL_JoystickNameForIndex(joyindex);
{
tempname = SDL_JoystickNameForIndex(joyindex);
if (tempname)
strncpy(joyname, tempname, 255);
}
return joyname;
}

Expand Down
34 changes: 34 additions & 0 deletions src/sdl/i_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -767,6 +767,33 @@ static void Impl_HandleJoystickAxisEvent(SDL_JoyAxisEvent evt)
D_PostEvent(&event);
}

#if 0
static void Impl_HandleJoystickHatEvent(SDL_JoyHatEvent evt)
{
event_t event;
SDL_JoystickID joyid[2];

// Determine the Joystick IDs for each current open joystick
joyid[0] = SDL_JoystickInstanceID(JoyInfo.dev);
joyid[1] = SDL_JoystickInstanceID(JoyInfo2.dev);

if (evt.hat >= JOYHATS)
return; // ignore hats with too high an index

if (evt.which == joyid[0])
{
event.data1 = KEY_HAT1 + (evt.hat*4);
}
else if (evt.which == joyid[1])
{
event.data1 = KEY_2HAT1 + (evt.hat*4);
}
else return;

// NOTE: UNFINISHED
}
#endif

static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type)
{
event_t event;
Expand Down Expand Up @@ -804,6 +831,8 @@ static void Impl_HandleJoystickButtonEvent(SDL_JoyButtonEvent evt, Uint32 type)
if (event.type != ev_console) D_PostEvent(&event);
}



void I_GetEvent(void)
{
SDL_Event evt;
Expand Down Expand Up @@ -844,6 +873,11 @@ void I_GetEvent(void)
case SDL_JOYAXISMOTION:
Impl_HandleJoystickAxisEvent(evt.jaxis);
break;
#if 0
case SDL_JOYHATMOTION:
Impl_HandleJoystickHatEvent(evt.jhat)
break;
#endif
case SDL_JOYBUTTONUP:
case SDL_JOYBUTTONDOWN:
Impl_HandleJoystickButtonEvent(evt.jbutton, evt.type);
Expand Down
Binary file modified src/sdl/macosx/Srb2mac.icns
Binary file not shown.
4 changes: 2 additions & 2 deletions src/sdl/mixer_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@

#ifdef HAVE_LIBGME
#include "gme/gme.h"
#define GME_TREBLE 5.0
#define GME_BASS 1.0
#define GME_TREBLE 5.0f
#define GME_BASS 1.0f

#ifdef HAVE_ZLIB
#ifndef _MSC_VER
Expand Down
Loading

0 comments on commit f2b0db5

Please sign in to comment.