Remove global 'temp' variable from titlerender.cpp

Just a miscellaneous code cleanup.

There's no glitches that take advantage of the previous situation,
namely that 'temp' was a global variable in Logic.cpp and editor.cpp.
Even if there were, it seems like it would easily lead to some undefined
behavior. So it's good to clean this up.
This commit is contained in:
Misa
2020-04-02 18:50:37 -07:00
committed by Ethan Lee
parent d3cdd33605
commit 04d14000ec
4 changed files with 17 additions and 24 deletions

View File

@@ -954,7 +954,7 @@ void editorclass::placetilelocal( int x, int y, int t )
int editorclass::base( int x, int y )
{
//Return the base tile for the given tileset and colour
temp=x+(y*maxwidth);
int temp=x+(y*maxwidth);
if(level[temp].tileset==0) //Space Station
{
if(level[temp].tilecol>=22)
@@ -992,7 +992,7 @@ int editorclass::base( int x, int y )
int editorclass::backbase( int x, int y )
{
//Return the base tile for the background of the given tileset and colour
temp=x+(y*maxwidth);
int temp=x+(y*maxwidth);
if(level[temp].tileset==0) //Space Station
{
//Pick depending on tilecol
@@ -2074,8 +2074,6 @@ void fillboxabs( int x, int y, int x2, int y2, int c )
extern editorclass ed;
extern int temp;
extern scriptclass script;
void editorclass::generatecustomminimap()
@@ -5079,7 +5077,7 @@ void editorinput()
{
for(int i=0; i<40; i++)
{
temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
int temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
if(ed.contents[temp]>=3 && ed.contents[temp]<80)
{
//Fix spikes
@@ -5103,7 +5101,7 @@ void editorinput()
{
for(int i=0; i<40; i++)
{
temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
int temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
if(ed.contents[temp]>=3 && ed.contents[temp]<80)
{
//Fix spikes
@@ -5127,7 +5125,7 @@ void editorinput()
{
for(int i=0; i<40; i++)
{
temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
int temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
if(ed.contents[temp]>=3 && ed.contents[temp]<80)
{
//Fix spikes
@@ -5151,7 +5149,7 @@ void editorinput()
{
for(int i=0; i<40; i++)
{
temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
int temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
if(ed.contents[temp]>=3 && ed.contents[temp]<80)
{
//Fix spikes
@@ -5175,7 +5173,7 @@ void editorinput()
{
for(int i=0; i<40; i++)
{
temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
int temp=i+(ed.levx*40) + ed.vmult[j+(ed.levy*30)];
if(ed.contents[temp]>=3 && ed.contents[temp]<80)
{
//Fix spikes