Skip to content

Commit

Permalink
Tweak default settings when using -noui (#141)
Browse files Browse the repository at this point in the history
The player's profile is not loaded when using -noui, so use some better defaults.
  • Loading branch information
KcRobin9 authored Mar 19, 2024
1 parent 1de0706 commit ee694ff
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 11 deletions.
6 changes: 6 additions & 0 deletions code/midtown/mmcamcs/trackcamcs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,12 @@

#include "carcamcs.h"

#define TRACK_CAM_NEAR 0
#define TRACK_CAM_BASE 1
#define TRACK_CAM_FAR 2
#define TRACK_CAM_XCAM 3
#define TRACK_CAM_HELICOPTER 4

class TrackCamCS final : public CarCamCS
{
public:
Expand Down
19 changes: 15 additions & 4 deletions code/midtown/mmcityinfo/state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ define_dummy_symbol(mmcityinfo_state);
#include "data7/args.h"
#include "midtown.h"
#include "mmaudio/manager.h"
#include "mmcamcs/trackcamcs.h"
#include "mmgame/hudmap.h"

void mmStatePack::SetDefaults()
{
Expand Down Expand Up @@ -74,15 +76,15 @@ void mmStatePack::SetDefaults()
CRGoldMass = 0;

arts_strcpy(IntroText, "Loading Open1560");
CameraIndex = 0;
HudmapMode = 0;
CameraIndex = TRACK_CAM_NEAR;
HudmapMode = HUD_MAP_NONE;
WideFov = false;
DashView = false;
EnableMirror = true;
ExternalView = false;
XcamView = false;
ShowPositions = true;
MapRes = 0;
MapRes = 0; // 0 Zoomed out, 1 zoomed in
DisablePeds = false;
EnablePaging = false;
Interlaced = false;
Expand All @@ -101,15 +103,24 @@ bool mmStatePack::ParseStateArgs(i32 argc, char** argv)

if (ARG("-noui"))
{
const char* veh_name = "vpbug";
const char* veh_name = "vppanoz";

if (asArg* veh = GBArgs['v'])
veh_name = veh->sValues[0];

NoUI = true;
no_ui = true;
arts_strcpy(CarName, veh_name);

GameState = mmGameState::Drive;
MaxOpponents = 8.0f;
PhysicsRealism = 0.25f;
Difficulty = mmSkillLevel::Professional;
WaveVolume = 0.1f;
CDVolume = 0.1f;
CameraIndex = TRACK_CAM_FAR;
HudmapMode = HUD_MAP_SMALL;
MapRes = 1;
}
else if (ARG("-keyboard"))
{
Expand Down
2 changes: 1 addition & 1 deletion code/midtown/mmgame/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ void mmGame::UpdateGameInput()
case IOID_XVIEW: Player->ToggleExternalView(); break;

case IOID_WFOV: {
if (Player->HudMap.GetMode() < HUD_MAP_MODE_2)
if (Player->HudMap.GetMode() < HUD_MAP_MEDIUM)
{
Player->ToggleWideFOV();

Expand Down
8 changes: 4 additions & 4 deletions code/midtown/mmgame/hudmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ struct OppIconInfo

check_size(OppIconInfo, 0x24);

#define HUD_MAP_MODE_0 0
#define HUD_MAP_MODE_1 1
#define HUD_MAP_MODE_2 2
#define HUD_MAP_MODE_3 3
#define HUD_MAP_NONE 0
#define HUD_MAP_SMALL 1
#define HUD_MAP_MEDIUM 2
#define HUD_MAP_LARGE 3

class mmHudMap final : public asNode
{
Expand Down
10 changes: 9 additions & 1 deletion code/midtown/mmgame/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,12 @@ void mmInterface::PlayerResolveCars()

vehinfo->IsLocked = locked && !AllCars;
}
}
}

void mmInterface::SetStateDefaults()
{
MMSTATE.TimeOfDay = mmTimeOfDay::Noon;
MMSTATE.GameMode = mmGameMode::Cruise;
MMSTATE.Weather = mmWeather::Sun;
MMSTATE.EventId = 0;
}
2 changes: 1 addition & 1 deletion code/midtown/mmgame/interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ class mmInterface final : public asNode
ARTS_IMPORT void SetSessionData(NETSESSION_DESC* arg1);

// ?SetStateDefaults@mmInterface@@AAEXXZ | unused
ARTS_IMPORT void SetStateDefaults();
ARTS_EXPORT void SetStateDefaults();

// ?SetStateRace@mmInterface@@AAEXH@Z | unused
ARTS_EXPORT void SetStateRace(i32 arg1);
Expand Down

0 comments on commit ee694ff

Please sign in to comment.