Remove terrain readiness diagnostic and fix graphics container name
Sync changed files to Google Drive / sync (push) Successful in 3m1s
Sync changed files to Google Drive / sync (push) Successful in 3m1s
This commit is contained in:
1 parent
d6676896d4
commit
f1b253e842
22 files changed
+2989
-352
No files matched your search
@@ -24,14 +24,10 @@ type
|
||||
FTitleLabel, FGraphicsFeedbackLabel: TCastleLabel;
|
||||
FExportButton: TCastleButton;
|
||||
FGraphicsReadinessButton, FTextureButton, FVisible2DButton: TCastleButton;
|
||||
FTerrainReadinessButton: TCastleButton;
|
||||
FTerrainReadinessStatusLabel: TCastleLabel;
|
||||
FTerrainReadinessDetailsLabel: TCastleLabel;
|
||||
FGraphicsReadinessStatusLabel, FGraphicsReadinessDetailsLabel: TCastleLabel;
|
||||
FTextureStatusLabel, FTextureDetailsLabel: TCastleLabel;
|
||||
FVisible2DStatusLabel, FVisible2DDetailsLabel: TCastleLabel;
|
||||
FFileIOInProgress, FExportInProgress: Boolean;
|
||||
FTerrainReadinessInProgress: Boolean;
|
||||
FGraphicsSession: TGraphicsDiagnosticSession;
|
||||
FGraphicsCompletionNotifiedDuringDispatch: Boolean;
|
||||
procedure RefreshReport;
|
||||
@@ -43,7 +39,6 @@ type
|
||||
procedure GraphicsVisible2DClick(Sender: TObject);
|
||||
procedure GraphicsResultPublished(Sender: TObject);
|
||||
procedure FileIOClick(Sender: TObject);
|
||||
procedure TerrainReadinessClick(Sender: TObject);
|
||||
procedure ExportClick(Sender: TObject);
|
||||
procedure ExportComplete(const AOutcome: TDiagnosticExportOutcome);
|
||||
public
|
||||
@@ -56,8 +51,7 @@ type
|
||||
implementation
|
||||
|
||||
uses
|
||||
SysUtils, Math, GameDiagnosticsFileIO, GameDiagnosticsReport,
|
||||
GameDiagnosticsTerrainReadiness;
|
||||
SysUtils, Math, GameDiagnosticsFileIO, GameDiagnosticsReport;
|
||||
|
||||
const
|
||||
LayoutMargin = 16;
|
||||
@@ -117,10 +111,6 @@ begin
|
||||
FVisible2DButton.AutoSize := False;
|
||||
FVisible2DButton.Enabled := True;
|
||||
FVisible2DButton.OnClick := @GraphicsVisible2DClick;
|
||||
FTerrainReadinessButton := TCastleButton.Create(Self);
|
||||
FTerrainReadinessButton.AutoSize := False;
|
||||
FTerrainReadinessStatusLabel := TCastleLabel.Create(Self);
|
||||
FTerrainReadinessDetailsLabel := TCastleLabel.Create(Self);
|
||||
FGraphicsReadinessStatusLabel := TCastleLabel.Create(Self);
|
||||
FGraphicsReadinessDetailsLabel := TCastleLabel.Create(Self);
|
||||
FTextureStatusLabel := TCastleLabel.Create(Self);
|
||||
@@ -130,8 +120,6 @@ begin
|
||||
|
||||
FContent.InsertFront(FStatusLabel);
|
||||
FContent.InsertFront(FDetailsLabel);
|
||||
FContent.InsertFront(FTerrainReadinessStatusLabel);
|
||||
FContent.InsertFront(FTerrainReadinessDetailsLabel);
|
||||
FContent.InsertFront(FGraphicsReadinessStatusLabel);
|
||||
FContent.InsertFront(FGraphicsReadinessDetailsLabel);
|
||||
FContent.InsertFront(FTextureStatusLabel);
|
||||
@@ -154,9 +142,6 @@ begin
|
||||
FActionRegion.InsertFront(FTextureButton);
|
||||
FVisible2DButton.Caption := 'Test Visible 2D' + LineEnding + 'RGBA / Brightness';
|
||||
FActionRegion.InsertFront(FVisible2DButton);
|
||||
FTerrainReadinessButton.Caption := 'Test MAP/RXX Terrain Readiness';
|
||||
FTerrainReadinessButton.OnClick := @TerrainReadinessClick;
|
||||
FActionRegion.InsertFront(FTerrainReadinessButton);
|
||||
FFileIOButton.Caption := 'Test File I/O';
|
||||
FFileIOButton.OnClick := @FileIOClick;
|
||||
FActionRegion.InsertFront(FFileIOButton);
|
||||
@@ -197,7 +182,7 @@ end;
|
||||
procedure TDiagnosticsView.DispatchGraphicsRequest(const ARequest: TGraphicsRequest);
|
||||
var
|
||||
Accepted: Boolean;
|
||||
Container: TCastleContainer;
|
||||
ViewContainer: TCastleContainer;
|
||||
begin
|
||||
if (FGraphicsSession <> nil) and FGraphicsSession.Busy then
|
||||
begin
|
||||
@@ -210,8 +195,8 @@ begin
|
||||
|
||||
if FGraphicsSession = nil then
|
||||
begin
|
||||
Container := Self.Container;
|
||||
if Container = nil then
|
||||
ViewContainer := Self.Container;
|
||||
if ViewContainer = nil then
|
||||
begin
|
||||
FGraphicsReadinessButton.Enabled := True;
|
||||
FTextureButton.Enabled := True;
|
||||
@@ -220,7 +205,7 @@ begin
|
||||
Exit;
|
||||
end;
|
||||
try
|
||||
FGraphicsSession := TGraphicsDiagnosticSession.Create(Container);
|
||||
FGraphicsSession := TGraphicsDiagnosticSession.Create(ViewContainer);
|
||||
FGraphicsSession.OnResultPublished := @GraphicsResultPublished;
|
||||
except
|
||||
if FGraphicsSession <> nil then
|
||||
@@ -306,9 +291,9 @@ var
|
||||
TitleHeight, GraphicsFeedbackRowHeight, ExportFeedbackRowHeight: Single;
|
||||
FreeHeight: Single;
|
||||
Columns, Rows, Index, Column, Row: Integer;
|
||||
Buttons: array[0..5] of TCastleButton;
|
||||
StatusLabels: array[0..4] of TCastleLabel;
|
||||
DetailsLabels: array[0..4] of TCastleLabel;
|
||||
Buttons: array[0..4] of TCastleButton;
|
||||
StatusLabels: array[0..3] of TCastleLabel;
|
||||
DetailsLabels: array[0..3] of TCastleLabel;
|
||||
begin
|
||||
ViewWidth := EffectiveWidth;
|
||||
ViewHeight := EffectiveHeight;
|
||||
@@ -321,7 +306,7 @@ begin
|
||||
ActionWidth := Min(AvailableWidth, Columns * 296 + (Columns - 1) * 6 + 16);
|
||||
Inset := Min(8, Max(0, (ActionWidth - 1) / 2));
|
||||
CellWidth := Max(1, (ActionWidth - 2 * Inset - (Columns - 1) * 6) / Columns);
|
||||
Rows := (6 + Columns - 1) div Columns;
|
||||
Rows := (5 + Columns - 1) div Columns;
|
||||
|
||||
FActionRegion.Width := ActionWidth;
|
||||
FActionRegion.Anchor(hpMiddle);
|
||||
@@ -340,11 +325,10 @@ begin
|
||||
FTitleLabel.Anchor(vpTop, -Inset);
|
||||
|
||||
Buttons[0] := FFileIOButton;
|
||||
Buttons[1] := FTerrainReadinessButton;
|
||||
Buttons[2] := FGraphicsReadinessButton;
|
||||
Buttons[3] := FTextureButton;
|
||||
Buttons[4] := FVisible2DButton;
|
||||
Buttons[5] := FExportButton;
|
||||
Buttons[1] := FGraphicsReadinessButton;
|
||||
Buttons[2] := FTextureButton;
|
||||
Buttons[3] := FVisible2DButton;
|
||||
Buttons[4] := FExportButton;
|
||||
for Index := 0 to High(Buttons) do
|
||||
begin
|
||||
Column := Index mod Columns;
|
||||
@@ -385,14 +369,12 @@ begin
|
||||
|
||||
StatusLabels[0] := FStatusLabel;
|
||||
DetailsLabels[0] := FDetailsLabel;
|
||||
StatusLabels[1] := FTerrainReadinessStatusLabel;
|
||||
DetailsLabels[1] := FTerrainReadinessDetailsLabel;
|
||||
StatusLabels[2] := FGraphicsReadinessStatusLabel;
|
||||
DetailsLabels[2] := FGraphicsReadinessDetailsLabel;
|
||||
StatusLabels[3] := FTextureStatusLabel;
|
||||
DetailsLabels[3] := FTextureDetailsLabel;
|
||||
StatusLabels[4] := FVisible2DStatusLabel;
|
||||
DetailsLabels[4] := FVisible2DDetailsLabel;
|
||||
StatusLabels[1] := FGraphicsReadinessStatusLabel;
|
||||
DetailsLabels[1] := FGraphicsReadinessDetailsLabel;
|
||||
StatusLabels[2] := FTextureStatusLabel;
|
||||
DetailsLabels[2] := FTextureDetailsLabel;
|
||||
StatusLabels[3] := FVisible2DStatusLabel;
|
||||
DetailsLabels[3] := FVisible2DDetailsLabel;
|
||||
for Index := 0 to High(StatusLabels) do
|
||||
begin
|
||||
StatusLabels[Index].MaxWidth := Max(1, FScroll.Width - 2 * LayoutMargin - 16);
|
||||
@@ -434,49 +416,6 @@ begin
|
||||
Result := Details;
|
||||
end;
|
||||
|
||||
function TerrainReadinessDetails(const State: TDiagnosticReportState): string;
|
||||
var
|
||||
TerrainStage: TTerrainReadinessDiagnosticStageId;
|
||||
Details: string;
|
||||
begin
|
||||
Details := '';
|
||||
for TerrainStage := Low(TTerrainReadinessDiagnosticStageId)
|
||||
to High(TTerrainReadinessDiagnosticStageId) do
|
||||
begin
|
||||
if Details <> '' then Details := Details + LineEnding;
|
||||
Details := Details + TerrainReadinessDiagnosticStageIdToken(TerrainStage) + ': ' +
|
||||
DiagnosticStatusToken(State.TerrainReadiness.Stages[TerrainStage]);
|
||||
end;
|
||||
if State.TerrainReadiness.FailureStage.HasValue then
|
||||
Details := Details + LineEnding + 'failure_stage: ' +
|
||||
TerrainReadinessDiagnosticStageIdToken(
|
||||
State.TerrainReadiness.FailureStage.Value);
|
||||
if State.TerrainReadiness.Error.Present then
|
||||
begin
|
||||
Details := Details + LineEnding + 'error class: ' +
|
||||
OptionalStringText(State.TerrainReadiness.Error.ClassName);
|
||||
Details := Details + LineEnding + 'error message: ' +
|
||||
OptionalStringText(State.TerrainReadiness.Error.MessageText);
|
||||
end;
|
||||
with State.TerrainReadiness.Evidence do
|
||||
begin
|
||||
if RxTilesLoaded.HasValue then
|
||||
Details := Details + LineEnding + 'rx_tiles_loaded: ' +
|
||||
OptionalBooleanText(RxTilesLoaded);
|
||||
if GeneratedTransitionsReady.HasValue then
|
||||
Details := Details + LineEnding + 'generated_transitions_ready: ' +
|
||||
OptionalBooleanText(GeneratedTransitionsReady);
|
||||
if MapX.HasValue then Details := Details + LineEnding + 'map_x: ' + OptionalInt64Text(MapX);
|
||||
if MapY.HasValue then Details := Details + LineEnding + 'map_y: ' + OptionalInt64Text(MapY);
|
||||
if GameRev.HasValue then Details := Details + LineEnding + 'game_rev: ' + OptionalInt64Text(GameRev);
|
||||
if ExpectedTileCount.HasValue then
|
||||
Details := Details + LineEnding + 'expected_tile_count: ' + OptionalInt64Text(ExpectedTileCount);
|
||||
if CompletedTileCount.HasValue then
|
||||
Details := Details + LineEnding + 'completed_tile_count: ' + OptionalInt64Text(CompletedTileCount);
|
||||
end;
|
||||
Result := Details;
|
||||
end;
|
||||
|
||||
function GraphicsReadinessDetails(const State: TDiagnosticReportState): string;
|
||||
var
|
||||
ReadinessStage: TGraphicsReadinessDiagnosticStageId;
|
||||
@@ -692,9 +631,6 @@ begin
|
||||
State := CurrentDiagnosticReport;
|
||||
FStatusLabel.Caption := 'File I/O: ' + DiagnosticStatusToken(State.FileIO.Status);
|
||||
FDetailsLabel.Caption := FileIODetails(State);
|
||||
FTerrainReadinessStatusLabel.Caption := 'MAP/RXX terrain readiness: ' +
|
||||
DiagnosticStatusToken(State.TerrainReadiness.Status);
|
||||
FTerrainReadinessDetailsLabel.Caption := TerrainReadinessDetails(State);
|
||||
FGraphicsReadinessStatusLabel.Caption := 'Graphics readiness/current surface: ' +
|
||||
DiagnosticStatusToken(State.GraphicsReadiness.Status);
|
||||
FGraphicsReadinessDetailsLabel.Caption := GraphicsReadinessDetails(State);
|
||||
@@ -733,20 +669,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDiagnosticsView.TerrainReadinessClick(Sender: TObject);
|
||||
begin
|
||||
if FTerrainReadinessInProgress then Exit;
|
||||
FTerrainReadinessInProgress := True;
|
||||
FTerrainReadinessButton.Enabled := False;
|
||||
try
|
||||
RunTerrainReadinessDiagnostic;
|
||||
RefreshReport;
|
||||
finally
|
||||
FTerrainReadinessButton.Enabled := True;
|
||||
FTerrainReadinessInProgress := False;
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TDiagnosticsView.ExportClick(Sender: TObject);
|
||||
begin
|
||||
if FExportInProgress then Exit;
|
||||
|
||||
Reference in new issue
Block a user