Subversion Repository Public Repository

Divide-Framework

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

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include "Headers/WaypointGraph.h"

#include "Core/Headers/Console.h"
#include "Utility/Headers/Localization.h"

namespace Divide {
namespace Navigation {
WaypointGraph::WaypointGraph() {
    _id = 0xFFFFFFFF;
    _loop = true;
}

WaypointGraph::~WaypointGraph() { _waypoints.clear(); }

void WaypointGraph::addWaypoint(Waypoint* wp) {
    if (_waypoints.find(wp->getID()) != std::end(_waypoints)) return;
    hashAlg::emplace(_waypoints, wp->getID(), wp);
    updateGraph();
}

void WaypointGraph::removeWaypoint(Waypoint* wp) {
    if (_waypoints.find(wp->getID()) != std::end(_waypoints)) {
        _waypoints.erase(wp->getID());
        updateGraph();
    } else {
        Console::printfn(Locale::get("WARN_WAYPOINT_NOT_FOUND"), wp->getID(),
                         getID());
    }
}

void WaypointGraph::updateGraph() {
    typedef hashMapImpl<U32, Waypoint*> wp;
    _positions.clear();
    _rotations.clear();
    _times.clear();
    for (wp::value_type& waypoint : _waypoints) {
        _positions.push_back((waypoint.second)->_position);
        _rotations.push_back((waypoint.second)->_orientation);
        _times.push_back((waypoint.second)->_time);
    }
}
};
};

Commits for Divide-Framework/trunk/Source Code/AI/PathFinding/Waypoints/WaypointGraph.cpp

Diff revisions: vs.
Revision Author Commited Message
350 Diff Diff IonutCava picture IonutCava Tue 10 Feb, 2015 16:25:39 +0000

[Ionut]
- Simplified some Util-namespace level functions by using STL algorithms where possible
- Formatted the entire codebase using clang-format with the following style: "{BasedOnStyle: Google, IndentWidth: 4}"
- Attempted to make ProfileTimer thread-safe (temp fix until std::chrono works properly in Visual Studio)

347 Diff Diff IonutCava picture IonutCava Thu 05 Feb, 2015 13:39:09 +0000

[Ionut]
- Changed all begin/end calls on containers to non-member versions
- Replaced all useless “auto” keywords from code. (“auto” only makes sense for return values for delegate functions)
- Replaced useless code in Util::Mat4::Multiply with something that makes sense

343 Diff Diff IonutCava picture IonutCava Thu 15 Jan, 2015 17:30:12 +0000

[Ionut]
- Refactored 2 singletons into static classes (Console and TerrainLoader)
- Changed some C-casts to static_casts
- Updated copyright notices

337 Diff Diff IonutCava picture IonutCava Wed 17 Dec, 2014 17:25:16 +0000

[Ionut]
- Replaced all tabs with 4 spaces (some spacing may be off now. no way to check all the files.)
- Moved implementation details for ParamHandler, BoundingBox, BoundingSphere and ProfileTimer to proper .inl and .cpp files. (more to follow)
- Update all forward declared enums with the required storage type (as requested by the C++11 standard)

333 Diff Diff IonutCava picture IonutCava Tue 09 Dec, 2014 16:15:44 +0000

[Ionut]
- Removed “core.h” and moved everything to their appropriate header files
- Renamed MathClasses to MathMatrices (finally)
- Renamed “-Inl.h” files to ".inl"
- Some String wrapper refactoring
- Update “InstallLibraries.bat” so that it still offers valid options

326 Diff Diff IonutCava picture IonutCava Tue 30 Sep, 2014 21:11:32 +0000

[Ionut]
- Fixed more memory leaks
- Simplified Task interface and timing System
- Improved compatibility between Boost, STL and EASTL with random combinations of vectors, strings and maps
- Simplified Light class by removing the “slot” member
- Random optimizations

322 Diff Diff IonutCava picture IonutCava Sat 06 Sep, 2014 20:33:47 +0000

[Ionut]
- Refactored most of Boost related code to be C++11 based
— Boost is only used for ThreadPool, Mutex handling, XML parsing and networking (ASIO)
— Function binds, threads, regex, NonCopyable base, Hashing algorithms and more are now using C++11 libraries
- Replaced all FOR_EACH calls with standard, range, “for” calls

321 Diff Diff IonutCava picture IonutCava Wed 03 Sep, 2014 22:05:15 +0000

[Ionut]
- Added support (and enabled by default) for the EASTL library (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2271.html / https://github.com/paulhodge/EASTL)
— Strings, vectors and hash_maps can be combined from EASTL, STL and Boost (not all combinations work. e.g. EASTL strings with STL/Boost containers due to the lack of a proper hash function)

319 Diff Diff IonutCava picture IonutCava Sat 30 Aug, 2014 21:37:57 +0000

[Ionut]
- Performance tweaks based on profiling data

318 IonutCava picture IonutCava Sat 30 Aug, 2014 17:35:53 +0000

[Ionut]
- Wrapped the entire code in a “Divide” namespace
- VertexBuffers now call “shrink_to_fit” on all internal data storage
- Improved some vector performance by preferring “emplace_back” instead of “push_back” + proepr usage of reserve / resize
- Wrapped OIS specific types and classes in Divide::Input namespace
- Added the messageBox.layout file (forgot it in the previous few commits)