Skip to content

Commit c13941d

Browse files
committed
Safe wrap resolution.
1 parent 5f4b804 commit c13941d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Assets/JCSUnity/Scripts/Settings/JCS_ScreenSettings.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ public void ForceAspectScreenOnce(bool starting = false)
211211
{
212212
// update the height
213213
float heightAccordingToWidth = width / ASPECT_RATIO_SCREEN_SIZE.width * ASPECT_RATIO_SCREEN_SIZE.height;
214-
Screen.SetResolution(width, (int)Mathf.Round(heightAccordingToWidth), false, 0);
214+
JCS_Screen.SetResolution(width, (int)Mathf.Round(heightAccordingToWidth), false, 0);
215215

216216
if (starting)
217217
{
@@ -223,7 +223,7 @@ public void ForceAspectScreenOnce(bool starting = false)
223223
{
224224
// update the width
225225
float widthAccordingToHeight = height / ASPECT_RATIO_SCREEN_SIZE.height * ASPECT_RATIO_SCREEN_SIZE.width;
226-
Screen.SetResolution((int)Mathf.Round(widthAccordingToHeight), height, false, 0);
226+
JCS_Screen.SetResolution((int)Mathf.Round(widthAccordingToHeight), height, false, 0);
227227

228228
if (starting)
229229
{
@@ -239,7 +239,7 @@ public void ForceAspectScreenOnce(bool starting = false)
239239
/// <param name="starting"> Change the starting screen as well? </param>
240240
public void ForceStandardScreenOnce(bool starting = false)
241241
{
242-
Screen.SetResolution(STANDARD_SCREEN_SIZE.width, STANDARD_SCREEN_SIZE.height, false, 0);
242+
JCS_Screen.SetResolution(STANDARD_SCREEN_SIZE.width, STANDARD_SCREEN_SIZE.height, false, 0);
243243

244244
if (starting)
245245
{
@@ -306,7 +306,7 @@ private void DoAlwaysStandard()
306306
if (width != STANDARD_SCREEN_SIZE.width ||
307307
height != STANDARD_SCREEN_SIZE.height)
308308
{
309-
Screen.SetResolution(STANDARD_SCREEN_SIZE.width, STANDARD_SCREEN_SIZE.height, false, 0);
309+
JCS_Screen.SetResolution(STANDARD_SCREEN_SIZE.width, STANDARD_SCREEN_SIZE.height, false, 0);
310310
}
311311

312312
this.PREV_SCREEN_SIZE.width = width;
@@ -335,15 +335,15 @@ private void DoFoceAspectScreen()
335335
{
336336
// update the height
337337
float heightAccordingToWidth = width / ss.ASPECT_RATIO_SCREEN_SIZE.width * ss.ASPECT_RATIO_SCREEN_SIZE.height;
338-
Screen.SetResolution(width, (int)Mathf.Round(heightAccordingToWidth), false, 0);
338+
JCS_Screen.SetResolution(width, (int)Mathf.Round(heightAccordingToWidth), false, 0);
339339
}
340340

341341
// if the user is changing the height
342342
if (PREV_SCREEN_SIZE.height != height)
343343
{
344344
// update the width
345345
float widthAccordingToHeight = height / ss.ASPECT_RATIO_SCREEN_SIZE.height * ss.ASPECT_RATIO_SCREEN_SIZE.width;
346-
Screen.SetResolution((int)Mathf.Round(widthAccordingToHeight), height, false, 0);
346+
JCS_Screen.SetResolution((int)Mathf.Round(widthAccordingToHeight), height, false, 0);
347347
}
348348

349349
this.PREV_SCREEN_SIZE.width = width;

0 commit comments

Comments
 (0)