mirror of
https://github.com/ZDoom/Raze.git
synced 2025-02-21 02:51:46 +00:00
- added a bit more of the GameInterface.
This commit is contained in:
parent
a31bc4be6b
commit
725cacb8e8
4 changed files with 53 additions and 13 deletions
|
@ -68,16 +68,19 @@ const char *GetVersionString();
|
|||
#define SAVESIG_BLD GAMENAME ".Blood"
|
||||
#define SAVESIG_SW GAMENAME ".ShadowWarrior"
|
||||
#define SAVESIG_PS GAMENAME ".Exhumed"
|
||||
#define SAVESIG_WH GAMENAME ".Witchaven"
|
||||
|
||||
#define MINSAVEVER_DN3D 10
|
||||
#define MINSAVEVER_BLD 10
|
||||
#define MINSAVEVER_SW 10
|
||||
#define MINSAVEVER_PS 10
|
||||
#define MINSAVEVER_WH 10
|
||||
|
||||
#define SAVEVER_DN3D 10
|
||||
#define SAVEVER_BLD 10
|
||||
#define SAVEVER_SW 10
|
||||
#define SAVEVER_PS 10
|
||||
#define SAVEVER_WH 10
|
||||
|
||||
#define NETGAMEVERSION 1
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "mmulti.h"
|
||||
#include "raze_music.h"
|
||||
#include "statistics.h"
|
||||
#include "version.h"
|
||||
|
||||
BEGIN_WH_NS
|
||||
|
||||
|
@ -338,8 +339,6 @@ void GameInterface::Ticker()
|
|||
timerprocess(plr);
|
||||
weaponsprocess(pyrn);
|
||||
|
||||
updatesounds();
|
||||
|
||||
if (followmode) {
|
||||
followa += followang;
|
||||
|
||||
|
@ -431,6 +430,27 @@ void GameInterface::MenuSound(EMenuSounds snd)
|
|||
else SND_Sound(59);
|
||||
}
|
||||
|
||||
void GameInterface::MenuOpened()
|
||||
{
|
||||
if (!isWh2()) SND_Sound(85);
|
||||
else SND_Sound(59);
|
||||
}
|
||||
|
||||
FSavegameInfo GameInterface::GetSaveSig()
|
||||
{
|
||||
return { SAVESIG_DN3D, MINSAVEVER_DN3D, SAVEVER_DN3D };
|
||||
}
|
||||
|
||||
void GameInterface::QuitToTitle()
|
||||
{
|
||||
Mus_Stop();
|
||||
gameaction = ga_mainmenu;
|
||||
}
|
||||
|
||||
::GameStats GameInterface::getStats()
|
||||
{
|
||||
return { kills, killcnt, treasuresfound, treasurescnt, lockclock / 30, 0 };
|
||||
}
|
||||
|
||||
::GameInterface* CreateInterface()
|
||||
{
|
||||
|
|
|
@ -120,9 +120,11 @@ void WHSoundEngine::CalcPosVel(int type, const void* source, const float pt[3],
|
|||
}
|
||||
}
|
||||
|
||||
void updatesounds()
|
||||
|
||||
void GameInterface::UpdateSounds()
|
||||
{
|
||||
// Handle timed loops.
|
||||
SoundListener listener;
|
||||
|
||||
soundEngine->EnumerateChannels([](FSoundChan* channel)
|
||||
{
|
||||
if (channel->UserData > 0)
|
||||
|
@ -135,10 +137,28 @@ void updatesounds()
|
|||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
if (player[pyrn].spritenum >= 0)
|
||||
{
|
||||
listener.angle = -(float)player[pyrn].ang * pi::pi() / 1024; // Build uses a period of 2048.
|
||||
listener.velocity.Zero();
|
||||
vec3_t ppos{ player[pyrn].x, player[pyrn].y, player[pyrn].z };
|
||||
listener.position = GetSoundPos(&ppos);
|
||||
listener.valid = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
listener.position.Zero();
|
||||
listener.valid = false;
|
||||
}
|
||||
listener.underwater = false;
|
||||
listener.Environment = 0;
|
||||
|
||||
listener.ListenerObject = &sprite[player[pyrn].spritenum];
|
||||
soundEngine->SetListener(listener);
|
||||
soundEngine->UpdateSounds(I_GetTime());
|
||||
}
|
||||
|
||||
|
||||
int playsound_internal(int sn, spritetype *spr, int x, int y, int loop, int chan)
|
||||
{
|
||||
sn++;
|
||||
|
|
|
@ -468,7 +468,6 @@ void resetflash();
|
|||
void applyflash();
|
||||
|
||||
|
||||
void updatesounds();
|
||||
int playsound_internal(int sn, spritetype* spr, int x, int y, int loop, int chan);
|
||||
|
||||
inline int playsound(int sn, int x, int y, int loop = 0, int channel = CHAN_AUTO) {
|
||||
|
@ -522,21 +521,19 @@ struct GameInterface : public ::GameInterface
|
|||
void app_init() override;
|
||||
//void clearlocalinputstate() override;
|
||||
//bool GenerateSavePic() override;
|
||||
//void PlayHudSound() override;
|
||||
//GameStats getStats() override;
|
||||
//void MenuOpened() override;
|
||||
GameStats getStats() override;
|
||||
void MenuOpened() override;
|
||||
void MenuSound(EMenuSounds snd) override;
|
||||
bool CanSave() override;
|
||||
bool StartGame(FNewGameStartup& gs) override;
|
||||
//FSavegameInfo GetSaveSig() override;
|
||||
FSavegameInfo GetSaveSig() override;
|
||||
void SerializeGameState(FSerializer& arc) override;
|
||||
//void QuitToTitle() override;
|
||||
void QuitToTitle() override;
|
||||
FString GetCoordString() override;
|
||||
//void ExitFromMenu() override;
|
||||
//ReservedSpace GetReservedScreenSpace(int viewsize) override;
|
||||
//void DrawPlayerSprite(const DVector2& origin, bool onteam) override;
|
||||
//void GetInput(InputPacket* packet, ControlInfo* const hidInput) override;
|
||||
//void UpdateSounds() override;
|
||||
void UpdateSounds() override;
|
||||
void Startup() override;
|
||||
void DrawBackground() override;
|
||||
void Render() override;
|
||||
|
|
Loading…
Reference in a new issue