@@ -513,36 +513,40 @@ void mapclass::changefinalcol(int t)
513513 // change the map to colour t - for the game's final stretch.
514514 // First up, the tiles. This is just a setting:
515515 final_mapcol = t;
516- const int temp = 6 - t;
516+ graphics.rcol = 6 - t;
517+ graphics.backgrounddrawn = false ;
517518 // Next, entities
518519 for (size_t i = 0 ; i < obj.entities .size (); i++)
519520 {
520521 if (obj.entities [i].type == 1 ) // something with a movement behavior
521522 {
522523 if (obj.entities [i].animate == 10 || obj.entities [i].animate == 11 ) // treadmill
523524 {
524- if (temp< 3 )
525+ if (graphics. rcol < 3 )
525526 {
526- obj.entities [i].tile = 907 + (temp * 80 );
527+ obj.entities [i].tile = 907 + (graphics. rcol * 80 );
527528 }
528529 else
529530 {
530- obj.entities [i].tile = 911 + ((temp-3 ) * 80 );
531+ obj.entities [i].tile = 911 + ((graphics.rcol - 3 ) * 80 );
532+ }
533+ if (obj.entities [i].animate == 10 )
534+ {
535+ obj.entities [i].tile += 40 ;
531536 }
532- if (obj.entities [i].animate == 10 ) obj.entities [i].tile += 40 ;
533537 }
534538 else if (obj.entities [i].isplatform )
535539 {
536- obj.entities [i].tile = 915 +(temp* 40 );
540+ obj.entities [i].tile = 915 + (graphics. rcol * 40 );
537541 }
538- else // just an enemy
542+ else // just an enemy
539543 {
540- obj.entities [i].colour = maptiletoenemycol (temp );
544+ obj.entities [i].colour = maptiletoenemycol (graphics. rcol );
541545 }
542546 }
543- else if (obj.entities [i].type == 2 ) // disappearing platforms
547+ else if (obj.entities [i].type == 2 ) // disappearing platforms
544548 {
545- obj.entities [i].tile = 915 +(temp* 40 );
549+ obj.entities [i].tile = 915 + (graphics. rcol * 40 );
546550 }
547551 }
548552}
@@ -1788,6 +1792,11 @@ void mapclass::loadlevel(int rx, int ry)
17881792 break ;
17891793 }
17901794
1795+ if (finalstretch)
1796+ {
1797+ graphics.rcol = 6 - final_mapcol;
1798+ }
1799+
17911800 setroomname (room->roomname .c_str ());
17921801 extrarow = 1 ;
17931802 const int * tmap = cl.loadlevel (rx, ry);
0 commit comments