summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfieldy101 <fieldy101@gmail.com>2020-04-23 10:05:19 +1000
committerfieldy101 <fieldy101@gmail.com>2020-04-23 10:05:19 +1000
commit4c409fa343e04a17e88c5a43162d2cf8eb295a00 (patch)
tree40837caf95c1e99e1cf55b04cf6354294b758ef0
parent1bddb1ff394e07890e01f0b91e91ad16083294bf (diff)
Resolving PR review
-rw-r--r--.gitignore2
-rw-r--r--include/battle_anim.h4
-rw-r--r--include/random.h2
-rw-r--r--src/graphics.c1
-rw-r--r--src/water.c18
5 files changed, 14 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index ba7cb9ab2..e9ebc1291 100644
--- a/.gitignore
+++ b/.gitignore
@@ -54,4 +54,4 @@ types_*.taghl
!sound/programmable_wave_samples/*.pcm
_Deparsed_XSubs.pm
porymap.project.cfg
-.vscode/*.* \ No newline at end of file
+.vscode/*.*
diff --git a/include/battle_anim.h b/include/battle_anim.h
index eacb51f2c..81c626f39 100644
--- a/include/battle_anim.h
+++ b/include/battle_anim.h
@@ -556,12 +556,12 @@ void sub_80ADAD8(u8 taskId);
void AnimTask_BlendBackground(u8 taskId);
void sub_80AD800(u8 taskId);
-// water.s
+// water.c
extern const union AnimCmd *const gAnims_WaterMudOrb[];
extern const union AnimCmd *const gAnims_WaterBubble[];
void AnimWaterPulseRing(struct Sprite *sprite);
-// smokescreen.s
+// smokescreen.c
u8 SmokescreenImpact(s16 x, s16 y, u8 a3);
// battle_anim_utility_funcs.c
diff --git a/include/random.h b/include/random.h
index 1eaff3245..139316f9d 100644
--- a/include/random.h
+++ b/include/random.h
@@ -13,8 +13,6 @@ u16 Random2(void);
//Returns a 32-bit pseudorandom number
#define Random32() (Random() | (Random() << 16))
-#define ISO_RANDOMIZE2(val)(1103515245 * (val) + 12345)
-
//Sets the initial seed value of the pseudorandom number generator
void SeedRng(u16 seed);
void SeedRng2(u16 seed);
diff --git a/src/graphics.c b/src/graphics.c
index 655bf43bc..391913eb7 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1088,7 +1088,6 @@ const u32 gBattleAnimSpritePal_CrossImpact[] = INCBIN_U32("graphics/battle_anims
const u32 gBattleAnimBgImage_Surf[] = INCBIN_U32("graphics/battle_anims/backgrounds/water.4bpp.lz");
const u32 gBattleAnimBgPalette_Surf[] = INCBIN_U32("graphics/battle_anims/backgrounds/water.gbapal.lz");
-// TODO Rename and move graphics
const u32 gBattleAnimBgTilemap_SurfOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/water_opponent.bin.lz");
const u32 gBattleAnimBgTilemap_SurfPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/water_player.bin.lz");
const u32 gBattleAnimBgTilemap_SurfContest[] = INCBIN_U32("graphics/battle_anims/backgrounds/water_contest.bin.lz");
diff --git a/src/water.c b/src/water.c
index 31a4b32e7..dbb42ecb3 100644
--- a/src/water.c
+++ b/src/water.c
@@ -12,6 +12,8 @@
#include "trig.h"
#include "util.h"
+#define ISO_RANDOMIZE2(val)(1103515245 * (val) + 12345)
+
static void AnimRainDrop(struct Sprite *);
static void AnimRainDrop_Step(struct Sprite *);
static void AnimWaterBubbleProjectile(struct Sprite *);
@@ -87,7 +89,7 @@ const struct SpriteTemplate gRainDropSpriteTemplate =
static const union AffineAnimCmd sAffineAnim_WaterBubbleProjectile[] =
{
- AFFINEANIMCMD_FRAME(0xFFFB, 0xFFFB, 0, 10),
+ AFFINEANIMCMD_FRAME(-0x5, -0x5, 0, 10),
AFFINEANIMCMD_FRAME(0x5, 0x5, 0, 10),
AFFINEANIMCMD_JUMP(0),
};
@@ -259,7 +261,7 @@ static const union AffineAnimCmd sAffineAnim_HydroCannonCharge[] =
{
AFFINEANIMCMD_FRAME(0x3, 0x3, 10, 50),
AFFINEANIMCMD_FRAME(0x0, 0x0, 0, 10),
- AFFINEANIMCMD_FRAME(0xFFEC, 0xFFEC, -10, 20),
+ AFFINEANIMCMD_FRAME(-0x14, -0x14, -10, 20),
AFFINEANIMCMD_END,
};
@@ -411,14 +413,14 @@ static const union AnimCmd *const sAnims_WeatherBallWaterDown[] =
static const union AffineAnimCmd sAffineAnim_WaterPulseRingBubble_0[] =
{
AFFINEANIMCMD_FRAME(0x100, 0x100, 0, 0),
- AFFINEANIMCMD_FRAME(0xFFF6, 0xFFF6, 0, 15),
+ AFFINEANIMCMD_FRAME(-0xA, -0xA, 0, 15),
AFFINEANIMCMD_END,
};
static const union AffineAnimCmd sAffineAnim_WaterPulseRingBubble_1[] =
{
AFFINEANIMCMD_FRAME(0xE0, 0xE0, 0, 0),
- AFFINEANIMCMD_FRAME(0xFFF8, 0xFFF8, 0, 15),
+ AFFINEANIMCMD_FRAME(-0x8, -0x8, 0, 15),
AFFINEANIMCMD_END,
};
@@ -494,11 +496,13 @@ void AnimTask_CreateRaindrops(u8 taskId)
DestroyAnimVisualTask(taskId);
}
-static void AnimRainDrop(struct Sprite *sprite) {
+static void AnimRainDrop(struct Sprite *sprite)
+{
sprite->callback = AnimRainDrop_Step;
}
-static void AnimRainDrop_Step(struct Sprite *sprite) {
+static void AnimRainDrop_Step(struct Sprite *sprite)
+{
if (++sprite->data[0] < 14) // Was 13 in emerald
{
sprite->pos2.x += 1;
@@ -892,7 +896,7 @@ void AnimTask_CreateSurfWave(u8 taskId)
else
{
// Changed from Emerald
- LZDecompressVram(gBattleAnimBgTilemap_SurfContest, animBg->bgTilemap);
+ LZDecompressVram(gBattleAnimBgTilemap_SurfContest, animBg.bgTilemap);
sub_80730C0(animBg.paletteId, animBg.bgTilemap, 0, 1);
}
AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Surf, animBg.tilesOffset);