Skip to content

Commit 95d7242

Browse files
authored
Merge pull request #75 from Pepper-Man/main
Add Reach lightmap color >= 0 assertion failure patch
2 parents 65d304e + efccf9b commit 95d7242

File tree

11 files changed

+167
-35
lines changed

11 files changed

+167
-35
lines changed

Launcher/MainWindow.xaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -366,34 +366,31 @@
366366
<CheckBox x:Name="import_force" Content="Force" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="Force all files to import even if they haven't changed."/>
367367
</Grid>
368368
<Grid Grid.Row="7" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
369-
<CheckBox x:Name="import_verbose" Content="Verbose" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="Dump extra import progress."/>
370-
</Grid>
371-
<Grid Grid.Row="8" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
372369
<CheckBox x:Name="import_repro" Content="Repro" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="Assumes GR2 and sidecar files are in the same directory, tags built to tags\\repro."/>
373370
</Grid>
374-
<Grid Grid.Row="9" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
371+
<Grid Grid.Row="8" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
375372
<CheckBox x:Name="import_draft" Content="Draft" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="(model only) Skip generating PRT data, faster speed, lower quality."/>
376373
</Grid>
377-
<Grid Grid.Row="10" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
374+
<Grid Grid.Row="9" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
378375
<CheckBox x:Name="import_seam_debug" Content="Seam Debug" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="(structure only) Extra seam debugging information."/>
379376
</Grid>
380-
<Grid Grid.Row="11" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
377+
<Grid Grid.Row="10" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
381378
<CheckBox x:Name="import_skip_instances" Content="Skip Instances" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="(structure only) Skip importing all instances."/>
382379
</Grid>
383-
<Grid Grid.Row="12" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
380+
<Grid Grid.Row="11" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
384381
<CheckBox x:Name="import_local" Content="Local" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="(structure only) Build is orphaned from the depot."/>
385382
</Grid>
386-
<Grid Grid.Row="13" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
383+
<Grid Grid.Row="12" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
387384
<CheckBox x:Name="import_farm_seams" Content="Farm Seams" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="(structure only) Specifics a content index to stamp with."/>
388385
</Grid>
389-
<Grid Grid.Row="14" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
386+
<Grid Grid.Row="13" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr + h4, ElementName=toolkit_selection}">
390387
<CheckBox x:Name="import_farm_bsp" Content="Farm BSP" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="(structure only) Do not rebuild seams. Use the seam content index on structures you build."/>
391388
</Grid>
392-
<Grid Grid.Row="15" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr, ElementName=toolkit_selection}">
389+
<Grid Grid.Row="14" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr, ElementName=toolkit_selection}">
393390
<CheckBox x:Name="import_decompose_instances" Content="Decompose Instances" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="(structure only) Run convex decomposition for poop physics (very slow)."/>
394391
</Grid>
395-
<Grid Grid.Row="16" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr, ElementName=toolkit_selection}">
396-
<CheckBox x:Name="import_supress_errors_to_vrml" Content="Supress Errors To VRML" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="Do not write errors to VRML files."/>
392+
<Grid Grid.Row="15" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=hr, ElementName=toolkit_selection}">
393+
<CheckBox x:Name="import_suppress_errors_to_vrml" Content="Suppress Errors To VRML" HorizontalAlignment="Left" VerticalAlignment="Center" Foreground="{DynamicResource TextColor}" ToolTip="Do not write errors to VRML files."/>
397394
</Grid>
398395
</Grid>
399396
</Grid>
@@ -1112,7 +1109,7 @@
11121109
</Grid>
11131110
</Grid>
11141111
</TabItem>
1115-
<TabItem Header="Extract Tags" IsEnabled="{Binding SelectedIndex, Converter={StaticResource ProfiletoIsEnabled}, ConverterParameter=h2|mcc + h3, ElementName=toolkit_selection}" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=h2|mcc + h3, ElementName=toolkit_selection}">
1112+
<TabItem Header="Extract Tags" IsEnabled="{Binding SelectedIndex, Converter={StaticResource ProfiletoIsEnabled}, ConverterParameter=h2|mcc + h3 + hr + h4, ElementName=toolkit_selection}" Visibility="{Binding SelectedIndex, Converter={StaticResource ProfiletoVisibility}, ConverterParameter=h2|mcc + h3 + hr + h4, ElementName=toolkit_selection}">
11161113
<Grid Background="{DynamicResource WindowSecondaryColor}">
11171114
<Grid.RowDefinitions>
11181115
<RowDefinition Height="5"/>

Launcher/MainWindow.xaml.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,7 +1049,6 @@ private async void CompileLevel(string level_path, string bsp_path, string Level
10491049
var import_args = new ToolkitBase.ImportArgs(
10501050
import_check.IsChecked ?? false,
10511051
import_force.IsChecked ?? false,
1052-
import_verbose.IsChecked ?? false,
10531052
import_repro.IsChecked ?? false,
10541053
import_draft.IsChecked ?? false,
10551054
import_seam_debug.IsChecked ?? false,
@@ -1058,7 +1057,7 @@ private async void CompileLevel(string level_path, string bsp_path, string Level
10581057
import_farm_seams.IsChecked ?? false,
10591058
import_farm_bsp.IsChecked ?? false,
10601059
import_decompose_instances.IsChecked ?? false,
1061-
import_supress_errors_to_vrml.IsChecked ?? false
1060+
import_suppress_errors_to_vrml.IsChecked ?? false
10621061
);
10631062

10641063
await toolkit.ImportStructure(structure_command, level_path, phantom_fix, is_release, disable_asserts.IsChecked ?? false, struct_auto_fbx.IsChecked ?? false, import_args);

Launcher/PathSettings.xaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@
406406
</MultiBinding>
407407
</CheckBox.Visibility>
408408
</CheckBox>
409+
<CheckBox Grid.Row="6" Foreground="{DynamicResource TextColor}" x:Name="lm_color_fix" Content="Disable Lightmap Color Assertion" HorizontalAlignment="Stretch" Height="22" VerticalAlignment="Bottom" Click="profile_data_Click" ToolTip="Applies small patch to tool.exe/tool_fast.exe to prevent color below zero (e.g. color->red>=0) assertion failures.">
410+
<CheckBox.Visibility>
411+
<MultiBinding Converter="{StaticResource ProfileSettingsVisibility}">
412+
<Binding ElementName="is_mcc" Path="IsChecked" />
413+
<Binding ElementName="gen_type" Path="SelectedIndex" />
414+
<Binding ElementName="community_tools" Path="IsChecked" />
415+
<Binding Source="6" />
416+
</MultiBinding>
417+
</CheckBox.Visibility>
418+
</CheckBox>
409419
</Grid>
410420
</Grid>
411421
</GroupBox>

Launcher/PathSettings.xaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ private void profile_selection_SelectionChanged(object sender, SelectionChangedE
279279
verbose.IsChecked = false;
280280
expert_mode.IsChecked = false;
281281
batch.IsChecked = false;
282+
lm_color_fix.IsChecked = false;
282283
h2codez_update_groupbox.Visibility = Visibility.Collapsed;
283284
if (profile_select != null && profile_select.SelectedItem != null && ToolkitProfiles.SettingsList.Count > profile_index && profile_index >= 0)
284285
{
@@ -298,6 +299,7 @@ private void profile_selection_SelectionChanged(object sender, SelectionChangedE
298299
verbose.IsChecked = ToolkitProfiles.SettingsList[profile_index].Verbose;
299300
expert_mode.IsChecked = ToolkitProfiles.SettingsList[profile_index].ExpertMode;
300301
batch.IsChecked = ToolkitProfiles.SettingsList[profile_index].Batch;
302+
lm_color_fix.IsChecked = ToolkitProfiles.SettingsList[profile_index].ReachColorAssertFix;
301303

302304
h2codez_update_groupbox.Visibility = ToolkitProfiles.SettingsList[profile_index].IsH2Codez() ?
303305
Visibility.Visible : Visibility.Collapsed;
@@ -351,6 +353,7 @@ void ProfileSave()
351353
Verbose = (bool)verbose.IsChecked,
352354
ExpertMode = (bool)expert_mode.IsChecked,
353355
Batch = (bool)batch.IsChecked,
356+
ReachColorAssertFix = (bool)lm_color_fix.IsChecked,
354357
};
355358

356359
// get new and old base directory

Launcher/ToolkitInterface/H2AToolkit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public async Task ASSFromFBX(string fbxPath, string assPath)
311311

312312
public override async Task ExtractTags(string path, bool h2MoveDir, bool bitmapsAsTGA)
313313
{
314-
var outputMode = OutputMode.slient;
314+
var outputMode = OutputMode.silent;
315315
#if DEBUG
316316
outputMode = OutputMode.keepOpen;
317317
#endif

Launcher/ToolkitInterface/H3Toolkit.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,13 @@ public override async Task ExtractTags(string path, bool h2MoveDir, bool bitmaps
333333
case ".render_model":
334334
case ".physics_model":
335335
case ".collision_model":
336-
await RunTool(ToolType.Tool, new() { "extract-import-info", Path.Join(GetTagDirectory(), path) }, OutputMode.slient);
336+
await RunTool(ToolType.Tool, new() { "extract-import-info", Path.Join(GetTagDirectory(), path) }, OutputMode.silent);
337337
break;
338338
case ".bitmap":
339339
await ExtractBitmapGen2Plus(path, basename, bitmapsAsTGA);
340340
break;
341341
case ".multilingual_unicode_string_list":
342-
await RunTool(ToolType.Tool, new() { "extract-unicode-strings", basename }, OutputMode.slient);
342+
await RunTool(ToolType.Tool, new() { "extract-unicode-strings", basename }, OutputMode.silent);
343343
break;
344344
default:
345345
throw new Exception($"Extraction not supported for {extension}");

Launcher/ToolkitInterface/H4Toolkit.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ override public async Task ImportStructure(StructureType structure_command, stri
2020
args.Add("check");
2121
if (import_args.import_force)
2222
args.Add("force");
23-
if (import_args.import_verbose)
24-
args.Add("verbose");
2523
if (import_args.import_repro)
2624
args.Add("repro");
2725
if (import_args.import_draft)

0 commit comments

Comments
 (0)