Skip to content
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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

PringlesGang
Copy link
Contributor

Implements character sprite fading support for C;C LCC.

@@ -18,6 +18,8 @@ root.Vm = {
UseReturnIds = true,
ScrWorkChaStructSize = 40,
ScrWorkBgStructSize = 40,
ScrWorkCaptureStructSize = 20,
Copy link
Collaborator

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?

Copy link
Contributor Author

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

std::fill(Layers.begin(), Layers.end(), -1);
}

bool Background2D::OnLayer(int layer) {
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay

@@ -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)
Copy link
Collaborator

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

Copy link
Contributor Author

@PringlesGang PringlesGang Feb 8, 2025

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

Copy link
Collaborator

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;
Copy link
Collaborator

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, missed that one

@PringlesGang PringlesGang force-pushed the cclcc-character-fading branch from 2e6ef1a to 73b8d60 Compare February 8, 2025 17:06
@KKhanhH KKhanhH force-pushed the cclcc-character-fading branch from c88e411 to 62d60d0 Compare February 8, 2025 23:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants