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

Occlude the cursor when covered by tiles #198

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

realSquidCoder
Copy link
Collaborator

Fixes #195

Makes it easier to tell where the cursor is.
Makes it use this top half cursor:
image

@realSquidCoder
Copy link
Collaborator Author

realSquidCoder commented Feb 6, 2025

merge after #187 (because this branch is a sub branch of that PR)

@realSquidCoder realSquidCoder marked this pull request as ready for review February 6, 2025 18:22

// Check the tiles in front of the cursor
bool occludeCursor = false;
for (int i : {3, 4, 5}) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I would recommend against using a copy of the dirs array used in SegmentProcessing, as it stores more directions than needed as well as being specialized for border calculations. Instead I would recommend an implementation similar to the following:

Tile* temp;
for (const dirRelative& dir : {eRight, eDownRight, eDown}) {
    temp = segment->getTileRelativeTo(cursor.x, cursor.y, cursor.z, dir);
    if (!temp)
        continue;
    // Do whatever checks are needed
}

continue;
}
int shape = dirs[i]->tileShapeBasic();
if (isObscuring(dirs[i]) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

The checks on tileShapeBasic likely make sense to be moved into your isObscuring function.
Additionally, the name of the function may be misleading as the method doesn't check if the cursor is obscuring a tile, but rather if the tile is obscuring the cursor.

@realSquidCoder
Copy link
Collaborator Author

Honestly, we should scrap this PR in favor of doing #202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Selection cursor occlusion
2 participants