Browse Source

Moved source files to src/

master
Joshua Moerman 11 years ago
parent
commit
7f3d8d99a1
  1. 3
      CMakeLists.txt
  2. 0
      src/json.h
  3. 10
      src/main.cpp
  4. 0
      src/websockets.cpp
  5. 0
      src/websockets.h

3
CMakeLists.txt

@ -25,7 +25,8 @@ set(all_libraries websockets json_spirit)
# Own files
include_directories("${PROJECT_SOURCE_DIR}")
file(GLOB all_files "*.cpp")
include_directories("${PROJECT_SOURCE_DIR}/src/")
file(GLOB all_files "src/*.cpp")
add_executable(server ${all_files})
target_link_libraries(server ${all_libraries})

0
json.h → src/json.h

10
main.cpp → src/main.cpp

@ -67,6 +67,8 @@ BOOST_FUSION_ADAPT_STRUCT(
std::vector<User*> people_online;
inline void update_positions(){
const float speed = 0.4;
typedef std::chrono::duration<double, std::ratio<1,1>> fseconds;
static auto start = std::chrono::steady_clock::now();
auto end = std::chrono::steady_clock::now();
@ -76,11 +78,11 @@ inline void update_positions(){
auto n = people_online.size();
for(int i = 0; i < n; ++i){
User& user = *people_online[i];
double x = cos(0.1 * time + 2*M_PI*i/double(n));
double y = sin(0.1 * time + 2*M_PI*i/double(n));
double x = cos(speed * time + 2*M_PI*i/double(n));
double y = sin(speed * time + 2*M_PI*i/double(n));
user.position.x = 200 + 180*x;
user.position.y = 200 + 180*y;
user.position.x = 200 + 200*x;
user.position.y = 200 + 200*y;
}
}

0
websockets.cpp → src/websockets.cpp

0
websockets.h → src/websockets.h