-
Notifications
You must be signed in to change notification settings - Fork 56
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
base: master
Are you sure you want to change the base?
Occlude the cursor when covered by tiles #198
Conversation
merge after #187 (because this branch is a sub branch of that PR) |
|
||
// Check the tiles in front of the cursor | ||
bool occludeCursor = false; | ||
for (int i : {3, 4, 5}) { |
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 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]) || |
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 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.
Honestly, we should scrap this PR in favor of doing #202 |
Fixes #195
Makes it easier to tell where the cursor is.
![image](https://private-user-images.githubusercontent.com/92821989/410587349-b8fda992-56e0-44aa-9c8f-e7af07e659d2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1OTM4NzQsIm5iZiI6MTczOTU5MzU3NCwicGF0aCI6Ii85MjgyMTk4OS80MTA1ODczNDktYjhmZGE5OTItNTZlMC00NGFhLTljOGYtZTdhZjA3ZTY1OWQyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE1VDA0MjYxNFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWIzMTQ1MjRhY2I1ZjkxMGExYTJlMGEzZjk0YWMwZTAzMTYwYzUzZTY1NGFkZjIwYTkxNzI4MGZlZTZhOTY5N2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.TN2p7vMXQZLLSrfFLUNU24MZpFE5kBRaLTRJ1yLVh3c)
Makes it use this top half cursor: