Example #1
0
// add an entity on the client because the server told us to
Entity* World::net_add(ID id)
{
	vi_assert(!Entity::list.active(id));
	vi_assert(Entity::list.count() < MAX_ENTITIES);
	Entity::list.active(id, true);
	Entity::list.free_list.length--;
	return &Entity::list[id];
}
Example #2
0
// remove an entity on the client because the server told us to
void World::net_remove(Entity* e)
{
	vi_assert(Entity::list.active(e->id()));
	vi_assert(Entity::list.count() > 0);
	remove_components(e);
	Entity::list.active(e->id(), false);
	e->revision++;
	Entity::list.free_list.length++;
}
Example #3
0
void StreamWrite::bits(u32 value, s32 bits)
{
	vi_assert(bits > 0);
	vi_assert(bits <= 32);
	value &= (u64(1) << bits) - 1;

	scratch |= u64(value) << scratch_bits;

	scratch_bits += bits;

	if (scratch_bits >= 32)
	{
		data.add(u32(scratch & 0xFFFFFFFF));
		scratch >>= 32;
		scratch_bits -= 32;
	}
Example #4
0
void World::remove(Entity* e)
{
	b8 actually_removed = internal_remove(e);
	vi_assert(actually_removed);
}
Example #5
0
void World::remove_deferred(Entity* e)
{
	vi_assert(Game::level.local); // if we're a client, all entity removals are handled by the server
	remove_buffer.add(e->id());
}
Example #6
0
void World::remove(Entity* e)
{
	vi_assert(Game::level.local); // if we're a client, all entity removals are handled by the server
	b8 actually_removed = internal_remove(e);
	vi_assert(actually_removed);
}