halflife-photomode/engine/progs.h

75 lines
1.9 KiB
C
Raw Normal View History

/***
2013-08-30 13:34:05 -07:00
*
* Copyright (c) 1996-2002, Valve LLC. All rights reserved.
*
* This product contains software technology licensed from Id
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
* All Rights Reserved.
*
* Use, distribution, and modification of this source code and/or resulting
* object code is restricted to non-commercial enhancements to products from
* Valve LLC. All other use, distribution, or modification is prohibited
* without written permission from Valve LLC.
*
****/
#pragma once
2013-08-30 13:34:05 -07:00
#include "progdefs.h"
// 16 simultaneous events, max
#define MAX_EVENT_QUEUE 64
#define DEFAULT_EVENT_RESENDS 1
#include "event_flags.h"
typedef struct event_info_s event_info_t;
#include "event_args.h"
struct event_info_s
{
unsigned short index; // 0 implies not in use
2013-08-30 13:34:05 -07:00
short packet_index; // Use data from state info for entity in delta_packet . -1 implies separate info based on event
// parameter signature
short entity_index; // The edict this event is associated with
2013-08-30 13:34:05 -07:00
float fire_time; // if non-zero, the time when the event should be fired ( fixed up on the client )
2013-08-30 13:34:05 -07:00
event_args_t args;
2013-08-30 13:34:05 -07:00
// CLIENT ONLY
int flags; // Reliable or not, etc.
2013-08-30 13:34:05 -07:00
};
typedef struct event_state_s event_state_t;
struct event_state_s
{
struct event_info_s ei[MAX_EVENT_QUEUE];
2013-08-30 13:34:05 -07:00
};
#include "entity_state.h"
#include "edict.h"
#define STRUCT_FROM_LINK(l, t, m) ((t*)((byte*)l - (int)&(((t*)0)->m)))
#define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l, edict_t, area)
2013-08-30 13:34:05 -07:00
//============================================================================
extern char* pr_strings;
extern globalvars_t gGlobalVariables;
2013-08-30 13:34:05 -07:00
//============================================================================
edict_t* ED_Alloc(void);
void ED_Free(edict_t* ed);
void ED_LoadFromFile(char* data);
2013-08-30 13:34:05 -07:00
edict_t* EDICT_NUM(int n);
int NUM_FOR_EDICT(const edict_t* e);
2013-08-30 13:34:05 -07:00
#define PROG_TO_EDICT(e) ((edict_t*)((byte*)sv.edicts + e))