From 96834fa5248a49e9f68ae9c6f3666b813c67c014 Mon Sep 17 00:00:00 2001
From: Magnus Norddahl <dpjudas@users.noreply.github.com>
Date: Wed, 12 Apr 2017 03:21:43 +0200
Subject: [PATCH 1/4] - Turn off vid_glswfb, gl_es on Linux ARM and stop saving
 it in the config file until it fully works

---
 src/posix/sdl/sdlglvideo.cpp | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp
index 106b98d79..2a4b869a7 100644
--- a/src/posix/sdl/sdlglvideo.cpp
+++ b/src/posix/sdl/sdlglvideo.cpp
@@ -62,17 +62,20 @@ CUSTOM_CVAR(Bool, gl_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINI
 {
 	Printf("This won't take effect until " GAMENAME " is restarted.\n");
 }
-CUSTOM_CVAR(Bool, vid_glswfb, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
+#ifdef __arm__
+CUSTOM_CVAR(Bool, vid_glswfb, true, CVAR_NOINITCALL)
 {
 	Printf("This won't take effect until " GAMENAME " is restarted.\n");
 }
-
-#ifdef __arm__
-CUSTOM_CVAR(Bool, gl_es, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
+CUSTOM_CVAR(Bool, gl_es, false, CVAR_NOINITCALL)
 {
 	Printf("This won't take effect until " GAMENAME " is restarted.\n");
 }
 #else
+CUSTOM_CVAR(Bool, vid_glswfb, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
+{
+	Printf("This won't take effect until " GAMENAME " is restarted.\n");
+}
 CUSTOM_CVAR(Bool, gl_es, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
 {
 	Printf("This won't take effect until " GAMENAME " is restarted.\n");

From df8fa1274a988da4a6d9ef08fcafbf16bb77603d Mon Sep 17 00:00:00 2001
From: Magnus Norddahl <dpjudas@users.noreply.github.com>
Date: Wed, 12 Apr 2017 03:22:38 +0200
Subject: [PATCH 2/4] - Oops, forgot to actually disable vid_glswfb in last
 commit

---
 src/posix/sdl/sdlglvideo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/posix/sdl/sdlglvideo.cpp b/src/posix/sdl/sdlglvideo.cpp
index 2a4b869a7..1e602f102 100644
--- a/src/posix/sdl/sdlglvideo.cpp
+++ b/src/posix/sdl/sdlglvideo.cpp
@@ -63,7 +63,7 @@ CUSTOM_CVAR(Bool, gl_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINI
 	Printf("This won't take effect until " GAMENAME " is restarted.\n");
 }
 #ifdef __arm__
-CUSTOM_CVAR(Bool, vid_glswfb, true, CVAR_NOINITCALL)
+CUSTOM_CVAR(Bool, vid_glswfb, false, CVAR_NOINITCALL)
 {
 	Printf("This won't take effect until " GAMENAME " is restarted.\n");
 }

From d8d7dc973c7797ac2817982afc9608c4b59e9711 Mon Sep 17 00:00:00 2001
From: "alexey.lysiuk" <alexey.lysiuk@gmail.com>
Date: Wed, 12 Apr 2017 17:15:12 +0300
Subject: [PATCH 3/4] Added check for selected item in save/load menu

https://mantis.zdoom.org/view.php?id=570
---
 wadsrc/static/zscript/menu/loadsavemenu.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/wadsrc/static/zscript/menu/loadsavemenu.txt b/wadsrc/static/zscript/menu/loadsavemenu.txt
index 2154e1015..7fe354317 100644
--- a/wadsrc/static/zscript/menu/loadsavemenu.txt
+++ b/wadsrc/static/zscript/menu/loadsavemenu.txt
@@ -387,7 +387,7 @@ class LoadSaveMenu : ListMenu
 	{
 		if (ev.Type == UIEvent.Type_KeyDown)
 		{
-			if (Selected < manager.SavegameCount())
+			if (Selected != -1 && Selected < manager.SavegameCount())
 			{
 				switch (ev.KeyChar)
 				{

From 20a9f17a158c4d37101dfd4b6177cb423290aa7a Mon Sep 17 00:00:00 2001
From: "alexey.lysiuk" <alexey.lysiuk@gmail.com>
Date: Wed, 12 Apr 2017 17:40:17 +0300
Subject: [PATCH 4/4] Fixed handling of count parameter's default value in
 Array.Delete()

https://mantis.zdoom.org/view.php?id=571
---
 src/scripting/backend/dynarrays.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/scripting/backend/dynarrays.cpp b/src/scripting/backend/dynarrays.cpp
index 0152c6520..fecb3185a 100644
--- a/src/scripting/backend/dynarrays.cpp
+++ b/src/scripting/backend/dynarrays.cpp
@@ -97,7 +97,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_I8, Delete)
 {
 	PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I8);
 	PARAM_INT(index);
-	PARAM_INT(count);
+	PARAM_INT_DEF(count);
 	self->Delete(index, count);
 	return 0;
 }
@@ -200,7 +200,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_I16, Delete)
 {
 	PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I16);
 	PARAM_INT(index);
-	PARAM_INT(count);
+	PARAM_INT_DEF(count);
 	self->Delete(index, count);
 	return 0;
 }
@@ -303,7 +303,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_I32, Delete)
 {
 	PARAM_SELF_STRUCT_PROLOGUE(FDynArray_I32);
 	PARAM_INT(index);
-	PARAM_INT(count);
+	PARAM_INT_DEF(count);
 	self->Delete(index, count);
 	return 0;
 }
@@ -406,7 +406,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_F32, Delete)
 {
 	PARAM_SELF_STRUCT_PROLOGUE(FDynArray_F32);
 	PARAM_INT(index);
-	PARAM_INT(count);
+	PARAM_INT_DEF(count);
 	self->Delete(index, count);
 	return 0;
 }
@@ -509,7 +509,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_F64, Delete)
 {
 	PARAM_SELF_STRUCT_PROLOGUE(FDynArray_F64);
 	PARAM_INT(index);
-	PARAM_INT(count);
+	PARAM_INT_DEF(count);
 	self->Delete(index, count);
 	return 0;
 }
@@ -612,7 +612,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_Ptr, Delete)
 {
 	PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Ptr);
 	PARAM_INT(index);
-	PARAM_INT(count);
+	PARAM_INT_DEF(count);
 	self->Delete(index, count);
 	return 0;
 }
@@ -716,7 +716,7 @@ DEFINE_ACTION_FUNCTION(FDynArray_String, Delete)
 {
 	PARAM_SELF_STRUCT_PROLOGUE(FDynArray_String);
 	PARAM_INT(index);
-	PARAM_INT(count);
+	PARAM_INT_DEF(count);
 	self->Delete(index, count);
 	return 0;
 }