(*
* light rendering: (INVALID!)
* glStencilFunc(GL_EQUAL, 0, $ff);
- * clear depth buffer
- * renderAmbientQuad()
* for each light:
+ * glClear(GL_STENCIL_BUFFER_BIT);
* glStencilOp(GL_KEEP, GL_KEEP, GL_INCR);
* draw shadow volume into stencil buffer
* glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); // modify color buffer
* glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); // don't modify stencil buffer
* turn off blending
- * draw quad with light alpha
+ * draw color-less quad with light alpha (WARNING! don't touch color!)
* glEnable(GL_BLEND);
- * gl.glBlendFunc(GL_DST_ALPHA, GL_ONE);
+ * glBlendFunc(GL_DST_ALPHA, GL_ONE);
+ * draw all geometry up to and including walls (with alpha-testing, probably) -- this does lighting
*)
wassc := (glIsEnabled(GL_SCISSOR_TEST) <> 0);
end;
function TPlayer.PickItem(ItemType: Byte; arespawn: Boolean; var remove: Boolean): Boolean;
+
+ function allowBerserkSwitching (): Boolean;
+ begin
+ if (FBFGFireCounter <> -1) then begin result := false; exit; end;
+ result := true;
+ if gBerserkAutoswitch then exit;
+ if not (gDebugMode or gCheats) then exit;
+ result := false;
+ end;
+
var
a: Boolean;
begin
if not (R_BERSERK in FRulez) then
begin
Include(FRulez, R_BERSERK);
- if gBerserkAutoswitch and (gDebugMode or gCheats) and (FBFGFireCounter = -1) then
+ if allowBerserkSwitching then
begin
FCurrWeap := WEAPON_KASTET;
resetWeaponQueue();