Skip to content

Commit

Permalink
various fixes
Browse files Browse the repository at this point in the history
git-svn-id: https://erampage.googlecode.com/svn/trunk@31 e01cb666-db7f-11de-9872-ef835a306e00
  • Loading branch information
grigoriev.dmitriy committed May 11, 2010
1 parent b356b0c commit 174f059
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 35 deletions.
3 changes: 2 additions & 1 deletion build/src/engine.c
Expand Up @@ -47,14 +47,15 @@ void *kmalloc(bsize_t size) { return(Bmalloc(size)); }
void kfree(void *buffer) { Bfree(buffer); }
#define kkfree kfree

int32_t editorgridextent = 131072; //!
#ifdef SUPERBUILD
void loadvoxel(int32_t voxindex) { voxindex=0; }
int32_t tiletovox[MAXTILES];
int32_t usevoxels = 1;
#define kloadvoxel loadvoxel

int32_t novoxmips = 0;
int32_t editorgridextent = 131072;
//! int32_t editorgridextent = 131072;

//These variables need to be copied into BUILD
#define MAXXSIZ 256
Expand Down
2 changes: 2 additions & 0 deletions build/src/polymost.c
Expand Up @@ -4717,6 +4717,7 @@ void polymost_drawsprite(int32_t snum)
if (mddraw(tspr)) return;
break; // else, render as flat sprite
}
#ifdef SUPERBUILD
if (usevoxels && (tspr->cstat&48)!=48 && tiletovox[tspr->picnum] >= 0 && voxmodels[ tiletovox[tspr->picnum] ])
{
if (voxdraw(voxmodels[ tiletovox[tspr->picnum] ], tspr)) return;
Expand All @@ -4727,6 +4728,7 @@ void polymost_drawsprite(int32_t snum)
voxdraw(voxmodels[ tspr->picnum ], tspr);
return;
}
#endif
break;
}
if (((tspr->cstat&2) || (gltexmayhavealpha(tspr->picnum,tspr->pal))))
Expand Down
58 changes: 44 additions & 14 deletions source/game.c
Expand Up @@ -4453,15 +4453,6 @@ int32_t A_Spawn(int32_t j, int32_t pn) {
}




if (sp->picnum == DOORLOCK) {
//sp->picnum = ACTIVATORLOCKED;
sp->lotag = (sp->lotag-1)%3; // 0-2
sp->hitag = 0;
}


if (sp->picnum == NUKEBUTTON) {
sp->picnum = LIGHTSWITCH;
sp->lotag = -1;
Expand Down Expand Up @@ -7334,7 +7325,7 @@ FOUNDCHEAT: {
return;

case CHEAT_KEYS:
g_player[myconnectindex].ps->got_access = 7;
g_player[myconnectindex].ps->got_access = 63;
KB_FlushKeyBoardQueue();
g_player[myconnectindex].ps->cheat_phase = 0;
P_DoQuote(121,g_player[myconnectindex].ps);
Expand Down Expand Up @@ -7464,7 +7455,7 @@ FOUNDCHEAT: {
weapon++)
P_AddAmmo(weapon, g_player[myconnectindex].ps, g_player[myconnectindex].ps->max_ammo_amount[weapon]);
G_CheatGetInv();
g_player[myconnectindex].ps->got_access = 7;
g_player[myconnectindex].ps->got_access = 63;
P_DoQuote(5,g_player[myconnectindex].ps);
g_player[myconnectindex].ps->cheat_phase = 0;

Expand Down Expand Up @@ -7576,7 +7567,7 @@ FOUNDCHEAT: {

case CHEAT_ITEMS:
G_CheatGetInv();
g_player[myconnectindex].ps->got_access = 7;
g_player[myconnectindex].ps->got_access = 63;
P_DoQuote(5,g_player[myconnectindex].ps);
g_player[myconnectindex].ps->cheat_phase = 0;
KB_FlushKeyBoardQueue();
Expand Down Expand Up @@ -12229,7 +12220,44 @@ void G_BonusScreen(int32_t bonusonly) {
break;
}*/

rotatesprite(0,0,65536L,0,BONUSSCREEN+gfx_offset,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1);

if (GAME_RA) {
char anm_name[32];
sprintf(anm_name, "LVL%d.ANM",ud.last_level+ud.volume_number*7);
flushperms();
setview(0,0,xdim-1,ydim-1);
clearview(0L);
nextpage();


G_PlayAnim(anm_name,ud.last_level+ud.volume_number*7);

#define E2L7 283
#define E2L6 255
#define E2L5 230
#define E2L4 198
#define E2L3 177
#define E2L2 176
#define E2L1 105
#define E1L7 104
#define E1L6 103
#define E1L5 102
#define E1L4 80
#define E1L3 77
#define E1L2 64
#define E1L1 63


//switch(ud.last_level+ud.volume_number*10) {
// case 1:
// S_PlaySound(E1L1);
// break;
//}
//clearview(0L);
//nextpage();

//FX_StopAllSounds();
} else rotatesprite(0,0,65536L,0,BONUSSCREEN+gfx_offset,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1);

menutext(160,20-6,0,0,lastmapname);
menutext(160,36-6,0,0,"COMPLETED");
Expand Down Expand Up @@ -12279,7 +12307,9 @@ void G_BonusScreen(int32_t bonusonly) {
AudioUpdate();

if (g_player[myconnectindex].ps->gm&MODE_EOL) {
rotatesprite(0,0,65536L,0,BONUSSCREEN+gfx_offset,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1);


if (totalclock > 200) rotatesprite(0,0,65536L,0,BONUSSCREEN+gfx_offset,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1);

if (totalclock > (1000000000L) && totalclock < (1000000320L)) {
switch ((totalclock>>4)%15) {
Expand Down
14 changes: 7 additions & 7 deletions source/gameexec.c
Expand Up @@ -2769,16 +2769,16 @@ static int32_t X_DoExecute(void) {
case GET_ACCESS:
switch (vm.g_sp->pal) {
case 0:
g_player[vm.g_p].ps->got_access |= 1;
g_player[vm.g_p].ps->got_access |= 8;
break;
case 21:
g_player[vm.g_p].ps->got_access |= 2;
g_player[vm.g_p].ps->got_access |= 16;
break;
case 23:
g_player[vm.g_p].ps->got_access |= 4;
g_player[vm.g_p].ps->got_access |= 32;
break;
}
g_player[vm.g_p].ps->got_access |= (1 << (vm.g_sp->lotag-100+3));
g_player[vm.g_p].ps->got_access |= (1 << (vm.g_sp->lotag-100));
//OSD_Printf("got key %d\n", g_player[vm.g_p].ps->got_access);
break;

Expand Down Expand Up @@ -4166,13 +4166,13 @@ static int32_t X_DoExecute(void) {
case GET_ACCESS:
switch (vm.g_sp->pal) {
case 0:
if (g_player[vm.g_p].ps->got_access&1) j = 1;
if (g_player[vm.g_p].ps->got_access&8) j = 1;
break;
case 21:
if (g_player[vm.g_p].ps->got_access&2) j = 1;
if (g_player[vm.g_p].ps->got_access&16) j = 1;
break;
case 23:
if (g_player[vm.g_p].ps->got_access&4) j = 1;
if (g_player[vm.g_p].ps->got_access&32) j = 1;
break;
}
j = 0;
Expand Down
10 changes: 8 additions & 2 deletions source/player.c
Expand Up @@ -1912,8 +1912,8 @@ void P_FireWeapon(DukePlayer_t *p) {
p->ammo_amount[p->curr_weapon]--;



if (p->curr_weapon==CROSSBOW_WEAPON) p->ammo_amount[DYNAMITE_WEAPON]--;
if (p->curr_weapon==CROSSBOW_WEAPON)
p->ammo_amount[DYNAMITE_WEAPON] = p->ammo_amount[CROSSBOW_WEAPON];


if (aplWeaponFireSound[p->curr_weapon][snum]) {
Expand Down Expand Up @@ -3371,6 +3371,10 @@ void P_AddAmmo(int32_t weapon,DukePlayer_t *p,int32_t amount) {

if (p->ammo_amount[weapon] > p->max_ammo_amount[weapon])
p->ammo_amount[weapon] = p->max_ammo_amount[weapon];


if (weapon == DYNAMITE_WEAPON) p->ammo_amount[CROSSBOW_WEAPON] = p->ammo_amount[DYNAMITE_WEAPON];
else if (weapon == CROSSBOW_WEAPON) p->ammo_amount[DYNAMITE_WEAPON] = p->ammo_amount[CROSSBOW_WEAPON];
}

void P_AddWeaponNoSwitch(DukePlayer_t *p, int32_t weapon) {
Expand Down Expand Up @@ -4999,7 +5003,9 @@ void P_ProcessInput(int32_t snum) {
if ((*kb)==aplWeaponHoldDelay[p->curr_weapon][snum]) {
int32_t lPipeBombControl;


p->ammo_amount[p->curr_weapon]--;
p->ammo_amount[CROSSBOW_WEAPON] = p->ammo_amount[DYNAMITE_WEAPON];

if (p->on_ground && TEST_SYNC_KEY(sb_snum, SK_CROUCH)) {
k = 15;
Expand Down
23 changes: 17 additions & 6 deletions source/premap.c
Expand Up @@ -620,7 +620,7 @@ static void P_ResetStatus(int32_t snum) {
p->toggle_key_flag = 0;
p->access_spritenum = -1;
if (ud.multimode > 1 && (GametypeFlags[ud.coop] & GAMETYPE_ACCESSATSTART))
p->got_access = 7;
p->got_access = 63;
else p->got_access = 0;
p->random_club_frame= 0;
pus = 1;
Expand Down Expand Up @@ -672,6 +672,15 @@ static void P_ResetStatus(int32_t snum) {

p->movement_lock = 0;


p->redneck_gut = p->redneck_alcohol = p->redneck_counter = 0;
if (p->curr_weapon == MOTORCYCLE_WEAPON || p->curr_weapon == BOAT_WEAPON)
p->curr_weapon = CROWBAR_WEAPON;
p->gotweapon[MOTORCYCLE_WEAPON] = 0;
//p->ammo_amount[MOTORCYCLE_WEAPON] = 0;
p->gotweapon[BOAT_WEAPON] = 0;
//p->ammo_amount[BOAT_WEAPON] = 0;

P_UpdateScreenPal(p);
X_OnEvent(EVENT_RESETPLAYER, p->i, snum, -1);
}
Expand Down Expand Up @@ -1136,25 +1145,27 @@ void G_NewGame(int32_t vn,int32_t ln,int32_t sk) {
if (ud.m_recstat != 2 && ud.last_level >= 0 && ud.multimode > 1 && (ud.coop&GAMETYPE_SCORESHEET))
G_BonusScreen(1);

if (ln == 0 && vn == 3 && ud.multimode < 2 && ud.lockout == 0) {

/*if (ln == 0 && vn == 0 && ud.multimode < 2 && ud.lockout == 0)
{
S_PlayMusic(&EnvMusicFilename[1][0],MAXVOLUMES*MAXLEVELS+1);
flushperms();
setview(0,0,xdim-1,ydim-1);
clearview(0L);
nextpage();
G_PlayAnim("vol41a.anm",6);
G_PlayAnim("RR_INTRO.anm",6);
clearview(0L);
nextpage();
G_PlayAnim("vol42a.anm",7);
G_PlayAnim("vol43a.anm",9);
G_PlayAnim("RR_OUTRO.anm",7);
G_PlayAnim("TURDMOV.anm",9);
clearview(0L);
nextpage();
FX_StopAllSounds();
}
}*/

g_showShareware = GAMETICSPERSEC*34;

Expand Down
10 changes: 5 additions & 5 deletions source/sector.c
Expand Up @@ -1047,19 +1047,19 @@ int32_t P_ActivateSwitch(int32_t snum,int32_t w,int32_t switchtype) {
case ACCESSSWITCH2__STATIC:
if (g_player[snum].ps->access_incs == 0) {
if (switchpal == 0) {
if ((g_player[snum].ps->got_access&1))
if ((g_player[snum].ps->got_access&8))
g_player[snum].ps->access_incs = 1;
else P_DoQuote(70,g_player[snum].ps);
}

else if (switchpal == 21) {
if (g_player[snum].ps->got_access&2)
if (g_player[snum].ps->got_access&16)
g_player[snum].ps->access_incs = 1;
else P_DoQuote(71,g_player[snum].ps);
}

else if (switchpal == 23) {
if (g_player[snum].ps->got_access&4)
if (g_player[snum].ps->got_access&32)
g_player[snum].ps->access_incs = 1;
else P_DoQuote(72,g_player[snum].ps);
}
Expand Down Expand Up @@ -2974,8 +2974,8 @@ void P_CheckSectors(int32_t snum) {
sj = nextspritesect[sj];
}
if (sj > 0) {
//OSD_Printf("keycheck %d against %d\n",p->got_access, (1 << (sprite[sj].lotag+3)));
if (!(p->got_access & (1 << (sprite[sj].lotag+3)))) {
//OSD_Printf("keycheck %d against %d\n",p->got_access, (1 << (sprite[sj].lotag)));
if (!(p->got_access & (1 << (sprite[sj].lotag-1)%3))) {
P_DoQuote(41,p);
return;
} else sector[neartagsector].lotag = sector[neartagsector].lotag^16384;
Expand Down

0 comments on commit 174f059

Please sign in to comment.