Wes xx gpu test
This commit is contained in:
committed by
Jerome Coudron
parent
1cceb3cb89
commit
1f5b855f61
@@ -326,6 +326,27 @@ public class PersistentDataController
|
||||
public MinigameIndex currentMinigame;
|
||||
public CourseIndex currentCourse;
|
||||
public ThemeIndex currentTheme;
|
||||
|
||||
/// <summary>
|
||||
/// The use hardware acceleration user preferences
|
||||
/// </summary>
|
||||
public bool useGPU = false;
|
||||
|
||||
/// <summary>
|
||||
/// Initiate the SavedDataStructure, by setting the user preferences
|
||||
/// </summary>
|
||||
public SavedDataStructure()
|
||||
{
|
||||
RestoreSettings();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Reset the user preferences to the default values
|
||||
/// </summary>
|
||||
public void RestoreSettings()
|
||||
{
|
||||
useGPU = false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -364,6 +385,7 @@ public class PersistentDataController
|
||||
{
|
||||
json.users.Clear();
|
||||
json.currentUser = -1;
|
||||
json.useGPU = false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -539,4 +561,37 @@ public class PersistentDataController
|
||||
if (save)
|
||||
Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Whether the user wants to use hardware acceleration or not
|
||||
/// </summary>
|
||||
public bool IsUsingGPU()
|
||||
{
|
||||
return json.useGPU;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the preference of the user for hardware acceleration
|
||||
/// </summary>
|
||||
/// <param name="value">Value of the preference</param>
|
||||
/// <param name="save">Whether to save the change immediately to disk</param>
|
||||
public void SetGPUUsage(bool value, bool save = true)
|
||||
{
|
||||
json.useGPU = value;
|
||||
|
||||
if (save)
|
||||
Save();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Restore preferences to default factory settings
|
||||
/// </summary>
|
||||
/// <param name="save">Whether to save the change immediately to disk</param>
|
||||
public void RestoreSettings(bool save = true)
|
||||
{
|
||||
json.RestoreSettings();
|
||||
|
||||
if (save)
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user