mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-06-29 08:22:51 +00:00
shots:: postprocessing hooks
This commit is contained in:
parent
f2efc6f295
commit
1a245b2523
@ -686,7 +686,7 @@ EX SDL_Surface *empty_surface(int x, int y, bool alpha) {
|
|||||||
|
|
||||||
#if CAP_PNG
|
#if CAP_PNG
|
||||||
|
|
||||||
void output(SDL_Surface* s, const string& fname) {
|
EX void output(SDL_Surface* s, const string& fname) {
|
||||||
if(format == screenshot_format::rawfile) {
|
if(format == screenshot_format::rawfile) {
|
||||||
for(int y=0; y<shoty; y++)
|
for(int y=0; y<shoty; y++)
|
||||||
ignore(write(rawfile_handle, &qpixel(s, 0, y), 4 * shotx));
|
ignore(write(rawfile_handle, &qpixel(s, 0, y), 4 * shotx));
|
||||||
@ -695,7 +695,10 @@ void output(SDL_Surface* s, const string& fname) {
|
|||||||
IMAGESAVE(s, fname.c_str());
|
IMAGESAVE(s, fname.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EX hookset<bool(string, SDL_Surface*, SDL_Surface*)> hooks_postprocess;
|
||||||
|
|
||||||
EX void postprocess(string fname, SDL_Surface *sdark, SDL_Surface *sbright) {
|
EX void postprocess(string fname, SDL_Surface *sdark, SDL_Surface *sbright) {
|
||||||
|
if(callhandlers(false, hooks_postprocess, fname, sdark, sbright)) return;
|
||||||
if(gamma == 1 && shot_aa == 1 && sdark == sbright) {
|
if(gamma == 1 && shot_aa == 1 && sdark == sbright) {
|
||||||
output(sdark, fname);
|
output(sdark, fname);
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user