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
9 changes: 0 additions & 9 deletions RTEA.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,6 @@
<ClInclude Include="Source\Managers\GLResourceMan.h" />
<ClInclude Include="Source\Managers\MusicMan.h" />
<ClInclude Include="Source\Managers\MenuMan.h" />
<ClInclude Include="Source\Managers\NetworkClient.h" />
<ClInclude Include="Source\Managers\NetworkServer.h" />
<ClInclude Include="Source\Managers\PerformanceMan.h" />
<ClInclude Include="Source\Managers\PostProcessMan.h" />
<ClInclude Include="Source\Managers\PrimitiveMan.h" />
Expand Down Expand Up @@ -803,7 +801,6 @@
<ClInclude Include="Source\Renderer\GLCheck.h" />
<ClInclude Include="Source\System\InputMapping.h" />
<ClInclude Include="Source\System\InputScheme.h" />
<ClInclude Include="Source\System\NetworkMessages.h" />
<ClInclude Include="Source\System\GraphicalPrimitive.h" />
<ClInclude Include="Source\System\Gamepad.h" />
<ClInclude Include="Source\Menus\InventoryMenuGUI.h" />
Expand Down Expand Up @@ -924,8 +921,6 @@
<ClInclude Include="Source\Activities\GAScripted.h" />
<ClInclude Include="Source\Activities\GATutorial.h" />
<ClInclude Include="Source\Activities\GibEditor.h" />
<ClInclude Include="Source\Activities\MultiplayerGame.h" />
<ClInclude Include="Source\Activities\MultiplayerServerLobby.h" />
<ClInclude Include="Source\Activities\SceneEditor.h" />
<ClInclude Include="Source\Menus\AreaEditorGUI.h" />
<ClInclude Include="Source\Menus\AreaPickerGUI.h" />
Expand Down Expand Up @@ -1016,8 +1011,6 @@
<ClCompile Include="Source\GUI\GUISound.cpp" />
<ClCompile Include="Source\GUI\GUIWriter.cpp" />
<ClCompile Include="Source\Managers\MenuMan.cpp" />
<ClCompile Include="Source\Managers\NetworkClient.cpp" />
<ClCompile Include="Source\Managers\NetworkServer.cpp" />
<ClCompile Include="Source\Managers\PerformanceMan.cpp" />
<ClCompile Include="Source\Managers\PostProcessMan.cpp" />
<ClCompile Include="Source\Managers\PrimitiveMan.cpp" />
Expand Down Expand Up @@ -1448,8 +1441,6 @@
<ClCompile Include="Source\Activities\GAScripted.cpp" />
<ClCompile Include="Source\Activities\GATutorial.cpp" />
<ClCompile Include="Source\Activities\GibEditor.cpp" />
<ClCompile Include="Source\Activities\MultiplayerGame.cpp" />
<ClCompile Include="Source\Activities\MultiplayerServerLobby.cpp" />
<ClCompile Include="Source\Activities\SceneEditor.cpp" />
<ClCompile Include="Source\Menus\AreaEditorGUI.cpp" />
<ClCompile Include="Source\Menus\AreaPickerGUI.cpp" />
Expand Down
24 changes: 0 additions & 24 deletions RTEA.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -417,18 +417,6 @@
<ClInclude Include="Source\Entities\PEmitter.h">
<Filter>Entities</Filter>
</ClInclude>
<ClInclude Include="Source\Managers\NetworkClient.h">
<Filter>Managers</Filter>
</ClInclude>
<ClInclude Include="Source\Managers\NetworkServer.h">
<Filter>Managers</Filter>
</ClInclude>
<ClInclude Include="Source\Activities\MultiplayerGame.h">
<Filter>Activities</Filter>
</ClInclude>
<ClInclude Include="Source\Activities\MultiplayerServerLobby.h">
<Filter>Activities</Filter>
</ClInclude>
<ClInclude Include="Source\System\StandardIncludes.h">
<Filter>System</Filter>
</ClInclude>
Expand Down Expand Up @@ -998,18 +986,6 @@
<ClCompile Include="Source\Entities\PEmitter.cpp">
<Filter>Entities</Filter>
</ClCompile>
<ClCompile Include="Source\Managers\NetworkClient.cpp">
<Filter>Managers</Filter>
</ClCompile>
<ClCompile Include="Source\Managers\NetworkServer.cpp">
<Filter>Managers</Filter>
</ClCompile>
<ClCompile Include="Source\Activities\MultiplayerGame.cpp">
<Filter>Activities</Filter>
</ClCompile>
<ClCompile Include="Source\Activities\MultiplayerServerLobby.cpp">
<Filter>Activities</Filter>
</ClCompile>
<ClCompile Include="Source\System\StandardIncludes.cpp">
<Filter>System</Filter>
</ClCompile>
Expand Down
54 changes: 23 additions & 31 deletions Source/Activities/GameActivity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -786,37 +786,32 @@ int GameActivity::Start() {
////////////////////////////////////
// GUI split screen setup
// If there are split screens, set up the GUIs to draw and their mouses to point correctly
if (g_FrameMan.IsInMultiplayerMode()) {
m_pEditorGUI[player]->SetPosOnScreen(0, 0);
m_pBuyGUI[player]->SetPosOnScreen(0, 0);
} else {
if (g_FrameMan.GetScreenCount() > 1) {
// Screen 1 Always upper left corner
if (ScreenOfPlayer(player) == 0) {
m_pEditorGUI[player]->SetPosOnScreen(0, 0);
m_pBuyGUI[player]->SetPosOnScreen(0, 0);
} else if (ScreenOfPlayer(player) == 1) {
// If both splits, or just Vsplit, then in upper right quadrant
if ((g_FrameMan.GetVSplit() && !g_FrameMan.GetHSplit()) || (g_FrameMan.GetVSplit() && g_FrameMan.GetVSplit())) {
m_pEditorGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, 0);
m_pBuyGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, 0);
}
// If only hsplit, then lower left quadrant
else {
m_pEditorGUI[player]->SetPosOnScreen(0, g_WindowMan.GetResY() / 2);
m_pBuyGUI[player]->SetPosOnScreen(0, g_WindowMan.GetResY() / 2);
}
if (g_FrameMan.GetScreenCount() > 1) {
// Screen 1 Always upper left corner
if (ScreenOfPlayer(player) == 0) {
m_pEditorGUI[player]->SetPosOnScreen(0, 0);
m_pBuyGUI[player]->SetPosOnScreen(0, 0);
} else if (ScreenOfPlayer(player) == 1) {
// If both splits, or just Vsplit, then in upper right quadrant
if ((g_FrameMan.GetVSplit() && !g_FrameMan.GetHSplit()) || (g_FrameMan.GetVSplit() && g_FrameMan.GetVSplit())) {
m_pEditorGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, 0);
m_pBuyGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, 0);
}
// Screen 3 is lower left quadrant
else if (ScreenOfPlayer(player) == 2) {
// If only hsplit, then lower left quadrant
else {
m_pEditorGUI[player]->SetPosOnScreen(0, g_WindowMan.GetResY() / 2);
m_pBuyGUI[player]->SetPosOnScreen(0, g_WindowMan.GetResY() / 2);
}
// Screen 4 is lower right quadrant
else if (ScreenOfPlayer(player) == 3) {
m_pEditorGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, g_WindowMan.GetResY() / 2);
m_pBuyGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, g_WindowMan.GetResY() / 2);
}
}
// Screen 3 is lower left quadrant
else if (ScreenOfPlayer(player) == 2) {
m_pEditorGUI[player]->SetPosOnScreen(0, g_WindowMan.GetResY() / 2);
m_pBuyGUI[player]->SetPosOnScreen(0, g_WindowMan.GetResY() / 2);
}
// Screen 4 is lower right quadrant
else if (ScreenOfPlayer(player) == 3) {
m_pEditorGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, g_WindowMan.GetResY() / 2);
m_pBuyGUI[player]->SetPosOnScreen(g_WindowMan.GetResX() / 2, g_WindowMan.GetResY() / 2);
}
}

Expand Down Expand Up @@ -1730,10 +1725,7 @@ void GameActivity::Update() {
if (m_ActivityState == ActivityState::Over && m_GameOverTimer.IsPastRealMS(m_GameOverPeriod)) {
g_FrameMan.ClearScreenText(ScreenOfPlayer(player));
// g_FrameMan.SetScreenText("Press [Esc] to leave the battlefield", ScreenOfPlayer(player), 750);
if (g_FrameMan.IsInMultiplayerMode())
g_FrameMan.SetScreenText("All players must press and hold [BACKSPACE] to continue!", ScreenOfPlayer(player), 750);
else
g_FrameMan.SetScreenText("Press [SPACE] or [START] to continue!", ScreenOfPlayer(player), 750);
g_FrameMan.SetScreenText("Press [SPACE] or [START] to continue!", ScreenOfPlayer(player), 750);

// Actually end on space
if (m_GameOverTimer.IsPastSimMS(55000) || g_UInputMan.AnyStartPress()) {
Expand Down
4 changes: 2 additions & 2 deletions Source/Activities/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ sources += files(
'GAScripted.cpp',
'GATutorial.cpp',
'GibEditor.cpp',
'MultiplayerGame.cpp',
'MultiplayerServerLobby.cpp',
#'MultiplayerGame.cpp',
#'MultiplayerServerLobby.cpp',
'SceneEditor.cpp',
)
13 changes: 3 additions & 10 deletions Source/Entities/Activity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "FrameMan.h"
#include "MetaMan.h"
#include "SceneMan.h"
#include "NetworkClient.h"

#include "ACraft.h"

Expand Down Expand Up @@ -296,11 +295,9 @@ int Activity::Start() {
m_Paused = false;

// Reset the mouse moving so that it won't trap the mouse if the window isn't in focus (common after loading)
if (!g_FrameMan.IsInMultiplayerMode()) {
g_UInputMan.DisableMouseMoving(true);
g_UInputMan.DisableMouseMoving(false);
g_UInputMan.DisableKeys(false);
}
g_UInputMan.DisableMouseMoving(true);
g_UInputMan.DisableMouseMoving(false);
g_UInputMan.DisableKeys(false);

int error = g_SceneMan.LoadScene();
if (error < 0) {
Expand Down Expand Up @@ -881,9 +878,5 @@ bool Activity::CanBeUserSaved() const {
return false;
}

if (g_NetworkClient.IsConnectedAndRegistered()) {
return false;
}

return m_AllowsUserSaving;
}
1 change: 1 addition & 0 deletions Source/Entities/Activity.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "Icon.h"
#include "Controller.h"
#include "GenericSavedData.h"
#include "Entity.h"

namespace RTE {

Expand Down
24 changes: 0 additions & 24 deletions Source/Entities/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1389,23 +1389,6 @@ void Actor::DrawHUD(BITMAP* pTargetBitmap, const Vector& targetPos, int whichScr
if (!m_Controller.IsState(PIE_MENU_ACTIVE) || actorScreen != whichScreen) {
// If we're still alive, show the team colors
if (m_Health > 0) {
if (IsPlayerControlled() && g_FrameMan.IsInMultiplayerMode()) {
m_pControllerIcon = nullptr;
if (m_Team == 0) {
m_pControllerIcon = g_UInputMan.GetDeviceIcon(DEVICE_GAMEPAD_1);
} else if (m_Team == 1) {
m_pControllerIcon = g_UInputMan.GetDeviceIcon(DEVICE_GAMEPAD_2);
} else if (m_Team == 2) {
m_pControllerIcon = g_UInputMan.GetDeviceIcon(DEVICE_GAMEPAD_3);
} else if (m_Team == 3) {
m_pControllerIcon = g_UInputMan.GetDeviceIcon(DEVICE_GAMEPAD_4);
}

if (m_pControllerIcon) {
std::vector<BITMAP*> apControllerBitmaps = m_pControllerIcon->GetBitmaps8();
masked_blit(apControllerBitmaps[0], pTargetBitmap, 0, 0, drawPos.m_X - apControllerBitmaps[0]->w - 2 + 10, drawPos.m_Y + m_HUDStack - (apControllerBitmaps[0]->h / 2) + 8, apControllerBitmaps[0]->w, apControllerBitmaps[0]->h);
}
}

// Get the Icon bitmaps of this Actor's team, if any
std::vector<BITMAP*> apIconBitmaps;
Expand Down Expand Up @@ -1447,13 +1430,6 @@ void Actor::DrawHUD(BITMAP* pTargetBitmap, const Vector& targetPos, int whichScr

m_HUDStack -= 11;
}
// Player name
if (g_FrameMan.IsInMultiplayerMode()) {
if (GameActivity* gameActivity = dynamic_cast<GameActivity*>(g_ActivityMan.GetActivity())) {
pSmallFont->DrawAligned(&bitmapInt, drawPos.GetFloorIntX(), drawPos.GetFloorIntY() + m_HUDStack + 2, gameActivity->GetNetworkPlayerName(m_Controller.GetPlayer()).c_str(), GUIFont::Centre);
m_HUDStack -= 11;
}
}
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions Source/Entities/MovableObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,14 +1112,12 @@ bool MovableObject::DrawToTerrain(SLTerrain* terrain) {
wrappedMaskedBlit(terrain->GetMaterialBitmap(), tempBitmap, tempBitmapPos, true);

terrain->AddUpdatedMaterialArea(Box(tempBitmapPos, static_cast<float>(tempBitmap->w), static_cast<float>(tempBitmap->h)));
g_SceneMan.RegisterTerrainChange(tempBitmapPos.GetFloorIntX(), tempBitmapPos.GetFloorIntY(), tempBitmap->w, tempBitmap->h, ColorKeys::g_MaskColor, false);
} else {
Draw(terrain->GetFGColorBitmap(), Vector(), DrawMode::g_DrawColor, true);
Material const* terrMat = g_SceneMan.GetMaterialFromID(g_SceneMan.GetTerrain()->GetMaterialPixel(m_Pos.GetFloorIntX(), m_Pos.GetFloorIntY()));
if (GetMaterial()->GetPriority() > terrMat->GetPriority()) {
Draw(terrain->GetMaterialBitmap(), Vector(), DrawMode::g_DrawMaterial, true);
}
g_SceneMan.RegisterTerrainChange(m_Pos.GetFloorIntX(), m_Pos.GetFloorIntY(), 1, 1, DrawMode::g_DrawColor, false);
}
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Entities/PieMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ void PieMenu::Draw(BITMAP* targetBitmap, const Vector& targetPos) const {
CalculateDrawPosition(targetBitmap, targetPos, drawPos);

if (m_EnabledState != EnabledState::Disabled) {
if (m_DrawBackgroundTransparent && !g_FrameMan.IsInMultiplayerMode()) {
if (m_DrawBackgroundTransparent) {
g_FrameMan.SetTransTableFromPreset(TransparencyPreset::MoreTrans);
g_GLResourceMan.UpdateDynamicBitmap(m_BGBitmap, true);
DrawTexture(g_GLResourceMan.GetStaticTextureFromBitmap(m_BGBitmap), drawPos.GetFloorIntX() - m_BGBitmap->w / 2, drawPos.GetFloorIntY() - m_BGBitmap->h / 2, {255, 255, 255, g_FrameMan.GetCurrentAlpha()});
Expand Down
1 change: 0 additions & 1 deletion Source/Entities/SLTerrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,6 @@ std::deque<MOPixel*> SLTerrain::EraseSilhouette(BITMAP* sprite, const Vector& po
}
if (colorPixel != ColorKeys::g_MaskColor) {
putpixel(m_FGColorLayer->GetBitmap(), terrX, terrY, ColorKeys::g_MaskColor);
g_SceneMan.RegisterTerrainChange(terrX, terrY, 1, 1, ColorKeys::g_MaskColor, false);
}
}
}
Expand Down
2 changes: 0 additions & 2 deletions Source/Entities/TerrainObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,8 @@ void TerrainObject::DrawToTerrain(SLTerrain* terrain) {
}
if (HasBGColorBitmap()) {
draw_sprite(terrainBGBitmap, m_BGColorBitmap, posOnScene.GetFloorIntX(), posOnScene.GetFloorIntY());
g_SceneMan.RegisterTerrainChange(posOnScene.GetFloorIntX(), posOnScene.GetFloorIntY(), m_BGColorBitmap->w, m_BGColorBitmap->h, ColorKeys::g_MaskColor, true);
}
if (HasFGColorBitmap()) {
draw_sprite(terrainFGBitmap, m_FGColorBitmap, posOnScene.GetFloorIntX(), posOnScene.GetFloorIntY());
g_SceneMan.RegisterTerrainChange(posOnScene.GetFloorIntX(), posOnScene.GetFloorIntY(), m_FGColorBitmap->w, m_FGColorBitmap->h, ColorKeys::g_MaskColor, false);
}
}
47 changes: 7 additions & 40 deletions Source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
#include "UInputMan.h"
#include "PerformanceMan.h"
#include "FrameMan.h"
#include "PostProcessMan.h"
#include "SceneMan.h"
#include "MetaMan.h"
#include "WindowMan.h"
#include "GLResourceMan.h"
#include "NetworkServer.h"
#include "NetworkClient.h"
#include "CameraMan.h"
#include "ActivityMan.h"
#include "PrimitiveMan.h"
Expand All @@ -56,6 +56,10 @@
#include "RenderTarget.h"
#include "tracy/Tracy.hpp"

#ifdef _WIN32
#include "windows.h"
#endif

extern "C" {
FILE __iob_func[3] = {*stdin, *stdout, *stderr};
}
Expand All @@ -73,8 +77,6 @@ void InitializeManagers() {
WindowMan::Construct();
GLResourceMan::Construct();
LuaMan::Construct();
NetworkServer::Construct();
NetworkClient::Construct();
FrameMan::Construct();
PerformanceMan::Construct();
PostProcessMan::Construct();
Expand All @@ -98,8 +100,6 @@ void InitializeManagers() {
g_GLResourceMan.Initialize();

g_LuaMan.Initialize();
g_NetworkServer.Initialize();
g_NetworkClient.Initialize();
g_TimerMan.Initialize();
g_FrameMan.Initialize();
g_PostProcessMan.Initialize();
Expand Down Expand Up @@ -128,8 +128,6 @@ void InitializeManagers() {
/// Destroys all the managers and frees all loaded data before termination.
/// </summary>
void DestroyManagers() {
g_NetworkClient.Destroy();
g_NetworkServer.Destroy();
g_MetaMan.Destroy();
g_PerformanceMan.Destroy();
g_MovableMan.Destroy();
Expand Down Expand Up @@ -189,11 +187,7 @@ void HandleMainArgs(int argCount, char** argValue) {
}
}
if (!launchModeSet) {
if (currentArg == "-server") {
g_NetworkServer.EnableServerMode();
g_NetworkServer.SetServerPort(!lastArg ? argValue[++i] : "8000");
launchModeSet = true;
} else if (!lastArg && currentArg == "-editor") {
if (!lastArg && currentArg == "-editor") {
g_ActivityMan.SetEditorToLaunch(argValue[++i]);
launchModeSet = true;
}
Expand Down Expand Up @@ -337,12 +331,6 @@ void RunGameLoop() {

g_UInputMan.Update();

// It is vital that server is updated after input manager but before activity because input manager will clear received pressed and released events on next update.
if (g_NetworkServer.IsServerModeEnabled()) {
g_NetworkServer.Update(true);
serverUpdated = true;
}

g_FrameMan.Update();

g_MovableMan.CompleteQueuedMOIDDrawings();
Expand Down Expand Up @@ -391,23 +379,6 @@ void RunGameLoop() {
}
}

if (g_NetworkServer.IsServerModeEnabled()) {
// Pause sim while we're waiting for scene transmission or scene will start changing before clients receive them and those changes will be lost.
g_TimerMan.PauseSim(!(g_NetworkServer.ReadyForSimulation() && g_ActivityMan.IsInActivity()));

if (!serverUpdated) {
g_NetworkServer.Update();
}

if (g_NetworkServer.GetServerSimSleepWhenIdle()) {
long long ticksToSleep = g_TimerMan.GetTimeToSleep();
if (ticksToSleep > 0) {
double secsToSleep = static_cast<double>(ticksToSleep) / static_cast<double>(g_TimerMan.GetTicksPerSecond());
long long milisToSleep = static_cast<long long>(secsToSleep) * 1000;
std::this_thread::sleep_for(std::chrono::milliseconds(milisToSleep));
}
}
}
updateEndAndDrawStartTime = g_TimerMan.GetAbsoluteTime();
updateTotalTime = updateEndAndDrawStartTime - updateStartTime;
drawStartTime = updateEndAndDrawStartTime;
Expand Down Expand Up @@ -467,10 +438,6 @@ int main(int argc, char** argv) {

HandleMainArgs(argc, argv);

if (g_NetworkServer.IsServerModeEnabled()) {
SDL_ShowCursor(SDL_ENABLE);
}

g_PresetMan.LoadAllDataModules();

if (!System::IsInExternalModuleValidationMode()) {
Expand Down
Loading