Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 336 vs 337 for /trunk/Source Code/Environment/Vegetation/Vegetation.cpp

Diff revisions: vs.
  @@ -36,8 +36,8 @@
36 36 _stateRefreshIntervalBuffer(0ULL),
37 37 _stateRefreshInterval(getSecToUs(1)) ///<Every second?
38 38 {
39 - _threadedLoadComplete = false;
40 - _stopLoadingRequest = false;
39 + _threadedLoadComplete = false;
40 + _stopLoadingRequest = false;
41 41 _readBuffer = 1;
42 42 _writeBuffer = 0;
43 43
  @@ -64,14 +64,14 @@
64 64 PRINT_FN(Locale::get("UNLOAD_VEGETATION_BEGIN"), getName().c_str());
65 65 _stopLoadingRequest = true;
66 66 U32 timer = 0;
67 - while (!_threadedLoadComplete){
68 - // wait for the loading thread to finish first;
69 - std::this_thread::sleep_for(std::chrono::milliseconds(10));
70 - timer += 10;
71 - if (timer > 3000) {
72 - break;
73 - }
74 - }
67 + while (!_threadedLoadComplete){
68 + // wait for the loading thread to finish first;
69 + std::this_thread::sleep_for(std::chrono::milliseconds(10));
70 + timer += 10;
71 + if (timer > 3000) {
72 + break;
73 + }
74 + }
75 75 assert(_threadedLoadComplete);
76 76 _grassPositions.clear();
77 77 RemoveResource(_cullShader);
  @@ -124,7 +124,7 @@
124 124 1,
125 125 DELEGATE_BIND(&Vegetation::generateGrass, this),
126 126 DELEGATE_BIND(&Vegetation::uploadGrassData, this)));
127 - _generateVegetation->startTask();
127 + _generateVegetation->startTask();
128 128 setState(RES_LOADED);
129 129 }
130 130
  @@ -147,7 +147,7 @@
147 147 void Vegetation::uploadGrassData(){
148 148 if (_grassPositions.empty()){
149 149 _threadedLoadComplete = true;
150 - return;
150 + return;
151 151 }
152 152
153 153 static const vec2<F32> pos000(cosf(RADIANS(0.000f)), sinf(RADIANS(0.000f)));
  @@ -415,9 +415,9 @@
415 415 densityFactor += 0.1f;
416 416 for (F32 width = 0; width < chunkSize.x - densityFactor; width += densityFactor){
417 417 for (F32 height = 0; height < chunkSize.y - densityFactor; height += densityFactor){
418 - if (_stopLoadingRequest) {
419 - continue;
420 - }
418 + if (_stopLoadingRequest) {
419 + continue;
420 + }
421 421 F32 x = width + random(densityFactor) + chunkPos.x;
422 422 F32 y = height + random(densityFactor) + chunkPos.y;
423 423 CLAMP<F32>(x, 0.0f, (F32)mapWidth - 1.0f);
  @@ -426,17 +426,17 @@
426 426 F32 y_fac = y / _map.dimensions().height;
427 427
428 428 I32 map_color = _map.getColor((U16)x, (U16)y)[index];
429 - if (map_color < 150) {
430 - continue;
431 - }
429 + if (map_color < 150) {
430 + continue;
431 + }
432 432 const vec3<F32>& P = _terrain->getPosition(x_fac, y_fac);
433 - if (P.y < waterLevel) {
434 - continue;
435 - }
433 + if (P.y < waterLevel) {
434 + continue;
435 + }
436 436 const vec3<F32>& N = _terrain->getNormal(x_fac, y_fac);
437 - if (N.y < 0.7f) {
438 - continue;
439 - }
437 + if (N.y < 0.7f) {
438 + continue;
439 + }
440 440 #pragma omp critical
441 441 {
442 442 /*position.set(P);