Browse Source

Place local symbols in an anonymous namespace

pull/2344/head
Anders Jenbo 5 years ago
parent
commit
352a0ca510
  1. 4
      CMakeLists.txt
  2. 40
      Source/control.cpp
  3. 1
      Source/control.h
  4. 1464
      Source/diablo.cpp
  5. 1
      Source/diablo.h
  6. 4
      Source/drlg_l2.cpp
  7. 1
      Source/drlg_l2.h
  8. 4
      Source/drlg_l3.cpp
  9. 1
      Source/drlg_l3.h
  10. 4
      Source/drlg_l4.cpp
  11. 4
      Source/drlg_l4.h
  12. 4
      Source/dthread.cpp
  13. 88
      Source/dx.cpp
  14. 233
      Source/effects.cpp
  15. 4
      Source/effects.h
  16. 12
      test/drlg_l2_test.cpp
  17. 35
      test/drlg_l3_test.cpp
  18. 21
      test/drlg_l4_test.cpp
  19. 20
      test/effects_test.cpp

4
CMakeLists.txt

@ -524,9 +524,6 @@ if(RUN_TESTS)
test/dead_test.cpp
test/diablo_test.cpp
test/drlg_l1_test.cpp
test/drlg_l2_test.cpp
test/drlg_l3_test.cpp
test/drlg_l4_test.cpp
test/effects_test.cpp
test/file_util_test.cpp
test/inv_test.cpp
@ -584,6 +581,7 @@ if(RUN_TESTS)
include(CTest)
include(GoogleTest)
find_package(GTest REQUIRED)
add_definitions(-DRUN_TESTS)
target_include_directories(devilutionx-tests PRIVATE ${GTEST_INCLUDE_DIRS})
target_link_libraries(devilutionx-tests PRIVATE libdevilutionx)
target_link_libraries(devilutionx-tests PRIVATE ${GTEST_LIBRARIES})

40
Source/control.cpp

@ -542,6 +542,25 @@ void ControlUpDown(int v)
}
}
void RemoveGold(int pnum, int goldIndex)
{
auto &player = Players[pnum];
int gi = goldIndex - INVITEM_INV_FIRST;
player.InvList[gi]._ivalue -= dropGoldValue;
if (player.InvList[gi]._ivalue > 0)
SetPlrHandGoldCurs(&player.InvList[gi]);
else
player.RemoveInvItem(gi);
SetPlrHandItem(&player.HoldItem, IDI_GOLD);
GetGoldSeed(pnum, &player.HoldItem);
player.HoldItem._ivalue = dropGoldValue;
player.HoldItem._iStatFlag = true;
ControlSetGoldCurs(player);
player._pGold = CalculateGold(player);
dropGoldValue = 0;
}
} // namespace
void DrawSpell(const Surface &out)
@ -1782,7 +1801,7 @@ void control_drop_gold(char vkey)
snprintf(input, sizeof(input), "%i", dropGoldValue);
if (vkey == DVL_VK_RETURN) {
if (dropGoldValue > 0)
control_remove_gold(MyPlayerId, initialDropGoldIndex);
RemoveGold(MyPlayerId, initialDropGoldIndex);
dropGoldFlag = false;
} else if (vkey == DVL_VK_ESCAPE) {
dropGoldFlag = false;
@ -1802,25 +1821,6 @@ void control_drop_gold(char vkey)
}
}
void control_remove_gold(int pnum, int goldIndex)
{
auto &player = Players[pnum];
int gi = goldIndex - INVITEM_INV_FIRST;
player.InvList[gi]._ivalue -= dropGoldValue;
if (player.InvList[gi]._ivalue > 0)
SetPlrHandGoldCurs(&player.InvList[gi]);
else
player.RemoveInvItem(gi);
SetPlrHandItem(&player.HoldItem, IDI_GOLD);
GetGoldSeed(pnum, &player.HoldItem);
player.HoldItem._ivalue = dropGoldValue;
player.HoldItem._iStatFlag = true;
ControlSetGoldCurs(player);
player._pGold = CalculateGold(player);
dropGoldValue = 0;
}
void DrawTalkPan(const Surface &out)
{
if (!talkflag)

1
Source/control.h

@ -146,7 +146,6 @@ void DrawSpellBook(const Surface &out);
void CheckSBook();
void DrawGoldSplit(const Surface &out, int amount);
void control_drop_gold(char vkey);
void control_remove_gold(int pnum, int goldIndex);
void DrawTalkPan(const Surface &out);
bool control_check_talk_btn();
void control_release_talk_btn();

1464
Source/diablo.cpp

File diff suppressed because it is too large Load Diff

1
Source/diablo.h

@ -77,7 +77,6 @@ bool TryIconCurs();
void diablo_pause_game();
bool PressEscKey();
void DisableInputWndProc(uint32_t uMsg, int32_t wParam, int32_t lParam);
void GM_Game(uint32_t uMsg, int32_t wParam, int32_t lParam);
void LoadGameLevel(bool firstflag, lvl_entry lvldir);
void game_loop(bool bStartup);
void diablo_color_cyc_logic();

4
Source/drlg_l2.cpp

@ -1610,8 +1610,6 @@ int Patterns[100][10] = {
{ 0, 0, 0, 0, 255, 0, 0, 0, 0, 0 },
};
} // namespace
static bool DrlgL2PlaceMiniSet(const BYTE *miniset, int tmin, int tmax, int cx, int cy, bool setview)
{
int sw = miniset[0];
@ -3188,6 +3186,8 @@ static void LoadL2DungeonData(const uint16_t *dunData)
}
}
} // namespace
void LoadL2Dungeon(const char *path, int vx, int vy)
{
auto dunData = LoadFileInMem<uint16_t>(path);

1
Source/drlg_l2.h

@ -26,7 +26,6 @@ struct ROOMNODE {
extern BYTE predungeon[DMAXX][DMAXY];
void InitDungeon();
void LoadL2Dungeon(const char *path, int vx, int vy);
void LoadPreL2Dungeon(const char *path);
void CreateL2Dungeon(uint32_t rseed, lvl_entry entry);

4
Source/drlg_l3.cpp

@ -842,8 +842,6 @@ const BYTE HivePattern42[] = {
// clang-format on
};
} // namespace
static void InitL3Dungeon()
{
memset(dungeon, 0, sizeof(dungeon));
@ -2475,6 +2473,8 @@ static void DrlgL3Pass3()
DRLG_LPass3(8 - 1);
}
} // namespace
void CreateL3Dungeon(uint32_t rseed, lvl_entry entry)
{
SetRndSeed(rseed);

1
Source/drlg_l3.h

@ -9,7 +9,6 @@
namespace devilution {
void AddFenceDoors();
void CreateL3Dungeon(uint32_t rseed, lvl_entry entry);
void LoadL3Dungeon(const char *sFileName, int vx, int vy);
void LoadPreL3Dungeon(const char *sFileName);

4
Source/drlg_l4.cpp

@ -151,8 +151,6 @@ const BYTE L4BTYPES[140] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
} // namespace
static void DrlgL4Shadows()
{
for (int y = 1; y < DMAXY; y++) {
@ -1514,6 +1512,8 @@ static void DrlgL4Pass3()
DRLG_LPass3(30 - 1);
}
} // namespace
void CreateL4Dungeon(uint32_t rseed, lvl_entry entry)
{
SetRndSeed(rseed);

4
Source/drlg_l4.h

@ -17,8 +17,8 @@ extern int diabquad3x;
extern int diabquad3y;
extern int diabquad4x;
extern int diabquad4y;
bool IsDURWall(char d);
bool IsDLLWall(char dd);
void CreateL4Dungeon(uint32_t rseed, lvl_entry entry);
void LoadL4Dungeon(const char *path, int vx, int vy);
void LoadPreL4Dungeon(const char *path);
} // namespace devilution

4
Source/dthread.cpp

@ -10,6 +10,8 @@
namespace devilution {
namespace {
static CCritSect sgMemCrit;
SDL_threadID glpDThreadId;
TMegaPkt *sgpInfoHead; /* may not be right struct */
@ -55,6 +57,8 @@ static void DthreadHandler()
}
}
}
void dthread_remove_player(uint8_t pnum)
{
TMegaPkt *pkt;

88
Source/dx.cpp

@ -19,11 +19,6 @@
namespace devilution {
int sgdwLockCount;
#ifdef _DEBUG
int locktbl[256];
#endif
static CCritSect sgMemCrit;
int refreshDelay;
SDL_Renderer *renderer;
@ -44,6 +39,12 @@ bool RenderDirectlyToOutputSurface;
namespace {
int sgdwLockCount;
#ifdef _DEBUG
int locktbl[256];
#endif
static CCritSect sgMemCrit;
bool CanRenderDirectlyToOutputSurface()
{
#ifdef USE_SDL1
@ -60,8 +61,6 @@ bool CanRenderDirectlyToOutputSurface()
#endif
}
} // namespace
static void CreateBackBuffer()
{
if (CanRenderDirectlyToOutputSurface()) {
@ -111,17 +110,6 @@ static void CreatePrimarySurface()
}
}
void dx_init()
{
#ifndef USE_SDL1
SDL_RaiseWindow(ghMainWnd);
SDL_ShowWindow(ghMainWnd);
#endif
CreatePrimarySurface();
palette_init();
CreateBackBuffer();
}
static void LockBufPriv()
{
sgMemCrit.Enter();
@ -133,14 +121,6 @@ static void LockBufPriv()
sgdwLockCount++;
}
void lock_buf(int idx) // NOLINT(misc-unused-parameters)
{
#ifdef _DEBUG
++locktbl[idx];
#endif
LockBufPriv();
}
static void UnlockBufPriv()
{
if (sgdwLockCount == 0)
@ -150,6 +130,45 @@ static void UnlockBufPriv()
sgMemCrit.Leave();
}
/**
* @brief Limit FPS to avoid high CPU load, use when v-sync isn't available
*/
void LimitFrameRate()
{
if (!sgOptions.Graphics.bFPSLimit)
return;
static uint32_t frameDeadline;
uint32_t tc = SDL_GetTicks() * 1000;
uint32_t v = 0;
if (frameDeadline > tc) {
v = tc % refreshDelay;
SDL_Delay(v / 1000 + 1); // ceil
}
frameDeadline = tc + v + refreshDelay;
}
} // namespace
void dx_init()
{
#ifndef USE_SDL1
SDL_RaiseWindow(ghMainWnd);
SDL_ShowWindow(ghMainWnd);
#endif
CreatePrimarySurface();
palette_init();
CreateBackBuffer();
}
void lock_buf(int idx) // NOLINT(misc-unused-parameters)
{
#ifdef _DEBUG
++locktbl[idx];
#endif
LockBufPriv();
}
void unlock_buf(int idx) // NOLINT(misc-unused-parameters)
{
#ifdef _DEBUG
@ -286,23 +305,6 @@ void Blit(SDL_Surface *src, SDL_Rect *srcRect, SDL_Rect *dstRect)
#endif
}
/**
* @brief Limit FPS to avoid high CPU load, use when v-sync isn't available
*/
void LimitFrameRate()
{
if (!sgOptions.Graphics.bFPSLimit)
return;
static uint32_t frameDeadline;
uint32_t tc = SDL_GetTicks() * 1000;
uint32_t v = 0;
if (frameDeadline > tc) {
v = tc % refreshDelay;
SDL_Delay(v / 1000 + 1); // ceil
}
frameDeadline = tc + v + refreshDelay;
}
void RenderPresent()
{
SDL_Surface *surface = GetOutputSurface();

233
Source/effects.cpp

@ -12,18 +12,20 @@
#include "utils/stdcompat/algorithm.hpp"
namespace devilution {
int sfxdelay;
_sfx_id sfxdnum = SFX_NONE;
namespace {
#ifndef DISABLE_STREAMING_SOUNDS
constexpr bool AllowStreaming = true;
#else
constexpr bool AllowStreaming = false;
#endif
} // namespace
int sfxdelay;
_sfx_id sfxdnum = SFX_NONE;
/** Specifies the sound file and the playback state of the current sound effect. */
static TSFX *sgpStreamSFX = nullptr;
TSFX *sgpStreamSFX = nullptr;
/**
* Monster sound type prefix
@ -1070,27 +1072,7 @@ TSFX sgSFX[] = {
// clang-format on
};
bool effect_is_playing(int nSFX)
{
TSFX *sfx = &sgSFX[nSFX];
if (sfx->pSnd != nullptr)
return sfx->pSnd->isPlaying();
if ((sfx->bFlags & sfx_STREAM) != 0)
return sfx == sgpStreamSFX;
return false;
}
void stream_stop()
{
if (sgpStreamSFX != nullptr) {
sgpStreamSFX->pSnd = nullptr;
sgpStreamSFX = nullptr;
}
}
static void StreamPlay(TSFX *pSFX, int lVolume, int lPan)
void StreamPlay(TSFX *pSFX, int lVolume, int lPan)
{
assert(pSFX);
assert(pSFX->bFlags & sfx_STREAM);
@ -1106,43 +1088,14 @@ static void StreamPlay(TSFX *pSFX, int lVolume, int lPan)
}
}
static void StreamUpdate()
void StreamUpdate()
{
if (sgpStreamSFX != nullptr && !sgpStreamSFX->pSnd->isPlaying()) {
stream_stop();
}
}
void InitMonsterSND(int monst)
{
if (!gbSndInited) {
return;
}
const int mtype = LevelMonsterTypes[monst].mtype;
for (int i = 0; i < 4; i++) {
if (MonstSndChar[i] != 's' || MonsterData[mtype].snd_special) {
for (int j = 0; j < 2; j++) {
char path[MAX_PATH];
sprintf(path, MonsterData[mtype].sndfile, MonstSndChar[i], j + 1);
LevelMonsterTypes[monst].Snds[i][j] = sound_file_load(path);
}
}
}
}
void FreeMonsterSnd()
{
for (int i = 0; i < LevelMonsterTypeCount; i++) {
for (auto &variants : LevelMonsterTypes[i].Snds) {
for (auto &snd : variants) {
snd = nullptr;
}
}
}
}
bool calc_snd_position(Point soundPosition, int *plVolume, int *plPan)
bool CalculatePosition(Point soundPosition, int *plVolume, int *plPan)
{
const auto &playerPosition = Players[MyPlayerId].position.tile;
const auto delta = soundPosition - playerPosition;
@ -1161,7 +1114,7 @@ bool calc_snd_position(Point soundPosition, int *plVolume, int *plPan)
return true;
}
static void PlaySfxPriv(TSFX *pSFX, bool loc, Point position)
void PlaySfxPriv(TSFX *pSFX, bool loc, Point position)
{
if (Players[MyPlayerId].pLvlLoad != 0 && gbIsMultiplayer) {
return;
@ -1176,7 +1129,7 @@ static void PlaySfxPriv(TSFX *pSFX, bool loc, Point position)
int lVolume = 0;
int lPan = 0;
if (loc && !calc_snd_position(position, &lVolume, &lPan)) {
if (loc && !CalculatePosition(position, &lVolume, &lPan)) {
return;
}
@ -1192,32 +1145,7 @@ static void PlaySfxPriv(TSFX *pSFX, bool loc, Point position)
snd_play_snd(pSFX->pSnd.get(), lVolume, lPan);
}
void PlayEffect(int i, int mode)
{
if (Players[MyPlayerId].pLvlLoad != 0) {
return;
}
int sndIdx = GenerateRnd(2);
if (!gbSndInited || !gbSoundOn || gbBufferMsgs != 0) {
return;
}
int mi = Monsters[i]._mMTidx;
TSnd *snd = LevelMonsterTypes[mi].Snds[mode][sndIdx].get();
if (snd == nullptr || snd->isPlaying()) {
return;
}
int lVolume = 0;
int lPan = 0;
if (!calc_snd_position(Monsters[i].position.tile, &lVolume, &lPan))
return;
snd_play_snd(snd, lVolume, lPan);
}
static _sfx_id RndSFX(_sfx_id psfx)
_sfx_id RndSFX(_sfx_id psfx)
{
int nRand;
@ -1249,6 +1177,109 @@ static _sfx_id RndSFX(_sfx_id psfx)
return static_cast<_sfx_id>(psfx + GenerateRnd(nRand));
}
void PrivSoundInit(BYTE bLoadMask)
{
if (!gbSndInited) {
return;
}
for (auto &sfx : sgSFX) {
if (sfx.pSnd != nullptr) {
continue;
}
if ((sfx.bFlags & sfx_STREAM) != 0) {
continue;
}
if ((sfx.bFlags & bLoadMask) == 0) {
continue;
}
if (!gbIsHellfire && (sfx.bFlags & sfx_HELLFIRE) != 0) {
continue;
}
sfx.pSnd = sound_file_load(sfx.pszName);
}
}
} // namespace
bool effect_is_playing(int nSFX)
{
TSFX *sfx = &sgSFX[nSFX];
if (sfx->pSnd != nullptr)
return sfx->pSnd->isPlaying();
if ((sfx->bFlags & sfx_STREAM) != 0)
return sfx == sgpStreamSFX;
return false;
}
void stream_stop()
{
if (sgpStreamSFX != nullptr) {
sgpStreamSFX->pSnd = nullptr;
sgpStreamSFX = nullptr;
}
}
void InitMonsterSND(int monst)
{
if (!gbSndInited) {
return;
}
const int mtype = LevelMonsterTypes[monst].mtype;
for (int i = 0; i < 4; i++) {
if (MonstSndChar[i] != 's' || MonsterData[mtype].snd_special) {
for (int j = 0; j < 2; j++) {
char path[MAX_PATH];
sprintf(path, MonsterData[mtype].sndfile, MonstSndChar[i], j + 1);
LevelMonsterTypes[monst].Snds[i][j] = sound_file_load(path);
}
}
}
}
void FreeMonsterSnd()
{
for (int i = 0; i < LevelMonsterTypeCount; i++) {
for (auto &variants : LevelMonsterTypes[i].Snds) {
for (auto &snd : variants) {
snd = nullptr;
}
}
}
}
void PlayEffect(int i, int mode)
{
if (Players[MyPlayerId].pLvlLoad != 0) {
return;
}
int sndIdx = GenerateRnd(2);
if (!gbSndInited || !gbSoundOn || gbBufferMsgs != 0) {
return;
}
int mi = Monsters[i]._mMTidx;
TSnd *snd = LevelMonsterTypes[mi].Snds[mode][sndIdx].get();
if (snd == nullptr || snd->isPlaying()) {
return;
}
int lVolume = 0;
int lPan = 0;
if (!CalculatePosition(Monsters[i].position.tile, &lVolume, &lPan))
return;
snd_play_snd(snd, lVolume, lPan);
}
void PlaySFX(_sfx_id psfx)
{
psfx = RndSFX(psfx);
@ -1298,33 +1329,6 @@ void effects_cleanup_sfx()
sfx.pSnd = nullptr;
}
static void PrivSoundInit(BYTE bLoadMask)
{
if (!gbSndInited) {
return;
}
for (auto &sfx : sgSFX) {
if (sfx.pSnd != nullptr) {
continue;
}
if ((sfx.bFlags & sfx_STREAM) != 0) {
continue;
}
if ((sfx.bFlags & bLoadMask) == 0) {
continue;
}
if (!gbIsHellfire && (sfx.bFlags & sfx_HELLFIRE) != 0) {
continue;
}
sfx.pSnd = sound_file_load(sfx.pszName);
}
}
void sound_init()
{
uint8_t mask = sfx_MISC;
@ -1387,4 +1391,11 @@ int GetSFXLength(int nSFX)
return sgSFX[nSFX].pSnd->DSB.GetLength();
}
#ifdef RUN_TESTS
bool TestCalculatePosition(Point soundPosition, int *plVolume, int *plPan)
{
CalculatePosition(soundPosition, plVolume, plPan);
}
#endif
} // namespace devilution

4
Source/effects.h

@ -1188,7 +1188,9 @@ void ui_sound_init();
void effects_play_sound(const char *sndFile);
#ifndef NOSOUND
bool calc_snd_position(Point soundPosition, int *plVolume, int *plPan);
#ifdef RUN_TESTS
bool TestCalculatePosition(Point soundPosition, int *plVolume, int *plPan);
#endif
int GetSFXLength(int nSFX);
#endif

12
test/drlg_l2_test.cpp

@ -1,12 +0,0 @@
#include <gtest/gtest.h>
#include "drlg_l2.h"
using namespace devilution;
TEST(Drlg_l2, InitDungeon)
{
InitDungeon();
EXPECT_EQ(predungeon[0][0], 32);
EXPECT_EQ(dflags[0][0], 0);
}

35
test/drlg_l3_test.cpp

@ -1,35 +0,0 @@
#include <gtest/gtest.h>
#include "drlg_l3.h"
using namespace devilution;
TEST(Drlg_l3, AddFenceDoors_x)
{
memset(dungeon, 0, sizeof(dungeon));
dungeon[5][5] = 7;
dungeon[5 - 1][5] = 130;
dungeon[5 + 1][5] = 152;
AddFenceDoors();
EXPECT_EQ(dungeon[5][5], 146);
}
TEST(Drlg_l3, AddFenceDoors_y)
{
memset(dungeon, 0, sizeof(dungeon));
dungeon[5][5] = 7;
dungeon[5][5 - 1] = 130;
dungeon[5][5 + 1] = 152;
AddFenceDoors();
EXPECT_EQ(dungeon[5][5], 147);
}
TEST(Drlg_l3, AddFenceDoors_no)
{
memset(dungeon, 0, sizeof(dungeon));
dungeon[5][5] = 7;
dungeon[5 - 1][5] = 130;
dungeon[5 + 1][5] = 153;
AddFenceDoors();
EXPECT_EQ(dungeon[5][5], 7);
}

21
test/drlg_l4_test.cpp

@ -1,21 +0,0 @@
#include <gtest/gtest.h>
#include "drlg_l4.h"
using namespace devilution;
TEST(Drlg_l4, IsDURWall)
{
EXPECT_EQ(IsDURWall(25), true);
EXPECT_EQ(IsDURWall(28), true);
EXPECT_EQ(IsDURWall(23), true);
EXPECT_EQ(IsDURWall(20), false);
}
TEST(Drlg_l4, IsDLLWall)
{
EXPECT_EQ(IsDLLWall(27), true);
EXPECT_EQ(IsDLLWall(26), true);
EXPECT_EQ(IsDLLWall(22), true);
EXPECT_EQ(IsDLLWall(20), false);
}

20
test/effects_test.cpp

@ -5,52 +5,52 @@
using namespace devilution;
TEST(Effects, calc_snd_position_center)
TEST(Effects, CalculatePosition_center)
{
Players[MyPlayerId].position.tile = { 50, 50 };
int plVolume = 0;
int plPan = 0;
EXPECT_EQ(calc_snd_position({ 50, 50 }, &plVolume, &plPan), true);
EXPECT_EQ(TestCalculatePosition({ 50, 50 }, &plVolume, &plPan), true);
EXPECT_EQ(plVolume, 0);
EXPECT_EQ(plPan, 0);
}
TEST(Effects, calc_snd_position_near)
TEST(Effects, CalculatePosition_near)
{
Players[MyPlayerId].position.tile = { 50, 50 };
int plVolume = 0;
int plPan = 0;
EXPECT_EQ(calc_snd_position({ 55, 50 }, &plVolume, &plPan), true);
EXPECT_EQ(TestCalculatePosition({ 55, 50 }, &plVolume, &plPan), true);
EXPECT_EQ(plVolume, -320);
EXPECT_EQ(plPan, 1280);
}
TEST(Effects, calc_snd_position_out_of_range)
TEST(Effects, CalculatePosition_out_of_range)
{
Players[MyPlayerId].position.tile = { 12, 12 };
int plVolume = 1234;
int plPan = 0;
EXPECT_EQ(calc_snd_position({ 112, 112 }, &plVolume, &plPan), false);
EXPECT_EQ(TestCalculatePosition({ 112, 112 }, &plVolume, &plPan), false);
EXPECT_EQ(plVolume, 1234);
EXPECT_EQ(plPan, 0);
}
TEST(Effects, calc_snd_position_extreme_right)
TEST(Effects, CalculatePosition_extreme_right)
{
Players[MyPlayerId].position.tile = { 50, 50 };
int plVolume = 0;
int plPan = 0;
EXPECT_EQ(calc_snd_position({ 75, 25 }, &plVolume, &plPan), true);
EXPECT_EQ(TestCalculatePosition({ 75, 25 }, &plVolume, &plPan), true);
EXPECT_EQ(plVolume, -2176);
EXPECT_EQ(plPan, 6400);
}
TEST(Effects, calc_snd_position_extreme_left)
TEST(Effects, CalculatePosition_extreme_left)
{
Players[MyPlayerId].position.tile = { 50, 50 };
int plVolume = 0;
int plPan = 0;
EXPECT_EQ(calc_snd_position({ 25, 75 }, &plVolume, &plPan), true);
EXPECT_EQ(TestCalculatePosition({ 25, 75 }, &plVolume, &plPan), true);
EXPECT_EQ(plVolume, -2176);
EXPECT_EQ(plPan, -6400);
}

Loading…
Cancel
Save