Break coding style

This commit is contained in:
Perttu Ahola 2014-10-27 01:07:05 +02:00
parent 8c864c6ac9
commit b50656f505
15 changed files with 27 additions and 21 deletions

View File

@ -338,7 +338,7 @@ void FileWatchThread::run(interface::Thread *thread)
client_file::access(m_module->m_server, client_file::access(m_module->m_server,
[&](client_file::Interface *iclient_file) [&](client_file::Interface *iclient_file)
{ {
for(int fd : active_sockets){ for(int fd: active_sockets){
m_module->handle_active_socket(fd); m_module->handle_active_socket(fd);
} }
}); });

View File

@ -283,7 +283,8 @@ struct Module: public interface::Module, public ground_plane_lighting::Interface
{ {
interface::VoxelRegistry *voxel_reg = ivoxelworld->get_voxel_reg(); interface::VoxelRegistry *voxel_reg = ivoxelworld->get_voxel_reg();
//const auto &chunk_size_voxels = ivoxelworld->get_chunk_size_voxels(); //const auto &chunk_size_voxels = ivoxelworld->get_chunk_size_voxels();
pv::Region chunk_region = ivoxelworld->get_chunk_region_voxels(chunk_p); pv::Region chunk_region =
ivoxelworld->get_chunk_region_voxels(chunk_p);
ground_plane_lighting::access(m_server, ground_plane_lighting::access(m_server,
[&](ground_plane_lighting::Interface *igpl) [&](ground_plane_lighting::Interface *igpl)

View File

@ -40,6 +40,4 @@ namespace main_context
}); });
} }
} }
// vim: set noet ts=4 sw=4: // vim: set noet ts=4 sw=4:

View File

@ -61,8 +61,8 @@ struct Module: public interface::Module, public main_context::Interface
magic::SharedPtr<magic::Context> m_context; magic::SharedPtr<magic::Context> m_context;
magic::SharedPtr<magic::Engine> m_engine; magic::SharedPtr<magic::Engine> m_engine;
magic::SharedPtr<magic::Scene> m_scene; magic::SharedPtr<magic::Scene> m_scene;
sm_<Event::Type, magic::SharedPtr<interface::MagicEventHandler>> sm_<Event::Type, magic::SharedPtr<interface::MagicEventHandler>
m_magic_event_handlers; > m_magic_event_handlers;
uint64_t profiler_last_print_us = 0; uint64_t profiler_last_print_us = 0;
@ -224,7 +224,7 @@ struct Module: public interface::Module, public main_context::Interface
{ {
m_magic_event_handlers[buildat_event_type] = m_magic_event_handlers[buildat_event_type] =
new interface::MagicEventHandler( new interface::MagicEventHandler(
m_context, m_server, event_type, buildat_event_type); m_context, m_server, event_type, buildat_event_type);
} }
void* get_interface() void* get_interface()

View File

@ -331,7 +331,7 @@ void NetworkThread::run(interface::Thread *thread)
(void)ok; // Unused (void)ok; // Unused
network::access(m_module->m_server, [&](network::Interface *inetwork){ network::access(m_module->m_server, [&](network::Interface *inetwork){
for(int fd : active_sockets){ for(int fd: active_sockets){
m_module->handle_active_socket(fd); m_module->handle_active_socket(fd);
} }
}); });

View File

@ -421,7 +421,7 @@ struct Module: public interface::Module, public voxelworld::Interface
const PODVector<unsigned char> &rawbuf = var.GetBuffer(); const PODVector<unsigned char> &rawbuf = var.GetBuffer();
ss_ data((const char*)&rawbuf[0], rawbuf.Size()); ss_ data((const char*)&rawbuf[0], rawbuf.Size());
up_<pv::RawVolume<VoxelInstance>> volume = up_<pv::RawVolume<VoxelInstance>> volume =
interface::deserialize_volume(data); interface::deserialize_volume(data);
// Update collision shape // Update collision shape
interface::mesh::set_voxel_physics_boxes(n, context, *volume, interface::mesh::set_voxel_physics_boxes(n, context, *volume,
m_voxel_reg.get()); m_voxel_reg.get());
@ -832,7 +832,7 @@ struct Module: public interface::Module, public voxelworld::Interface
const PODVector<unsigned char> &buf = var.GetBuffer(); const PODVector<unsigned char> &buf = var.GetBuffer();
ss_ data((const char*)&buf[0], buf.Size()); ss_ data((const char*)&buf[0], buf.Size());
up_<pv::RawVolume<VoxelInstance>> volume = up_<pv::RawVolume<VoxelInstance>> volume =
interface::deserialize_volume(data); interface::deserialize_volume(data);
pv::Vector3DInt32 voxel_p( pv::Vector3DInt32 voxel_p(
p.getX() - chunk_p.getX() * m_chunk_size_voxels.getX(), p.getX() - chunk_p.getX() * m_chunk_size_voxels.getX(),
@ -888,7 +888,7 @@ struct Module: public interface::Module, public voxelworld::Interface
// Set in buffer // Set in buffer
ChunkBuffer &buf = section->get_buffer(chunk_p, m_server, ChunkBuffer &buf = section->get_buffer(chunk_p, m_server,
&m_total_buffers_loaded); &m_total_buffers_loaded);
if(!buf.volume){ if(!buf.volume){
log_(disable_warnings ? LOG_DEBUG : LOG_WARNING, log_(disable_warnings ? LOG_DEBUG : LOG_WARNING,
MODULE, "set_voxel() p=" PV3I_FORMAT ", v=%i: Couldn't get " MODULE, "set_voxel() p=" PV3I_FORMAT ", v=%i: Couldn't get "
@ -1042,7 +1042,7 @@ struct Module: public interface::Module, public voxelworld::Interface
// Get from buffer // Get from buffer
ChunkBuffer &buf = section->get_buffer(chunk_p, m_server, ChunkBuffer &buf = section->get_buffer(chunk_p, m_server,
&m_total_buffers_loaded); &m_total_buffers_loaded);
if(!buf.volume){ if(!buf.volume){
log_(disable_warnings ? LOG_DEBUG : LOG_WARNING, log_(disable_warnings ? LOG_DEBUG : LOG_WARNING,
MODULE, "get_voxel() p=" PV3I_FORMAT ": Couldn't get " MODULE, "get_voxel() p=" PV3I_FORMAT ": Couldn't get "

View File

@ -282,7 +282,7 @@ struct Module: public interface::Module
{ {
/*main_context::access(m_server, [&](main_context::Interface *imc) /*main_context::access(m_server, [&](main_context::Interface *imc)
{ {
Scene *scene = imc->get_scene(); Scene *scene = imc->get_scene();
Node *n = scene->GetChild("Testbox"); Node *n = scene->GetChild("Testbox");
auto p = n->GetPosition(); auto p = n->GetPosition();
log_v(MODULE, "Testbox: (%f, %f, %f)", p.x_, p.y_, p.z_); log_v(MODULE, "Testbox: (%f, %f, %f)", p.x_, p.y_, p.z_);

View File

@ -844,6 +844,10 @@ void generate_voxel_physics_boxes(
if(!def) if(!def)
throw Exception(ss_()+"Undefined voxel: "+itos(v_orig.get_id())); throw Exception(ss_()+"Undefined voxel: "+itos(v_orig.get_id()));
uint8_t v = (def && def->physically_solid); uint8_t v = (def && def->physically_solid);
volume.setVoxelAt(x, y, z, v); volume.setVoxelAt(x, y, z, v);
} }

View File

@ -70,3 +70,4 @@ namespace interface
} }
}; };
} }
// vim: set noet ts=4 sw=4:

View File

@ -9,4 +9,3 @@ namespace interface
typedef server::Config ServerConfig; typedef server::Config ServerConfig;
} }
// vim: set noet ts=4 sw=4: // vim: set noet ts=4 sw=4:

View File

@ -11,8 +11,8 @@ static inline void usleep(unsigned int us)
// Prefer using mingw-w64 with pthreads! // Prefer using mingw-w64 with pthreads!
#ifdef __WINPTHREADS_VERSION #ifdef __WINPTHREADS_VERSION
#include <pthread.h> #include <pthread.h>
#include <semaphore.h> #include <semaphore.h>
#else #else

View File

@ -172,7 +172,7 @@ int main(int argc, char *argv[])
next_tick_us = current_us; next_tick_us = current_us;
} }
interface::Event event("core:tick", interface::Event event("core:tick",
new interface::TickEvent(t_per_tick / 1e6)); new interface::TickEvent(t_per_tick / 1e6));
state->emit_event(std::move(event)); state->emit_event(std::move(event));
} }

View File

@ -70,3 +70,4 @@ ss_ hash_files(const sv_<ss_> &paths)
} }
} }
// vim: set noet ts=4 sw=4:

View File

@ -42,7 +42,8 @@ namespace urho3d_log_redirect
void on_message(const interface::MagicEvent &event) void on_message(const interface::MagicEvent &event)
{ {
int magic_level = event.magic_data.Find("Level")->second_.GetInt(); int magic_level = event.magic_data.Find("Level")->second_.GetInt();
ss_ message = event.magic_data.Find("Message")->second_.GetString().CString(); ss_ message =
event.magic_data.Find("Message")->second_.GetString().CString();
int core_level = LOG_ERROR; int core_level = LOG_ERROR;
if(magic_level == magic::LOG_DEBUG) if(magic_level == magic::LOG_DEBUG)
core_level = LOG_DEBUG; core_level = LOG_DEBUG;
@ -56,3 +57,4 @@ namespace urho3d_log_redirect
} }
}; };
} // urho3d_log_redirect } // urho3d_log_redirect
// vim: set noet ts=4 sw=4: