2020-01-01 21:29:24 +01:00
|
|
|
#ifndef GRAPHICS_H
|
|
|
|
#define GRAPHICS_H
|
|
|
|
|
2020-01-31 19:25:37 +01:00
|
|
|
#include <map>
|
2020-01-01 21:29:24 +01:00
|
|
|
#include <string>
|
2020-07-19 21:43:29 +02:00
|
|
|
#include <vector>
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-07-19 21:43:29 +02:00
|
|
|
#include "GraphicsResources.h"
|
2020-01-01 21:29:24 +01:00
|
|
|
#include "GraphicsUtil.h"
|
2020-07-19 21:43:29 +02:00
|
|
|
#include "Maths.h"
|
2020-01-01 21:29:24 +01:00
|
|
|
#include "Screen.h"
|
2020-07-19 21:43:29 +02:00
|
|
|
#include "Textbox.h"
|
2020-11-03 00:05:24 +01:00
|
|
|
#include "TowerBG.h"
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
class Graphics
|
|
|
|
{
|
|
|
|
public:
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void init(void);
|
|
|
|
void destroy(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2021-02-16 01:18:45 +01:00
|
|
|
void create_buffers(const SDL_PixelFormat* fmt);
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void destroy_buffers(void);
|
2021-02-16 01:16:52 +01:00
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
GraphicsResources grphx;
|
|
|
|
|
2020-02-11 06:48:07 +01:00
|
|
|
int bfontlen(uint32_t ch);
|
|
|
|
int font_idx(uint32_t ch);
|
2020-01-31 19:25:37 +01:00
|
|
|
|
2021-08-07 05:57:34 +02:00
|
|
|
bool Makebfont(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-04-30 23:42:08 +02:00
|
|
|
void drawhuetile(int x, int y, int t);
|
|
|
|
void huetilesetcol(int t);
|
2020-04-30 23:57:21 +02:00
|
|
|
Uint32 bigchunkygetcol(int t);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-03-31 21:26:11 +02:00
|
|
|
void drawgravityline(int t);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2021-08-07 05:57:34 +02:00
|
|
|
bool MakeTileArray(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2021-08-07 05:57:34 +02:00
|
|
|
bool MakeSpriteArray(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2021-08-07 05:57:34 +02:00
|
|
|
bool maketelearray(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void drawcoloredtile(int x, int y, int t, int r, int g, int b);
|
|
|
|
|
2020-07-04 23:53:05 +02:00
|
|
|
void drawmenu(int cr, int cg, int cb, bool levelmenu = false);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void processfade(void);
|
2021-03-20 07:09:11 +01:00
|
|
|
void setfade(const int amount);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void drawfade(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void setwarprect(int a, int b, int c, int d);
|
|
|
|
|
2021-03-20 04:03:08 +01:00
|
|
|
void createtextboxreal(
|
|
|
|
std::string t,
|
|
|
|
int xp,
|
|
|
|
int yp,
|
|
|
|
int r,
|
|
|
|
int g,
|
|
|
|
int b,
|
|
|
|
bool flipme
|
|
|
|
);
|
|
|
|
void createtextbox(
|
|
|
|
std::string t,
|
|
|
|
int xp,
|
|
|
|
int yp,
|
|
|
|
int r,
|
|
|
|
int g,
|
|
|
|
int b
|
|
|
|
);
|
|
|
|
void createtextboxflipme(
|
|
|
|
std::string t,
|
|
|
|
int xp,
|
|
|
|
int yp,
|
|
|
|
int r,
|
|
|
|
int g,
|
|
|
|
int b
|
|
|
|
);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void textboxcenterx(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
int textboxwidth(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void textboxmoveto(int xo);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void textboxcentery(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void textboxadjust(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void addline(std::string t);
|
|
|
|
|
|
|
|
void textboxtimer(int t);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void textboxremove(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void textboxremovefast(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void textboxactive(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void drawtextbox(int x, int y, int w, int h, int r, int g, int b);
|
|
|
|
|
|
|
|
void drawpixeltextbox(int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo);
|
|
|
|
void drawcustompixeltextbox(int x, int y, int w, int h, int w2, int h2, int r, int g, int b, int xo, int yo);
|
|
|
|
|
2020-03-31 21:26:11 +02:00
|
|
|
void drawcrewman(int x, int y, int t, bool act, bool noshift =false);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
int crewcolour(const int t);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void cutscenebars(void);
|
|
|
|
void cutscenebarstimer(void);
|
2021-03-20 07:08:35 +01:00
|
|
|
void setbars(const int position);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void drawpartimage(int t, int xp, int yp, int wp, int hp);
|
|
|
|
|
|
|
|
void drawimage(int t, int xp, int yp, bool cent=false);
|
|
|
|
|
|
|
|
void drawimagecol(int t, int xp, int yp, int r, int g, int b, bool cent= false);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void updatetextboxes(void);
|
|
|
|
void drawgui(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void drawsprite(int x, int y, int t, int r, int g, int b);
|
2020-05-02 01:40:35 +02:00
|
|
|
void drawsprite(int x, int y, int t, Uint32 c);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void printcrewname(int x, int y, int t);
|
|
|
|
|
|
|
|
void printcrewnamestatus(int x, int y, int t);
|
|
|
|
|
|
|
|
void printcrewnamedark(int x, int y, int t);
|
|
|
|
|
2020-06-21 03:33:55 +02:00
|
|
|
void map_tab(int opt, const std::string& text, bool selected = false);
|
|
|
|
|
2020-06-23 00:23:15 +02:00
|
|
|
void map_option(int opt, int num_opts, const std::string& text, bool selected = false);
|
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
void Print(int _x, int _y, std::string _s, int r, int g, int b, bool cen = false);
|
|
|
|
|
2020-02-10 03:23:12 +01:00
|
|
|
void PrintAlpha(int _x, int _y, std::string _s, int r, int g, int b, int a, bool cen = false);
|
|
|
|
|
2021-08-07 05:55:09 +02:00
|
|
|
bool next_wrap(size_t* start, size_t* len, const char* str, int maxwidth);
|
|
|
|
|
|
|
|
bool next_wrap_s(char buffer[], size_t buffer_size, size_t* start, const char* str, int maxwidth);
|
|
|
|
|
|
|
|
void PrintWrap(int x, int y, const char* str, int r, int g, int b, bool cen, int linespacing, int maxwidth);
|
|
|
|
|
2020-02-10 03:23:12 +01:00
|
|
|
void PrintOffAlpha(int _x, int _y, std::string _s, int r, int g, int b, int a, bool cen = false);
|
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
void bprint(int x, int y, std::string t, int r, int g, int b, bool cen = false);
|
|
|
|
|
2020-02-10 03:23:12 +01:00
|
|
|
void bprintalpha(int x, int y, std::string t, int r, int g, int b, int a, bool cen = false);
|
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
int len(std::string t);
|
|
|
|
void bigprint( int _x, int _y, std::string _s, int r, int g, int b, bool cen = false, int sc = 2 );
|
2021-03-19 22:26:59 +01:00
|
|
|
void bigbprint(int x, int y, std::string s, int r, int g, int b, bool cen = false, int sc = 2);
|
2020-03-31 21:26:11 +02:00
|
|
|
void drawspritesetcol(int x, int y, int t, int c);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void flashlight(void);
|
|
|
|
void screenshake(void);
|
|
|
|
void updatescreenshake(void);
|
2020-04-29 02:29:59 +02:00
|
|
|
|
|
|
|
int screenshake_x;
|
|
|
|
int screenshake_y;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void render(void);
|
|
|
|
void renderwithscreeneffects(void);
|
Fix filter/screenshake/flash update order
In 2.2, at render time, the game rendered screenshakes and flashes if
their timers were above 0, and then decremented them afterwards. The
game would also update the analogue filter right before rendering it,
too.
In 2.3, this was changed so the flash and screenshake timers were
unified, and also done at the end of the frame - right before rendering
happened. This resulted in 1-frame flashes and screenshakes not
rendering at all. The other changes in this patchset don't fix this
either. The analogue filter was also in the wrong order, but that is
less of an issue than flashes and screenshakes.
So, what I've done is made the flash and screenshake timers update right
before the loop switches over to rendering, and only decrements them
when we switch back to fixed functions (after rendering). The analogue
filter is also updated right before rendering as well. This restores
1-frame flashes and screenshakes, as well as restores the correct order
of analogue filter updates.
2021-03-18 01:53:17 +01:00
|
|
|
void renderfixedpre(void);
|
|
|
|
void renderfixedpost(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-04-02 00:35:27 +02:00
|
|
|
bool Hitest(SDL_Surface* surface1, point p1, SDL_Surface* surface2, point p2);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void drawentities(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-11-01 05:38:15 +01:00
|
|
|
void drawentity(const int i, const int yoff);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void drawtrophytext(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void bigrprint(int x, int y, std::string& t, int r, int g, int b, bool cen = false, float sc = 2);
|
2021-03-19 22:28:04 +01:00
|
|
|
void bigbrprint(int x, int y, std::string& t, int r, int g, int b, bool cen = false, float sc = 2);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
|
Fix, for in-GAMEMODE sprites, their colors updating too fast
Okay, so the problem here is that Graphics::setcol() is called right
before a sprite is drawn in a render function, but render functions are
done in deltatime, meaning that the color of a sprite keeps being
recalculated every time. This only affects sprites that use fRandom()
(the other thing that can dynamically determine a color is help.glow,
but that's only updated in the fixed-timestep loop), but is especially
noticeable for sprites that flash wildly, like the teleporter, trinket,
and elephant.
To fix this, we need to make the color be recalculated only in the
fixed-timestep loop. However, this means that we MUST store the color of
the sprite SOMEWHERE for the delta-timesteps to render it, otherwise the
color calculation will just be lost or something.
So each entity now has a new attribute, `realcol`, which is the actual
raw color used to render the sprite in render functions. This is not to
be confused with their `colour` attribute, which is more akin to a color
"ID" of sorts, but which isn't an actual color.
At the end of gamelogic(), as well as when an entity is first created,
the `colour` is given to Graphics::setcol() and then `realcol` gets set
to the actual color. Then when it comes time to render the entity,
`realcol` gets used instead.
Gravitron squares are a somewhat tricky case where there's technically
TWO colors for it - one is the actual sprite itself and the other is the
indicator. However, usually the indicator and the square aren't both
onscreen at the same time, so we can simply switch the realcol between
the two as needed.
However, we can't use this system for the sprite colors used on the
title and map screen, so we'll have to do something else for those.
2020-05-01 02:34:37 +02:00
|
|
|
void drawtele(int x, int y, int t, Uint32 c);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-02-10 03:23:12 +01:00
|
|
|
Uint32 getRGBA(Uint8 r, Uint8 g, Uint8 b, Uint8 a);
|
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
Uint32 getRGB(Uint8 r, Uint8 g, Uint8 b);
|
|
|
|
|
|
|
|
Uint32 getBGR(Uint8 r, Uint8 g, Uint8 b);
|
|
|
|
|
|
|
|
Uint32 getRGB(Uint32 _col);
|
|
|
|
|
|
|
|
Uint32 RGBflip(Uint8 r, Uint8 g, Uint8 b);
|
|
|
|
|
|
|
|
|
|
|
|
Uint32 RGBf(int r, int g, int b);
|
|
|
|
|
|
|
|
void setcolreal(Uint32 t);
|
|
|
|
|
2020-03-31 21:26:11 +02:00
|
|
|
void drawbackground(int t);
|
2020-04-29 04:28:16 +02:00
|
|
|
void updatebackground(int t);
|
2021-03-06 08:55:35 +01:00
|
|
|
#ifndef NO_CUSTOM_LEVELS
|
Make one-way recolors check for specific files
So, 2.3 added recoloring one-way tiles to no longer make them be always
yellow. However, custom levels that retexture the one-way tiles might
not want them to be recolored. So, if there are ANY custom assets
mounted, then the one-ways will not be recolored. However, if the XML
has a <onewaycol_override>1</onewaycol_override> tag, then the one-way
will be recolored again anyways.
When I added one-way recoloring, I didn't intend for any custom asset to
disable the recoloring; I only did it because I couldn't find a way to
check if a specific file was customized by the custom level or not.
However, I have figured out how to do so, and so now tiles.png one-way
recolors will only be disabled if there's a custom tiles.png, and
tiles2.png one-way recolors will only be disabled if there's a custom
tiles2.png.
In order to make sure we're not calling PhysFS functions on every single
deltaframe, I've added caching variables, tiles1_mounted and
tiles2_mounted, to Graphics; these get assigned every time
reloadresources() is called.
2021-03-06 19:52:11 +01:00
|
|
|
bool shouldrecoloroneway(const int tilenum, const bool mounted);
|
2021-03-06 08:55:35 +01:00
|
|
|
#endif
|
2020-08-04 04:13:08 +02:00
|
|
|
void drawtile3( int x, int y, int t, int off, int height_subtract = 0 );
|
2020-04-02 00:47:35 +02:00
|
|
|
void drawtile2( int x, int y, int t );
|
2020-04-02 00:42:22 +02:00
|
|
|
void drawtile( int x, int y, int t );
|
2020-01-01 21:29:24 +01:00
|
|
|
void drawtowertile( int x, int y, int t );
|
2020-11-03 00:05:24 +01:00
|
|
|
void drawtowertile3( int x, int y, int t, TowerBG& bg_obj );
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void drawmap(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
void drawforetile(int x, int y, int t);
|
|
|
|
|
|
|
|
void drawforetile2(int x, int y, int t);
|
|
|
|
|
|
|
|
void drawforetile3(int x, int y, int t, int off);
|
|
|
|
|
|
|
|
void drawrect(int x, int y, int w, int h, int r, int g, int b);
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void drawtowermap(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void drawtowerspikes(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
bool onscreen(int t);
|
2020-06-12 02:56:12 +02:00
|
|
|
|
2021-08-07 05:57:34 +02:00
|
|
|
bool reloadresources(void);
|
Make one-way recolors check for specific files
So, 2.3 added recoloring one-way tiles to no longer make them be always
yellow. However, custom levels that retexture the one-way tiles might
not want them to be recolored. So, if there are ANY custom assets
mounted, then the one-ways will not be recolored. However, if the XML
has a <onewaycol_override>1</onewaycol_override> tag, then the one-way
will be recolored again anyways.
When I added one-way recoloring, I didn't intend for any custom asset to
disable the recoloring; I only did it because I couldn't find a way to
check if a specific file was customized by the custom level or not.
However, I have figured out how to do so, and so now tiles.png one-way
recolors will only be disabled if there's a custom tiles.png, and
tiles2.png one-way recolors will only be disabled if there's a custom
tiles2.png.
In order to make sure we're not calling PhysFS functions on every single
deltaframe, I've added caching variables, tiles1_mounted and
tiles2_mounted, to Graphics; these get assigned every time
reloadresources() is called.
2021-03-06 19:52:11 +01:00
|
|
|
#ifndef NO_CUSTOM_LEVELS
|
|
|
|
bool tiles1_mounted;
|
|
|
|
bool tiles2_mounted;
|
2021-04-19 08:39:10 +02:00
|
|
|
bool minimap_mounted;
|
Make one-way recolors check for specific files
So, 2.3 added recoloring one-way tiles to no longer make them be always
yellow. However, custom levels that retexture the one-way tiles might
not want them to be recolored. So, if there are ANY custom assets
mounted, then the one-ways will not be recolored. However, if the XML
has a <onewaycol_override>1</onewaycol_override> tag, then the one-way
will be recolored again anyways.
When I added one-way recoloring, I didn't intend for any custom asset to
disable the recoloring; I only did it because I couldn't find a way to
check if a specific file was customized by the custom level or not.
However, I have figured out how to do so, and so now tiles.png one-way
recolors will only be disabled if there's a custom tiles.png, and
tiles2.png one-way recolors will only be disabled if there's a custom
tiles2.png.
In order to make sure we're not calling PhysFS functions on every single
deltaframe, I've added caching variables, tiles1_mounted and
tiles2_mounted, to Graphics; these get assigned every time
reloadresources() is called.
2021-03-06 19:52:11 +01:00
|
|
|
#endif
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void menuoffrender(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-11-03 00:05:24 +01:00
|
|
|
void drawtowerbackground(const TowerBG& bg_obj);
|
|
|
|
void updatetowerbackground(TowerBG& bg_obj);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-03-31 21:26:11 +02:00
|
|
|
void setcol(int t);
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void drawfinalmap(void);
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
colourTransform ct;
|
|
|
|
|
2020-11-02 22:02:51 +01:00
|
|
|
int rcol;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-06-14 20:21:32 +02:00
|
|
|
int m;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
std::vector <SDL_Surface*> images;
|
|
|
|
|
|
|
|
std::vector <SDL_Surface*> tele;
|
|
|
|
std::vector <SDL_Surface*> tiles;
|
|
|
|
std::vector <SDL_Surface*> tiles2;
|
|
|
|
std::vector <SDL_Surface*> tiles3;
|
|
|
|
std::vector <SDL_Surface*> entcolours;
|
|
|
|
std::vector <SDL_Surface*> sprites;
|
|
|
|
std::vector <SDL_Surface*> flipsprites;
|
|
|
|
std::vector <SDL_Surface*> bfont;
|
|
|
|
std::vector <SDL_Surface*> flipbfont;
|
|
|
|
|
|
|
|
bool flipmode;
|
|
|
|
bool setflipmode;
|
2020-01-17 18:37:53 +01:00
|
|
|
bool notextoutline;
|
2020-01-01 21:29:24 +01:00
|
|
|
//buffer objects. //TODO refactor buffer objects
|
|
|
|
SDL_Surface* backBuffer;
|
|
|
|
Screen* screenbuffer;
|
|
|
|
SDL_Surface* menubuffer;
|
2020-01-11 01:37:23 +01:00
|
|
|
SDL_Surface* foregroundBuffer;
|
2020-01-01 21:29:24 +01:00
|
|
|
SDL_Surface* tempBuffer;
|
2020-11-03 01:54:17 +01:00
|
|
|
SDL_Surface* warpbuffer;
|
|
|
|
SDL_Surface* warpbuffer_lerp;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-11-03 00:05:24 +01:00
|
|
|
TowerBG towerbg;
|
2020-11-03 00:23:53 +01:00
|
|
|
TowerBG titlebg;
|
2020-11-03 00:05:24 +01:00
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
SDL_Rect bfont_rect;
|
|
|
|
SDL_Rect tiles_rect;
|
|
|
|
SDL_Rect sprites_rect;
|
|
|
|
SDL_Rect images_rect;
|
|
|
|
SDL_Rect bg_rect;
|
|
|
|
SDL_Rect line_rect;
|
|
|
|
SDL_Rect tele_rect;
|
2020-11-02 19:44:53 +01:00
|
|
|
SDL_Rect towerbuffer_rect;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
SDL_Rect foot_rect;
|
|
|
|
SDL_Rect prect;
|
|
|
|
SDL_Rect footerrect;
|
2020-01-25 05:32:55 +01:00
|
|
|
SDL_Surface* footerbuffer;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
int linestate, linedelay;
|
|
|
|
int backoffset;
|
|
|
|
bool backgrounddrawn, foregrounddrawn;
|
|
|
|
|
|
|
|
int menuoffset;
|
2020-04-29 05:46:33 +02:00
|
|
|
int oldmenuoffset;
|
2020-01-01 21:29:24 +01:00
|
|
|
bool resumegamemode;
|
|
|
|
|
|
|
|
SDL_Rect warprect;
|
|
|
|
|
|
|
|
int crewframe;
|
|
|
|
int crewframedelay;
|
|
|
|
|
|
|
|
int fademode;
|
|
|
|
int fadeamount;
|
2020-04-29 03:10:40 +02:00
|
|
|
int oldfadeamount;
|
2020-07-03 11:40:57 +02:00
|
|
|
int fadebars[15];
|
2021-03-20 07:23:18 +01:00
|
|
|
int ingame_fademode;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
bool trinketcolset;
|
|
|
|
int trinketr, trinketg, trinketb;
|
|
|
|
|
|
|
|
std::vector <textboxclass> textbox;
|
|
|
|
|
|
|
|
bool showcutscenebars;
|
|
|
|
int cutscenebarspos;
|
2020-04-29 02:16:24 +02:00
|
|
|
int oldcutscenebarspos;
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-07-03 11:31:13 +02:00
|
|
|
static const int numstars = 50;
|
|
|
|
SDL_Rect stars[numstars];
|
|
|
|
int starsspeed[numstars];
|
2020-01-01 21:29:24 +01:00
|
|
|
|
2020-07-03 11:31:13 +02:00
|
|
|
static const int numbackboxes = 18;
|
2020-01-01 21:29:24 +01:00
|
|
|
int spcol, spcoldel;
|
2020-07-03 11:31:13 +02:00
|
|
|
SDL_Rect backboxes[numbackboxes];
|
|
|
|
int backboxvx[numbackboxes];
|
|
|
|
int backboxvy[numbackboxes];
|
|
|
|
float backboxint[numbackboxes];
|
2020-01-01 21:29:24 +01:00
|
|
|
|
|
|
|
int warpskip, warpfcol, warpbcol;
|
|
|
|
|
2020-01-25 05:43:04 +01:00
|
|
|
bool translucentroomname;
|
2020-01-29 08:17:13 +01:00
|
|
|
|
2020-01-31 19:25:37 +01:00
|
|
|
std::map<int, int> font_positions;
|
Add a player trail to the editor (ghosts)
A few months ago, I added ghosts to the VVVVVV: Community Edition editor. I was told recently I should think
about upstreaming it, and with Terry saying go ahead I finally ported them into VVVVVV. There's one slight
difference however--you can choose whether you have them or not in the editor's settings menu. They're off by
default, and this is saved to the save file.
Anyway, when you're playtesting, the game saves the players position, color, room coordinates and sprite every 3
frames. The max is 100, where if it tries to add more, the oldest one gets removed.
When you exit playtesting, the saved positions appear one at a time, and you can use the Z key to speed it up.
[Here's a video of them in action.](https://o.lol-sa.me/4H21zCv.mp4)
2020-06-13 00:04:35 +02:00
|
|
|
|
2020-06-13 00:20:39 +02:00
|
|
|
SDL_Surface* ghostbuffer;
|
2020-04-29 01:02:55 +02:00
|
|
|
|
|
|
|
float inline lerp(const float v0, const float v1)
|
|
|
|
{
|
|
|
|
return v0 + alpha * (v1 - v0);
|
|
|
|
}
|
|
|
|
float alpha;
|
2020-05-02 01:40:35 +02:00
|
|
|
|
|
|
|
Uint32 col_crewred;
|
|
|
|
Uint32 col_crewyellow;
|
|
|
|
Uint32 col_crewgreen;
|
|
|
|
Uint32 col_crewcyan;
|
|
|
|
Uint32 col_crewblue;
|
|
|
|
Uint32 col_crewpurple; //actually pink
|
|
|
|
Uint32 col_crewinactive;
|
|
|
|
Uint32 col_clock;
|
|
|
|
Uint32 col_trinket;
|
|
|
|
int col_tr;
|
|
|
|
int col_tg;
|
|
|
|
int col_tb;
|
Explicitly declare void for all void parameter functions (#628)
Apparently in C, if you have `void test();`, it's completely okay to do
`test(2);`. The function will take in the argument, but just discard it
and throw it away. It's like a trash can, and a rude one at that. If you
declare it like `void test(void);`, this is prevented.
This is not a problem in C++ - doing `void test();` and `test(2);` is
guaranteed to result in a compile error (this also means that right now,
at least in all `.cpp` files, nobody is ever calling a void parameter
function with arguments and having their arguments be thrown away).
However, we may not be using C++ in the future, so I just want to lay
down the precedent that if a function takes in no arguments, you must
explicitly declare it as such.
I would've added `-Wstrict-prototypes`, but it produces an annoying
warning message saying it doesn't work in C++ mode if you're compiling
in C++ mode. So it can be added later.
2021-02-25 23:23:59 +01:00
|
|
|
void updatetitlecolours(void);
|
2020-05-02 21:06:40 +02:00
|
|
|
|
|
|
|
bool kludgeswnlinewidth;
|
2020-05-02 22:53:19 +02:00
|
|
|
|
|
|
|
Uint32 crewcolourreal(int t);
|
2021-08-07 05:57:34 +02:00
|
|
|
|
|
|
|
char error[128];
|
|
|
|
char error_title[128]; /* for SDL_ShowSimpleMessageBox */
|
2020-01-01 21:29:24 +01:00
|
|
|
};
|
|
|
|
|
2020-09-28 04:15:06 +02:00
|
|
|
#ifndef GRAPHICS_DEFINITION
|
Allow using help/graphics/music/game/key/map/obj everywhere
This commit makes `help`, `graphics`, `music`, `game`, `key`, `map`, and
`obj` essentially static global objects that can be used everywhere.
This is useful in case we ever need to add a new function in the future,
so we don't have to bother with passing a new argument in which means we
have to pass a new argument in to the function that calls that function
which means having to pass a new argument into the function that calls
THAT function, etc. which is a real headache when working on fan mods of
the source code.
Note that this changes NONE of the existing function signatures, it
merely just makes those variables accessible everywhere in the same way
`script` and `ed` are.
Also note that some classes had to be initialized after the filesystem
was initialized, but C++ would keep initializing them before the
filesystem got initialized, because I *had* to put them at the top of
`main.cpp`, or else they wouldn't be global variables.
The only way to work around this was to use entityclass's initialization
style (which I'm pretty sure entityclass of all things doesn't need to
be initialized this way), where you actually initialize the class in an
`init()` function, and so then you do `graphics.init()` after the
filesystem initialization, AFTER doing `Graphics graphics` up at the
top.
I've had to do this for `graphics` (but only because its child
GraphicsResources `grphx` needs to be initialized this way), `music`,
and `game`. I don't think this will affect anything. Other than that,
`help`, `key`, and `map` are still using the C++-intended method of
having ClassName::ClassName() functions.
2020-01-29 08:35:03 +01:00
|
|
|
extern Graphics graphics;
|
2020-09-28 04:15:06 +02:00
|
|
|
#endif
|
Allow using help/graphics/music/game/key/map/obj everywhere
This commit makes `help`, `graphics`, `music`, `game`, `key`, `map`, and
`obj` essentially static global objects that can be used everywhere.
This is useful in case we ever need to add a new function in the future,
so we don't have to bother with passing a new argument in which means we
have to pass a new argument in to the function that calls that function
which means having to pass a new argument into the function that calls
THAT function, etc. which is a real headache when working on fan mods of
the source code.
Note that this changes NONE of the existing function signatures, it
merely just makes those variables accessible everywhere in the same way
`script` and `ed` are.
Also note that some classes had to be initialized after the filesystem
was initialized, but C++ would keep initializing them before the
filesystem got initialized, because I *had* to put them at the top of
`main.cpp`, or else they wouldn't be global variables.
The only way to work around this was to use entityclass's initialization
style (which I'm pretty sure entityclass of all things doesn't need to
be initialized this way), where you actually initialize the class in an
`init()` function, and so then you do `graphics.init()` after the
filesystem initialization, AFTER doing `Graphics graphics` up at the
top.
I've had to do this for `graphics` (but only because its child
GraphicsResources `grphx` needs to be initialized this way), `music`,
and `game`. I don't think this will affect anything. Other than that,
`help`, `key`, and `map` are still using the C++-intended method of
having ClassName::ClassName() functions.
2020-01-29 08:35:03 +01:00
|
|
|
|
2020-01-01 21:29:24 +01:00
|
|
|
#endif /* GRAPHICS_H */
|