Skip to content

Commit

Permalink
Merge remote-tracking branch 'gzdoom/master' into clientserver
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/polyrenderer/poly_renderer.cpp
  • Loading branch information
dpjudas committed Apr 14, 2018
2 parents ca6f881 + c03024e commit 759d758
Show file tree
Hide file tree
Showing 83 changed files with 1,801 additions and 1,273 deletions.
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Expand Up @@ -796,7 +796,7 @@ set( POLYRENDER_SOURCES
polyrenderer/drawers/poly_triangle.cpp
polyrenderer/drawers/poly_draw_args.cpp
polyrenderer/drawers/screen_triangle.cpp
polyrenderer/math/tri_matrix.cpp
polyrenderer/math/gpu_types.cpp
)

# These files will be flagged as "headers" so that they appear in project files
Expand Down Expand Up @@ -1085,6 +1085,7 @@ set (PCH_SOURCES
gl/textures/gl_texture.cpp
gl/textures/gl_material.cpp
gl/textures/gl_samplers.cpp
hwrenderer/data/flatvertices.cpp
hwrenderer/dynlights/hw_aabbtree.cpp

menu/joystickmenu.cpp
Expand Down
15 changes: 9 additions & 6 deletions src/events.cpp
Expand Up @@ -404,16 +404,16 @@ void E_WorldThingDestroyed(AActor* actor)
handler->WorldThingDestroyed(actor);
}

void E_WorldLinePreActivated(line_t* line, AActor* actor, bool* shouldactivate)
void E_WorldLinePreActivated(line_t* line, AActor* actor, int activationType, bool* shouldactivate)
{
for (DStaticEventHandler* handler = E_FirstEventHandler; handler; handler = handler->next)
handler->WorldLinePreActivated(line, actor, shouldactivate);
handler->WorldLinePreActivated(line, actor, activationType, shouldactivate);
}

void E_WorldLineActivated(line_t* line, AActor* actor)
void E_WorldLineActivated(line_t* line, AActor* actor, int activationType)
{
for (DStaticEventHandler* handler = E_FirstEventHandler; handler; handler = handler->next)
handler->WorldLineActivated(line, actor);
handler->WorldLineActivated(line, actor, activationType);
}

void E_PlayerEntered(int num, bool fromhub)
Expand Down Expand Up @@ -545,6 +545,7 @@ DEFINE_FIELD_X(WorldEvent, FWorldEvent, DamageType);
DEFINE_FIELD_X(WorldEvent, FWorldEvent, DamageFlags);
DEFINE_FIELD_X(WorldEvent, FWorldEvent, DamageAngle);
DEFINE_FIELD_X(WorldEvent, FWorldEvent, ActivatedLine);
DEFINE_FIELD_X(WorldEvent, FWorldEvent, ActivationType);
DEFINE_FIELD_X(WorldEvent, FWorldEvent, ShouldActivate);

DEFINE_FIELD_X(PlayerEvent, FPlayerEvent, PlayerNumber);
Expand Down Expand Up @@ -795,7 +796,7 @@ void DStaticEventHandler::WorldThingDestroyed(AActor* actor)
}
}

void DStaticEventHandler::WorldLinePreActivated(line_t* line, AActor* actor, bool* shouldactivate)
void DStaticEventHandler::WorldLinePreActivated(line_t* line, AActor* actor, int activationType, bool* shouldactivate)
{
IFVIRTUAL(DStaticEventHandler, WorldLinePreActivated)
{
Expand All @@ -805,14 +806,15 @@ void DStaticEventHandler::WorldLinePreActivated(line_t* line, AActor* actor, boo
FWorldEvent e = E_SetupWorldEvent();
e.Thing = actor;
e.ActivatedLine = line;
e.ActivationType = activationType;
e.ShouldActivate = *shouldactivate;
VMValue params[2] = { (DStaticEventHandler*)this, &e };
VMCall(func, params, 2, nullptr, 0);
*shouldactivate = e.ShouldActivate;
}
}

void DStaticEventHandler::WorldLineActivated(line_t* line, AActor* actor)
void DStaticEventHandler::WorldLineActivated(line_t* line, AActor* actor, int activationType)
{
IFVIRTUAL(DStaticEventHandler, WorldLineActivated)
{
Expand All @@ -822,6 +824,7 @@ void DStaticEventHandler::WorldLineActivated(line_t* line, AActor* actor)
FWorldEvent e = E_SetupWorldEvent();
e.Thing = actor;
e.ActivatedLine = line;
e.ActivationType = activationType;
VMValue params[2] = { (DStaticEventHandler*)this, &e };
VMCall(func, params, 2, nullptr, 0);
}
Expand Down
19 changes: 10 additions & 9 deletions src/events.h
Expand Up @@ -41,9 +41,9 @@ void E_WorldThingDamaged(AActor* actor, AActor* inflictor, AActor* source, int d
// called before AActor::Destroy of each actor.
void E_WorldThingDestroyed(AActor* actor);
// called in P_ActivateLine before executing special, set shouldactivate to false to prevent activation.
void E_WorldLinePreActivated(line_t* line, AActor* actor, bool* shouldactivate);
void E_WorldLinePreActivated(line_t* line, AActor* actor, int activationType, bool* shouldactivate);
// called in P_ActivateLine after successful special execution.
void E_WorldLineActivated(line_t* line, AActor* actor);
void E_WorldLineActivated(line_t* line, AActor* actor, int activationType);
// same as ACS SCRIPT_Lightning
void E_WorldLightning();
// this executes on every tick, before everything, only when in valid level and not paused
Expand Down Expand Up @@ -138,13 +138,13 @@ class DStaticEventHandler : public DObject // make it a part of normal GC proces
//
void WorldLoaded();
void WorldUnloaded();
void WorldThingSpawned(AActor*);
void WorldThingDied(AActor*, AActor*);
void WorldThingRevived(AActor*);
void WorldThingDamaged(AActor*, AActor*, AActor*, int, FName, int, DAngle);
void WorldThingDestroyed(AActor*);
void WorldLinePreActivated(line_t*, AActor*, bool*);
void WorldLineActivated(line_t*, AActor*);
void WorldThingSpawned(AActor* actor);
void WorldThingDied(AActor* actor, AActor* inflictor);
void WorldThingRevived(AActor* actor);
void WorldThingDamaged(AActor* actor, AActor* inflictor, AActor* source, int damage, FName mod, int flags, DAngle angle);
void WorldThingDestroyed(AActor* actor);
void WorldLinePreActivated(line_t* line, AActor* actor, int activationType, bool* shouldactivate);
void WorldLineActivated(line_t* line, AActor* actor, int activationType);
void WorldLightning();
void WorldTick();

Expand Down Expand Up @@ -203,6 +203,7 @@ struct FWorldEvent
DAngle DamageAngle;
// for line(pre)activated
line_t* ActivatedLine = nullptr;
int ActivationType = 0;
bool ShouldActivate = true;
};

Expand Down
20 changes: 10 additions & 10 deletions src/gl/compatibility/gl_20.cpp
Expand Up @@ -534,32 +534,32 @@ static bool gl_CheckFog(FColormap *cm, int lightlevel)
//
//==========================================================================

bool GLWall::PutWallCompat(int passflag)
bool FDrawInfo::PutWallCompat(GLWall *wall, int passflag)
{
static int list_indices[2][2] =
{ { GLLDL_WALLS_PLAIN, GLLDL_WALLS_FOG },{ GLLDL_WALLS_MASKED, GLLDL_WALLS_FOGMASKED } };

// are lights possible?
if (mDrawer->FixedColormap != CM_DEFAULT || !gl_lights || seg->sidedef == nullptr || type == RENDERWALL_M2SNF || !gltexture) return false;
if (mDrawer->FixedColormap != CM_DEFAULT || !gl_lights || wall->seg->sidedef == nullptr || wall->type == RENDERWALL_M2SNF || !wall->gltexture) return false;

// multipassing these is problematic.
if ((flags&GLWF_SKYHACK && type == RENDERWALL_M2S)) return false;
if ((wall->flags & GLWall::GLWF_SKYHACK && wall->type == RENDERWALL_M2S)) return false;

// Any lights affecting this wall?
if (!(seg->sidedef->Flags & WALLF_POLYOBJ))
if (!(wall->seg->sidedef->Flags & WALLF_POLYOBJ))
{
if (seg->sidedef->lighthead == nullptr) return false;
if (wall->seg->sidedef->lighthead == nullptr) return false;
}
else if (sub)
else if (wall->sub)
{
if (sub->lighthead == nullptr) return false;
if (wall->sub->lighthead == nullptr) return false;
}

bool foggy = gl_CheckFog(&Colormap, lightlevel) || (level.flags&LEVEL_HASFADETABLE) || gl_lights_additive;
bool masked = passflag == 2 && gltexture->isMasked();
bool foggy = gl_CheckFog(&wall->Colormap, wall->lightlevel) || (level.flags&LEVEL_HASFADETABLE) || gl_lights_additive;
bool masked = passflag == 2 && wall->gltexture->isMasked();

int list = list_indices[masked][foggy];
gl_drawinfo->dldrawlists[list].AddWall(this);
dldrawlists[list].AddWall(wall);
return true;

}
Expand Down

0 comments on commit 759d758

Please sign in to comment.