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

Constants for the size (in bytes) and length (in pixels) of a tile #49

Open
Rangi42 opened this issue Dec 11, 2024 · 5 comments
Open

Constants for the size (in bytes) and length (in pixels) of a tile #49

Rangi42 opened this issue Dec 11, 2024 · 5 comments

Comments

@Rangi42
Copy link
Contributor

Rangi42 commented Dec 11, 2024

A tile in VRAM is 8x8 pixels, so 16 bytes at 2 bits per pixel. Constants for these measurements would be useful, and would pair well with the screen-size constants.

@ISSOtm
Copy link
Member

ISSOtm commented Dec 11, 2024

I'd use “width” and “height” for the names; even if those are both intrinsically the same, they 1. provide extra semantic value, and 2. are much more distinguishable from “size” (which is very often used interchangeably with “length”).

@Rangi42
Copy link
Contributor Author

Rangi42 commented Dec 11, 2024

Maybe just provide TILE_WIDTH, so a redundant TILE_HEIGHT doesn't cause confusion ("wait, is there ever a circumstance where width as opposed to height matters?") or a split over which one to conventionally use.

@Rangi42
Copy link
Contributor Author

Rangi42 commented Dec 11, 2024

As well as TILE_SIZE_B for the size in bytes (16), which matches SCRN_X_B, SCRN_VY_B, etc.

@ISSOtm
Copy link
Member

ISSOtm commented Dec 12, 2024

There won't be a split, the height will be used for heights and width for width. They are not redundant merely because they are identical, otherwise we would define def EIGHT equ 8.

@Rangi42
Copy link
Contributor Author

Rangi42 commented Dec 12, 2024

They would be redundant because squares have one side length that describes both their width and height. We just want to avoid calling it "length" to avoid confusion over the "byte length".

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

No branches or pull requests

2 participants