mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-06-25 05:58:30 +02:00
Instead of duplicating the same variables over and over again, Graphics::drawgui() can just make its own SDL_Rect. It's not that hard. As far as I can tell, textrect was always being properly kept up to date by the time Graphics::drawgui() got around to rendering (textboxclass::resize() keeps being called a LOT), so this shouldn't be a noticeable change from the user perspective.
49 lines
661 B
C++
49 lines
661 B
C++
#ifndef TEXTBOX_H
|
|
#define TEXTBOX_H
|
|
|
|
#include <SDL.h>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
class textboxclass
|
|
{
|
|
public:
|
|
textboxclass(void);
|
|
|
|
void centerx(void);
|
|
|
|
void centery(void);
|
|
|
|
void adjust(void);
|
|
|
|
void initcol(int rr, int gg, int bb);
|
|
|
|
void setcol(int rr, int gg, int bb);
|
|
|
|
void update(void);
|
|
|
|
void remove(void);
|
|
|
|
void removefast(void);
|
|
|
|
void resize(void);
|
|
|
|
void addline(std::string t);
|
|
public:
|
|
//Fundamentals
|
|
std::vector<std::string> line;
|
|
int xp, yp, lw, w, h;
|
|
int r,g,b;
|
|
int tr,tg,tb;
|
|
int timer;
|
|
|
|
float tl;
|
|
float prev_tl;
|
|
int tm;
|
|
|
|
int max;
|
|
|
|
};
|
|
|
|
#endif /* TEXTBOX_H */
|