mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-16 22:20:01 +01:00
ref_soft: Add OpenMP for blit and 2d draw
This commit is contained in:
parent
bf0d694c71
commit
932ad73441
10
r_draw.c
10
r_draw.c
@ -65,7 +65,7 @@ Draw_StretchPicImplementation
|
||||
*/
|
||||
void R_DrawStretchPicImplementation (int x, int y, int w, int h, int s1, int t1, int s2, int t2, image_t *pic)
|
||||
{
|
||||
pixel_t *dest, *source;
|
||||
pixel_t *source, *dest;
|
||||
unsigned int v, u, sv;
|
||||
unsigned int height;
|
||||
unsigned int f, fstep;
|
||||
@ -104,8 +104,13 @@ void R_DrawStretchPicImplementation (int x, int y, int w, int h, int s1, int t1,
|
||||
|
||||
dest = vid.buffer + y * vid.rowbytes + x;
|
||||
|
||||
for (v=0 ; v<height ; v++, dest += vid.rowbytes)
|
||||
|
||||
#pragma omp parallel for schedule(static)
|
||||
for (v=0 ; v<height ; v++)
|
||||
{
|
||||
#ifdef _OPENMP
|
||||
pixel_t *dest = vid.buffer + (y + v) * vid.rowbytes + x;
|
||||
#endif
|
||||
sv = (skip + v)*(t2-t1)/h + t1;
|
||||
source = pic->pixels[0] + sv*pic->width + s1;
|
||||
{
|
||||
@ -161,6 +166,7 @@ void R_DrawStretchPicImplementation (int x, int y, int w, int h, int s1, int t1,
|
||||
}
|
||||
#endif
|
||||
}
|
||||
dest += vid.rowbytes;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -179,6 +179,7 @@ void R_BlitScreen()
|
||||
int i;
|
||||
byte *buf = vid.buffer;
|
||||
|
||||
#pragma omp parallel for schedule(static)
|
||||
for( i = 0; i < vid.width * vid.height;i++)
|
||||
{
|
||||
#ifdef SEPARATE_BLIT
|
||||
|
Loading…
Reference in New Issue
Block a user