mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-04 11:10:48 +00:00
Update to ZDoom r1643
- Added Hirogen2's unlimited pickup patch. - Added railgun performance customization CVARs by Spleen. - Added aspect ratio override submission by SoulPriestess. - Added a 'resetinventory' MAPINFO option. - Added MF6_NOFEAR flag. - Added A_MonsterRefire(probability, jumptarget). - Added A_JumpIfTargetInSight(state) action function. - Changed: Puffs set their angle to face the originator of the attack. - Strife's burning hands originally make the level view fullbright. changed in ZDoom to do partial brightening. - Added support for horizontal mouse wheels, and set invprev/invnext as default bindings for it. This is Vista only. DirectInput mouse (in_mouse 2) does not support it, because the DirectInput mouse device does not expose this control. - Added a label for the F16 key and mapped the kp= key on a Mac keyboard to the PC98 equivalent so it will be identified as kp=. (Interestingly, F13- F16 and kp= only generate events when using Raw Input, not when using DirectInput. - Added MF6_FORCEPAIN flag that forces the target to go into the pain state regardless of pain chance. - Changed screenblocks CVAR to be settable per game. - Added SpawnSpotForced and SpawnSpotFacingForced ACS functions. - Added pushfactor actor property. - Added Gez's GetArmorType submission git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@339 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
0225657584
commit
c2d1121663
35 changed files with 356 additions and 79 deletions
|
@ -1,4 +1,69 @@
|
|||
May 27, 2009
|
||||
June 6, 2009 (Changes by Graf Zahl)
|
||||
- Added Hirogen2's unlimited pickup patch.
|
||||
- Added railgun performance customization CVARs by Spleen.
|
||||
- Added aspect ratio override submission by SoulPriestess.
|
||||
- Added a 'resetinventory' MAPINFO option.
|
||||
- Added MF6_NOFEAR flag.
|
||||
- Added A_MonsterRefire(probability, jumptarget).
|
||||
- Added A_JumpIfTargetInSight(state) action function.
|
||||
- Changed: Puffs set their angle to face the originator of the attack.
|
||||
- Strife's burning hands originally make the level view fullbright.
|
||||
changed in ZDoom to do partial brightening.
|
||||
|
||||
June 5, 2009
|
||||
- Added support for horizontal mouse wheels, and set invprev/invnext as
|
||||
default bindings for it. This is Vista only. DirectInput mouse (in_mouse 2)
|
||||
does not support it, because the DirectInput mouse device does not expose
|
||||
this control.
|
||||
- Added a label for the F16 key and mapped the kp= key on a Mac keyboard to
|
||||
the PC98 equivalent so it will be identified as kp=. (Interestingly, F13-
|
||||
F16 and kp= only generate events when using Raw Input, not when using
|
||||
DirectInput.
|
||||
|
||||
June 5, 2009 (Changes by Graf Zahl)
|
||||
- Added MF6_FORCEPAIN flag that forces the target to go into the pain state
|
||||
regardless of pain chance.
|
||||
- Changed screenblocks CVAR to be settable per game.
|
||||
- Added SpawnSpotForced and SpawnSpotFacingForced ACS functions.
|
||||
- Added pushfactor actor property.
|
||||
- Added Gez's GetArmorType submission
|
||||
|
||||
June 2, 2009
|
||||
- Swapped snes_spc out for the full Game Music Emu library.
|
||||
|
||||
June 2, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: The Hexen status bar still uses MAX_MANA for some calculations instead
|
||||
of MaxAmount.
|
||||
|
||||
June 1, 2009 (Changes by Graf Zahl)
|
||||
- Added Blzut3's submission for displaying underwater stats in SBARINFO.
|
||||
|
||||
May 31, 2009 (Changes by Graf Zahl)
|
||||
- Added Gez's AMMO_CHECKBOTH submission.
|
||||
- Added Gez's THRUSPECIES submission.
|
||||
- Added loading directories into the lump directory.
|
||||
- fixed: The Dehacked parser could not parse flag values with the highest bit
|
||||
set because it used atoi to convert the string into a number.
|
||||
- fixed: bouncing sounds were limited to inventory items.
|
||||
|
||||
May 30, 2009 (Changes by Graf Zahl)
|
||||
- Rewrote IWAD detection code to use the ResourceFile classes instead of
|
||||
reading the WAD directory directly. As a side effect it should now be
|
||||
possible to use Zip and 7z for IWADs, too.
|
||||
- Added 'EndTitle' nextmap option which goes to the regular title loop after
|
||||
the game has finished.
|
||||
- Added NOBOSSRIP flag. Note: we are now at flags6!
|
||||
- Added SetSkyScrollSpeed(int skyplane, fixed speed) ACS function.
|
||||
- Added THRUACTORS flag that disables all actor<->actor collision detection.
|
||||
- Added DONTSEEKINVISIBLE flag for missiles that can't home in on invisible
|
||||
targets.
|
||||
- Added SFX_TRANSFERPITCH flag to A_SpawnItemEx.
|
||||
- Added Ultimate Freedoom IWAD detection.
|
||||
- Added GetAirSupply and SetAirSupply functions to ACS.
|
||||
- Fixed: The *surface sound was not played when drowning was switched off
|
||||
by setting the level's air supply to 0.
|
||||
|
||||
May 27, 2009
|
||||
- Fixed: The mouse wheel generated no events in GUI mode if you weren't
|
||||
fullscreen. (e.g. You could no longer scroll the console with the mouse
|
||||
buffer.)
|
||||
|
|
|
@ -308,6 +308,8 @@ enum
|
|||
MF6_NOBOSSRIP = 0x00000001, // For rippermissiles: Don't rip through bosses.
|
||||
MF6_THRUSPECIES = 0x00000002, // Actors passes through other of the same species.
|
||||
MF6_MTHRUSPECIES = 0x00000004, // Missile passes through actors of its shooter's species.
|
||||
MF6_FORCEPAIN = 0x00000008, // forces target into painstate (unless it has the NOPAIN flag)
|
||||
MF6_NOFEAR = 0x00000010, // Not scared of frightening players
|
||||
|
||||
|
||||
// --- mobj.renderflags ---
|
||||
|
@ -737,6 +739,7 @@ public:
|
|||
int bouncecount; // Strife's grenades only bounce twice before exploding
|
||||
fixed_t gravity; // [GRB] Gravity factor
|
||||
int FastChaseStrafeCount;
|
||||
fixed_t pushfactor;
|
||||
|
||||
AActor *BlockingMobj; // Actor that blocked the last move
|
||||
line_t *BlockingLine; // Line that blocked the last move
|
||||
|
|
|
@ -70,6 +70,8 @@ static const FBinding DefBindings[] =
|
|||
{ "0", "slot 0" },
|
||||
{ "[", "invprev" },
|
||||
{ "]", "invnext" },
|
||||
{ "mwheelleft", "invprev" },
|
||||
{ "mwheelright", "invnext" },
|
||||
{ "enter", "invuse" },
|
||||
{ "-", "sizedown" },
|
||||
{ "=", "sizeup" },
|
||||
|
@ -179,7 +181,7 @@ const char *KeyNames[NUM_KEYS] =
|
|||
"kp8", "kp9", "kp-", "kp4", "kp5", "kp6", "kp+", "kp1", //48
|
||||
"kp2", "kp3", "kp0", "kp.", NULL, NULL, "oem102", "f11", //50
|
||||
"f12", NULL, NULL, NULL, NULL, NULL, NULL, NULL, //58
|
||||
NULL, NULL, NULL, NULL, "f13", "f14", "f15", NULL, //60
|
||||
NULL, NULL, NULL, NULL, "f13", "f14", "f15", "f16", //60
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, //68
|
||||
"kana", NULL, NULL, "abnt_c1", NULL, NULL, NULL, NULL, //70
|
||||
NULL, "convert", NULL, "noconvert",NULL, "yen", "abnt_c2", NULL, //78
|
||||
|
@ -243,6 +245,7 @@ const char *KeyNames[NUM_KEYS] =
|
|||
"pov4up", "pov4right","pov4down", "pov4left", // Fourth POV hat
|
||||
|
||||
"mwheelup", "mwheeldown", // the mouse wheel
|
||||
"mwheelright", "mwheelleft",
|
||||
};
|
||||
|
||||
static FString Bindings[NUM_KEYS];
|
||||
|
|
|
@ -1428,11 +1428,11 @@ static bool C_HandleKey (event_t *ev, BYTE *buffer, int len)
|
|||
case EV_GUI_WheelDown:
|
||||
if (!(ev->data3 & GKM_SHIFT))
|
||||
{
|
||||
data1 = GK_PGDN + ev->subtype - EV_GUI_WheelDown;
|
||||
data1 = GK_PGDN + EV_GUI_WheelDown - ev->subtype;
|
||||
}
|
||||
else
|
||||
{
|
||||
data1 = GK_DOWN + ev->subtype - EV_GUI_WheelDown;
|
||||
data1 = GK_DOWN + EV_GUI_WheelDown - ev->subtype;
|
||||
}
|
||||
// Intentional fallthrough
|
||||
|
||||
|
|
|
@ -53,8 +53,10 @@ enum EGUIEvent
|
|||
EV_GUI_RButtonDown,
|
||||
EV_GUI_RButtonUp,
|
||||
EV_GUI_RButtonDblClick,
|
||||
EV_GUI_WheelDown, // data3: shift/ctrl/alt
|
||||
EV_GUI_WheelUp // data3: shift/ctrl/alt
|
||||
EV_GUI_WheelUp, // data3: shift/ctrl/alt
|
||||
EV_GUI_WheelDown, // "
|
||||
EV_GUI_WheelRight, // "
|
||||
EV_GUI_WheelLeft, // "
|
||||
};
|
||||
|
||||
enum GUIKeyModifiers
|
||||
|
|
|
@ -1740,7 +1740,6 @@ void D_DoomMain (void)
|
|||
if (Args->CheckParm ("-nomonsters")) flags |= DF_NO_MONSTERS;
|
||||
if (Args->CheckParm ("-respawn")) flags |= DF_MONSTERS_RESPAWN;
|
||||
if (Args->CheckParm ("-fast")) flags |= DF_FAST_MONSTERS;
|
||||
if (Args->CheckParm("-ulp")) sv_unlimited_pickup = true;
|
||||
|
||||
devparm = !!Args->CheckParm ("-devparm");
|
||||
|
||||
|
|
|
@ -167,8 +167,10 @@ enum ESkillLevels
|
|||
|
||||
#define KEY_MWHEELUP 0x198
|
||||
#define KEY_MWHEELDOWN 0x199
|
||||
#define KEY_MWHEELRIGHT 0x19A
|
||||
#define KEY_MWHEELLEFT 0x19B
|
||||
|
||||
#define NUM_KEYS 0x19A
|
||||
#define NUM_KEYS 0x19C
|
||||
|
||||
#define JOYAXIS_NONE 0
|
||||
#define JOYAXIS_YAW 1
|
||||
|
|
|
@ -95,12 +95,18 @@ const BYTE *FManaBar::GetPixels ()
|
|||
|
||||
void FManaBar::SetVial (FTexture *pic, AActor *actor, const PClass *manaType)
|
||||
{
|
||||
int level;
|
||||
int level, max;
|
||||
AInventory *ammo;
|
||||
|
||||
ammo = actor->FindInventory (manaType);
|
||||
level = ammo != NULL ? ammo->Amount : 0;
|
||||
level = MIN (22*level/ammo->MaxAmount, 22);
|
||||
level = 0; max = 200;
|
||||
if (ammo != NULL)
|
||||
{
|
||||
level = ammo->Amount;
|
||||
max = ammo->MaxAmount;
|
||||
if (!max) max = 1;
|
||||
}
|
||||
level = MIN (22*level/max, 22);
|
||||
if (VialPic != pic || VialLevel != level)
|
||||
{
|
||||
VialPic = pic;
|
||||
|
|
|
@ -564,6 +564,8 @@ static bool g_nomonsters;
|
|||
void G_ChangeLevel(const char *levelname, int position, bool keepFacing, int nextSkill,
|
||||
bool nointermission, bool resetinv, bool nomonsters)
|
||||
{
|
||||
level_info_t *nextinfo = NULL;
|
||||
|
||||
if (unloading)
|
||||
{
|
||||
Printf (TEXTCOLOR_RED "Unloading scripts cannot exit the level again.\n");
|
||||
|
@ -574,7 +576,7 @@ void G_ChangeLevel(const char *levelname, int position, bool keepFacing, int nex
|
|||
|
||||
if (strncmp(levelname, "enDSeQ", 6))
|
||||
{
|
||||
level_info_t *nextinfo = FindLevelInfo (nextlevel)->CheckLevelRedirect ();
|
||||
nextinfo = FindLevelInfo (nextlevel)->CheckLevelRedirect ();
|
||||
if (nextinfo)
|
||||
{
|
||||
nextlevel = nextinfo->mapname;
|
||||
|
@ -588,13 +590,21 @@ void G_ChangeLevel(const char *levelname, int position, bool keepFacing, int nex
|
|||
if (nointermission) level.flags |= LEVEL_NOINTERMISSION;
|
||||
|
||||
cluster_info_t *thiscluster = FindClusterInfo (level.cluster);
|
||||
cluster_info_t *nextcluster = FindClusterInfo (FindLevelInfo (nextlevel)->cluster);
|
||||
cluster_info_t *nextcluster = nextinfo? FindClusterInfo (nextinfo->cluster) : NULL;
|
||||
|
||||
startpos = position;
|
||||
startkeepfacing = keepFacing;
|
||||
gameaction = ga_completed;
|
||||
resetinventory = resetinv;
|
||||
|
||||
if (nextinfo != NULL)
|
||||
{
|
||||
if (thiscluster != nextcluster || (thiscluster && !(thiscluster->flags & CLUSTER_HUB)))
|
||||
{
|
||||
resetinventory |= !!(nextinfo->flags2 & LEVEL2_RESETINVENTORY);
|
||||
}
|
||||
}
|
||||
|
||||
bglobal.End(); //Added by MC:
|
||||
|
||||
// [RH] Give scripts a chance to do something
|
||||
|
|
|
@ -198,6 +198,7 @@ enum ELevelFlags
|
|||
|
||||
LEVEL2_SMOOTHLIGHTING = 0x01000000, // Level uses the smooth lighting feature.
|
||||
LEVEL2_POLYGRIND = 0x02000000, // Polyobjects grind corpses to gibs.
|
||||
LEVEL2_RESETINVENTORY = 0x04000000, // Resets player inventory when starting this level (unless in a hub)
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -1316,6 +1316,7 @@ MapFlagHandlers[] =
|
|||
{ "nocheckswitchrange", MITYPE_CLRFLAG2, LEVEL2_CHECKSWITCHRANGE, 0 },
|
||||
{ "grinding_polyobj", MITYPE_SETFLAG2, LEVEL2_POLYGRIND, 0 },
|
||||
{ "no_grinding_polyobj", MITYPE_CLRFLAG2, LEVEL2_POLYGRIND, 0 },
|
||||
{ "resetinventory", MITYPE_SETFLAG2, LEVEL2_RESETINVENTORY, 0 },
|
||||
{ "unfreezesingleplayerconversations",MITYPE_SETFLAG2, LEVEL2_CONV_SINGLE_UNFREEZE, 0 },
|
||||
{ "nobotnodes", MITYPE_IGNORE, 0, 0 }, // Skulltag option: nobotnodes
|
||||
{ "compat_shorttex", MITYPE_COMPATFLAG, COMPATF_SHORTTEX},
|
||||
|
|
|
@ -22,7 +22,7 @@ IMPLEMENT_CLASS (AHexenArmor)
|
|||
void ABasicArmor::Serialize (FArchive &arc)
|
||||
{
|
||||
Super::Serialize (arc);
|
||||
arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount;
|
||||
arc << SavePercent << BonusCount << MaxAbsorb << MaxFullAbsorb << AbsorbCount << ArmorType;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -77,6 +77,7 @@ AInventory *ABasicArmor::CreateCopy (AActor *other)
|
|||
copy->MaxAmount = MaxAmount;
|
||||
copy->Icon = Icon;
|
||||
copy->BonusCount = BonusCount;
|
||||
copy->ArmorType = ArmorType;
|
||||
GoAwayAndDie ();
|
||||
return copy;
|
||||
}
|
||||
|
@ -237,6 +238,7 @@ bool ABasicArmorPickup::Use (bool pickup)
|
|||
armor->Icon = Icon;
|
||||
armor->MaxAbsorb = MaxAbsorb;
|
||||
armor->MaxFullAbsorb = MaxFullAbsorb;
|
||||
armor->ArmorType = this->GetClass()->TypeName;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -320,6 +322,7 @@ bool ABasicArmorBonus::Use (bool pickup)
|
|||
armor->Icon = Icon;
|
||||
armor->SavePercent = SavePercent;
|
||||
armor->MaxAbsorb = MaxAbsorb;
|
||||
armor->ArmorType = this->GetClass()->TypeName;
|
||||
armor->MaxFullAbsorb = MaxFullAbsorb;
|
||||
}
|
||||
|
||||
|
|
|
@ -328,37 +328,34 @@ DEFINE_ACTION_FUNCTION(AActor, A_RestoreSpecialPosition)
|
|||
_y = self->SpawnPoint[1];
|
||||
sec = P_PointInSector (_x, _y);
|
||||
|
||||
fixed_t floorz = sec->floorplane.ZatPoint (_x, _y);
|
||||
fixed_t ceilingz = sec->ceilingplane.ZatPoint (_x, _y);
|
||||
|
||||
self->SetOrigin (_x, _y, floorz);
|
||||
self->SetOrigin (_x, _y, sec->floorplane.ZatPoint (_x, _y));
|
||||
P_CheckPosition (self, _x, _y);
|
||||
|
||||
if (self->flags & MF_SPAWNCEILING)
|
||||
{
|
||||
self->z = ceilingz - self->height - self->SpawnPoint[2];
|
||||
self->z = self->ceilingz - self->height - self->SpawnPoint[2];
|
||||
}
|
||||
else if (self->flags2 & MF2_SPAWNFLOAT)
|
||||
{
|
||||
fixed_t space = ceilingz - self->height - floorz;
|
||||
fixed_t space = self->ceilingz - self->height - self->floorz;
|
||||
if (space > 48*FRACUNIT)
|
||||
{
|
||||
space -= 40*FRACUNIT;
|
||||
self->z = ((space * pr_restore())>>8) + floorz + 40*FRACUNIT;
|
||||
self->z = ((space * pr_restore())>>8) + self->floorz + 40*FRACUNIT;
|
||||
}
|
||||
else
|
||||
{
|
||||
self->z = floorz;
|
||||
self->z = self->floorz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
self->z = self->SpawnPoint[2] + floorz;
|
||||
self->z = self->SpawnPoint[2] + self->floorz;
|
||||
if (self->flags2 & MF2_FLOATBOB)
|
||||
{
|
||||
self->z += FloatBobOffsets[(self->FloatBobPhase + level.maptime) & 63];
|
||||
}
|
||||
}
|
||||
P_CheckPosition (self, _x, _y);
|
||||
}
|
||||
|
||||
int AInventory::StaticLastMessageTic;
|
||||
|
@ -516,10 +513,10 @@ bool AInventory::HandlePickup (AInventory *item)
|
|||
{
|
||||
if (item->GetClass() == GetClass())
|
||||
{
|
||||
if (Amount < MaxAmount)
|
||||
if (Amount < MaxAmount || sv_unlimited_pickup)
|
||||
{
|
||||
Amount += item->Amount;
|
||||
if (Amount > MaxAmount)
|
||||
if (Amount > MaxAmount && !sv_unlimited_pickup)
|
||||
{
|
||||
Amount = MaxAmount;
|
||||
}
|
||||
|
|
|
@ -379,6 +379,7 @@ public:
|
|||
int MaxAbsorb;
|
||||
int MaxFullAbsorb;
|
||||
int BonusCount;
|
||||
FNameNoInit ArmorType;
|
||||
};
|
||||
|
||||
// BasicArmorPickup replaces the armor you have.
|
||||
|
|
|
@ -674,6 +674,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_ItBurnsItBurns)
|
|||
self->player->ReadyWeapon = NULL;
|
||||
self->player->PendingWeapon = WP_NOCHANGE;
|
||||
self->player->playerstate = PST_LIVE;
|
||||
self->player->extralight = 3;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -705,6 +706,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_HandLower)
|
|||
{
|
||||
P_SetPsprite (self->player, ps_weapon, NULL);
|
||||
}
|
||||
if (self->player->extralight > 0) self->player->extralight--;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -80,6 +80,8 @@
|
|||
#include "cmdlib.h"
|
||||
#include "d_event.h"
|
||||
|
||||
#include "sbar.h"
|
||||
|
||||
// Data.
|
||||
#include "m_menu.h"
|
||||
|
||||
|
@ -117,6 +119,7 @@ EXTERN_CVAR (Int, crosshair)
|
|||
EXTERN_CVAR (Bool, freelook)
|
||||
EXTERN_CVAR (Int, sv_smartaim)
|
||||
EXTERN_CVAR (Int, am_colorset)
|
||||
EXTERN_CVAR (Int, vid_aspect)
|
||||
|
||||
static void CalcIndent (menu_t *menu);
|
||||
|
||||
|
@ -937,6 +940,14 @@ CUSTOM_CVAR (Int, menu_screenratios, 0, CVAR_ARCHIVE)
|
|||
}
|
||||
}
|
||||
|
||||
static value_t ForceRatios[] =
|
||||
{
|
||||
{ 0.0, "Off" },
|
||||
{ 3.0, "4:3" },
|
||||
{ 1.0, "16:9" },
|
||||
{ 2.0, "16:10" },
|
||||
{ 4.0, "5:4" }
|
||||
};
|
||||
static value_t Ratios[] =
|
||||
{
|
||||
{ 0.0, "4:3" },
|
||||
|
@ -958,6 +969,7 @@ static char VMTestText[] = "T to test mode for 5 seconds";
|
|||
|
||||
static menuitem_t ModesItems[] = {
|
||||
// { discrete, "Screen mode", {&DummyDepthCvar}, {0.0}, {0.0}, {0.0}, {Depths} },
|
||||
{ discrete, "Force aspect ratio", {&vid_aspect}, {5.0}, {0.0}, {0.0}, {ForceRatios} },
|
||||
{ discrete, "Aspect ratio", {&menu_screenratios}, {4.0}, {0.0}, {0.0}, {Ratios} },
|
||||
{ discrete, "Renderer", {&vid_renderer}, {2.0}, {0.0}, {0.0}, {Renderers} }, // [ZDoomGL]
|
||||
{ discrete, "Fullscreen", {&fullscreen}, {2.0}, {0.0}, {0.0}, {YesNo} },
|
||||
|
@ -981,9 +993,9 @@ static menuitem_t ModesItems[] = {
|
|||
|
||||
#define VM_DEPTHITEM 0
|
||||
#define VM_ASPECTITEM 0
|
||||
#define VM_RESSTART 5
|
||||
#define VM_ENTERLINE 15
|
||||
#define VM_TESTLINE 17
|
||||
#define VM_RESSTART 6
|
||||
#define VM_ENTERLINE 16
|
||||
#define VM_TESTLINE 18
|
||||
|
||||
menu_t ModesMenu =
|
||||
{
|
||||
|
@ -1010,6 +1022,11 @@ CUSTOM_CVAR (Bool, vid_tft, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
|||
menu_screenratios = 0;
|
||||
}
|
||||
}
|
||||
setsizeneeded = true;
|
||||
if (StatusBar != NULL)
|
||||
{
|
||||
StatusBar->ScreenSizeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
/*=======================================
|
||||
|
|
|
@ -101,6 +101,9 @@ xx(ArtiSuperHealth)
|
|||
xx(MedicalKit)
|
||||
xx(MedPatch)
|
||||
|
||||
// Armor
|
||||
xx(BasicArmor)
|
||||
|
||||
// The Wings of Wrath
|
||||
xx(ArtiFly)
|
||||
|
||||
|
|
|
@ -72,6 +72,8 @@
|
|||
#include "m_png.h"
|
||||
#include "p_setup.h"
|
||||
|
||||
#include "g_shared/a_pickups.h"
|
||||
|
||||
extern FILE *Logfile;
|
||||
|
||||
FRandom pr_acs ("ACS");
|
||||
|
@ -2228,7 +2230,7 @@ void DLevelScript::ReplaceTextures (int fromnamei, int tonamei, int flags)
|
|||
}
|
||||
}
|
||||
|
||||
int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle)
|
||||
int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle, bool force)
|
||||
{
|
||||
const PClass *info = PClass::FindClass (FBehavior::StaticLookupString (type));
|
||||
AActor *actor = NULL;
|
||||
|
@ -2241,7 +2243,7 @@ int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, i
|
|||
{
|
||||
DWORD oldFlags2 = actor->flags2;
|
||||
actor->flags2 |= MF2_PASSMOBJ;
|
||||
if (P_TestMobjLocation (actor))
|
||||
if (force || P_TestMobjLocation (actor))
|
||||
{
|
||||
actor->angle = angle << 24;
|
||||
actor->tid = tid;
|
||||
|
@ -2272,7 +2274,7 @@ int DLevelScript::DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, i
|
|||
return spawncount;
|
||||
}
|
||||
|
||||
int DLevelScript::DoSpawnSpot (int type, int spot, int tid, int angle)
|
||||
int DLevelScript::DoSpawnSpot (int type, int spot, int tid, int angle, bool force)
|
||||
{
|
||||
FActorIterator iterator (spot);
|
||||
AActor *aspot;
|
||||
|
@ -2280,12 +2282,12 @@ int DLevelScript::DoSpawnSpot (int type, int spot, int tid, int angle)
|
|||
|
||||
while ( (aspot = iterator.Next ()) )
|
||||
{
|
||||
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, angle);
|
||||
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, angle, force);
|
||||
}
|
||||
return spawned;
|
||||
}
|
||||
|
||||
int DLevelScript::DoSpawnSpotFacing (int type, int spot, int tid)
|
||||
int DLevelScript::DoSpawnSpotFacing (int type, int spot, int tid, bool force)
|
||||
{
|
||||
FActorIterator iterator (spot);
|
||||
AActor *aspot;
|
||||
|
@ -2293,7 +2295,7 @@ int DLevelScript::DoSpawnSpotFacing (int type, int spot, int tid)
|
|||
|
||||
while ( (aspot = iterator.Next ()) )
|
||||
{
|
||||
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, aspot->angle >> 24);
|
||||
spawned += DoSpawn (type, aspot->x, aspot->y, aspot->z, tid, aspot->angle >> 24, force);
|
||||
}
|
||||
return spawned;
|
||||
}
|
||||
|
@ -2799,6 +2801,9 @@ enum EACSFunctions
|
|||
ACSF_GetAirSupply,
|
||||
ACSF_SetAirSupply,
|
||||
ACSF_SetSkyScrollSpeed,
|
||||
ACSF_GetArmorType,
|
||||
ACSF_SpawnSpotForced,
|
||||
ACSF_SpawnSpotFacingForced,
|
||||
};
|
||||
|
||||
int DLevelScript::SideFromID(int id, int side)
|
||||
|
@ -2942,6 +2947,27 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
|
|||
return 1;
|
||||
}
|
||||
|
||||
case ACSF_GetArmorType:
|
||||
{
|
||||
if (args[1] < 0 || args[1] >= MAXPLAYERS || !playeringame[args[1]])
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
FName p(FBehavior::StaticLookupString(args[0]));
|
||||
ABasicArmor * armor = (ABasicArmor *) players[args[1]].mo->FindInventory(NAME_BasicArmor);
|
||||
if (armor->ArmorType == p) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
case ACSF_SpawnSpotForced:
|
||||
return DoSpawnSpot(args[0], args[1], args[2], args[3], true);
|
||||
|
||||
case ACSF_SpawnSpotFacingForced:
|
||||
return DoSpawnSpotFacing(args[0], args[1], args[2], true);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -4934,27 +4960,27 @@ int DLevelScript::RunScript ()
|
|||
break;
|
||||
|
||||
case PCD_SPAWN:
|
||||
STACK(6) = DoSpawn (STACK(6), STACK(5), STACK(4), STACK(3), STACK(2), STACK(1));
|
||||
STACK(6) = DoSpawn (STACK(6), STACK(5), STACK(4), STACK(3), STACK(2), STACK(1), false);
|
||||
sp -= 5;
|
||||
break;
|
||||
|
||||
case PCD_SPAWNDIRECT:
|
||||
PushToStack (DoSpawn (pc[0], pc[1], pc[2], pc[3], pc[4], pc[5]));
|
||||
PushToStack (DoSpawn (pc[0], pc[1], pc[2], pc[3], pc[4], pc[5], false));
|
||||
pc += 6;
|
||||
break;
|
||||
|
||||
case PCD_SPAWNSPOT:
|
||||
STACK(4) = DoSpawnSpot (STACK(4), STACK(3), STACK(2), STACK(1));
|
||||
STACK(4) = DoSpawnSpot (STACK(4), STACK(3), STACK(2), STACK(1), false);
|
||||
sp -= 3;
|
||||
break;
|
||||
|
||||
case PCD_SPAWNSPOTDIRECT:
|
||||
PushToStack (DoSpawnSpot (pc[0], pc[1], pc[2], pc[3]));
|
||||
PushToStack (DoSpawnSpot (pc[0], pc[1], pc[2], pc[3], false));
|
||||
pc += 4;
|
||||
break;
|
||||
|
||||
case PCD_SPAWNSPOTFACING:
|
||||
STACK(3) = DoSpawnSpotFacing (STACK(3), STACK(2), STACK(1));
|
||||
STACK(3) = DoSpawnSpotFacing (STACK(3), STACK(2), STACK(1), false);
|
||||
sp -= 2;
|
||||
break;
|
||||
|
||||
|
|
|
@ -712,9 +712,9 @@ protected:
|
|||
static int CountPlayers ();
|
||||
static void SetLineTexture (int lineid, int side, int position, int name);
|
||||
static void ReplaceTextures (int fromname, int toname, int flags);
|
||||
static int DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle);
|
||||
static int DoSpawnSpot (int type, int spot, int tid, int angle);
|
||||
static int DoSpawnSpotFacing (int type, int spot, int tid);
|
||||
static int DoSpawn (int type, fixed_t x, fixed_t y, fixed_t z, int tid, int angle, bool force);
|
||||
static int DoSpawnSpot (int type, int spot, int tid, int angle, bool forced);
|
||||
static int DoSpawnSpotFacing (int type, int spot, int tid, bool forced);
|
||||
int DoClassifyActor (int tid);
|
||||
int CallFunction(int argCount, int funcIndex, SDWORD *args);
|
||||
|
||||
|
|
|
@ -52,6 +52,9 @@
|
|||
#include "colormatcher.h"
|
||||
|
||||
CVAR (Int, cl_rockettrails, 1, CVAR_ARCHIVE);
|
||||
CVAR (Bool, r_rail_smartspiral, 0, CVAR_ARCHIVE);
|
||||
CVAR (Int, r_rail_spiralsparsity, 1, CVAR_ARCHIVE);
|
||||
CVAR (Int, r_rail_trailsparsity, 1, CVAR_ARCHIVE);
|
||||
|
||||
#define FADEFROMTTL(a) (255/(a))
|
||||
|
||||
|
@ -512,12 +515,15 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end
|
|||
step = dir * 3;
|
||||
|
||||
// Create the outer spiral.
|
||||
if (color1 != -1)
|
||||
if (color1 != -1 && (!r_rail_smartspiral || color2 == -1) && r_rail_spiralsparsity > 0)
|
||||
{
|
||||
FVector3 spiral_step = step * r_rail_spiralsparsity;
|
||||
int spiral_steps = steps * r_rail_spiralsparsity;
|
||||
|
||||
color1 = color1 == 0 ? -1 : ColorMatcher.Pick(RPART(color1), GPART(color1), BPART(color1));
|
||||
pos = start;
|
||||
deg = FAngle(270);
|
||||
for (i = steps; i; i--)
|
||||
for (i = spiral_steps; i; i--)
|
||||
{
|
||||
particle_t *p = NewParticle ();
|
||||
FVector3 tempvec;
|
||||
|
@ -538,8 +544,8 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end
|
|||
p->x = FLOAT2FIXED(tempvec.X);
|
||||
p->y = FLOAT2FIXED(tempvec.Y);
|
||||
p->z = FLOAT2FIXED(tempvec.Z);
|
||||
pos += step;
|
||||
deg += FAngle(14);
|
||||
pos += spiral_step;
|
||||
deg += FAngle(r_rail_spiralsparsity * 14);
|
||||
|
||||
if (color1 == -1)
|
||||
{
|
||||
|
@ -562,13 +568,16 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end
|
|||
}
|
||||
|
||||
// Create the inner trail.
|
||||
if (color2 != -1)
|
||||
if (color2 != -1 && r_rail_trailsparsity > 0)
|
||||
{
|
||||
FVector3 trail_step = step * r_rail_trailsparsity;
|
||||
int trail_steps = steps * r_rail_trailsparsity;
|
||||
|
||||
color2 = color2 == 0 ? -1 : ColorMatcher.Pick(RPART(color2), GPART(color2), BPART(color2));
|
||||
FVector3 diff(0, 0, 0);
|
||||
|
||||
pos = start;
|
||||
for (i = steps; i; i--)
|
||||
for (i = trail_steps; i; i--)
|
||||
{
|
||||
particle_t *p = JitterParticle (33);
|
||||
|
||||
|
@ -594,7 +603,7 @@ void P_DrawRailTrail (AActor *source, const FVector3 &start, const FVector3 &end
|
|||
p->z = FLOAT2FIXED(postmp.Z);
|
||||
if (color1 != -1)
|
||||
p->accz -= FRACUNIT/4096;
|
||||
pos += step;
|
||||
pos += trail_step;
|
||||
|
||||
if (color2 == -1)
|
||||
{
|
||||
|
|
|
@ -724,6 +724,8 @@ void P_NewChaseDir(AActor * actor)
|
|||
deltax = actor->target->x - actor->x;
|
||||
deltay = actor->target->y - actor->y;
|
||||
|
||||
if (!(actor->flags6 & MF6_NOFEAR))
|
||||
{
|
||||
if ((actor->target->player != NULL && (actor->target->player->cheats & CF_FRIGHTENING)) ||
|
||||
(actor->flags4 & MF4_FRIGHTENED))
|
||||
{
|
||||
|
@ -731,6 +733,7 @@ void P_NewChaseDir(AActor * actor)
|
|||
deltay = -deltay;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't abort if this happens.
|
||||
|
|
|
@ -1123,6 +1123,8 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
damage = newdam;
|
||||
if (damage <= 0)
|
||||
{
|
||||
// If MF&_FORCEPAIN is set make the player enter the pain state.
|
||||
if (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN)) goto dopain;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1254,8 +1256,10 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage
|
|||
}
|
||||
}
|
||||
|
||||
dopain:
|
||||
if (!(target->flags5 & MF5_NOPAIN) && (inflictor == NULL || !(inflictor->flags5 & MF5_PAINLESS)) &&
|
||||
(pr_damagemobj() < painchance) && !(target->flags & MF_SKULLFLY))
|
||||
(pr_damagemobj() < painchance || (inflictor != NULL && (inflictor->flags6 & MF6_FORCEPAIN))) &&
|
||||
!(target->flags & MF_SKULLFLY))
|
||||
{
|
||||
if (mod == NAME_Electric)
|
||||
{
|
||||
|
|
|
@ -1037,8 +1037,8 @@ bool PIT_CheckThing (AActor *thing, FCheckPosition &tm)
|
|||
if (thing->flags2 & MF2_PUSHABLE && !(tm.thing->flags2 & MF2_CANNOTPUSH) &&
|
||||
(tm.thing->player == NULL || !(tm.thing->player->cheats & CF_PREDICTING)))
|
||||
{ // Push thing
|
||||
thing->momx += tm.thing->momx >> 2;
|
||||
thing->momy += tm.thing->momy >> 2;
|
||||
thing->momx += FixedMul(tm.thing->momx, thing->pushfactor);
|
||||
thing->momy += FixedMul(tm.thing->momy, thing->pushfactor);
|
||||
}
|
||||
solid = (thing->flags & MF_SOLID) &&
|
||||
!(thing->flags & MF_NOCLIP) &&
|
||||
|
|
|
@ -4288,6 +4288,7 @@ AActor *P_SpawnPuff (AActor *source, const PClass *pufftype, fixed_t x, fixed_t
|
|||
|
||||
puff = Spawn (pufftype, x, y, z, ALLOW_REPLACE);
|
||||
if (puff == NULL) return NULL;
|
||||
if (source != NULL) puff->angle = R_PointToAngle2(x, y, source->x, source->y);
|
||||
|
||||
// If a puff has a crash state and an actor was not hit,
|
||||
// it will enter the crash state. This is used by the StrifeSpark
|
||||
|
|
|
@ -694,7 +694,7 @@ void R_ExecuteSetViewSize ()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
CUSTOM_CVAR (Int, screenblocks, 10, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
|
||||
CUSTOM_CVAR (Int, screenblocks, 10, CVAR_ARCHIVE)
|
||||
{
|
||||
if (self > 12)
|
||||
self = 12;
|
||||
|
|
|
@ -3,5 +3,5 @@
|
|||
// This file was automatically generated by the
|
||||
// updaterevision tool. Do not edit by hand.
|
||||
|
||||
#define ZD_SVN_REVISION_STRING "1631"
|
||||
#define ZD_SVN_REVISION_NUMBER 1631
|
||||
#define ZD_SVN_REVISION_STRING "1643"
|
||||
#define ZD_SVN_REVISION_NUMBER 1643
|
||||
|
|
|
@ -80,6 +80,7 @@ static FRandom pr_crailgun ("CustomRailgun");
|
|||
static FRandom pr_spawndebris ("SpawnDebris");
|
||||
static FRandom pr_spawnitemex ("SpawnItemEx");
|
||||
static FRandom pr_burst ("Burst");
|
||||
static FRandom pr_monsterrefire ("MonsterRefire");
|
||||
|
||||
|
||||
//==========================================================================
|
||||
|
@ -524,6 +525,25 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfInTargetInventory)
|
|||
DoJumpIfInventory(self->target, PUSH_PARAMINFO);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// State jump function
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfArmorType)
|
||||
{
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_NAME(Type, 0);
|
||||
ACTION_PARAM_STATE(JumpOffset, 1);
|
||||
|
||||
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
||||
|
||||
ABasicArmor * armor = (ABasicArmor *) self->FindInventory(NAME_BasicArmor);
|
||||
|
||||
if (armor && armor->ArmorType == Type)
|
||||
ACTION_JUMP(JumpOffset);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// Parameterized version of A_Explode
|
||||
|
@ -1753,6 +1773,24 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckSight)
|
|||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// A_JumpIfTargetInSight
|
||||
// jumps if monster can see its target
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_JumpIfTargetInSight)
|
||||
{
|
||||
ACTION_PARAM_START(1);
|
||||
ACTION_PARAM_STATE(jump, 0);
|
||||
|
||||
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
||||
if (self->target == NULL || !P_CheckSight(self, self->target,4)) return;
|
||||
ACTION_JUMP(jump);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Inventory drop
|
||||
|
@ -2437,3 +2475,30 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RemoveChildren)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// keep firing unless target got out of sight
|
||||
//
|
||||
//===========================================================================
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_MonsterRefire)
|
||||
{
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_INT(prob, 0);
|
||||
ACTION_PARAM_STATE(jump, 1);
|
||||
|
||||
ACTION_SET_RESULT(false); // Jumps should never set the result for inventory state chains!
|
||||
A_FaceTarget (self);
|
||||
|
||||
if (pr_monsterrefire() < prob)
|
||||
return;
|
||||
|
||||
if (!self->target
|
||||
|| P_HitFriend (self)
|
||||
|| self->target->health <= 0
|
||||
|| !P_CheckSight (self, self->target, 0) )
|
||||
{
|
||||
ACTION_JUMP(jump);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -212,6 +212,8 @@ static FFlagDef ActorFlags[]=
|
|||
DEFINE_FLAG(MF6, NOBOSSRIP, AActor, flags6),
|
||||
DEFINE_FLAG(MF6, THRUSPECIES, AActor, flags6),
|
||||
DEFINE_FLAG(MF6, MTHRUSPECIES, AActor, flags6),
|
||||
DEFINE_FLAG(MF6, FORCEPAIN, AActor, flags6),
|
||||
DEFINE_FLAG(MF6, NOFEAR, AActor, flags6),
|
||||
|
||||
// Effect flags
|
||||
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),
|
||||
|
|
|
@ -741,6 +741,15 @@ DEFINE_PROPERTY(missileheight, F, Actor)
|
|||
info->Class->Meta.SetMetaFixed (ACMETA_MissileHeight, id);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
DEFINE_PROPERTY(pushfactor, F, Actor)
|
||||
{
|
||||
PROP_FIXED_PARM(id, 0);
|
||||
defaults->pushfactor = id;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
@ -1581,7 +1590,7 @@ DEFINE_CLASS_PROPERTY_PREFIX(powerup, duration, I, Inventory)
|
|||
}
|
||||
else
|
||||
{
|
||||
I_Error("\"powerup.color\" requires an actor of type \"Powerup\"\n");
|
||||
I_Error("\"powerup.duration\" requires an actor of type \"Powerup\"\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -1526,6 +1526,15 @@ CUSTOM_CVAR (Bool, vid_nowidescreen, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
|||
}
|
||||
}
|
||||
|
||||
CUSTOM_CVAR (Int, vid_aspect, 0, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
||||
{
|
||||
setsizeneeded = true;
|
||||
if (StatusBar != NULL)
|
||||
{
|
||||
StatusBar->ScreenSizeChanged();
|
||||
}
|
||||
}
|
||||
|
||||
// Tries to guess the physical dimensions of the screen based on the
|
||||
// screen's pixel dimensions. Can return:
|
||||
// 0: 4:3
|
||||
|
@ -1534,6 +1543,11 @@ CUSTOM_CVAR (Bool, vid_nowidescreen, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
|||
// 4: 5:4
|
||||
int CheckRatio (int width, int height)
|
||||
{
|
||||
if ((vid_aspect >=1) && (vid_aspect <=4))
|
||||
{
|
||||
// [SP] User wants to force aspect ratio; let them.
|
||||
return vid_aspect == 3? 0: int(vid_aspect);
|
||||
}
|
||||
if (vid_nowidescreen)
|
||||
{
|
||||
if (!vid_tft)
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
// SAVESIG should match SAVEVER.
|
||||
|
||||
// MINSAVEVER is the minimum level snapshot version that can be loaded.
|
||||
#define MINSAVEVER 1619
|
||||
#define MINSAVEVER 1643
|
||||
|
||||
#if ZD_SVN_REVISION_NUMBER < MINSAVEVER
|
||||
// Never write a savegame with a version lower than what we need
|
||||
|
|
|
@ -76,11 +76,11 @@ public:
|
|||
|
||||
protected:
|
||||
void PostMouseMove(int x, int y);
|
||||
void WheelMoved(int wheelmove);
|
||||
void WheelMoved(int axis, int wheelmove);
|
||||
void PostButtonEvent(int button, bool down);
|
||||
void ClearButtonState();
|
||||
|
||||
int WheelMove;
|
||||
int WheelMove[2];
|
||||
int LastX, LastY; // for m_filter
|
||||
WORD ButtonState; // bit mask of current button states (1=down, 0=up)
|
||||
};
|
||||
|
|
|
@ -228,6 +228,10 @@ void FKeyboard::PostKeyEvent(int key, INTBOOL down, bool foreground)
|
|||
key = DIK_LSHIFT;
|
||||
}
|
||||
}
|
||||
if (key == 0x59)
|
||||
{ // Turn kp= on a Mac keyboard into kp= on a PC98 keyboard.
|
||||
key = DIK_NUMPADEQUALS;
|
||||
}
|
||||
|
||||
// Generate the event, if appropriate.
|
||||
if (down)
|
||||
|
|
|
@ -32,6 +32,12 @@
|
|||
#define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
|
||||
#endif
|
||||
|
||||
// Only present in Vista SDK, and it probably isn't available with w32api,
|
||||
// either.
|
||||
#ifndef WM_MOUSEHWHEEL
|
||||
#define WM_MOUSEHWHEEL 0x20e
|
||||
#endif
|
||||
|
||||
// TYPES -------------------------------------------------------------------
|
||||
|
||||
class FRawMouse : public FMouse
|
||||
|
@ -266,7 +272,8 @@ FMouse::FMouse()
|
|||
{
|
||||
LastX = LastY = 0;
|
||||
ButtonState = 0;
|
||||
WheelMove = 0;
|
||||
WheelMove[0] = 0;
|
||||
WheelMove[1] = 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -308,18 +315,20 @@ void FMouse::PostMouseMove(int x, int y)
|
|||
// Generates events for a wheel move. Events are generated for every
|
||||
// WHEEL_DELTA units that the wheel has moved. In normal mode, each move
|
||||
// generates both a key down and a key up event. In GUI mode, only one
|
||||
// event is generated for each unit of movement.
|
||||
// event is generated for each unit of movement. Axis can be 0 for up/down
|
||||
// or 1 for left/right.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
void FMouse::WheelMoved(int wheelmove)
|
||||
void FMouse::WheelMoved(int axis, int wheelmove)
|
||||
{
|
||||
assert(axis == 0 || axis == 1);
|
||||
event_t ev = { 0 };
|
||||
int dir;
|
||||
|
||||
WheelMove += wheelmove;
|
||||
WheelMove[axis] += wheelmove;
|
||||
|
||||
if (WheelMove < 0)
|
||||
if (WheelMove[axis] < 0)
|
||||
{
|
||||
dir = WHEEL_DELTA;
|
||||
ev.data1 = KEY_MWHEELDOWN;
|
||||
|
@ -329,30 +338,31 @@ void FMouse::WheelMoved(int wheelmove)
|
|||
dir = -WHEEL_DELTA;
|
||||
ev.data1 = KEY_MWHEELUP;
|
||||
}
|
||||
ev.data1 += axis * 2;
|
||||
|
||||
if (!GUICapture)
|
||||
{
|
||||
while (abs(WheelMove) >= WHEEL_DELTA)
|
||||
while (abs(WheelMove[axis]) >= WHEEL_DELTA)
|
||||
{
|
||||
ev.type = EV_KeyDown;
|
||||
D_PostEvent(&ev);
|
||||
ev.type = EV_KeyUp;
|
||||
D_PostEvent(&ev);
|
||||
WheelMove += dir;
|
||||
WheelMove[axis] += dir;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ev.type = EV_GUI_Event;
|
||||
ev.subtype = (WheelMove < 0) ? EV_GUI_WheelDown : EV_GUI_WheelUp;
|
||||
ev.subtype = ev.data1 - KEY_MWHEELUP + EV_GUI_WheelUp;
|
||||
if (GetKeyState(VK_SHIFT) & 0x8000) ev.data3 |= GKM_SHIFT;
|
||||
if (GetKeyState(VK_CONTROL) & 0x8000) ev.data3 |= GKM_CTRL;
|
||||
if (GetKeyState(VK_MENU) & 0x8000) ev.data3 |= GKM_ALT;
|
||||
ev.data1 = 0;
|
||||
while (abs(WheelMove) >= WHEEL_DELTA)
|
||||
while (abs(WheelMove[axis]) >= WHEEL_DELTA)
|
||||
{
|
||||
D_PostEvent(&ev);
|
||||
WheelMove += dir;
|
||||
WheelMove[axis] += dir;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -415,7 +425,8 @@ void FMouse::ClearButtonState()
|
|||
ButtonState = 0;
|
||||
}
|
||||
// Reset mouse wheel accumulation to 0.
|
||||
WheelMove = 0;
|
||||
WheelMove[0] = 0;
|
||||
WheelMove[1] = 0;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -597,7 +608,11 @@ bool FRawMouse::WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPara
|
|||
}
|
||||
if (raw->data.mouse.usButtonFlags & RI_MOUSE_WHEEL)
|
||||
{
|
||||
WheelMoved((SHORT)raw->data.mouse.usButtonData);
|
||||
WheelMoved(0, (SHORT)raw->data.mouse.usButtonData);
|
||||
}
|
||||
else if (raw->data.mouse.usButtonFlags & 0x800) // horizontal mouse wheel
|
||||
{
|
||||
WheelMoved(1, (SHORT)raw->data.mouse.usButtonData);
|
||||
}
|
||||
PostMouseMove(m_noprescale ? raw->data.mouse.lLastX : raw->data.mouse.lLastX<<2,
|
||||
-raw->data.mouse.lLastY);
|
||||
|
@ -794,7 +809,7 @@ void FDInputMouse::ProcessInput()
|
|||
}
|
||||
else if (od.dwOfs == (DWORD)DIMOFS_Z)
|
||||
{
|
||||
WheelMoved(od.dwData);
|
||||
WheelMoved(0, od.dwData);
|
||||
}
|
||||
else if (od.dwOfs >= (DWORD)DIMOFS_BUTTON0 && od.dwOfs <= (DWORD)DIMOFS_BUTTON7)
|
||||
{
|
||||
|
@ -963,7 +978,12 @@ bool FWin32Mouse::WndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||
}
|
||||
else if (message == WM_MOUSEWHEEL)
|
||||
{
|
||||
WheelMoved((SHORT)HIWORD(wParam));
|
||||
WheelMoved(0, (SHORT)HIWORD(wParam));
|
||||
return true;
|
||||
}
|
||||
else if (message == WM_MOUSEHWHEEL)
|
||||
{
|
||||
WheelMoved(1, (SHORT)HIWORD(wParam));
|
||||
return true;
|
||||
}
|
||||
else if (message >= WM_LBUTTONDOWN && message <= WM_MBUTTONUP)
|
||||
|
|
|
@ -17,6 +17,7 @@ ACTOR Actor native //: Thinker
|
|||
BounceCount -1
|
||||
FloatSpeed 4
|
||||
Gravity 1
|
||||
PushFactor 0.25
|
||||
|
||||
// Variables for the expression evaluator
|
||||
// NOTE: fixed_t and angle_t are only used here to ensure proper conversion
|
||||
|
@ -175,6 +176,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_JumpIfHealthLower(int health, state label);
|
||||
action native A_JumpIfCloser(float distance, state label);
|
||||
action native A_JumpIfInventory(class<Inventory> itemtype, int itemamount, state label);
|
||||
action native A_JumpIfArmorType(string Type, state label);
|
||||
action native A_GiveInventory(class<Inventory> itemtype, int amount = 0);
|
||||
action native A_TakeInventory(class<Inventory> itemtype, int amount = 0);
|
||||
action native A_SpawnItem(class<Actor> itemtype, float distance = 0, float zheight = 0, bool useammo = true, bool transfer_translation = false);
|
||||
|
@ -235,6 +237,9 @@ ACTOR Actor native //: Thinker
|
|||
action native A_DropWeaponPieces(class<Actor> p1, class<Actor> p2, class<Actor> p3);
|
||||
action native A_PigPain ();
|
||||
|
||||
action native A_JumpIfTargetInSight(state label);
|
||||
action native A_MonsterRefire(int chance, state label);
|
||||
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue