diff --git a/C/inputs.cpp b/C/inputs.cpp index b61a955..625e0a6 100644 --- a/C/inputs.cpp +++ b/C/inputs.cpp @@ -20,6 +20,10 @@ void inputActions(SDL_Event e) { case SDLK_e: setErease = true; break; + case SDLK_o: + selectPattern = true; + break; + default: break; } diff --git a/C/main.cpp b/C/main.cpp index 3f1e82f..dee72c5 100644 --- a/C/main.cpp +++ b/C/main.cpp @@ -20,11 +20,12 @@ int pattern[PATTERN_ROWS][PATTERN_COLS]; int matrix[] = {PATTERN_ROWS, PATTERN_COLS}; bool play = false; bool setErease = false; +bool selectPattern = false; int step = 0; #include "draw.cpp" -#include "players.cpp" #include "loaders.cpp" +#include "players.cpp" #include "inputs.cpp" #include "actions.cpp" diff --git a/C/players.cpp b/C/players.cpp index cc40ead..206c7ae 100644 --- a/C/players.cpp +++ b/C/players.cpp @@ -20,6 +20,9 @@ void setSample(int sample, int step) { pattern[sample-1][i] = 0; } setErease = false; + } else if(selectPattern) { + loadPattern(sample); + selectPattern = false; } else { pattern[sample-1][step-1] = 1; for(int i=0; i