-
Notifications
You must be signed in to change notification settings - Fork 146
Implement Texture Scrolling Interpolation #969
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
base: main
Are you sure you want to change the base?
Changes from all commits
5c619a6
9b0f64e
9823a31
7ca3396
32f7624
821da46
65fbb65
70dcf22
745c51e
64c07ed
8847847
da214d5
cbfcd4d
84a9c9f
cf32cf6
8291c19
950baa3
8459c4b
cef2f6e
0f3b1fd
d5564c3
7a4848d
9916e59
03cbe7d
306d624
49e33be
427bfc1
7aea5cf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -68,8 +68,7 @@ constexpr int8_t OTR_G_REGBLENDEDTEX = OPCODE(0x3f); | |
| constexpr int8_t OTR_G_SETINTENSITY = OPCODE(0x40); | ||
| constexpr int8_t OTR_G_MOVEMEM_HASH = OPCODE(0x42); | ||
| constexpr int8_t OTR_G_LOAD_SHADER = OPCODE(0x43); | ||
| constexpr int8_t RDP_G_SETTILESIZE_INTERP = OPCODE(0x44); | ||
| constexpr int8_t RDP_G_SETTARGETINTERPINDEX = OPCODE(0x45); | ||
| constexpr int8_t RDP_G_SCROLL_TEXTURE = OPCODE(0x44); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is very much a breaking change. i'd want to either see a migration guide for people using the previous opcode defs or for this to be handled in a non-breaking way |
||
|
|
||
| /* | ||
| * The following commands are the "generated" RDP commands; the user | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -190,8 +190,7 @@ | |
| #define G_READFB 0x3e | ||
| #define G_SETINTENSITY 0x40 | ||
| #define G_LOAD_SHADER 0x43 | ||
| #define G_SETTILESIZE_INTERP 0x44 | ||
| #define G_SETTARGETINTERPINDEX 0x45 | ||
| #define G_SCROLL_TEXTURE 0x44 | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| /* | ||
| * The following commands are the "generated" RDP commands; the user | ||
|
|
@@ -3213,16 +3212,27 @@ typedef union Gfx { | |
| _SHIFTL(tile, 24, 3) | _SHIFTL(lrs, 12, 12) | _SHIFTL(lrt, 0, 12) \ | ||
| } | ||
|
|
||
| #define gDPSetInterpolation(pkt, index) \ | ||
| _DW({ \ | ||
| Gfx* _g = (Gfx*)(pkt); \ | ||
| \ | ||
| _g->words.w0 = G_SETTARGETINTERPINDEX << 24; \ | ||
| _g->words.w1 = index; \ | ||
| #define gDPScrollTexture(pkt, t, uls, ult, lrs, lrt, stepX, stepY) \ | ||
| _DW({ \ | ||
| Gfx* _g = (Gfx*)(pkt); \ | ||
| if (pkt) \ | ||
| ; \ | ||
| _g->words.w0 = (_SHIFTL(G_SCROLL_TEXTURE, 24, 8) | _SHIFTL(tile, 0, 12)); \ | ||
| _g->words.w1 = (_SHIFTL(stepX, 32, 32) | _SHIFTL(stepY, 0, 32)); \ | ||
| _g++; \ | ||
| _g->words.w0 = (_SHIFTL(uls, 32, 32) | _SHIFTL(ult, 0, 32)); \ | ||
| _g->words.w1 = (_SHIFTL(lrs, 32, 32) | _SHIFTL(lrt, 0, 32)); \ | ||
| }) | ||
|
|
||
| #define __gDPSetTileSizeInterp(pkt, t, uls, ult, lrs, lrt) \ | ||
| gDPLoadTileGeneric(pkt, G_SETTILESIZE_INTERP, t, uls, ult, lrs, lrt) | ||
| #define gsDPScrollTexture(t, uls, ult, lrs, lrt, stepX, stepY) \ | ||
| { \ | ||
| (_SHIFTL(G_SCROLL_TEXTURE, 24, 8) | _SHIFTL(tile, 0, 12)), \ | ||
| (_SHIFTL(stepX, 32, 32) | _SHIFTL(stepY, 0, 32)), \ | ||
| }, \ | ||
| { \ | ||
| (_SHIFTL(uls, 32, 32) | _SHIFTL(ult, 0, 32)), (_SHIFTL(lrs, 32, 32) | _SHIFTL(lrt, 0, 32)), \ | ||
| } | ||
|
|
||
|
Comment on lines
-3216
to
+3235
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| #define gDPSetTileSize(pkt, t, uls, ult, lrs, lrt) gDPLoadTileGeneric(pkt, G_SETTILESIZE, t, uls, ult, lrs, lrt) | ||
| #define gsDPSetTileSize(t, uls, ult, lrs, lrt) gsDPLoadTileGeneric(G_SETTILESIZE, t, uls, ult, lrs, lrt) | ||
| #define gDPLoadTile(pkt, t, uls, ult, lrs, lrt) gDPLoadTileGeneric(pkt, G_LOADTILE, t, uls, ult, lrs, lrt) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -81,6 +81,7 @@ class Window { | |||||
| int32_t GetMouseCaptureScancode(); | ||||||
| void SetFullscreenScancode(int32_t scancode); | ||||||
| void SetMouseCaptureScancode(int32_t scancode); | ||||||
| uint64_t mFrameCount; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tidy is right to be mad about this. it shouldn't be public. make it private and add a public getter and from what i can tell you should be able to use a protected setter |
||||||
|
|
||||||
| protected: | ||||||
| void SetWindowBackend(WindowBackend backend); | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -206,6 +206,7 @@ bool Fast3dWindow::DrawAndRunGraphicsCommands(Gfx* commands, const std::unordere | |
| } | ||
|
|
||
| void Fast3dWindow::HandleEvents() { | ||
| mFrameCount += 1; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this in |
||
| mWindowManagerApi->HandleEvents(); | ||
| } | ||
|
|
||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tons of breaking changes in here, same comment as https://github.com/Kenix3/libultraship/pull/969/changes#r2678862060 |
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.
we need to verify no ports are relying on being able to pass in negative values here
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 interpolation index is generally a value from 0-16