Changed: #878 Fix typos in comments/code

This commit is contained in:
kervala 2010-06-24 15:00:31 +02:00
parent 7e1f6dc293
commit 3e9f7eed4b
12 changed files with 62 additions and 67 deletions

View file

@ -152,7 +152,7 @@ public:
* 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
* 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
* basis given in changeBase, and insert() with multiplying min and max with inverse of this basis.
* eg:

View file

@ -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)
{
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);
static const double divRand = (2.0 / RAND_MAX);

View file

@ -952,10 +952,10 @@ void CZoneLighter::light (CLandscape &landscape, CZone& output, uint zoneToLight
_ProcessCount=MAX_CPU_PROCESS;
// Number of obstacle polygones
printf ("Obstacle polygones : %zu\n", obstacles.size ());
nlinfo ("Obstacle polygones : %zu", obstacles.size ());
// Number of CPUS used
printf ("Number of CPU used: %d\n", _ProcessCount);
nlinfo ("Number of CPU used: %d", _ProcessCount);
// Zone pointer
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;
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
CVector lightPos = description.SunCenter - (description.SunDirection * description.SunDistance);
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

View file

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

View file

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

View file

@ -486,7 +486,7 @@ void CBGDownloaderAccess::CDownloadCoTask::restartDownloader()
uint tryCounter = 1;
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
Parent->_DownloaderMsgQueue.init(HInstance, BGDownloader::ClientWndID, BGDownloader::DownloaderWndID);
sleep(200);

View file

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

View file

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

View file

@ -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
* this is a 1:1 ratio so if texture is x long there are x pixels on screen
*/

View file

@ -1093,7 +1093,7 @@ void CViewText::updateTextContextMultiLineJustified(uint nMaxWidth, bool expandS
else // it is the only word on the line..
{
// .. 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)
{
uint maxNumSpaces = std::max(1U, (uint) (nMaxWidth / _SpaceWidth));

View file

@ -3978,11 +3978,11 @@ void updateClouds()
if (InitCloudScape)
{
InitCloudScape = false;
// 1 ° ) set current state
// 1 ) set current state
CCloudState cs;
WeatherManager.computeCloudState(RT.getRyzomDay(), DayNightCycleHour, wc, cs);
updateCloudScape(cs, wc, WeatherManager.getCurrWeatherState().WindIntensity, LightCycleManager.getLightLevel(), 0.f, true);
// 2 ° )set next state
// 2 )set next state
// compute date of next update
const CLightCycleDesc &lcd = LightCycleManager.getLightDesc();
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 ();
}
// 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")
{
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", "")
{
DebugUIView = !DebugUIView;
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", "")
{
DebugUICtrl = !DebugUICtrl;
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", "")
{
DebugUIGroup = !DebugUIGroup;
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", "")
{
DebugUICell = !DebugUICell;
@ -4588,4 +4588,4 @@ void inGamePatchUncompleteWarning()
im->messageBoxWithHelp(CI18N::get("uiBGD_InGamePatchIncomplete"));
im->displaySystemInfo(CI18N::get("uiBGD_InGamePatchIncompleteBC"), "BC");
*/
}
}

View file

@ -76,7 +76,7 @@ class CDisplayerVisualEntity;
*
* 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".
* 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
*
* 2°) Mouse over UI
* 2) Mouse over UI
* -----------------
* 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;
@ -120,7 +120,7 @@ class CDisplayerVisualEntity;
* - Rotate
* ...
*
* 1°) Mouse in 3D view
* 1) Mouse in 3D view
* --------------------
* 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
* to avoid conflict with the previous events ...
*
* 2°) Mouse over UI
* 2) Mouse over UI
* -----------------
* The mouse is dipslayed as usual
* Events are taken in account by the UI, not by the tool