raze/source/games/duke/src/dispatch.cpp

118 lines
3.2 KiB
C++
Raw Normal View History

//-------------------------------------------------------------------------
/*
Copyright (C) 2020 - Christoph Oelckers
This 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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
2020-07-20 21:21:27 +00:00
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
//-------------------------------------------------------------------------
#include "ns.h"
#include "global.h"
#include "dukeactor.h"
BEGIN_DUKE_NS
//---------------------------------------------------------------------------
//
// Dispatcher for functions where different variants exist for the two families of games.
//
//---------------------------------------------------------------------------
bool checkaccessswitch_d(int snum, int pal, DDukeActor *act, walltype* w);
bool checkaccessswitch_r(int snum, int pal, DDukeActor* act, walltype* w);
2021-11-18 17:51:19 +00:00
void activatebysector_d(sectortype* sect, DDukeActor* j);
void activatebysector_r(sectortype* sect, DDukeActor* j);
void checksectors_d(int snum);
void checksectors_r(int snum);
void addweapon_d(player_struct* p, int weapon, bool wswitch);
void addweapon_r(player_struct* p, int weapon, bool wswitch);
int ifhitbyweapon_r(DDukeActor* sn);
int ifhitbyweapon_d(DDukeActor* sn);
2022-02-07 10:04:19 +00:00
void incur_damage_d(player_struct* p);
void incur_damage_r(player_struct* p);
2020-05-17 11:25:39 +00:00
void selectweapon_d(int snum, int j);
void selectweapon_r(int snum, int j);
2022-02-07 10:04:19 +00:00
int doincrements_d(player_struct* p);
int doincrements_r(player_struct* p);
void checkweapons_d(player_struct* p);
void checkweapons_r(player_struct* p);
2020-05-19 07:54:52 +00:00
void processinput_d(int snum);
void processinput_r(int snum);
void displayweapon_d(int snum, double interpfrac);
void displayweapon_r(int snum, double interpfrac);
void displaymasks_d(int snum, int p, double interpfrac);
void displaymasks_r(int snum, int p, double interpfrac);
2020-06-23 19:12:15 +00:00
void think_d();
void think_r();
void movetransports_d();
void movetransports_r();
2022-09-15 17:06:41 +00:00
void animatesprites_d(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac);
void animatesprites_r(tspriteArray& tsprites, const DVector2& viewVec, DAngle viewang, double interpfrac);
Dispatcher fi;
void SetDispatcher()
{
if (!isRR())
{
fi = {
2020-06-23 19:12:15 +00:00
think_d,
movetransports_d,
checkaccessswitch_d,
activatebysector_d,
2020-07-20 21:21:27 +00:00
checksectors_d,
addweapon_d,
ifhitbyweapon_d,
incur_damage_d,
2020-05-17 11:25:39 +00:00
selectweapon_d,
doincrements_d,
2020-05-17 21:44:53 +00:00
checkweapons_d,
2020-05-19 07:54:52 +00:00
processinput_d,
displayweapon_d,
displaymasks_d,
animatesprites_d,
};
}
2020-07-20 21:21:27 +00:00
else
{
fi = {
2020-06-23 19:12:15 +00:00
think_r,
movetransports_r,
checkaccessswitch_r,
activatebysector_r,
2020-07-20 21:21:27 +00:00
checksectors_r,
addweapon_r,
ifhitbyweapon_r,
incur_damage_r,
selectweapon_r,
doincrements_r,
2020-05-17 21:44:53 +00:00
checkweapons_r,
processinput_r,
displayweapon_r,
displaymasks_r,
animatesprites_r,
};
}
}
END_DUKE_NS