Пример #1
0
static SELF
tp_new (PyTypeObject* type, PyObject* args, PyObject* kwds) {
    SELF self;
    static char* kw[] = {NULL};

    // Parse arguments
    if (!PyArg_ParseTupleAndKeywords(args, kwds, "|", kw))
        return NULL;

    // inherit base type
    self = (SELF) PyType_GenericNew(type, args, kwds);
    if (!self)
      return NULL;

    // new gobject
    self->g = soy_materials_material_new();

    // return self
    return self;
}
Пример #2
0
Файл: Box.c Проект: RONNCC/pysoy
soybodiesBox* soy_bodies_box_construct (GType object_type, soyatomsPosition* position, soyatomsSize* size, soymaterialsMaterial* material) {
	soybodiesBox * self = NULL;
	soyatomsPosition* _tmp0_;
	soyatomsSize* _tmp1_;
	soymaterialsMaterial* _tmp2_;
	_tmp0_ = position;
	_tmp1_ = size;
	self = (soybodiesBox*) soy_bodies_body_construct (object_type, _tmp0_, (GObject*) _tmp1_, 0.0f);
	self->priv->_ebo = (GLuint) 0;
	self->priv->_updated = TRUE;
	_tmp2_ = material;
	if (_tmp2_ == NULL) {
		soymaterialsMaterial* _tmp3_;
		soymaterialsMaterial* _tmp5_;
		soymaterialsMaterial* _tmp6_;
		_tmp3_ = soy_default_material;
		if (_tmp3_ == NULL) {
			soymaterialsMaterial* _tmp4_;
			_tmp4_ = soy_materials_material_new ();
			_g_object_unref0 (soy_default_material);
			soy_default_material = _tmp4_;
		}
		_tmp5_ = soy_default_material;
		_tmp6_ = _g_object_ref0 (_tmp5_);
		_g_object_unref0 (self->priv->_material);
		self->priv->_material = _tmp6_;
	} else {
		soymaterialsMaterial* _tmp7_;
		soymaterialsMaterial* _tmp8_;
		_tmp7_ = material;
		_tmp8_ = _g_object_ref0 (_tmp7_);
		_g_object_unref0 (self->priv->_material);
		self->priv->_material = _tmp8_;
	}
	return self;
}
Пример #3
0
soybodiesBillboard* soy_bodies_billboard_construct (GType object_type, soyatomsPosition* position, soyatomsSize* size, soymaterialsMaterial* material) {
	soybodiesBillboard * self = NULL;
	soyatomsPosition* _tmp0_;
	soyatomsSize* _tmp1_;
	soyatomsSize* _tmp2_;
	soymaterialsMaterial* _tmp18_;
	_tmp0_ = position;
	_tmp1_ = size;
	self = (soybodiesBillboard*) soy_bodies_body_construct (object_type, _tmp0_, (GObject*) _tmp1_, 0.0f);
	self->priv->_updated = TRUE;
	_tmp2_ = size;
	if (_tmp2_ == NULL) {
		self->priv->_width = (GLfloat) 1.0f;
		self->priv->_height = (GLfloat) 1.0f;
		self->priv->_xsubdivisions = 1;
		self->priv->_ysubdivisions = 1;
	} else {
		soyatomsSize* _tmp3_;
		gfloat _tmp4_;
		gfloat _tmp5_;
		soyatomsSize* _tmp6_;
		gfloat _tmp7_;
		gfloat _tmp8_;
		soyatomsSize* _tmp9_;
		gfloat _tmp10_;
		gfloat _tmp11_;
		gdouble _tmp12_ = 0.0;
		soyatomsSize* _tmp13_;
		gfloat _tmp14_;
		gfloat _tmp15_;
		gdouble _tmp16_ = 0.0;
		soyatomsSize* _tmp17_;
		_tmp3_ = size;
		_tmp4_ = soy_atoms_size_get_width (_tmp3_);
		_tmp5_ = _tmp4_;
		self->priv->_width = (GLfloat) _tmp5_;
		_tmp6_ = size;
		_tmp7_ = soy_atoms_size_get_height (_tmp6_);
		_tmp8_ = _tmp7_;
		self->priv->_height = (GLfloat) _tmp8_;
		_tmp9_ = size;
		_tmp10_ = soy_atoms_size_get_width (_tmp9_);
		_tmp11_ = _tmp10_;
		_tmp12_ = ceil ((gdouble) (_tmp11_ / 2));
		self->priv->_xsubdivisions = (gint) _tmp12_;
		_tmp13_ = size;
		_tmp14_ = soy_atoms_size_get_height (_tmp13_);
		_tmp15_ = _tmp14_;
		_tmp16_ = ceil ((gdouble) (_tmp15_ / 2));
		self->priv->_ysubdivisions = (gint) _tmp16_;
		_tmp17_ = size;
		self->priv->_size_obj = _tmp17_;
	}
	_tmp18_ = material;
	if (_tmp18_ == NULL) {
		soymaterialsMaterial* _tmp19_;
		soymaterialsMaterial* _tmp21_;
		soymaterialsMaterial* _tmp22_;
		_tmp19_ = soy_default_material;
		if (_tmp19_ == NULL) {
			soymaterialsMaterial* _tmp20_;
			_tmp20_ = soy_materials_material_new ();
			_g_object_unref0 (soy_default_material);
			soy_default_material = _tmp20_;
		}
		_tmp21_ = soy_default_material;
		_tmp22_ = _g_object_ref0 (_tmp21_);
		_g_object_unref0 (self->priv->_material);
		self->priv->_material = _tmp22_;
	} else {
		soymaterialsMaterial* _tmp23_;
		soymaterialsMaterial* _tmp24_;
		_tmp23_ = material;
		_tmp24_ = _g_object_ref0 (_tmp23_);
		_g_object_unref0 (self->priv->_material);
		self->priv->_material = _tmp24_;
	}
	return self;
}