Compare commits
21
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6d9e47257 | ||
|
|
c677cc0065 | ||
|
|
eb3ae69d3f | ||
|
|
1580fdced7 | ||
|
|
7200598afa | ||
|
|
b08d478d73 | ||
|
|
b1189eb6c9 | ||
|
|
4e2369f194 | ||
|
|
e1508731d0 | ||
|
|
d236b70546 | ||
|
|
636bf0b692 | ||
|
|
22bcbde6a3 | ||
|
|
8b20122798 | ||
|
|
0672a56786 | ||
|
|
8e77eb70de | ||
|
|
d0cc8ce080 | ||
|
|
a0e81976e6 | ||
|
|
dd19188d93 | ||
|
|
976f55c46d | ||
|
|
2d3fb87a1a | ||
|
|
3b78903179 |
@@ -2,6 +2,8 @@
|
||||
/ORBIS_Release
|
||||
/PS3_Debug
|
||||
/PS3_Release
|
||||
/PSVita_Debug
|
||||
/PSVita_Release
|
||||
/X360_Debug
|
||||
/X360_Release
|
||||
/Release
|
||||
@@ -14,6 +16,8 @@
|
||||
/Minecraft.Client/ORBIS_Release
|
||||
/Minecraft.Client/PS3_Debug
|
||||
/Minecraft.Client/PS3_Release
|
||||
/Minecraft.Client/PSVita_Debug
|
||||
/Minecraft.Client/PSVita_Release
|
||||
/Minecraft.Client/X360_Debug
|
||||
/Minecraft.Client/X360_Release
|
||||
/Minecraft.Client/Debug
|
||||
@@ -25,6 +29,8 @@
|
||||
/Minecraft.World/ORBIS_Release
|
||||
/Minecraft.World/PS3_Debug
|
||||
/Minecraft.World/PS3_Release
|
||||
/Minecraft.World/PSVita_Debug
|
||||
/Minecraft.World/PSVita_Release
|
||||
/Minecraft.World/X360_Debug
|
||||
/Minecraft.World/X360_Release
|
||||
/Minecraft.World/Debug
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
#define _SEKRIT
|
||||
#include "..\..\Durango\Miles\include\mss.h"
|
||||
#elif defined _WINDOWS64
|
||||
#include "..\..\windows64\Miles\include\mss.h"
|
||||
#else // PS4
|
||||
// 4J Stu - Temp define to get Miles to link, can likely be removed when we get a new version of Miles
|
||||
#define _SEKRIT2
|
||||
|
||||
@@ -16,7 +16,17 @@
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include "..\..\Minecraft.Client\Windows64\Windows64_App.h"
|
||||
#include "..\..\Minecraft.Client\Windows64\Miles\include\imssapi.h"
|
||||
std::vector<MiniAudioSound*> m_activeSounds;
|
||||
#include "stb_vorbis.h"
|
||||
|
||||
#define MA_NO_DSOUND
|
||||
#define MA_NO_WINMM
|
||||
#define MINIAUDIO_IMPLEMENTATION
|
||||
#include "miniaudio.h"
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <mutex>
|
||||
#include "..\Filesystem\Filesystem.h"
|
||||
#endif
|
||||
|
||||
#ifdef __ORBIS__
|
||||
@@ -93,11 +103,13 @@ char SoundEngine::m_szSoundPath[]={"Sound/"};
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef _WINDOWS64
|
||||
F32 AILCALLBACK custom_falloff_function (HSAMPLE S,
|
||||
F32 distance,
|
||||
F32 rolloff_factor,
|
||||
F32 min_dist,
|
||||
F32 max_dist);
|
||||
#endif
|
||||
|
||||
char *SoundEngine::m_szStreamFileA[eStream_Max]=
|
||||
{
|
||||
@@ -155,6 +167,7 @@ char *SoundEngine::m_szStreamFileA[eStream_Max]=
|
||||
// ErrorCallback
|
||||
//
|
||||
/////////////////////////////////////////////
|
||||
#ifndef _WINDOWS64
|
||||
void AILCALL ErrorCallback(S64 i_Id, char const* i_Details)
|
||||
{
|
||||
char *pchLastError=AIL_last_error();
|
||||
@@ -169,6 +182,7 @@ void AILCALL ErrorCallback(S64 i_Id, char const* i_Details)
|
||||
app.DebugPrintf("ErrorCallback - Details: %s\n", i_Details);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __PSVITA__
|
||||
// AP - this is the callback when the driver is about to mix. At this point the mutex is locked by Miles so we can now call all Miles functions without
|
||||
@@ -201,6 +215,7 @@ void AILCALL MilesMixerCB(HDIGDRIVER dig)
|
||||
/////////////////////////////////////////////
|
||||
void SoundEngine::init(Options *pOptions)
|
||||
{
|
||||
#ifndef _WINDOWS64
|
||||
app.DebugPrintf("---SoundEngine::init\n");
|
||||
#ifdef __DISABLE_MILES__
|
||||
return;
|
||||
@@ -370,6 +385,31 @@ void SoundEngine::init(Options *pOptions)
|
||||
// wait for 1 mix...
|
||||
AIL_release_sample_handle(Sample);
|
||||
#endif
|
||||
#else
|
||||
app.DebugPrintf("---SoundEngine::init\n");
|
||||
|
||||
m_engineConfig = ma_engine_config_init();
|
||||
m_engineConfig.listenerCount = MAX_LOCAL_PLAYERS;
|
||||
|
||||
if (ma_engine_init(&m_engineConfig, &m_engine) != MA_SUCCESS)
|
||||
{
|
||||
app.DebugPrintf("Failed to initialize miniaudio engine\n");
|
||||
return;
|
||||
}
|
||||
|
||||
ma_engine_set_volume(&m_engine, 1.0f);
|
||||
|
||||
m_MasterMusicVolume = 1.0f;
|
||||
m_MasterEffectsVolume = 1.0f;
|
||||
|
||||
m_validListenerCount = 1;
|
||||
|
||||
m_bSystemMusicPlaying = false;
|
||||
|
||||
app.DebugPrintf("---miniaudio initialized\n");
|
||||
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __ORBIS__
|
||||
@@ -399,6 +439,7 @@ void SoundEngine::SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int i
|
||||
}
|
||||
|
||||
// AP - moved to a separate function so it can be called from the mixer callback on Vita
|
||||
#ifndef _WINDOWS64
|
||||
void SoundEngine::updateMiles()
|
||||
{
|
||||
#ifdef __PSVITA__
|
||||
@@ -611,6 +652,110 @@ void SoundEngine::updateMiles()
|
||||
}
|
||||
AIL_complete_event_queue_processing();
|
||||
}
|
||||
#else
|
||||
void SoundEngine::updateMiniAudio()
|
||||
{
|
||||
if (m_validListenerCount == 1)
|
||||
{
|
||||
for (size_t i = 0; i < MAX_LOCAL_PLAYERS; i++)
|
||||
{
|
||||
if (m_ListenerA[i].bValid)
|
||||
{
|
||||
ma_engine_listener_set_position(
|
||||
&m_engine,
|
||||
0,
|
||||
m_ListenerA[i].vPosition.x,
|
||||
m_ListenerA[i].vPosition.y,
|
||||
m_ListenerA[i].vPosition.z);
|
||||
|
||||
ma_engine_listener_set_direction(
|
||||
&m_engine,
|
||||
0,
|
||||
m_ListenerA[i].vOrientFront.x,
|
||||
m_ListenerA[i].vOrientFront.y,
|
||||
m_ListenerA[i].vOrientFront.z);
|
||||
|
||||
ma_engine_listener_set_world_up(
|
||||
&m_engine,
|
||||
0,
|
||||
0.0f, 1.0f, 0.0f);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ma_engine_listener_set_position(&m_engine, 0, 0.0f, 0.0f, 0.0f);
|
||||
ma_engine_listener_set_direction(&m_engine, 0, 0.0f, 0.0f, 1.0f);
|
||||
ma_engine_listener_set_world_up(&m_engine, 0, 0.0f, 1.0f, 0.0f);
|
||||
}
|
||||
|
||||
for (auto it = m_activeSounds.begin(); it != m_activeSounds.end(); )
|
||||
{
|
||||
MiniAudioSound* s = *it;
|
||||
|
||||
if (!ma_sound_is_playing(&s->sound))
|
||||
{
|
||||
ma_sound_uninit(&s->sound);
|
||||
delete s;
|
||||
it = m_activeSounds.erase(it);
|
||||
continue;
|
||||
}
|
||||
|
||||
float finalVolume = s->info.volume * m_MasterEffectsVolume * SFX_VOLUME_MULTIPLIER;
|
||||
if (finalVolume > SFX_MAX_GAIN)
|
||||
finalVolume = SFX_MAX_GAIN;
|
||||
|
||||
ma_sound_set_volume(&s->sound, finalVolume);
|
||||
ma_sound_set_pitch(&s->sound, s->info.pitch);
|
||||
|
||||
if (s->info.bIs3D)
|
||||
{
|
||||
if (m_validListenerCount > 1)
|
||||
{
|
||||
float fClosest=10000.0f;
|
||||
int iClosestListener=0;
|
||||
float fClosestX=0.0f,fClosestY=0.0f,fClosestZ=0.0f,fDist;
|
||||
for( size_t i = 0; i < MAX_LOCAL_PLAYERS; i++ )
|
||||
{
|
||||
if( m_ListenerA[i].bValid )
|
||||
{
|
||||
float x,y,z;
|
||||
|
||||
x=fabs(m_ListenerA[i].vPosition.x-s->info.x);
|
||||
y=fabs(m_ListenerA[i].vPosition.y-s->info.y);
|
||||
z=fabs(m_ListenerA[i].vPosition.z-s->info.z);
|
||||
fDist=x+y+z;
|
||||
|
||||
if(fDist<fClosest)
|
||||
{
|
||||
fClosest=fDist;
|
||||
fClosestX=x;
|
||||
fClosestY=y;
|
||||
fClosestZ=z;
|
||||
iClosestListener=i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float realDist = sqrtf((fClosestX*fClosestX)+(fClosestY*fClosestY)+(fClosestZ*fClosestZ));
|
||||
ma_sound_set_position(&s->sound, 0, 0, realDist);
|
||||
}
|
||||
else
|
||||
{
|
||||
ma_sound_set_position(
|
||||
&s->sound,
|
||||
s->info.x,
|
||||
s->info.y,
|
||||
s->info.z);
|
||||
}
|
||||
}
|
||||
|
||||
++it;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//#define DISTORTION_TEST
|
||||
#ifdef DISTORTION_TEST
|
||||
@@ -697,7 +842,11 @@ void SoundEngine::tick(shared_ptr<Mob> *players, float a)
|
||||
|
||||
LeaveCriticalSection(&SoundEngine_MixerMutex);
|
||||
#else
|
||||
#ifndef _WINDOWS64
|
||||
updateMiles();
|
||||
#else
|
||||
updateMiniAudio();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -709,7 +858,13 @@ void SoundEngine::tick(shared_ptr<Mob> *players, float a)
|
||||
SoundEngine::SoundEngine()
|
||||
{
|
||||
random = new Random();
|
||||
#ifndef _WINDOWS64
|
||||
m_hStream=0;
|
||||
#else
|
||||
memset(&m_engine, 0, sizeof(ma_engine));
|
||||
memset(&m_engineConfig, 0, sizeof(ma_engine_config));
|
||||
m_musicStreamActive = false;
|
||||
#endif
|
||||
m_StreamState=eMusicStreamState_Idle;
|
||||
m_iMusicDelay=0;
|
||||
m_validListenerCount=0;
|
||||
@@ -791,7 +946,7 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
||||
strcat((char *)szSoundName,SoundName);
|
||||
|
||||
// app.DebugPrintf(6,"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",iSound, SoundName, szSoundName,x,y,z,volume,pitch);
|
||||
|
||||
#ifndef _WINDOWS64
|
||||
AUDIO_INFO AudioInfo;
|
||||
AudioInfo.x=x;
|
||||
AudioInfo.y=y;
|
||||
@@ -808,6 +963,124 @@ void SoundEngine::play(int iSound, float x, float y, float z, float volume, floa
|
||||
S32 token = AIL_enqueue_event_start();
|
||||
AIL_enqueue_event_buffer(&token, &AudioInfo, sizeof(AUDIO_INFO), 0);
|
||||
AIL_enqueue_event_end_named(token, (char *)szSoundName);
|
||||
#else
|
||||
app.DebugPrintf(6,
|
||||
"PlaySound - %d - %s - %s (%f %f %f, vol %f, pitch %f)\n",
|
||||
iSound, SoundName, szSoundName, x, y, z, volume, pitch);
|
||||
|
||||
char basePath[256];
|
||||
sprintf_s(basePath, "Windows64Media/Sound/%s", (char*)szSoundName);
|
||||
|
||||
char finalPath[256];
|
||||
|
||||
// Check path cache first to avoid expensive filesystem probing
|
||||
auto cacheIt = m_soundPathCache.find(iSound);
|
||||
if (cacheIt != m_soundPathCache.end())
|
||||
{
|
||||
const auto& paths = cacheIt->second;
|
||||
if (paths.empty())
|
||||
return; // previously probed, no files found
|
||||
const std::string& chosen = paths[rand() % paths.size()];
|
||||
sprintf_s(finalPath, "%s", chosen.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cache miss — probe filesystem and store results
|
||||
std::vector<std::string> validPaths;
|
||||
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
|
||||
size_t extCount = sizeof(extensions) / sizeof(extensions[0]);
|
||||
bool found = false;
|
||||
|
||||
// Check base name with each extension (non-numbered)
|
||||
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
|
||||
{
|
||||
char basePlusExt[256];
|
||||
sprintf_s(basePlusExt, "%s%s", basePath, extensions[extIdx]);
|
||||
|
||||
DWORD attr = GetFileAttributesA(basePlusExt);
|
||||
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
validPaths.push_back(basePlusExt);
|
||||
found = true;
|
||||
break; // non-numbered: only one base file needed
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
// Check numbered variants (e.g. sound1.ogg, sound2.ogg, ...)
|
||||
for (size_t extIdx = 0; extIdx < extCount; extIdx++)
|
||||
{
|
||||
for (int i = 1; i < 32; i++)
|
||||
{
|
||||
char numberedPath[256];
|
||||
sprintf_s(numberedPath, "%s%d%s", basePath, i, extensions[extIdx]);
|
||||
|
||||
DWORD attr = GetFileAttributesA(numberedPath);
|
||||
if (attr != INVALID_FILE_ATTRIBUTES && !(attr & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
validPaths.push_back(numberedPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_soundPathCache[iSound] = validPaths;
|
||||
|
||||
if (validPaths.empty())
|
||||
{
|
||||
sprintf_s(finalPath, "%s.wav", basePath); // fallback for debug print
|
||||
}
|
||||
else
|
||||
{
|
||||
const std::string& chosen = validPaths[rand() % validPaths.size()];
|
||||
sprintf_s(finalPath, "%s", chosen.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
MiniAudioSound* s = new MiniAudioSound();
|
||||
memset(&s->info, 0, sizeof(AUDIO_INFO));
|
||||
|
||||
s->info.x = x;
|
||||
s->info.y = y;
|
||||
s->info.z = z;
|
||||
|
||||
s->info.volume = volume;
|
||||
s->info.pitch = pitch;
|
||||
s->info.bIs3D = true;
|
||||
s->info.bUseSoundsPitchVal = false;
|
||||
s->info.iSound = iSound + eSFX_MAX;
|
||||
|
||||
if (ma_sound_init_from_file(
|
||||
&m_engine,
|
||||
finalPath,
|
||||
MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC,
|
||||
NULL,
|
||||
NULL,
|
||||
&s->sound) != MA_SUCCESS)
|
||||
{
|
||||
app.DebugPrintf("Failed to initialize sound from file: %s\n", finalPath);
|
||||
delete s;
|
||||
return;
|
||||
}
|
||||
|
||||
ma_sound_set_spatialization_enabled(&s->sound, MA_TRUE);
|
||||
ma_sound_set_min_distance(&s->sound, SFX_3D_MIN_DISTANCE);
|
||||
ma_sound_set_max_distance(&s->sound, SFX_3D_MAX_DISTANCE);
|
||||
ma_sound_set_rolloff(&s->sound, SFX_3D_ROLLOFF);
|
||||
|
||||
float finalVolume = volume * m_MasterEffectsVolume * SFX_VOLUME_MULTIPLIER;
|
||||
if (finalVolume > SFX_MAX_GAIN)
|
||||
finalVolume = SFX_MAX_GAIN;
|
||||
|
||||
ma_sound_set_volume(&s->sound, finalVolume);
|
||||
ma_sound_set_pitch(&s->sound, pitch);
|
||||
ma_sound_set_position(&s->sound, x, y, z);
|
||||
|
||||
ma_sound_start(&s->sound);
|
||||
|
||||
m_activeSounds.push_back(s);
|
||||
#endif
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
@@ -819,6 +1092,9 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
{
|
||||
U8 szSoundName[256];
|
||||
wstring name;
|
||||
#ifdef _WINDOWS64
|
||||
const char* soundDir;
|
||||
#endif
|
||||
// we have some game sounds played as UI sounds...
|
||||
// Not the best way to do this, but it seems to only be the portal sounds
|
||||
|
||||
@@ -831,6 +1107,9 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
// build the name
|
||||
strcpy((char *)szSoundName,"Minecraft/");
|
||||
name = wchSoundNames[iSound];
|
||||
#ifdef _WINDOWS64
|
||||
soundDir = "Minecraft";
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -841,6 +1120,9 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
// build the name
|
||||
strcpy((char *)szSoundName,"Minecraft/UI/");
|
||||
name = wchUISoundNames[iSound];
|
||||
#ifdef _WINDOWS64
|
||||
soundDir = "Minecraft/UI";
|
||||
#endif
|
||||
}
|
||||
|
||||
char *SoundName = (char *)ConvertSoundPathToName(name);
|
||||
@@ -848,6 +1130,7 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
// app.DebugPrintf("UI: Playing %s, volume %f, pitch %f\n",SoundName,volume,pitch);
|
||||
|
||||
//app.DebugPrintf("PlaySound - %d - %s\n",iSound, SoundName);
|
||||
#ifndef _WINDOWS64
|
||||
|
||||
AUDIO_INFO AudioInfo;
|
||||
memset(&AudioInfo,0,sizeof(AUDIO_INFO));
|
||||
@@ -870,6 +1153,82 @@ void SoundEngine::playUI(int iSound, float volume, float pitch)
|
||||
S32 token = AIL_enqueue_event_start();
|
||||
AIL_enqueue_event_buffer(&token, &AudioInfo, sizeof(AUDIO_INFO), 0);
|
||||
AIL_enqueue_event_end_named(token, (char *)szSoundName);
|
||||
#else
|
||||
char basePath[256];
|
||||
sprintf_s(basePath, "Windows64Media/Sound/%s/%s", soundDir, ConvertSoundPathToName(name));
|
||||
|
||||
char finalPath[256];
|
||||
|
||||
// Check UI sound path cache first
|
||||
auto cacheIt = m_uiSoundPathCache.find(iSound);
|
||||
if (cacheIt != m_uiSoundPathCache.end())
|
||||
{
|
||||
if (cacheIt->second.empty())
|
||||
{
|
||||
app.DebugPrintf("No sound file found for UI sound (cached): %s\n", basePath);
|
||||
return;
|
||||
}
|
||||
sprintf_s(finalPath, "%s", cacheIt->second.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
// Cache miss — probe filesystem and store result
|
||||
const char* extensions[] = { ".ogg", ".wav", ".mp3" };
|
||||
size_t count = sizeof(extensions) / sizeof(extensions[0]);
|
||||
bool found = false;
|
||||
for (size_t i = 0; i < count; i++)
|
||||
{
|
||||
sprintf_s(finalPath, "%s%s", basePath, extensions[i]);
|
||||
if (FileExists(finalPath))
|
||||
{
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
m_uiSoundPathCache[iSound] = ""; // cache negative result
|
||||
app.DebugPrintf("No sound file found for UI sound: %s\n", basePath);
|
||||
return;
|
||||
}
|
||||
m_uiSoundPathCache[iSound] = finalPath;
|
||||
}
|
||||
|
||||
MiniAudioSound* s = new MiniAudioSound();
|
||||
memset(&s->info, 0, sizeof(AUDIO_INFO));
|
||||
|
||||
s->info.volume = volume;
|
||||
s->info.pitch = pitch;
|
||||
s->info.bIs3D = false;
|
||||
s->info.bUseSoundsPitchVal = true;
|
||||
|
||||
if (ma_sound_init_from_file(
|
||||
&m_engine,
|
||||
finalPath,
|
||||
MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC,
|
||||
NULL,
|
||||
NULL,
|
||||
&s->sound) != MA_SUCCESS)
|
||||
{
|
||||
delete s;
|
||||
app.DebugPrintf("ma_sound_init_from_file failed: %s\n", finalPath);
|
||||
return;
|
||||
}
|
||||
|
||||
ma_sound_set_spatialization_enabled(&s->sound, MA_FALSE);
|
||||
|
||||
float finalVolume = volume * m_MasterEffectsVolume;
|
||||
if (finalVolume > 1.0f)
|
||||
finalVolume = 1.0f;
|
||||
printf("UI Sound volume set to %f\nEffects volume: %f\n", finalVolume, m_MasterEffectsVolume);
|
||||
|
||||
ma_sound_set_volume(&s->sound, finalVolume);
|
||||
ma_sound_set_pitch(&s->sound, pitch);
|
||||
|
||||
ma_sound_start(&s->sound);
|
||||
|
||||
m_activeSounds.push_back(s);
|
||||
#endif
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////
|
||||
@@ -1133,12 +1492,42 @@ int SoundEngine::OpenStreamThreadProc( void* lpParameter )
|
||||
return 0;
|
||||
#endif
|
||||
SoundEngine *soundEngine = (SoundEngine *)lpParameter;
|
||||
#ifndef _WINDOWS64
|
||||
soundEngine->m_hStream = AIL_open_stream(soundEngine->m_hDriver,soundEngine->m_szStreamName,0);
|
||||
|
||||
if(soundEngine->m_hStream==0)
|
||||
{
|
||||
app.DebugPrintf("SoundEngine::OpenStreamThreadProc - Could not open - %s\n",soundEngine->m_szStreamName);
|
||||
}
|
||||
#else
|
||||
const char* ext = strrchr(soundEngine->m_szStreamName, '.');
|
||||
|
||||
if (soundEngine->m_musicStreamActive)
|
||||
{
|
||||
ma_sound_stop(&soundEngine->m_musicStream);
|
||||
ma_sound_uninit(&soundEngine->m_musicStream);
|
||||
soundEngine->m_musicStreamActive = false;
|
||||
}
|
||||
|
||||
ma_result result = ma_sound_init_from_file(
|
||||
&soundEngine->m_engine,
|
||||
soundEngine->m_szStreamName,
|
||||
MA_SOUND_FLAG_STREAM,
|
||||
NULL,
|
||||
NULL,
|
||||
&soundEngine->m_musicStream);
|
||||
|
||||
if (result != MA_SUCCESS)
|
||||
{
|
||||
app.DebugPrintf("SoundEngine::OpenStreamThreadProc - Failed to open stream: %s\n", soundEngine->m_szStreamName);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ma_sound_set_spatialization_enabled(&soundEngine->m_musicStream, MA_FALSE);
|
||||
ma_sound_set_looping(&soundEngine->m_musicStream, MA_FALSE);
|
||||
|
||||
soundEngine->m_musicStreamActive = true;
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1158,6 +1547,7 @@ void SoundEngine::playMusicTick()
|
||||
// AP - moved to a separate function so it can be called from the mixer callback on Vita
|
||||
void SoundEngine::playMusicUpdate()
|
||||
{
|
||||
#ifndef _WINDOWS64
|
||||
//return;
|
||||
static bool firstCall = true;
|
||||
static float fMusicVol = 0.0f;
|
||||
@@ -1328,11 +1718,6 @@ void SoundEngine::playMusicUpdate()
|
||||
#endif
|
||||
}
|
||||
|
||||
// wstring name = m_szStreamFileA[m_musicID];
|
||||
// char *SoundName = (char *)ConvertSoundPathToName(name);
|
||||
// strcat((char *)szStreamName,SoundName);
|
||||
|
||||
|
||||
app.DebugPrintf("Starting streaming - %s\n",m_szStreamName);
|
||||
|
||||
// Don't actually open in this thread, as it can block for ~300ms.
|
||||
@@ -1340,10 +1725,150 @@ void SoundEngine::playMusicUpdate()
|
||||
m_openStreamThread->Run();
|
||||
m_StreamState = eMusicStreamState_Opening;
|
||||
}
|
||||
#else
|
||||
static float fMusicVol = 0.0f;
|
||||
fMusicVol = getMasterMusicVolume();
|
||||
|
||||
switch(m_StreamState)
|
||||
{
|
||||
case eMusicStreamState_Idle:
|
||||
|
||||
// start a stream playing
|
||||
if (m_iMusicDelay > 0)
|
||||
{
|
||||
m_iMusicDelay--;
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_musicStreamActive)
|
||||
{
|
||||
app.DebugPrintf("WARNING: m_musicStreamActive already true in Idle state, resetting to Playing\n");
|
||||
m_StreamState = eMusicStreamState_Playing;
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_musicID!=-1)
|
||||
{
|
||||
// start playing it
|
||||
strcpy((char *)m_szStreamName,m_szMusicPath);
|
||||
|
||||
// are we using a mash-up pack?
|
||||
//if(pMinecraft && !pMinecraft->skins->isUsingDefaultSkin() && pMinecraft->skins->getSelected()->hasAudio())
|
||||
if(Minecraft::GetInstance()->skins->getSelected()->hasAudio())
|
||||
{
|
||||
// It's a mash-up - need to use the DLC path for the music
|
||||
TexturePack *pTexPack=Minecraft::GetInstance()->skins->getSelected();
|
||||
DLCTexturePack *pDLCTexPack=(DLCTexturePack *)pTexPack;
|
||||
DLCPack *pack = pDLCTexPack->getDLCInfoParentPack();
|
||||
DLCAudioFile *dlcAudioFile = (DLCAudioFile *) pack->getFile(DLCManager::e_DLCType_Audio, 0);
|
||||
|
||||
app.DebugPrintf("Mashup pack \n");
|
||||
|
||||
// build the name
|
||||
|
||||
// if the music ID is beyond the end of the texture pack music files, then it's a CD
|
||||
if(m_musicID<m_iStream_CD_1)
|
||||
{
|
||||
SetIsPlayingStreamingGameMusic(true);
|
||||
SetIsPlayingStreamingCDMusic(false);
|
||||
m_MusicType=eMusicType_Game;
|
||||
m_StreamingAudioInfo.bIs3D=false;
|
||||
|
||||
wstring &wstrSoundName=dlcAudioFile->GetSoundName(m_musicID);
|
||||
char szName[255];
|
||||
wcstombs(szName,wstrSoundName.c_str(),255);
|
||||
|
||||
string strFile="TPACK:\\Data\\" + string(szName) + ".wav";
|
||||
std::string mountedPath = StorageManager.GetMountedPath(strFile);
|
||||
strcpy(m_szStreamName,mountedPath.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
SetIsPlayingStreamingGameMusic(false);
|
||||
SetIsPlayingStreamingCDMusic(true);
|
||||
m_MusicType=eMusicType_CD;
|
||||
m_StreamingAudioInfo.bIs3D=true;
|
||||
|
||||
// Need to adjust to index into the cds in the game's m_szStreamFileA
|
||||
strcat((char *)m_szStreamName,"cds/");
|
||||
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID-m_iStream_CD_1+eStream_CD_1]);
|
||||
strcat((char *)m_szStreamName,".wav");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(m_musicID<m_iStream_CD_1)
|
||||
{
|
||||
SetIsPlayingStreamingGameMusic(true);
|
||||
SetIsPlayingStreamingCDMusic(false);
|
||||
m_MusicType=eMusicType_Game;
|
||||
m_StreamingAudioInfo.bIs3D=false;
|
||||
// build the name
|
||||
strcat((char *)m_szStreamName,"music/");
|
||||
}
|
||||
else
|
||||
{
|
||||
SetIsPlayingStreamingGameMusic(false);
|
||||
SetIsPlayingStreamingCDMusic(true);
|
||||
m_MusicType=eMusicType_CD;
|
||||
m_StreamingAudioInfo.bIs3D=true;
|
||||
// build the name
|
||||
strcat((char *)m_szStreamName,"cds/");
|
||||
}
|
||||
strcat((char *)m_szStreamName,m_szStreamFileA[m_musicID]);
|
||||
strcat((char *)m_szStreamName,".wav");
|
||||
}
|
||||
|
||||
FILE* pFile = NULL;
|
||||
|
||||
if (fopen_s(&pFile, reinterpret_cast<char*>(m_szStreamName), "rb") == 0 && pFile)
|
||||
{
|
||||
fclose(pFile);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char* extensions[] = { ".ogg", ".mp3", ".wav" };
|
||||
size_t extCount = sizeof(extensions) / sizeof(extensions[0]);
|
||||
bool found = false;
|
||||
|
||||
char* dotPos = strrchr(reinterpret_cast<char*>(m_szStreamName), '.');
|
||||
if (dotPos != NULL && (dotPos - reinterpret_cast<char*>(m_szStreamName)) < 250)
|
||||
{
|
||||
for (size_t i = 0; i < extCount; i++)
|
||||
{
|
||||
strcpy_s(dotPos, 5, extensions[i]);
|
||||
|
||||
if (fopen_s(&pFile, reinterpret_cast<char*>(m_szStreamName), "rb") == 0 && pFile)
|
||||
{
|
||||
fclose(pFile);
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found)
|
||||
{
|
||||
if (dotPos != NULL)
|
||||
{
|
||||
strcpy_s(dotPos, 5, ".wav");
|
||||
}
|
||||
app.DebugPrintf("WARNING: No audio file found for music ID %d (tried .ogg, .mp3, .wav)\n", m_musicID);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
app.DebugPrintf("Starting streaming - %s\n",m_szStreamName);
|
||||
m_openStreamThread = new C4JThread(OpenStreamThreadProc, this, "OpenStreamThreadProc");
|
||||
m_openStreamThread->Run();
|
||||
m_StreamState = eMusicStreamState_Opening;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
case eMusicStreamState_Opening:
|
||||
// If the open stream thread is complete, then we are ready to proceed to actually playing
|
||||
#ifndef _WINDOWS64
|
||||
if( !m_openStreamThread->isRunning() )
|
||||
{
|
||||
delete m_openStreamThread;
|
||||
@@ -1409,6 +1934,63 @@ void SoundEngine::playMusicUpdate()
|
||||
|
||||
m_StreamState=eMusicStreamState_Playing;
|
||||
}
|
||||
#else
|
||||
if( !m_openStreamThread->isRunning() )
|
||||
{
|
||||
delete m_openStreamThread;
|
||||
m_openStreamThread = NULL;
|
||||
|
||||
app.DebugPrintf("OpenStreamThreadProc finished. m_musicStreamActive=%d\n", m_musicStreamActive);
|
||||
|
||||
if (!m_musicStreamActive)
|
||||
{
|
||||
const char* currentExt = strrchr(reinterpret_cast<char*>(m_szStreamName), '.');
|
||||
if (currentExt && _stricmp(currentExt, ".wav") == 0)
|
||||
{
|
||||
const bool isCD = (m_musicID >= m_iStream_CD_1);
|
||||
const char* folder = isCD ? "cds/" : "music/";
|
||||
|
||||
int n = sprintf_s(reinterpret_cast<char*>(m_szStreamName), 512, "%s%s%s.wav", m_szMusicPath, folder, m_szStreamFileA[m_musicID]);
|
||||
|
||||
if (n > 0)
|
||||
{
|
||||
FILE* pFile = NULL;
|
||||
if (fopen_s(&pFile, reinterpret_cast<char*>(m_szStreamName), "rb") == 0 && pFile)
|
||||
{
|
||||
fclose(pFile);
|
||||
|
||||
m_openStreamThread = new C4JThread(OpenStreamThreadProc, this, "OpenStreamThreadProc");
|
||||
m_openStreamThread->Run();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
m_StreamState = eMusicStreamState_Idle;
|
||||
break;
|
||||
}
|
||||
|
||||
if (m_StreamingAudioInfo.bIs3D)
|
||||
{
|
||||
ma_sound_set_spatialization_enabled(&m_musicStream, MA_TRUE);
|
||||
ma_sound_set_position(&m_musicStream, m_StreamingAudioInfo.x, m_StreamingAudioInfo.y, m_StreamingAudioInfo.z);
|
||||
}
|
||||
else
|
||||
{
|
||||
ma_sound_set_spatialization_enabled(&m_musicStream, MA_FALSE);
|
||||
}
|
||||
|
||||
ma_sound_set_pitch(&m_musicStream, m_StreamingAudioInfo.pitch);
|
||||
|
||||
float finalVolume = m_StreamingAudioInfo.volume * getMasterMusicVolume();
|
||||
|
||||
ma_sound_set_volume(&m_musicStream, finalVolume);
|
||||
ma_result startResult = ma_sound_start(&m_musicStream);
|
||||
app.DebugPrintf("ma_sound_start result: %d\n", startResult);
|
||||
|
||||
m_StreamState=eMusicStreamState_Playing;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case eMusicStreamState_OpeningCancel:
|
||||
if( !m_openStreamThread->isRunning() )
|
||||
@@ -1420,18 +2002,46 @@ void SoundEngine::playMusicUpdate()
|
||||
break;
|
||||
case eMusicStreamState_Stop:
|
||||
// should gradually take the volume down in steps
|
||||
#ifndef _WINDOWS64
|
||||
AIL_pause_stream(m_hStream,1);
|
||||
AIL_close_stream(m_hStream);
|
||||
m_hStream=0;
|
||||
SetIsPlayingStreamingCDMusic(false);
|
||||
SetIsPlayingStreamingGameMusic(false);
|
||||
m_StreamState=eMusicStreamState_Idle;
|
||||
#else
|
||||
if (m_musicStreamActive)
|
||||
{
|
||||
ma_sound_stop(&m_musicStream);
|
||||
ma_sound_uninit(&m_musicStream);
|
||||
m_musicStreamActive = false;
|
||||
}
|
||||
|
||||
SetIsPlayingStreamingCDMusic(false);
|
||||
SetIsPlayingStreamingGameMusic(false);
|
||||
|
||||
m_StreamState = eMusicStreamState_Idle;
|
||||
#endif
|
||||
break;
|
||||
case eMusicStreamState_Stopping:
|
||||
break;
|
||||
case eMusicStreamState_Play:
|
||||
break;
|
||||
case eMusicStreamState_Playing:
|
||||
#ifdef _WINDOWS64
|
||||
{
|
||||
static int frameCount = 0;
|
||||
if (frameCount++ % 60 == 0)
|
||||
{
|
||||
if (m_musicStreamActive)
|
||||
{
|
||||
bool isPlaying = ma_sound_is_playing(&m_musicStream);
|
||||
float vol = ma_sound_get_volume(&m_musicStream);
|
||||
bool isAtEnd = ma_sound_at_end(&m_musicStream);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if(GetIsPlayingStreamingGameMusic())
|
||||
{
|
||||
//if(m_MusicInfo.pCue!=NULL)
|
||||
@@ -1513,6 +2123,7 @@ void SoundEngine::playMusicUpdate()
|
||||
}
|
||||
|
||||
// volume change required?
|
||||
#ifndef _WINDOWS64
|
||||
if(fMusicVol!=getMasterMusicVolume())
|
||||
{
|
||||
fMusicVol=getMasterMusicVolume();
|
||||
@@ -1520,6 +2131,14 @@ void SoundEngine::playMusicUpdate()
|
||||
//AIL_set_sample_3D_position( hSample, m_StreamingAudioInfo.x, m_StreamingAudioInfo.y, m_StreamingAudioInfo.z );
|
||||
AIL_set_sample_volume_levels( hSample, fMusicVol, fMusicVol);
|
||||
}
|
||||
#else
|
||||
if (m_musicStreamActive)
|
||||
{
|
||||
float finalVolume = m_StreamingAudioInfo.volume * fMusicVol;
|
||||
|
||||
ma_sound_set_volume(&m_musicStream, finalVolume);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -1527,6 +2146,7 @@ void SoundEngine::playMusicUpdate()
|
||||
// Music disc playing - if it's a 3D stream, then set the position - we don't have any streaming audio in the world that moves, so this isn't
|
||||
// required unless we have more than one listener, and are setting the listening position to the origin and setting a fake position
|
||||
// for the sound down the z axis
|
||||
#ifndef _WINDOWS64
|
||||
if(m_StreamingAudioInfo.bIs3D)
|
||||
{
|
||||
if(m_validListenerCount>1)
|
||||
@@ -1565,6 +2185,40 @@ void SoundEngine::playMusicUpdate()
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (m_StreamingAudioInfo.bIs3D && m_validListenerCount > 1)
|
||||
{
|
||||
int iClosestListener = 0;
|
||||
float fClosestDist = 1e6f;
|
||||
|
||||
for (size_t i = 0; i < MAX_LOCAL_PLAYERS; i++)
|
||||
{
|
||||
if (m_ListenerA[i].bValid)
|
||||
{
|
||||
float dx = m_StreamingAudioInfo.x - m_ListenerA[i].vPosition.x;
|
||||
float dy = m_StreamingAudioInfo.y - m_ListenerA[i].vPosition.y;
|
||||
float dz = m_StreamingAudioInfo.z - m_ListenerA[i].vPosition.z;
|
||||
float dist = sqrtf(dx*dx + dy*dy + dz*dz);
|
||||
|
||||
if (dist < fClosestDist)
|
||||
{
|
||||
fClosestDist = dist;
|
||||
iClosestListener = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float relX = m_StreamingAudioInfo.x - m_ListenerA[iClosestListener].vPosition.x;
|
||||
float relY = m_StreamingAudioInfo.y - m_ListenerA[iClosestListener].vPosition.y;
|
||||
float relZ = m_StreamingAudioInfo.z - m_ListenerA[iClosestListener].vPosition.z;
|
||||
|
||||
if (m_musicStreamActive)
|
||||
{
|
||||
ma_sound_set_position(&m_musicStream, relX, relY, relZ);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
break;
|
||||
|
||||
@@ -1616,7 +2270,7 @@ void SoundEngine::playMusicUpdate()
|
||||
}
|
||||
|
||||
// check the status of the stream - this is for when a track completes rather than is stopped by the user action
|
||||
|
||||
#ifndef _WINDOWS64
|
||||
if(m_hStream!=0)
|
||||
{
|
||||
if(AIL_stream_status(m_hStream)==SMP_DONE ) // SMP_DONE
|
||||
@@ -1629,6 +2283,7 @@ void SoundEngine::playMusicUpdate()
|
||||
m_StreamState=eMusicStreamState_Completed;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1657,7 +2312,7 @@ char *SoundEngine::ConvertSoundPathToName(const wstring& name, bool bConvertSpac
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef _WINDOWS64
|
||||
F32 AILCALLBACK custom_falloff_function (HSAMPLE S,
|
||||
F32 distance,
|
||||
F32 rolloff_factor,
|
||||
@@ -1680,3 +2335,4 @@ F32 AILCALLBACK custom_falloff_function (HSAMPLE S,
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
@@ -3,6 +3,18 @@ class Mob;
|
||||
class Options;
|
||||
using namespace std;
|
||||
#include "..\..\Minecraft.World\SoundTypes.h"
|
||||
#include "miniaudio.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include <unordered_map>
|
||||
#include <string>
|
||||
|
||||
const float SFX_3D_MIN_DISTANCE = 1.0f;
|
||||
const float SFX_3D_MAX_DISTANCE = 16.0f;
|
||||
const float SFX_3D_ROLLOFF = 0.5f;
|
||||
const float SFX_VOLUME_MULTIPLIER = 1.5f;
|
||||
const float SFX_MAX_GAIN = 1.5f;
|
||||
#endif
|
||||
|
||||
enum eMUSICFILES
|
||||
{
|
||||
@@ -76,7 +88,11 @@ enum MUSIC_STREAMSTATE
|
||||
|
||||
typedef struct
|
||||
{
|
||||
F32 x,y,z,volume,pitch;
|
||||
#ifndef _WINDOWS64
|
||||
F32 x, y, z, volume, pitch;
|
||||
#else
|
||||
float x, y, z, volume, pitch;
|
||||
#endif
|
||||
int iSound;
|
||||
bool bIs3D;
|
||||
bool bUseSoundsPitchVal;
|
||||
@@ -86,6 +102,17 @@ typedef struct
|
||||
}
|
||||
AUDIO_INFO;
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
struct MiniAudioSound
|
||||
{
|
||||
ma_sound sound;
|
||||
AUDIO_INFO info;
|
||||
bool active;
|
||||
};
|
||||
|
||||
extern std::vector<MiniAudioSound*> m_activeSounds;
|
||||
#endif
|
||||
|
||||
class SoundEngine : public ConsoleSoundEngine
|
||||
{
|
||||
static const int MAX_SAME_SOUNDS_PLAYING = 8; // 4J added
|
||||
@@ -112,7 +139,11 @@ public:
|
||||
int getMusicID(int iDomain);
|
||||
int getMusicID(const wstring& name);
|
||||
void SetStreamingSounds(int iOverworldMin, int iOverWorldMax, int iNetherMin, int iNetherMax, int iEndMin, int iEndMax, int iCD1);
|
||||
void updateMiles(); // AP added so Vita can update all the Miles functions during the mixer callback
|
||||
#ifdef _WINDOWS64
|
||||
void updateMiniAudio();
|
||||
#else
|
||||
void updateMiles(); // AP added so Vita can update all the Miles functions during the mixer callback
|
||||
#endif
|
||||
void playMusicUpdate();
|
||||
|
||||
private:
|
||||
@@ -126,9 +157,18 @@ private:
|
||||
|
||||
int GetRandomishTrack(int iStart,int iEnd);
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
ma_engine m_engine;
|
||||
ma_engine_config m_engineConfig;
|
||||
ma_sound m_musicStream;
|
||||
bool m_musicStreamActive;
|
||||
std::unordered_map<int, std::vector<std::string>> m_soundPathCache;
|
||||
std::unordered_map<int, std::string> m_uiSoundPathCache;
|
||||
#else
|
||||
HMSOUNDBANK m_hBank;
|
||||
HDIGDRIVER m_hDriver;
|
||||
HSTREAM m_hStream;
|
||||
#endif
|
||||
|
||||
static char m_szSoundPath[];
|
||||
static char m_szMusicPath[];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
#include "stdafx.h"
|
||||
#include "Filesystem.h"
|
||||
|
||||
#ifdef _WINDOWS64
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
bool FileOrDirectoryExists(const char* path)
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
DWORD attribs = GetFileAttributesA(path);
|
||||
return (attribs != INVALID_FILE_ATTRIBUTES);
|
||||
#else
|
||||
#error "FileOrDirectoryExists not implemented for this platform"
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool FileExists(const char* path)
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
DWORD attribs = GetFileAttributesA(path);
|
||||
return (attribs != INVALID_FILE_ATTRIBUTES && !(attribs & FILE_ATTRIBUTE_DIRECTORY));
|
||||
#else
|
||||
#error "FileExists not implemented for this platform"
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool DirectoryExists(const char* path)
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
DWORD attribs = GetFileAttributesA(path);
|
||||
return (attribs != INVALID_FILE_ATTRIBUTES && (attribs & FILE_ATTRIBUTE_DIRECTORY));
|
||||
#else
|
||||
#error "DirectoryExists not implemented for this platform"
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool GetFirstFileInDirectory(const char* directory, char* outFilePath, size_t outFilePathSize)
|
||||
{
|
||||
#ifdef _WINDOWS64
|
||||
char searchPath[MAX_PATH];
|
||||
printf(searchPath, MAX_PATH, "%s\\*", directory);
|
||||
|
||||
WIN32_FIND_DATAA findData;
|
||||
HANDLE hFind = FindFirstFileA(searchPath, &findData);
|
||||
|
||||
if (hFind == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
if (!(findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||
{
|
||||
// Found a file, copy its path to the output buffer
|
||||
printf(outFilePath, outFilePathSize, "%s\\%s", directory, findData.cFileName);
|
||||
FindClose(hFind);
|
||||
return true;
|
||||
}
|
||||
} while (FindNextFileA(hFind, &findData) != 0);
|
||||
|
||||
FindClose(hFind);
|
||||
return false; // No files found in the directory
|
||||
#else
|
||||
#error "GetFirstFileInDirectory not implemented for this platform"
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
bool FileOrDirectoryExists(const char* path);
|
||||
bool FileExists(const char* path);
|
||||
bool DirectoryExists(const char* path);
|
||||
bool GetFirstFileInDirectory(const char* directory, char* outFilePath, size_t outFilePathSize);
|
||||
#pragma once
|
||||
@@ -9,7 +9,9 @@ const wstring LeaderboardManager::filterNames[eNumFilterModes] =
|
||||
L"Friends", L"MyScore", L"TopRank"
|
||||
};
|
||||
|
||||
#if !defined(_WINDOWS64) && !defined(_DURANGO) && !defined(__ORBIS__) && !defined(__PS3__) && !defined(__PSVITA__) && !defined(_XBOX)
|
||||
LeaderboardManager *LeaderboardManager::m_instance = NULL;
|
||||
#endif
|
||||
|
||||
void LeaderboardManager::DeleteInstance()
|
||||
{
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -20,7 +20,7 @@ foreach ($dir in $directories) {
|
||||
}
|
||||
|
||||
$folderCopies = @(
|
||||
@{ Source = "music"; Dest = "PS4_GAME\music" },
|
||||
@{ Source = "music\Miles"; Dest = "PS4_GAME\music" },
|
||||
@{ Source = "Common\Media"; Dest = "PS4_GAME\Common\Media" },
|
||||
@{ Source = "Common\res"; Dest = "PS4_GAME\Common\res" },
|
||||
@{ Source = "PSVita\Tutorial"; Dest = "PS4_GAME\Common\Tutorial" },
|
||||
@@ -59,7 +59,7 @@ $destPath = Join-Path $destDir $newName
|
||||
|
||||
if (Test-Path $builtFile) {
|
||||
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
|
||||
Move-Item -Path $builtFile -Destination $destPath -Force
|
||||
Copy-Item -Path $builtFile -Destination $destPath -Force
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
@@ -84,8 +84,8 @@ foreach ($dir in $deleteDirs) {
|
||||
}
|
||||
|
||||
$delDirs = @(
|
||||
"Common\Media",
|
||||
"Common\Media\font"
|
||||
"PS4_GAME\Common\Media",
|
||||
"PS4_GAME\Common\Media\font"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
|
||||
@@ -19,7 +19,7 @@ foreach ($dir in $directories) {
|
||||
}
|
||||
|
||||
$folderCopies = @(
|
||||
@{ Source = "music"; Dest = "PS3_GAME\USRDIR\music" },
|
||||
@{ Source = "music\Miles"; Dest = "PS3_GAME\USRDIR\music" },
|
||||
@{ Source = "Common\Media"; Dest = "PS3_GAME\USRDIR\Common\Media" },
|
||||
@{ Source = "Common\res"; Dest = "PS3_GAME\USRDIR\Common\res" },
|
||||
@{ Source = "PS3Media\DLC"; Dest = "PS3_GAME\USRDIR\DLC" },
|
||||
@@ -91,8 +91,8 @@ foreach ($dir in $deleteDirs) {
|
||||
}
|
||||
|
||||
$delDirs = @(
|
||||
"Common\Media",
|
||||
"Common\Media\font"
|
||||
"PS3_GAME\USRDIR\Common\Media",
|
||||
"PS3_GAME\USRDIR\Common\Media\font"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
|
||||
@@ -19,7 +19,7 @@ foreach ($dir in $directories) {
|
||||
}
|
||||
|
||||
$folderCopies = @(
|
||||
@{ Source = "music"; Dest = "PSVITA_GAME\music" },
|
||||
@{ Source = "music\Miles"; Dest = "PSVITA_GAME\music" },
|
||||
@{ Source = "Common\Media"; Dest = "PSVITA_GAME\Common\Media" },
|
||||
@{ Source = "Common\res"; Dest = "PSVITA_GAME\Common\res" },
|
||||
@{ Source = "PSVita\Sound"; Dest = "PSVITA_GAME\Sound" },
|
||||
@@ -57,7 +57,7 @@ $destPath = Join-Path $destDir $newName
|
||||
|
||||
if (Test-Path $builtFile) {
|
||||
New-Item -ItemType Directory -Path $destDir -Force | Out-Null
|
||||
Move-Item -Path $builtFile -Destination $destPath -Force
|
||||
Copy-Item -Path $builtFile -Destination $destPath -Force
|
||||
}
|
||||
|
||||
$deleteDirs = @(
|
||||
@@ -82,8 +82,8 @@ foreach ($dir in $deleteDirs) {
|
||||
}
|
||||
|
||||
$delDirs = @(
|
||||
"Common\Media",
|
||||
"Common\Media\font"
|
||||
"PSVITA_GAME\Common\Media",
|
||||
"PSVITA_GAME\Common\Media\font"
|
||||
)
|
||||
|
||||
foreach ($dir in $delDirs) {
|
||||
|
||||
@@ -21,12 +21,10 @@ foreach ($dir in $directories) {
|
||||
$folderCopies = @(
|
||||
@{ Source = "Common\Media"; Dest = "Common\Media" },
|
||||
@{ Source = "Common\res"; Dest = "Common\res" },
|
||||
@{ Source = "DurangoMedia"; Dest = "Windows64Media" },
|
||||
@{ Source = "Windows64Media"; Dest = "Windows64Media" },
|
||||
@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" },
|
||||
@{ Source = "Windows64Media\music"; Dest = "Windows64Media\music" },
|
||||
@{ Source = "music\Miniaudio"; Dest = "music" },
|
||||
@{ Source = "Windows64Media\DLC"; Dest = "Windows64Media\DLC" },
|
||||
@{ Source = "Windows64Media\Sound"; Dest = "Windows64Media\Sound" },
|
||||
@{ Source = "Common\Postbuilds\Contents\Windows64\redist64"; Dest = "redist64" }
|
||||
@{ Source = "PSVita\Tutorial"; Dest = "Windows64Media\Tutorial" }
|
||||
)
|
||||
|
||||
foreach ($copy in $folderCopies) {
|
||||
@@ -39,9 +37,7 @@ foreach ($copy in $folderCopies) {
|
||||
}
|
||||
|
||||
$fileCopies = @(
|
||||
@{ Source = "Common\Postbuilds\Contents\Windows64\Effects.msscmp"; Dest = "Effects.msscmp" },
|
||||
@{ Source = "Common\Postbuilds\Contents\Windows64\iggy_w64.dll"; Dest = "iggy_w64.dll" },
|
||||
@{ Source = "Common\Postbuilds\Contents\Windows64\mss64.dll"; Dest = "mss64.dll" }
|
||||
@{ Source = "Common\Postbuilds\Contents\Windows64\iggy_w64.dll"; Dest = "iggy_w64.dll" }
|
||||
)
|
||||
|
||||
foreach ($copy in $fileCopies) {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
// 4J - added
|
||||
void CreeperModel::_init(float g)
|
||||
{
|
||||
int yo = 4;
|
||||
int yo = 6;
|
||||
|
||||
head = new ModelPart(this, 0, 0);
|
||||
head->addBox(-4, - 8, -4, 8, 8, 8, g); // Head
|
||||
|
||||
@@ -46,9 +46,35 @@ void HorseRenderer::renderModel(shared_ptr<LivingEntity> mob, float wp, float ws
|
||||
}
|
||||
else
|
||||
{
|
||||
EntityRenderer::bindTexture(mob);
|
||||
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
|
||||
// Ensure that any extra layers of texturing are disabled after rendering this horse
|
||||
shared_ptr<EntityHorse> horse = dynamic_pointer_cast<EntityHorse>(mob);
|
||||
ResourceLocation *location = getTextureLocation(mob);
|
||||
|
||||
// Pass 1: Bind only the coat texture (first valid layer) and render opaque
|
||||
int coatTex = location->getTexture(0);
|
||||
if( coatTex != -1 )
|
||||
{
|
||||
RenderManager.TextureBind(entityRenderDispatcher->textures->loadTexture(coatTex));
|
||||
}
|
||||
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
|
||||
|
||||
// Pass 2: If horse has armor, find the armor texture in the layers and render with blending
|
||||
int armorType = horse->getArmorType();
|
||||
if( armorType > 0 )
|
||||
{
|
||||
glEnable(GL_BLEND);
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
for( int i = 1; i < location->getTextureCount(); i++ )
|
||||
{
|
||||
int texId = location->getTexture(i);
|
||||
if( texId != -1 )
|
||||
{
|
||||
RenderManager.TextureBind(entityRenderDispatcher->textures->loadTexture(texId));
|
||||
model->render(mob, wp, ws, bob, headRotMinusBodyRot, headRotx, scale, true);
|
||||
}
|
||||
}
|
||||
glDisable(GL_BLEND);
|
||||
}
|
||||
|
||||
RenderManager.TextureBind(-1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -491,7 +491,7 @@ void LivingEntityRenderer::renderNameTag(shared_ptr<LivingEntity> mob, const wst
|
||||
float s = 1 / 60.0f * size;
|
||||
|
||||
glPushMatrix();
|
||||
glTranslatef((float) x, (float) y + 2.3f, (float) z);
|
||||
glTranslatef((float) x, (float) y + mob->bbHeight + 0.5f, (float) z);
|
||||
glNormal3f(0, 1, 0);
|
||||
|
||||
glRotatef(-this->entityRenderDispatcher->playerRotY, 0, 1, 0);
|
||||
|
||||
@@ -1435,7 +1435,7 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata"</Command>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallAttributedProfiling>Disabled</CallAttributedProfiling>
|
||||
<AdditionalIncludeDirectories>Windows64\Iggy\include;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
@@ -1472,46 +1472,6 @@ if not exist "$(TargetDir)\savedata" mkdir "$(TargetDir)\savedata"</Command>
|
||||
<Message>Run Windows64 postbuild script</Message>
|
||||
</PostBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(OutDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<CallAttributedProfiling>Disabled</CallAttributedProfiling>
|
||||
<AdditionalIncludeDirectories>Windows64\Iggy\include;$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
<ShowIncludes>false</ShowIncludes>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
||||
<AdditionalDependencies>d3d11.lib;..\Minecraft.World\x64_Debug\Minecraft.World.lib;%(AdditionalDependencies);XInput9_1_0.lib;..\Minecraft.Client\Windows64\Miles\Lib\mss64.lib;wsock32.lib</AdditionalDependencies>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<SuppressStartupBanner>false</SuppressStartupBanner>
|
||||
</Link>
|
||||
<ImageXex>
|
||||
<ConfigurationFile>$(ProjectDir)xbox\xex-dev.xml</ConfigurationFile>
|
||||
</ImageXex>
|
||||
<ImageXex>
|
||||
<TitleID>1480659447</TitleID>
|
||||
</ImageXex>
|
||||
<ImageXex>
|
||||
<AdditionalSections>584111F7=$(ProjectDir)xbox\GameConfig\Minecraft.spa,RO;media=$(ProjectDir)xbox\XZP\Minecraft.xzp,RO</AdditionalSections>
|
||||
<Pal50Incompatible>true</Pal50Incompatible>
|
||||
</ImageXex>
|
||||
<Deploy>
|
||||
<DeploymentType>CopyToHardDrive</DeploymentType>
|
||||
<DeploymentFiles>$(RemoteRoot)=$(ImagePath);$(RemoteRoot)\res=Xbox\res;$(RemoteRoot)=Xbox\AvatarAwards;$(RemoteRoot)\Tutorial=Xbox\Tutorial\Tutorial;$(RemoteRoot)=Xbox\584111F70AAAAAAA;$(RemoteRoot)=Xbox\kinect\speech;$(RemoteRoot)=Xbox\XZP\TMSFiles.xzp</DeploymentFiles>
|
||||
</Deploy>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Durango'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
@@ -4933,6 +4893,8 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\MinecraftConsoles\Minecraft.Client\Common\Audio\miniaudio.h" />
|
||||
<ClInclude Include="..\..\MinecraftConsoles\Minecraft.Client\Common\Audio\stb_vorbis.h" />
|
||||
<ClInclude Include="AbstractContainerScreen.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
|
||||
@@ -5036,7 +4998,9 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClInclude Include="Common\App_enums.h" />
|
||||
<ClInclude Include="Common\App_structs.h" />
|
||||
<ClInclude Include="Common\Audio\Consoles_SoundEngine.h" />
|
||||
<ClInclude Include="Common\Audio\miniaudio.h" />
|
||||
<ClInclude Include="Common\Audio\SoundEngine.h" />
|
||||
<ClInclude Include="Common\Audio\stb_vorbis.h" />
|
||||
<ClInclude Include="Common\BuildVer.h" />
|
||||
<ClInclude Include="Common\Colours\ColourTable.h" />
|
||||
<ClInclude Include="Common\Consoles_App.h" />
|
||||
@@ -5053,6 +5017,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClInclude Include="Common\DLC\DLCSkinFile.h" />
|
||||
<ClInclude Include="Common\DLC\DLCTextureFile.h" />
|
||||
<ClInclude Include="Common\DLC\DLCUIDataFile.h" />
|
||||
<ClInclude Include="Common\Filesystem\Filesystem.h" />
|
||||
<ClInclude Include="Common\GameRules\AddEnchantmentRuleDefinition.h" />
|
||||
<ClInclude Include="Common\GameRules\AddItemRuleDefinition.h" />
|
||||
<ClInclude Include="Common\GameRules\ApplySchematicRuleDefinition.h" />
|
||||
@@ -17167,6 +17132,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PSVita\Network\PSVita_NPToolkit.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
|
||||
@@ -17485,6 +17451,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PSVita\OldSdk.h" />
|
||||
<ClInclude Include="PSVita\PSVitaExtras\Conf.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Durango'">true</ExcludedFromBuild>
|
||||
@@ -25215,6 +25182,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ClCompile Include="Common\DLC\DLCSkinFile.cpp" />
|
||||
<ClCompile Include="Common\DLC\DLCTextureFile.cpp" />
|
||||
<ClCompile Include="Common\DLC\DLCUIDataFile.cpp" />
|
||||
<ClCompile Include="Common\Filesystem\Filesystem.cpp" />
|
||||
<ClCompile Include="Common\GameRules\AddEnchantmentRuleDefinition.cpp" />
|
||||
<ClCompile Include="Common\GameRules\AddItemRuleDefinition.cpp" />
|
||||
<ClCompile Include="Common\GameRules\ApplySchematicRuleDefinition.cpp" />
|
||||
@@ -32817,6 +32785,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|PSVita'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PSVita\Network\PSVita_NPToolkit.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
|
||||
@@ -33133,6 +33102,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Xbox 360'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='CONTENTPACKAGE_SYMBOLS|Xbox 360'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PSVita\OldSdk.cpp" />
|
||||
<ClCompile Include="PSVita\PSVitaExtras\CustomMap.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage|Durango'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Durango'">true</ExcludedFromBuild>
|
||||
@@ -34044,7 +34014,7 @@ xcopy /q /y /i /s /e $(ProjectDir)Durango\CU $(LayoutDir)Image\Loose\CU</Comman
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ReleaseForArt|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_NO_TU|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|x64'">false</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='ContentPackage_Vita|Win32'">false</ExcludedFromBuild>
|
||||
|
||||
@@ -3772,6 +3772,24 @@
|
||||
<ClInclude Include="Common\Leaderboards\LeaderboardInterface.h">
|
||||
<Filter>Common\Source Files\Leaderboards</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="PSVita\OldSdk.h">
|
||||
<Filter>PSVita</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\MinecraftConsoles\Minecraft.Client\Common\Audio\miniaudio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\MinecraftConsoles\Minecraft.Client\Common\Audio\stb_vorbis.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Audio\stb_vorbis.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Audio\miniaudio.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Common\Filesystem\Filesystem.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
@@ -5913,6 +5931,12 @@
|
||||
<ClCompile Include="Common\Leaderboards\LeaderboardInterface.cpp">
|
||||
<Filter>Common\Source Files\Leaderboards</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="PSVita\OldSdk.cpp">
|
||||
<Filter>PSVita</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Common\Filesystem\Filesystem.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Library Include="Xbox\4JLibs\libs\4J_Render_d.lib">
|
||||
|
||||
@@ -1858,7 +1858,7 @@ void Minecraft::run_middle()
|
||||
achievementPopup->render();
|
||||
|
||||
PIXBeginNamedEvent(0,"Sleeping");
|
||||
Sleep(0); // 4J - was Thread.yield()
|
||||
//Sleep(0); // 4J - was Thread.yield()
|
||||
PIXEndNamedEvent();
|
||||
|
||||
// if (Keyboard::isKeyDown(Keyboard::KEY_F7)) Display.update(); // 4J - removed condition
|
||||
|
||||
@@ -116,7 +116,7 @@ void Options::init()
|
||||
bobView = true;
|
||||
anaglyph3d = false;
|
||||
advancedOpengl = false;
|
||||
framerateLimit = 2;
|
||||
framerateLimit = 0;
|
||||
fancyGraphics = true;
|
||||
ambientOcclusion = true;
|
||||
renderClouds = true;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,109 +1,32 @@
|
||||
#pragma once
|
||||
|
||||
#include "Common\Leaderboards\SonyLeaderboardManager.h"
|
||||
#include "Common\Leaderboards\LeaderboardManager.h"
|
||||
|
||||
class OrbisLeaderboardManager : public LeaderboardManager
|
||||
{
|
||||
protected:
|
||||
enum EStatsState
|
||||
{
|
||||
eStatsState_Idle,
|
||||
eStatsState_Getting,
|
||||
eStatsState_Failed,
|
||||
eStatsState_Ready,
|
||||
eStatsState_Canceled,
|
||||
//eStatsState_Writing,
|
||||
eStatsState_Max
|
||||
};
|
||||
#include <np.h>
|
||||
|
||||
class OrbisLeaderboardManager : public SonyLeaderboardManager
|
||||
{
|
||||
public:
|
||||
OrbisLeaderboardManager();
|
||||
virtual ~OrbisLeaderboardManager();
|
||||
|
||||
private:
|
||||
unsigned short m_openSessions;
|
||||
protected:
|
||||
|
||||
C4JThread *m_threadScoreboard;
|
||||
bool m_running;
|
||||
virtual HRESULT initialiseScoreUtility();
|
||||
|
||||
int m_titleContext;
|
||||
int32_t m_requestId;
|
||||
virtual bool scoreUtilityAlreadyInitialised(HRESULT hr);
|
||||
|
||||
//SceNpId m_myNpId;
|
||||
virtual HRESULT createTitleContext(const SceNpId &npId);
|
||||
|
||||
static int scoreboardThreadEntry(LPVOID lpParam);
|
||||
void scoreboardThreadInternal();
|
||||
virtual HRESULT destroyTitleContext(int titleContext);
|
||||
|
||||
bool getScoreByIds();
|
||||
bool getScoreByRange();
|
||||
virtual HRESULT createTransactionContext(int titleContext);
|
||||
|
||||
bool setScore();
|
||||
queue<RegisterScore> m_views;
|
||||
virtual HRESULT abortTransactionContext(int transactionContext);
|
||||
|
||||
CRITICAL_SECTION m_csViewsLock;
|
||||
virtual HRESULT destroyTransactionContext(int transactionContext);
|
||||
|
||||
EStatsState m_eStatsState; //State of the stats read
|
||||
// EFilterMode m_eFilterMode;
|
||||
virtual HRESULT getFriendsList(sce::Toolkit::NP::Utilities::Future<sce::Toolkit::NP::FriendsList> &friendsList);
|
||||
|
||||
ReadScore *m_scores;
|
||||
unsigned int m_maxRank;
|
||||
//SceNpScoreRankData *m_stats;
|
||||
|
||||
public:
|
||||
virtual void Tick();// {}
|
||||
|
||||
//Open a session
|
||||
virtual bool OpenSession();// { return true; }
|
||||
|
||||
//Close a session
|
||||
virtual void CloseSession();// {}
|
||||
|
||||
//Delete a session
|
||||
virtual void DeleteSession();// {}
|
||||
|
||||
//Write the given stats
|
||||
//This is called synchronously and will not free any memory allocated for views when it is done
|
||||
|
||||
virtual bool WriteStats(unsigned int viewCount, ViewIn views);// { return false; }
|
||||
|
||||
virtual bool ReadStats_Friends(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int startIndex, unsigned int readCount);// { return false; }
|
||||
virtual bool ReadStats_MyScore(LeaderboardReadListener *callback, int difficulty, EStatsType type, PlayerUID myUID, unsigned int readCount);// { return false; }
|
||||
virtual bool ReadStats_TopRank(LeaderboardReadListener *callback, int difficulty, EStatsType type, unsigned int startIndex, unsigned int readCount);// { return false; }
|
||||
|
||||
//Perform a flush of the stats
|
||||
virtual void FlushStats();// {}
|
||||
|
||||
//Cancel the current operation
|
||||
virtual void CancelOperation();// {}
|
||||
|
||||
//Is the leaderboard manager idle.
|
||||
virtual bool isIdle();// { return true; }
|
||||
|
||||
|
||||
private:
|
||||
int getBoardId(int difficulty, EStatsType);
|
||||
|
||||
//LeaderboardManager::ReadScore *filterJustScorers(unsigned int &num, LeaderboardManager::ReadScore *friendsData);
|
||||
|
||||
SceNpScorePlayerRankData *addPadding(unsigned int num, SceNpScoreRankData *rankData);
|
||||
|
||||
void convertToOutput(unsigned int &num, ReadScore *out, SceNpScorePlayerRankData *rankData, SceNpScoreComment *comm);
|
||||
|
||||
void toBinary(void *out, SceNpScoreComment *in);
|
||||
void fromBinary(SceNpScoreComment **out, void *in);
|
||||
|
||||
void toBase32(SceNpScoreComment *out, void *in);
|
||||
void fromBase32(void *out, SceNpScoreComment *in);
|
||||
|
||||
void toSymbols(char *);
|
||||
void fromSymbols(char *);
|
||||
|
||||
bool test_string(string);
|
||||
|
||||
void initReadScoreStruct(ReadScore &out, SceNpScoreRankData &);
|
||||
void fillReadScoreStruct(ReadScore &out, SceNpScoreComment &comment);
|
||||
|
||||
static bool SortByRank(const ReadScore &lhs, const ReadScore &rhs);
|
||||
|
||||
//void NotifyAsyncPlusFeature();
|
||||
virtual char * getComment(SceNpScoreComment *comment);
|
||||
};
|
||||
|
||||
@@ -10,6 +10,8 @@
|
||||
|
||||
#include "..\..\Common\Network\Sony\SQRNetworkManager.h"
|
||||
|
||||
#include "../OldSdk.h"
|
||||
|
||||
class SQRNetworkPlayer;
|
||||
class ISQRNetworkManagerListener;
|
||||
class SonyVoiceChat_Vita;
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
#include "stdafx.h"
|
||||
#include "OldSdk.h"
|
||||
#ifdef __PSVITA__
|
||||
|
||||
int sceNpBasicGetFriendOnlineStatus(const SceNpId *friendId, SceNpBasicOnlineStatus *status) {
|
||||
if (status) *status = SCE_NP_BASIC_ONLINE_STATUS_UNKNOWN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int sceNpBasicGetFriendContextState(const SceNpId *friendId, SceNpBasicFriendContextState *state) {
|
||||
if (state) *state = SCE_NP_BASIC_FRIEND_CONTEXT_STATE_UNKNOWN;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int sceNpBasicGetGamePresenceOfFriend(const SceNpId *friendId, SceNpBasicGamePresence *presence) {
|
||||
if (presence) memset(presence, 0, sizeof(SceNpBasicGamePresence));
|
||||
return -1;
|
||||
}
|
||||
|
||||
int sceNpBasicGetFriendListEntryCount(SceSize *count) {
|
||||
if (count) *count = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceNpBasicGetFriendListEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved) {
|
||||
if (retrieved) *retrieved = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceNpBasicGetFriendRequestEntryCount(SceSize *count) {
|
||||
if (count) *count = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceNpBasicGetFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved) {
|
||||
if (retrieved) *retrieved = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceNpBasicGetRequestedFriendRequestEntryCount(SceSize *count) {
|
||||
if (count) *count = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sceNpBasicGetRequestedFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved) {
|
||||
if (retrieved) *retrieved = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
SceInt32 sceAppUtilAppEventParseNpBasicJoinablePresence(const SceAppUtilAppEventParam *eventParam, SceAppUtilNpBasicJoinablePresenceParam *param) {
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
#ifdef __PSVITA__
|
||||
#ifndef _OLD_SDK_H
|
||||
#define _OLD_SDK_H 1
|
||||
|
||||
#include <np.h>
|
||||
#include <np/np_basic.h>
|
||||
#include <apputil.h>
|
||||
#include <np_toolkit.h>
|
||||
#include <np_toolkit\friends_interface.h>
|
||||
|
||||
typedef enum {
|
||||
SCE_NP_BASIC_ONLINE_STATUS_UNKNOWN = 0,
|
||||
SCE_NP_BASIC_ONLINE_STATUS_OFFLINE = 1,
|
||||
SCE_NP_BASIC_ONLINE_STATUS_AFK = 2,
|
||||
SCE_NP_BASIC_ONLINE_STATUS_ONLINE = 3
|
||||
} SceNpBasicOnlineStatus;
|
||||
|
||||
typedef void(*SceNpBasicFriendOnlineStatusEventHandler)(
|
||||
const SceNpId *friendId,
|
||||
SceNpBasicOnlineStatus status,
|
||||
void *userdata
|
||||
);
|
||||
|
||||
typedef enum {
|
||||
SCE_NP_BASIC_FRIEND_CONTEXT_STATE_UNKNOWN = 0,
|
||||
SCE_NP_BASIC_FRIEND_CONTEXT_STATE_OUT_OF_CONTEXT = 1,
|
||||
SCE_NP_BASIC_FRIEND_CONTEXT_STATE_IN_CONTEXT = 2
|
||||
} SceNpBasicFriendContextState;
|
||||
|
||||
typedef void(*SceNpBasicFriendContextEventHandler)(
|
||||
const SceNpId *friendId,
|
||||
SceNpBasicFriendContextState state,
|
||||
void *userdata
|
||||
);
|
||||
typedef struct SceAppUtilNpBasicJoinablePresenceParam {
|
||||
SceNpCommunicationId commId;
|
||||
SceNpId npId;
|
||||
} SceAppUtilNpBasicJoinablePresenceParam;
|
||||
|
||||
int sceNpBasicGetFriendOnlineStatus(const SceNpId *friendId, SceNpBasicOnlineStatus *status);
|
||||
int sceNpBasicGetFriendContextState(const SceNpId *friendId, SceNpBasicFriendContextState *state);
|
||||
int sceNpBasicGetGamePresenceOfFriend(const SceNpId *friendId, SceNpBasicGamePresence *presence);
|
||||
int sceNpBasicGetFriendListEntryCount(SceSize *count);
|
||||
int sceNpBasicGetFriendListEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved);
|
||||
int sceNpBasicGetFriendRequestEntryCount(SceSize *count);
|
||||
int sceNpBasicGetFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved);
|
||||
int sceNpBasicGetRequestedFriendRequestEntryCount(SceSize *count);
|
||||
int sceNpBasicGetRequestedFriendRequestEntries(unsigned int startIndex, SceNpId *entries, SceSize numEntries, SceSize *retrieved);
|
||||
SceInt32 sceAppUtilAppEventParseNpBasicJoinablePresence(const SceAppUtilAppEventParam *eventParam, SceAppUtilNpBasicJoinablePresenceParam *param);
|
||||
|
||||
#define SCE_APPUTIL_APPEVENT_TYPE_NP_BASIC_JOINABLE_PRESENCE (3)
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -434,7 +434,11 @@ void Textures::bindTextureLayers(ResourceLocation *resource)
|
||||
|
||||
for( int i = 0; i < layers; i++ )
|
||||
{
|
||||
RenderManager.TextureBind(loadTexture(resource->getTexture(i)));
|
||||
int texId = resource->getTexture(i);
|
||||
if( texId != -1 )
|
||||
{
|
||||
RenderManager.TextureBind(loadTexture(texId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -498,7 +498,7 @@ app.DebugPrintf("width: %d, height: %d\n", width, height);
|
||||
|
||||
DXGI_SWAP_CHAIN_DESC sd;
|
||||
ZeroMemory( &sd, sizeof( sd ) );
|
||||
sd.BufferCount = 1;
|
||||
sd.BufferCount = 2;
|
||||
sd.BufferDesc.Width = width;
|
||||
sd.BufferDesc.Height = height;
|
||||
sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user