mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-09-29 01:37:23 +02:00
815a48c025
Instead each line is now held in a const char* array, like it should be. This results in less work for the compiler, especially with optimization, since every time the compiler encounters a constant argument in a function, it has to go off and locate a place to put it. But if we're upfront and say, hey, here's all the strings we ever need conveniently packaged into one place, it'll be much more cooperative.
71 lines
1.1 KiB
C++
71 lines
1.1 KiB
C++
#ifndef SCRIPT_H
|
|
#define SCRIPT_H
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "Enums.h"
|
|
|
|
#define filllines(lines) commands.insert(commands.end(), lines, lines + sizeof(lines)/sizeof(lines[0]))
|
|
|
|
|
|
class scriptclass
|
|
{
|
|
public:
|
|
|
|
|
|
scriptclass();
|
|
|
|
void load(std::string t);
|
|
void loadother(std::string t);
|
|
|
|
|
|
void inline add(std::string t)
|
|
{
|
|
commands.push_back(t);
|
|
}
|
|
|
|
void clearcustom();
|
|
|
|
void tokenize(std::string t);
|
|
|
|
void run();
|
|
|
|
void resetgametomenu();
|
|
|
|
void startgamemode(int t);
|
|
|
|
void teleport();
|
|
|
|
void hardreset();
|
|
|
|
void loadcustom(std::string t);
|
|
|
|
//Script contents
|
|
std::vector<std::string> commands;
|
|
std::vector<std::string> words;
|
|
std::vector<std::string> txt;
|
|
std::string scriptname;
|
|
int position;
|
|
int looppoint, loopcount;
|
|
|
|
int scriptdelay;
|
|
bool running;
|
|
std::string tempword;
|
|
std::string currentletter;
|
|
|
|
//Textbox stuff
|
|
int textx;
|
|
int texty;
|
|
int r,g,b;
|
|
|
|
//Misc
|
|
int i, j, k;
|
|
|
|
//Custom level stuff
|
|
std::vector <std::string> customscript;
|
|
};
|
|
|
|
extern scriptclass script;
|
|
|
|
#endif /* SCRIPT_H */
|