# HG changeset patch # User Matti Hamalainen # Date 1534241493 -10800 # Node ID f91dda5dc8da4fb3316d642fe44fea073201be7c # Parent 5e18cb16bc4b6f0eeb7647b76d56af569c240937 Integer fixes. diff -r 5e18cb16bc4b -r f91dda5dc8da Interface.pde --- 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 }