mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-30 09:54:10 +03:00
Statically allocate level arrays
This prevents a potential stack overflow if the compiler tries to allocate all of the arrays at once (observed on MSVC).
This commit is contained in:
@@ -25,8 +25,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
#if !defined(MAKEANDPLAY)
|
||||
case rn(50,50):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
|
||||
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
|
||||
120,120,120,120,120,120,120,120,120,120,120,120,120,200,80,202,0,0,0,0,0,0,0,0,200,80,202,120,120,120,120,120,120,120,120,120,120,120,120,120,
|
||||
@@ -76,7 +75,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(51,50):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,248,206,86,208,246,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,247,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -119,7 +118,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(51,51):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,
|
||||
83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,
|
||||
244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,244,245,0,0,0,0,243,244,244,244,244,244,
|
||||
@@ -165,7 +164,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(52,51):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
95,95,95,95,95,217,0,0,0,0,215,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,95,
|
||||
256,256,256,256,256,257,0,0,0,0,255,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -213,7 +212,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(52,50):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
213,212,92,214,172,174,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
|
||||
213,212,92,214,252,254,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
|
||||
213,212,92,214,0,0,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,214,0,0,0,0,0,0,212,92,92,92,
|
||||
@@ -258,7 +257,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(53,50):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
250,250,250,250,250,250,251,0,0,0,209,211,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
|
||||
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,209,211,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -302,7 +301,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(53,49):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
126,126,126,126,206,86,208,0,0,0,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,
|
||||
126,126,126,126,206,86,208,0,0,0,246,247,248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,246,247,
|
||||
126,126,126,126,206,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -346,7 +345,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(54,49):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
80,80,80,202,200,202,200,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,200,202,200,80,
|
||||
241,241,241,242,200,202,240,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,241,242,200,202,240,241,
|
||||
0,0,0,0,200,202,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,160,161,161,162,7,7,7,7,7,7,7,7,7,200,202,0,0,
|
||||
@@ -394,7 +393,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(54,50):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
|
||||
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
|
||||
86,86,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,86,86,
|
||||
@@ -440,7 +439,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(55,50):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
212,92,92,214,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
|
||||
212,92,92,214,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
|
||||
212,92,92,214,0,0,0,0,0,0,0,0,252,253,253,254,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,212,92,92,214,
|
||||
@@ -487,7 +486,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(55,51):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
83,83,83,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,
|
||||
244,244,244,245,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,243,245,0,0,0,0,243,245,0,0,0,0,203,83,
|
||||
0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
|
||||
@@ -536,7 +535,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(54,51):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,211,209,89,89,211,209,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,89,
|
||||
250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,251,249,250,250,251,249,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,250,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -588,7 +587,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(54,52):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
95,95,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,177,0,0,0,0,215,95,95,95,
|
||||
256,256,256,257,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,257,0,0,0,0,255,256,256,256,
|
||||
176,177,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,175,176,
|
||||
@@ -643,7 +642,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(53,52):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,246,247,247,248,206,86,
|
||||
207,207,207,207,207,207,207,207,207,207,207,207,207,206,86,208,206,208,0,0,0,0,206,208,206,86,208,207,207,207,207,206,86,208,0,0,0,0,206,86,
|
||||
167,167,167,167,167,167,167,167,167,167,167,167,167,128,86,208,206,208,0,0,0,0,206,208,206,86,127,167,167,167,167,128,86,208,0,0,0,0,206,86,
|
||||
@@ -698,7 +697,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(53,51):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
|
||||
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
|
||||
83,83,205,0,0,0,0,203,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,205,0,0,0,0,203,205,0,0,0,0,203,83,83,
|
||||
@@ -743,7 +742,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(55,49):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
|
||||
0,0,212,92,214,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,212,92,214,0,0,
|
||||
0,0,252,253,254,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,252,253,254,0,0,
|
||||
@@ -789,7 +788,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(55,52):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -835,7 +834,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(52,52):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,215,95,217,216,216,216,216,215,95,217,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -881,7 +880,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(50,51):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
|
||||
83,83,83,83,83,83,83,83,83,83,83,83,83,205,203,83,83,83,83,83,83,83,83,83,83,205,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
|
||||
83,83,83,83,83,83,83,83,83,83,83,83,83,205,243,244,244,244,244,244,244,244,244,244,244,245,0,0,0,0,203,83,83,83,83,83,83,83,83,83,
|
||||
@@ -931,7 +930,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(52,49):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
|
||||
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
|
||||
86,86,86,86,86,208,0,0,0,0,206,208,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,206,208,0,0,0,0,206,86,86,86,86,86,
|
||||
@@ -982,7 +981,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(50,49):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
83,83,205,0,0,0,0,0,203,83,83,83,83,83,83,83,83,205,203,83,83,83,205,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,203,83,
|
||||
83,83,205,0,0,0,0,0,243,244,244,244,244,244,244,244,244,245,203,83,83,83,205,0,0,0,0,0,243,244,244,244,245,0,0,0,0,0,203,83,
|
||||
83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,83,83,205,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,203,83,
|
||||
@@ -1025,7 +1024,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(51,49):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
||||
@@ -1076,7 +1075,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
case rn(49,49):
|
||||
{
|
||||
|
||||
const int contents[] = {
|
||||
static const int contents[] = {
|
||||
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
|
||||
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
|
||||
80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,202,0,0,0,0,0,0,0,200,80,202,201,201,201,201,201,201,201,201,201,201,201,201,201,201,
|
||||
@@ -1128,7 +1127,7 @@ std::vector<int> warpclass::loadlevel(int rx, int ry)
|
||||
|
||||
default:
|
||||
{
|
||||
const int contents[1200] = {0};
|
||||
static const int contents[1200] = {0};
|
||||
//roomname = "Outer Space";
|
||||
result.insert(result.end(), contents, contents+1200);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user