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
12 changes: 7 additions & 5 deletions Game.MenuSystem/SourceDllMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ public static class SourceDllMain
public static IGarrysMod garrysmod = null!;
public static INetworkStringTableContainer? networkstringtable;

[Dependency] public static ICvar cvar { get; private set; } = null!;
[Dependency] public static IFileSystem filesystem { get; private set; } = null!;
[Dependency] public static IMaterialSystem materials { get; private set; } = null!;
[Dependency] public static ICommandLine commandLine { get; private set; } = null!;
#if !SWDS
[Dependency] public static IGameUIFuncs gameuifuncs { get; private set; } = null!;
[Dependency] public static IEngineClient engine { get; private set; } = null!;
[Dependency] public static IEngineVGui enginevgui { get; private set; } = null!;
[Dependency] public static IGameUIFuncs gameuifuncs { get; private set; } = null!;
[Dependency] public static IGameUI gameUI { get; private set; } = null!;
[Dependency] public static IMatSystemSurface surface { get; private set; } = null!;
[Dependency] public static ISurface Surface { get; private set; } = null!;
Expand All @@ -36,9 +41,6 @@ public static class SourceDllMain
[Dependency] public static ISchemeManager vguiSchemeManager { get; private set; } = null!;
[Dependency] public static ILocalize localize { get; private set; } = null!;
[Dependency] public static ILocalize Localize { get; private set; } = null!;
[Dependency] public static ICvar cvar { get; private set; } = null!;
[Dependency] public static IFileSystem filesystem { get; private set; } = null!;
[Dependency] public static IMaterialSystem materials { get; private set; } = null!;
[Dependency] public static ICommandLine commandLine { get; private set; } = null!;
[Dependency] public static ISystem system { get; private set; } = null!;
#endif
}
2 changes: 1 addition & 1 deletion Source.Engine/EngineBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ void PreBuildAllForms() {
this.AddSingleton<IServerPluginHelpers, ServerPlugin>(x => x.GetRequiredService<ServerPlugin>());
this.AddSingleton<IUniformRandomStream, UniformRandomStream>();
this.AddSingleton<ISoundServices, EngineSoundServices>();
this.AddSingleton<IGameUIFuncs, GameUIFuncs>();
this.AddSingleton<DtCommonEng>();
this.AddSingleton<EngineToolImpl>();
this.AddSingleton<IEngineToolInternal>(x => x.GetRequiredService<EngineToolImpl>());
Expand Down Expand Up @@ -326,6 +325,7 @@ public ClientLauncherAPI BuildClient() {
this.AddSingleton<IEngineVGui, EngineVGui>(x => x.GetRequiredService<EngineVGui>());
// These interfaces go to client and game dll's
this.AddSingleton<IEngineClient, EngineClient>();
this.AddSingleton<IGameUIFuncs, GameUIFuncs>();
this.AddSingleton<ClientLauncherAPI>();
this.AddSingleton<IEngineAPI, ClientLauncherAPI>(x => x.GetRequiredService<ClientLauncherAPI>());
this.AddSingleton<IClientLauncherAPI, ClientLauncherAPI>(x => x.GetRequiredService<ClientLauncherAPI>());
Expand Down
7 changes: 5 additions & 2 deletions Source.Engine/StaticPropMgr.cs
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ public void ComputePropOpacity(StaticProp prop) {
}

public void DrawStaticProps(ref InlineArray512<IClientRenderable> props, int count, bool shadowDepth, bool drawVCollideWireframe) {
#if !SWDS
if (!r_drawstaticprops.GetBool())
return;

Expand All @@ -352,8 +353,10 @@ public void DrawStaticProps(ref InlineArray512<IClientRenderable> props, int cou
else
DrawStaticProps_Fast(ref props, count, shadowDepth);
}
#endif
}

#if !SWDS
void DrawStaticProps_Slow(ref InlineArray512<IClientRenderable> props, int count, bool shadowDepth, bool drawVCollideWireframe) {
StudioFlags flags = StudioFlags.Render;
if (shadowDepth)
Expand All @@ -368,7 +371,7 @@ void DrawStaticProps_Slow(ref InlineArray512<IClientRenderable> props, int count
}

void DrawStaticProps_Fast(ref InlineArray512<IClientRenderable> props, int count, bool shadowDepth) => throw new NotImplementedException();

const int MAX_OBJECTS = 2048;
readonly StaticPropRenderInfo[] PropList = new StaticPropRenderInfo[MAX_OBJECTS];

Expand All @@ -392,7 +395,7 @@ void DrawStaticProps_FastPipeline(Span<IClientRenderable> props, int count, bool
}
modelrender.DrawStaticPropArrayFast(propList, listCount, shadowDepth);
}

#endif
static readonly ConVar pipeline_static_props = new("pipeline_static_props", "1");

void OutputLevelStats() => throw new NotImplementedException();
Expand Down
28 changes: 17 additions & 11 deletions Source.GUI.Controls/SourceDllMain.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,27 @@ namespace Source.GUI.Controls;
[EngineComponent]
public static class SourceDllMain
{
[Dependency] public static ISurface Surface { get; private set; } = null!;
[Dependency] public static ISchemeManager SchemeManager { get; private set; } = null!;
[Dependency] public static IVGui VGui { get; private set; } = null!;
[Dependency] public static IInputSystem input { get; private set; } = null!;
[Dependency] public static IVGuiInput Input { get; private set; } = null!;
#if SWDS
const bool ClientRequired = false;
#else
const bool ClientRequired = true;
#endif

[Dependency(Required = ClientRequired)] public static ISurface Surface { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static ISchemeManager SchemeManager { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static IVGui VGui { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static IInputSystem input { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static IVGuiInput Input { get; private set; } = null!;
[Dependency] public static IEngineAPI EngineAPI { get; private set; } = null!;
[Dependency] public static ILocalize Localize { get; private set; } = null!;
[Dependency] public static ILauncherManager Launcher { get; private set; } = null!;
[Dependency] public static ISystem system { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static ILocalize Localize { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static ILauncherManager Launcher { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static ISystem system { get; private set; } = null!;
[Dependency] public static IMaterialSystem Materials { get; private set; } = null!;
[Dependency] public static ICvar cvar { get; private set; } = null!;
[Dependency] public static IFileSystem fileSystem { get; private set; } = null!;
[Dependency] public static IEngineClient engine { get; private set; } = null!;
[Dependency] public static IGameUIFuncs gameuifuncs { get; private set; } = null!;
[Dependency] public static IMatSystemSurface matSys { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static IEngineClient engine { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static IGameUIFuncs gameuifuncs { get; private set; } = null!;
[Dependency(Required = ClientRequired)] public static IMatSystemSurface matSys { get; private set; } = null!;

public static void Link(IServiceCollection services) {
services.AddSingleton<AnimationController>();
Expand Down
Loading