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

move prerender hook back to original position #6

Open
wants to merge 1 commit into
base: sdl2
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions g_src/graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ void graphicst::addcoloredst(const char *str,const char *colorstr)
screenx=0;
if (s >= slen) break;
}

changecolor((colorstr[s] & 7),((colorstr[s] & 56))>>3,((colorstr[s] & 64))>>6);
addchar(str[s]);
}
Expand Down Expand Up @@ -332,7 +332,7 @@ void graphicst::addst_flag(const string &str_orig, justification just, int space
screenx=0;
if(s>=str.length())break;
}

addchar_flag(str[s],1,sflag);
}
}
Expand All @@ -354,7 +354,7 @@ void graphicst::addst(const string &str_orig, justification just, int space)
screenx=0;
if(s>=str.length())break;
}

addchar(str[s]);
}
/*
Expand Down Expand Up @@ -412,7 +412,7 @@ void graphicst::top_addst_flag(const string &str_orig, justification just, int s
screenx=0;
if(s>=str.length())break;
}

top_addchar_flag(str[s],1,sflag);
}
}
Expand All @@ -434,7 +434,7 @@ void graphicst::top_addst(const string &str_orig, justification just, int space)
screenx=0;
if(s>=str.length())break;
}

top_addchar(str[s]);
}
/*
Expand Down Expand Up @@ -490,7 +490,7 @@ void graphicst::erasescreen_clip()
}

void graphicst::erasescreen_rect(int x1, int x2, int y1, int y2)
{
{
changecolor(0,0,0);
for (int x = x1; x <= x2; x++) {
for (int y = y1; y <= y2; y++) {
Expand Down Expand Up @@ -1082,22 +1082,23 @@ void render_things()
//GRAB CURRENT SCREEN AT THE END OF THE LIST
viewscreenst *currentscreen=&gview.view;
while(currentscreen->child!=NULL)currentscreen=currentscreen->child;

//NO INTERFACE LEFT, LEAVE
if(currentscreen==&gview.view)
{
enabler.must_do_render_things_before_display=false;
return;
}

hooks_prerender();

if(currentscreen->breakdownlevel==INTERFACE_BREAKDOWN_NONE)
{
currentscreen->render();
}
else gps.erasescreen();

// allow external code to render over the screen
hooks_prerender();

// Render REC when recording macros. Definitely want this screen-specific. Or do we?
const Time now = SDL_GetTicks();
if (enabler.is_recording() && now % 1000 > 500) {
Expand Down Expand Up @@ -1578,7 +1579,7 @@ void graphicst::copy_pixel_data_with_alpha_mask(SDL_Surface *src,SDL_Surface *al
}
}
}

void graphicst::copy_transformed_pixel_data(SDL_Surface *src,SDL_Surface *dst,int32_t cw_rotate,bool flip_vert)
{
//assumes both surfaces are locked, same dimensions for src/dst, square
Expand Down Expand Up @@ -2019,7 +2020,7 @@ void graphicst::create_derived_textures()
if(color!=NULL)
{
SDL_LockSurface(color);

switch(i)
{
case 0:copy_transformed_pixel_data(tex,color,0,true);break;
Expand Down Expand Up @@ -2060,7 +2061,7 @@ void graphicst::create_derived_textures()
if(color!=NULL)
{
SDL_LockSurface(color);

switch(i)
{
case 0:copy_transformed_pixel_data(tex,color,180,true);break;
Expand Down Expand Up @@ -2101,7 +2102,7 @@ void graphicst::create_derived_textures()
if(color!=NULL)
{
SDL_LockSurface(color);

switch(i)
{
case 0:copy_transformed_pixel_data(tex,color,90,false);break;
Expand Down Expand Up @@ -2140,7 +2141,7 @@ void graphicst::create_derived_textures()
if(color!=NULL)
{
SDL_LockSurface(color);

switch(i)
{
case 0:copy_transformed_pixel_data(tex,color,90,false);break;
Expand Down Expand Up @@ -4733,7 +4734,7 @@ void graphicst::create_derived_textures()
{
SDL_LockSurface(tex);
SDL_LockSurface(color);

copy_transformed_pixel_data(tex,color,0,false);

SDL_UnlockSurface(color);
Expand All @@ -4755,7 +4756,7 @@ void graphicst::create_derived_textures()
{
SDL_LockSurface(tex);
SDL_LockSurface(color);

copy_transformed_pixel_data(tex,color,0,false);

SDL_UnlockSurface(color);
Expand Down