diff --git a/C/actions.cpp b/C/actions.cpp new file mode 100644 index 0000000..f8980d5 --- /dev/null +++ b/C/actions.cpp @@ -0,0 +1,3 @@ +void erease() { + +} diff --git a/C/inputs.cpp b/C/inputs.cpp index afd941c..b61a955 100644 --- a/C/inputs.cpp +++ b/C/inputs.cpp @@ -17,6 +17,9 @@ void inputActions(SDL_Event e) { play = !play; step = 0; break; + case SDLK_e: + setErease = true; + break; default: break; } diff --git a/C/main.cpp b/C/main.cpp index 2fbc4fa..3f1e82f 100644 --- a/C/main.cpp +++ b/C/main.cpp @@ -19,12 +19,14 @@ SDL_Renderer* renderer; int pattern[PATTERN_ROWS][PATTERN_COLS]; int matrix[] = {PATTERN_ROWS, PATTERN_COLS}; bool play = false; +bool setErease = false; int step = 0; #include "draw.cpp" #include "players.cpp" #include "loaders.cpp" #include "inputs.cpp" +#include "actions.cpp" int main(int argc, char** argv) { @@ -67,8 +69,6 @@ int main(int argc, char** argv) { break; default: break; - - } if( !done ) { gotEvent = SDL_PollEvent(&event); } @@ -80,7 +80,6 @@ int main(int argc, char** argv) { } } - for( int i = 0; i < NUM_WAVEFORMS; i++ ) { Mix_FreeChunk(samples[i]); } diff --git a/C/players.cpp b/C/players.cpp index b3ac490..cc40ead 100644 --- a/C/players.cpp +++ b/C/players.cpp @@ -15,11 +15,18 @@ void playPattern(int *timer, int duration, int *step) { } void setSample(int sample, int step) { - pattern[sample-1][step-1] = 1; - for(int i=0; i