diff --git a/C/inputs.cpp b/C/inputs.cpp new file mode 100644 index 0000000..bf732e5 --- /dev/null +++ b/C/inputs.cpp @@ -0,0 +1,18 @@ +void inputActions(SDL_Event e, int step) { + switch (e.key.keysym.sym) { + case SDLK_1: + setSample(1, step); + break; + case SDLK_2: + setSample(2, step); + break; + case SDLK_3: + setSample(3, step); + break; + case SDLK_4: + setSample(4, step); + break; + default: + break; + } +} diff --git a/C/loaders.cpp b/C/loaders.cpp index 4017795..10a0b39 100644 --- a/C/loaders.cpp +++ b/C/loaders.cpp @@ -50,16 +50,14 @@ void loadPattern(int patternNum) { if(fp == NULL) {exit(EXIT_FAILURE);} while ((read = getline(&line, &len, fp)) != -1) { - //printf("Retrieved line of length %zu:\n", read); if(lineCount == 0) { bank = line[10]-'0'; } if(lineCount == 1) { rows = line[10]-'0'; } - if(lineCount > 1) { if(lineCount == 2) { cols = read-1; } for(int i=0; i