Back color configurable, added fps counter checkbox
This commit is contained in:
@@ -594,6 +594,10 @@ namespace SplashEdit.EditorCode
|
|||||||
new GUIContent("Memory Overlay", "Show heap/RAM usage bar at top-right during gameplay"),
|
new GUIContent("Memory Overlay", "Show heap/RAM usage bar at top-right during gameplay"),
|
||||||
SplashSettings.MemoryOverlay);
|
SplashSettings.MemoryOverlay);
|
||||||
|
|
||||||
|
SplashSettings.FpsOverlay = EditorGUILayout.Toggle(
|
||||||
|
new GUIContent("FPS Overlay", "Show an FPS counter at top-left during gameplay"),
|
||||||
|
SplashSettings.FpsOverlay);
|
||||||
|
|
||||||
// Serial port (only for Real Hardware)
|
// Serial port (only for Real Hardware)
|
||||||
if (SplashSettings.Target == BuildTarget.RealHardware)
|
if (SplashSettings.Target == BuildTarget.RealHardware)
|
||||||
{
|
{
|
||||||
@@ -1188,6 +1192,9 @@ namespace SplashEdit.EditorCode
|
|||||||
if (SplashSettings.MemoryOverlay)
|
if (SplashSettings.MemoryOverlay)
|
||||||
buildArg += " MEMOVERLAY=1";
|
buildArg += " MEMOVERLAY=1";
|
||||||
|
|
||||||
|
if (SplashSettings.FpsOverlay)
|
||||||
|
buildArg += " FPSOVERLAY=1";
|
||||||
|
|
||||||
int jobCount = Math.Max(1, SystemInfo.processorCount - 1);
|
int jobCount = Math.Max(1, SystemInfo.processorCount - 1);
|
||||||
string cleanPrefix = SplashSettings.CleanBuild ? "make clean && " : "";
|
string cleanPrefix = SplashSettings.CleanBuild ? "make clean && " : "";
|
||||||
string makeCmd = $"{cleanPrefix}make all -j{jobCount} {buildArg}".Trim();
|
string makeCmd = $"{cleanPrefix}make all -j{jobCount} {buildArg}".Trim();
|
||||||
|
|||||||
@@ -136,6 +136,19 @@ namespace SplashEdit.EditorCode
|
|||||||
set => EditorPrefs.SetBool(Prefix + "MemoryOverlay", value);
|
set => EditorPrefs.SetBool(Prefix + "MemoryOverlay", value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// --- FPS Overlay ---
|
||||||
|
/// <summary>
|
||||||
|
/// When enabled, compiles the runtime with an FPS counter
|
||||||
|
/// and text overlay at the top-left corner of the screen.
|
||||||
|
/// Passes FPSOVERLAY=1 to the native Makefile.
|
||||||
|
/// </summary>
|
||||||
|
public static bool FpsOverlay
|
||||||
|
{
|
||||||
|
get => EditorPrefs.GetBool(Prefix + "FpsOverlay", false);
|
||||||
|
set => EditorPrefs.SetBool(Prefix + "FpsOverlay", value);
|
||||||
|
}
|
||||||
|
|
||||||
// --- Export settings ---
|
// --- Export settings ---
|
||||||
public static float DefaultGTEScaling
|
public static float DefaultGTEScaling
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -103,16 +103,19 @@ namespace SplashEdit.EditorCode
|
|||||||
|
|
||||||
private void DrawFogSection(PSXSceneExporter exporter)
|
private void DrawFogSection(PSXSceneExporter exporter)
|
||||||
{
|
{
|
||||||
showFog = EditorGUILayout.Foldout(showFog, "Fog", true, PSXEditorStyles.FoldoutHeader);
|
showFog = EditorGUILayout.Foldout(showFog, "Fog & Background", true, PSXEditorStyles.FoldoutHeader);
|
||||||
if (!showFog) return;
|
if (!showFog) return;
|
||||||
|
|
||||||
EditorGUI.indentLevel++;
|
EditorGUI.indentLevel++;
|
||||||
|
|
||||||
EditorGUILayout.PropertyField(fogEnabledProp, new GUIContent("Enabled"));
|
EditorGUILayout.PropertyField(fogColorProp, new GUIContent("Background Color",
|
||||||
|
"Background clear color. Also used as the fog blend target when fog is enabled."));
|
||||||
|
|
||||||
|
EditorGUILayout.PropertyField(fogEnabledProp, new GUIContent("Distance Fog"));
|
||||||
|
|
||||||
if (fogEnabledProp.boolValue)
|
if (fogEnabledProp.boolValue)
|
||||||
{
|
{
|
||||||
EditorGUILayout.PropertyField(fogColorProp, new GUIContent("Color"));
|
EditorGUI.indentLevel++;
|
||||||
EditorGUILayout.PropertyField(fogDensityProp, new GUIContent("Density"));
|
EditorGUILayout.PropertyField(fogDensityProp, new GUIContent("Density"));
|
||||||
|
|
||||||
float gteScale = exporter.GTEScaling;
|
float gteScale = exporter.GTEScaling;
|
||||||
@@ -125,6 +128,7 @@ namespace SplashEdit.EditorCode
|
|||||||
$"<color=#aaaaaa>GTE range: {fogNearUnity:F1} - {fogFarUnity:F1} units | " +
|
$"<color=#aaaaaa>GTE range: {fogNearUnity:F1} - {fogFarUnity:F1} units | " +
|
||||||
$"{8000f / (density * 3f):F0} - {8000f / density:F0} SZ</color>",
|
$"{8000f / (density * 3f):F0} - {8000f / density:F0} SZ</color>",
|
||||||
PSXEditorStyles.RichLabel);
|
PSXEditorStyles.RichLabel);
|
||||||
|
EditorGUI.indentLevel--;
|
||||||
}
|
}
|
||||||
|
|
||||||
EditorGUI.indentLevel--;
|
EditorGUI.indentLevel--;
|
||||||
|
|||||||
@@ -30,11 +30,11 @@ namespace SplashEdit.RuntimeCode
|
|||||||
public float GTEScaling = 100.0f;
|
public float GTEScaling = 100.0f;
|
||||||
public LuaFile SceneLuaFile;
|
public LuaFile SceneLuaFile;
|
||||||
|
|
||||||
[Header("Fog Configuration")]
|
[Header("Fog & Background")]
|
||||||
[Tooltip("Enable distance fog. Fog color is also used as the GPU clear color.")]
|
[Tooltip("Background clear color. Also used as the fog blend target when fog is enabled.")]
|
||||||
public bool FogEnabled = false;
|
|
||||||
[Tooltip("Fog color (RGB). Also used as the sky/clear color.")]
|
|
||||||
public Color FogColor = new Color(0.5f, 0.5f, 0.6f);
|
public Color FogColor = new Color(0.5f, 0.5f, 0.6f);
|
||||||
|
[Tooltip("Enable distance fog that blends geometry toward the background color.")]
|
||||||
|
public bool FogEnabled = false;
|
||||||
[Tooltip("Fog density (1 = light haze, 10 = pea soup).")]
|
[Tooltip("Fog density (1 = light haze, 10 = pea soup).")]
|
||||||
[Range(1, 10)]
|
[Range(1, 10)]
|
||||||
public int FogDensity = 5;
|
public int FogDensity = 5;
|
||||||
@@ -82,8 +82,7 @@ namespace SplashEdit.RuntimeCode
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Phase 3+4: World collision and nav regions
|
// Phase 4: Nav regions
|
||||||
private PSXCollisionExporter _collisionExporter;
|
|
||||||
private PSXNavRegionBuilder _navRegionBuilder;
|
private PSXNavRegionBuilder _navRegionBuilder;
|
||||||
|
|
||||||
// Phase 5: Room/portal system (interior scenes)
|
// Phase 5: Room/portal system (interior scenes)
|
||||||
@@ -186,12 +185,6 @@ namespace SplashEdit.RuntimeCode
|
|||||||
_bvh = new BVH(_exporters.ToList());
|
_bvh = new BVH(_exporters.ToList());
|
||||||
_bvh.Build();
|
_bvh.Build();
|
||||||
|
|
||||||
// Phase 3: Build world collision soup
|
|
||||||
_collisionExporter = new PSXCollisionExporter();
|
|
||||||
_collisionExporter.Build(_exporters, GTEScaling);
|
|
||||||
if (_collisionExporter.MeshCount == 0)
|
|
||||||
Debug.LogWarning("No collision meshes! Set CollisionType=Static on your floor/wall objects.");
|
|
||||||
|
|
||||||
// Phase 4+5: Room volumes are needed by BOTH the nav region builder
|
// Phase 4+5: Room volumes are needed by BOTH the nav region builder
|
||||||
// (for spatial room assignment) and the room builder (for triangle assignment).
|
// (for spatial room assignment) and the room builder (for triangle assignment).
|
||||||
// Collect them early so both systems use the same room indices.
|
// Collect them early so both systems use the same room indices.
|
||||||
|
|||||||
Reference in New Issue
Block a user