Repository navigation
Implement ParticleSystem module - #43
Merged
Merged
Conversation
…ructions
- Extend module lifecycle section in CLAUDE.md and README.md to distinguish
global-state (Start → Use → Stop) from per-instance (Create → Use → Destroy)
- Add Documentation Guidelines section to CONTRIBUTING.md covering file placement,
two-tier README/API structure, Markdown style, and Doxygen rules
- Add Running Tests section to CONTRIBUTING.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ference
- Implement psCreate (calloc + bounds check) and psDestroy in ParticleSystem.c
- Reorder lifecycle declarations in ParticleSystem.h to match call order; add blank
lines between prototypes; rename maxParticles param to particles
- Restructure test file: constexpr constants, fixtures section, one smoke test
passing; remaining tests commented out pending implementation
- Add docs/ParticleSystem/ParticleSystemAPI.md
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace psEmit with two dedicated emission functions: - psBurst(ps, n) — spawns up to n particles immediately, capped at idle slots - psStream(ps, rate) — sets a particles/second rate driven by psUpdate's accumulator Remove psSetEvent (lifetime events) — game-loop polling via psForEach/psGetActive covers the use case without adding complexity inside the module. Drop PS_SHAPE_POINT — point emission is PS_SHAPE_ELLIPSE with all spreads 0.0f, which is also the default at psCreate. Add void *context to psSetSnapshotInfluence/SnapshotInfluenceFn for consistency with psSetInfluence — C function pointers cannot close over state. Mark psForEach, psGetX/Y, psGetActive, and psGetIdle const-correct. Add streamRate/streamAccumulator to psInternalParticleSystem; reorder velocity/acceleration fields to group by axis (minX/minY, maxX/maxY). Implement psGetActive, psReset, psBurst, psStream, and null guard on psDestroy. Activate all Create, Destroy, Reset, Burst, and Stream tests; remove psSetEvent stubs; update remaining scaffolding to reflect the new API names. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…psGetX and psGetY
…creasesAfterUpdate
Range-validation branches in psSetSpread, psSetVelocity, psSetAcceleration, and psSetLifetime were logging CSE_NULL_ARG despite no null pointer being involved; corrected to CSE_INVALID_ARG. Three MSG_INVALID_*_RANGE message strings described the valid requirement backwards (e.g. "Min lifetime must be greater than max lifetime"); rephrased to "min X must not exceed max X". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Correct influence callback timing (after, not before, position integration), remove unimplemented negativity guards from psSetSpread/psSetLifetime notes, and fix psReset description to reflect that the stream accumulator is preserved. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move <string.h> to the angle-bracket include group - Remove const from all by-value parameters in function definitions - Fix float const/const float inconsistency in psInternalSamplePosition - Remove double blank line in psSetSnapshotInfluence Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Install clang-18 explicitly on Ubuntu runners and use it as the compiler in both the build-and-test matrix and the sanitize job. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
clang-18 (used in CI on Ubuntu) does not support C23 constexpr; replace all occurrences with static const. Also fix lgPrivateLogV's definition to match its forward declaration (drop const from the value parameter and va_list argument, which also resolves the vfprintf qualifier warning). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cosf, sinf, and nanf require explicit -lm on Linux; macOS provides them in the standard C library. PUBLIC visibility propagates the flag to all consumers of smile (tests, GenScene) without touching each target. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
Author
|
Good job, me! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
ParticleSystempublic API (psCreate,psDestroy,psReset,psBurst,psStream,psUpdate,psForEach, allpsGet*andpsSet*functions including influence and snapshot-influence callbacks)tests/ParticleSystem.cwith a comprehensive test suite covering happy-path, error, edge-case, and stress scenariosdocs/ParticleSystem/README.md(Getting Started) anddocs/ParticleSystem/ParticleSystemAPI.md(full API reference), plus Doxygen comments on all public declarations ininclude/ParticleSystem.hTest plan
cmake -S . -B build -DSMILE_DEV=ON && cmake --build buildctest --test-dir build --output-on-failurectest --test-dir build -R TestAPIParticleSystem --output-on-failureTestAPILog,TestAPISceneManager, andTestToolGenScene🤖 Generated with Claude Code