This commit is contained in:
Rachael Alexanderson 2017-03-06 12:36:34 -05:00
commit 134c2f3f38
8 changed files with 124 additions and 16 deletions

23
.appveyor.yml Normal file
View File

@ -0,0 +1,23 @@
version: "{build}"
os: Visual Studio 2015
platform:
- Win32
- x64
configuration:
- Debug
- Release
before_build:
- cmd: md build
- cmd: cd build
- cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015
- cmd: if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 Win64
- cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% ..
build:
project: build\GZDoom.sln
parallel: true
verbosity: minimal

73
.travis.yml Normal file
View File

@ -0,0 +1,73 @@
language: c++
dist: trusty
sudo: required
matrix:
include:
- os: osx
osx_image: xcode8.2
env:
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Debug -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7"
- os: osx
osx_image: xcode8.2
env:
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_DEPLOYMENT_TARGET=10.7 -DFORCE_INTERNAL_ZLIB=YES -DFORCE_INTERNAL_JPEG=YES -DFORCE_INTERNAL_BZIP2=YES -DFORCE_INTERNAL_GME=YES"
- os: linux
compiler: gcc
env:
- GCC_VERSION=5
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=Release"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- kubuntu-backports
packages:
- g++-5
- libsdl2-dev
- libgme-dev
- libopenal-dev
- libmpg123-dev
- libsndfile-dev
- libfluidsynth-dev
- libgtk-3-dev
- os: linux
compiler: clang
env:
- CLANG_VERSION=3.9
- CMAKE_OPTIONS="-DCMAKE_BUILD_TYPE=RelWithDebInfo -DDYN_OPENAL=NO -DDYN_FLUIDSYNTH=NO"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-3.9
- kubuntu-backports
packages:
- clang-3.9
- libstdc++-5-dev
- libsdl2-dev
- libgme-dev
- libopenal-dev
- libmpg123-dev
- libsndfile-dev
- libfluidsynth-dev
- libgtk-3-dev
before_install:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update; brew install mpg123 libsndfile fluidsynth; fi
- if [ -n "$GCC_VERSION" ]; then export CC="gcc-${GCC_VERSION}" CXX="g++-${GCC_VERSION}"; fi
- if [ -n "$CLANG_VERSION" ]; then export CC="clang-${CLANG_VERSION}" CXX="clang++-${CLANG_VERSION}"; fi
- $CC --version
- $CXX --version
script:
- mkdir build
- cd build
- cmake ${CMAKE_OPTIONS} ..
- make -j2
notifications:
email: false

View File

@ -2676,7 +2676,8 @@ void Net_DoCommand (int type, BYTE **stream, int player)
int arg[3] = { 0, 0, 0 }; int arg[3] = { 0, 0, 0 };
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
arg[i] = ReadLong(stream); arg[i] = ReadLong(stream);
E_Console(player, s, arg[0], arg[1], arg[2]); bool manual = ReadByte(stream);
E_Console(player, s, arg[0], arg[1], arg[2], manual);
} }
break; break;
@ -2727,7 +2728,7 @@ void Net_SkipCommand (int type, BYTE **stream)
break; break;
case DEM_NETEVENT: case DEM_NETEVENT:
skip = strlen((char *)(*stream)) + 14; skip = strlen((char *)(*stream)) + 15;
break; break;
case DEM_SUMMON2: case DEM_SUMMON2:

View File

@ -117,7 +117,7 @@ bool E_UnregisterHandler(DStaticEventHandler* handler)
return true; return true;
} }
bool E_SendNetworkEvent(FString name, int arg1, int arg2, int arg3) bool E_SendNetworkEvent(FString name, int arg1, int arg2, int arg3, bool manual)
{ {
if (gamestate != GS_LEVEL) if (gamestate != GS_LEVEL)
return false; return false;
@ -128,6 +128,7 @@ bool E_SendNetworkEvent(FString name, int arg1, int arg2, int arg3)
Net_WriteLong(arg1); Net_WriteLong(arg1);
Net_WriteLong(arg2); Net_WriteLong(arg2);
Net_WriteLong(arg3); Net_WriteLong(arg3);
Net_WriteByte(manual);
return true; return true;
} }
@ -433,10 +434,10 @@ bool E_Responder(event_t* ev)
return false; return false;
} }
void E_Console(int player, FString name, int arg1, int arg2, int arg3) void E_Console(int player, FString name, int arg1, int arg2, int arg3, bool manual)
{ {
for (DStaticEventHandler* handler = E_FirstEventHandler; handler; handler = handler->next) for (DStaticEventHandler* handler = E_FirstEventHandler; handler; handler = handler->next)
handler->ConsoleProcess(player, name, arg1, arg2, arg3); handler->ConsoleProcess(player, name, arg1, arg2, arg3, manual);
} }
bool E_CheckUiProcessors() bool E_CheckUiProcessors()
@ -523,6 +524,7 @@ DEFINE_FIELD_X(InputEvent, DInputEvent, MouseY);
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Player) DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Player)
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Name) DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Name)
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Args) DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Args)
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, IsManual)
DEFINE_ACTION_FUNCTION(DStaticEventHandler, SetOrder) DEFINE_ACTION_FUNCTION(DStaticEventHandler, SetOrder)
{ {
@ -545,7 +547,7 @@ DEFINE_ACTION_FUNCTION(DEventHandler, SendNetworkEvent)
PARAM_INT(arg3); PARAM_INT(arg3);
// //
ACTION_RETURN_BOOL(E_SendNetworkEvent(name, arg1, arg2, arg3)); ACTION_RETURN_BOOL(E_SendNetworkEvent(name, arg1, arg2, arg3, false));
} }
DEFINE_ACTION_FUNCTION(DEventHandler, Create) DEFINE_ACTION_FUNCTION(DEventHandler, Create)
@ -1091,10 +1093,11 @@ static DConsoleEvent* E_SetupConsoleEvent()
e->Name = ""; e->Name = "";
for (size_t i = 0; i < countof(e->Args); i++) for (size_t i = 0; i < countof(e->Args); i++)
e->Args[i] = 0; e->Args[i] = 0;
e->IsManual = false;
return e; return e;
} }
void DStaticEventHandler::ConsoleProcess(int player, FString name, int arg1, int arg2, int arg3) void DStaticEventHandler::ConsoleProcess(int player, FString name, int arg1, int arg2, int arg3, bool manual)
{ {
if (player < 0) if (player < 0)
{ {
@ -1111,6 +1114,7 @@ void DStaticEventHandler::ConsoleProcess(int player, FString name, int arg1, int
e->Args[0] = arg1; e->Args[0] = arg1;
e->Args[1] = arg2; e->Args[1] = arg2;
e->Args[2] = arg3; e->Args[2] = arg3;
e->IsManual = manual;
VMValue params[2] = { (DStaticEventHandler*)this, e }; VMValue params[2] = { (DStaticEventHandler*)this, e };
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr); GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
@ -1131,6 +1135,7 @@ void DStaticEventHandler::ConsoleProcess(int player, FString name, int arg1, int
e->Args[0] = arg1; e->Args[0] = arg1;
e->Args[1] = arg2; e->Args[1] = arg2;
e->Args[2] = arg3; e->Args[2] = arg3;
e->IsManual = manual;
VMValue params[2] = { (DStaticEventHandler*)this, e }; VMValue params[2] = { (DStaticEventHandler*)this, e };
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr); GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
@ -1162,7 +1167,7 @@ CCMD(event)
for (int i = 0; i < argn; i++) for (int i = 0; i < argn; i++)
arg[i] = atoi(argv[2 + i]); arg[i] = atoi(argv[2 + i]);
// call locally // call locally
E_Console(-1, argv[1], arg[0], arg[1], arg[2]); E_Console(-1, argv[1], arg[0], arg[1], arg[2], true);
} }
} }
@ -1187,6 +1192,6 @@ CCMD(netevent)
for (int i = 0; i < argn; i++) for (int i = 0; i < argn; i++)
arg[i] = atoi(argv[2 + i]); arg[i] = atoi(argv[2 + i]);
// call networked // call networked
E_SendNetworkEvent(argv[1], arg[0], arg[1], arg[2]); E_SendNetworkEvent(argv[1], arg[0], arg[1], arg[2], true);
} }
} }

View File

@ -58,10 +58,10 @@ void E_PlayerDisconnected(int num);
// this executes on events. // this executes on events.
bool E_Responder(event_t* ev); // splits events into InputProcess and UiProcess bool E_Responder(event_t* ev); // splits events into InputProcess and UiProcess
// this executes on console/net events. // this executes on console/net events.
void E_Console(int player, FString name, int arg1, int arg2, int arg3); void E_Console(int player, FString name, int arg1, int arg2, int arg3, bool manual);
// send networked event. unified function. // send networked event. unified function.
bool E_SendNetworkEvent(FString name, int arg1, int arg2, int arg3); bool E_SendNetworkEvent(FString name, int arg1, int arg2, int arg3, bool manual);
// check if there is anything that should receive GUI events // check if there is anything that should receive GUI events
bool E_CheckUiProcessors(); bool E_CheckUiProcessors();
@ -152,7 +152,7 @@ public:
bool UiProcess(event_t* ev); bool UiProcess(event_t* ev);
// //
void ConsoleProcess(int player, FString name, int arg1, int arg2, int arg3); void ConsoleProcess(int player, FString name, int arg1, int arg2, int arg3, bool manual);
}; };
class DEventHandler : public DStaticEventHandler class DEventHandler : public DStaticEventHandler
{ {
@ -300,10 +300,13 @@ public:
// //
FString Name; FString Name;
int Args[3]; int Args[3];
//
bool IsManual;
DConsoleEvent() DConsoleEvent()
{ {
Player = -1; Player = -1;
IsManual = false;
} }
}; };

View File

@ -8516,7 +8516,6 @@ bool FxVMFunctionCall::CheckAccessibility(const VersionInfo &ver)
if ((Function->Variants[0].Flags & VARF_Deprecated) && Function->mVersion >= ver) if ((Function->Variants[0].Flags & VARF_Deprecated) && Function->mVersion >= ver)
{ {
ScriptPosition.Message(MSG_WARNING, "Accessing deprecated function %s - deprecated since %d.%d.%d", Function->SymbolName.GetChars(), Function->mVersion.major, Function->mVersion.minor, Function->mVersion.revision); ScriptPosition.Message(MSG_WARNING, "Accessing deprecated function %s - deprecated since %d.%d.%d", Function->SymbolName.GetChars(), Function->mVersion.major, Function->mVersion.minor, Function->mVersion.revision);
return false;
} }
return true; return true;
} }
@ -8565,7 +8564,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
if (!CheckAccessibility(ctx.Version)) if (!CheckAccessibility(ctx.Version))
{ {
delete this; delete this;
return false; return nullptr;
} }
// This should never happen. // This should never happen.
if (Self == nullptr && (Function->Variants[0].Flags & VARF_Method)) if (Self == nullptr && (Function->Variants[0].Flags & VARF_Method))

View File

@ -6,7 +6,8 @@
#ifdef HAVE_MPG123 #ifdef HAVE_MPG123
#ifdef _MSC_VER #ifdef _MSC_VER
typedef int ssize_t; #include <stddef.h>
typedef ptrdiff_t ssize_t;
#endif #endif
#include "mpg123.h" #include "mpg123.h"

View File

@ -275,8 +275,11 @@ class ConsoleEvent : BaseEvent native version("2.4")
// for net events, this will be the activator. // for net events, this will be the activator.
// for UI events, this is always -1, and you need to check if level is loaded and use players[consoleplayer]. // for UI events, this is always -1, and you need to check if level is loaded and use players[consoleplayer].
native readonly int Player; native readonly int Player;
// this is the name and args as specified in SendNetworkEvent or event/netevent CCMDs
native readonly String Name; native readonly String Name;
native readonly int Args[3]; native readonly int Args[3];
// this will be true if the event is fired from the console by event/netevent CCMD
native readonly bool IsManual;
} }
class StaticEventHandler : Object native play version("2.4") class StaticEventHandler : Object native play version("2.4")
@ -318,7 +321,7 @@ class StaticEventHandler : Object native play version("2.4")
// //
virtual native ui bool UiProcess(UiEvent e); virtual native ui bool UiProcess(UiEvent e);
virtual native bool InputProcess(InputEvent e); virtual native ui bool InputProcess(InputEvent e);
// //
virtual native ui void ConsoleProcess(ConsoleEvent e); virtual native ui void ConsoleProcess(ConsoleEvent e);