changeset 144:f91dda5dc8da

Integer fixes.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 14 Aug 2018 13:11:33 +0300
parents 5e18cb16bc4b
children 5af8b5ddf349
files Interface.pde
diffstat 1 files changed, 8 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/Interface.pde	Tue Aug 14 13:02:30 2018 +0300
+++ b/Interface.pde	Tue Aug 14 13:11:33 2018 +0300
@@ -164,28 +164,25 @@
     if (g_uizoom == 1) base = 10;
     if (g_uizoom == 3) base = 20;
     if (g_data[int('M')] == 1 && g_data[int('m')] == 1) g_data[int('m')] = 0;
-    if (g_data[int('m')] == 1) base++;
-    if (g_data[int('M')] == 1) base = base + 2;
+    if (g_data[int('m')] == 1) base += 1;
+    if (g_data[int('M')] == 1) base += 2;
     return base;
 }
 
 
-int magx() {
+int magx()
+{
     //return the amount of horizontal 8x8 characters in current mode ('m' or 'M')
-    int psize, mag;
-    psize = g_magpix[magmode()];
-    mag = psize * 8;
-    return (width - (33 * g_uizoom)) / mag;
+    int mag = g_magpix[magmode()] * 8;
+    return int((width - (33 * g_uizoom)) / mag);
 }
 
 
 int magy()
 {
     //return the amount of vertical 8x8 characters in current mode ('m' or 'M')
-    int psize, mag;
-    psize = g_magpiy[magmode()];
-    mag = psize * 8;
-    return (height - (33 * g_uizoom)) / mag; //how many chars in a magmode
+    int mag = g_magpiy[magmode()] * 8;
+    return int((height - (33 * g_uizoom)) / mag); //how many chars in a magmode
 }