mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +00:00
This commit is contained in:
commit
134c2f3f38
8 changed files with 124 additions and 16 deletions
23
.appveyor.yml
Normal file
23
.appveyor.yml
Normal 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
73
.travis.yml
Normal 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
|
|
@ -2676,7 +2676,8 @@ void Net_DoCommand (int type, BYTE **stream, int player)
|
|||
int arg[3] = { 0, 0, 0 };
|
||||
for (int i = 0; i < 3; i++)
|
||||
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;
|
||||
|
||||
|
@ -2727,7 +2728,7 @@ void Net_SkipCommand (int type, BYTE **stream)
|
|||
break;
|
||||
|
||||
case DEM_NETEVENT:
|
||||
skip = strlen((char *)(*stream)) + 14;
|
||||
skip = strlen((char *)(*stream)) + 15;
|
||||
break;
|
||||
|
||||
case DEM_SUMMON2:
|
||||
|
|
|
@ -117,7 +117,7 @@ bool E_UnregisterHandler(DStaticEventHandler* handler)
|
|||
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)
|
||||
return false;
|
||||
|
@ -128,6 +128,7 @@ bool E_SendNetworkEvent(FString name, int arg1, int arg2, int arg3)
|
|||
Net_WriteLong(arg1);
|
||||
Net_WriteLong(arg2);
|
||||
Net_WriteLong(arg3);
|
||||
Net_WriteByte(manual);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -433,10 +434,10 @@ bool E_Responder(event_t* ev)
|
|||
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)
|
||||
handler->ConsoleProcess(player, name, arg1, arg2, arg3);
|
||||
handler->ConsoleProcess(player, name, arg1, arg2, arg3, manual);
|
||||
}
|
||||
|
||||
bool E_CheckUiProcessors()
|
||||
|
@ -523,6 +524,7 @@ DEFINE_FIELD_X(InputEvent, DInputEvent, MouseY);
|
|||
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Player)
|
||||
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Name)
|
||||
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, Args)
|
||||
DEFINE_FIELD_X(ConsoleEvent, DConsoleEvent, IsManual)
|
||||
|
||||
DEFINE_ACTION_FUNCTION(DStaticEventHandler, SetOrder)
|
||||
{
|
||||
|
@ -545,7 +547,7 @@ DEFINE_ACTION_FUNCTION(DEventHandler, SendNetworkEvent)
|
|||
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)
|
||||
|
@ -1091,10 +1093,11 @@ static DConsoleEvent* E_SetupConsoleEvent()
|
|||
e->Name = "";
|
||||
for (size_t i = 0; i < countof(e->Args); i++)
|
||||
e->Args[i] = 0;
|
||||
e->IsManual = false;
|
||||
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)
|
||||
{
|
||||
|
@ -1111,6 +1114,7 @@ void DStaticEventHandler::ConsoleProcess(int player, FString name, int arg1, int
|
|||
e->Args[0] = arg1;
|
||||
e->Args[1] = arg2;
|
||||
e->Args[2] = arg3;
|
||||
e->IsManual = manual;
|
||||
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, e };
|
||||
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[1] = arg2;
|
||||
e->Args[2] = arg3;
|
||||
e->IsManual = manual;
|
||||
|
||||
VMValue params[2] = { (DStaticEventHandler*)this, e };
|
||||
GlobalVMStack.Call(func, params, 2, nullptr, 0, nullptr);
|
||||
|
@ -1162,7 +1167,7 @@ CCMD(event)
|
|||
for (int i = 0; i < argn; i++)
|
||||
arg[i] = atoi(argv[2 + i]);
|
||||
// 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++)
|
||||
arg[i] = atoi(argv[2 + i]);
|
||||
// call networked
|
||||
E_SendNetworkEvent(argv[1], arg[0], arg[1], arg[2]);
|
||||
E_SendNetworkEvent(argv[1], arg[0], arg[1], arg[2], true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,10 +58,10 @@ void E_PlayerDisconnected(int num);
|
|||
// this executes on events.
|
||||
bool E_Responder(event_t* ev); // splits events into InputProcess and UiProcess
|
||||
// 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.
|
||||
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
|
||||
bool E_CheckUiProcessors();
|
||||
|
@ -152,7 +152,7 @@ public:
|
|||
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
|
||||
{
|
||||
|
@ -300,10 +300,13 @@ public:
|
|||
//
|
||||
FString Name;
|
||||
int Args[3];
|
||||
//
|
||||
bool IsManual;
|
||||
|
||||
DConsoleEvent()
|
||||
{
|
||||
Player = -1;
|
||||
IsManual = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -8516,7 +8516,6 @@ bool FxVMFunctionCall::CheckAccessibility(const VersionInfo &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);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -8565,7 +8564,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
|||
if (!CheckAccessibility(ctx.Version))
|
||||
{
|
||||
delete this;
|
||||
return false;
|
||||
return nullptr;
|
||||
}
|
||||
// This should never happen.
|
||||
if (Self == nullptr && (Function->Variants[0].Flags & VARF_Method))
|
||||
|
|
|
@ -6,7 +6,8 @@
|
|||
#ifdef HAVE_MPG123
|
||||
|
||||
#ifdef _MSC_VER
|
||||
typedef int ssize_t;
|
||||
#include <stddef.h>
|
||||
typedef ptrdiff_t ssize_t;
|
||||
#endif
|
||||
#include "mpg123.h"
|
||||
|
||||
|
|
|
@ -275,8 +275,11 @@ class ConsoleEvent : BaseEvent native version("2.4")
|
|||
// 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].
|
||||
native readonly int Player;
|
||||
// this is the name and args as specified in SendNetworkEvent or event/netevent CCMDs
|
||||
native readonly String Name;
|
||||
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")
|
||||
|
@ -318,7 +321,7 @@ class StaticEventHandler : Object native play version("2.4")
|
|||
|
||||
//
|
||||
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);
|
||||
|
|
Loading…
Reference in a new issue