[Bf-blender-cvs] [7f89977] particles_refactor: Cleanup: Removed old unused code from multi-layer paged buffers.

Lukas Tönne noreply at git.blender.org
Tue Apr 22 12:06:26 CEST 2014


Commit: 7f8997783fcf7ec1255ef9ba80dac67d340451da
Author: Lukas Tönne
Date:   Sun Dec 22 12:00:06 2013 +0100
https://developer.blender.org/rB7f8997783fcf7ec1255ef9ba80dac67d340451da

Cleanup: Removed old unused code from multi-layer paged buffers.

===================================================================

M	source/blender/blenkernel/BKE_nparticle.h
M	source/blender/blenkernel/intern/nparticle.c
M	source/blender/blenlib/BLI_pagedbuffer.h
M	source/blender/blenlib/intern/pagedbuffer.c
M	source/blender/makesdna/DNA_nparticle_types.h

===================================================================

diff --git a/source/blender/blenkernel/BKE_nparticle.h b/source/blender/blenkernel/BKE_nparticle.h
index 3b724dc..bfee1e5 100644
--- a/source/blender/blenkernel/BKE_nparticle.h
+++ b/source/blender/blenkernel/BKE_nparticle.h
@@ -116,94 +116,4 @@ struct NParticleDisplay *BKE_nparticle_display_particle(void);
 struct NParticleDisplay *BKE_nparticle_display_copy(struct NParticleDisplay *display);
 void BKE_nparticle_display_free(struct NParticleDisplay *display);
 
-
-#if 0 /* old code */
-#include "BLI_math.h"
-#include "BLI_pagedbuffer.h"
-
-#include "DNA_nparticle_types.h"
-
-#include "BKE_node.h"
-
-struct Object;
-struct Scene;
-struct DupliObject;
-struct NParticleSystem;
-struct NParticlesModifierData;
-struct NParticleDupliObject;
-
-
-BLI_INLINE int pit_get_particle_flag(struct NParticleSystem *psys, struct bPagedBufferIterator *it, NParticleFlagLayerType flag)
-{
-	return (((*PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_FLAG]->layer, NParticleFlagLayerType)) & flag) != 0);
-}
-BLI_INLINE void pit_set_particle_flag(struct NParticleSystem *psys, struct bPagedBufferIterator *it, NParticleFlagLayerType flag)
-{
-	(*PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_FLAG]->layer_write, NParticleFlagLayerType)) |= flag;
-}
-BLI_INLINE void pit_clear_particle_flag(struct NParticleSystem *psys, struct bPagedBufferIterator *it, NParticleFlagLayerType flag)
-{
-	(*PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_FLAG]->layer_write, NParticleFlagLayerType)) &= ~flag;
-}
-
-BLI_INLINE NParticleRNG *pit_get_particle_rng(struct NParticleSystem *psys, struct bPagedBufferIterator *it)
-{
-	return PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_RANDOM_SEED]->layer, NParticleRNG);
-}
-
-BLI_INLINE const NParticleVector *pit_get_particle_position(struct NParticleSystem *psys, struct bPagedBufferIterator *it)
-{
-	return PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_POSITION]->layer, NParticleVector);
-}
-
-BLI_INLINE void pit_set_particle_position(struct NParticleSystem *psys, struct bPagedBufferIterator *it, const NParticleVector *value)
-{
-	copy_v3_v3((float *)PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_POSITION]->layer_write, NParticleVector), (const float *)value);
-}
-
-BLI_INLINE const NParticleQuaternion *pit_get_particle_rotation(struct NParticleSystem *psys, struct bPagedBufferIterator *it)
-{
-	return PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_ROTATION]->layer, NParticleQuaternion);
-}
-
-BLI_INLINE void pit_set_particle_rotation(struct NParticleSystem *psys, struct bPagedBufferIterator *it, const NParticleQuaternion *value)
-{
-	copy_qt_qt((float *)PBUF_GET_DATA_POINTER(it, psys->standard_attribute[PAR_ATTR_TYPE_ROTATION]->layer_write, NParticleQuaternion), (const float *)value);
-}
-
-struct bPagedBufferIterator pit_init_particles(struct NParticleSystem *psys);
-struct bPagedBufferIterator pit_init_particles_at(struct NParticleSystem *psys, int index);
-void pit_next_particle(struct NParticleSystem *psys, struct bPagedBufferIterator *it);
-
-void npar_init(struct NParticleSystem *psys);
-void npar_free(struct NParticleSystem *psys);
-void npar_copy(struct NParticleSystem *to, struct NParticleSystem *from);
-
-struct bPagedBufferIterator npar_create_particles(struct NParticleSystem *psys, struct NParticleSource *source, float time, float num);
-void npar_free_dead_particles(struct NParticleSystem *psys);
-
-void npar_reset(struct NParticleSystem *psys);
-
-struct NParticleAttribute *npar_find_custom_attribute(struct NParticleSystem *psys, const char *name);
-void npar_custom_attribute_unique_name(struct ListBase *attributes, struct NParticleAttribute *attr);
-void npar_init_attribute(struct NParticleAttribute *attr, int type, struct NParticleSystem *psys);
-void npar_init_custom_attribute(struct NParticleAttribute *attr, int datatype, const char *name, struct NParticleSystem *psys);
-struct NParticleAttribute *npar_add_attribute(struct NParticleSystem *psys, int type);
-struct NParticleAttribute *npar_add_custom_attribute(struct NParticleSystem *psys, int datatype, const char *name);
-void npar_remove_attribute(struct NParticleSystem *psys, struct NParticleAttribute *attr);
-int npar_socket_type_from_attribute(struct NParticleAttribute *attr);
-
-void npar_update_state(struct NParticleAttribute *attr, struct bPagedBufferIterator *pit);
-void npar_update_state_all(struct NParticleSystem *psys, struct bPagedBufferIterator *pit);
-
-struct NParticleSource *npar_source_new(struct NParticleSystem *psys);
-
-struct NParticleDupliObject *npar_dupli_object_new(void);
-void npar_dupli_object_free(struct NParticleDupliObject *dupli);
-struct NParticleDupliObject *npar_dupli_object_copy(struct NParticleDupliObject *dupli);
-void npar_create_dupli_object(struct NParticlesModifierData *pmd, struct bPagedBufferIterator *pit, struct Object **ob, float mat[][4]);
-
-void npar_filter_objects(struct Scene *scene, int type, void *userdata, void (*walk)(void *userdata, Scene *scene, struct Object *ob, struct bNodeTree *ntree));
-#endif
-
-#endif
+#endif /* BKE_NPARTICLE_H */
diff --git a/source/blender/blenkernel/intern/nparticle.c b/source/blender/blenkernel/intern/nparticle.c
index 2bc419a..4fef842 100644
--- a/source/blender/blenkernel/intern/nparticle.c
+++ b/source/blender/blenkernel/intern/nparticle.c
@@ -589,610 +589,3 @@ void BKE_nparticle_display_free(NParticleDisplay *display)
 {
 	MEM_freeN(display);
 }
-
-
-#if 0 /* old code */
-#include <assert.h>
-#include <stdlib.h>
-#include <math.h>
-#include <string.h>
-
-#include "MEM_guardedalloc.h"
-
-#include "DNA_mesh_types.h"
-#include "DNA_meshdata_types.h"
-#include "DNA_modifier_types.h"
-#include "DNA_node_types.h"
-#include "DNA_nparticle_types.h"
-#include "DNA_object_types.h"
-#include "DNA_pagedbuffer_types.h"
-#include "DNA_scene_types.h"
-
-#include "BLI_blenlib.h"
-#include "BLI_ghash.h"
-#include "BLI_math.h"
-#include "BLI_pagedbuffer.h"
-#include "BLI_path_util.h"
-#include "BLI_utildefines.h"
-
-#include "BKE_cdderivedmesh.h"
-#include "BKE_global.h"
-#include "BKE_group.h"
-#include "BKE_main.h"
-#include "BKE_modifier.h"
-#include "BKE_node.h"
-
-#include "BKE_nparticle.h"
-#include "BKE_object.h"
-#include "BKE_library.h"
-#include "BKE_depsgraph.h"
-
-#include "RNA_access.h"
-
-
-struct bPagedBufferIterator pit_init_particles(struct NParticleSystem *psys)
-{
-	return pit_init(&psys->particles);
-}
-
-struct bPagedBufferIterator pit_init_particles_at(struct NParticleSystem *psys, int index)
-{
-	return pit_init_at(&psys->particles, index);
-}
-
-/* skips dead particles */
-void pit_next_particle(struct NParticleSystem *psys, bPagedBufferIterator *it)
-{
-	do {
-		pit_next(it);
-	} while (it->valid && pit_get_particle_flag(psys, it, NPAR_DEAD));
-}
-
-static void pbuf_print(bPagedBuffer *pbuf)
-{
-	bPagedBufferLayerInfo *layer = pbuf->layers.first;
-//	char indent[64] = {'\0'};
-	
-	while (layer) {
-		printf("Layer %s: ", layer->name);
-		printf(" index=%d, stride=%d\n", layer->layer, layer->stride);
-		
-		layer = layer->next;
-	}
-}
-
-void npar_init(NParticleSystem *psys)
-{
-	/* XXX NPARTICLES page size default? */
-	pbufInit(&psys->particles, 1024);
-	
-	npar_add_attribute(psys, PAR_ATTR_TYPE_FLAG);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_ID);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_SOURCE_ID);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_RANDOM_SEED);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_REM_INDEX);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_BIRTH_TIME);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_POSITION);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_VELOCITY);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_FORCE);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_MASS);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_ROTATION);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_ANGULAR_VELOCITY);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_TORQUE);
-	npar_add_attribute(psys, PAR_ATTR_TYPE_ANGULAR_MASS);
-	
-	nodePathMapInit(&psys->node_path_map);
-	
-	psys->next_source_id = 0;
-	
-	/* pbuf_print(&psys->particles); */
-}
-
-void npar_free(NParticleSystem *psys)
-{
-	NParticleAttribute *attr, *attr_next;
-	
-	/* free attributes */
-	for (attr=psys->attributes.first; attr; attr=attr_next) {
-		attr_next = attr->next;
-		npar_remove_attribute(psys, attr);
-	}
-	
-	nodePathMapFree(&psys->node_path_map);
-	
-	pbufFree(&psys->particles);
-}
-
-static NParticleAttribute *npar_copy_attribute(NParticleAttribute *attr)
-{
-	NParticleAttribute *nattr = MEM_dupallocN(attr);
-	nattr->prev = nattr->next = NULL;
-	
-	nattr->layer = attr->layer->new_layer;
-	nattr->layer_write = attr->layer_write->new_layer;
-	
-	/* temporary copy pointer for easy mapping */
-	attr->new_attribute = nattr;
-	
-	return nattr;
-}
-
-void npar_copy(NParticleSystem *to, NParticleSystem *from)
-{
-	NParticleAttribute *attr;
-	int i;
-	
-	pbufCopy(&to->particles, &from->particles);
-	
-	/* copy attributes */
-	to->attributes.first = to->attributes.last = NULL;
-	for (attr=from->attributes.first; attr; attr=attr->next) {
-		BLI_addtail(&to->attributes, npar_copy_attribute(attr));
-	}
-	for (i=0; i < PAR_ATTR_TYPE_MAX; ++i) {
-		if (from->standard_attribute[i])
-			to->standard_attribute[i] = from->standard_attribute[i]->new_attribute;
-	}
-	if (from->active_attribute)
-		to->active_attribute = from->active_attribute->new_attribute;
-	
-	nodePathMapCopy(&to->node_path_map, &from->node_path_map);
-}
-
-bPagedBufferIterator npar_create_particles(NParticleSystem *psys, NParticleSource *source, float time, float num)
-{
-	int delta;
-	bPagedBufferIterator pit, res;
-	
-	source->emit_carry += num;
-	delta = (int)(source->emit_carry);
-	source->emit_carry -= floorf(source->emit_carry);
-	
-	res = pbufAppendElements(&psys->particles, delta);
-	for (pit=res; pit.valid; pit_next(&pit)) {
-		int id;
-		
-		id = source->next_element_id++;
-		pit_set_int(&pit, psys->standard_attribute[PAR_ATTR_TYPE_ID]->layer, id);
-		pit_set_int(&pit, psys->standard_attribute[PAR_ATTR_TYPE_SOURCE_ID]->layer, source->id);
-		pit_set_float(&pit, psys->standard_attribute[PAR_ATTR_TYPE_BIRTH_TIME]->layer, time);
-	}
-	
-	return res;
-}
-
-static int npar_test_dead(bPage

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list