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 .github/build/linux/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ rm -f *
cp ../README.md ./
cp ../LICENSE ./

for f in Q3A; do
for f in Q3A QUAKE2; do
cp ../bin/release-$f/x86/rocketmod_qmm_$f.so ./
cp ../bin/release-$f/x86_64/rocketmod_qmm_x86_64_$f.so ./
done
Expand Down
2 changes: 1 addition & 1 deletion .github/build/windows/debug.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
for %%x in (Q3A) do (
for %%x in (Q2R Q3A QUAKE2) do (
msbuild .\msvc\rocketmod_qmm.vcxproj /p:Configuration=Debug-%%x /p:Platform=x86
msbuild .\msvc\rocketmod_qmm.vcxproj /p:Configuration=Debug-%%x /p:Platform=x64
)
2 changes: 1 addition & 1 deletion .github/build/windows/package.bat
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ del /q *
rem copy ..\README.md .\
rem copy ..\LICENSE .\

for %%x in (Q3A) do (
for %%x in (Q2R Q3A QUAKE2) do (
copy ..\bin\Release-%%x\x86\rocketmod_qmm_%%x.dll .\
copy ..\bin\Release-%%x\x64\rocketmod_qmm_x86_64_%%x.dll .\
)
Expand Down
2 changes: 1 addition & 1 deletion .github/build/windows/release.bat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
for %%x in (Q3A) do (
for %%x in (Q2R Q3A QUAKE2) do (
msbuild .\msvc\rocketmod_qmm.vcxproj /p:Configuration=Release-%%x /p:Platform=x86
msbuild .\msvc\rocketmod_qmm.vcxproj /p:Configuration=Release-%%x /p:Platform=x64
)
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# RocketMod - Rocket Launchers-Only Plugin
# STUB_QMM - Example QMM Plugin
# Copyright 2004-2025
# https://github.com/thecybermind/rocketmod_qmm/
# https://github.com/thecybermind/stub_qmm/
# 3-clause BSD license: https://opensource.org/license/bsd-3-clause
# Created By: Kevin Masterson < k.m.masterson@gmail.com >

BIN_32 := rocketmod_qmm
BIN_64 := rocketmod_qmm_x86_64
GAMES := Q3A
GAMES := Q3A QUAKE2

CC := g++

Expand Down
2 changes: 2 additions & 0 deletions games.lst
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Q2R
Q3A
QUAKE2
17 changes: 14 additions & 3 deletions include/game.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@ Created By:
#define __ROCKETMOD_QMM_GAME_H__

#if defined(GAME_Q3A)
#include <q3a/game/q_shared.h>
#include <q3a/game/g_local.h>
#include <q3a/game/q_shared.h>
#include <q3a/game/g_local.h>
#elif defined(GAME_QUAKE2)
#include <quake2/game/g_local.h>
#include <game_quake2.h>
#elif defined(GAME_Q2R)
#include <q2r/rerelease/g_local.h>
#include <game_q2r.h>
#else
#error Only supported in Quake 3!
#error Only supported in Quake 2 and Quake 3!
#endif

intptr_t GAME_vmMain(intptr_t cmd, intptr_t* args);
intptr_t GAME_syscall(intptr_t cmd, intptr_t* args);
intptr_t GAME_vmMain_Post(intptr_t cmd, intptr_t* args);
intptr_t GAME_syscall_Post(intptr_t cmd, intptr_t* args);

#endif // __ROCKETMOD_QMM_GAME_H__
26 changes: 26 additions & 0 deletions include/main.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
RocketMod - Rocket Launchers-Only Plugin
Copyright 2004-2024
https://github.com/thecybermind/rocketmod_qmm/
3-clause BSD license: https://opensource.org/license/bsd-3-clause

Created By:
Kevin Masterson < k.m.masterson@gmail.com >

*/

#ifndef __ROCKETMOD_QMM_MAIN_H__
#define __ROCKETMOD_QMM_MAIN_H__

#include <qmmapi.h>

#include "version.h"
#include "game.h"

extern gentity_t* g_gents;
extern intptr_t g_numgents;
extern intptr_t g_gentsize;
extern gclient_t* g_clients;
extern intptr_t g_clientsize;

#endif // __ROCKETMOD_QMM_MAIN_H__
27 changes: 27 additions & 0 deletions include/util.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
RocketMod - Rocket Launchers-Only Plugin
Copyright 2004-2024
https://github.com/thecybermind/rocketmod_qmm/
3-clause BSD license: https://opensource.org/license/bsd-3-clause

Created By:
Kevin Masterson < k.m.masterson@gmail.com >

*/

#ifndef __ROCKETMOD_QMM_UTIL_H__
#define __ROCKETMOD_QMM_UTIL_H__

#include <vector>
#include <string>

// "safe" strncpy that always null-terminates
char* strncpyz(char* dest, const char* src, size_t count);

// break an entstring into a list of string tokens
std::vector<std::string> tokenlist_from_entstring(const char* entstring);

// generate an entstring from a list of string tokens
const char* entstring_from_tokenlist(std::vector<std::string> tokenlist);

#endif // __ROCKETMOD_QMM_UTIL_H__
24 changes: 24 additions & 0 deletions msvc/rocketmod_qmm.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,44 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rocketmod_qmm", "rocketmod_
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug-Q2R|x86 = Debug-Q2R|x86
Debug-Q2R|x64 = Debug-Q2R|x64
Debug-Q3A|x86 = Debug-Q3A|x86
Debug-Q3A|x64 = Debug-Q3A|x64
Debug-QUAKE2|x86 = Debug-QUAKE2|x86
Debug-QUAKE2|x64 = Debug-QUAKE2|x64
Release-Q2R|x86 = Release-Q2R|x86
Release-Q2R|x64 = Release-Q2R|x64
Release-Q3A|x86 = Release-Q3A|x86
Release-Q3A|x64 = Release-Q3A|x64
Release-QUAKE2|x86 = Release-QUAKE2|x86
Release-QUAKE2|x64 = Release-QUAKE2|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q2R|x86.ActiveCfg = Debug-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q2R|x86.Build.0 = Debug-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q2R|x64.ActiveCfg = Debug-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q2R|x64.Build.0 = Debug-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q3A|x86.ActiveCfg = Debug-Q3A|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q3A|x86.Build.0 = Debug-Q3A|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q3A|x64.ActiveCfg = Debug-Q3A|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-Q3A|x64.Build.0 = Debug-Q3A|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-QUAKE2|x86.ActiveCfg = Debug-QUAKE2|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-QUAKE2|x86.Build.0 = Debug-QUAKE2|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-QUAKE2|x64.ActiveCfg = Debug-QUAKE2|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Debug-QUAKE2|x64.Build.0 = Debug-QUAKE2|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q2R|x86.ActiveCfg = Release-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q2R|x86.Build.0 = Release-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q2R|x64.ActiveCfg = Release-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q2R|x64.Build.0 = Release-Q2R|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q3A|x86.ActiveCfg = Release-Q3A|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q3A|x86.Build.0 = Release-Q3A|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q3A|x64.ActiveCfg = Release-Q3A|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-Q3A|x64.Build.0 = Release-Q3A|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-QUAKE2|x86.ActiveCfg = Release-QUAKE2|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-QUAKE2|x86.Build.0 = Release-QUAKE2|Win32
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-QUAKE2|x64.ActiveCfg = Release-QUAKE2|x64
{1D5BE629-82D1-4511-8559-5116BFE4338C}.Release-QUAKE2|x64.Build.0 = Release-QUAKE2|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
49 changes: 49 additions & 0 deletions msvc/rocketmod_qmm.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,55 @@
<Configuration>Debug-Q3A</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-QUAKE2|Win32">
<Configuration>Debug-QUAKE2</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-Q2R|x64">
<Configuration>Debug-Q2R</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-Q3A|x64">
<Configuration>Debug-Q3A</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug-QUAKE2|x64">
<Configuration>Debug-QUAKE2</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Q3A|Win32">
<Configuration>Release-Q3A</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-QUAKE2|Win32">
<Configuration>Release-QUAKE2</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Q2R|x64">
<Configuration>Release-Q2R</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-Q3A|x64">
<Configuration>Release-Q3A</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release-QUAKE2|x64">
<Configuration>Release-QUAKE2</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\game.h" />
<ClInclude Include="..\include\main.h" />
<ClInclude Include="..\include\util.h" />
<ClInclude Include="..\include\version.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\game_q2r.cpp" />
<ClCompile Include="..\src\game_q3a.cpp" />
<ClCompile Include="..\src\game_quake2.cpp" />
<ClCompile Include="..\src\main.cpp" />
<ClCompile Include="..\src\util.cpp" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">
Expand Down Expand Up @@ -69,9 +99,18 @@
<PropertyGroup Condition="$(Platform)=='Win32' And $(Configuration.EndsWith('-Q3A'))==true">
<TargetName>$(ProjectName)_Q3A</TargetName>
</PropertyGroup>
<PropertyGroup Condition="$(Platform)=='Win32' And $(Configuration.EndsWith('-QUAKE2'))==true">
<TargetName>$(ProjectName)_QUAKE2</TargetName>
</PropertyGroup>
<PropertyGroup Condition="$(Platform)=='x64' And $(Configuration.EndsWith('-Q2R'))==true">
<TargetName>$(ProjectName)_x86_64_Q2R</TargetName>
</PropertyGroup>
<PropertyGroup Condition="$(Platform)=='x64' And $(Configuration.EndsWith('-Q3A'))==true">
<TargetName>$(ProjectName)_x86_64_Q3A</TargetName>
</PropertyGroup>
<PropertyGroup Condition="$(Platform)=='x64' And $(Configuration.EndsWith('-QUAKE2'))==true">
<TargetName>$(ProjectName)_x86_64_QUAKE2</TargetName>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WarningLevel>Level3</WarningLevel>
Expand Down Expand Up @@ -111,11 +150,21 @@
<GenerateDebugInformation>false</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(Configuration.EndsWith('-Q2R'))==true">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);GAME_Q2R</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(Configuration.EndsWith('-Q3A'))==true">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);GAME_Q3A</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="$(Configuration.EndsWith('-QUAKE2'))==true">
<ClCompile>
<PreprocessorDefinitions>%(PreprocessorDefinitions);GAME_QUAKE2</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
18 changes: 18 additions & 0 deletions msvc/rocketmod_qmm.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,29 @@
<ClInclude Include="..\include\version.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\main.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\include\util.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\main.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\game_q2r.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\game_q3a.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\game_quake2.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\util.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">
Expand Down
Loading