From 2bd8fa1aa9e9f071889cdf805cd238ce465d9676 Mon Sep 17 00:00:00 2001 From: Trevor Boddy Date: Tue, 16 Aug 2022 22:52:26 -0400 Subject: [PATCH] mostly squash compiler warnings --- res/bg/wall1.png | Bin 5484 -> 5515 bytes src/chrome.h | 16 ++++++++-------- src/foreground.h | 2 +- src/global.h | 15 ++++++++++++--- src/main.c | 2 +- src/player.h | 15 +++++---------- 6 files changed, 27 insertions(+), 23 deletions(-) diff --git a/res/bg/wall1.png b/res/bg/wall1.png index a61d2c234293df7cfc20124c78c7b7ae1747faf2..45702683d3d7f9fc8aa614df3ba439e2c0e31999 100644 GIT binary patch delta 1116 zcmaE()vdi@7B7d9p_PfHm67q}MZC%g&RJdyl@!ZV3sZ9=L*1lgBO_fCQ&V$Yi=?y^ zU86)(!^EUS6GLND!_As}JDFUGQK_U*T;f_*VpX1znrEwIWB@eMz(Uv1EClX=+5C2s zrwNEnt`>}}KgDIgj)8%Bwx^3@NJMLHcx2I01CGgS@BBYD>kIRdN!Lr3MdlcADE^+y zuJkGB4u@bD`xVy(%ew-2<}cs>y1ZydGzxd1sQ>XZimaD%M zZ`5Z_m|j$I=$BH!3Zr)il(^Sfoe{7$XS7Lom+xyy+~Xy6F0{C0cSeiC#E=wCm#67h zMTKL17@qSSC@%Y_Xn8%+`kjlYK&ZrwKh2-cb$Y%qy?8#d^+}@A8HKfPi&tHEe=>$K ze4E>(IU3GiCzZ)1xMs1 zC$DjqEVEzs+xnWRi}DNw-h*e_v$poFikLdJ==xj@XH}7zkB^!=EO1V` zlVdU@jh~*lF;mLK%PB7>tkEyxUaF7?*C9)1_M~XHrv|yNC9c_eHCinXeY~Ijzx?{u zLOYh!pT2%{-OsJc|K92ETgN1qny2dBsU=+yma@68@gsKxE+tN)#Sf70d4 zw1B@aszkMogxP1zDvSS6tN%_ko_|`~O?=jtk-sF240QJQ4SDvZt=O1>fru%g>QJPwh~Aue-N?S3=Z_ITIh> zaJ<#JeeSf}-s1r(q7%%dQl>|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=rytk# zIIyZ-=ItE~x%+oy_Gi{GGz9%{eYCB;-j=ESMb>e@t@ZgBy9Ru zC4Nl!|EV=v7I|qGH>xgBH9WC8S&Qk_oYqO~4F6A0&J_-Lvi{UV@we+kf)>x6U0+e> z*Jiima*Ol_Z5G|mq>X_#%^E+Ng1pw7uCw(NKa&6Pnd9dwFS|E3cOFNq*JiS(ztIyL_6H#_y?p}acBpD>QQ@7+WHGpM(GeBaM;^aTSDc)I$ztaD0e0sw8r B^!ES& diff --git a/src/chrome.h b/src/chrome.h index f436817..ed33640 100644 --- a/src/chrome.h +++ b/src/chrome.h @@ -26,14 +26,14 @@ static void loadScore(){ VDP_drawText(scoreStr, SCORE_X, SCORE_Y); } -static void updateScore(){ - if(lastScore != score){ - intToStr(score, scoreStr, SCORE_LENGTH); - VDP_drawText(scoreStr, SCORE_X, SCORE_Y); - lastScore = score; - } - score++; -} +// static void updateScore(){ +// if(lastScore != score){ +// intToStr(score, scoreStr, SCORE_LENGTH); +// VDP_drawText(scoreStr, SCORE_X, SCORE_Y); +// lastScore = score; +// } +// score++; +// } // zone diff --git a/src/foreground.h b/src/foreground.h index 691232b..95b68b4 100644 --- a/src/foreground.h +++ b/src/foreground.h @@ -35,7 +35,7 @@ static void drawFg(){ #define OBS_FLOOR_Y 20 #define OBS_X 32 -#define OBS_TOP_Y FIX16(24) +#define OBS_TOP_Y FIX16(56) #define OBS_BOTTOM_Y FIX16(160) s16 fgPos; diff --git a/src/global.h b/src/global.h index cbb6bd9..8c74bf3 100644 --- a/src/global.h +++ b/src/global.h @@ -14,6 +14,7 @@ #define CLOCK_LIMIT 32000 #define COUNT_INT 8 +#define INVINCIBLE_LIMIT 60 * 4 bool killBullets; @@ -22,7 +23,8 @@ s16 clock; u32 score, highScore; -void EMPTY(s16 i){} +s16 emptyI; // lmao +void EMPTY(s16 i){emptyI = i;} // structs @@ -31,11 +33,18 @@ struct bulletSpawner { fix16 x, y, speed; Vect2D_f16 vel; s16 angle; - Sprite* image; + SpriteDefinition* image; bool big, player; bool bools[COUNT_INT]; s16 ints[COUNT_INT]; fix16 fixes[COUNT_INT]; }; -void collideObstacleWithPlayer(s16); \ No newline at end of file +void collideObstacleWithPlayer(s16); + +struct playerStruct { + Vect2D_f16 pos, vel; + Sprite* image; + s16 clock, invincibleClock, shotClock; +}; +struct playerStruct player; \ No newline at end of file diff --git a/src/main.c b/src/main.c index 947010c..c6e6079 100644 --- a/src/main.c +++ b/src/main.c @@ -7,8 +7,8 @@ #include "controls.h" #include "background.h" #include "foreground.h" -#include "player.h" #include "bullets.h" +#include "player.h" #include "chrome.h" // game loop diff --git a/src/player.h b/src/player.h index a44ee07..c513fb6 100644 --- a/src/player.h +++ b/src/player.h @@ -4,16 +4,8 @@ #define PLAYER_INIT_X FIX16(32) #define PLAYER_INIT_Y FIX16(124) -#define INVINCIBLE_LIMIT 60 * 4 #define SHOT_INTERVAL 15 -struct playerStruct { - Vect2D_f16 pos, vel; - Sprite* image; - s16 clock, invincibleClock, shotClock; -}; -struct playerStruct player; - // spawn @@ -48,10 +40,13 @@ static void checkPlayerBounds(){ } void collideObstacleWithPlayer(s16 i){ - if(obstacles[i].pos.x < fix16Add(player.pos.x, PLAYER_OFF) && + if( + obstacles[i].pos.x < fix16Add(player.pos.x, PLAYER_OFF) && fix16Add(obstacles[i].pos.x, obstacles[i].size.x) > fix16Sub(player.pos.x, PLAYER_OFF) && obstacles[i].pos.y < fix16Add(player.pos.y, PLAYER_OFF) && - fix16Add(obstacles[i].pos.y, obstacles[i].size.y) > fix16Sub(player.pos.y, PLAYER_OFF)){ + fix16Add(obstacles[i].pos.y, obstacles[i].size.y) > fix16Sub(player.pos.y, PLAYER_OFF) + + ){ if(obstacles[i].pos.x > player.pos.x) player.pos.x = fix16Sub(fix16Sub(obstacles[i].pos.x, FG_SPEED), PLAYER_OFF); else if(obstacles[i].pos.y > player.pos.y) player.pos.y = fix16Sub(obstacles[i].pos.y, PLAYER_OFF); checkPlayerBounds();