Skip to content

Commit

Permalink
custom changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TwelveEyes committed Jun 9, 2024
1 parent 7b9dfe7 commit 808d642
Show file tree
Hide file tree
Showing 38 changed files with 1,635 additions and 136 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ jobs:
shell: bash
run: cmake --build . --config ${{ matrix.build_type }} -j $NUMBER_OF_PROCESSORS

- name: Copy PK3s
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}
shell: bash
run: |
mkdir -p ./build/bin/JediAcademy/base/
cp ./pk3/assets_fpls.pk3 ./build/bin/JediAcademy/base/
- name: Install
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/build
Expand Down Expand Up @@ -137,6 +145,12 @@ jobs:
shell: bash
run: cmake --install .

- name: Copy PK3s
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}
shell: bash
run: cp ./pk3/assets_fpls.pk3 ./install/JediAcademy/base/

- name: Create OpenJK binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
Expand Down Expand Up @@ -210,6 +224,14 @@ jobs:
shell: bash
run: cmake --install .

- name: Copy PK3s
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}
shell: bash
run: |
mkdir -p ./install/JediAcademy/openjk_sp.${{ matrix.arch }}.app/Contents/MacOS/base/
cp ./pk3/assets_fpls.pk3 ./install/JediAcademy/openjk_sp.${{ matrix.arch }}.app/Contents/MacOS/base/
- name: Create OpenJK binary archive
if: ${{ matrix.build_type == 'Release' }}
working-directory: ${{ github.workspace }}/install/JediAcademy
Expand Down
22 changes: 21 additions & 1 deletion code/cgame/cg_consolecmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void CG_ToggleBinoculars( void )
cg.zoomMode = 1;
cg.zoomLocked = qfalse;

if ( cg.weaponSelect == WP_SABER )
if ( cg.weaponSelect == WP_SABER || cg.weaponSelect == WP_MELEE )
{
cg.weaponSelect = WP_NONE;
}
Expand Down Expand Up @@ -151,6 +151,10 @@ void CG_ToggleBinoculars( void )
// FIXME: this is pretty damn ugly but whatever
cg.weaponSelect = WP_SABER;
}
else if( cg.weaponSelect == WP_NONE && cg.snap->ps.stats[STAT_WEAPONS] & ( 1 << WP_MELEE ) )
{
cg.weaponSelect = WP_MELEE;
}
}
}

Expand All @@ -177,6 +181,12 @@ void CG_ToggleLAGoggles( void )

cg.zoomMode = 3;
cg.zoomLocked = qfalse;

if ( cg.weaponSelect == WP_SABER || cg.weaponSelect == WP_MELEE )
{
cg.weaponSelect = WP_NONE;
}

if ( cg.overrides.active & CG_OVERRIDE_FOV )
{
cg_zoomFov = cg.overrides.fov;
Expand All @@ -193,6 +203,16 @@ void CG_ToggleLAGoggles( void )
cg.zoomMode = 0;
cg.zoomTime = cg.time;
cgi_S_StartSound( NULL, cg.snap->ps.clientNum, CHAN_AUTO, cgs.media.zoomEnd );

if( cg.weaponSelect == WP_NONE && cg.snap->ps.stats[STAT_WEAPONS] & ( 1 << WP_SABER ) )
{
// FIXME: this is pretty damn ugly but whatever
cg.weaponSelect = WP_SABER;
}
else if( cg.weaponSelect == WP_NONE && cg.snap->ps.stats[STAT_WEAPONS] & ( 1 << WP_MELEE ) )
{
cg.weaponSelect = WP_MELEE;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion code/cgame/cg_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ static void CG_DrawAmmo(const centity_t *cent,const int xPos,const int yPos)
return;
}

if ( cent->currentState.weapon == WP_STUN_BATON )
if ( cent->currentState.weapon == WP_STUN_BATON || cent->currentState.weapon == WP_MELEE )
{
return;
}
Expand Down
1 change: 1 addition & 0 deletions code/cgame/cg_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ extern vmCvar_t cg_thirdPersonPitchOffset;
extern vmCvar_t cg_thirdPersonVertOffset;
extern vmCvar_t cg_thirdPersonCameraDamp;
extern vmCvar_t cg_thirdPersonTargetDamp;
// extern vmCvar_t cg_saberAutoThird;
extern vmCvar_t cg_gunAutoFirst;

extern vmCvar_t cg_stereoSeparation;
Expand Down
6 changes: 4 additions & 2 deletions code/cgame/cg_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ vmCvar_t cg_thirdPersonPitchOffset;
vmCvar_t cg_thirdPersonVertOffset;
vmCvar_t cg_thirdPersonCameraDamp;
vmCvar_t cg_thirdPersonTargetDamp;
// vmCvar_t cg_saberAutoThird;
vmCvar_t cg_gunAutoFirst;

vmCvar_t cg_thirdPersonAlpha;
Expand Down Expand Up @@ -352,7 +353,7 @@ static cvarTable_t cvarTable[] = {
{ &cg_autoswitch, "cg_autoswitch", "1", CVAR_ARCHIVE },
{ &cg_drawGun, "cg_drawGun", "1", CVAR_ARCHIVE },
{ &cg_fov, "cg_fov", "80", CVAR_ARCHIVE },
{ &cg_fovAspectAdjust, "cg_fovAspectAdjust", "0", CVAR_ARCHIVE },
{ &cg_fovAspectAdjust, "cg_fovAspectAdjust", "1", CVAR_ARCHIVE },
{ &cg_stereoSeparation, "cg_stereoSeparation", "0.4", CVAR_ARCHIVE },
{ &cg_shadows, "cg_shadows", "1", CVAR_ARCHIVE },
{ &cg_renderToTextureFX, "cg_renderToTextureFX", "1", CVAR_ARCHIVE },
Expand Down Expand Up @@ -424,6 +425,7 @@ static cvarTable_t cvarTable[] = {
{ &cg_thirdPersonAlpha, "cg_thirdPersonAlpha", "1.0", CVAR_ARCHIVE },
{ &cg_thirdPersonAutoAlpha, "cg_thirdPersonAutoAlpha", "0", 0 },
// NOTE: also declare this in UI_Init
// { &cg_saberAutoThird, "cg_saberAutoThird", "1", CVAR_ARCHIVE },
{ &cg_gunAutoFirst, "cg_gunAutoFirst", "1", CVAR_ARCHIVE },

{ &cg_pano, "pano", "0", 0 },
Expand Down Expand Up @@ -1368,7 +1370,7 @@ static void CG_RegisterGraphics( void ) {
// FIXME: do these conditionally
cgi_R_RegisterShader( "gfx/2d/workingCamera" );
cgi_R_RegisterShader( "gfx/2d/brokenCamera" );
//cgi_R_RegisterShader( "gfx/effects/irid_shield" ); // for galak, but he doesn't have his own weapon so I can't register the shader there.
cgi_R_RegisterShader( "gfx/effects/irid_shield" ); // for galak, but he doesn't have his own weapon so I can't register the shader there.

//interface
for ( i = 0 ; i < NUM_CROSSHAIRS ; i++ ) {
Expand Down
20 changes: 16 additions & 4 deletions code/cgame/cg_players.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4793,7 +4793,8 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, centity_t *cen
&& (gent->client->ps.forcePowersActive & (1 << FP_SPEED) //in force speed
|| cent->gent->client->ps.legsAnim == BOTH_FORCELONGLEAP_START//or force long jump - FIXME: only 1st half of that anim?
|| cent->gent->client->ps.legsAnim == BOTH_FORCELONGLEAP_ATTACK )//or force long jump attack
&& (gent->s.number || cg.renderingThirdPerson) ) // looks dumb doing this with first peron mode on
&& (gent->s.number || cg.renderingThirdPerson) // looks dumb doing this with first peron mode on
&& level.time % 2000 == 0 ) //limit how often we do this to avoid model rendering overload
{
//FIXME: debounce this
localEntity_t *ex;
Expand Down Expand Up @@ -4855,7 +4856,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, centity_t *cen
//------------------------------------------------------
if ( powerups & ( 1 << PW_GALAK_SHIELD ))
{
/* refEntity_t tent;
refEntity_t tent;

memset( &tent, 0, sizeof( refEntity_t ));

Expand All @@ -4882,7 +4883,7 @@ void CG_AddRefEntityWithPowerups( refEntity_t *ent, int powerups, centity_t *cen
tent.endTime = gent->fx_time + 1000; // if you want the shell to build around the guy, pass in a time that is 1000ms after the start of the turn-on-effect
tent.customShader = cgi_R_RegisterShader( "gfx/effects/irid_shield" );

cgi_R_AddRefEntityToScene( &tent );*/
cgi_R_AddRefEntityToScene( &tent );
}

// Invincibility -- effect needs work
Expand Down Expand Up @@ -6838,7 +6839,7 @@ void CG_Player( centity_t *cent ) {
return;
}

if( cent->gent->s.number == 0 && cg.weaponSelect == WP_NONE && cg.zoomMode == 1 )
if( cent->gent->s.number == 0 && cg.weaponSelect == WP_NONE && (cg.zoomMode == 1 || cg.zoomMode == 3) )
{
// HACK
return;
Expand Down Expand Up @@ -7233,6 +7234,17 @@ extern vmCvar_t cg_thirdPersonAlpha;
}
}

/*if ( !cg.renderingThirdPerson
&& ( cg.snap->ps.weapon == WP_SABER || cg.snap->ps.weapon == WP_MELEE )
&& !cent->gent->s.number )
{// Yeah um, this needs to not do this quite this way
ent.customSkin = cgi_R_RegisterSkin( "models/players/kyle/model_fpls.skin" ); //precached in g_client.cpp
}
else
{
ent.customSkin = 0;
}*/

if ( cg_debugHealthBars.integer )
{
if ( cent->gent && cent->gent->health > 0 && cent->gent->max_health > 0 )
Expand Down
4 changes: 2 additions & 2 deletions code/cgame/cg_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static void CG_CalcIdealThirdPersonViewLocation(void)
VectorMA(cameraIdealTarget, -(cg_thirdPersonRange.value), camerafwd, cameraIdealLoc);
}

if ( cg.renderingThirdPerson && (cg.snap->ps.forcePowersActive&(1<<FP_SPEED)) && player->client->ps.forcePowerDuration[FP_SPEED] )
/*if ( cg.renderingThirdPerson && (cg.snap->ps.forcePowersActive&(1<<FP_SPEED)) && player->client->ps.forcePowerDuration[FP_SPEED] )
{
float timeLeft = player->client->ps.forcePowerDuration[FP_SPEED] - cg.time;
float length = FORCE_SPEED_DURATION*forceSpeedValue[player->client->ps.forcePowerLevel[FP_SPEED]];
Expand All @@ -480,7 +480,7 @@ static void CG_CalcIdealThirdPersonViewLocation(void)
{
VectorMA(cameraIdealLoc, amt, camerafwd, cameraIdealLoc);
}
}
}*/
}


Expand Down
6 changes: 3 additions & 3 deletions code/client/snd_dma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4805,14 +4805,14 @@ static qboolean S_UpdateBackgroundTrack_Actual( MusicInfo_t *pMusicInfo, qboolea
// or if it's a dynamic music specifier (which can't literally exist), in which case it should set
// a return flag then exit...
//
char sTestName[MAX_QPATH*2];// *2 so COM_DefaultExtension doesn't do an ERR_DROP if there was no space
char sTestName[MAX_QPATH/**2*/];// *2 so COM_DefaultExtension doesn't do an ERR_DROP if there was no space
// for an extension, since this is a "soft" test
Q_strncpyz( sTestName, sMusic_BackgroundLoop, sizeof(sTestName));
Q_strncpyz( sTestName, sMusic_BackgroundLoop, sizeof(sTestName) - 4 );
COM_DefaultExtension(sTestName, sizeof(sTestName), ".mp3");

if (S_FileExists( sTestName ))
{
S_StartBackgroundTrack_Actual( pMusicInfo, qfalse, sMusic_BackgroundLoop, sMusic_BackgroundLoop );
S_StartBackgroundTrack_Actual( pMusicInfo, qfalse, sTestName, sTestName );
}
else
{
Expand Down
Loading

0 comments on commit 808d642

Please sign in to comment.