-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C;C LCC character fading #109
base: master
Are you sure you want to change the base?
C;C LCC character fading #109
Conversation
@@ -18,6 +18,8 @@ root.Vm = { | |||
UseReturnIds = true, | |||
ScrWorkChaStructSize = 40, | |||
ScrWorkBgStructSize = 40, | |||
ScrWorkCaptureStructSize = 20, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cclcc has differently sized capture struct to CC?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually C;C's the one that needs to be 20 as well whoops
src/background2d.cpp
Outdated
std::fill(Layers.begin(), Layers.end(), -1); | ||
} | ||
|
||
bool Background2D::OnLayer(int layer) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably just define this in the header file, it's small enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
src/background2d.h
Outdated
@@ -5,8 +5,7 @@ | |||
#include "spritesheet.h" | |||
#include "loadable.h" | |||
|
|||
#define BackgroundRenderer(name) \ | |||
void name(Background2D* bg, int bgId, glm::vec4 col) | |||
#define BackgroundRenderer(name) void name(Background2D* bg, glm::vec4 col) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we really need this macro now, especially since we can make these functions member functions and they only have one arg anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the issue is mostly with the function table at the bottom of the file. If we make them member functions, each instance would have to haul its own render table as well
We could also replace the function table with a delegation method
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The render table just needs to be a static variable inside the class, it actually shouldn't be static in the header in the first place, since that recreates the table in every translation unit, I'll push a change for it.
@@ -355,6 +396,17 @@ void Render() { | |||
} | |||
} | |||
|
|||
for (size_t capId = 0; capId <= 1; capId++) { | |||
if (!GetFlag(SF_CAP1DISP + capId)) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be 1 and not MaxScreenCaptures here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, missed that one
2e6ef1a
to
73b8d60
Compare
c88e411
to
62d60d0
Compare
Implements character sprite fading support for C;C LCC.