Skip to content

Commit

Permalink
Add special source files for statically linking specific projects.
Browse files Browse the repository at this point in the history
  • Loading branch information
DreamyCecil committed Jul 11, 2024
1 parent cedffb3 commit 401b5bc
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Sources/StaticAPI/EntitiesMP.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright (c) 2024 Dreamy Cecil
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */

#ifdef NDEBUG
#pragma comment(lib, "EntitiesMP.lib")
#else
#pragma comment(lib, "EntitiesMPD.lib")
#endif

#if defined(SE1_STATIC_BUILD)
#include "Misc/EntitiesClasses.inl"
#endif
33 changes: 33 additions & 0 deletions Sources/StaticAPI/Misc/EngineClasses.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/* Copyright (c) 2024 Dreamy Cecil
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */

// [Cecil] NOTE: This is a list of all entity classes from the Engine project
// This file can be included inline to generate functions, arrays or any other structures
// with all classes in alphabetical order by redefining custom macro functions below

// Define a reference to the dynamic module class by default for creating an external dummy dependency
#ifndef ES_CLASS_INLINE
#define ES_CLASS_INLINE(_Class) \
extern DynamicModuleClass _Class##_AddToRegistry; \
void *__##_Class##_Include__ = &_Class##_AddToRegistry;
#endif

ES_CLASS_INLINE(CEntity)
ES_CLASS_INLINE(CLiveEntity)
ES_CLASS_INLINE(CMovableBrushEntity)
ES_CLASS_INLINE(CMovableEntity)
ES_CLASS_INLINE(CMovableModelEntity)
ES_CLASS_INLINE(CPlayerEntity)
ES_CLASS_INLINE(CRationalEntity)
165 changes: 165 additions & 0 deletions Sources/StaticAPI/Misc/EntitiesClasses.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
/* Copyright (c) 2024 Dreamy Cecil
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */

// [Cecil] NOTE: This is a list of all entity classes from the EntitiesMP project
// This file can be included inline to generate functions, arrays or any other structures
// with all classes in alphabetical order by redefining custom macro functions below

// Define a reference to the dynamic module class by default for creating an external dummy dependency
#ifndef ES_CLASS_INLINE
#define ES_CLASS_INLINE(_Class) \
extern DynamicModuleClass _Class##_AddToRegistry; \
void *__##_Class##_Include__ = &_Class##_AddToRegistry;
#endif

ES_CLASS_INLINE(CAirElemental)
ES_CLASS_INLINE(CAirShockwave)
ES_CLASS_INLINE(CAmmoItem)
ES_CLASS_INLINE(CAmmoPack)
ES_CLASS_INLINE(CAnimationChanger)
ES_CLASS_INLINE(CAnimationHub)
ES_CLASS_INLINE(CAreaMarker)
ES_CLASS_INLINE(CArmorItem)
ES_CLASS_INLINE(CBackgroundViewer)
ES_CLASS_INLINE(CBasicEffect)
ES_CLASS_INLINE(CBeast)
ES_CLASS_INLINE(CBigHead)
ES_CLASS_INLINE(CBlendController)
ES_CLASS_INLINE(CBloodSpray)
ES_CLASS_INLINE(CBoneman)
ES_CLASS_INLINE(CBouncer)
ES_CLASS_INLINE(CBullet)
ES_CLASS_INLINE(CCamera)
ES_CLASS_INLINE(CCameraMarker)
ES_CLASS_INLINE(CCannonBall)
ES_CLASS_INLINE(CCannonRotating)
ES_CLASS_INLINE(CCannonStatic)
ES_CLASS_INLINE(CChainsawFreak)
ES_CLASS_INLINE(CCopier)
ES_CLASS_INLINE(CCounter)
ES_CLASS_INLINE(CCrateBus)
ES_CLASS_INLINE(CCrateRider)
ES_CLASS_INLINE(CCreditsHolder)
ES_CLASS_INLINE(CDamager)
ES_CLASS_INLINE(CDebris)
ES_CLASS_INLINE(CDemon)
ES_CLASS_INLINE(CDestroyableArchitecture)
ES_CLASS_INLINE(CDevil)
ES_CLASS_INLINE(CDevilMarker)
ES_CLASS_INLINE(CDevilProjectile)
ES_CLASS_INLINE(CDoorController)
ES_CLASS_INLINE(CEffectMarker)
ES_CLASS_INLINE(CEffector)
ES_CLASS_INLINE(CElemental)
ES_CLASS_INLINE(CEnemyBase)
ES_CLASS_INLINE(CEnemyCounter)
ES_CLASS_INLINE(CEnemyDive)
ES_CLASS_INLINE(CEnemyFly)
ES_CLASS_INLINE(CEnemyMarker)
ES_CLASS_INLINE(CEnemyRunInto)
ES_CLASS_INLINE(CEnemySpawner)
ES_CLASS_INLINE(CEntityStateDisplay)
ES_CLASS_INLINE(CEnvironmentBase)
ES_CLASS_INLINE(CEnvironmentMarker)
ES_CLASS_INLINE(CEnvironmentParticlesHolder)
ES_CLASS_INLINE(CEruptor)
ES_CLASS_INLINE(CExotechLarva)
ES_CLASS_INLINE(CExotechLarvaBattery)
ES_CLASS_INLINE(CExotechLarvaCharger)
ES_CLASS_INLINE(CEyeman)
ES_CLASS_INLINE(CFireworks)
ES_CLASS_INLINE(CFish)
ES_CLASS_INLINE(CFlame)
ES_CLASS_INLINE(CFogMarker)
ES_CLASS_INLINE(CGizmo)
ES_CLASS_INLINE(CGradientMarker)
ES_CLASS_INLINE(CGravityMarker)
ES_CLASS_INLINE(CGravityRouter)
ES_CLASS_INLINE(CGrunt)
ES_CLASS_INLINE(CGruntSka)
ES_CLASS_INLINE(CGuffy)
ES_CLASS_INLINE(CHazeMarker)
ES_CLASS_INLINE(CHeadman)
ES_CLASS_INLINE(CHealthItem)
ES_CLASS_INLINE(CHudPicHolder)
ES_CLASS_INLINE(CItem)
ES_CLASS_INLINE(CKeyItem)
ES_CLASS_INLINE(CLarvaOffspring)
ES_CLASS_INLINE(CLight)
ES_CLASS_INLINE(CLightning)
ES_CLASS_INLINE(CMarker)
ES_CLASS_INLINE(CMessageHolder)
ES_CLASS_INLINE(CMessageItem)
ES_CLASS_INLINE(CMeteorShower)
ES_CLASS_INLINE(CMirrorMarker)
ES_CLASS_INLINE(CModelDestruction)
ES_CLASS_INLINE(CModelHolder)
ES_CLASS_INLINE(CModelHolder2)
ES_CLASS_INLINE(CModelHolder3)
ES_CLASS_INLINE(CMovingBrush)
ES_CLASS_INLINE(CMovingBrushMarker)
ES_CLASS_INLINE(CMusicChanger)
ES_CLASS_INLINE(CMusicHolder)
ES_CLASS_INLINE(CNavigationMarker)
ES_CLASS_INLINE(CParticlesHolder)
ES_CLASS_INLINE(CPendulum)
ES_CLASS_INLINE(CPhotoAlbum)
ES_CLASS_INLINE(CPlayer)
ES_CLASS_INLINE(CPlayerActionMarker)
ES_CLASS_INLINE(CPlayerAnimator)
ES_CLASS_INLINE(CPlayerMarker)
ES_CLASS_INLINE(CPlayerView)
ES_CLASS_INLINE(CPlayerWeapons)
ES_CLASS_INLINE(CPlayerWeaponsEffects)
ES_CLASS_INLINE(CPowerUpItem)
ES_CLASS_INLINE(CProjectile)
ES_CLASS_INLINE(CPyramidSpaceShip)
ES_CLASS_INLINE(CPyramidSpaceShipMarker)
ES_CLASS_INLINE(CReminder)
ES_CLASS_INLINE(CRollingStone)
ES_CLASS_INLINE(CSanta)
ES_CLASS_INLINE(CScorpman)
ES_CLASS_INLINE(CScrollHolder)
ES_CLASS_INLINE(CSeriousBomb)
ES_CLASS_INLINE(CShip)
ES_CLASS_INLINE(CShipMarker)
ES_CLASS_INLINE(CShooter)
ES_CLASS_INLINE(CSoundHolder)
ES_CLASS_INLINE(CSpawnerProjectile)
ES_CLASS_INLINE(CSpinner)
ES_CLASS_INLINE(CStormController)
ES_CLASS_INLINE(CSummoner)
ES_CLASS_INLINE(CSummonerMarker)
ES_CLASS_INLINE(CSwitch)
ES_CLASS_INLINE(CTacticsChanger)
ES_CLASS_INLINE(CTacticsHolder)
ES_CLASS_INLINE(CTeleport)
ES_CLASS_INLINE(CTerrainEntity)
ES_CLASS_INLINE(CTextFXHolder)
ES_CLASS_INLINE(CTimeController)
ES_CLASS_INLINE(CTouchField)
ES_CLASS_INLINE(CTrigger)
ES_CLASS_INLINE(CTwister)
ES_CLASS_INLINE(CVoiceHolder)
ES_CLASS_INLINE(CWalker)
ES_CLASS_INLINE(CWatcher)
ES_CLASS_INLINE(CWatchPlayers)
ES_CLASS_INLINE(CWater)
ES_CLASS_INLINE(CWeaponItem)
ES_CLASS_INLINE(CWerebull)
ES_CLASS_INLINE(CWoman)
ES_CLASS_INLINE(CWorldBase)
ES_CLASS_INLINE(CWorldLink)
ES_CLASS_INLINE(CWorldSettingsController)
44 changes: 44 additions & 0 deletions Sources/StaticAPI/Misc/ShadersFunctions.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Copyright (c) 2024 Dreamy Cecil
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */

// [Cecil] NOTE: This is a list of all shader functions from the Shaders project
// This file can be included inline to generate functions, arrays or any other structures
// with all functions in alphabetical order by redefining custom macro functions below

// Define a reference to the dynamic module class by default for creating an external dummy dependency
#ifndef SHADER_FUNC_INLINE
#define SHADER_FUNC_INLINE(_ShaderName) \
extern DynamicModuleClass Shader_##_ShaderName##_AddToRegistry; \
void *__##_ShaderName##_Include__ = &Shader_##_ShaderName##_AddToRegistry;
#endif

SHADER_FUNC_INLINE(Add)
SHADER_FUNC_INLINE(AddDS)
SHADER_FUNC_INLINE(Base)
SHADER_FUNC_INLINE(BaseDS)
SHADER_FUNC_INLINE(Base_Transparent)
SHADER_FUNC_INLINE(Base_TransparentDS)
SHADER_FUNC_INLINE(Color)
SHADER_FUNC_INLINE(Detail)
SHADER_FUNC_INLINE(LavaDisplace)
SHADER_FUNC_INLINE(Invisible)
SHADER_FUNC_INLINE(MultiLayer)
SHADER_FUNC_INLINE(Reflection)
SHADER_FUNC_INLINE(ReflectionDS)
SHADER_FUNC_INLINE(ReflectionAndSpecular)
SHADER_FUNC_INLINE(ReflectionAndSpecularDS)
SHADER_FUNC_INLINE(Specular)
SHADER_FUNC_INLINE(SpecularDS)
SHADER_FUNC_INLINE(Translucent)
5 changes: 5 additions & 0 deletions Sources/StaticAPI/Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
These API source files should be used when linking specific Serious Engine projects together.
Projects that need to be properly statically linked have an inline source file (.inl) of the same name as the project folder under "Sources/".

These files are supposed to be included *only once* in the entire project, preferably in some main source file in order to define all the necessary functionality and also link the library itself.
It can be included in a file such as "StdH.cpp", "Main.cpp", "<project name>.cpp" or similar.
24 changes: 24 additions & 0 deletions Sources/StaticAPI/Shaders.inl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/* Copyright (c) 2024 Dreamy Cecil
This program is free software; you can redistribute it and/or modify
it under the terms of version 2 of the GNU General Public License as published by
the Free Software Foundation
This program 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 this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */

#ifdef NDEBUG
#pragma comment(lib, "Shaders.lib")
#else
#pragma comment(lib, "ShadersD.lib")
#endif

#if defined(SE1_STATIC_BUILD)
#include "Misc/ShadersFunctions.inl"
#endif

0 comments on commit 401b5bc

Please sign in to comment.