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

Reverse JPegCompress plugin #782

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

yukani
Copy link
Collaborator

@yukani yukani commented Oct 5, 2024

reimplemented d3dx/libjpeg shit with wic

@yukani yukani added the tested This PR has been tested and is ready to be merged label Oct 5, 2024
@yukani yukani requested a review from Pirulax October 5, 2024 22:46
IWICBitmapFrameEncode* frame{};
GUID format{ GUID_WICPixelFormat24bppBGR };

#define HRCHK(hr) if (FAILED((hr))) { NOTSA_LOG_ERR("Couldn't encode screenshot. Your capture is not saved."); return; }
Copy link
Collaborator

Choose a reason for hiding this comment

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

"Couldn't encode screenshot." might be misleading. I'd also include the status in the message.
Or perhaps just use VERIFY (or WIN_VERIFY? not sure)

source/game_sa/Plugins/JPegCompressPlugin/JPegCompress.cpp Outdated Show resolved Hide resolved
source/game_sa/Plugins/JPegCompressPlugin/JPegCompress.cpp Outdated Show resolved Hide resolved

// 0x5D07A0 - unused
bool JPegDecompressToVramFromBuffer(RwRaster* raster, uint8** unk) {
static auto s_ScreenshotFileBuf = StaticRef<std::array<uint8, 204'800>>(0xBD0B78);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to use GTA's buffer here?
Or we can use our own?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we can but why

void JPegDecompressToRaster(RwRaster* raster, struct jpeg_source_mgr& src);
void JPegDecompressToVramFromBuffer(RwRaster* raster, RwInt8** unk);
// 0x5D07A0
bool JPegDecompressToVramFromBuffer(RwRaster* raster, uint8** unk);
Copy link
Collaborator

Choose a reason for hiding this comment

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

might as well just use byte instead

@Pirulax
Copy link
Collaborator

Pirulax commented Oct 13, 2024

I just noticed that the sole reason of you adding wil was because of the smart pointers lol
Anyways, when you asked i thought you were referring to windows imaging library :D
But it's fine, you've already spent the time on implementing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tested This PR has been tested and is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants