Skip to content

Commit cbddd4a

Browse files
committed
Revert some changes that were causing rendering issues
At least in medium quality, before joining a server, the OpenGL state was not being set up correctly with these changes in place. The menu opacity looked wrong. Revert "Fix radar area blurring with fully opaque radar before a world exists" This reverts commit ade47c9. Revert "Fix crashes when world is null after connect spam" This reverts commit 070d498.
1 parent 95f8222 commit cbddd4a

File tree

3 files changed

+10
-22
lines changed

3 files changed

+10
-22
lines changed

src/bzflag/BackgroundRenderer.cxx

+1-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "MainWindow.h"
3232
#include "SceneNode.h"
3333
#include "effectsRenderer.h"
34-
#include "World.h"
3534

3635
static const GLfloat squareShape[4][2] =
3736
{
@@ -665,8 +664,7 @@ void BackgroundRenderer::renderGroundEffects(SceneRenderer& renderer,
665664

666665
if (!blank)
667666
{
668-
const World *_world = World::getWorld();
669-
if (doShadows && shadowsVisible && !drawingMirror && _world)
667+
if (doShadows && shadowsVisible && !drawingMirror)
670668
drawGroundShadows(renderer);
671669

672670
// draw light receivers on ground (little meshes under light sources so

src/bzflag/SceneRenderer.cxx

+4-7
Original file line numberDiff line numberDiff line change
@@ -856,18 +856,14 @@ void SceneRenderer::renderScene(bool UNUSED(_lastFrame), bool UNUSED(_sameFrame)
856856
int i;
857857
const bool lightLists = BZDB.isTrue("lightLists");
858858

859-
const World* world = World::getWorld();
860-
861-
862859
// avoid OpenGL calls as long as possible -- there's a good
863860
// chance we're waiting on the vertical retrace.
864861

865862
// get a list of the dynamic lights
866863
getLights();
867864

868865
// get the obstacle sceneNodes and shadowNodes
869-
if (world)
870-
getRenderNodes();
866+
getRenderNodes();
871867

872868
// prepare transforms
873869
// note -- lights should not be positioned before view is set
@@ -995,16 +991,17 @@ void SceneRenderer::renderScene(bool UNUSED(_lastFrame), bool UNUSED(_sameFrame)
995991
if (useHiddenLineOn)
996992
glEnable(GL_POLYGON_OFFSET_FILL);
997993

994+
998995
///////////////////////
999996
// THE BIG RENDERING //
1000997
///////////////////////
1001-
if (world)
1002-
doRender();
998+
doRender();
1003999

10041000

10051001
if (scene && BZDBCache::showCullingGrid)
10061002
scene->drawCuller();
10071003

1004+
const World* world = World::getWorld();
10081005
if (scene && BZDBCache::showCollisionGrid && (world != NULL))
10091006
world->drawCollisionGrid();
10101007

src/bzflag/playing.cxx

+5-12
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,6 @@ static void handleServerMessage(bool human, uint16_t code,
20162016
{
20172017
bool checkScores = false;
20182018
static WordFilter *wordfilter = (WordFilter *)BZDB.getPointer("filter");
2019-
const World *_world = World::getWorld();
20202019

20212020
switch (code)
20222021
{
@@ -2341,10 +2340,7 @@ static void handleServerMessage(bool human, uint16_t code,
23412340
for (int i = 0; i < numTeams; i++)
23422341
{
23432342
msg = nboUnpackUShort(msg, team);
2344-
Team uTeam;
2345-
msg = uTeam.unpack(msg);
2346-
if (_world)
2347-
teams[int(team)] = uTeam;
2343+
msg = teams[int(team)].unpack(msg);
23482344
}
23492345
checkScores = true;
23502346
break;
@@ -5743,10 +5739,8 @@ static void drawUI()
57435739
hud->setFrameRadarTriangleCount(0);
57445740
}
57455741

5746-
const World *_world = World::getWorld();
5747-
57485742
// update the HUD (player list, alerts)
5749-
if (_world && hud)
5743+
if (World::getWorld() && hud)
57505744
hud->render(*sceneRenderer);
57515745

57525746
// draw the control panel
@@ -6124,8 +6118,7 @@ void drawFrame(const float dt)
61246118

61256119
// add dynamic nodes
61266120
SceneDatabase* scene = sceneRenderer->getSceneDatabase();
6127-
World *_world = World::getWorld();
6128-
if (scene && myTank && _world)
6121+
if (scene && myTank && world)
61296122
{
61306123

61316124
int i;
@@ -7324,7 +7317,7 @@ static void playingLoop()
73247317
}
73257318

73267319
// do motion
7327-
if (myTank && _world)
7320+
if (myTank && world)
73287321
{
73297322
if (myTank->isAlive() && !myTank->isPaused())
73307323
{
@@ -7374,7 +7367,7 @@ static void playingLoop()
73747367
#endif
73757368

73767369
// adjust properties based on flags (dimensions, cloaking, etc...)
7377-
if (myTank && _world)
7370+
if (myTank)
73787371
myTank->updateTank(dt, true);
73797372
for (i = 0; i < curMaxPlayers; i++)
73807373
{

0 commit comments

Comments
 (0)