Skip to content

draw static sprites#21

Draft
facundoolano wants to merge 10 commits into
minifb2from
draw_statics
Draft

draw static sprites#21
facundoolano wants to merge 10 commits into
minifb2from
draw_statics

Conversation

@facundoolano
Copy link
Copy Markdown
Collaborator

still has bugs with sprite sizes and angle handling

@facundoolano facundoolano marked this pull request as draft March 7, 2022 01:35
Comment thread src/cache.rs

pub fn get_sprite(&self, index: usize) -> &(CompShape, Vec<u8>) {
&self.sprites[index]
&self.sprites[index - 21]
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does this magic number mean?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

for some reason there's an offset between the number stored in the map tiles and the picnum in the sprites file. In wolf4sdl it's 23, and the extra +2 I don't remember where it's coming from, but it was necessary for it to match with the correct sprite. (we should make these constants)

Comment thread src/constants.rs
Comment on lines +17 to +18
// where does this value come from?
pub const TILE_SIZE: f64 = 4.8;
Copy link
Copy Markdown

@tsvehagen tsvehagen Mar 8, 2022

Choose a reason for hiding this comment

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

I'm also quite interested in the calculations behind this value :p

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

iirc this was 4 in the initial implementation by @qhool. Not sure how he came up with that number, but the walls looked a bit short so I increased it in a previous PR until it seemed to roughly match the original game (there may be some accurate way to come up with this number)

@dannykansas dannykansas added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Sep 20, 2023
@dannykansas dannykansas self-requested a review September 20, 2023 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants