Skip to content

Commit

Permalink
Fixed problems caused by merge
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 19, 2004
1 parent 69433cb commit ab178dc
Show file tree
Hide file tree
Showing 9 changed files with 86 additions and 111 deletions.
32 changes: 1 addition & 31 deletions doomsday/Include/cl_def.h
@@ -1,5 +1,5 @@
/* DE1: $Id$
* Copyright (C) 2003 Jaakko Ker�en <jaakko.keranen@iki.fi>
* Copyright (C) 2003 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -29,36 +29,6 @@

extern id_t clientID;
extern int serverTime;

// Flags for clmobjs.
#define CLMF_HIDDEN 0x01 // Not officially created yet
#define CLMF_UNPREDICTABLE 0x02 // Temporarily hidden (until next delta)
#define CLMF_SOUND 0x04 // Sound is queued for playing on unhide.
#define CLMF_NULLED 0x08 // Once nulled, it can't be updated.
#define CLMF_STICK_FLOOR 0x10 // Mobj will stick to the floor.
#define CLMF_STICK_CEILING 0x20 // Mobj will stick to the ceiling.

typedef struct clmobj_s
{
struct clmobj_s *next, *prev;
byte flags;
uint time; // Time of last update.
int sound; // Queued sound ID.
float volume; // Volume for queued sound.
mobj_t mo;
} clmobj_t;

typedef struct playerstate_s
{
clmobj_t *cmo;
thid_t mobjid;
int forwardmove;
int sidemove;
int angle;
angle_t turndelta;
int friction;
} playerstate_t;

extern boolean handshakeReceived;
extern int gameReady;
extern boolean netLoggedIn;
Expand Down
2 changes: 2 additions & 0 deletions doomsday/Include/cl_mobj.h
Expand Up @@ -27,6 +27,8 @@
#define CLMF_UNPREDICTABLE 0x02 // Temporarily hidden (until next delta)
#define CLMF_SOUND 0x04 // Sound is queued for playing on unhide.
#define CLMF_NULLED 0x08 // Once nulled, it can't be updated.
#define CLMF_STICK_FLOOR 0x10 // Mobj will stick to the floor.
#define CLMF_STICK_CEILING 0x20 // Mobj will stick to the ceiling.

typedef struct clmobj_s {
struct clmobj_s *next, *prev;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/Include/dd_share.h
@@ -1,5 +1,5 @@
/* DE1: $Id$
* Copyright (C) 2003 Jaakko Ker�en <jaakko.keranen@iki.fi>
* Copyright (C) 2003 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
4 changes: 3 additions & 1 deletion doomsday/Include/dd_types.h
@@ -1,5 +1,5 @@
/* DE1: $Id$
* Copyright (C) 2003 Jaakko Ker�en <jaakko.keranen@iki.fi>
* Copyright (C) 2003 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -37,6 +37,8 @@ typedef unsigned short ushort;
typedef unsigned int size_t;
#endif

typedef int fixed_t;
typedef unsigned int angle_t;
typedef int spritenum_t;
typedef unsigned int ident_t;
typedef unsigned short nodeindex_t;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/Include/dglib.h
@@ -1,5 +1,5 @@
/* DE1: $Id$
* Copyright (C) 2003 Jaakko Ker�en <jaakko.keranen@iki.fi>
* Copyright (C) 2003 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
3 changes: 1 addition & 2 deletions doomsday/Src/con_main.c
Expand Up @@ -1553,8 +1553,7 @@ void Con_SplitIntoSubCommands(const char *command, timespan_t markerOffset)
{
int gPos = 0, scPos = 0;
char subCmd[2048];
int nextSub = false;
int ret = true, inQuotes = false, escape = false;
int inQuotes = false, escape = false;

// Is there a command to execute?
if(!command || command[0] == 0) return;
Expand Down
123 changes: 60 additions & 63 deletions doomsday/Src/def_main.c
Expand Up @@ -49,8 +49,7 @@

// TYPES -------------------------------------------------------------------

typedef struct
{
typedef struct {
char *name; // Name of the routine.
void (C_DECL *func)(); // Pointer to the function.
} actionlink_t;
Expand Down Expand Up @@ -370,29 +369,6 @@ void Def_InitTextDef(ddtext_t *txt, char *str)
txt->text = realloc(txt->text, strlen(txt->text) + 1);
}

/*
//===========================================================================
// Def_ReadIncludedDEDs
//===========================================================================
void Def_ReadIncludedDEDs(directory_t *mydir)
{
char fn[256];
// Also read the files that were listed as includes.
while(defs.count.includes.num > 0)
{
strcpy(fn, defs.includes[0].path);
// Remove the name from the list before reading it.
// This'll prevent re-reading.
DED_DelEntry(0, &defs.includes, &defs.count.includes,
sizeof(*defs.includes));
Def_ReadProcessDED(fn);
// Back to our dir.
Dir_ChDir(mydir);
}
}
*/

//===========================================================================
// Def_ReadDEDFile
// Callback for DD_ReadProcessDED.
Expand Down Expand Up @@ -423,37 +399,30 @@ int Def_ReadDEDFile(const char *fn, filetype_t type, void *parm)
//===========================================================================
void Def_ReadProcessDED(const char *fileName)
{
char fn[256];
directory_t oldDir;
filename_t fn, fullFn;
directory_t dir;
boolean changed = false;

Dir_GetDir(&oldDir);

// Change to the directory of the file we're about to read.
Dir_FileName(fileName, fn);
Dir_FileDir(fileName, &dir);

if(!Dir_IsEqual(&dir, &oldDir))
// We want an absolute path.
if(!Dir_IsAbsolute(fileName))
{
changed = true;
if(!Dir_ChDir(&dir))
{
// The directory doesn't exist, which means the DED file
// doesn't, either.
return;
}
Dir_FileDir(fileName, &dir);
sprintf(fullFn, "%s%s", dir.path, fn);
}
else
{
strcpy(fullFn, fileName);
}

if(strchr(fn, '*') || strchr(fn, '?'))
F_ForAll(fn, 0, Def_ReadDEDFile);
{
// Wildcard search.
F_ForAll(fullFn, 0, Def_ReadDEDFile);
}
else
Def_ReadDEDFile(fn, FT_NORMAL, 0);

if(changed)
{
// Back to the original directory.
Dir_ChDir(&oldDir);
Def_ReadDEDFile(fullFn, FT_NORMAL, 0);
}
}

Expand Down Expand Up @@ -491,9 +460,6 @@ void Def_ReadLumpDefs(void)
Con_Message("ReadLumpDefs: %i definition lump%s read.\n",
c, c != 1? "s" : "");
}

// Read any included files.
//Def_ReadIncludedDEDs(&ddRuntimeDir);
}

//===========================================================================
Expand Down Expand Up @@ -548,14 +514,10 @@ void Def_Read(void)

for(read_count = 0, i = 0; dedFiles[i]; i++)
{
Dir_ChDir(&ddRuntimeDir);
Con_Message("Reading definition file: %s\n", M_Pretty(dedFiles[i]));
Def_ReadProcessDED(dedFiles[i]);
}

// Back to the directory we started from.
Dir_ChDir(&ddRuntimeDir);

// Read definitions from WAD files.
Def_ReadLumpDefs();

Expand Down Expand Up @@ -712,18 +674,53 @@ void Def_Read(void)
// Particle generators.
for(i = 0; i < defs.count.ptcgens.num; i++)
{
int st = Def_GetStateNum(defs.ptcgens[i].state);
if(defs.ptcgens[i].flat[0])
defs.ptcgens[i].flat_num = W_CheckNumForName(defs.ptcgens[i].flat);
ded_ptcgen_t *pg = defs.ptcgens + i;
int st = Def_GetStateNum(pg->state);
if(pg->flat[0])
pg->flat_num = W_CheckNumForName(pg->flat);
else
defs.ptcgens[i].flat_num = -1;
//defs.ptcgens[i].flags = Def_EvalFlags(defs.ptcgens[i].flags_string);
defs.ptcgens[i].type_num = Def_GetMobjNum(defs.ptcgens[i].type);
defs.ptcgens[i].type2_num = Def_GetMobjNum(defs.ptcgens[i].type2);
defs.ptcgens[i].damage_num = Def_GetMobjNum(defs.ptcgens[i].damage);
pg->flat_num = -1;
pg->type_num = Def_GetMobjNum(pg->type);
pg->type2_num = Def_GetMobjNum(pg->type2);
pg->damage_num = Def_GetMobjNum(pg->damage);

// Figure out embedded sound ID numbers.
for(k = 0; k < DED_PTC_STAGES; k++)
{
if(pg->stages[k].sound.name[0])
{
pg->stages[k].sound.id
= Def_GetSoundNum(pg->stages[k].sound.name);
}
if(pg->stages[k].hit_sound.name[0])
{
pg->stages[k].hit_sound.id
= Def_GetSoundNum(pg->stages[k].hit_sound.name);
}
}

if(st <= 0) continue; // Not state triggered, then...
// A pointer to the definition.
states[st].ptrigger = defs.ptcgens + i;

// Link the definition to the state.
if(pg->flags & PGF_STATE_CHAIN)
{
// Add to the chain.
pg->state_next = states[st].ptrigger;
states[st].ptrigger = pg;
}
else
{
// Make sure the previously built list is unlinked.
while(states[st].ptrigger)
{
ded_ptcgen_t *temp =
((ded_ptcgen_t*)states[st].ptrigger)->state_next;
((ded_ptcgen_t*)states[st].ptrigger)->state_next = NULL;
states[st].ptrigger = temp;
}
states[st].ptrigger = pg;
pg->state_next = NULL;
}
}
Def_CountMsg(defs.count.ptcgens.num, "particle generators");

Expand Down
2 changes: 1 addition & 1 deletion doomsday/Src/m_misc.c
@@ -1,5 +1,5 @@
/* DE1: $Id$
* Copyright (C) 2003 Jaakko Ker�en <jaakko.keranen@iki.fi>
* Copyright (C) 2003 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down
27 changes: 16 additions & 11 deletions doomsday/Src/net_main.c
@@ -1,5 +1,5 @@
/* DE1: $Id$
* Copyright (C) 2003 Jaakko Ker�en <jaakko.keranen@iki.fi>
* Copyright (C) 2003 Jaakko Keränen <jaakko.keranen@iki.fi>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -65,16 +65,21 @@ extern void ST_NetDone(void);

// PUBLIC DATA DEFINITIONS -------------------------------------------------

ddplayer_t players[MAXPLAYERS];
client_t clients[MAXPLAYERS];// All network data for the players.
char *serverName = "Doomsday";
char *serverInfo = "Multiplayer Host";
char *playerName = "Player";
int serverData[3]; // Some parameters passed to master server.

int netgame; // true if a netgame is in progress
int isServer; // true if this computer is an open server.
int isClient; // true if this computer is a client
int consoleplayer;
int displayplayer;
ddplayer_t players[MAXPLAYERS];
client_t clients[MAXPLAYERS];// All network data for the players.

int gametic;
int netgame; // true if a netgame is in progress
int isServer; // true if this computer is an open server.
int isClient; // true if this computer is a client
int consoleplayer;
int displayplayer;

int gametic;

// Gotframe is true if a frame packet has been received.
int gotframe = false;
Expand Down Expand Up @@ -177,7 +182,7 @@ void Net_SendBuffer(int toPlayer, int spFlags)
netBuffer.player = toPlayer;

// A rebound packet?
if(spFlags & SPF_REBOUND_FROM)
if(spFlags & SPF_REBOUND)
{
reboundstore = netBuffer;
reboundpacket = true;
Expand Down Expand Up @@ -422,7 +427,7 @@ void Net_SendCommandsToServer(timespan_t time)
Msg_Write(msg + 2, *(ushort*) msg);

// Send the packet to the server, i.e. player zero.
Net_SendBuffer(0, isClient? 0 : (SPF_REBOUND_FROM | i));
Net_SendBuffer(0, isClient? 0 : (SPF_REBOUND | i));

// The buffer is cleared.
clients[i].numLocal = 0;
Expand Down

0 comments on commit ab178dc

Please sign in to comment.