Skip to content

cleanup of glCanvasArea.cpp #17

@nathanfranklin

Description

@nathanfranklin

There is lots of code repeat that should be cleaned up.

    // Go through all the particles and make a list of
    // known types
    int numberOfParticleTypes = 0;
    for (i=0;i<ad.numberOfParticles;i++) {
        if (this->particleIsInSlice(i)) {
            isInList = FALSE;
            for (int j=0;j<numberOfParticleTypes;j++) {
                if (typeCmp( (char *)&particleTypes[j], (char *)&ad.particles[i].type ) == TRUE) {
                    isInList = TRUE;
                    j = numberOfParticleTypes;
                }
            }
            if (isInList == FALSE) {
                // Found a new particle -- add it to the list
                if (numberOfParticleTypes < MAX_PARTICLE_TYPES) {
                    typeCopy( (char *)&ad.particles[i].type, (char *)&particleTypes[numberOfParticleTypes]);
                    numberOfParticleTypes++;
                }
            }
        }
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions