Merge branch 'master' into new_algae
This commit is contained in:
commit
284ced06ec
|
@ -149,7 +149,7 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm
|
||||||
{
|
{
|
||||||
RGBA_t rgbatexel;
|
RGBA_t rgbatexel;
|
||||||
rgbatexel.rgba = *(UINT32 *)dest;
|
rgbatexel.rgba = *(UINT32 *)dest;
|
||||||
colortemp = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
colortemp.rgba = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
||||||
}
|
}
|
||||||
memcpy(dest, &colortemp, sizeof(RGBA_t)-sizeof(UINT8));
|
memcpy(dest, &colortemp, sizeof(RGBA_t)-sizeof(UINT8));
|
||||||
break;
|
break;
|
||||||
|
@ -159,7 +159,7 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm
|
||||||
{
|
{
|
||||||
RGBA_t rgbatexel;
|
RGBA_t rgbatexel;
|
||||||
rgbatexel.rgba = *(UINT32 *)dest;
|
rgbatexel.rgba = *(UINT32 *)dest;
|
||||||
colortemp = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
colortemp.rgba = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
||||||
}
|
}
|
||||||
memcpy(dest, &colortemp, sizeof(RGBA_t));
|
memcpy(dest, &colortemp, sizeof(RGBA_t));
|
||||||
break;
|
break;
|
||||||
|
@ -263,7 +263,7 @@ static void HWR_DrawFlippedColumnInCache(const column_t *patchcol, UINT8 *block,
|
||||||
{
|
{
|
||||||
RGBA_t rgbatexel;
|
RGBA_t rgbatexel;
|
||||||
rgbatexel.rgba = *(UINT32 *)dest;
|
rgbatexel.rgba = *(UINT32 *)dest;
|
||||||
colortemp = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
colortemp.rgba = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
||||||
}
|
}
|
||||||
memcpy(dest, &colortemp, sizeof(RGBA_t)-sizeof(UINT8));
|
memcpy(dest, &colortemp, sizeof(RGBA_t)-sizeof(UINT8));
|
||||||
break;
|
break;
|
||||||
|
@ -273,7 +273,7 @@ static void HWR_DrawFlippedColumnInCache(const column_t *patchcol, UINT8 *block,
|
||||||
{
|
{
|
||||||
RGBA_t rgbatexel;
|
RGBA_t rgbatexel;
|
||||||
rgbatexel.rgba = *(UINT32 *)dest;
|
rgbatexel.rgba = *(UINT32 *)dest;
|
||||||
colortemp = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
colortemp.rgba = ASTBlendPixel(rgbatexel, colortemp, originPatch->style, originPatch->alpha);
|
||||||
}
|
}
|
||||||
memcpy(dest, &colortemp, sizeof(RGBA_t));
|
memcpy(dest, &colortemp, sizeof(RGBA_t));
|
||||||
break;
|
break;
|
||||||
|
@ -727,8 +727,8 @@ void HWR_MakePatch (const patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipm
|
||||||
#ifndef NO_PNG_LUMPS
|
#ifndef NO_PNG_LUMPS
|
||||||
// lump is a png so convert it
|
// lump is a png so convert it
|
||||||
size_t len = W_LumpLengthPwad(grPatch->wadnum, grPatch->lumpnum);
|
size_t len = W_LumpLengthPwad(grPatch->wadnum, grPatch->lumpnum);
|
||||||
if ((patch != NULL) && R_IsLumpPNG((UINT8 *)patch, len))
|
if ((patch != NULL) && R_IsLumpPNG((const UINT8 *)patch, len))
|
||||||
patch = R_PNGToPatch((UINT8 *)patch, len, NULL, true);
|
patch = R_PNGToPatch((const UINT8 *)patch, len, NULL, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// don't do it twice (like a cache)
|
// don't do it twice (like a cache)
|
||||||
|
|
|
@ -47,7 +47,6 @@ EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal, RGBA_t *pgamma);
|
||||||
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
|
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
|
||||||
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
||||||
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
|
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
|
||||||
EXPORT void HWRAPI(RenderSkyDome) (INT32 tex, INT32 texture_width, INT32 texture_height, FTransform transform);
|
|
||||||
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
|
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
|
||||||
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FRGBAFloat *ClearColor);
|
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FRGBAFloat *ClearColor);
|
||||||
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo);
|
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo);
|
||||||
|
@ -90,7 +89,6 @@ struct hwdriver_s
|
||||||
FinishUpdate pfnFinishUpdate;
|
FinishUpdate pfnFinishUpdate;
|
||||||
Draw2DLine pfnDraw2DLine;
|
Draw2DLine pfnDraw2DLine;
|
||||||
DrawPolygon pfnDrawPolygon;
|
DrawPolygon pfnDrawPolygon;
|
||||||
RenderSkyDome pfnRenderSkyDome;
|
|
||||||
SetBlend pfnSetBlend;
|
SetBlend pfnSetBlend;
|
||||||
ClearBuffer pfnClearBuffer;
|
ClearBuffer pfnClearBuffer;
|
||||||
SetTexture pfnSetTexture;
|
SetTexture pfnSetTexture;
|
||||||
|
|
|
@ -5869,43 +5869,8 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing)
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
//
|
//
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
static void HWR_DrawSkyBackground(player_t *player)
|
static void HWR_DrawSkyBackground(void)
|
||||||
{
|
{
|
||||||
if (cv_grskydome.value)
|
|
||||||
{
|
|
||||||
FTransform transform;
|
|
||||||
const float fpov = FIXED_TO_FLOAT(cv_grfov.value+player->fovadd);
|
|
||||||
postimg_t *type;
|
|
||||||
|
|
||||||
if (splitscreen && player == &players[secondarydisplayplayer])
|
|
||||||
type = &postimgtype2;
|
|
||||||
else
|
|
||||||
type = &postimgtype;
|
|
||||||
|
|
||||||
memset(&transform, 0x00, sizeof(FTransform));
|
|
||||||
|
|
||||||
//04/01/2000: Hurdler: added for T&L
|
|
||||||
// It should replace all other gr_viewxxx when finished
|
|
||||||
transform.anglex = (float)(aimingangle>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
|
|
||||||
transform.angley = (float)((viewangle-ANGLE_270)>>ANGLETOFINESHIFT)*(360.0f/(float)FINEANGLES);
|
|
||||||
|
|
||||||
if (*type == postimg_flip)
|
|
||||||
transform.flip = true;
|
|
||||||
else
|
|
||||||
transform.flip = false;
|
|
||||||
|
|
||||||
transform.scalex = 1;
|
|
||||||
transform.scaley = (float)vid.width/vid.height;
|
|
||||||
transform.scalez = 1;
|
|
||||||
transform.fovxangle = fpov; // Tails
|
|
||||||
transform.fovyangle = fpov; // Tails
|
|
||||||
transform.splitscreen = splitscreen;
|
|
||||||
|
|
||||||
HWR_GetTexture(texturetranslation[skytexture]);
|
|
||||||
HWD.pfnRenderSkyDome(skytexture, textures[skytexture]->width, textures[skytexture]->height, transform);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FOutVector v[4];
|
FOutVector v[4];
|
||||||
angle_t angle;
|
angle_t angle;
|
||||||
float dimensionmultiply;
|
float dimensionmultiply;
|
||||||
|
@ -5984,7 +5949,6 @@ static void HWR_DrawSkyBackground(player_t *player)
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(NULL, v, 4, 0);
|
HWD.pfnDrawPolygon(NULL, v, 4, 0);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6136,7 +6100,7 @@ if (0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (drawsky)
|
if (drawsky)
|
||||||
HWR_DrawSkyBackground(player);
|
HWR_DrawSkyBackground();
|
||||||
|
|
||||||
//Hurdler: it doesn't work in splitscreen mode
|
//Hurdler: it doesn't work in splitscreen mode
|
||||||
drawsky = splitscreen;
|
drawsky = splitscreen;
|
||||||
|
@ -6353,7 +6317,7 @@ if (0)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!skybox && drawsky) // Don't draw the regular sky if there's a skybox
|
if (!skybox && drawsky) // Don't draw the regular sky if there's a skybox
|
||||||
HWR_DrawSkyBackground(player);
|
HWR_DrawSkyBackground();
|
||||||
|
|
||||||
//Hurdler: it doesn't work in splitscreen mode
|
//Hurdler: it doesn't work in splitscreen mode
|
||||||
drawsky = splitscreen;
|
drawsky = splitscreen;
|
||||||
|
|
|
@ -98,7 +98,6 @@ extern consvar_t cv_voodoocompatibility;
|
||||||
extern consvar_t cv_grfovchange;
|
extern consvar_t cv_grfovchange;
|
||||||
extern consvar_t cv_grsolvetjoin;
|
extern consvar_t cv_grsolvetjoin;
|
||||||
extern consvar_t cv_grspritebillboarding;
|
extern consvar_t cv_grspritebillboarding;
|
||||||
extern consvar_t cv_grskydome;
|
|
||||||
|
|
||||||
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowy;
|
extern float gr_viewwidth, gr_viewheight, gr_baseviewwindowy;
|
||||||
|
|
||||||
|
|
|
@ -1427,232 +1427,6 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf,
|
||||||
Clamp2D(GL_TEXTURE_WRAP_T);
|
Clamp2D(GL_TEXTURE_WRAP_T);
|
||||||
}
|
}
|
||||||
|
|
||||||
// PRBoom sky dome
|
|
||||||
typedef struct vbo_vertex_s
|
|
||||||
{
|
|
||||||
float x, y, z;
|
|
||||||
float u, v;
|
|
||||||
unsigned char r, g, b, a;
|
|
||||||
} vbo_vertex_t;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int mode;
|
|
||||||
int vertexcount;
|
|
||||||
int vertexindex;
|
|
||||||
int use_texture;
|
|
||||||
} GLSkyLoopDef;
|
|
||||||
|
|
||||||
typedef struct
|
|
||||||
{
|
|
||||||
int id;
|
|
||||||
int rows, columns;
|
|
||||||
int loopcount;
|
|
||||||
GLSkyLoopDef *loops;
|
|
||||||
vbo_vertex_t *data;
|
|
||||||
} GLSkyVBO;
|
|
||||||
|
|
||||||
// The texture offset to be applied to the texture coordinates in SkyVertex().
|
|
||||||
static int rows, columns;
|
|
||||||
static boolean yflip;
|
|
||||||
static int texw, texh;
|
|
||||||
static float yMult, yAdd;
|
|
||||||
static boolean foglayer;
|
|
||||||
static float delta = 0.0f;
|
|
||||||
static int gl_sky_detail = 16;
|
|
||||||
static INT32 lasttex = -1;
|
|
||||||
|
|
||||||
static RGBA_t SkyColor;
|
|
||||||
|
|
||||||
#define MAP_COEFF 128.0f
|
|
||||||
#define MAP_SCALE (MAP_COEFF*(float)FRACUNIT)
|
|
||||||
|
|
||||||
static void SkyVertex(vbo_vertex_t *vbo, int r, int c)
|
|
||||||
{
|
|
||||||
static fixed_t scale = 10000 << FRACBITS;
|
|
||||||
static angle_t maxSideAngle = ANGLE_180 / 3;
|
|
||||||
|
|
||||||
angle_t topAngle = (angle_t)(c / (float)columns * ANGLE_MAX);
|
|
||||||
angle_t sideAngle = maxSideAngle * (rows - r) / rows;
|
|
||||||
fixed_t height = FINESINE(sideAngle>>ANGLETOFINESHIFT);
|
|
||||||
fixed_t realRadius = FixedMul(scale, FINECOSINE(sideAngle>>ANGLETOFINESHIFT));
|
|
||||||
fixed_t x = FixedMul(realRadius, FINECOSINE(topAngle>>ANGLETOFINESHIFT));
|
|
||||||
fixed_t y = (!yflip) ? FixedMul(scale, height) : FixedMul(scale, height) * -1;
|
|
||||||
fixed_t z = FixedMul(realRadius, FINESINE(topAngle>>ANGLETOFINESHIFT));
|
|
||||||
float timesRepeat;
|
|
||||||
|
|
||||||
timesRepeat = (short)(4 * (256.0f / texw));
|
|
||||||
if (timesRepeat == 0.0f)
|
|
||||||
timesRepeat = 1.0f;
|
|
||||||
|
|
||||||
if (!foglayer)
|
|
||||||
{
|
|
||||||
boolean flip = yflip;
|
|
||||||
vbo->r = 255;
|
|
||||||
vbo->g = 255;
|
|
||||||
vbo->b = 255;
|
|
||||||
vbo->a = (r == 0 ? 0 : 255);
|
|
||||||
|
|
||||||
// Flip Y coordinate anyway for the top part of the hemisphere
|
|
||||||
if (r <= 1)
|
|
||||||
flip = !flip;
|
|
||||||
|
|
||||||
// And the texture coordinates.
|
|
||||||
vbo->u = (-timesRepeat * c / (float)columns);
|
|
||||||
if (!flip) // Flipped Y is for the lower hemisphere.
|
|
||||||
vbo->v = (r / (float)rows) * 1.f * yMult + yAdd;
|
|
||||||
else
|
|
||||||
vbo->v = ((rows-r)/(float)rows) * 1.f * yMult + yAdd;
|
|
||||||
}
|
|
||||||
|
|
||||||
// And finally the vertex.
|
|
||||||
vbo->x = (float)x/(float)MAP_SCALE;
|
|
||||||
vbo->y = (float)y/(float)MAP_SCALE + delta;
|
|
||||||
vbo->z = (float)z/(float)MAP_SCALE;
|
|
||||||
}
|
|
||||||
|
|
||||||
GLSkyVBO sky_vbo;
|
|
||||||
|
|
||||||
static void gld_BuildSky(int row_count, int col_count)
|
|
||||||
{
|
|
||||||
int c, r;
|
|
||||||
vbo_vertex_t *vertex_p;
|
|
||||||
int vertex_count = 2 * row_count * (col_count * 2 + 2) + col_count * 2;
|
|
||||||
|
|
||||||
GLSkyVBO *vbo = &sky_vbo;
|
|
||||||
|
|
||||||
if ((vbo->columns != col_count) || (vbo->rows != row_count))
|
|
||||||
{
|
|
||||||
free(vbo->loops);
|
|
||||||
free(vbo->data);
|
|
||||||
memset(vbo, 0, sizeof(&vbo));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!vbo->data)
|
|
||||||
{
|
|
||||||
memset(vbo, 0, sizeof(&vbo));
|
|
||||||
vbo->loops = malloc((row_count * 2 + 2) * sizeof(vbo->loops[0]));
|
|
||||||
// create vertex array
|
|
||||||
vbo->data = malloc(vertex_count * sizeof(vbo->data[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
vbo->columns = col_count;
|
|
||||||
vbo->rows = row_count;
|
|
||||||
|
|
||||||
vertex_p = &vbo->data[0];
|
|
||||||
vbo->loopcount = 0;
|
|
||||||
|
|
||||||
memset(&SkyColor, 0xFF, sizeof(SkyColor));
|
|
||||||
|
|
||||||
// Why not?
|
|
||||||
for (yflip = false; yflip <= true; yflip++)
|
|
||||||
{
|
|
||||||
vbo->loops[vbo->loopcount].mode = GL_TRIANGLE_FAN;
|
|
||||||
vbo->loops[vbo->loopcount].vertexindex = vertex_p - &vbo->data[0];
|
|
||||||
vbo->loops[vbo->loopcount].vertexcount = col_count;
|
|
||||||
vbo->loops[vbo->loopcount].use_texture = false;
|
|
||||||
vbo->loopcount++;
|
|
||||||
|
|
||||||
yAdd = 0.5f;
|
|
||||||
yMult = 1.0f;
|
|
||||||
/*if (yflip == 0)
|
|
||||||
SkyColor = &sky->CeilingSkyColor[vbo_idx];
|
|
||||||
else
|
|
||||||
SkyColor = &sky->FloorSkyColor[vbo_idx];*/
|
|
||||||
|
|
||||||
delta = 0.0f;
|
|
||||||
foglayer = true;
|
|
||||||
for (c = 0; c < col_count; c++)
|
|
||||||
{
|
|
||||||
SkyVertex(vertex_p, 1, c);
|
|
||||||
vertex_p->r = SkyColor.s.red;
|
|
||||||
vertex_p->g = SkyColor.s.green;
|
|
||||||
vertex_p->b = SkyColor.s.blue;
|
|
||||||
vertex_p->a = 255;
|
|
||||||
vertex_p++;
|
|
||||||
}
|
|
||||||
foglayer = false;
|
|
||||||
|
|
||||||
delta = (yflip ? 5.0f : -5.0f) / MAP_COEFF;
|
|
||||||
|
|
||||||
for (r = 0; r < row_count; r++)
|
|
||||||
{
|
|
||||||
vbo->loops[vbo->loopcount].mode = GL_TRIANGLE_STRIP;
|
|
||||||
vbo->loops[vbo->loopcount].vertexindex = vertex_p - &vbo->data[0];
|
|
||||||
vbo->loops[vbo->loopcount].vertexcount = 2 * col_count + 2;
|
|
||||||
vbo->loops[vbo->loopcount].use_texture = true; //(r > 1) ? true : false;
|
|
||||||
vbo->loopcount++;
|
|
||||||
|
|
||||||
for (c = 0; c <= col_count; c++)
|
|
||||||
{
|
|
||||||
SkyVertex(vertex_p++, r + (yflip ? 1 : 0), (c ? c : 0));
|
|
||||||
SkyVertex(vertex_p++, r + (yflip ? 0 : 1), (c ? c : 0));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void RenderDomeForReal(INT32 skytexture)
|
|
||||||
{
|
|
||||||
int i, j;
|
|
||||||
GLSkyVBO *vbo = &sky_vbo;
|
|
||||||
|
|
||||||
pglRotatef(270.f, 0.f, 1.f, 0.f);
|
|
||||||
|
|
||||||
rows = 4;
|
|
||||||
columns = 4 * gl_sky_detail;
|
|
||||||
|
|
||||||
if (lasttex != skytexture)
|
|
||||||
{
|
|
||||||
lasttex = skytexture;
|
|
||||||
gld_BuildSky(rows, columns);
|
|
||||||
}
|
|
||||||
|
|
||||||
pglScalef(1.0f, (float)texh / 230.0f, 1.0f);
|
|
||||||
|
|
||||||
for (j = 0; j < 2; j++)
|
|
||||||
{
|
|
||||||
for (i = 0; i < vbo->loopcount; i++)
|
|
||||||
{
|
|
||||||
GLSkyLoopDef *loop = &vbo->loops[i];
|
|
||||||
|
|
||||||
if (j == 0 ? loop->use_texture : !loop->use_texture)
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
int k;
|
|
||||||
pglBegin(loop->mode);
|
|
||||||
for (k = loop->vertexindex; k < (loop->vertexindex + loop->vertexcount); k++)
|
|
||||||
{
|
|
||||||
vbo_vertex_t *v = &vbo->data[k];
|
|
||||||
if (loop->use_texture)
|
|
||||||
pglTexCoord2f(v->u, v->v);
|
|
||||||
pglColor4f(v->r, v->g, v->b, v->a);
|
|
||||||
pglVertex3f(v->x, v->y, v->z);
|
|
||||||
}
|
|
||||||
pglEnd();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pglScalef(1.0f, 1.0f, 1.0f);
|
|
||||||
|
|
||||||
// current color is undefined after glDrawArrays
|
|
||||||
pglColor4f(1.0f, 1.0f, 1.0f, 1.0f);
|
|
||||||
}
|
|
||||||
|
|
||||||
EXPORT void HWRAPI(RenderSkyDome) (INT32 tex, INT32 texture_width, INT32 texture_height, FTransform transform)
|
|
||||||
{
|
|
||||||
SetBlend(PF_Translucent|PF_NoDepthTest|PF_Modulated);
|
|
||||||
SetTransform(&transform);
|
|
||||||
|
|
||||||
texw = texture_width;
|
|
||||||
texh = texture_height;
|
|
||||||
RenderDomeForReal(tex);
|
|
||||||
|
|
||||||
// HWR_DrawSkyBackground left no blend flags after rendering the sky
|
|
||||||
SetBlend(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
//
|
//
|
||||||
|
|
108
src/info.c
108
src/info.c
|
@ -11748,6 +11748,60 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{ // MT_CACTI10
|
||||||
|
1230, // doomednum
|
||||||
|
S_CACTI10, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
64*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
|
{ // MT_CACTI11
|
||||||
|
1231, // doomednum
|
||||||
|
S_CACTI11, // spawnstate
|
||||||
|
1000, // spawnhealth
|
||||||
|
S_NULL, // seestate
|
||||||
|
sfx_None, // seesound
|
||||||
|
8, // reactiontime
|
||||||
|
sfx_None, // attacksound
|
||||||
|
S_NULL, // painstate
|
||||||
|
0, // painchance
|
||||||
|
sfx_None, // painsound
|
||||||
|
S_NULL, // meleestate
|
||||||
|
S_NULL, // missilestate
|
||||||
|
S_NULL, // deathstate
|
||||||
|
S_NULL, // xdeathstate
|
||||||
|
sfx_None, // deathsound
|
||||||
|
0, // speed
|
||||||
|
16*FRACUNIT, // radius
|
||||||
|
32*FRACUNIT, // height
|
||||||
|
0, // display offset
|
||||||
|
100, // mass
|
||||||
|
0, // damage
|
||||||
|
sfx_None, // activesound
|
||||||
|
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
||||||
|
S_NULL // raisestate
|
||||||
|
},
|
||||||
|
|
||||||
{ // MT_ARIDSIGN_CAUTION
|
{ // MT_ARIDSIGN_CAUTION
|
||||||
1212, // doomednum
|
1212, // doomednum
|
||||||
S_ARIDSIGN_CAUTION, // spawnstate
|
S_ARIDSIGN_CAUTION, // spawnstate
|
||||||
|
@ -12369,60 +12423,6 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
||||||
S_NULL // raisestate
|
S_NULL // raisestate
|
||||||
},
|
},
|
||||||
|
|
||||||
{ // MT_CACTI10
|
|
||||||
1230, // doomednum
|
|
||||||
S_CACTI10, // spawnstate
|
|
||||||
1000, // spawnhealth
|
|
||||||
S_NULL, // seestate
|
|
||||||
sfx_None, // seesound
|
|
||||||
8, // reactiontime
|
|
||||||
sfx_None, // attacksound
|
|
||||||
S_NULL, // painstate
|
|
||||||
0, // painchance
|
|
||||||
sfx_None, // painsound
|
|
||||||
S_NULL, // meleestate
|
|
||||||
S_NULL, // missilestate
|
|
||||||
S_NULL, // deathstate
|
|
||||||
S_NULL, // xdeathstate
|
|
||||||
sfx_None, // deathsound
|
|
||||||
0, // speed
|
|
||||||
16*FRACUNIT, // radius
|
|
||||||
64*FRACUNIT, // height
|
|
||||||
0, // display offset
|
|
||||||
100, // mass
|
|
||||||
0, // damage
|
|
||||||
sfx_None, // activesound
|
|
||||||
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
|
||||||
S_NULL // raisestate
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // MT_CACTI11
|
|
||||||
1231, // doomednum
|
|
||||||
S_CACTI11, // spawnstate
|
|
||||||
1000, // spawnhealth
|
|
||||||
S_NULL, // seestate
|
|
||||||
sfx_None, // seesound
|
|
||||||
8, // reactiontime
|
|
||||||
sfx_None, // attacksound
|
|
||||||
S_NULL, // painstate
|
|
||||||
0, // painchance
|
|
||||||
sfx_None, // painsound
|
|
||||||
S_NULL, // meleestate
|
|
||||||
S_NULL, // missilestate
|
|
||||||
S_NULL, // deathstate
|
|
||||||
S_NULL, // xdeathstate
|
|
||||||
sfx_None, // deathsound
|
|
||||||
0, // speed
|
|
||||||
16*FRACUNIT, // radius
|
|
||||||
32*FRACUNIT, // height
|
|
||||||
0, // display offset
|
|
||||||
100, // mass
|
|
||||||
0, // damage
|
|
||||||
sfx_None, // activesound
|
|
||||||
MF_SOLID|MF_SCENERY|MF_PAIN, // flags
|
|
||||||
S_NULL // raisestate
|
|
||||||
},
|
|
||||||
|
|
||||||
{ // MT_FLAMEJET
|
{ // MT_FLAMEJET
|
||||||
1300, // doomednum
|
1300, // doomednum
|
||||||
S_FLAMEJETSTND, // spawnstate
|
S_FLAMEJETSTND, // spawnstate
|
||||||
|
|
33
src/r_data.c
33
src/r_data.c
|
@ -241,7 +241,7 @@ static inline void R_DrawFlippedColumnInCache(column_t *patch, UINT8 *cache, tex
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RGBA_t ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha)
|
UINT32 ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha)
|
||||||
{
|
{
|
||||||
RGBA_t output;
|
RGBA_t output;
|
||||||
if (style == AST_TRANSLUCENT)
|
if (style == AST_TRANSLUCENT)
|
||||||
|
@ -298,13 +298,13 @@ RGBA_t ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alph
|
||||||
}
|
}
|
||||||
// just copy the pixel
|
// just copy the pixel
|
||||||
else if (style == AST_COPY)
|
else if (style == AST_COPY)
|
||||||
return background;
|
output.rgba = foreground.rgba;
|
||||||
|
|
||||||
|
output.s.alpha = 0xFF;
|
||||||
|
return output.rgba;
|
||||||
}
|
}
|
||||||
#undef clamp
|
#undef clamp
|
||||||
// unimplemented blend modes return the background pixel
|
return 0;
|
||||||
output = background;
|
|
||||||
output.s.alpha = 0xFF;
|
|
||||||
return output;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 ASTBlendPixel_8bpp(UINT8 background, UINT8 foreground, int style, UINT8 alpha)
|
UINT8 ASTBlendPixel_8bpp(UINT8 background, UINT8 foreground, int style, UINT8 alpha)
|
||||||
|
@ -321,7 +321,7 @@ UINT8 ASTBlendPixel_8bpp(UINT8 background, UINT8 foreground, int style, UINT8 al
|
||||||
}
|
}
|
||||||
// just copy the pixel
|
// just copy the pixel
|
||||||
else if (style == AST_COPY)
|
else if (style == AST_COPY)
|
||||||
return background;
|
return foreground;
|
||||||
// use ASTBlendPixel for all other blend modes
|
// use ASTBlendPixel for all other blend modes
|
||||||
// and find the nearest colour in the palette
|
// and find the nearest colour in the palette
|
||||||
else if (style != AST_TRANSLUCENT)
|
else if (style != AST_TRANSLUCENT)
|
||||||
|
@ -329,7 +329,7 @@ UINT8 ASTBlendPixel_8bpp(UINT8 background, UINT8 foreground, int style, UINT8 al
|
||||||
RGBA_t texel;
|
RGBA_t texel;
|
||||||
RGBA_t bg = V_GetColor(background);
|
RGBA_t bg = V_GetColor(background);
|
||||||
RGBA_t fg = V_GetColor(foreground);
|
RGBA_t fg = V_GetColor(foreground);
|
||||||
texel = ASTBlendPixel(bg, fg, style, alpha);
|
texel.rgba = ASTBlendPixel(bg, fg, style, alpha);
|
||||||
return NearestColor(texel.s.red, texel.s.green, texel.s.blue);
|
return NearestColor(texel.s.red, texel.s.green, texel.s.blue);
|
||||||
}
|
}
|
||||||
// fallback if all above fails, somehow
|
// fallback if all above fails, somehow
|
||||||
|
@ -2588,7 +2588,7 @@ void R_PatchToFlat(patch_t *patch, UINT8 *flat)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NO_PNG_LUMPS
|
#ifndef NO_PNG_LUMPS
|
||||||
boolean R_IsLumpPNG(UINT8 *d, size_t s)
|
boolean R_IsLumpPNG(const UINT8 *d, size_t s)
|
||||||
{
|
{
|
||||||
if (s < 67) // http://garethrees.org/2007/11/14/pngcrush/
|
if (s < 67) // http://garethrees.org/2007/11/14/pngcrush/
|
||||||
return false;
|
return false;
|
||||||
|
@ -2599,8 +2599,12 @@ boolean R_IsLumpPNG(UINT8 *d, size_t s)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PNG
|
#ifdef HAVE_PNG
|
||||||
|
|
||||||
|
#if PNG_LIBPNG_VER_DLLNUM < 14
|
||||||
|
typedef PNG_CONST png_byte *png_const_bytep;
|
||||||
|
#endif
|
||||||
typedef struct {
|
typedef struct {
|
||||||
png_bytep buffer;
|
png_const_bytep buffer;
|
||||||
png_uint_32 bufsize;
|
png_uint_32 bufsize;
|
||||||
png_uint_32 current_pos;
|
png_uint_32 current_pos;
|
||||||
} png_io_t;
|
} png_io_t;
|
||||||
|
@ -2626,6 +2630,7 @@ static png_chunk_t chunk;
|
||||||
|
|
||||||
static int PNG_ChunkReader(png_structp png_ptr, png_unknown_chunkp chonk)
|
static int PNG_ChunkReader(png_structp png_ptr, png_unknown_chunkp chonk)
|
||||||
{
|
{
|
||||||
|
(void)png_ptr;
|
||||||
if (!memcmp(chonk->name, chunkname, 4))
|
if (!memcmp(chonk->name, chunkname, 4))
|
||||||
{
|
{
|
||||||
memcpy(chunk.name, chonk->name, 4);
|
memcpy(chunk.name, chonk->name, 4);
|
||||||
|
@ -2648,7 +2653,7 @@ static void PNG_warn(png_structp PNG, png_const_charp pngtext)
|
||||||
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext);
|
CONS_Debug(DBG_RENDER, "libpng warning at %p: %s", PNG, pngtext);
|
||||||
}
|
}
|
||||||
|
|
||||||
static png_bytep *PNG_Read(UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoffset, INT16 *leftoffset, size_t size)
|
static png_bytep *PNG_Read(const UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoffset, INT16 *leftoffset, size_t size)
|
||||||
{
|
{
|
||||||
png_structp png_ptr;
|
png_structp png_ptr;
|
||||||
png_infop png_info_ptr;
|
png_infop png_info_ptr;
|
||||||
|
@ -2697,7 +2702,7 @@ static png_bytep *PNG_Read(UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoffset, I
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// set our own read_function
|
// set our own read_function
|
||||||
png_io.buffer = (png_bytep)png;
|
png_io.buffer = (png_const_bytep)png;
|
||||||
png_io.bufsize = size;
|
png_io.bufsize = size;
|
||||||
png_io.current_pos = 0;
|
png_io.current_pos = 0;
|
||||||
png_set_read_fn(png_ptr, &png_io, PNG_IOReader);
|
png_set_read_fn(png_ptr, &png_io, PNG_IOReader);
|
||||||
|
@ -2767,7 +2772,7 @@ static png_bytep *PNG_Read(UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoffset, I
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert a PNG to a raw image.
|
// Convert a PNG to a raw image.
|
||||||
static UINT8 *PNG_RawConvert(UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoffset, INT16 *leftoffset, size_t size)
|
static UINT8 *PNG_RawConvert(const UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoffset, INT16 *leftoffset, size_t size)
|
||||||
{
|
{
|
||||||
UINT8 *flat;
|
UINT8 *flat;
|
||||||
png_uint_32 x, y;
|
png_uint_32 x, y;
|
||||||
|
@ -2803,7 +2808,7 @@ UINT8 *R_PNGToFlat(levelflat_t *levelflat, UINT8 *png, size_t size)
|
||||||
|
|
||||||
// Convert a PNG to a patch.
|
// Convert a PNG to a patch.
|
||||||
static unsigned char imgbuf[1<<26];
|
static unsigned char imgbuf[1<<26];
|
||||||
patch_t *R_PNGToPatch(UINT8 *png, size_t size, size_t *destsize, boolean transparency)
|
patch_t *R_PNGToPatch(const UINT8 *png, size_t size, size_t *destsize, boolean transparency)
|
||||||
{
|
{
|
||||||
UINT16 width, height;
|
UINT16 width, height;
|
||||||
INT16 topoffset = 0, leftoffset = 0;
|
INT16 topoffset = 0, leftoffset = 0;
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
// Possible alpha types for a patch.
|
// Possible alpha types for a patch.
|
||||||
enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY};
|
enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY};
|
||||||
|
|
||||||
RGBA_t ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha);
|
UINT32 ASTBlendPixel(RGBA_t background, RGBA_t foreground, int style, UINT8 alpha);
|
||||||
UINT8 ASTBlendPixel_8bpp(UINT8 background, UINT8 foreground, int style, UINT8 alpha);
|
UINT8 ASTBlendPixel_8bpp(UINT8 background, UINT8 foreground, int style, UINT8 alpha);
|
||||||
|
|
||||||
UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b);
|
UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b);
|
||||||
|
@ -165,10 +165,10 @@ void R_PatchToFlat(patch_t *patch, UINT8 *flat);
|
||||||
void R_TextureToFlat(size_t tex, UINT8 *flat);
|
void R_TextureToFlat(size_t tex, UINT8 *flat);
|
||||||
|
|
||||||
#ifndef NO_PNG_LUMPS
|
#ifndef NO_PNG_LUMPS
|
||||||
boolean R_IsLumpPNG(UINT8 *d, size_t s);
|
boolean R_IsLumpPNG(const UINT8 *d, size_t s);
|
||||||
|
|
||||||
UINT8 *R_PNGToFlat(levelflat_t *levelflat, UINT8 *png, size_t size);
|
UINT8 *R_PNGToFlat(levelflat_t *levelflat, UINT8 *png, size_t size);
|
||||||
patch_t *R_PNGToPatch(UINT8 *png, size_t size, size_t *destsize, boolean transparency);
|
patch_t *R_PNGToPatch(const UINT8 *png, size_t size, size_t *destsize, boolean transparency);
|
||||||
boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size);
|
boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -1215,7 +1215,6 @@ void R_RegisterEngineStuff(void)
|
||||||
#endif
|
#endif
|
||||||
CV_RegisterVar(&cv_grmd2);
|
CV_RegisterVar(&cv_grmd2);
|
||||||
CV_RegisterVar(&cv_grspritebillboarding);
|
CV_RegisterVar(&cv_grspritebillboarding);
|
||||||
CV_RegisterVar(&cv_grskydome);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
|
|
|
@ -79,7 +79,6 @@ void *hwSym(const char *funcName,void *handle)
|
||||||
GETFUNC(Init);
|
GETFUNC(Init);
|
||||||
GETFUNC(Draw2DLine);
|
GETFUNC(Draw2DLine);
|
||||||
GETFUNC(DrawPolygon);
|
GETFUNC(DrawPolygon);
|
||||||
GETFUNC(RenderSkyDome);
|
|
||||||
GETFUNC(SetBlend);
|
GETFUNC(SetBlend);
|
||||||
GETFUNC(ClearBuffer);
|
GETFUNC(ClearBuffer);
|
||||||
GETFUNC(SetTexture);
|
GETFUNC(SetTexture);
|
||||||
|
|
|
@ -1499,7 +1499,6 @@ void I_StartupGraphics(void)
|
||||||
HWD.pfnFinishUpdate = NULL;
|
HWD.pfnFinishUpdate = NULL;
|
||||||
HWD.pfnDraw2DLine = hwSym("Draw2DLine",NULL);
|
HWD.pfnDraw2DLine = hwSym("Draw2DLine",NULL);
|
||||||
HWD.pfnDrawPolygon = hwSym("DrawPolygon",NULL);
|
HWD.pfnDrawPolygon = hwSym("DrawPolygon",NULL);
|
||||||
HWD.pfnRenderSkyDome = hwSym("RenderSkyDome",NULL);
|
|
||||||
HWD.pfnSetBlend = hwSym("SetBlend",NULL);
|
HWD.pfnSetBlend = hwSym("SetBlend",NULL);
|
||||||
HWD.pfnClearBuffer = hwSym("ClearBuffer",NULL);
|
HWD.pfnClearBuffer = hwSym("ClearBuffer",NULL);
|
||||||
HWD.pfnSetTexture = hwSym("SetTexture",NULL);
|
HWD.pfnSetTexture = hwSym("SetTexture",NULL);
|
||||||
|
|
|
@ -112,7 +112,6 @@ static CV_PossibleValue_t CV_MD2[] = {{0, "Off"}, {1, "On"}, {2, "Old"}, {0, NUL
|
||||||
// console variables in development
|
// console variables in development
|
||||||
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grmd2 = {"gr_md2", "Off", CV_SAVE, CV_MD2, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grspritebillboarding = {"gr_spritebillboarding", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_grskydome = {"gr_skydome", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// local copy of the palette for V_GetColor()
|
// local copy of the palette for V_GetColor()
|
||||||
|
|
|
@ -102,7 +102,6 @@ static loadfunc_t hwdFuncTable[] = {
|
||||||
{"FinishUpdate@4", &hwdriver.pfnFinishUpdate},
|
{"FinishUpdate@4", &hwdriver.pfnFinishUpdate},
|
||||||
{"Draw2DLine@12", &hwdriver.pfnDraw2DLine},
|
{"Draw2DLine@12", &hwdriver.pfnDraw2DLine},
|
||||||
{"DrawPolygon@16", &hwdriver.pfnDrawPolygon},
|
{"DrawPolygon@16", &hwdriver.pfnDrawPolygon},
|
||||||
{"RenderSkyDome@16", &hwdriver.pfnRenderDome},
|
|
||||||
{"SetBlend@4", &hwdriver.pfnSetBlend},
|
{"SetBlend@4", &hwdriver.pfnSetBlend},
|
||||||
{"ClearBuffer@12", &hwdriver.pfnClearBuffer},
|
{"ClearBuffer@12", &hwdriver.pfnClearBuffer},
|
||||||
{"SetTexture@4", &hwdriver.pfnSetTexture},
|
{"SetTexture@4", &hwdriver.pfnSetTexture},
|
||||||
|
@ -134,7 +133,6 @@ static loadfunc_t hwdFuncTable[] = {
|
||||||
{"FinishUpdate", &hwdriver.pfnFinishUpdate},
|
{"FinishUpdate", &hwdriver.pfnFinishUpdate},
|
||||||
{"Draw2DLine", &hwdriver.pfnDraw2DLine},
|
{"Draw2DLine", &hwdriver.pfnDraw2DLine},
|
||||||
{"DrawPolygon", &hwdriver.pfnDrawPolygon},
|
{"DrawPolygon", &hwdriver.pfnDrawPolygon},
|
||||||
{"RenderSkyDome", &hwdriver.pfnRenderDome},
|
|
||||||
{"SetBlend", &hwdriver.pfnSetBlend},
|
{"SetBlend", &hwdriver.pfnSetBlend},
|
||||||
{"ClearBuffer", &hwdriver.pfnClearBuffer},
|
{"ClearBuffer", &hwdriver.pfnClearBuffer},
|
||||||
{"SetTexture", &hwdriver.pfnSetTexture},
|
{"SetTexture", &hwdriver.pfnSetTexture},
|
||||||
|
|
Loading…
Reference in a new issue