Changed: #878 Fix typos in comments/code

hg/feature/sound
kervala 15 years ago
parent 0af8991374
commit 9de1c9e027

@ -152,7 +152,7 @@ public:
* Speed is in O(1 * L*H) where L*H is the number of squares surrounded by the element * Speed is in O(1 * L*H) where L*H is the number of squares surrounded by the element
* *
* Warning! : bboxmin and bboxmax are multiplied by matrix setuped by changeBase. This work for any * Warning! : bboxmin and bboxmax are multiplied by matrix setuped by changeBase. This work for any
* matrix with 90deg rotations (min and max are recomputed internally), but not with any rotation (43° ...) * matrix with 90deg rotations (min and max are recomputed internally), but not with any rotation (43 degrees ...)
* because of the nature of AABBox. To do this correclty you should compute the bbox min and max in the * because of the nature of AABBox. To do this correclty you should compute the bbox min and max in the
* basis given in changeBase, and insert() with multiplying min and max with inverse of this basis. * basis given in changeBase, and insert() with multiplying min and max with inverse of this basis.
* eg: * eg:

@ -2676,7 +2676,7 @@ void CPSRadialEmitter::serial(NLMISC::IStream &f) throw(NLMISC::EStream)
void CPSRadialEmitter::emit(const NLMISC::CVector &srcPos, uint32 index, NLMISC::CVector &pos, NLMISC::CVector &speed) void CPSRadialEmitter::emit(const NLMISC::CVector &srcPos, uint32 index, NLMISC::CVector &pos, NLMISC::CVector &speed)
{ {
NL_PS_FUNC(CPSRadialEmitter_emit) NL_PS_FUNC(CPSRadialEmitter_emit)
// TODO : verifier que ca marche si une particule s'emet elle-mem // TODO : verify if it works when a particle emits itself
nlassert(_EmittedType); nlassert(_EmittedType);
static const double divRand = (2.0 / RAND_MAX); static const double divRand = (2.0 / RAND_MAX);

@ -952,10 +952,10 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight
_ProcessCount=MAX_CPU_PROCESS; _ProcessCount=MAX_CPU_PROCESS;
// Number of obstacle polygones // Number of obstacle polygones
printf ("Obstacle polygones : %zu\n", obstacles.size ()); nlinfo ("Obstacle polygones : %zu", obstacles.size ());
// Number of CPUS used // Number of CPUS used
printf ("Number of CPU used: %d\n", _ProcessCount); nlinfo ("Number of CPU used: %d", _ProcessCount);
// Zone pointer // Zone pointer
CZone *pZone=landscape.getZone (_ZoneToLight); CZone *pZone=landscape.getZone (_ZoneToLight);
@ -999,14 +999,14 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight
lightPos = description.SunCenter - (description.SunDirection * description.SunDistance) + lightPos; lightPos = description.SunCenter - (description.SunDirection * description.SunDistance) + lightPos;
InitZBuffer (zbuffer, lightPos, _RayBasis, zoneBB, description.ZBufferLandscapeSize, description); InitZBuffer (zbuffer, lightPos, _RayBasis, zoneBB, description.ZBufferLandscapeSize, description);
printf ("Zbuffer %d size : %d x %d\n", sampleX+sampleY*description.SoftShadowSamplesSqrt, zbuffer.LocalZBufferWidth, zbuffer.LocalZBufferHeight); nlinfo ("Zbuffer %d size : %d x %d", sampleX+sampleY*description.SoftShadowSamplesSqrt, zbuffer.LocalZBufferWidth, zbuffer.LocalZBufferHeight);
} }
// *** Init the zbuffer for the vegetation // *** Init the zbuffer for the vegetation
CVector lightPos = description.SunCenter - (description.SunDirection * description.SunDistance); CVector lightPos = description.SunCenter - (description.SunDirection * description.SunDistance);
InitZBuffer (_ZBufferObject, lightPos, _RayBasis, zoneBB, description.ZBufferObjectSize, description); InitZBuffer (_ZBufferObject, lightPos, _RayBasis, zoneBB, description.ZBufferObjectSize, description);
printf ("Zbuffer object size : %d x %d\n", _ZBufferObject.LocalZBufferWidth, _ZBufferObject.LocalZBufferHeight); nlinfo ("Zbuffer object size : %d x %d", _ZBufferObject.LocalZBufferWidth, _ZBufferObject.LocalZBufferHeight);
// Compute the zbuffer in multi thread // Compute the zbuffer in multi thread

@ -92,12 +92,12 @@ UAudioMixer *UAudioMixer::createAudioMixer()
CAudioMixerUser::CAudioMixerUser() : _AutoLoadSample(false), CAudioMixerUser::CAudioMixerUser() : _AutoLoadSample(false),
_UseADPCM(true), _UseADPCM(true),
_SoundDriver(NULL), _SoundDriver(NULL),
_SoundBank(NULL), _SoundBank(NULL),
_SampleBankManager(NULL), _SampleBankManager(NULL),
_BackgroundSoundManager(NULL), _BackgroundSoundManager(NULL),
_ClusteredSound(0), _ClusteredSound(0),
_ReverbEffect(NULL), _ReverbEffect(NULL),
_ListenPosition(CVector::Null), _ListenPosition(CVector::Null),
_BackgroundMusicManager(NULL), _BackgroundMusicManager(NULL),
_PlayingSources(0), _PlayingSources(0),
@ -136,7 +136,7 @@ CAudioMixerUser::~CAudioMixerUser()
reset(); reset();
_Leaving = true; _Leaving = true;
// Release all the SampleBanks // Release all the SampleBanks
delete _SampleBankManager; _SampleBankManager = NULL; delete _SampleBankManager; _SampleBankManager = NULL;
// Release the sound bank // Release the sound bank
@ -167,14 +167,14 @@ void CAudioMixerUser::initClusteredSound(NL3D::UScene *uscene, float minGain, fl
{ {
NL3D::CScene *scene = 0; NL3D::CScene *scene = 0;
if (uscene) scene = &(static_cast<NL3D::CSceneUser*>(uscene)->getScene()); if (uscene) scene = &(static_cast<NL3D::CSceneUser*>(uscene)->getScene());
initClusteredSound(scene, minGain, maxDistance, portalInterpolate); initClusteredSound(scene, minGain, maxDistance, portalInterpolate);
} }
void CAudioMixerUser::initClusteredSound(NL3D::CScene *scene, float minGain, float maxDistance, float portalInterpolate = 20.0f) void CAudioMixerUser::initClusteredSound(NL3D::CScene *scene, float minGain, float maxDistance, float portalInterpolate = 20.0f)
{ {
if (!_ClusteredSound) _ClusteredSound = new CClusteredSound(); if (!_ClusteredSound) _ClusteredSound = new CClusteredSound();
_ClusteredSound->init(scene, portalInterpolate, maxDistance, minGain); _ClusteredSound->init(scene, portalInterpolate, maxDistance, minGain);
} }
@ -359,7 +359,7 @@ void CAudioMixerUser::initDriver(const std::string &driverName)
else if (dn == "dsound") driverType = ISoundDriver::DriverDSound; else if (dn == "dsound") driverType = ISoundDriver::DriverDSound;
else if (dn == "openal") driverType = ISoundDriver::DriverOpenAl; else if (dn == "openal") driverType = ISoundDriver::DriverOpenAl;
else if (dn == "xaudio2") driverType = ISoundDriver::DriverXAudio2; else if (dn == "xaudio2") driverType = ISoundDriver::DriverXAudio2;
else else
{ {
driverType = ISoundDriver::DriverAuto; driverType = ISoundDriver::DriverAuto;
nlwarning("AM: driverName value '%s' ('%s') is invalid.", driverName.c_str(), dn.c_str()); nlwarning("AM: driverName value '%s' ('%s') is invalid.", driverName.c_str(), dn.c_str());
@ -383,7 +383,6 @@ void CAudioMixerUser::initDriver(const std::string &driverName)
delete _SoundDriver; _SoundDriver = NULL; delete _SoundDriver; _SoundDriver = NULL;
throw; throw;
} }
} }
/// Get the available devices on the loaded driver. /// Get the available devices on the loaded driver.
@ -422,7 +421,7 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo
try try
{ {
_profile(( "AM: DRIVER: %s", _SoundDriver->getDllName().c_str() )); _profile(( "AM: DRIVER: %s", _SoundDriver->getDllName().c_str() ));
// the options to init the driver // the options to init the driver
sint driverOptions = ISoundDriver::OptionHasBufferStreaming; sint driverOptions = ISoundDriver::OptionHasBufferStreaming;
if (_UseEax) driverOptions |= ISoundDriver::OptionEnvironmentEffects; if (_UseEax) driverOptions |= ISoundDriver::OptionEnvironmentEffects;
@ -430,10 +429,10 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo
if (forceSoftware) driverOptions |= ISoundDriver::OptionSoftwareBuffer; if (forceSoftware) driverOptions |= ISoundDriver::OptionSoftwareBuffer;
if (manualRolloff) driverOptions |= ISoundDriver::OptionManualRolloff; if (manualRolloff) driverOptions |= ISoundDriver::OptionManualRolloff;
if (_AutoLoadSample) driverOptions |= ISoundDriver::OptionLocalBufferCopy; if (_AutoLoadSample) driverOptions |= ISoundDriver::OptionLocalBufferCopy;
// init the driver with selected device and needed options // init the driver with selected device and needed options
_SoundDriver->initDevice(deviceName, (ISoundDriver::TSoundOptions)driverOptions); _SoundDriver->initDevice(deviceName, (ISoundDriver::TSoundOptions)driverOptions);
// verify the options, OptionHasBufferStreaming not checked // verify the options, OptionHasBufferStreaming not checked
if (_UseEax && !_SoundDriver->getOption(ISoundDriver::OptionEnvironmentEffects)) if (_UseEax && !_SoundDriver->getOption(ISoundDriver::OptionEnvironmentEffects))
{ {
@ -474,7 +473,7 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo
} }
uint i; uint i;
// Init registrable classes // Init registrable classes
static bool initialized = false; static bool initialized = false;
if (!initialized) if (!initialized)
@ -556,20 +555,16 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo
buildSampleBankList(); buildSampleBankList();
} }
// Init music channels // Init music channels
for (i = 0; i < _NbMusicChannelFaders; ++i) for (i = 0; i < _NbMusicChannelFaders; ++i)
_MusicChannelFaders[i].init(_SoundDriver); _MusicChannelFaders[i].init(_SoundDriver);
// Create the background sound manager. // Create the background sound manager.
_BackgroundSoundManager = new CBackgroundSoundManager(); _BackgroundSoundManager = new CBackgroundSoundManager();
// Create the background music manager // Create the background music manager
_BackgroundMusicManager = new CMusicSoundManager(); _BackgroundMusicManager = new CMusicSoundManager();
// Load the sound bank // Load the sound bank
CSoundBank *soundBank = new CSoundBank(); CSoundBank *soundBank = new CSoundBank();
_SoundBank = soundBank; _SoundBank = soundBank;
@ -599,7 +594,6 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo
NLGEORGES::UFormElm &root = form->getRootNode(); NLGEORGES::UFormElm &root = form->getRootNode();
// read track reserve // read track reserve
uint32 highestRes, highRes, midRes, lowRes; uint32 highestRes, highRes, midRes, lowRes;
root.getValueByName(highestRes, ".HighestPriorityReserve"); root.getValueByName(highestRes, ".HighestPriorityReserve");
@ -694,7 +688,7 @@ void CAudioMixerUser::initDevice(const std::string &deviceName, const CInitInfo
/// Build a sample bank from a directory containing .wav files, and return the path to the written file. /// Build a sample bank from a directory containing .wav files, and return the path to the written file.
std::string UAudioMixer::buildSampleBank(const std::string &wavDir, const std::string &bankDir, const std::string &bankName) std::string UAudioMixer::buildSampleBank(const std::string &wavDir, const std::string &bankDir, const std::string &bankName)
{ {
vector<string> sampleList; vector<string> sampleList;
CPath::getPathContent(wavDir, false, false, true, sampleList); CPath::getPathContent(wavDir, false, false, true, sampleList);
// remove any non wav file // remove any non wav file
@ -707,7 +701,7 @@ std::string UAudioMixer::buildSampleBank(const std::string &wavDir, const std::s
} }
} }
sort(sampleList.begin(), sampleList.end()); sort(sampleList.begin(), sampleList.end());
return buildSampleBank(sampleList, bankDir, bankName); return buildSampleBank(sampleList, bankDir, bankName);
} }
@ -723,46 +717,46 @@ std::string UAudioMixer::buildSampleBank(const std::vector<std::string> &sampleL
for (uint j = 0; j < sampleList.size(); ++j) for (uint j = 0; j < sampleList.size(); ++j)
{ {
nldebug(" Adding sample [%s] into bank", CFile::getFilename(sampleList[j]).c_str()); nldebug(" Adding sample [%s] into bank", CFile::getFilename(sampleList[j]).c_str());
CIFile sample(sampleList[j]); CIFile sample(sampleList[j]);
uint size = sample.getFileSize(); uint size = sample.getFileSize();
std::vector<uint8> buffer; std::vector<uint8> buffer;
buffer.resize(size); buffer.resize(size);
sample.serialBuffer(&buffer[0], sample.getFileSize()); sample.serialBuffer(&buffer[0], sample.getFileSize());
std::vector<uint8> result; std::vector<uint8> result;
IBuffer::TBufferFormat bufferFormat; IBuffer::TBufferFormat bufferFormat;
uint8 channels; uint8 channels;
uint8 bitsPerSample; uint8 bitsPerSample;
uint32 frequency; uint32 frequency;
if (!IBuffer::readWav(&buffer[0], size, result, bufferFormat, channels, bitsPerSample, frequency)) if (!IBuffer::readWav(&buffer[0], size, result, bufferFormat, channels, bitsPerSample, frequency))
{ {
nlwarning(" IBuffer::readWav returned false"); nlwarning(" IBuffer::readWav returned false");
continue; continue;
} }
vector<sint16> mono16Data; vector<sint16> mono16Data;
if (!IBuffer::convertToMono16PCM(&result[0], (uint)result.size(), mono16Data, bufferFormat, channels, bitsPerSample)) if (!IBuffer::convertToMono16PCM(&result[0], (uint)result.size(), mono16Data, bufferFormat, channels, bitsPerSample))
{ {
nlwarning(" IBuffer::convertToMono16PCM returned false"); nlwarning(" IBuffer::convertToMono16PCM returned false");
continue; continue;
} }
vector<uint8> adpcmData; vector<uint8> adpcmData;
if (!IBuffer::convertMono16PCMToMonoADPCM(&mono16Data[0], (uint)mono16Data.size(), adpcmData)) if (!IBuffer::convertMono16PCMToMonoADPCM(&mono16Data[0], (uint)mono16Data.size(), adpcmData))
{ {
nlwarning(" IBuffer::convertMono16PCMToMonoADPCM returned false"); nlwarning(" IBuffer::convertMono16PCMToMonoADPCM returned false");
continue; continue;
} }
// Sample number MUST be even // Sample number MUST be even
nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe)); nlassert(mono16Data.size() == (mono16Data.size() & 0xfffffffe));
nlassert(adpcmData.size() == mono16Data.size() / 2); nlassert(adpcmData.size() == mono16Data.size() / 2);
adpcmBuffers[j].swap(adpcmData); adpcmBuffers[j].swap(adpcmData);
mono16Buffers[j].swap(mono16Data); mono16Buffers[j].swap(mono16Data);
hdr.addSample(CFile::getFilename(sampleList[j]), frequency, (uint32)mono16Data.size(), (uint32)mono16Buffers[j].size() * 2, (uint32)adpcmBuffers[j].size()); hdr.addSample(CFile::getFilename(sampleList[j]), frequency, (uint32)mono16Data.size(), (uint32)mono16Buffers[j].size() * 2, (uint32)adpcmBuffers[j].size());
} }
@ -1340,7 +1334,7 @@ void CAudioMixerUser::reloadSampleBanks(bool async)
// { // {
// CTrack *free_track = _FreeTracks.back(); // CTrack *free_track = _FreeTracks.back();
// _FreeTracks.pop_back(); // _FreeTracks.pop_back();
// nlassert(!free_track->getLogicalSource()); // nlassert(!free_track->getLogicalSource());
// ++_ReserveUsage[HighestPri]; // ++_ReserveUsage[HighestPri];
// if (_UseEax) free_track->getPhysicalSource()->setEffect(NULL); // no reverb! // if (_UseEax) free_track->getPhysicalSource()->setEffect(NULL); // no reverb!
// return free_track; // return free_track;
@ -1396,7 +1390,7 @@ CTrack *CAudioMixerUser::getFreeTrack(CSourceCommon *source)
{ {
float srcMinDist = source->getSound()->getMinDistance(); float srcMinDist = source->getSound()->getMinDistance();
float srcMaxDist = source->getSound()->getMaxDistance(); float srcMaxDist = source->getSound()->getMaxDistance();
float d1, d2, t1, t2; float d1, d2, t1, t2;
d1 = source->getSourceRelativeMode() ? source->getPos().norm() : (source->getPos() - _ListenPosition).norm(); d1 = source->getSourceRelativeMode() ? source->getPos().norm() : (source->getPos() - _ListenPosition).norm();
t1 = max(0.0f, 1.0f - ((d1 - srcMinDist) / (srcMaxDist - srcMinDist))); t1 = max(0.0f, 1.0f - ((d1 - srcMinDist) / (srcMaxDist - srcMinDist)));
@ -1408,10 +1402,10 @@ CTrack *CAudioMixerUser::getFreeTrack(CSourceCommon *source)
{ {
float src2MinDist = src2->getSound()->getMinDistance(); float src2MinDist = src2->getSound()->getMinDistance();
float src2MaxDist = src2->getSound()->getMaxDistance(); float src2MaxDist = src2->getSound()->getMaxDistance();
d2 = src2->getSourceRelativeMode() ? src2->getPos().norm() : (src2->getPos() - _ListenPosition).norm(); d2 = src2->getSourceRelativeMode() ? src2->getPos().norm() : (src2->getPos() - _ListenPosition).norm();
t2 = max(0.0f, 1.0f - ((d2 - src2MinDist) / (src2MaxDist - src2MinDist))); t2 = max(0.0f, 1.0f - ((d2 - src2MinDist) / (src2MaxDist - src2MinDist)));
const float tfactor = 1.3f; const float tfactor = 1.3f;
if (t1 > t2 * tfactor) if (t1 > t2 * tfactor)
// if (d1 < d2) // if (d1 < d2)
@ -1485,8 +1479,8 @@ void CAudioMixerUser::getPlayingSoundsPos(bool virtualPos, std::vector<std::pair
if (virtualPos) if (virtualPos)
pos.push_back(make_pair(source->getTrack() == 0, source->getVirtualPos())); pos.push_back(make_pair(source->getTrack() == 0, source->getVirtualPos()));
else else
pos.push_back(make_pair(source->getTrack() == 0, pos.push_back(make_pair(source->getTrack() == 0,
source->getSourceRelativeMode() source->getSourceRelativeMode()
? source->getPos() + _ListenPosition ? source->getPos() + _ListenPosition
: source->getPos())); : source->getPos()));
@ -1509,8 +1503,8 @@ void CAudioMixerUser::getPlayingSoundsPos(bool virtualPos, std::vector<std::pair
if (virtualPos) if (virtualPos)
pos.push_back(make_pair(source->getTrack() == 0, source->getVirtualPos())); pos.push_back(make_pair(source->getTrack() == 0, source->getVirtualPos()));
else else
pos.push_back(make_pair(source->getTrack() == 0, pos.push_back(make_pair(source->getTrack() == 0,
source->getSourceRelativeMode() source->getSourceRelativeMode()
? source->getPos() + _ListenPosition ? source->getPos() + _ListenPosition
: source->getPos())); : source->getPos()));
@ -1904,7 +1898,7 @@ retrySound:
} }
switch (id->getSoundType()) switch (id->getSoundType())
{ {
case CSound::SOUND_SIMPLE: case CSound::SOUND_SIMPLE:
{ {
CSimpleSound *simpleSound = static_cast<CSimpleSound *>(id); CSimpleSound *simpleSound = static_cast<CSimpleSound *>(id);
@ -2473,11 +2467,11 @@ void CAudioMixerUser::changeMaxTrack(uint maxTrack)
uint max_track_old = maxTrack; uint max_track_old = maxTrack;
maxTrack = min(maxTrack, _SoundDriver->countMaxSources()); maxTrack = min(maxTrack, _SoundDriver->countMaxSources());
if (maxTrack != max_track_old) nlwarning("AM: MaxTrack limited from %u to %u", (uint32)max_track_old, (uint32)maxTrack); if (maxTrack != max_track_old) nlwarning("AM: MaxTrack limited from %u to %u", (uint32)max_track_old, (uint32)maxTrack);
// if same, no op // if same, no op
if (maxTrack == _Tracks.size()) if (maxTrack == _Tracks.size())
return; return;
uint prev_track_nb = (uint)_Tracks.size(); uint prev_track_nb = (uint)_Tracks.size();
// **** if try to add new tracks, easy // **** if try to add new tracks, easy
if (maxTrack > prev_track_nb) if (maxTrack > prev_track_nb)
@ -2709,11 +2703,11 @@ void CAudioMixerUser::getMusicExtensions(std::vector<std::string> &extensions)
/// Add a reverb environment /// Add a reverb environment
void CAudioMixerUser::addEnvironment(const std::string &environmentName, const IReverbEffect::CEnvironment &environment) void CAudioMixerUser::addEnvironment(const std::string &environmentName, const IReverbEffect::CEnvironment &environment)
{ {
if (_ReverbEffect) if (_ReverbEffect)
{ {
TStringId environment_name = CStringMapper::map(environmentName); TStringId environment_name = CStringMapper::map(environmentName);
if (_Environments.find(environment_name) != _Environments.end()) if (_Environments.find(environment_name) != _Environments.end())
nlwarning("Reverb environment %s already exists, replacing with new one", CStringMapper::unmap(environment_name).c_str()); nlwarning("Reverb environment %s already exists, replacing with new one", CStringMapper::unmap(environment_name).c_str());
_Environments[environment_name] = environment; _Environments[environment_name] = environment;
@ -2723,7 +2717,7 @@ void CAudioMixerUser::addEnvironment(const std::string &environmentName, const I
/// Set the current reverb environment /// Set the current reverb environment
void CAudioMixerUser::setEnvironment(NLMISC::TStringId environmentName, float roomSize) void CAudioMixerUser::setEnvironment(NLMISC::TStringId environmentName, float roomSize)
{ {
if (_ReverbEffect) if (_ReverbEffect)
{ {
_ReverbEffect->setEnvironment(getEnvironment(environmentName), roomSize); _ReverbEffect->setEnvironment(getEnvironment(environmentName), roomSize);
} }

@ -223,12 +223,12 @@ void IBuffer::encodeADPCM(const sint16 *indata, uint8 *outdata, uint nbSample, T
/* Step 4 - Clamp previous value to 16 bits */ /* Step 4 - Clamp previous value to 16 bits */
if ( valpred > 32767 ) if ( valpred > 32767 )
{ {
printf("over+ %d\n",valpred); nlwarning("over+ %d",valpred);
valpred = 32767; valpred = 32767;
} }
else if ( valpred < -32768 ) else if ( valpred < -32768 )
{ {
printf("over- %d\n",valpred); nlwarning("over- %d",valpred);
valpred = -32768; valpred = -32768;
} }

@ -486,7 +486,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader()
uint tryCounter = 1; uint tryCounter = 1;
for (;;) for (;;)
{ {
nlwarning("Launching downloader: try n°%d", (int) tryCounter++); nlwarning("Launching downloader: try number %d", (int) tryCounter++);
// now we can create the message queue because we are sure that it will reach the good app // now we can create the message queue because we are sure that it will reach the good app
Parent->_DownloaderMsgQueue.init(HInstance, BGDownloader::ClientWndID, BGDownloader::DownloaderWndID); Parent->_DownloaderMsgQueue.init(HInstance, BGDownloader::ClientWndID, BGDownloader::DownloaderWndID);
sleep(200); sleep(200);

@ -7197,7 +7197,7 @@ ADD_METHOD(void CCharacterCL::updateDisplay(CEntityCL *parent))
AnimMatrixRot.identity(); AnimMatrixRot.identity();
AnimMatrixRot.setRot(currentAnimRot); AnimMatrixRot.setRot(currentAnimRot);
// Rotation 180° Matrix // Rotation 180 degrees Matrix
CMatrix rot180; CMatrix rot180;
rot180.identity(); rot180.identity();
if(parent == 0) if(parent == 0)
@ -7273,7 +7273,7 @@ ADD_METHOD(void CCharacterCL::updateDisplay(CEntityCL *parent))
{ {
H_AUTO ( RZ_Client_Entity_CL_Update_Display_Unknown_Anim ) H_AUTO ( RZ_Client_Entity_CL_Update_Display_Unknown_Anim )
// Rotation 90° Matrix // Rotation 90 degrees Matrix
CMatrix rot90; CMatrix rot90;
rot90.identity(); rot90.identity();
if(parent == 0) if(parent == 0)

@ -3500,6 +3500,7 @@ void CEntityCL::setStateFx(const std::string &fxName)
} }
NL3D::UInstance instance = Scene->createInstance(fxName); NL3D::UInstance instance = Scene->createInstance(fxName);
if (!instance.empty()) if (!instance.empty())
{ {
_StateFX.cast (instance); _StateFX.cast (instance);

@ -202,7 +202,7 @@ public:
/* /*
* drawBitmap : draw a bitmap roted by 90° in CW 'rot times' * drawBitmap : draw a bitmap roted by 90 degrees in CW 'rot times'
* flipv is a boolean that indicates if there is a vertical flip * flipv is a boolean that indicates if there is a vertical flip
* this is a 1:1 ratio so if texture is x long there are x pixels on screen * this is a 1:1 ratio so if texture is x long there are x pixels on screen
*/ */

@ -1093,7 +1093,7 @@ void CViewText::updateTextContextMultiLineJustified(uint nMaxWidth, bool expandS
else // it is the only word on the line.. else // it is the only word on the line..
{ {
// .. so split it // .. so split it
// 1 °) Check if spaces go beyond the end of line // 1) Check if spaces go beyond the end of line
if (numSpaces * _SpaceWidth > nMaxWidth) if (numSpaces * _SpaceWidth > nMaxWidth)
{ {
uint maxNumSpaces = std::max(1U, (uint) (nMaxWidth / _SpaceWidth)); uint maxNumSpaces = std::max(1U, (uint) (nMaxWidth / _SpaceWidth));

@ -3978,11 +3978,11 @@ void updateClouds()
if (InitCloudScape) if (InitCloudScape)
{ {
InitCloudScape = false; InitCloudScape = false;
// 1 ° ) set current state // 1 ) set current state
CCloudState cs; CCloudState cs;
WeatherManager.computeCloudState(RT.getRyzomDay(), DayNightCycleHour, wc, cs); WeatherManager.computeCloudState(RT.getRyzomDay(), DayNightCycleHour, wc, cs);
updateCloudScape(cs, wc, WeatherManager.getCurrWeatherState().WindIntensity, LightCycleManager.getLightLevel(), 0.f, true); updateCloudScape(cs, wc, WeatherManager.getCurrWeatherState().WindIntensity, LightCycleManager.getLightLevel(), 0.f, true);
// 2 ° )set next state // 2 )set next state
// compute date of next update // compute date of next update
const CLightCycleDesc &lcd = LightCycleManager.getLightDesc(); const CLightCycleDesc &lcd = LightCycleManager.getLightDesc();
float updateDelay = 0.f; float updateDelay = 0.f;
@ -4404,7 +4404,7 @@ NLMISC_DYNVARIABLE(float, FPS, "The second smoothed frame rate per second")
if (get) *pointer = 1.0f/smoothFPS.getSmoothValue (); if (get) *pointer = 1.0f/smoothFPS.getSmoothValue ();
} }
// show hide all the debuginf of ui // show hide all the debuging of ui
NLMISC_COMMAND(debugUI, "Debug the ui : show/hide quads of bboxs and hotspots", "debugUI 1 or 0") NLMISC_COMMAND(debugUI, "Debug the ui : show/hide quads of bboxs and hotspots", "debugUI 1 or 0")
{ {
if (args.size() > 1) return false; if (args.size() > 1) return false;
@ -4428,28 +4428,28 @@ NLMISC_COMMAND(debugUI, "Debug the ui : show/hide quads of bboxs and hotspots",
} }
// show hide the debuginf of ui // show hide the debuging of ui
NLMISC_COMMAND(debugUIView, "Debug the ui : show/hide quads of bboxs and hotspots for views", "") NLMISC_COMMAND(debugUIView, "Debug the ui : show/hide quads of bboxs and hotspots for views", "")
{ {
DebugUIView = !DebugUIView; DebugUIView = !DebugUIView;
return true; return true;
} }
// show hide the debuginf of ui // show hide the debuging of ui
NLMISC_COMMAND(debugUICtrl, "Debug the ui : show/hide quads of bboxs and hotspots for ctrl", "") NLMISC_COMMAND(debugUICtrl, "Debug the ui : show/hide quads of bboxs and hotspots for ctrl", "")
{ {
DebugUICtrl = !DebugUICtrl; DebugUICtrl = !DebugUICtrl;
return true; return true;
} }
// show hide the debuginf of ui // show hide the debuging of ui
NLMISC_COMMAND(debugUIGroup, "Debug the ui : show/hide quads of bboxs and hotspots for group", "") NLMISC_COMMAND(debugUIGroup, "Debug the ui : show/hide quads of bboxs and hotspots for group", "")
{ {
DebugUIGroup = !DebugUIGroup; DebugUIGroup = !DebugUIGroup;
return true; return true;
} }
// show hide the debuginf of cells // show hide the debuging of cells
NLMISC_COMMAND(debugUICell, "Debug the ui : show/hide quads of bboxs for cells", "") NLMISC_COMMAND(debugUICell, "Debug the ui : show/hide quads of bboxs for cells", "")
{ {
DebugUICell = !DebugUICell; DebugUICell = !DebugUICell;
@ -4588,4 +4588,4 @@ void inGamePatchUncompleteWarning()
im->messageBoxWithHelp(CI18N::get("uiBGD_InGamePatchIncomplete")); im->messageBoxWithHelp(CI18N::get("uiBGD_InGamePatchIncomplete"));
im->displaySystemInfo(CI18N::get("uiBGD_InGamePatchIncompleteBC"), "BC"); im->displaySystemInfo(CI18N::get("uiBGD_InGamePatchIncompleteBC"), "BC");
*/ */
} }

@ -76,7 +76,7 @@ class CDisplayerVisualEntity;
* *
* No tool is displayed as "highlighted" * No tool is displayed as "highlighted"
* *
* 1°) Mouse in 3D view * 1) Mouse in 3D view
* -------------------- * --------------------
* The mouse cursor has a little star to indicate "creation mode". * The mouse cursor has a little star to indicate "creation mode".
* If creation is not possible at the mouse position, then there's is a little 'stop' icon shown * If creation is not possible at the mouse position, then there's is a little 'stop' icon shown
@ -89,7 +89,7 @@ class CDisplayerVisualEntity;
* *
* NB : we don't do creation on LDOWN or RUP in order to allow camera manipulation * NB : we don't do creation on LDOWN or RUP in order to allow camera manipulation
* *
* 2°) Mouse over UI * 2) Mouse over UI
* ----------------- * -----------------
* The mouse cursor still has a little star to indicate "creation mode". * The mouse cursor still has a little star to indicate "creation mode".
* Ideally on some actions, the creation is canceled, and the default tool is backuped; * Ideally on some actions, the creation is canceled, and the default tool is backuped;
@ -120,7 +120,7 @@ class CDisplayerVisualEntity;
* - Rotate * - Rotate
* ... * ...
* *
* 1°) Mouse in 3D view * 1) Mouse in 3D view
* -------------------- * --------------------
* a ) Mouse over empty space in scene * a ) Mouse over empty space in scene
* ----------------------------------- * -----------------------------------
@ -168,7 +168,7 @@ class CDisplayerVisualEntity;
* This would requires using something like the middle button or some shift / control combination * This would requires using something like the middle button or some shift / control combination
* to avoid conflict with the previous events ... * to avoid conflict with the previous events ...
* *
* 2°) Mouse over UI * 2) Mouse over UI
* ----------------- * -----------------
* The mouse is dipslayed as usual * The mouse is dipslayed as usual
* Events are taken in account by the UI, not by the tool * Events are taken in account by the UI, not by the tool

Loading…
Cancel
Save