openmohaa/code/cgame/cg_specialfx.h

84 lines
2.3 KiB
C
Raw Normal View History

2023-04-30 17:22:57 +02:00
/*
===========================================================================
Copyright (C) 2023 the OpenMoHAA team
This file is part of OpenMoHAA source code.
OpenMoHAA source code 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.
OpenMoHAA source code 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 OpenMoHAA source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// DESCRIPTION:
// Special Effects code
#pragma once
#include "cg_local.h"
2023-05-04 20:30:38 +02:00
#include "cg_commands.h"
#include "class.h"
2023-04-30 17:22:57 +02:00
#define MAX_SPECIAL_EFFECT_COMMANDS 32
2023-04-30 17:22:57 +02:00
class specialeffectcommand_t : public Class {
public:
spawnthing_t* emitter;
float fCommandTime;
void (*endfcn)();
2023-05-05 20:43:37 +02:00
Event *pEvent;
public:
specialeffectcommand_t();
2023-04-30 17:22:57 +02:00
};
class specialeffect_t : public Class
{
public:
int m_iCommandCount;
specialeffectcommand_t* m_commands[MAX_SPECIAL_EFFECT_COMMANDS];
public:
specialeffect_t();
specialeffectcommand_t* AddNewCommand();
2023-04-30 17:22:57 +02:00
};
2023-05-01 15:10:17 +02:00
#define MAX_SPECIAL_EFFECTS 99
#define SPECIAL_EFFECT_TEST MAX_SPECIAL_EFFECTS - 1
class ClientSpecialEffectsManager : public Listener {
specialeffect_t m_effects[99];
qboolean m_bEffectsLoaded;
int m_iNumPendingEvents;
public:
CLASS_PROTOTYPE(ClientSpecialEffectsManager);
private:
void ContinueEffectExecution(Event* ev);
void ExecuteEffect(int iEffect, int iStartCommand, Vector vPos, Vector vAngles, float axis[3][3]);
public:
ClientSpecialEffectsManager();
void LoadEffects();
qboolean EffectsPending();
void MakeEffect_Normal(int iEffect, Vector vPos, Vector vNormal);
void MakeEffect_Angles(int iEffect, Vector vPos, Vector vAngles);
void MakeEffect_Axis(int iEffect, Vector vPos, float axis[3][3]);
specialeffect_t* GetTestEffectPointer();
};
2023-05-01 17:08:02 +02:00
extern ClientSpecialEffectsManager sfxManager;