Merge branch 'kaetemi-develop' into feature/nel-dll

feature/nel-dll
kaetemi 6 years ago
commit 40a000c0c5

@ -18,7 +18,7 @@
#define NLSOUND_AUDIO_DECODER_MP3_H #define NLSOUND_AUDIO_DECODER_MP3_H
#include <nel/misc/types_nl.h> #include <nel/misc/types_nl.h>
#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ #if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */
#include <nel/sound/audio_decoder.h> #include <nel/sound/audio_decoder.h>

File diff suppressed because it is too large Load Diff

@ -103,7 +103,7 @@ IAudioDecoder *IAudioDecoder::createAudioDecoder(const std::string &type, NLMISC
{ {
return new CAudioDecoderVorbis(stream, loop); return new CAudioDecoderVorbis(stream, loop);
} }
#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ #if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */
else if (type_lower == "mp3") else if (type_lower == "mp3")
{ {
return new CAudioDecoderMP3(stream, loop); return new CAudioDecoderMP3(stream, loop);
@ -146,7 +146,7 @@ bool IAudioDecoder::getInfo(const std::string &filepath, std::string &artist, st
nlwarning("Unable to open: '%s'", filepath.c_str()); nlwarning("Unable to open: '%s'", filepath.c_str());
} }
#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ #if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */
else if (type_lower == "mp3") else if (type_lower == "mp3")
{ {
CIFile ifile; CIFile ifile;

@ -17,7 +17,7 @@
#include "stdsound.h" #include "stdsound.h"
#if (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */ #if !defined(NL_OS_WINDOWS) || (NL_COMP_VC_VERSION > 90) /* VS2008 does not have stdint.h */
#include <nel/sound/audio_decoder_mp3.h> #include <nel/sound/audio_decoder_mp3.h>

@ -61,8 +61,9 @@ if LigoExportLand == "" or LigoExportOnePass == 1:
mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemZoneLigoExportDirectory) mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemZoneLigoExportDirectory)
mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemCmbExportDirectory) mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemCmbExportDirectory)
mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0]) mkPath(log, DatabaseDirectory + "/" + ZoneSourceDirectory[0])
mkPath(log, ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory) tagDirectory = ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory
if (needUpdateDirByTagLogFiltered(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory, ".max.tag", [ "zonematerial", "zonetransition", "zonespecial" ])): mkPath(log, tagDirectory)
if (needUpdateDirByTagLogFiltered(log, DatabaseDirectory + "/" + LigoMaxSourceDirectory, ".max", tagDirectory, ".max.tag", [ "zonematerial", "zonetransition", "zonespecial" ])):
printLog(log, "WRITE " + ligoIniPath) printLog(log, "WRITE " + ligoIniPath)
ligoIni = open(ligoIniPath, "w") ligoIni = open(ligoIniPath, "w")
ligoIni.write("[LigoConfig]\n") ligoIni.write("[LigoConfig]\n")
@ -71,29 +72,69 @@ if LigoExportLand == "" or LigoExportOnePass == 1:
ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory[0] + "/\n") ligoIni.write("LigoOldZonePath=" + DatabaseDirectory + "/" + ZoneSourceDirectory[0] + "/\n")
ligoIni.close() ligoIni.close()
outDirTag = ExportBuildDirectory + "/" + LigoEcosystemTagExportDirectory outputLogfile = ScriptDirectory + "/processes/ligo/log.log"
logFile = ScriptDirectory + "/processes/ligo/log.log"
smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank" smallBank = ExportBuildDirectory + "/" + SmallbankExportDirectory + "/" + BankTileBankName + ".smallbank"
maxRunningTagFile = tagDirectory + "/max_running.tag"
scriptSrc = "maxscript/nel_ligo_export.ms" scriptSrc = "maxscript/nel_ligo_export.ms"
scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms" scriptDst = MaxUserDirectory + "/scripts/nel_ligo_export.ms"
tagList = findFiles(log, tagDirectory, "", ".max.tag")
tagLen = len(tagList)
if os.path.isfile(scriptDst): if os.path.isfile(scriptDst):
os.remove(scriptDst) os.remove(scriptDst)
tagDiff = 1
printLog(log, "WRITE " + scriptDst) printLog(log, "WRITE " + scriptDst)
sSrc = open(scriptSrc, "r") sSrc = open(scriptSrc, "r")
sDst = open(scriptDst, "w") sDst = open(scriptDst, "w")
for line in sSrc: for line in sSrc:
newline = line.replace("output_logfile", logFile) newline = line.replace("output_logfile", outputLogfile)
newline = newline.replace("output_directory_tag", outDirTag) newline = newline.replace("output_directory_tag", tagDirectory)
newline = newline.replace("bankFilename", smallBank) newline = newline.replace("bankFilename", smallBank)
sDst.write(newline) sDst.write(newline)
sSrc.close() sSrc.close()
sDst.close() sDst.close()
zeroRetryLimit = 3
while tagDiff > 0:
mrt = open(maxRunningTagFile, "w")
mrt.write("moe-moe-kyun")
mrt.close()
printLog(log, "MAXSCRIPT " + scriptDst) printLog(log, "MAXSCRIPT " + scriptDst)
subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-mip" ]) subprocess.call([ Max, "-U", "MAXScript", "nel_ligo_export.ms", "-q", "-mi", "-mip" ])
if os.path.exists(outputLogfile):
try:
lSrc = open(outputLogfile, "r")
for line in lSrc:
lineStrip = line.strip()
if (len(lineStrip) > 0):
printLog(log, lineStrip)
lSrc.close()
os.remove(outputLogfile)
except Exception:
printLog(log, "ERROR Failed to read 3dsmax log")
else:
printLog(log, "WARNING No 3dsmax log")
tagList = findFiles(log, tagDirectory, "", ".max.tag")
newTagLen = len(tagList)
tagDiff = newTagLen - tagLen
tagLen = newTagLen
addTagDiff = 0
if os.path.exists(maxRunningTagFile):
printLog(log, "FAIL 3ds Max crashed and/or file export failed!")
if tagDiff == 0:
if zeroRetryLimit > 0:
zeroRetryLimit = zeroRetryLimit - 1
addTagDiff = 1
else:
printLog(log, "FAIL Retry limit reached!")
else:
addTagDiff = 1
os.remove(maxRunningTagFile)
printLog(log, "Exported " + str(tagDiff) + " .max files!")
tagDiff += addTagDiff
os.remove(scriptDst) os.remove(scriptDst)
printLog(log, "") printLog(log, "")

@ -16,6 +16,7 @@ TransitionNumBis = #( 5, 4, 2, 3, 7, 6, 0, 1, 8)
NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group NEL3D_APPDATA_IGNAME = 1423062564 -- string : name of the Instance Group
tagThisFile = true tagThisFile = true
removeRunningTag = true
-- Unhide layers -- Unhide layers
fn unhidelayers = fn unhidelayers =
@ -599,6 +600,7 @@ try
if tagFile == undefined then if tagFile == undefined then
( (
nlerror ("WARNING can't create tag file "+tag) nlerror ("WARNING can't create tag file "+tag)
removeRunningTag = false
) )
else else
( (
@ -606,6 +608,10 @@ try
close tagFile close tagFile
) )
) )
else
(
removeRunningTag = false
)
resetMAXFile #noprompt resetMAXFile #noprompt
gc () gc ()
@ -832,6 +838,7 @@ try
if tagFile == undefined then if tagFile == undefined then
( (
nlerror ("WARNING can't create tag file "+tag) nlerror ("WARNING can't create tag file "+tag)
removeRunningTag = false
) )
else else
( (
@ -839,6 +846,10 @@ try
close tagFile close tagFile
) )
) )
else
(
removeRunningTag = false
)
) )
resetMAXFile #noprompt resetMAXFile #noprompt
@ -956,6 +967,7 @@ try
if tagFile == undefined then if tagFile == undefined then
( (
nlerror ("WARNING can't create tag file "+tag) nlerror ("WARNING can't create tag file "+tag)
removeRunningTag = false
) )
else else
( (
@ -963,6 +975,10 @@ try
close tagFile close tagFile
) )
) )
else
(
removeRunningTag = false
)
resetMAXFile #noprompt resetMAXFile #noprompt
gc () gc ()
@ -979,12 +995,37 @@ catch
( (
-- Error -- Error
nlerror("ERROR fatal error exporting ligo zone in folder"+ligo_root_path) nlerror("ERROR fatal error exporting ligo zone in folder"+ligo_root_path)
nlerror("FAIL Fatal error occurred")
NelForceQuitRightNow()
removeRunningTag = false
tagThisFile = false tagThisFile = false
) )
try
(
if (removeRunningTag) then
(
resetMAXFile #noPrompt
)
)
catch
(
nlerror("FAIL Last reset fails")
removeRunningTag = false
)
if (removeRunningTag) then
(
nlerror("SUCCESS All .max files have been successfully exported")
deleteFile("%TagDirectory%/max_running.tag")
)
else
(
nlerror("FAIL One or more issues occurred")
NelForceQuitRightNow()
)
resetMAXFile #noprompt nlerror("BYE")
quitMAX #noPrompt quitMAX #noPrompt
quitMAX () #noPrompt quitMAX () #noPrompt

@ -359,6 +359,10 @@ SoundGameMusicVolume_min = 0.0;
SoundGameMusicVolume_max = 1.0; SoundGameMusicVolume_max = 1.0;
SoundGameMusicVolume_step = 0.001; SoundGameMusicVolume_step = 0.001;
// MP3 player
MediaPlayerDirectory = "music";
MediaPlayerAutoPlay = false;
// MISC // MISC
PreDataPath = { "user", "patch", "data", "examples" }; PreDataPath = { "user", "patch", "data", "examples" };
NeedComputeVS = 0; NeedComputeVS = 0;

@ -472,6 +472,10 @@ CClientConfig::CClientConfig()
ColorShout = CRGBA(150,0,0,255); // Default Shout color. ColorShout = CRGBA(150,0,0,255); // Default Shout color.
ColorTalk = CRGBA(255,255,255,255); // Default Talk color. ColorTalk = CRGBA(255,255,255,255); // Default Talk color.
// MP3 player
MediaPlayerDirectory = "music";
MediaPlayerAutoPlay = false;
// PreDataPath.push_back("data/gamedev/language/"); // Default Path for the language data // PreDataPath.push_back("data/gamedev/language/"); // Default Path for the language data
// DataPath.push_back("data/"); // Default Path for the Data. // DataPath.push_back("data/"); // Default Path for the Data.
@ -1247,6 +1251,10 @@ void CClientConfig::setValues()
// Max track // Max track
READ_INT_FV(MaxTrack) READ_INT_FV(MaxTrack)
// MP3 Player
READ_STRING_FV(MediaPlayerDirectory);
READ_BOOL_FV(MediaPlayerAutoPlay);
///////////////// /////////////////
// USER COLORS // // USER COLORS //
// Shout Color // Shout Color

@ -366,6 +366,10 @@ struct CClientConfig
/// The max number of track we want to use. /// The max number of track we want to use.
uint MaxTrack; uint MaxTrack;
// MP3 Player
string MediaPlayerDirectory;
bool MediaPlayerAutoPlay;
/// Pre Data Path. /// Pre Data Path.
std::vector<string> PreDataPath; std::vector<string> PreDataPath;
/// Data Path. /// Data Path.

@ -23,6 +23,7 @@
#include "../input.h" #include "../input.h"
#include "../sound_manager.h" #include "../sound_manager.h"
#include "interface_manager.h" #include "interface_manager.h"
#include "../client_cfg.h"
using namespace std; using namespace std;
using namespace NLMISC; using namespace NLMISC;
@ -43,8 +44,6 @@ extern UDriver *Driver;
#define MP3_SAVE_SHUFFLE "UI:SAVE:MP3_SHUFFLE" #define MP3_SAVE_SHUFFLE "UI:SAVE:MP3_SHUFFLE"
#define MP3_SAVE_REPEAT "UI:SAVE:MP3_REPEAT" #define MP3_SAVE_REPEAT "UI:SAVE:MP3_REPEAT"
static const std::string MediaPlayerDirectory("music/");
CMusicPlayer MusicPlayer; CMusicPlayer MusicPlayer;
// *************************************************************************** // ***************************************************************************
@ -396,7 +395,7 @@ public:
// Recursive scan for files from media directory // Recursive scan for files from media directory
vector<string> filesToProcess; vector<string> filesToProcess;
string newPath = CPath::standardizePath(MediaPlayerDirectory); string newPath = CPath::standardizePath(ClientCfg.MediaPlayerDirectory);
CPath::getPathContent (newPath, true, false, true, filesToProcess); CPath::getPathContent (newPath, true, false, true, filesToProcess);
uint i; uint i;

@ -1081,6 +1081,8 @@ bool mainLoop()
ProgressBar.finish(); ProgressBar.finish();
bool musicTriggerAutoPlay = true;
// Main loop. If the window is no more Active -> Exit. // Main loop. If the window is no more Active -> Exit.
while( !UserEntity->permanentDeath() while( !UserEntity->permanentDeath()
&& !game_exit ) && !game_exit )
@ -2418,6 +2420,17 @@ bool mainLoop()
// Update ingame duration and stat report sending // Update ingame duration and stat report sending
updateStatReport (); updateStatReport ();
// Auto play once on character login
if (musicTriggerAutoPlay)
{
musicTriggerAutoPlay = false;
if (ClientCfg.SoundOn && ClientCfg.MediaPlayerAutoPlay)
{
MusicPlayer.stop();
CAHManager::getInstance()->runActionHandler("music_player", NULL, "play_songs");
MusicPlayer.play();
}
}
// Update the music player // Update the music player
MusicPlayer.update (); MusicPlayer.update ();
@ -2453,6 +2466,9 @@ bool mainLoop()
// we have just completed init main loop, after reselecting character // we have just completed init main loop, after reselecting character
// repeat the steps before the main loop itself // repeat the steps before the main loop itself
// new char, retrigger music autoplay
musicTriggerAutoPlay = true;
// pre main loop in mainLoop // pre main loop in mainLoop
resetIngameTime (); resetIngameTime ();

Loading…
Cancel
Save