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

flip/rotate broken on latest versions #2016

Closed
msx80 opened this issue Sep 29, 2022 · 7 comments
Closed

flip/rotate broken on latest versions #2016

msx80 opened this issue Sep 29, 2022 · 7 comments
Labels

Comments

@msx80
Copy link
Contributor

msx80 commented Sep 29, 2022

Hi there, the combination of flip and rotate is broken in 1.0.x. It was working on 0.90.
Affected games that i know of: Warm wheels, Secret Agents.

Test case:

function TIC()
 cls(0)
 for i=0,3 do
   for j=0,3 do
     spr(0,i*10,j*10,14,1,j,i)
   end
 end
end

On 0.9.something:

image

On 1.0.something:

image

@jgengelhardt
Copy link

jgengelhardt commented Oct 4, 2022

I've tested this. Flip is fine; rotate 1 and 3 don't work, while 2 does.

@borbware
Copy link
Contributor

borbware commented Oct 4, 2022

I noticed the same recently. It's also broken on map()'s remap functions:

0.90:
video21

1.0:
video20

@borbware
Copy link
Contributor

borbware commented Nov 8, 2022

@nesbox any ideas what might have broken this?

@joshgoebel joshgoebel added the bug label Dec 4, 2022
@Gabby-Paolucci
Copy link

Gabby-Paolucci commented Jan 1, 2023

Ah, this is the problem! It will be great to have this bug fixed.

@Podepi
Copy link
Contributor

Podepi commented Jan 3, 2023

So the issue appears to be that someone wrote the wrong number when converting from binary to decimal on line 158 in src/core/draw.c
orientation |= 0b100 became orientation |= 2 instead of orientation |= 4
It's a simple fix, but I've never contributed to a git repository before so I'm not sure what to do. Do I just make a pull request with that single line changed?

@borbware
Copy link
Contributor

borbware commented Jan 3, 2023

So that's the issue! To contribute a fix, make a fork of the repo, change the line (and make a build so you can confirm the change fixes the issue), make a commit (mention "fixes #2016" or something), and then make a pull request where you also mention this issue #2016. That should do the trick!

@joshgoebel
Copy link
Collaborator

Yes someone whip up a PR please and I'm happy to approve.

Was this decimal conversion done for some very old compilers? If so, we really probably should have a file full of just binary constants (or at least the small ones) to cover this instead of doing manual conversions.

@nesbox nesbox closed this as completed in 474dcf8 Jan 12, 2023
nesbox added a commit that referenced this issue Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants