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
13 changes: 13 additions & 0 deletions src/compat.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#pragma once

#include <memory>

// Backport of `std::make_unique` for the Xbox 360 toolchain.
//
// The Xenon compiler provides std::unique_ptr but does not support:
// - `std::make_unique` (introduced in C++14)
// - variadic templates (required by the real make_unique)
template <typename T> inline std::unique_ptr<T> make_unique()
{
return std::unique_ptr<T>(new T());
}
4 changes: 0 additions & 4 deletions src/game/iw2/mp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,5 @@ IW2_MP_Plugin::~IW2_MP_Plugin()
{
}

bool IW2_MP_Plugin::ShouldLoad()
{
return (strncmp((char *)0x820410E4, "multiplayer", 11) == 0);
}
} // namespace mp
} // namespace iw2
1 change: 0 additions & 1 deletion src/game/iw2/mp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class IW2_MP_Plugin : public Plugin
public:
IW2_MP_Plugin();
~IW2_MP_Plugin();
static bool ShouldLoad();
};
} // namespace mp
} // namespace iw2
6 changes: 0 additions & 6 deletions src/game/iw2/sp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,5 @@ IW2_SP_Plugin::~IW2_SP_Plugin()
{
}

bool IW2_SP_Plugin::ShouldLoad()
{
// Check if the game is in single player mode
return (strncmp((char *)0x82059FE0, "startSingleplayer", 17) == 0);
}

} // namespace sp
} // namespace iw2
1 change: 0 additions & 1 deletion src/game/iw2/sp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class IW2_SP_Plugin : public Plugin
public:
IW2_SP_Plugin();
~IW2_SP_Plugin();
static bool ShouldLoad();
};
} // namespace sp
} // namespace iw2
5 changes: 0 additions & 5 deletions src/game/iw3/mp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1607,10 +1607,5 @@ IW3_MP_Plugin::~IW3_MP_Plugin()
Pmove_Detour.Remove();
}

bool IW3_MP_Plugin::ShouldLoad()
{
return (strncmp((char *)0x82032AC4, "multiplayer", 11) == 0);
}

} // namespace mp
} // namespace iw3
1 change: 0 additions & 1 deletion src/game/iw3/mp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class IW3_MP_Plugin : public Plugin
public:
IW3_MP_Plugin();
~IW3_MP_Plugin();
static bool ShouldLoad();
};
} // namespace mp
} // namespace iw3
5 changes: 0 additions & 5 deletions src/game/iw3/sp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,5 @@ IW3_SP_Plugin::~IW3_SP_Plugin()
Load_MapEntsPtr_Detour.Remove();
}

bool IW3_SP_Plugin::ShouldLoad()
{
return (strncmp((char *)0x82065E48, "startSingleplayer", 17) == 0);
}

} // namespace sp
} // namespace iw3
1 change: 0 additions & 1 deletion src/game/iw3/sp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class IW3_SP_Plugin : public Plugin
public:
IW3_SP_Plugin();
~IW3_SP_Plugin();
static bool ShouldLoad();
};
} // namespace sp
} // namespace iw3
6 changes: 0 additions & 6 deletions src/game/iw4/mp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,5 @@ IW4_MP_Plugin::IW4_MP_Plugin()
RegisterModule(new scr_parser());
}

bool IW4_MP_Plugin::ShouldLoad()
{
DbgPrint("IW4 MP: Checking if plugin should load\n");
return (strncmp((char *)0x82001F44, "multiplayer", 11) == 0);
}

} // namespace mp
} // namespace iw4
1 change: 0 additions & 1 deletion src/game/iw4/mp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class IW4_MP_Plugin : public Plugin

public:
IW4_MP_Plugin();
static bool ShouldLoad();
};
} // namespace mp
} // namespace iw4
6 changes: 0 additions & 6 deletions src/game/iw4/sp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,5 @@ IW4_SP_Plugin::IW4_SP_Plugin()
RegisterModule(new scr_parser());
}

bool IW4_SP_Plugin::ShouldLoad()
{
DbgPrint("IW4 SP: Checking if plugin should load\n");
return (strncmp((char *)0x8203C924, "startSingleplayer", 17) == 0);
}

} // namespace sp
} // namespace iw4
1 change: 0 additions & 1 deletion src/game/iw4/sp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class IW4_SP_Plugin : public Plugin

public:
IW4_SP_Plugin();
static bool ShouldLoad();
};
} // namespace sp
} // namespace iw4
4 changes: 0 additions & 4 deletions src/game/iw5/mp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,5 @@ IW5_MP_Plugin::~IW5_MP_Plugin()
DB_IsXAssetDefault_Detour.Remove();
}

bool IW5_MP_Plugin::ShouldLoad()
{
return (strncmp((char *)0x82001458, "multiplayer", 11) == 0);
}
} // namespace mp
} // namespace iw5
1 change: 0 additions & 1 deletion src/game/iw5/mp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ class IW5_MP_Plugin : public Plugin
public:
IW5_MP_Plugin();
~IW5_MP_Plugin();
static bool ShouldLoad();
};
} // namespace mp
} // namespace iw5
5 changes: 0 additions & 5 deletions src/game/qos/mp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,5 @@ QOS_MP_Plugin::QOS_MP_Plugin()
RegisterModule(new scr_parser());
}

bool QOS_MP_Plugin::ShouldLoad()
{
return strncmp((char *)0x8200236C, "multiplayer", 11) == 0;
}

} // namespace mp
} // namespace qos
1 change: 0 additions & 1 deletion src/game/qos/mp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class QOS_MP_Plugin : public Plugin

public:
QOS_MP_Plugin();
static bool ShouldLoad();
};
} // namespace mp
} // namespace qos
5 changes: 0 additions & 5 deletions src/game/qos/sp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,5 @@ QOS_SP_Plugin::QOS_SP_Plugin()
RegisterModule(new scr_parser());
}

bool QOS_SP_Plugin::ShouldLoad()
{
return strncmp((char *)0x82047EC4, "startSingleplayer", 17) == 0;
}

} // namespace sp
} // namespace qos
1 change: 0 additions & 1 deletion src/game/qos/sp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ class QOS_SP_Plugin : public Plugin
{
public:
QOS_SP_Plugin();
static bool ShouldLoad();
};
} // namespace sp
} // namespace qos
4 changes: 0 additions & 4 deletions src/game/t4/mp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,5 @@ T4_MP_Plugin::~T4_MP_Plugin()
DbgPrint("T4 MP: Plugin unloaded\n");
}

bool T4_MP_Plugin::ShouldLoad()
{
return (strncmp((char *)0x820024CC, "multiplayer", 11) == 0);
}
} // namespace mp
} // namespace t4
1 change: 0 additions & 1 deletion src/game/t4/mp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class T4_MP_Plugin : public Plugin
public:
T4_MP_Plugin();
~T4_MP_Plugin();
static bool ShouldLoad();
};

} // namespace mp
Expand Down
5 changes: 0 additions & 5 deletions src/game/t4/sp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,5 @@ T4_SP_Plugin::T4_SP_Plugin()
RegisterModule(new ui());
}

bool T4_SP_Plugin::ShouldLoad()
{
return (strncmp((char *)0x82035A94, "startSingleplayer", 17) == 0);
}

} // namespace sp
} // namespace t4
1 change: 0 additions & 1 deletion src/game/t4/sp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class T4_SP_Plugin : public Plugin
{
public:
T4_SP_Plugin();
static bool ShouldLoad();
};

} // namespace sp
Expand Down
5 changes: 0 additions & 5 deletions src/game/t5/mp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,5 @@ T5_MP_Plugin::T5_MP_Plugin()
RegisterModule(new scr_parser());
}

bool T5_MP_Plugin::ShouldLoad()
{
return strncmp((char *)0x82001998, "multiplayer", 11) == 0;
}

} // namespace mp
} // namespace t5
1 change: 0 additions & 1 deletion src/game/t5/mp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class T5_MP_Plugin : public Plugin

public:
T5_MP_Plugin();
static bool ShouldLoad();
};
} // namespace mp
} // namespace t5
5 changes: 0 additions & 5 deletions src/game/t5/sp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,5 @@ T5_SP_Plugin::T5_SP_Plugin()
RegisterModule(new scr_parser());
}

bool T5_SP_Plugin::ShouldLoad()
{
return strncmp((char *)0x82018364, "startSingleplayer", 17) == 0;
}

} // namespace sp
} // namespace t5
1 change: 0 additions & 1 deletion src/game/t5/sp/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class T5_SP_Plugin : public Plugin

public:
T5_SP_Plugin();
static bool ShouldLoad();
};

} // namespace sp
Expand Down
1 change: 1 addition & 0 deletions src/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include "xkelib.h"
#include "xbox360.h"
#include "plugin.h"
#include "compat.h"

// Common includes
#include "common/branding.h"
Expand Down
3 changes: 0 additions & 3 deletions src/plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ class Plugin
DbgPrint("Plugin::~Plugin\n");
};

/* Determines if this plugin should load. */
static bool ShouldLoad();

void RegisterModule(Module *module)
{
if (module)
Expand Down
Loading