Skip to content

Commit

Permalink
Merge branch 'port' of https://github.com/fgsfdsfgs/perfect_dark into…
Browse files Browse the repository at this point in the history
… port-net
  • Loading branch information
fgsfdsfgs committed Nov 16, 2024
2 parents 9a484c1 + 3d8f63d commit 26c24d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
10 changes: 5 additions & 5 deletions src/game/invitems.c
Original file line number Diff line number Diff line change
Expand Up @@ -2848,7 +2848,7 @@ struct weapon invitem_rocketlauncher = {
L_GUN_027, // name
L_GUN_149, // manufacturer
L_GUN_175, // description
WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK,
WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK,
};

struct guncmd invanim_slayer_shoot[] = {
Expand Down Expand Up @@ -3083,7 +3083,7 @@ struct weapon invitem_devastator = {
L_GUN_028, // name
L_GUN_149, // manufacturer
L_GUN_176, // description
WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS,
WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS,
};

struct weaponfunc invfunc_mine_threatdetector = {
Expand Down Expand Up @@ -3476,7 +3476,7 @@ struct weapon invitem_grenade = {
L_GUN_036, // name
L_GUN_000, // manufacturer
L_GUN_183, // description
WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS,
WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS,
};

struct weaponfunc_throw invfunc_nbomb_throw = {
Expand Down Expand Up @@ -3537,7 +3537,7 @@ struct weapon invitem_nbomb = {
L_GUN_037, // name
L_GUN_000, // manufacturer
L_GUN_184, // description
WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN,
WEAPONFLAG_THROWABLE | WEAPONFLAG_00000004 | WEAPONFLAG_ONEHANDED | WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_TRACKTIMEUSED | WEAPONFLAG_00000400 | WEAPONFLAG_00002000 | WEAPONFLAG_00008000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_DETERMINER_S_AN | WEAPONFLAG_DETERMINER_F_AN,
};

struct gunviscmd gunviscmds_farsight[] = {
Expand Down Expand Up @@ -6131,7 +6131,7 @@ struct weapon invitem_rocketlauncher_34 = {
L_GUN_027, // name
L_GUN_000, // manufacturer
L_GUN_000, // description
WEAPONFLAG_AICANUSE | WEAPONFLAG_DUALFLIP | WEAPONFLAG_00000040 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK,
WEAPONFLAG_AICANUSE | WEAPONFLAG_00000040 | WEAPONFLAG_00002000 | WEAPONFLAG_00004000 | WEAPONFLAG_HASHANDS | WEAPONFLAG_AIMTRACK,
};

struct guncmd invanim_tester_shoot[] = {
Expand Down
13 changes: 7 additions & 6 deletions src/game/menugfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
#define PXTOBYTES(val) ((val) * 2)

#ifndef PLATFORM_N64
static s32 g_MenuBlurFb = 0;
static s32 g_MenuBlurFb = -1;
static s32 g_MenuScreenFb = -1;
static bool g_MenuBlurDone = false;
#endif

Expand Down Expand Up @@ -124,8 +125,9 @@ void menugfxCreateBlur(void)

g_ScaleX = 1;
#else
if (g_MenuBlurFb == 0) {
if (g_MenuBlurFb < 0) {
g_MenuBlurFb = videoCreateFramebuffer(BLURIMG_WIDTH, BLURIMG_HEIGHT, true, false);
g_MenuScreenFb = videoCreateFramebuffer(0, 0, false, true);
}
// copy full viewport and downscale to 40x30
videoCopyFramebuffer(g_MenuBlurFb, 0, -1, -1);
Expand All @@ -151,14 +153,13 @@ Gfx *menugfxRenderBgBlur(Gfx *gdl, u32 colour, s16 arg2, s16 arg3)
#ifndef PLATFORM_N64
width = viGetWidth();
height = viGetHeight();
if (g_MenuBlurFb && !g_MenuBlurDone) {
if (g_MenuBlurFb >= 0 && !g_MenuBlurDone) {
// blit the small blur texture onto a screen-sized framebuffer while blurring it
g_MenuBlurDone = true;
g_BlurFbDirty = true;
gdl = bviewPrepareStaticRgba16(gdl, 0xffffffff, 0xff);
gDPSetTextureFilter(gdl++, G_TF_BLUR_EXT);
gDPSetFramebufferTextureEXT(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, BLURIMG_WIDTH, g_MenuBlurFb);
gDPSetFramebufferTargetEXT(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, g_BlurFb);
gDPSetFramebufferTargetEXT(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, g_MenuScreenFb);
gSPImageRectangleEXT(gdl++, 0, 0, 0, 0, width << 2, height << 2, BLURIMG_WIDTH, BLURIMG_HEIGHT, 0, BLURIMG_WIDTH, BLURIMG_HEIGHT);
gDPSetFramebufferTargetEXT(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, 0);
gDPSetFramebufferTextureEXT(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, BLURIMG_WIDTH, 0);
Expand All @@ -177,7 +178,7 @@ Gfx *menugfxRenderBgBlur(Gfx *gdl, u32 colour, s16 arg2, s16 arg3)

#ifndef PLATFORM_N64
// LoadTextureBlock will set up the sizes, but we'll use the framebuffer instead of g_BlurBuffer
gDPSetFramebufferTextureEXT(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, g_BlurFb);
gDPSetFramebufferTextureEXT(gdl++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, g_MenuScreenFb);
#endif

gDPPipeSync(gdl++);
Expand Down

0 comments on commit 26c24d6

Please sign in to comment.