Skip to content

Commit d213b91

Browse files
author
Aitor Moreno
committed
Minor fixes
1 parent 619e697 commit d213b91

File tree

3 files changed

+58
-51
lines changed

3 files changed

+58
-51
lines changed

doom.html

+5-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
<meta name="twitter:site" content="@azazeln28">
99
<meta name="twitter:creator" content="@azazeln28">
1010
<!-- Facebook Open Graph -->
11-
<meta property="og:url" content="https://azazeln28.neocities.org/games/doom" />
12-
<meta property="og:title" content="DOOM" />
13-
<meta property="og:description" content="DOOM® is a registered trademark of ZeniMax Media Inc. in the US and/or other countries. Id Software® is a registered trademark of ZeniMax Media Inc. in the US and/or other countries. WebDOOM is in no way affiliated with ZeniMax Media Inc. or id Software LLC and is not approved by ZeniMax Media Inc. or id Software." />
14-
<meta property="og:image" content="https://azazeln28.neocities.org/games/doom/cover.png" />
11+
<meta property="og:type" content="website">
12+
<meta property="og:url" content="https://azazeln28.neocities.org/games/doom">
13+
<meta property="og:title" content="DOOM">
14+
<meta property="og:description" content="DOOM® is a registered trademark of ZeniMax Media Inc. in the US and/or other countries. Id Software® is a registered trademark of ZeniMax Media Inc. in the US and/or other countries. WebDOOM is in no way affiliated with ZeniMax Media Inc. or id Software LLC and is not approved by ZeniMax Media Inc. or id Software.">
15+
<meta property="og:image" content="https://azazeln28.neocities.org/games/doom/cover.png">
1516
<link href="https://fonts.googleapis.com/css?family=Teko&display=swap" rel="stylesheet">
1617
<title>DOOM</title>
1718
<style>

src/doom/d_main.c

+25-23
Original file line numberDiff line numberDiff line change
@@ -148,9 +148,10 @@ void D_ProcessEvents (void)
148148

149149
while ((ev = D_PopEvent()) != NULL)
150150
{
151-
if (M_Responder (ev))
152-
continue; // menu ate the event
153-
G_Responder (ev);
151+
if (M_Responder (ev)) {
152+
continue; // menu ate the event
153+
}
154+
G_Responder (ev);
154155
}
155156
}
156157

@@ -297,36 +298,37 @@ void D_Display (void)
297298
else
298299
wipe = false;
299300

300-
if (gamestate == GS_LEVEL && gametic)
301-
HU_Erase();
301+
if (gamestate == GS_LEVEL && gametic) {
302+
HU_Erase();
303+
}
302304

303305
// do buffered drawing
304306
switch (gamestate)
305307
{
306308
case GS_LEVEL:
307-
if (!gametic)
309+
if (!gametic)
310+
break;
311+
if (automapactive)
312+
AM_Drawer ();
313+
if (wipe || (viewheight != SCREENHEIGHT && fullscreen))
314+
redrawsbar = true;
315+
if (inhelpscreensstate && !inhelpscreens)
316+
redrawsbar = true; // just put away the help screen
317+
ST_Drawer (viewheight == SCREENHEIGHT, redrawsbar );
318+
fullscreen = viewheight == SCREENHEIGHT;
308319
break;
309-
if (automapactive)
310-
AM_Drawer ();
311-
if (wipe || (viewheight != SCREENHEIGHT && fullscreen))
312-
redrawsbar = true;
313-
if (inhelpscreensstate && !inhelpscreens)
314-
redrawsbar = true; // just put away the help screen
315-
ST_Drawer (viewheight == SCREENHEIGHT, redrawsbar );
316-
fullscreen = viewheight == SCREENHEIGHT;
317-
break;
318320

319321
case GS_INTERMISSION:
320-
WI_Drawer ();
321-
break;
322+
WI_Drawer ();
323+
break;
322324

323325
case GS_FINALE:
324-
F_Drawer ();
325-
break;
326+
F_Drawer ();
327+
break;
326328

327329
case GS_DEMOSCREEN:
328-
D_PageDrawer ();
329-
break;
330+
D_PageDrawer ();
331+
break;
330332
}
331333

332334
// draw buffered stuff to screen
@@ -346,8 +348,8 @@ void D_Display (void)
346348
// see if the border needs to be initially drawn
347349
if (gamestate == GS_LEVEL && oldgamestate != GS_LEVEL)
348350
{
349-
viewactivestate = false; // view was not active
350-
R_FillBackScreen (); // draw the pattern into the back screen
351+
viewactivestate = false; // view was not active
352+
R_FillBackScreen (); // draw the pattern into the back screen
351353
}
352354

353355
// see if the border needs to be updated to the screen

src/doom/p_user.c

+28-24
Original file line numberDiff line numberDiff line change
@@ -150,16 +150,18 @@ void P_MovePlayer (player_t* player)
150150
// if not onground.
151151
onground = (player->mo->z <= player->mo->floorz);
152152

153-
if (cmd->forwardmove && onground)
154-
P_Thrust (player, player->mo->angle, cmd->forwardmove*2048);
153+
if (cmd->forwardmove && onground) {
154+
P_Thrust (player, player->mo->angle, cmd->forwardmove*2048);
155+
}
155156

156-
if (cmd->sidemove && onground)
157-
P_Thrust (player, player->mo->angle-ANG90, cmd->sidemove*2048);
157+
if (cmd->sidemove && onground) {
158+
P_Thrust (player, player->mo->angle-ANG90, cmd->sidemove*2048);
159+
}
158160

159161
if ( (cmd->forwardmove || cmd->sidemove)
160162
&& player->mo->state == &states[S_PLAY] )
161163
{
162-
P_SetMobjState (player->mo, S_PLAY_RUN1);
164+
P_SetMobjState (player->mo, S_PLAY_RUN1);
163165
}
164166
}
165167

@@ -233,45 +235,47 @@ void P_PlayerThink (player_t* player)
233235

234236
// fixme: do this in the cheat code
235237
if (player->cheats & CF_NOCLIP)
236-
player->mo->flags |= MF_NOCLIP;
238+
player->mo->flags |= MF_NOCLIP;
237239
else
238-
player->mo->flags &= ~MF_NOCLIP;
240+
player->mo->flags &= ~MF_NOCLIP;
239241

240242
// chain saw run forward
241243
cmd = &player->cmd;
242244
if (player->mo->flags & MF_JUSTATTACKED)
243245
{
244-
cmd->angleturn = 0;
245-
cmd->forwardmove = 0xc800/512;
246-
cmd->sidemove = 0;
247-
player->mo->flags &= ~MF_JUSTATTACKED;
246+
cmd->angleturn = 0;
247+
cmd->forwardmove = 0xc800/512;
248+
cmd->sidemove = 0;
249+
player->mo->flags &= ~MF_JUSTATTACKED;
248250
}
249251

250252

251253
if (player->playerstate == PST_DEAD)
252254
{
253-
P_DeathThink (player);
254-
return;
255+
P_DeathThink (player);
256+
return;
255257
}
256258

257259
// Move around.
258260
// Reactiontime is used to prevent movement
259261
// for a bit after a teleport.
260262
if (player->mo->reactiontime)
261-
player->mo->reactiontime--;
263+
player->mo->reactiontime--;
262264
else
263-
P_MovePlayer (player);
265+
P_MovePlayer (player);
264266

265267
P_CalcHeight (player);
266268

267-
if (player->mo->subsector->sector->special)
268-
P_PlayerInSpecialSector (player);
269+
if (player->mo->subsector->sector->special) {
270+
P_PlayerInSpecialSector (player);
271+
}
269272

270273
// Check for weapon change.
271274

272275
// A special event has no other buttons.
273-
if (cmd->buttons & BT_SPECIAL)
274-
cmd->buttons = 0;
276+
if (cmd->buttons & BT_SPECIAL) {
277+
cmd->buttons = 0;
278+
}
275279

276280
if (cmd->buttons & BT_CHANGE)
277281
{
@@ -314,11 +318,11 @@ void P_PlayerThink (player_t* player)
314318
// check for use
315319
if (cmd->buttons & BT_USE)
316320
{
317-
if (!player->usedown)
318-
{
319-
P_UseLines (player);
320-
player->usedown = true;
321-
}
321+
if (!player->usedown)
322+
{
323+
P_UseLines (player);
324+
player->usedown = true;
325+
}
322326
}
323327
else
324328
player->usedown = false;

0 commit comments

Comments
 (0)