adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[adonthell-commits] master b205a08: UPDATED to force render batching on


From: Kai Sterker
Subject: [adonthell-commits] master b205a08: UPDATED to force render batching on SDL 2.0.9 and up
Date: Sun, 30 Dec 2018 09:03:15 -0500 (EST)

branch: master
commit b205a089bfe3d86c79df48344d37fe103163f9fe
Author: Kai Sterker <address@hidden>
Commit: Kai Sterker <address@hidden>

    UPDATED to force render batching on SDL 2.0.9 and up
    UPDATED for 0.3.8 release
---
 NEWS                |  3 +++
 configure.ac        |  2 +-
 make_osx_bundle.sh  |  6 +++---
 make_windows_pkg.sh | 10 +++++-----
 src/screen.cc       |  7 ++++++-
 5 files changed, 18 insertions(+), 10 deletions(-)

diff --git a/NEWS b/NEWS
index 281cc75..a466bd2 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+version 0.3.8
+- Force render batching with SDL 2.0.9 or newer
+
 version 0.3.7
 - Added basic gamecontroller support
 - Set fullscreen resolution to highest available multiple of 320x240
diff --git a/configure.ac b/configure.ac
index ff516e7..1f50816 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3,7 +3,7 @@ dnl Process this file with autoconf to produce a configure 
script.
 dnl **************************************************************
 
 AC_PREREQ(2.59)
-AC_INIT([Adonthell], [0.3.7], address@hidden, [adonthell], 
[http://adonthell.nongnu.org])
+AC_INIT([Adonthell], [0.3.8], address@hidden, [adonthell], 
[http://adonthell.nongnu.org])
 AC_CONFIG_SRCDIR([README])
 AC_CONFIG_AUX_DIR(.)
 
diff --git a/make_osx_bundle.sh b/make_osx_bundle.sh
index 2853632..a24dcc6 100755
--- a/make_osx_bundle.sh
+++ b/make_osx_bundle.sh
@@ -74,11 +74,11 @@ cat > $bundle/Contents/Info.plist <<EOF
         <key>CFBundlePackageType</key>
         <string>APPL</string>
         <key>CFBundleShortVersionString</key>
-        <string>0.3.7</string>
+        <string>0.3.8</string>
         <key>CFBundleSignature</key>
         <string>????</string>
         <key>CFBundleVersion</key>
-        <string>0.3.7</string>
+        <string>0.3.8</string>
        <key>LSEnvironment</key>
        <dict>
                <key>PYTHONDONTWRITEBYTECODE</key>
@@ -91,7 +91,7 @@ cat > $bundle/Contents/Info.plist <<EOF
         <key>NSSupportsSuddenTermination</key>
         <string>YES</string>
         <key>NSHumanReadableCopyright</key>
-        <string>Copyright ©2017, Adonthell Team</string>
+        <string>Copyright ©2018, Adonthell Team</string>
         <key>NSHighResolutionCapable</key>
         <string>YES</string>
 </dict>
diff --git a/make_windows_pkg.sh b/make_windows_pkg.sh
index c09195b..2cf9ffb 100755
--- a/make_windows_pkg.sh
+++ b/make_windows_pkg.sh
@@ -49,8 +49,8 @@ cd build
 # -- create resource file
 cat > adonthell.rc << EOF
 1 VERSIONINFO
-FILEVERSION     0,3,7,0
-PRODUCTVERSION  0,3,7,0
+FILEVERSION     0.3.8,0
+PRODUCTVERSION  0.3.8,0
 BEGIN
   BLOCK "StringFileInfo"
   BEGIN
@@ -58,12 +58,12 @@ BEGIN
     BEGIN
       VALUE "CompanyName", "The Adonthell Team"
       VALUE "FileDescription", "Adonthell RPG Engine"
-      VALUE "FileVersion", "0.3.7"
+      VALUE "FileVersion", "0.3.8"
       VALUE "InternalName", "adonthell"
-      VALUE "LegalCopyright", "© 2017 The Adonthell Team"
+      VALUE "LegalCopyright", "© 2018 The Adonthell Team"
       VALUE "OriginalFilename", "adonthell-0.3.exe"
       VALUE "ProductName", "Adonthell"
-      VALUE "ProductVersion", "0.3.7"
+      VALUE "ProductVersion", "0.3.8"
     END
   END
 
diff --git a/src/screen.cc b/src/screen.cc
index 3ad7312..3ab1a4a 100644
--- a/src/screen.cc
+++ b/src/screen.cc
@@ -32,6 +32,7 @@
 #include "game.h"
 #include <iostream>
 #include <sstream> 
+#include <algorithm>
 
 using namespace std; 
 
@@ -73,6 +74,10 @@ bool screen::init (u_int16 nl, u_int16 nh, u_int8 depth, 
const config & myconfig
        putenv ((char *) wm_class.c_str ());
 #endif
 
+#if defined(SDL_HINT_RENDER_BATCHING)
+    SDL_SetHint (SDL_HINT_RENDER_BATCHING, "1");
+#endif
+
     if (SDL_Init (SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_GAMECONTROLLER) < 
0)
     {
        std::cout << "Couldn't init SDL: " << SDL_GetError () << std::endl;
@@ -336,7 +341,7 @@ u_int8 screen::get_scale_for_display(u_int8 screen, u_int16 
nl, u_int16 nh)
        int scale_x = bounds.w / nl;
        int scale_y = bounds.h / nh;
 
-       return scale_x > scale_y ? scale_y : scale_x;
+       return std::max(1, scale_x > scale_y ? scale_y : scale_x);
 }
 
 void screen::update_scale()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]