248 lines
8.2 KiB
Plaintext
248 lines
8.2 KiB
Plaintext
// Filename: spriteParticleRenderer.I
|
|
// Created by: charles (13Jul00)
|
|
//
|
|
////////////////////////////////////////////////////////////////////
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_texture
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_texture(Texture *tex) {
|
|
_sprite_primitive->set_texture(tex);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_color
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_color(const Colorf &color) {
|
|
_color = color;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_x_scale_flag
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_x_scale_flag(bool animate_x_ratio) {
|
|
if (animate_x_ratio == true && _animate_x_ratio == false) {
|
|
_x_texel_array = PTA_float(_pool_size);
|
|
_sprite_primitive->set_x_texel_ratio(_x_texel_array, G_PER_PRIM);
|
|
}
|
|
else if (animate_x_ratio == false && _animate_x_ratio == true) {
|
|
_x_texel_array = PTA_float(1);
|
|
_sprite_primitive->set_x_texel_ratio(_x_texel_array, G_OVERALL);
|
|
}
|
|
|
|
_animate_x_ratio = animate_x_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_y_scale_flag
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_y_scale_flag(bool animate_y_ratio) {
|
|
if (animate_y_ratio == true && _animate_y_ratio == false) {
|
|
_y_texel_array = PTA_float(_pool_size);
|
|
_sprite_primitive->set_y_texel_ratio(_y_texel_array, G_PER_PRIM);
|
|
}
|
|
else if (animate_y_ratio == false && _animate_y_ratio == true) {
|
|
_y_texel_array = PTA_float(1);
|
|
_sprite_primitive->set_y_texel_ratio(_y_texel_array, G_OVERALL);
|
|
}
|
|
|
|
_animate_y_ratio = animate_y_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_anim_angle_flag
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_anim_angle_flag(bool animate_theta) {
|
|
if (animate_theta == true && _animate_theta == false) {
|
|
_theta_array = PTA_float(_pool_size);
|
|
_sprite_primitive->set_thetas(_theta_array, G_PER_PRIM);
|
|
}
|
|
else if (animate_theta == false && _animate_theta == true) {
|
|
_theta_array = PTA_float(_pool_size);
|
|
_sprite_primitive->set_thetas(_theta_array, G_OVERALL);
|
|
}
|
|
|
|
_animate_theta = animate_theta;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_initial_x_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_initial_x_scale(float initial_x_scale) {
|
|
_initial_x_texel_ratio = initial_x_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_final_x_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_final_x_scale(float final_x_scale) {
|
|
_final_x_texel_ratio = final_x_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_initial_y_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_initial_y_scale(float initial_y_scale) {
|
|
_initial_y_texel_ratio = initial_y_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_final_y_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_final_y_scale(float final_y_scale) {
|
|
_final_y_texel_ratio = final_y_scale;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_nonanimated_theta
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_nonanimated_theta(float theta) {
|
|
_theta = theta;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_alpha_blend_method
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_alpha_blend_method(ParticleRendererBlendMethod bm) {
|
|
_blend_method = bm;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : set_alpha_disable
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE void SpriteParticleRenderer::
|
|
set_alpha_disable(bool ad) {
|
|
_sprite_primitive->set_alpha_disable(ad);
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_texture
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE Texture *SpriteParticleRenderer::
|
|
get_texture(void) const {
|
|
return _sprite_primitive->get_texture();
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_color
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE Colorf SpriteParticleRenderer::
|
|
get_color(void) const {
|
|
return _color;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_x_scale_flag
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE bool SpriteParticleRenderer::
|
|
get_x_scale_flag(void) const {
|
|
return _animate_x_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_y_scale_flag
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE bool SpriteParticleRenderer::
|
|
get_y_scale_flag(void) const {
|
|
return _animate_y_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_anim_angle_flag
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE bool SpriteParticleRenderer::
|
|
get_anim_angle_flag(void) const {
|
|
return _animate_theta;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_initial_x_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE float SpriteParticleRenderer::
|
|
get_initial_x_scale(void) const {
|
|
return _initial_x_texel_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_final_x_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE float SpriteParticleRenderer::
|
|
get_final_x_scale(void) const {
|
|
return _final_x_texel_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_initial_y_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE float SpriteParticleRenderer::
|
|
get_initial_y_scale(void) const {
|
|
return _initial_y_texel_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_final_y_scale
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE float SpriteParticleRenderer::
|
|
get_final_y_scale(void) const {
|
|
return _final_y_texel_ratio;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_nonanimated_theta
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE float SpriteParticleRenderer::
|
|
get_nonanimated_theta(void) const {
|
|
return _theta;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_alpha_blend_method
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE BaseParticleRenderer::ParticleRendererBlendMethod SpriteParticleRenderer::
|
|
get_alpha_blend_method(void) const {
|
|
return _blend_method;
|
|
}
|
|
|
|
////////////////////////////////////////////////////////////////////
|
|
// Function : get_alpha_disable
|
|
// Access : public
|
|
////////////////////////////////////////////////////////////////////
|
|
INLINE bool SpriteParticleRenderer::
|
|
get_alpha_disable(void) const {
|
|
return _sprite_primitive->get_alpha_disable();
|
|
}
|