Skip to content

Commit

Permalink
OPTIMIZE: Changed wall seg rendering. Previously we were calculating …
Browse files Browse the repository at this point in the history
…whether each wall seg, in all visible subsectors faced the viewer at least three times per seg per frame unnecessarily. This calculation is now done once per frame per seg in visible subsectors and seg_t->flags updated with SEGINF_FACINGFRONT if true.

Cleaned up con_bind.c, event bindings are now put into separate arrays depending on event_t->type. This plus the other recent changes enabled for the current code to be simplified greatly.
Fixed numerous compiler warnings pointed out by GCC (thanks Yagisan). General cleanup.
  • Loading branch information
danij committed Oct 11, 2006
1 parent 3edb118 commit 853acd5
Show file tree
Hide file tree
Showing 50 changed files with 1,574 additions and 1,357 deletions.
13 changes: 9 additions & 4 deletions doomsday/engine/api/dd_share.h
Expand Up @@ -482,13 +482,15 @@ extern "C" {
EV_JOY_AXIS, // Joystick main axes (xyz + Rxyz)
EV_JOY_SLIDER, // Joystick sliders
EV_JOY_BUTTON,
EV_POV
EV_POV,
NUM_EVENT_TYPES
} evtype_t;

typedef enum {
EVS_DOWN,
EVS_UP,
EVS_REPEAT,
NUM_EVENT_STATES
} evstate_t;

typedef struct {
Expand All @@ -500,7 +502,8 @@ extern "C" {
int data4;
int data5;
int data6;
int useclass; // use a specific bindclass command
unsigned int useclass; // use a specific bindclass command
boolean noclass;
} event_t;

// The mouse wheel is considered two extra mouse buttons.
Expand Down Expand Up @@ -1118,12 +1121,14 @@ typedef enum blendmode_e {
NUM_DDBINDCLASSES
};

#define BCF_ABSOLUTE 0x00000001

// Bind Class
typedef struct bindclass_s {
char *name;
int id;
unsigned int id;
int active;
int absolute;
int flags;
} bindclass_t;

// Console command.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/api/doomsday.def
Expand Up @@ -5,6 +5,7 @@ NAME "DOOMSDAY"
; Other free ordinals:
; 77 formaly P_LoadBlockMap
; 78 formaly P_LoadReject
; 232 formaly R_SetAnimGroup

EXPORTS
Plug_AddHook @1 NONAME
Expand Down Expand Up @@ -254,7 +255,6 @@ EXPORTS
R_TextureNameForNum @98 NONAME
R_SetFlatTranslation @99 NONAME
R_SetTextureTranslation @100 NONAME
R_SetAnimGroup @232 NONAME
R_PointToAngle2 @101 NONAME
R_PointInSubsector @102 NONAME
R_CreateAnimGroup @241 NONAME
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/api/doomsday.h
Expand Up @@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

Expand Down Expand Up @@ -145,9 +145,10 @@ extern "C" {
void B_FormEventString(char *buff, evtype_t type, evstate_t state,
int data1);
int B_BindingsForCommand(char *command, char *buffer,
int bindClass);
unsigned int classID,
boolean allClasses);
void DD_AddBindClass(struct bindclass_s *);
boolean DD_SetBindClass(int classID, int type);
boolean DD_SetBindClass(unsigned int classID, int type);

// System.
void Sys_TicksPerSecond(float num);
Expand Down Expand Up @@ -339,7 +340,6 @@ extern "C" {
char *R_TextureNameForNum(int num);
int R_SetFlatTranslation(int flat, int translate_to);
int R_SetTextureTranslation(int tex, int translate_to);
void R_SetAnimGroup(int type, int number, int group);
int R_CreateAnimGroup(int type, int flags);
void R_AddToAnimGroup(int groupNum, int number, int tics,
int randomTics);
Expand Down
31 changes: 16 additions & 15 deletions doomsday/engine/portable/include/cl_mobj.h
Expand Up @@ -4,6 +4,7 @@
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2006 Jaakko Keränen <skyjake@dengine.net>
*\author Copyright © 2006 Daniel Swanson <danij@dengine.net>
*
* 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 All @@ -17,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

Expand All @@ -29,12 +30,12 @@
#define __DOOMSDAY_CLIENT_MOBJ_H__

// 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.
#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.

// Clmobj knowledge flags. This keeps track of the information that has been
// received.
Expand All @@ -45,12 +46,12 @@
#define CLMF_KNOWN 0xf0000 // combination of all the KNOWN-flags

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

void Cl_InitClientMobjs();
Expand All @@ -59,12 +60,12 @@ void Cl_DestroyClientMobjs();
clmobj_t *Cl_CreateMobj(thid_t id);
void Cl_DestroyMobj(clmobj_t *cmo);
boolean Cl_MobjIterator(boolean (*callback) (clmobj_t *, void *),
void *parm);
void *parm);
void Cl_PredictMovement(void);
void Cl_UnsetThingPosition(clmobj_t *cmo);
void Cl_SetThingPosition(clmobj_t *cmo);
int Cl_ReadMobjDelta(void);
void Cl_ReadMobjDelta2(boolean allowCreate, boolean skip);
void Cl_ReadMobjDelta2(boolean skip);
void Cl_ReadNullMobjDelta2(boolean skip);
clmobj_t *Cl_FindMobj(thid_t id);
void Cl_CheckMobj(clmobj_t *cmo, boolean justCreated);
Expand Down
15 changes: 10 additions & 5 deletions doomsday/engine/portable/include/con_bind.h
Expand Up @@ -18,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

Expand All @@ -43,12 +43,17 @@ typedef struct {
command_t *commands;
} binding_t;

void B_Bind(event_t *event, char *command, int bindClass);
void B_Init(void);
void B_Bind(event_t *event, char *command,
unsigned int bindClass);
void DD_AddBindClass(struct bindclass_s *);
boolean B_SetBindClass(int classID, int type);
boolean B_SetBindClass(unsigned int classID, unsigned int type);
void B_RegisterBindClasses(void);
int B_BindingsForCommand(char *command, char *buffer, int bindClass);
void B_ClearBinding(char *command, int bindClass);
int B_BindingsForCommand(char *command, char *buffer,
unsigned int bindClass,
boolean allClasses);
void B_ClearBinding(char *command, unsigned int bindClass,
boolean allClasses);
boolean B_Responder(event_t *ev);
void B_WriteToFile(FILE * file);
void B_Shutdown();
Expand Down
3 changes: 2 additions & 1 deletion doomsday/engine/portable/include/net_main.h
Expand Up @@ -4,6 +4,7 @@
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2006 Jaakko Keränen <skyjake@dengine.net>
*\author Copyright © 2006 Daniel Swanson <danij@dengine.net>
*
* 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 @@ -284,7 +285,7 @@ int Net_TimeDelta(byte now, byte then);
void Net_NewLocalCmd(ticcmd_t * cmd, int pNum);
int Net_GetTicCmd(void *cmd, int player);
void Net_Update(void);
void Net_Ticker(timespan_t time);
void Net_Ticker(void/*timespan_t time*/);
void Net_Drawer(void);

boolean Net_IsLocalPlayer(int pNum);
Expand Down
4 changes: 3 additions & 1 deletion doomsday/engine/portable/include/r_data.h
Expand Up @@ -277,7 +277,10 @@ typedef struct shadowlink_s {
shadowpoly_t *poly;
} shadowlink_t;

#define SEGINF_FACINGFRONT 0x0001

typedef struct seginfo_s {
short flags;
biastracker_t tracker[3]; // 0=top, 1=middle, 2=bottom
vertexillum_t illum[3][4];
uint updated;
Expand Down Expand Up @@ -456,7 +459,6 @@ int R_TextureNumForName(char *name);
char *R_TextureNameForNum(int num);
int R_SetFlatTranslation(int flat, int translateTo);
int R_SetTextureTranslation(int tex, int translateTo);
void R_SetAnimGroup(int type, int number, int group);
boolean R_IsCustomTexture(int texture);
boolean R_IsAllowedDecoration(ded_decor_t * def, int index,
boolean hasExternal);
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/include/r_lgrid.h
Expand Up @@ -17,7 +17,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

Expand All @@ -32,7 +32,7 @@

void LG_Register(void);
void LG_Init(void);
void LG_SectorChanged(sector_t *sector, sectorinfo_t *info);
void LG_SectorChanged(sector_t *sector);
void LG_Update(void);
void LG_Evaluate(const float *point, byte *color);
void LG_Debug(void);
Expand Down
10 changes: 7 additions & 3 deletions doomsday/engine/portable/include/sys_sock.h
Expand Up @@ -4,6 +4,7 @@
* Online License Link: http://www.gnu.org/licenses/gpl.html
*
*\author Copyright © 2003-2006 Jaakko Keränen <skyjake@dengine.net>
*\author Copyright © 2006 Daniel Swanson <danij@dengine.net>
*
* 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 All @@ -17,7 +18,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301 USA
*/

Expand All @@ -30,15 +31,18 @@

#include "dd_types.h"

typedef unsigned int socket_t;
// DJS - this was unsigned, however socket() will return a signed
// value depending on the outcome. Which we check against a signed
// value in several places in the code.
typedef int socket_t;

void N_SockInit(void);
void N_SockShutdown(void);
void N_SockPrintf(socket_t s, const char *format, ...);
struct hostent *N_SockGetHost(const char *hostName);
socket_t N_SockNewStream(void);
boolean N_SockConnect(socket_t s, struct hostent *host,
unsigned short port);
unsigned short port);
void N_SockClose(socket_t s);

#endif

0 comments on commit 853acd5

Please sign in to comment.