Skip to content

Commit

Permalink
v10 - multithreading
Browse files Browse the repository at this point in the history
  • Loading branch information
david.wustenhagen committed Mar 30, 2024
1 parent 860fb18 commit d2fdd9c
Show file tree
Hide file tree
Showing 14 changed files with 202 additions and 216 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
APP_NAME = Sandbox
APP_VER_MAJOR = 0
APP_VER_MINOR = 10
APP_VER_BUILD = 386
APP_VER_BUILD = 507


DEFINES = -DAPP_NAME=\"$(APP_NAME)\" -DAPP_VER_MAJOR=$(APP_VER_MAJOR) -DAPP_VER_MINOR=$(APP_VER_MINOR) -DAPP_VER_BUILD=$(APP_VER_BUILD)

CFLAGS = -O3 -Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable
CFLAGS = -O3 -Wall -Wextra -Wno-unused-variable -Wno-unused-function -Wno-unused-but-set-variable -pthread -lpthread
#-pg -no-pie #Enable profiling data out gmon.out

EMSFLAGS = -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sUSE_SDL_TTF=2 -pthread
EMSFLAGS = -sUSE_SDL=2 -sUSE_SDL_IMAGE=2 -sUSE_SDL_TTF=2 -pthread -sPTHREAD_POOL_SIZE=8

# Increment APP_VER_BUILD number by 1
increment_version:
Expand Down
36 changes: 24 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,44 @@

## Todo

- [ ] Rendering doesn't work properly while autogenerating map adn scropping through coordinates, somethign to do with multithreading.
- [ ] Add water to terrain generation.
- [ ] Add erosion brush.
- [ ] Make windbrush follow the direction and speed of the mouse.
- [ ] Bug: Water velocity is messed up at the edge of the map, causes foam to spawn.
- [x] Bug: Lava and mist bleeds over to the other side of the map if you add it over the map edge.
- [x] Add a version number.
- [x] Make transparent things sample the background framebuffer.
- [ ] Make map buffers allocated.
- [ ] Make map resizable.
- [ ] Make starting camera position adjust to center over map regardless of size.
- [x] Move zooming camera to a function so the same code isn't everywhere.
- [ ] Try adding particles that spawn foam. use these as spawners for foam to get better looking foam transport.
- [-] Move rendering to different layers.
- [x] Make sure colors cannot overflow.
- [x] Move simulation functions into its own .c file
- [-] Move project to Clion
- [x] Add back lava.
- [x] Add back mist.
- [ ] Add all camera controls to mouse.
- [ ] Add touch support.
- [ ] Foam and sand transport doesn't work very good, mass isn't constant. Something to do with the advection, fix that.
- [ ] Get nicer colors for stuff.
- [ ] Make the html look nicer.
- [ ] Make sediment have color that gets transported with the sediment.
- [x] Move drawPoint and drawLine into window.c
- [ ] Split map into chunks, each chunk should keep track of what sort of fluids/sand it contains so it only need to update what is present.

## Done

### v0.10

- [x] Doubled the rendering resolution to 1024x1024.
- [x] Added multithreading, the simulation step of the next frame now starts at the same time as the software rendering.
- [x] Limit zoom distance so that no artifacts happens at the edge of the map.

### v0.9

- [x] Bug: Lava and mist bleeds over to the other side of the map if you add it over the map edge.
- [x] Add a version number.
- [x] Make transparent things sample the background framebuffer.
- [x] Move zooming camera to a function so the same code isn't everywhere.
- [-] Move rendering to different layers.
- [x] Make sure colors cannot overflow.
- [x] Move simulation functions into its own .c file
- [-] Move project to Clion
- [x] Add back lava.
- [x] Add back mist.
- [x] Move drawPoint and drawLine into window.c
- [x] Add back foam.

## Ideas
Expand Down Expand Up @@ -69,7 +81,7 @@ Paste this in launch.json, this disables CORS as well as enables multithreading
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
// For more information, visit: <https://go.microsoft.com/fwlink/?linkid=830387>
"version": "0.2.0",
"configurations": [
{
Expand Down
2 changes: 1 addition & 1 deletion application.js

Large diffs are not rendered by default.

Binary file modified application.wasm
Binary file not shown.
Loading

0 comments on commit d2fdd9c

Please sign in to comment.