experiments
This commit is contained in:
19
main.c
19
main.c
@@ -38,6 +38,7 @@ int loadGameState(char *filename, Player *plr) {
|
||||
SDL_Rect *tmp = audioData.playerRect;
|
||||
memcpy(&audioData, &gameState.audioData, sizeof(gameState.audioData));
|
||||
audioData.playerRect = tmp;
|
||||
audioData.totalSamples = 0;
|
||||
memcpy(&neededUpdates, &gameState.neededUpdates, sizeof(gameState.neededUpdates));
|
||||
plr->cursor.targetTile = NULL;
|
||||
plr->cursor.prevTargetTile = NULL;
|
||||
@@ -142,11 +143,11 @@ int init() {
|
||||
loadItems(mainRenderer);
|
||||
setupTiles();
|
||||
|
||||
for (ItemType i = 0; i < ITEMREGISTRY_SIZE; i++) {
|
||||
if (strlen(ItemRegistry[i].name)) {
|
||||
printf("%d -> %s\n", i, ItemRegistry[i].name);
|
||||
}
|
||||
}
|
||||
// for (ItemType i = 0; i < ITEMREGISTRY_SIZE; i++) {
|
||||
// if (strlen(ItemRegistry[i].name)) {
|
||||
// printf("%d -> %s\n", i, ItemRegistry[i].name);
|
||||
// }
|
||||
// }
|
||||
// Create OpenGL context
|
||||
glContext = SDL_GL_CreateContext(window);
|
||||
if (!glContext) {
|
||||
@@ -174,7 +175,14 @@ int init() {
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
for (int t = 0; t < MIDI_TRACK_MAX; t++) {
|
||||
midiEventCount[t] = 0;
|
||||
nextMidiEvent[t] = 0;
|
||||
}
|
||||
|
||||
|
||||
load_midi_file("assets/audio/testaid.mid");
|
||||
load_midi_file("assets/audio/bg.mid");
|
||||
|
||||
SDL_PauseAudioDevice(dev, 0);
|
||||
|
||||
@@ -353,6 +361,7 @@ void processMousePosition() {
|
||||
player.cursor.targetTile->items[lane].type = 0;
|
||||
}
|
||||
}
|
||||
audioData.synthVoices[player.cursor.targetTile->audioCh].volume = 0;
|
||||
int neededIndex = player.cursor.targetTile->neededUpdateIndex;
|
||||
if (TileRegistry[player.cursor.targetTile->type].needsTicks &&
|
||||
neededUpdates.tiles[neededIndex].x == player.cursor.targetTile->rect.x &&
|
||||
|
Reference in New Issue
Block a user