ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


source_port_identification

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
source_port_identification [2019/08/26 02:04] korshunsource_port_identification [2019/08/26 03:54] (current) – removed korshun
Line 1: Line 1:
-====== Source port identification ====== 
- 
-===== Introduction ===== 
- 
-You can identify what engine your mod is running in using ACSUtils. This may be useful to avoid using features if they're not present in the engine your mod is running in. 
- 
-<note important>Don't use [[functions:IsGZDoom]] to check for OpenGL renderer. Use [[functions:IsOpenGL]]!</note> 
- 
-===== How it works ===== 
- 
-First, [[zan>GetPlayerAccountName]] is called. It's a Zandronum-exclusive function. It always returns a string (usually an empty string) if it's implemented, while unimplemented ACS functions return 0. Thus, if the function returned something other than zero, it is supported by the engine, and the port is assumed to be Zandronum. 
- 
-If the port is not Zandronum, the detection module attempts to spawn an actor of type [[zdoom>Classes:DynamicLight|DynamicLight]], which is present in GZDoom, but not in ZDoom. If the actor spawns successfully, the port is assumed to be GZDoom. 
- 
-If both these checks fail, the port is assumed to be ZDoom. 
- 
-To avoid rerunning these checks every time you call one of the below functions, they are only run the first time any of the functions is called and the result is stored into a map variable. Subsequent function calls simply read the map variable. 
- 
-===== Functions ===== 
- 
-  * [[functions:IsZDoom]] 
-  * [[functions:IsGZDoom]] 
-  * [[functions:IsZandronum]] 
-  * [[functions:IdentifySourcePort]] 
- 
- 
  
source_port_identification.1566774276.txt.gz · Last modified: 2019/08/26 02:04 by korshun