forked from drfrag666/gzdoom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- sprite lightlevel cleanup and fixes.
* consolidated the getter functions on the game data side * better handling of per-sprite lighting with fog * allow negative values for additive per-sprite lighting. * also fixed return type of UpdateWaterDepth.
- Loading branch information
Showing
12 changed files
with
312 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Mainly a bugfix release addressing the following issues: | ||
- Fixed: SBar_DrawTextureRotated was missing the angle parameter | ||
- Compat patch for misplaced items in Hexen MAP08. | ||
- fixed some imprecisions in font luminosity calculation. This was still going through the palette which could result in off-by-one errors. | ||
- fixed palette initialization for single lump fonts (FON2 and BMF) | ||
- push sprite shadows a little back for distance sorting | ||
- avoid multiple Dehacked mappings to the same function to fix MBF21 lookup issues. | ||
- disallow changing the line spacing for option menus. | ||
- be a bit more aggressive with the GC when not running the game loop. | ||
- fixed memory leak in DShape2DBufferInfo. | ||
- allow "INDEXFON" as an alias for "INDEXFONT". | ||
- fixed A_Punch having a short attack range (take 2). | ||
- GLES: Fix texture MapBuffer and AllocateBuffer create client side memory. | ||
- Fix "out of memory" errors when the vulkan backend is asked to create zero byte sized buffers | ||
- resolved a VM abort upon morphing while the tome of power is active | ||
- fixed particle processing in the main thinker loop. This may not be guarded by the dynamic light flags, only the light ticking may. | ||
- fixed handling of states with the 'light' keyword. | ||
- Fixed broken V_BreakLines. | ||
- treat "materials" as a known folder name for eliminating root folders in Zips. | ||
|
||
New Features: | ||
- widescreen assets for all officially supported games. This version adds Hacx, Harmony and Chex Quest. | ||
- Allow WorldUnloaded events to know the next map name (if any). | ||
- Allow map markers to scale relative to automap zoom. | ||
- Add cvars to control automap line alpha and thickness | ||
- PreTravelled virtual for player and inventory. | ||
- Allow customization of pause screen. | ||
- ReadThisMenu / MenuDelegate overriding. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
N/A weapon_recoil Firing a weapon pushes the player back | ||
---N/A (todo, lastenemy?) monsters_remember 1 Friendly monsters return to old target when losing current one | ||
!LEVEL2_NOINFIGHTING monster_infighting 1 Monsters infight | ||
LEVEL3_AVOIDMELEE monster_backing Ranged monsters will back away from close melee targets | ||
COMPATF2_AVOID_HAZARDS monster_avoid_hazards 1 Monsters avoid hazards such as crushing ceilings | ||
N/A monkeys Monsters can climb steep stairs | ||
COMPATF_MBFMONSTERMOVE monster_friction 1 Monsters are affected by friction modifiers | ||
help_friends Friendly monsters prefer targets of friends | ||
player_helpers Number of dogs to spawn | ||
friend_distance 128 Friendly monsters try to keep at least this distance apart | ||
!LEVEL3_NOJUMPDOWN dog_jumping 1 Dogs can jump down from high ledges | ||
N/A comp_telefrag Spawners only telefrag on Map 30 | ||
COMPATF_DROPOFF comp_dropoff 01 Discourage / prevent enemies from walking off ledges (?) | ||
COMPATF_CORPSEGIBS,BCOMPATF_VILEGHOSTS comp_vile Archviles can create ghosts | ||
COMPATF_LIMITPAIN comp_pain Pain elementals don't spawn lost souls if there are over 20 | ||
--- N/A (todo) comp_skull Lost souls can spawn past impassable lines | ||
N/A comp_blazing Blazing doors have double sounds | ||
COMPATF_NODOORLIGHT comp_doorlight Door lighting changes are abrupt | ||
COMPATF_LIGHT,COMPATF_SHORTTEX (partial) comp_model Assorted physics quirks and bugs | ||
N/A comp_god God mode is removed in sector 11 & ignored at 1000+ damage | ||
N/A comp_falloff Don't pull monsters off ledges they are hanging off of | ||
COMPATF2_FLOORMOVE comp_floors Assorted floor bugs | ||
N/A comp_skymap Don't apply invulnerability palette to skies | ||
---todo comp_pursuit 1 Monsters can infight immediately when alerted | ||
N/A comp_doorstuck Monsters get stuck in door tracks | ||
COMPATF2_STAYONLIFT comp_staylift Monsters don't prefer staying on lifts their target is on | ||
N/A comp_zombie Dead players can activate things | ||
COMPATF_STAIRINDEX comp_stairs Assorted stair bugs | ||
N/A comp_infcheat ? | ||
N/A comp_zerotags Allow tag zero actions | ||
N/A comp_respawn Monsters not spawned at level start respawn at the origin | ||
N/A comp_soul Buggy lost soul bouncing | ||
COMPATF_CROSSDROPOFF comp_ledgeblock 10 Monsters are blocked by ledges (except when scrolling) | ||
---todo comp_friendlyspawn 1 Spawned things inherit the friend attribute from the source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,205 @@ | ||
// | ||
// Copyright(C) 2020 by Ryan Krafnick | ||
// | ||
// This program is free software; you can redistribute it and/or | ||
// modify it under the terms of the GNU General Public License | ||
// as published by the Free Software Foundation; either version 2 | ||
// of the License, or (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// DESCRIPTION: | ||
// DSDA Options Lump | ||
// | ||
|
||
#include "filesystem.h" | ||
#include "g_mapinfo.h" | ||
#include "doomdef.h" | ||
#include "templates.h" | ||
|
||
|
||
struct dsda_options | ||
{ | ||
int monsters_remember = -1; | ||
int monster_infighting = -1; | ||
int monster_backing = -1; | ||
int monster_avoid_hazards = -1; | ||
int monster_friction = -1; | ||
int help_friends = 0; | ||
int player_helpers = 0; | ||
int friend_distance = 128; | ||
int dog_jumping = -1; | ||
int comp_dropoff = -1; | ||
int comp_vile = -1; | ||
int comp_pain = -1; | ||
int comp_doorlight = -1; | ||
int comp_model = -1; | ||
int comp_floors = -1; | ||
int comp_pursuit = -1; // 1 for 'latest' | ||
int comp_staylift = -1; | ||
int comp_stairs = -1; | ||
int comp_ledgeblock = -1; | ||
int comp_friendlyspawn = -1; | ||
}; | ||
|
||
struct dsda_option_t | ||
{ | ||
const char* key; | ||
int dsda_options::* value; | ||
int min; | ||
int max; | ||
}; | ||
|
||
static dsda_option_t option_list[] = { | ||
{ "monsters_remember", &dsda_options::monsters_remember, 0, 1 }, | ||
{ "monster_infighting", &dsda_options::monster_infighting, 0, 1 }, | ||
{ "monster_backing", &dsda_options::monster_backing, 0, 1 }, | ||
{ "monster_avoid_hazards", &dsda_options::monster_avoid_hazards, 0, 1 }, | ||
{ "monster_friction", &dsda_options::monster_friction, 0, 1 }, | ||
{ "help_friends", &dsda_options::help_friends, 0, 1 }, | ||
{ "player_helpers", &dsda_options::player_helpers, 0, 3 }, | ||
{ "friend_distance", &dsda_options::friend_distance, 0, 999 }, | ||
{ "dog_jumping", &dsda_options::dog_jumping, 0, 1 }, | ||
{ "comp_dropoff", &dsda_options::comp_dropoff, 0, 1 }, | ||
{ "comp_vile", &dsda_options::comp_vile, 0, 1 }, | ||
{ "comp_pain", &dsda_options::comp_pain, 0, 1 }, | ||
{ "comp_doorlight", &dsda_options::comp_doorlight, 0, 1 }, | ||
{ "comp_model", &dsda_options::comp_model, 0, 1 }, | ||
{ "comp_floors", &dsda_options::comp_floors, 0, 1 }, | ||
{ "comp_pursuit", &dsda_options::comp_pursuit, 0, 1 }, | ||
{ "comp_staylift", &dsda_options::comp_staylift, 0, 1 }, | ||
{ "comp_stairs", &dsda_options::comp_stairs, 0, 1 }, | ||
{ "comp_ledgeblock", &dsda_options::comp_ledgeblock, 0, 1 }, | ||
{ "comp_friendlyspawn", &dsda_options::comp_friendlyspawn, 0, 1 }, | ||
{ 0 } | ||
}; | ||
|
||
enum { OPTIONS_LINE_LENGTH = 80 }; | ||
|
||
struct options_lump_t | ||
{ | ||
const char* data; | ||
int length; | ||
}; | ||
|
||
static const char* dsda_ReadOption(char* buf, size_t size, options_lump_t* lump) | ||
{ | ||
if (lump->length <= 0) | ||
return nullptr; | ||
|
||
while (size > 1 && *lump->data && lump->length) | ||
{ | ||
size--; | ||
lump->length--; | ||
if ((*buf++ = *lump->data++) == '\n') | ||
break; | ||
} | ||
|
||
*buf = '\0'; | ||
|
||
return lump->data; | ||
} | ||
|
||
static struct dsda_options dsda_LumpOptions(int lumpnum) | ||
{ | ||
struct dsda_options mbf_options; | ||
|
||
options_lump_t lump; | ||
char buf[OPTIONS_LINE_LENGTH]; | ||
char key[OPTIONS_LINE_LENGTH]; | ||
char* scan; | ||
int value, count; | ||
dsda_option_t* option; | ||
|
||
lump.length = fileSystem.FileLength(lumpnum); | ||
auto data = fileSystem.ReadFile(lumpnum); | ||
lump.data = (char*)data.GetMem(); | ||
|
||
while (dsda_ReadOption(buf, OPTIONS_LINE_LENGTH, &lump)) | ||
{ | ||
if (buf[0] == '#') | ||
continue; | ||
|
||
scan = buf; | ||
count = sscanf(scan, "%79s %d", key, &value); | ||
|
||
if (count != 2) | ||
continue; | ||
|
||
for (option = option_list; option->value; option++) | ||
{ | ||
if (!strncmp(key, option->key, OPTIONS_LINE_LENGTH)) | ||
{ | ||
mbf_options.*option->value = clamp(option->min, option->max, value); | ||
|
||
//lprintf(LO_INFO, "dsda_LumpOptions: %s = %d\n", key, value); | ||
|
||
break; | ||
} | ||
} | ||
} | ||
return mbf_options; | ||
} | ||
|
||
|
||
void parseOptions() | ||
{ | ||
int lumpnum = fileSystem.FindFile("OPTIONS"); | ||
|
||
if (lumpnum == -1) | ||
return; | ||
|
||
auto opt = dsda_LumpOptions(lumpnum); | ||
|
||
auto setflag = [](auto& flag, auto mask, bool set) | ||
{ | ||
if (set) flag |= mask; | ||
else flag &= ~mask; | ||
}; | ||
|
||
for (auto& lev : wadlevelinfos) | ||
{ | ||
setflag(lev.flags2, LEVEL2_NOINFIGHTING, opt.monster_infighting); | ||
setflag(lev.flags3, LEVEL3_AVOIDMELEE, opt.monster_backing); | ||
setflag(lev.compatflags2, COMPATF2_AVOID_HAZARDS, opt.monster_avoid_hazards); | ||
setflag(lev.compatmask2, COMPATF2_AVOID_HAZARDS, opt.monster_avoid_hazards); | ||
setflag(lev.compatflags, COMPATF_MBFMONSTERMOVE, opt.monster_friction); | ||
setflag(lev.compatmask, COMPATF_MBFMONSTERMOVE, opt.monster_friction); | ||
setflag(lev.compatflags, COMPATF_DROPOFF, opt.comp_dropoff); | ||
setflag(lev.compatmask, COMPATF_DROPOFF, opt.comp_dropoff); | ||
setflag(lev.compatflags, COMPATF_DROPOFF, opt.comp_dropoff); | ||
setflag(lev.compatmask, COMPATF_DROPOFF, opt.comp_dropoff); | ||
setflag(lev.compatflags, COMPATF_CORPSEGIBS, opt.comp_vile); | ||
setflag(lev.compatmask, COMPATF_CORPSEGIBS, opt.comp_vile); | ||
setflag(lev.flags3, LEVEL3_VILEOPTION, opt.comp_vile); | ||
setflag(lev.flags3, LEVEL3_NOJUMPDOWN, !opt.dog_jumping); // this one's rather pointless, but well... | ||
setflag(lev.compatflags, COMPATF_LIMITPAIN, opt.comp_pain); | ||
setflag(lev.compatmask, COMPATF_LIMITPAIN, opt.comp_pain); | ||
setflag(lev.compatflags, COMPATF_NODOORLIGHT, opt.comp_doorlight); | ||
setflag(lev.compatmask, COMPATF_NODOORLIGHT, opt.comp_doorlight); | ||
setflag(lev.compatflags, COMPATF_LIGHT | COMPATF_SHORTTEX, opt.comp_model); // only the relevant parts of this catch-all option. | ||
setflag(lev.compatmask, COMPATF_LIGHT | COMPATF_SHORTTEX, opt.comp_model); | ||
setflag(lev.compatflags2, COMPATF2_FLOORMOVE, opt.comp_floors); | ||
setflag(lev.compatmask2, COMPATF2_FLOORMOVE, opt.comp_floors); | ||
setflag(lev.compatflags2, COMPATF2_STAYONLIFT, opt.comp_staylift); | ||
setflag(lev.compatmask2, COMPATF2_STAYONLIFT, opt.comp_staylift); | ||
setflag(lev.compatflags, COMPATF_STAIRINDEX, opt.comp_stairs); | ||
setflag(lev.compatmask, COMPATF_STAIRINDEX, opt.comp_stairs); | ||
setflag(lev.compatflags, COMPATF_CROSSDROPOFF, opt.comp_ledgeblock); | ||
setflag(lev.compatmask, COMPATF_CROSSDROPOFF, opt.comp_ledgeblock); | ||
|
||
/* later. these should be supported but are not implemented yet. | ||
if (opt.monsters_remember == 0) | ||
if (opt.comp_pursuit) | ||
if (opt.comp_friendlyspawn == 0) | ||
int help_friends = 0; | ||
int player_helpers = 0; | ||
int friend_distance = 128; | ||
*/ | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.