Skip to content

Commit

Permalink
clean up for iniital pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnywycliffe committed Nov 4, 2024
1 parent 5762838 commit 31fe439
Show file tree
Hide file tree
Showing 18 changed files with 15 additions and 15 deletions.
Binary file added assets/cGrove/Sprites/Items/Books/agi_book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Books/cha_book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Books/spd_book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Books/sta_book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Books/str_book.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/DonutRing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Food/cake.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Food/souffle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Toys/cg_ball.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Toys/cg_crayons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Toys/cg_knife.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/cGrove/Sprites/Items/Toys/cg_toy_sword.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions main/modes/games/cGrove/Garden/cg_Grove.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void cg_initGrove(cGrove_t* cg)
cg->grove.items[idx].aabb.height = cg->grove.itemsWSGs[idx].h;
cg->grove.items[idx].aabb.width = cg->grove.itemsWSGs[idx].w;
char buffer[32];
snprintf(buffer, sizeof(buffer) - 1, "Item_%" PRId32, idx);
snprintf(buffer, sizeof(buffer) - 1, "Item_%d" PRId16, idx);
strcpy(cg->grove.items[idx].name, buffer);
}

Expand Down Expand Up @@ -277,7 +277,7 @@ void cg_runGrove(cGrove_t* cg, int64_t elapsedUS)
// Play BGM if it's not playing
if (!isBGMPlaying)
{
// soundPlayBgmCb(&cg->grove.bgm, MIDI_BGM, cg_bgmCB);
soundPlayBgmCb(&cg->grove.bgm, MIDI_BGM, cg_bgmCB);
isBGMPlaying = true;
}

Expand Down
4 changes: 2 additions & 2 deletions main/modes/games/cGrove/Garden/cg_GroveAI.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@ static cgChowaStateGarden_t cg_getNewTask(cGrove_t* cg, cgGroveChowa_t* c)
// Check player affinity
if (c->chowa->playerAffinity > 100 && esp_random() % 6 == 0)
{
c->precision = 16.0f;
c->precision = 16.0f;
c->nextTimeLeft = SECOND * (1 + (esp_random() % 3));
c->nextState = CHOWA_GIFT;
c->nextState = CHOWA_GIFT;
return CHOWA_CHASE;
}
// Check for held items
Expand Down
4 changes: 2 additions & 2 deletions main/modes/games/cGrove/Garden/cg_GroveAI.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
* @brief Chowa AI in the garden
* @version 0.1
* @date 2024-10-13
*
*
* @copyright Copyright (c) 2024
*
*
*/
#pragma once

Expand Down
1 change: 1 addition & 0 deletions main/modes/games/cGrove/Garden/cg_GroveDraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ static void cg_drawChowaGrove(cGrove_t* cg, int64_t elapsedUS)
int16_t xOffset = c->aabb.pos.x - cg->grove.camera.pos.x;
int16_t yOffset = c->aabb.pos.y - cg->grove.camera.pos.y;
wsg_t* spr;
spr = cg_getChowaWSG(cg, c->chowa, CG_ANIM_WALK_DOWN, 0);
switch (c->gState)
{
case CHOWA_STATIC:
Expand Down
2 changes: 1 addition & 1 deletion main/modes/games/cGrove/cg_Typedef.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ typedef struct
rectangle_t aabb; ///< Position and bounding box
int64_t despawnTimer; ///< Time left until money despawns
int8_t animFrame; ///< Sparkle animation frames
bool active; ///< If the ring is active
bool active; ///< If the ring is active
} cgGroveMoney_t;

typedef struct
Expand Down
15 changes: 7 additions & 8 deletions main/modes/games/cGrove/mode_cGrove.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "cg_Grove.h"
#include "cg_Spar.h"
#include <esp_random.h>
#include <esp_heap_caps.h>

//==============================================================================
// Defines
Expand Down Expand Up @@ -76,7 +77,7 @@ static void cg_menuCB(const char* label, bool selected, uint32_t settingVal);

/**
* @brief Draw title screen
*
*
* @param elapsedUs Time since I last dunked my head in a bucket of acid
*/
static void cg_titleScreen(int64_t elapsedUs);
Expand Down Expand Up @@ -112,9 +113,7 @@ static cGrove_t* cg = NULL;
static void cGroveEnterMode(void)
{
// Mode memory allocation
// FIXME: Emulator doesn't accept this?
// cg = heap_caps_calloc(1, sizeof(cGrove_t), MALLOC_CAP_SPIRAM);
cg = calloc(1, sizeof(cGrove_t));
cg = heap_caps_calloc(1, sizeof(cGrove_t), MALLOC_CAP_SPIRAM);
setFrameRateUs(CG_FRAMERATE);

// Load Chowa WSGs
Expand Down Expand Up @@ -157,11 +156,11 @@ static void cGroveEnterMode(void)
cg->state = CG_MAIN_MENU;
cg->titleActive = true;

//FIXME: test
// FIXME: test
for (int i = 0; i < CG_MAX_CHOWA; i++)
{
cg->chowa[i].active = true;
cg->chowa[i].type = CG_KING_DONUT;
cg->chowa[i].type = CG_KING_DONUT;
switch (esp_random() % 4)
{
case 0:
Expand All @@ -182,7 +181,7 @@ static void cGroveEnterMode(void)
for (int i = 0; i < CG_GROVE_MAX_GUEST_CHOWA; i++)
{
cg->guests[i].active = true;
cg->guests[i].type = CG_KING_DONUT;
cg->guests[i].type = CG_KING_DONUT;
switch (esp_random() % 4)
{
case 0:
Expand Down Expand Up @@ -399,7 +398,7 @@ static void cg_titleScreen(int64_t elapsedUs)
cg->cloudPos.x = -cg->title[0].h;
}
}
cg->animFrame = (cg->animFrame + 1) % 32;
cg->animFrame = (cg->animFrame + 1) % 32;
cg->titleFrame = (cg->titleFrame + 1) % 64;

// Draw
Expand Down

0 comments on commit 31fe439

Please sign in to comment.