Ejemplo n.º 1
0
int main(int argc, char *argv[])
{
    const char *mode = NULL;
    const char *host = NULL;

    if(argc != 3)
    {
        PRINT_USAGE;
    }

    mode = argv[1];
    host = argv[2];

    if(strcmp(mode, "--enable") == 0)
    {
        set_enabled(host, TRUE);
    }
    else if(strcmp(mode, "--disable") == 0)
    {
        set_enabled(host, FALSE);
    }
    else
    {
        PRINT_USAGE;
    }

    return 0;
}
Ejemplo n.º 2
0
bool Portal::_set(const StringName &p_name, const Variant &p_value) {

	if (p_name == "shape") {
		PoolVector<float> src_coords = p_value;
		Vector<Point2> points;
		int src_coords_size = src_coords.size();
		ERR_FAIL_COND_V(src_coords_size % 2, false);
		points.resize(src_coords_size / 2);
		for (int i = 0; i < points.size(); i++) {

			points[i].x = src_coords[i * 2 + 0];
			points[i].y = src_coords[i * 2 + 1];
			set_shape(points);
		}
	} else if (p_name == "enabled") {
		set_enabled(p_value);
	} else if (p_name == "disable_distance") {
		set_disable_distance(p_value);
	} else if (p_name == "disabled_color") {
		set_disabled_color(p_value);
	} else if (p_name == "connect_range") {
		set_connect_range(p_value);
	} else
		return false;

	return true;
}
Ejemplo n.º 3
0
 std::unique_ptr<ElVis::Serialization::RenderModule> RenderModule::Serialize() const
 {
   auto pResult = std::unique_ptr<ElVis::Serialization::RenderModule>(new ElVis::Serialization::RenderModule());
   pResult->set_enabled(m_enabled);
   DoSerialize(pResult);
   return pResult;
 }
Ejemplo n.º 4
0
	void X11Window::show(bool activate)
	{
		log_event("debug", "clan::X11Window::show(): Mapping window.");
		map_window();
		if (activate)
			set_enabled(true);
	}
Ejemplo n.º 5
0
/**
 * @brief Creates a new dynamic tile on the map.
 * @param name a name to identify this tile
 * @param layer layer of the tile
 * @param x x position of the tile on the map
 * @param y y position of the tile on the map
 * @param width width of the tile (the pattern can be repeated)
 * @param height height of the tile (the pattern can be repeated)
 * @param tile_pattern_id id of the tile pattern in the tileset 
 * @param enabled true to make the tile active on the map
 */
DynamicTile::DynamicTile(const std::string &name, Layer layer, int x, int y,
			 int width, int height, int tile_pattern_id, bool enabled):
  Detector(COLLISION_CUSTOM, name, layer, x, y, width, height),
  tile_pattern_id(tile_pattern_id), tile_pattern(NULL) {

  set_enabled(enabled);
}
Ejemplo n.º 6
0
/**
 * \brief Creates a new dynamic tile on the map.
 * \param name a name to identify this tile
 * \param layer layer of the tile
 * \param x x position of the tile on the map
 * \param y y position of the tile on the map
 * \param width width of the tile (the pattern can be repeated)
 * \param height height of the tile (the pattern can be repeated)
 * \param tile_pattern_id id of the tile pattern in the tileset
 * \param enabled true to make the tile active on the map
 */
DynamicTile::DynamicTile(const std::string& name, Layer layer, int x, int y,
			 int width, int height, int tile_pattern_id, bool enabled):
  MapEntity(name, 0, layer, x, y, width, height),
  tile_pattern_id(tile_pattern_id),
  tile_pattern(NULL) {

  set_enabled(enabled);
}
Ejemplo n.º 7
0
void DriverStation::MergeFrom(const DriverStation& from) {
  GOOGLE_CHECK_NE(&from, this);
  if (from._has_bits_[0 / 32] & (0xffu << (0 % 32))) {
    if (from.has_enabled()) {
      set_enabled(from.enabled());
    }
    if (from.has_state()) {
      set_state(from.state());
    }
  }
  mutable_unknown_fields()->MergeFrom(from.unknown_fields());
}
Ejemplo n.º 8
0
game::~game() {
	eevt->remove_event_handler(action_handler_fct);
	set_enabled(false);
	t->delete_texture(death_tex);
	// eleminate cubes
	for(size_t i = CUBE_VBO_INDEX_VERT; i < CUBE_VBO_INDEX_MAX__; ++i) {
		if(glIsBuffer(cube_vbo[i])) glDeleteBuffers(1, &cube_vbo[i]);
	}
	if(glIsBuffer(laser_beam_vbo)) glDeleteBuffers(1, &laser_beam_vbo);
	if(glIsBuffer(laser_beam_indices_vbo)) glDeleteBuffers(1, &laser_beam_indices_vbo);
	if(glIsTexture(tex_permutation)) glDeleteTextures(1, &tex_permutation);
	if(glIsTexture(tex_gradient)) glDeleteTextures(1, &tex_gradient);
}
Ejemplo n.º 9
0
/**
 * \brief Creates a new dynamic tile on the map.
 * \param name a name to identify this tile
 * \param layer layer of the tile
 * \param xy Coordinates of the tile on the map
 * \param size Size of the tile (the pattern can be repeated)
 * \param tileset The tileset to use.
 * \param tile_pattern_id id of the tile pattern in the tileset
 * \param enabled true to make the tile initially enabled.
 */
DynamicTile::DynamicTile(
    const std::string& name,
    int layer,
    const Point& xy,
    const Size& size,
    Tileset& tileset,
    const std::string& tile_pattern_id,
    bool enabled
) :
  Entity(name, 0, layer, xy, size),
  tile_pattern_id(tile_pattern_id),
  tile_pattern(tileset.get_tile_pattern(tile_pattern_id)) {

  set_enabled(enabled);
}
Ejemplo n.º 10
0
Portal::Portal() {

	portal = VisualServer::get_singleton()->portal_create();
	Vector<Point2> points;
	points.push_back(Point2(-1, 1));
	points.push_back(Point2(1, 1));
	points.push_back(Point2(1, -1));
	points.push_back(Point2(-1, -1));
	set_shape(points); // default shape

	set_connect_range(0.8);
	set_disable_distance(50);
	set_enabled(true);

	set_base(portal);
}
Ejemplo n.º 11
0
inline bool enable() { return set_enabled(true); }
Ejemplo n.º 12
0
inline bool disable() { return set_enabled(false); }
CameraController::~CameraController()
{
    set_enabled(false);
}
Ejemplo n.º 14
0
	void X11Window::hide()
	{
		set_enabled(false);
		unmap_window();
	}