2020-05-14 10:14:03 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
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.
|
2020-05-14 10:14:03 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2020-05-14 10:52:59 +00:00
|
|
|
#include "ns.h"
|
|
|
|
#include "global.h"
|
2020-10-24 07:31:15 +00:00
|
|
|
#include "dukeactor.h"
|
2020-05-14 10:52:59 +00:00
|
|
|
|
|
|
|
BEGIN_DUKE_NS
|
2020-05-14 10:14:03 +00:00
|
|
|
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// Dispatcher for functions where different variants exist for the two families of games.
|
|
|
|
//
|
|
|
|
//---------------------------------------------------------------------------
|
|
|
|
|
2022-12-11 14:42:33 +00:00
|
|
|
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);
|
2020-05-14 10:14:03 +00:00
|
|
|
void checksectors_d(int snum);
|
|
|
|
void checksectors_r(int snum);
|
|
|
|
|
2022-11-12 08:33:33 +00:00
|
|
|
void addweapon_d(player_struct* p, int weapon, bool wswitch);
|
|
|
|
void addweapon_r(player_struct* p, int weapon, bool wswitch);
|
2020-10-21 19:41:14 +00:00
|
|
|
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);
|
2022-09-07 05:34:55 +00:00
|
|
|
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();
|
2022-10-11 01:16:59 +00:00
|
|
|
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);
|
2020-05-17 16:04:45 +00:00
|
|
|
|
2020-05-14 10:14:03 +00:00
|
|
|
Dispatcher fi;
|
|
|
|
|
|
|
|
void SetDispatcher()
|
|
|
|
{
|
|
|
|
if (!isRR())
|
|
|
|
{
|
|
|
|
fi = {
|
2020-06-23 19:12:15 +00:00
|
|
|
think_d,
|
2022-10-11 01:16:59 +00:00
|
|
|
movetransports_d,
|
2022-12-11 14:42:33 +00:00
|
|
|
checkaccessswitch_d,
|
2020-05-14 10:14:03 +00:00
|
|
|
activatebysector_d,
|
2020-07-20 21:21:27 +00:00
|
|
|
checksectors_d,
|
|
|
|
|
|
|
|
addweapon_d,
|
|
|
|
ifhitbyweapon_d,
|
2020-05-16 21:55:21 +00:00
|
|
|
|
|
|
|
incur_damage_d,
|
2020-05-17 11:25:39 +00:00
|
|
|
selectweapon_d,
|
2020-05-17 16:04:45 +00:00
|
|
|
doincrements_d,
|
2020-05-17 21:44:53 +00:00
|
|
|
checkweapons_d,
|
2020-05-19 07:54:52 +00:00
|
|
|
processinput_d,
|
2020-05-19 22:35:52 +00:00
|
|
|
displayweapon_d,
|
2020-05-20 08:38:56 +00:00
|
|
|
displaymasks_d,
|
2020-07-04 21:40:14 +00:00
|
|
|
animatesprites_d,
|
2020-05-14 10:14:03 +00:00
|
|
|
};
|
|
|
|
}
|
2020-07-20 21:21:27 +00:00
|
|
|
else
|
2020-05-14 10:14:03 +00:00
|
|
|
{
|
|
|
|
fi = {
|
2020-06-23 19:12:15 +00:00
|
|
|
think_r,
|
2022-10-11 01:16:59 +00:00
|
|
|
movetransports_r,
|
2022-12-11 14:42:33 +00:00
|
|
|
checkaccessswitch_r,
|
2020-05-14 10:14:03 +00:00
|
|
|
activatebysector_r,
|
2020-07-20 21:21:27 +00:00
|
|
|
checksectors_r,
|
|
|
|
|
|
|
|
addweapon_r,
|
|
|
|
ifhitbyweapon_r,
|
2020-05-16 21:55:21 +00:00
|
|
|
|
|
|
|
incur_damage_r,
|
2020-05-17 16:04:45 +00:00
|
|
|
selectweapon_r,
|
|
|
|
doincrements_r,
|
2020-05-17 21:44:53 +00:00
|
|
|
checkweapons_r,
|
2020-05-19 22:35:52 +00:00
|
|
|
processinput_r,
|
|
|
|
displayweapon_r,
|
2020-05-20 08:38:56 +00:00
|
|
|
displaymasks_r,
|
2020-07-04 21:40:14 +00:00
|
|
|
animatesprites_r,
|
2020-05-14 10:14:03 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-05-14 10:52:59 +00:00
|
|
|
END_DUKE_NS
|