-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backport linkent for hlds (and listenserver) without rehlds
- Loading branch information
Showing
13 changed files
with
536 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
// vi: set ts=4 sw=4 : | ||
// vim: set tw=75 : | ||
|
||
// linkent.h - export entities from mod "games" back to the HL engine | ||
|
||
/* | ||
* Copyright (c) 2001-2006 Will Day <[email protected]> | ||
* | ||
* This file is part of Metamod. | ||
* | ||
* Metamod is free software; you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by the | ||
* Free Software Foundation; either version 2 of the License, or (at | ||
* your option) any later version. | ||
* | ||
* Metamod is distributed in the hope that it will be useful, but | ||
* WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
* General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with Metamod; if not, write to the Free Software Foundation, | ||
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
* | ||
* In addition, as a special exception, the author gives permission to | ||
* link the code of this program with the Half-Life Game Engine ("HL | ||
* Engine") and Modified Game Libraries ("MODs") developed by Valve, | ||
* L.L.C ("Valve"). You must obey the GNU General Public License in all | ||
* respects for all of the code used other than the HL Engine and MODs | ||
* from Valve. If you modify this file, you may extend this exception | ||
* to your version of the file, but you are not obligated to do so. If | ||
* you do not wish to do so, delete this exception statement from your | ||
* version. | ||
* | ||
*/ | ||
|
||
#pragma once | ||
|
||
// Initializes replacement code | ||
bool meta_init_linkent_replacement(CSysModule *moduleMetamod, CSysModule *moduleGame); | ||
|
||
// Comments from SDK dlls/util.h: | ||
//! This is the glue that hooks .MAP entity class names to our CPP classes. | ||
//! The _declspec forces them to be exported by name so we can do a lookup with GetProcAddress(). | ||
//! The function is used to intialize / allocate the object for the entity. | ||
|
||
// Adapted from LINK_ENTITY_TO_FUNC in adminmod linkfunc.cpp. | ||
typedef void (*ENTITY_FN)(entvars_t *); | ||
|
||
// Function to perform common code of LINK_ENTITY_TO_GAME. | ||
void do_link_ent(ENTITY_FN* pfnEntity, int* missing, const char* entStr, entvars_t* pev); | ||
|
||
#define LINK_ENTITY_TO_GAME(entityName) \ | ||
C_DLLEXPORT void entityName(entvars_t *pev) { \ | ||
static ENTITY_FN pfnEntity = nullptr; \ | ||
static int missing = 0; \ | ||
do_link_ent(&pfnEntity, &missing, STRINGIZE(entityName, 0), pev); \ | ||
} | ||
typedef void (*ENTITY_FN) (entvars_t *); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.