Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e6a1e58405 | ||
|
|
ea10c9ac13 | ||
|
|
e6d3f3f27c | ||
|
|
f713b7fb60 | ||
|
|
c35a542d60 | ||
|
|
e6c699faf4 | ||
|
|
f626b4b031 | ||
|
|
aed81c0ff5 | ||
|
|
1354f2f302 | ||
|
|
8ea5d0f729 | ||
|
|
ab93865255 | ||
|
|
1ecdd3dae6 | ||
|
|
ddcd6b0d31 | ||
|
|
5196f1c5b9 | ||
|
|
9dd6ec718f | ||
|
|
69237d6a3a | ||
|
|
426cbee752 | ||
|
|
c2f3486e6d | ||
|
|
e4a575cc5e | ||
|
|
f00c9d8c23 | ||
|
|
f70f7152ab | ||
|
|
8c7f35fa29 | ||
|
|
fe74e69da6 | ||
|
|
c170f53948 | ||
|
|
13fd825bcf | ||
|
|
8ee4fc2fa1 | ||
|
|
679a8387c9 | ||
|
|
9044a46b31 | ||
|
|
e1b41d2c58 | ||
|
|
3204095afb | ||
|
|
538de7d2d2 | ||
|
|
2cba586d9c | ||
|
|
ad4d587a52 | ||
|
|
a929636a28 | ||
|
|
06a2508a9c | ||
|
|
64b2e2ee37 | ||
|
|
b6ef6eb801 | ||
|
|
b4d48cc9ec | ||
|
|
f83a937dc5 | ||
|
|
e2acb4c3fc | ||
|
|
5bf722a1fb | ||
|
|
0751484439 | ||
|
|
e5b16c7aa0 | ||
|
|
bac058d128 | ||
|
|
dd4a9ae890 | ||
|
|
f91687209b | ||
|
|
ec4140a9d2 | ||
|
|
2553c9e878 | ||
|
|
f9f33aa53a | ||
|
|
4455ebe58f | ||
|
|
35cfdea9e7 | ||
|
|
346433d248 | ||
|
|
16a7e69292 | ||
|
|
441824fc70 | ||
|
|
f46b77ab7b | ||
|
|
561af0e601 | ||
|
|
362c21505d | ||
|
|
d3d40de996 | ||
|
|
3ce4653bb5 | ||
|
|
a639c87a90 | ||
|
|
3aac16432a | ||
|
|
1c9ea1eb2e | ||
|
|
a47aea4c9f | ||
|
|
9cd0e6c385 | ||
|
|
c23a0f08c4 | ||
|
|
3ff865b1b6 | ||
|
|
cdedf1349c | ||
|
|
7beab3b582 | ||
|
|
b1b592f88d | ||
|
|
8737a40a4d | ||
|
|
71ce5be570 | ||
|
|
b883d02abb | ||
|
|
09f79a6934 | ||
|
|
9bdcfe9750 | ||
|
|
b767180473 | ||
|
|
acb5d96788 | ||
|
|
228a932598 | ||
|
|
b53cc6fd2b | ||
|
|
01cd8f5a0f | ||
|
|
9732e74bf3 | ||
|
|
2ed4a7b548 | ||
|
|
52c11d1444 | ||
|
|
78d50e4c43 | ||
|
|
7f05d27f42 | ||
|
|
3675fdd361 | ||
|
|
98dfe528d8 | ||
|
|
7da590df94 | ||
|
|
90cc5a6cb0 | ||
|
|
ca9277366c | ||
|
|
e79bf24bcd | ||
|
|
2c1201ff34 | ||
|
|
c4ff1a3aca | ||
|
|
5760f25c74 | ||
|
|
0a6f700c6f | ||
|
|
3147dfb012 | ||
|
|
5007a33bbf | ||
|
|
c65acfa90e | ||
|
|
b167c19137 | ||
|
|
d48b08856e | ||
|
|
9ba5c9a38b | ||
|
|
1a9f30a328 | ||
|
|
97058bfcf6 | ||
|
|
bd41bbb304 | ||
|
|
f47cb885cc | ||
|
|
1ab243d93a | ||
|
|
15d59cbbd8 | ||
|
|
c88d2dadb0 | ||
|
|
a4e96d2380 | ||
|
|
002c550263 | ||
|
|
25b9bc4100 | ||
|
|
7105606475 | ||
|
|
71e4005226 | ||
|
|
76b66b41b6 | ||
|
|
43e1331594 | ||
|
|
23ba3d493b | ||
|
|
487cbc495a | ||
|
|
faeb4d22ed | ||
|
|
9dc2ad4f32 | ||
|
|
ceae12baba | ||
|
|
58c58e9542 | ||
|
|
46c7bf8b03 | ||
|
|
c011d09e33 | ||
|
|
65fadcf709 | ||
|
|
e2b06aa600 | ||
|
|
7ab0a808a9 | ||
|
|
bc7ce5c983 | ||
|
|
6e55d88816 | ||
|
|
97f0ea1b0f |
No files matched your search
@@ -6,29 +6,34 @@
|
|||||||
|
|
||||||
- Sprites player rotation on slopes; going on hills, levitate, going down, and so on alters your sprites (configurable)
|
- Sprites player rotation on slopes; going on hills, levitate, going down, and so on alters your sprites (configurable)
|
||||||
- You can alter all the base kart HUD element offsets on the fly in the Saturn Options settings menu
|
- You can alter all the base kart HUD element offsets on the fly in the Saturn Options settings menu
|
||||||
- "addfilelocal" Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
|
- `addfilelocal` Command, for those who want to use things like their custom hud in netgames (Same as addfile but completely client sided)
|
||||||
- OpenMPT for Tracker module playback (Complete with filters) fixed looping issues while even sounding better than the old GME playback
|
- OpenMPT for Tracker module playback instead of GME
|
||||||
|
- Fixes looping and sounds better
|
||||||
|
- Allows filter configuration
|
||||||
- The minimal brightness with Shaders can be configured, now you can seeeee in dark areas (0-255 , uses Sector brightness values)
|
- The minimal brightness with Shaders can be configured, now you can seeeee in dark areas (0-255 , uses Sector brightness values)
|
||||||
- Lua hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
|
- Lua HUD hooks for Intermission (ex: You can make hostmod votes still visible during intermission!)
|
||||||
- Lua hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
|
- Lua HUD hooks for Vote Screen (ex: You can make hostmod votes still visible during map vote screen!)
|
||||||
- Saltyhop! do a funny hop
|
- Saltyhop! do a funny hop
|
||||||
- Smaller Speedometer (optional / requieres extra.kart file)
|
- Smaller Speedometer (optional / requieres extra.kart file)
|
||||||
- Record Attack input display can now be used everywhere
|
- Record Attack input display can now be used everywhere
|
||||||
- Smaller minimap icons and also show player names on the minimap (toggable)
|
- Smaller minimap icons and also show player names on the minimap (toggable)
|
||||||
- "showmusiccredits" command, shows you the current music track again
|
- `showmusiccredit` command, shows you the current music track again
|
||||||
- "listskins" show a list of all skins currently loaded
|
- `listskins` show a list of all skins currently loaded
|
||||||
- Visual Portals from Haya´s HEP Client
|
- Visual Portals from Haya's HEP Client
|
||||||
- Toggable lowercase menu´s also from Haya´s HEP client
|
- Toggable lowercase menu's also from Haya's HEP client
|
||||||
- Everything that Galaxy has
|
- Everything that Galaxy has
|
||||||
|
|
||||||
## Improvements / Bug fixes
|
## Improvements / Bug fixes
|
||||||
|
|
||||||
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen (can be set to 100MiB max with "maxdemosize" command in console)
|
- Replay size has been increased to 10MiB minimum, to make replay overflows very unlikely to happen
|
||||||
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music) *The mapper still has to provide a MusicDEF for this to work.
|
- can be set to 100MiB max with `maxdemosize` command in console
|
||||||
|
- Music changes now properly show the music credits (ex: Kart maps with easter eggs that alter the music)
|
||||||
|
- The mapper still has to provide a MusicDEF for this to work.
|
||||||
- Configurable chatlog length (yay can read those messages from 30 mins ago without opening log.txt)
|
- Configurable chatlog length (yay can read those messages from 30 mins ago without opening log.txt)
|
||||||
- Configurable timeout for waiting to join a full server (in vanilla this is capped to 5 minutes before it boots you out)
|
- Configurable timeout for waiting to join a full server (in vanilla this is capped to 5 minutes before it boots you out)
|
||||||
- Characters now spin in skin selection menu (configurable)
|
- Characters now spin in skin selection menu (configurable)
|
||||||
- HTTP Addon download speed has been raised dramatically (configurable with "downloadspeed" command)
|
- HTTP Addon download speed has been raised dramatically
|
||||||
|
- configurable with `downloadspeed` command
|
||||||
- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals
|
- HWR Drawnodes have been refactored, this should fix a few rare crashes esp in regards to OpenGL Visportals
|
||||||
- The Position Number in the corner is alot smaller now (half the size!)
|
- The Position Number in the corner is alot smaller now (half the size!)
|
||||||
- Toggable Lap animation
|
- Toggable Lap animation
|
||||||
@@ -40,17 +45,18 @@
|
|||||||
- Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts
|
- Access for `mobj_t` and `player_t` fields from Lua has been completely rewritten, for much better performance with many Lua scripts
|
||||||
- Lua shows Tracebacks whenever an error occurs
|
- Lua shows Tracebacks whenever an error occurs
|
||||||
- The Lua Perfstats page now has multiple pages and is more organized (ps_thinkframe_page X in console)
|
- The Lua Perfstats page now has multiple pages and is more organized (ps_thinkframe_page X in console)
|
||||||
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss (Note intermission screen background is broken with this)
|
- People with lower end hardware can disable "screen textures" with "gr_screentextures" command, huge performance gain with minimal visual loss
|
||||||
- Software mode has gotten "ffloorclip", which boosts performance on maps with many Floor over Floor roads
|
- Intermission backgrounds, heat wave effects and etc are broken with this
|
||||||
|
- `ffloorclip`, exclusive to Software, which boosts performance on maps with many Floor over Floor sectors
|
||||||
|
|
||||||
## Technical fixes
|
## Technical fixes
|
||||||
|
|
||||||
- ZFigthing Textures in Opengl mode have been fixed in engine (well almost all of it)
|
- ZFigthing Textures in Opengl mode have been fixed in engine (well almost all of it)
|
||||||
- Fof's intersecting with slopes have less issues and now render correctly in Opengl
|
- FOFs intersecting with slopes have less issues and now render correctly in Opengl
|
||||||
- Midtextures on slopes in Opengl are fixed, many weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone
|
- Midtextures on slopes in Opengl are fixed, many weird guardrails and fences, aswell as some of those sticking out textures from the ground on some maps should be gone
|
||||||
- The annoying depraction messages for "P_TeleportMove" and "P_AproxDistance" have been silenced
|
- The annoying depraction messages for `P_TeleportMove` and `P_AproxDistance` have been silenced
|
||||||
- Silenced the annoying "cant find next map..." messages as theyre super useless and annoying anyways
|
- Silenced the annoying "cant find next map..." messages as theyre super useless and annoying anyways
|
||||||
- Added a small cooldown on "map" command due to spamming causing a SIGSEGV
|
- Added a small cooldown on `map` command due to spamming causing a SIGSEGV
|
||||||
|
|
||||||
## MISC
|
## MISC
|
||||||
- Bird's Camara Tilting feature is no longer turned on by default
|
- Bird's Camara Tilting feature is no longer turned on by default
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
# Core sources
|
# Core sources
|
||||||
set(SRB2_CORE_SOURCES
|
set(SRB2_CORE_SOURCES
|
||||||
am_map.c
|
am_map.c
|
||||||
|
args.c
|
||||||
b_bot.c
|
b_bot.c
|
||||||
command.c
|
command.c
|
||||||
comptime.c
|
comptime.c
|
||||||
@@ -52,6 +53,7 @@ set(SRB2_CORE_SOURCES
|
|||||||
|
|
||||||
set(SRB2_CORE_HEADERS
|
set(SRB2_CORE_HEADERS
|
||||||
am_map.h
|
am_map.h
|
||||||
|
args.h
|
||||||
b_bot.h
|
b_bot.h
|
||||||
byteptr.h
|
byteptr.h
|
||||||
command.h
|
command.h
|
||||||
|
|||||||
@@ -626,6 +626,7 @@ OBJS:=$(i_main_o) \
|
|||||||
$(OBJDIR)/lzf.o \
|
$(OBJDIR)/lzf.o \
|
||||||
$(OBJDIR)/vid_copy.o \
|
$(OBJDIR)/vid_copy.o \
|
||||||
$(OBJDIR)/b_bot.o \
|
$(OBJDIR)/b_bot.o \
|
||||||
|
$(OBJDIR)/args.o \
|
||||||
$(i_cdmus_o) \
|
$(i_cdmus_o) \
|
||||||
$(i_net_o) \
|
$(i_net_o) \
|
||||||
$(i_system_o) \
|
$(i_system_o) \
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ static INT64 start_time; // as microseconds since the epoch
|
|||||||
|
|
||||||
// I should probably return how much memory is remaining
|
// I should probably return how much memory is remaining
|
||||||
// for this process, considering Android's process memory limit.
|
// for this process, considering Android's process memory limit.
|
||||||
UINT32 I_GetFreeMem(UINT32 *total)
|
size_t I_GetFreeMem(size_t *total)
|
||||||
{
|
{
|
||||||
// what the heck? sysinfo() is partially missing in bionic?
|
// what the heck? sysinfo() is partially missing in bionic?
|
||||||
/* struct sysinfo si; */
|
/* struct sysinfo si; */
|
||||||
|
|||||||
+11
-1
@@ -277,7 +277,7 @@ static xcommand_t *com_commands = NULL; // current commands
|
|||||||
|
|
||||||
#define MAX_ARGS 80
|
#define MAX_ARGS 80
|
||||||
static size_t com_argc;
|
static size_t com_argc;
|
||||||
static char *com_argv[MAX_ARGS];
|
char *com_argv[MAX_ARGS];
|
||||||
static const char *com_null_string = "";
|
static const char *com_null_string = "";
|
||||||
static char *com_args = NULL; // current command args or NULL
|
static char *com_args = NULL; // current command args or NULL
|
||||||
|
|
||||||
@@ -327,6 +327,16 @@ const char *COM_Argv(size_t arg)
|
|||||||
return com_argv[arg];
|
return com_argv[arg];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Returns all of the console command arguments
|
||||||
|
*
|
||||||
|
* \return String pointer to the argv table.
|
||||||
|
* \sa COM_ArgvList
|
||||||
|
*/
|
||||||
|
char **COM_ArgvList(void)
|
||||||
|
{
|
||||||
|
return com_argv;
|
||||||
|
}
|
||||||
|
|
||||||
/** Gets all console command arguments.
|
/** Gets all console command arguments.
|
||||||
*
|
*
|
||||||
* \return String pointer to all arguments for the last command.
|
* \return String pointer to all arguments for the last command.
|
||||||
|
|||||||
@@ -33,8 +33,12 @@ typedef void (*com_func_t)(void);
|
|||||||
void COM_AddCommand(const char *name, com_func_t func);
|
void COM_AddCommand(const char *name, com_func_t func);
|
||||||
int COM_AddLuaCommand(const char *name);
|
int COM_AddLuaCommand(const char *name);
|
||||||
|
|
||||||
|
#define MAX_ARGS 80
|
||||||
|
extern char *com_argv[MAX_ARGS];
|
||||||
|
|
||||||
size_t COM_Argc(void);
|
size_t COM_Argc(void);
|
||||||
const char *COM_Argv(size_t arg); // if argv > argc, returns empty string
|
const char *COM_Argv(size_t arg); // if argv > argc, returns empty string
|
||||||
|
char **COM_ArgvList(void);
|
||||||
char *COM_Args(void);
|
char *COM_Args(void);
|
||||||
size_t COM_CheckParm(const char *check); // like M_CheckParm :)
|
size_t COM_CheckParm(const char *check); // like M_CheckParm :)
|
||||||
size_t COM_CheckPartialParm(const char *check);
|
size_t COM_CheckPartialParm(const char *check);
|
||||||
|
|||||||
+169
-4
@@ -49,6 +49,7 @@
|
|||||||
#include "m_anigif.h"
|
#include "m_anigif.h"
|
||||||
#include "k_kart.h" // SRB2kart
|
#include "k_kart.h" // SRB2kart
|
||||||
#include "y_inter.h"
|
#include "y_inter.h"
|
||||||
|
#include "fastcmp.h"
|
||||||
#include "m_perfstats.h"
|
#include "m_perfstats.h"
|
||||||
|
|
||||||
#ifdef NETGAME_DEVMODE
|
#ifdef NETGAME_DEVMODE
|
||||||
@@ -141,6 +142,8 @@ static void Command_SetViews_f(void);
|
|||||||
|
|
||||||
static void Command_Addfilelocal(void);
|
static void Command_Addfilelocal(void);
|
||||||
static void Command_Addfile(void);
|
static void Command_Addfile(void);
|
||||||
|
static void Command_Addskins(void);
|
||||||
|
static void Command_GLocalSkin(void);
|
||||||
static void Command_ListWADS_f(void);
|
static void Command_ListWADS_f(void);
|
||||||
#ifdef DELFILE
|
#ifdef DELFILE
|
||||||
static void Command_Delfile(void);
|
static void Command_Delfile(void);
|
||||||
@@ -289,6 +292,8 @@ consvar_t cv_skin = {"skin", DEFAULTSKIN, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin_
|
|||||||
consvar_t cv_skin2 = {"skin2", DEFAULTSKIN2, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_skin2 = {"skin2", DEFAULTSKIN2, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin2_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_skin3 = {"skin3", DEFAULTSKIN3, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_skin3 = {"skin3", DEFAULTSKIN3, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin3_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_skin4 = {"skin4", DEFAULTSKIN4, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_skin4 = {"skin4", DEFAULTSKIN4, CV_SAVE|CV_CALL|CV_NOINIT, NULL, Skin4_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
// haha I've beaten you now, ONLINE
|
||||||
|
consvar_t cv_localskin = {"internal___localskin", "none", CV_HIDEN, NULL, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_skipmapcheck = {"skipmapcheck", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
@@ -447,6 +452,7 @@ static CV_PossibleValue_t basenumlaps_cons_t[] = {{1, "MIN"}, {50, "MAX"}, {0, "
|
|||||||
consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_basenumlaps = {"basenumlaps", "Map default", CV_NETVAR|CV_CALL|CV_CHEAT, basenumlaps_cons_t, BaseNumLaps_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_forceskin = {"forceskin", "Off", CV_NETVAR|CV_CALL|CV_CHEAT, Forceskin_cons_t, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_forceskin = {"forceskin", "Off", CV_NETVAR|CV_CALL|CV_CHEAT, Forceskin_cons_t, ForceSkin_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_fakelocalskin = {"fakelocalskin", "None", CV_SAVE, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_downloading = {"downloading", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_downloading = {"downloading", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_allowexitlevel = {"allowexitlevel", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_allowexitlevel = {"allowexitlevel", "No", CV_NETVAR, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
@@ -468,6 +474,7 @@ consvar_t cv_showping = {"showping", "Always", CV_SAVE, showping_cons_t, NULL, 0
|
|||||||
|
|
||||||
static CV_PossibleValue_t pingmeasurement_cons_t[] = {{0, "Frames"}, {1, "Milliseconds"}, {0, NULL}};
|
static CV_PossibleValue_t pingmeasurement_cons_t[] = {{0, "Frames"}, {1, "Milliseconds"}, {0, NULL}};
|
||||||
consvar_t cv_pingmeasurement = {"pingmeasurement", "Frames", CV_SAVE, pingmeasurement_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_pingmeasurement = {"pingmeasurement", "Frames", CV_SAVE, pingmeasurement_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_luaimmersion = {"luaimmersion", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_minihead = {"smallminimapplayers", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_minihead = {"smallminimapplayers", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
@@ -512,7 +519,7 @@ consvar_t cv_ps_descriptor = {"ps_descriptor", "Average", 0, ps_descriptor_cons_
|
|||||||
|
|
||||||
consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_showtrackaddon = {"showtrackaddon", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scoll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {0, NULL}};
|
static CV_PossibleValue_t skinselectmenu_t[] = {{SKINMENUTYPE_SCROLL, "Scroll"}, {SKINMENUTYPE_2D, "2d"}, {SKINMENUTYPE_GRID, "Grid"}, {0, NULL}};
|
||||||
consvar_t cv_skinselectmenu = {"skinselectmenu", "Grid", CV_SAVE, skinselectmenu_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_skinselectmenu = {"skinselectmenu", "Grid", CV_SAVE, skinselectmenu_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
static CV_PossibleValue_t skinselectgridsort_t[] ={
|
static CV_PossibleValue_t skinselectgridsort_t[] ={
|
||||||
@@ -643,6 +650,8 @@ void D_RegisterServerCommands(void)
|
|||||||
|
|
||||||
COM_AddCommand("addfilelocal", Command_Addfilelocal);
|
COM_AddCommand("addfilelocal", Command_Addfilelocal);
|
||||||
COM_AddCommand("addfile", Command_Addfile);
|
COM_AddCommand("addfile", Command_Addfile);
|
||||||
|
COM_AddCommand("addskins", Command_Addskins);
|
||||||
|
COM_AddCommand("localskin", Command_GLocalSkin);
|
||||||
COM_AddCommand("listwad", Command_ListWADS_f);
|
COM_AddCommand("listwad", Command_ListWADS_f);
|
||||||
|
|
||||||
#ifdef DELFILE
|
#ifdef DELFILE
|
||||||
@@ -777,6 +786,9 @@ void D_RegisterServerCommands(void)
|
|||||||
CV_RegisterVar(&cv_showping);
|
CV_RegisterVar(&cv_showping);
|
||||||
CV_RegisterVar(&cv_pingmeasurement);
|
CV_RegisterVar(&cv_pingmeasurement);
|
||||||
|
|
||||||
|
CV_RegisterVar(&cv_luaimmersion);
|
||||||
|
CV_RegisterVar(&cv_fakelocalskin);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_minihead);
|
CV_RegisterVar(&cv_minihead);
|
||||||
CV_RegisterVar(&cv_showminimapnames);
|
CV_RegisterVar(&cv_showminimapnames);
|
||||||
|
|
||||||
@@ -885,6 +897,7 @@ void D_RegisterClientCommands(void)
|
|||||||
CV_RegisterVar(&cv_playername);
|
CV_RegisterVar(&cv_playername);
|
||||||
CV_RegisterVar(&cv_playercolor);
|
CV_RegisterVar(&cv_playercolor);
|
||||||
CV_RegisterVar(&cv_skin); // r_things.c (skin NAME)
|
CV_RegisterVar(&cv_skin); // r_things.c (skin NAME)
|
||||||
|
CV_RegisterVar(&cv_localskin);
|
||||||
// secondary player (splitscreen)
|
// secondary player (splitscreen)
|
||||||
CV_RegisterVar(&cv_playername2);
|
CV_RegisterVar(&cv_playername2);
|
||||||
CV_RegisterVar(&cv_playercolor2);
|
CV_RegisterVar(&cv_playercolor2);
|
||||||
@@ -977,6 +990,9 @@ void D_RegisterClientCommands(void)
|
|||||||
CV_RegisterVar(&cv_saltyhopsfx);
|
CV_RegisterVar(&cv_saltyhopsfx);
|
||||||
CV_RegisterVar(&cv_saltysquish);
|
CV_RegisterVar(&cv_saltysquish);
|
||||||
|
|
||||||
|
CV_RegisterVar(&cv_growmusic);
|
||||||
|
CV_RegisterVar(&cv_supermusic);
|
||||||
|
|
||||||
//CV_RegisterVar(&cv_crosshair);
|
//CV_RegisterVar(&cv_crosshair);
|
||||||
//CV_RegisterVar(&cv_crosshair2);
|
//CV_RegisterVar(&cv_crosshair2);
|
||||||
//CV_RegisterVar(&cv_crosshair3);
|
//CV_RegisterVar(&cv_crosshair3);
|
||||||
@@ -4564,7 +4580,7 @@ static void Command_Addfile(void)
|
|||||||
// Add file on your client directly if it is trivial, or you aren't in a netgame.
|
// Add file on your client directly if it is trivial, or you aren't in a netgame.
|
||||||
if (!(netgame || multiplayer) || musiconly)
|
if (!(netgame || multiplayer) || musiconly)
|
||||||
{
|
{
|
||||||
P_AddWadFile(fn);
|
P_AddWadFile(fn, false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4613,6 +4629,156 @@ static void Command_Addfile(void)
|
|||||||
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
|
SendNetXCmd(XD_ADDFILE, buf, buf_p - buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// i hate myself
|
||||||
|
static boolean DumbStartsWith(const char *pre, const char *str)
|
||||||
|
{
|
||||||
|
size_t lenpre = strlen(pre),
|
||||||
|
lenstr = strlen(str);
|
||||||
|
return lenstr < lenpre ? false : memcmp(pre, str, lenpre) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Adds something at runtime.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
Command_Addskins (void)
|
||||||
|
{
|
||||||
|
if (COM_Argc() > 3)
|
||||||
|
{
|
||||||
|
CONS_Printf(
|
||||||
|
"addskins <file>: Load a skin file.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// no forcing?
|
||||||
|
/*
|
||||||
|
if (fasticmp(COM_Argv(2), "-force") || fasticmp(COM_Argv(2), "-f")) {
|
||||||
|
CONS_Alert(CONS_NOTICE, M_GetText("Adding file %s. May or may not be a skin.\n"), COM_Argv(1));
|
||||||
|
P_AddWadFile(COM_Argv(1), 0, true);
|
||||||
|
} else {
|
||||||
|
if (DumbStartsWith("KC_", COM_Argv(1))) {
|
||||||
|
P_AddWadFile(COM_Argv(1), 0, true);
|
||||||
|
} else if (DumbStartsWith("KCL_", COM_Argv(1))) {
|
||||||
|
if (!demo.playback) {
|
||||||
|
CONS_Alert(CONS_ERROR, M_GetText("Cannot add file %s as it is a skin with lua. Include -force or -f to force it to load.\n"), COM_Argv(1));
|
||||||
|
return;
|
||||||
|
} else {
|
||||||
|
*/
|
||||||
|
P_AddWadFile(COM_Argv(1), true);
|
||||||
|
/*
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
CONS_Alert(CONS_ERROR, M_GetText("Cannot add file %s as it is not a skin.\n"), COM_Argv(1));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
// args n stuff
|
||||||
|
#include "args.h"
|
||||||
|
|
||||||
|
static void Command_GLocalSkin (void)
|
||||||
|
{
|
||||||
|
size_t first_option;
|
||||||
|
size_t option_display;
|
||||||
|
size_t option_all;
|
||||||
|
size_t option_player;
|
||||||
|
|
||||||
|
option_player = COM_CheckPartialParm("-p");
|
||||||
|
option_display = COM_CheckPartialParm("-d");
|
||||||
|
option_all = COM_CheckPartialParm("-a");
|
||||||
|
|
||||||
|
char* fuck; // local skin name
|
||||||
|
|
||||||
|
if (!( first_option = COM_FirstOption() ))
|
||||||
|
first_option = COM_Argc();
|
||||||
|
|
||||||
|
if (first_option < 2)
|
||||||
|
{
|
||||||
|
/* holy fucking shit */
|
||||||
|
CONS_Printf("localskin <name> [-player <name>] [-display <number>] [-all]:\n");
|
||||||
|
CONS_Printf(M_GetText("Set a localskin via its internal name (usually printed on the console).\n\n\
|
||||||
|
* Using \"-player\" will set a localskin to a specified player.\n\
|
||||||
|
Defaults to yourself.\n\
|
||||||
|
* Using \"-display\" will set a localskin to the displayed player.\n\
|
||||||
|
Defaults to 0, which is the first player displayed.\n\
|
||||||
|
Can go up to 3 for splitscreen.\n\
|
||||||
|
* Using \"-all\" will set a localskin to ALL players.\n\
|
||||||
|
* \"localskin none\" removes the localskin, just like how\n\
|
||||||
|
\"forceskin none\" does.\n"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
fuck = ConcatCommandArgv(1, first_option);
|
||||||
|
|
||||||
|
char* player_name = player_names[consoleplayer];
|
||||||
|
char* display_num = "0";
|
||||||
|
size_t dnum = 0;
|
||||||
|
|
||||||
|
if (option_display) // -display
|
||||||
|
{
|
||||||
|
// handle default: 0
|
||||||
|
if (COM_Argv(option_display + 1)[0] == "" || COM_Argv(option_display + 1)[0] != "-")
|
||||||
|
display_num = COM_Argv(option_display + 1);
|
||||||
|
|
||||||
|
if (isdigit(display_num[0]) || display_num == "0")
|
||||||
|
{
|
||||||
|
dnum = atoi(display_num);
|
||||||
|
if (dnum > 3 || dnum < 0) // nuh uh
|
||||||
|
dnum = 0;
|
||||||
|
SetLocalPlayerSkin(displayplayers[dnum], fuck, NULL);
|
||||||
|
|
||||||
|
CONS_Printf("Successfully applied localskin to displayed player.\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CONS_Printf("Could not apply localskin.\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else if (option_all) // -all
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; ++i)
|
||||||
|
{
|
||||||
|
if (!playeringame[i])
|
||||||
|
continue;
|
||||||
|
SetLocalPlayerSkin(i, fuck, NULL);
|
||||||
|
}
|
||||||
|
CONS_Printf("Successfully applied localskin to all players.\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else // -player or no other arguments
|
||||||
|
{
|
||||||
|
if (option_player)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
player_name = COM_Argv(option_player + 1);
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; ++i)
|
||||||
|
{
|
||||||
|
if (fasticmp(player_names[i], player_name))
|
||||||
|
SetLocalPlayerSkin(i, fuck, NULL);
|
||||||
|
}
|
||||||
|
CONS_Printf("Successfully applied localskin to specified player.\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetLocalPlayerSkin(consoleplayer, fuck, &cv_localskin);
|
||||||
|
CONS_Printf("Successfully applied localskin.\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CONS_Printf("Could not apply localskin.\n");
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef DELFILE
|
#ifdef DELFILE
|
||||||
/** removes the last added pwad at runtime.
|
/** removes the last added pwad at runtime.
|
||||||
* Searches for sounds, maps, music and images to remove
|
* Searches for sounds, maps, music and images to remove
|
||||||
@@ -4769,7 +4935,7 @@ static void Got_Addfilecmd(UINT8 **cp, INT32 playernum)
|
|||||||
|
|
||||||
ncs = findfile(filename,md5sum,true);
|
ncs = findfile(filename,md5sum,true);
|
||||||
|
|
||||||
if (ncs != FS_FOUND || !P_AddWadFile(filename))
|
if (ncs != FS_FOUND || !P_AddWadFile(filename, false))
|
||||||
{
|
{
|
||||||
Command_ExitGame_f();
|
Command_ExitGame_f();
|
||||||
if (ncs == FS_FOUND)
|
if (ncs == FS_FOUND)
|
||||||
@@ -5925,7 +6091,6 @@ static void Command_ListSkins(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/** Sends a color change for the console player, unless that player is moving.
|
/** Sends a color change for the console player, unless that player is moving.
|
||||||
* \sa cv_playercolor, Color2_OnChange, Skin_OnChange
|
* \sa cv_playercolor, Color2_OnChange, Skin_OnChange
|
||||||
* \author Graue <graue@oceanbase.org>
|
* \author Graue <graue@oceanbase.org>
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
extern consvar_t cv_playername;
|
extern consvar_t cv_playername;
|
||||||
extern consvar_t cv_playercolor;
|
extern consvar_t cv_playercolor;
|
||||||
extern consvar_t cv_skin;
|
extern consvar_t cv_skin;
|
||||||
|
extern consvar_t cv_localskin;
|
||||||
// secondary splitscreen player
|
// secondary splitscreen player
|
||||||
extern consvar_t cv_playername2;
|
extern consvar_t cv_playername2;
|
||||||
extern consvar_t cv_playercolor2;
|
extern consvar_t cv_playercolor2;
|
||||||
@@ -157,6 +158,8 @@ extern consvar_t cv_minihead;
|
|||||||
extern consvar_t cv_showlapemblem;
|
extern consvar_t cv_showlapemblem;
|
||||||
|
|
||||||
extern consvar_t cv_showviewpointtext;
|
extern consvar_t cv_showviewpointtext;
|
||||||
|
extern consvar_t cv_luaimmersion;
|
||||||
|
extern consvar_t cv_fakelocalskin;
|
||||||
|
|
||||||
extern consvar_t cv_skipmapcheck;
|
extern consvar_t cv_skipmapcheck;
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -513,7 +513,7 @@ INT32 CL_CheckFiles(void)
|
|||||||
|
|
||||||
for (i = 0, j = mainwads+1; i < fileneedednum || j < numwadfiles;)
|
for (i = 0, j = mainwads+1; i < fileneedednum || j < numwadfiles;)
|
||||||
{
|
{
|
||||||
if (j < numwadfiles && !wadfiles[j]->important)
|
if (j < numwadfiles && (!wadfiles[j]->important || wadfiles[j]->localfile))
|
||||||
{
|
{
|
||||||
// Unimportant on our side. still don't care.
|
// Unimportant on our side. still don't care.
|
||||||
++j;
|
++j;
|
||||||
|
|||||||
@@ -371,6 +371,7 @@ typedef struct player_s
|
|||||||
|
|
||||||
angle_t viewrollangle;
|
angle_t viewrollangle;
|
||||||
angle_t tilt;
|
angle_t tilt;
|
||||||
|
angle_t tilt_sprite;
|
||||||
|
|
||||||
// Mouse aiming, where the guy is looking at!
|
// Mouse aiming, where the guy is looking at!
|
||||||
// It is updated with cmd->aiming.
|
// It is updated with cmd->aiming.
|
||||||
@@ -415,6 +416,8 @@ typedef struct player_s
|
|||||||
UINT8 skincolor;
|
UINT8 skincolor;
|
||||||
|
|
||||||
INT32 skin;
|
INT32 skin;
|
||||||
|
INT32 localskin;
|
||||||
|
boolean skinlocal;
|
||||||
|
|
||||||
UINT32 score; // player score
|
UINT32 score; // player score
|
||||||
fixed_t dashspeed; // dashing speed
|
fixed_t dashspeed; // dashing speed
|
||||||
|
|||||||
+39
-2
@@ -37,7 +37,9 @@
|
|||||||
// length of IP strings
|
// length of IP strings
|
||||||
#define IP_SIZE 21
|
#define IP_SIZE 21
|
||||||
|
|
||||||
consvar_t cv_discordrp = {"discordrp", "On", CV_SAVE|CV_CALL, CV_OnOff, DRPC_UpdatePresence, 0, NULL, NULL, 0, 0, NULL};
|
static void Discordrp_OnChange(void);
|
||||||
|
|
||||||
|
consvar_t cv_discordrp = {"discordrp", "On", CV_SAVE|CV_CALL, CV_OnOff, Discordrp_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_discordstreamer = {"discordstreamer", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_discordstreamer = {"discordstreamer", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_discordasks = {"discordasks", "Yes", CV_SAVE|CV_CALL, CV_YesNo, DRPC_UpdatePresence, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_discordasks = {"discordasks", "Yes", CV_SAVE|CV_CALL, CV_YesNo, DRPC_UpdatePresence, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
@@ -47,6 +49,8 @@ discordRequest_t *discordRequestList = NULL;
|
|||||||
|
|
||||||
static char self_ip[IP_SIZE];
|
static char self_ip[IP_SIZE];
|
||||||
|
|
||||||
|
boolean drpc_init = false;
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
static char *DRPC_XORIPString(const char *input)
|
static char *DRPC_XORIPString(const char *input)
|
||||||
|
|
||||||
@@ -315,6 +319,9 @@ void DRPC_RemoveRequest(discordRequest_t *removeRequest)
|
|||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
void DRPC_Init(void)
|
void DRPC_Init(void)
|
||||||
{
|
{
|
||||||
|
if (drpc_init || !cv_discordrp.value) return;
|
||||||
|
|
||||||
|
drpc_init = true;
|
||||||
DiscordEventHandlers handlers;
|
DiscordEventHandlers handlers;
|
||||||
memset(&handlers, 0, sizeof(handlers));
|
memset(&handlers, 0, sizeof(handlers));
|
||||||
|
|
||||||
@@ -325,10 +332,36 @@ void DRPC_Init(void)
|
|||||||
handlers.joinRequest = DRPC_HandleJoinRequest;
|
handlers.joinRequest = DRPC_HandleJoinRequest;
|
||||||
|
|
||||||
Discord_Initialize(DISCORD_APPID, &handlers, 1, NULL);
|
Discord_Initialize(DISCORD_APPID, &handlers, 1, NULL);
|
||||||
I_AddExitFunc(Discord_Shutdown);
|
I_AddExitFunc(DRPC_Shutdown);
|
||||||
DRPC_UpdatePresence();
|
DRPC_UpdatePresence();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DRPC_Shutdown(void)
|
||||||
|
{
|
||||||
|
if (!drpc_init)
|
||||||
|
{
|
||||||
|
CONS_Printf("DiscordRPC never started\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
CONS_Printf("Shutting down DiscordRPC\n");
|
||||||
|
|
||||||
|
Discord_Shutdown();
|
||||||
|
drpc_init = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Discordrp_OnChange(void)
|
||||||
|
{
|
||||||
|
if (cv_discordrp.value)
|
||||||
|
{
|
||||||
|
DRPC_UpdatePresence();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DRPC_Shutdown();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
static void DRPC_GotServerIP(UINT32 address)
|
static void DRPC_GotServerIP(UINT32 address)
|
||||||
|
|
||||||
@@ -402,6 +435,10 @@ static void DRPC_EmptyRequests(void)
|
|||||||
--------------------------------------------------*/
|
--------------------------------------------------*/
|
||||||
void DRPC_UpdatePresence(void)
|
void DRPC_UpdatePresence(void)
|
||||||
{
|
{
|
||||||
|
if (!cv_discordrp.value) return;
|
||||||
|
|
||||||
|
if (!drpc_init) DRPC_Init();
|
||||||
|
|
||||||
char detailstr[48+1];
|
char detailstr[48+1];
|
||||||
|
|
||||||
char mapimg[8+1];
|
char mapimg[8+1];
|
||||||
|
|||||||
@@ -64,6 +64,13 @@ void DRPC_RemoveRequest(discordRequest_t *removeRequest);
|
|||||||
void DRPC_Init(void);
|
void DRPC_Init(void);
|
||||||
|
|
||||||
|
|
||||||
|
/*--------------------------------------------------
|
||||||
|
void DRPC_Shutdown(void);
|
||||||
|
|
||||||
|
Shutdown Discord Rich Presence if it was started at all.
|
||||||
|
--------------------------------------------------*/
|
||||||
|
void DRPC_Shutdown(void);
|
||||||
|
|
||||||
/*--------------------------------------------------
|
/*--------------------------------------------------
|
||||||
void DRPC_UpdatePresence(void);
|
void DRPC_UpdatePresence(void);
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -149,8 +149,8 @@ extern char logfilename[1024];
|
|||||||
#else
|
#else
|
||||||
#define VERSION 1 // Game version
|
#define VERSION 1 // Game version
|
||||||
#define SUBVERSION 6 // more precise version number
|
#define SUBVERSION 6 // more precise version number
|
||||||
#define VERSIONSTRING "Saturn v2 "
|
#define VERSIONSTRING "Saturn v3 "
|
||||||
#define VERSIONSTRINGW L"Saturn v2"
|
#define VERSIONSTRINGW L"Saturn v3"
|
||||||
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
// Hey! If you change this, add 1 to the MODVERSION below! Otherwise we can't force updates!
|
||||||
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
// And change CMakeLists.txt (not src/, but in root), for CMake users!
|
||||||
// AND appveyor.yml, for the build bots!
|
// AND appveyor.yml, for the build bots!
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ UINT8 graphics_started = 0;
|
|||||||
|
|
||||||
UINT8 keyboard_started = 0;
|
UINT8 keyboard_started = 0;
|
||||||
|
|
||||||
UINT32 I_GetFreeMem(UINT32 *total)
|
size_t I_GetFreeMem(size_t *total)
|
||||||
{
|
{
|
||||||
*total = 0;
|
*total = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -468,6 +468,10 @@ consvar_t cv_songcredits = {"songcredits", "On", CV_SAVE, CV_OnOff, NULL, 0, NUL
|
|||||||
// Show "FREE PLAY" when you're alone. :(
|
// Show "FREE PLAY" when you're alone. :(
|
||||||
consvar_t cv_showfreeplay = { "showfreeplay", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_showfreeplay = { "showfreeplay", "Yes", CV_SAVE, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
// We can disable special tunes!
|
||||||
|
consvar_t cv_growmusic = {"growmusic", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_supermusic = {"supermusic", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
/*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
/*consvar_t cv_crosshair = {"crosshair", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_crosshair2 = {"crosshair2", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_crosshair3 = {"crosshair3", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_crosshair3 = {"crosshair3", "Off", CV_SAVE, crosshair_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
@@ -846,6 +850,16 @@ void G_SetGameModified(boolean silent, boolean major)
|
|||||||
M_EndModeAttackRun();
|
M_EndModeAttackRun();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void G_SetWadModified(boolean silent, boolean major, UINT16 wadnum)
|
||||||
|
{
|
||||||
|
// now that we have a wad that is actually well, a gameplay changing mod
|
||||||
|
// (for later)
|
||||||
|
wadfiles[wadnum]->majormod = true;
|
||||||
|
|
||||||
|
// set our game to be marked as modified.
|
||||||
|
G_SetGameModified(silent, major);
|
||||||
|
}
|
||||||
|
|
||||||
/** Builds an original game map name from a map number.
|
/** Builds an original game map name from a map number.
|
||||||
* The complexity is due to MAPA0-MAPZZ.
|
* The complexity is due to MAPA0-MAPZZ.
|
||||||
*
|
*
|
||||||
@@ -2702,6 +2716,8 @@ void G_PlayerReborn(INT32 player)
|
|||||||
UINT8 mare;
|
UINT8 mare;
|
||||||
UINT8 skincolor;
|
UINT8 skincolor;
|
||||||
INT32 skin;
|
INT32 skin;
|
||||||
|
int localskin;
|
||||||
|
boolean skinlocal;
|
||||||
tic_t jointime;
|
tic_t jointime;
|
||||||
UINT8 splitscreenindex;
|
UINT8 splitscreenindex;
|
||||||
boolean spectator;
|
boolean spectator;
|
||||||
@@ -2748,6 +2764,8 @@ void G_PlayerReborn(INT32 player)
|
|||||||
|
|
||||||
skincolor = players[player].skincolor;
|
skincolor = players[player].skincolor;
|
||||||
skin = players[player].skin;
|
skin = players[player].skin;
|
||||||
|
localskin = players[player].localskin;
|
||||||
|
skinlocal = players[player].skinlocal;
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
kartspeed = players[player].kartspeed;
|
kartspeed = players[player].kartspeed;
|
||||||
kartweight = players[player].kartweight;
|
kartweight = players[player].kartweight;
|
||||||
@@ -2837,6 +2855,8 @@ void G_PlayerReborn(INT32 player)
|
|||||||
// save player config truth reborn
|
// save player config truth reborn
|
||||||
p->skincolor = skincolor;
|
p->skincolor = skincolor;
|
||||||
p->skin = skin;
|
p->skin = skin;
|
||||||
|
p->localskin = localskin;
|
||||||
|
p->skinlocal = skinlocal;
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
p->kartspeed = kartspeed;
|
p->kartspeed = kartspeed;
|
||||||
p->kartweight = kartweight;
|
p->kartweight = kartweight;
|
||||||
|
|||||||
@@ -113,6 +113,7 @@ extern INT16 rw_maximums[NUM_WEAPONS];
|
|||||||
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection/*, cv_compactscoreboard*/;
|
extern consvar_t cv_chatwidth, cv_chatnotifications, cv_chatheight, cv_chattime, cv_consolechat, cv_chatbacktint, cv_chatspamprotection/*, cv_compactscoreboard*/;
|
||||||
extern consvar_t cv_songcredits;
|
extern consvar_t cv_songcredits;
|
||||||
extern consvar_t cv_showfreeplay;
|
extern consvar_t cv_showfreeplay;
|
||||||
|
extern consvar_t cv_growmusic, cv_supermusic;
|
||||||
extern consvar_t cv_pauseifunfocused;
|
extern consvar_t cv_pauseifunfocused;
|
||||||
//extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4;
|
//extern consvar_t cv_crosshair, cv_crosshair2, cv_crosshair3, cv_crosshair4;
|
||||||
extern consvar_t cv_invertmouse/*, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove*/;
|
extern consvar_t cv_invertmouse/*, cv_alwaysfreelook, cv_chasefreelook, cv_mousemove*/;
|
||||||
@@ -402,6 +403,7 @@ boolean G_GetRetryFlag(void);
|
|||||||
void G_LoadGameData(void);
|
void G_LoadGameData(void);
|
||||||
void G_LoadGameSettings(void);
|
void G_LoadGameSettings(void);
|
||||||
|
|
||||||
|
void G_SetWadModified(boolean silent, boolean major, UINT16 wadnum);
|
||||||
void G_SetGameModified(boolean silent, boolean major);
|
void G_SetGameModified(boolean silent, boolean major);
|
||||||
|
|
||||||
void G_SetGamestate(gamestate_t newstate);
|
void G_SetGamestate(gamestate_t newstate);
|
||||||
|
|||||||
@@ -576,7 +576,6 @@ void HWR_SetPalette(RGBA_t *palette)
|
|||||||
Z_FreeTags(PU_HWRCACHE_UNLOCKED, PU_HWRCACHE_UNLOCKED);
|
Z_FreeTags(PU_HWRCACHE_UNLOCKED, PU_HWRCACHE_UNLOCKED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// Make sure texture is downloaded and set it as the source
|
// Make sure texture is downloaded and set it as the source
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -224,6 +224,7 @@ struct FSurfaceInfo
|
|||||||
RGBA_t PolyColor;
|
RGBA_t PolyColor;
|
||||||
RGBA_t TintColor;
|
RGBA_t TintColor;
|
||||||
RGBA_t FadeColor;
|
RGBA_t FadeColor;
|
||||||
|
UINT32 LightTableId;
|
||||||
FLightInfo LightInfo; // jimita 14032019
|
FLightInfo LightInfo; // jimita 14032019
|
||||||
};
|
};
|
||||||
typedef struct FSurfaceInfo FSurfaceInfo;
|
typedef struct FSurfaceInfo FSurfaceInfo;
|
||||||
@@ -231,6 +232,7 @@ typedef struct FSurfaceInfo FSurfaceInfo;
|
|||||||
enum hwdsetspecialstate
|
enum hwdsetspecialstate
|
||||||
{
|
{
|
||||||
HWD_SET_SHADERS,
|
HWD_SET_SHADERS,
|
||||||
|
HWD_SET_PALETTE_SHADER_ENABLED,
|
||||||
|
|
||||||
HWD_SET_TEXTUREFILTERMODE,
|
HWD_SET_TEXTUREFILTERMODE,
|
||||||
HWD_SET_TEXTUREANISOTROPICMODE,
|
HWD_SET_TEXTUREANISOTROPICMODE,
|
||||||
|
|||||||
+11
-11
@@ -122,7 +122,7 @@ void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option)
|
|||||||
flags |= PF_ForceWrapY;
|
flags |= PF_ForceWrapY;
|
||||||
|
|
||||||
// clip it since it is used for bunny scroll in doom I
|
// clip it since it is used for bunny scroll in doom I
|
||||||
HWD.pfnDrawPolygon(NULL, v, 4, flags);
|
HWD.pfnDrawPolygon(NULL, v, 4, flags, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap)
|
void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, fixed_t vscale, INT32 option, const UINT8 *colormap)
|
||||||
@@ -300,10 +300,10 @@ void HWR_DrawStretchyFixedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t
|
|||||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans];
|
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[hudtrans];
|
||||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||||
flags |= PF_Modulated;
|
flags |= PF_Modulated;
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
HWD.pfnDrawPolygon(&Surf, v, 4, flags, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
HWD.pfnDrawPolygon(NULL, v, 4, flags);
|
HWD.pfnDrawPolygon(NULL, v, 4, flags, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h)
|
void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscale, INT32 option, fixed_t sx, fixed_t sy, fixed_t w, fixed_t h)
|
||||||
@@ -454,10 +454,10 @@ void HWR_DrawCroppedPatch(GLPatch_t *gpatch, fixed_t x, fixed_t y, fixed_t pscal
|
|||||||
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
|
else if (alphalevel == 15) Surf.PolyColor.s.alpha = softwaretranstogl_hi[cv_translucenthud.value];
|
||||||
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
else Surf.PolyColor.s.alpha = softwaretranstogl[10-alphalevel];
|
||||||
flags |= PF_Modulated;
|
flags |= PF_Modulated;
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4, flags);
|
HWD.pfnDrawPolygon(&Surf, v, 4, flags, false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
HWD.pfnDrawPolygon(NULL, v, 4, flags);
|
HWD.pfnDrawPolygon(NULL, v, 4, flags, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@@ -533,7 +533,7 @@ void HWR_DrawFlatFill (INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum
|
|||||||
// BTW, I see we put 0 for PFs, and If I'm right, that
|
// BTW, I see we put 0 for PFs, and If I'm right, that
|
||||||
// means we take the previous PFs as default
|
// means we take the previous PFs as default
|
||||||
// how can we be sure they are ok?
|
// how can we be sure they are ok?
|
||||||
HWD.pfnDrawPolygon(NULL, v, 4, PF_NoDepthTest); //PF_Translucent);
|
HWD.pfnDrawPolygon(NULL, v, 4, PF_NoDepthTest, false); //PF_Translucent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -570,7 +570,7 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
|
|||||||
Surf.PolyColor.rgba = pLocalPalette[color].rgba;
|
Surf.PolyColor.rgba = pLocalPalette[color].rgba;
|
||||||
Surf.PolyColor.s.alpha = (UINT8)(strength*25.5f);
|
Surf.PolyColor.s.alpha = (UINT8)(strength*25.5f);
|
||||||
}
|
}
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Draw the console background with translucency support
|
// Draw the console background with translucency support
|
||||||
@@ -597,7 +597,7 @@ void HWR_DrawConsoleBack(UINT32 color, INT32 height)
|
|||||||
Surf.PolyColor.rgba = UINT2RGBA(color);
|
Surf.PolyColor.rgba = UINT2RGBA(color);
|
||||||
Surf.PolyColor.s.alpha = 0x80;
|
Surf.PolyColor.s.alpha = 0x80;
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -846,7 +846,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
|
|||||||
Surf.PolyColor = V_GetColor(color);
|
Surf.PolyColor = V_GetColor(color);
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4,
|
HWD.pfnDrawPolygon(&Surf, v, 4,
|
||||||
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
|
PF_Modulated|PF_NoTexture|PF_NoDepthTest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------+
|
// -------------------+
|
||||||
@@ -954,7 +954,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
|
|||||||
Surf.PolyColor.rgba = UINT2RGBA(color);
|
Surf.PolyColor.rgba = UINT2RGBA(color);
|
||||||
Surf.PolyColor.s.alpha = 0x80;
|
Surf.PolyColor.s.alpha = 0x80;
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest);
|
HWD.pfnDrawPolygon(&Surf, v, 4, PF_NoTexture|PF_Modulated|PF_Translucent|PF_NoDepthTest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
@@ -1062,7 +1062,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
|
|||||||
Surf.PolyColor = V_GetColor(color);
|
Surf.PolyColor = V_GetColor(color);
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4,
|
HWD.pfnDrawPolygon(&Surf, v, 4,
|
||||||
PF_Modulated|PF_NoTexture|PF_NoDepthTest);
|
PF_Modulated|PF_NoTexture|PF_NoDepthTest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PNG
|
#ifdef HAVE_PNG
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "hw_md2.h"
|
#include "hw_md2.h"
|
||||||
|
|
||||||
#include "hw_dll.h"
|
#include "hw_dll.h"
|
||||||
|
#include "../doomdef.h"
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// STANDARD DLL EXPORTS
|
// STANDARD DLL EXPORTS
|
||||||
@@ -34,7 +35,7 @@ EXPORT void HWRAPI(SetPalette) (RGBA_t *ppal, RGBA_t *pgamma);
|
|||||||
#endif
|
#endif
|
||||||
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
|
EXPORT void HWRAPI(FinishUpdate) (INT32 waitvbl);
|
||||||
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
EXPORT void HWRAPI(Draw2DLine) (F2DCoord *v1, F2DCoord *v2, RGBA_t Color);
|
||||||
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags);
|
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, boolean horizonSpecial);
|
||||||
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
|
EXPORT void HWRAPI(SetBlend) (FBITFIELD PolyFlags);
|
||||||
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FBOOLEAN StencilMask, FRGBAFloat *ClearColor);
|
EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask, FBOOLEAN DepthMask, FBOOLEAN StencilMask, FRGBAFloat *ClearColor);
|
||||||
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo);
|
EXPORT void HWRAPI(SetTexture) (FTextureInfo *TexInfo);
|
||||||
@@ -79,6 +80,9 @@ EXPORT void HWRAPI(InitCustomShaders) (void);
|
|||||||
EXPORT void HWRAPI(StartBatching) (void);
|
EXPORT void HWRAPI(StartBatching) (void);
|
||||||
EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, int *sNumPolys, int *sNumVerts, int *sNumCalls, int *sNumShaders, int *sNumTextures, int *sNumPolyFlags, int *sNumColors);
|
EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, int *sNumPolys, int *sNumVerts, int *sNumCalls, int *sNumShaders, int *sNumTextures, int *sNumPolyFlags, int *sNumColors);
|
||||||
|
|
||||||
|
EXPORT UINT32 HWRAPI(AddLightTable) (UINT8 *lighttable);
|
||||||
|
EXPORT void HWRAPI(ClearLightTableCache) (void);
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// HWR DRIVER OBJECT, FOR CLIENT PROGRAM
|
// HWR DRIVER OBJECT, FOR CLIENT PROGRAM
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@@ -125,6 +129,9 @@ struct hwdriver_s
|
|||||||
|
|
||||||
StartBatching pfnStartBatching;
|
StartBatching pfnStartBatching;
|
||||||
RenderBatches pfnRenderBatches;
|
RenderBatches pfnRenderBatches;
|
||||||
|
|
||||||
|
AddLightTable pfnAddLightTable;
|
||||||
|
ClearLightTableCache pfnClearLightTableCache;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct hwdriver_s hwdriver;
|
extern struct hwdriver_s hwdriver;
|
||||||
|
|||||||
+211
-57
@@ -30,6 +30,7 @@
|
|||||||
#include "../r_fps.h"
|
#include "../r_fps.h"
|
||||||
#include "../r_state.h"
|
#include "../r_state.h"
|
||||||
#include "../r_local.h"
|
#include "../r_local.h"
|
||||||
|
#include "../r_data.h"
|
||||||
#include "../r_patch.h" // a mystery as to what this is for
|
#include "../r_patch.h" // a mystery as to what this is for
|
||||||
#include "../r_bsp.h" // R_NoEncore
|
#include "../r_bsp.h" // R_NoEncore
|
||||||
#include "../r_main.h" // cv_fov
|
#include "../r_main.h" // cv_fov
|
||||||
@@ -60,10 +61,14 @@ struct hwdriver_s hwdriver;
|
|||||||
// Commands and console variables
|
// Commands and console variables
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
// keep the state here instead of in the cv var, so it always matches the state in r_opengl.c
|
||||||
|
int gr_use_palette_shader = 0;
|
||||||
|
|
||||||
static void CV_filtermode_ONChange(void);
|
static void CV_filtermode_ONChange(void);
|
||||||
static void CV_anisotropic_ONChange(void);
|
static void CV_anisotropic_ONChange(void);
|
||||||
static void CV_screentextures_ONChange(void);
|
static void CV_screentextures_ONChange(void);
|
||||||
static void CV_useCustomShaders_ONChange(void);
|
static void CV_useCustomShaders_ONChange(void);
|
||||||
|
static void CV_grpaletteshader_OnChange(void);
|
||||||
|
|
||||||
static CV_PossibleValue_t grfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSAMPLED, "Nearest"},
|
static CV_PossibleValue_t grfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSAMPLED, "Nearest"},
|
||||||
{HWD_SET_TEXTUREFILTER_BILINEAR, "Bilinear"}, {HWD_SET_TEXTUREFILTER_TRILINEAR, "Trilinear"},
|
{HWD_SET_TEXTUREFILTER_BILINEAR, "Bilinear"}, {HWD_SET_TEXTUREFILTER_TRILINEAR, "Trilinear"},
|
||||||
@@ -115,7 +120,11 @@ static INT32 current_bsp_culling_distance = 0;
|
|||||||
consvar_t cv_grscreentextures = {"gr_screentextures", "On", CV_CALL, CV_OnOff,
|
consvar_t cv_grscreentextures = {"gr_screentextures", "On", CV_CALL, CV_OnOff,
|
||||||
CV_screentextures_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
CV_screentextures_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
consvar_t cv_grusecustomshaders = {"gr_usecustomshaders", "Yes", CV_CALL|CV_SAVE, CV_OnOff, CV_useCustomShaders_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_grusecustomshaders = {"gr_usecustomshaders", "Yes", CV_CALL|CV_SAVE, CV_OnOff, CV_useCustomShaders_ONChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
consvar_t cv_grpaletteshader = {"gr_paletteshader", "Off", CV_CALL|CV_SAVE, CV_OnOff, CV_grpaletteshader_OnChange, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
|
consvar_t cv_grflashpal = {"gr_flashpal", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
static void CV_filtermode_ONChange(void)
|
static void CV_filtermode_ONChange(void)
|
||||||
{
|
{
|
||||||
@@ -138,6 +147,16 @@ static void CV_useCustomShaders_ONChange(void)
|
|||||||
HWD.pfnInitCustomShaders();
|
HWD.pfnInitCustomShaders();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void CV_grpaletteshader_OnChange(void)
|
||||||
|
{
|
||||||
|
if (rendermode == render_opengl)
|
||||||
|
{
|
||||||
|
HWD.pfnSetSpecialState(HWD_SET_PALETTE_SHADER_ENABLED, cv_grpaletteshader.value);
|
||||||
|
gr_use_palette_shader = cv_grpaletteshader.value;
|
||||||
|
V_SetPalette(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Globals
|
// Globals
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@@ -400,6 +419,7 @@ static size_t gr_numportalcullsectors = 0;
|
|||||||
void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap)
|
void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *colormap)
|
||||||
{
|
{
|
||||||
RGBA_t poly_color, tint_color, fade_color;
|
RGBA_t poly_color, tint_color, fade_color;
|
||||||
|
boolean default_colormap = false;
|
||||||
|
|
||||||
poly_color.rgba = 0xFFFFFFFF;
|
poly_color.rgba = 0xFFFFFFFF;
|
||||||
tint_color.rgba = (colormap != NULL) ? (UINT32)colormap->rgba : GL_DEFAULTMIX;
|
tint_color.rgba = (colormap != NULL) ? (UINT32)colormap->rgba : GL_DEFAULTMIX;
|
||||||
@@ -451,6 +471,37 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
|
|||||||
Surface->LightInfo.light_level = light_level;
|
Surface->LightInfo.light_level = light_level;
|
||||||
Surface->LightInfo.fade_start = (colormap != NULL) ? colormap->fadestart : 0;
|
Surface->LightInfo.fade_start = (colormap != NULL) ? colormap->fadestart : 0;
|
||||||
Surface->LightInfo.fade_end = (colormap != NULL) ? colormap->fadeend : 31;
|
Surface->LightInfo.fade_end = (colormap != NULL) ? colormap->fadeend : 31;
|
||||||
|
|
||||||
|
if (gr_use_palette_shader)
|
||||||
|
{
|
||||||
|
if (!colormap)
|
||||||
|
{
|
||||||
|
colormap = &extra_colormaps[num_extra_colormaps];
|
||||||
|
default_colormap = true;
|
||||||
|
}
|
||||||
|
if (!colormap->gl_lighttable_id)
|
||||||
|
{
|
||||||
|
UINT8 *colormap_pointer;
|
||||||
|
|
||||||
|
if (default_colormap)
|
||||||
|
{
|
||||||
|
colormap_pointer = colormaps;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
colormap_pointer = colormap->colormap;
|
||||||
|
}
|
||||||
|
colormap->gl_lighttable_id = HWD.pfnAddLightTable(colormap_pointer);
|
||||||
|
}
|
||||||
|
|
||||||
|
Surface->LightTableId = colormap->gl_lighttable_id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void HWR_ClearLightTableCache()
|
||||||
|
{
|
||||||
|
if (rendermode == render_opengl)
|
||||||
|
HWD.pfnClearLightTableCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap) // Let's see if this can work
|
UINT8 HWR_FogBlockAlpha(INT32 light, extracolormap_t *colormap) // Let's see if this can work
|
||||||
@@ -723,9 +774,82 @@ void HWR_RenderPlane(extrasubsector_t *xsub, boolean isceiling, fixed_t fixedhei
|
|||||||
else if (PolyFlags & PF_Ripple)
|
else if (PolyFlags & PF_Ripple)
|
||||||
HWD.pfnSetShader(5); // water shader
|
HWD.pfnSetShader(5); // water shader
|
||||||
else
|
else
|
||||||
HWD.pfnSetShader(1); // floor shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 9 : 1); // floor shader
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags);
|
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, PolyFlags, false);
|
||||||
|
|
||||||
|
if (subsector)
|
||||||
|
{
|
||||||
|
// Horizon lines
|
||||||
|
FOutVector horizonpts[6];
|
||||||
|
float dist, vx, vy;
|
||||||
|
float x1, y1, xd, yd;
|
||||||
|
UINT8 numplanes, j;
|
||||||
|
vertex_t v; // For determining the closest distance from the line to the camera, to split render planes for minimum distortion;
|
||||||
|
|
||||||
|
const float renderdist = 27000.0f; // How far out to properly render the plane
|
||||||
|
const float farrenderdist = 32768.0f; // From here, raise plane to horizon level to fill in the line with some texture distortion
|
||||||
|
|
||||||
|
seg_t *line = &segs[subsector->firstline];
|
||||||
|
|
||||||
|
for (i = 0; i < subsector->numlines; i++, line++)
|
||||||
|
{
|
||||||
|
if (line->linedef->special == 41 && R_PointOnSegSide(dup_viewx, dup_viewy, line) == 0)
|
||||||
|
{
|
||||||
|
P_ClosestPointOnLine(viewx, viewy, line->linedef, &v);
|
||||||
|
dist = FIXED_TO_FLOAT(R_PointToDist(v.x, v.y));
|
||||||
|
|
||||||
|
x1 = ((polyvertex_t *)line->pv1)->x;
|
||||||
|
y1 = ((polyvertex_t *)line->pv1)->y;
|
||||||
|
xd = ((polyvertex_t *)line->pv2)->x - x1;
|
||||||
|
yd = ((polyvertex_t *)line->pv2)->y - y1;
|
||||||
|
|
||||||
|
// Based on the seg length and the distance from the line, split horizon into multiple poly sets to reduce distortion
|
||||||
|
dist = sqrtf((xd*xd) + (yd*yd)) / dist / 16.0f;
|
||||||
|
if (dist > 100.0f)
|
||||||
|
numplanes = 100;
|
||||||
|
else
|
||||||
|
numplanes = (UINT8)dist + 1;
|
||||||
|
|
||||||
|
for (j = 0; j < numplanes; j++)
|
||||||
|
{
|
||||||
|
// Left side
|
||||||
|
vx = x1 + xd * j / numplanes;
|
||||||
|
vy = y1 + yd * j / numplanes;
|
||||||
|
SETUP3DVERT((&horizonpts[1]), vx, vy);
|
||||||
|
|
||||||
|
dist = sqrtf(powf(vx - gr_viewx, 2) + powf(vy - gr_viewy, 2));
|
||||||
|
vx = (vx - gr_viewx) * renderdist / dist + gr_viewx;
|
||||||
|
vy = (vy - gr_viewy) * renderdist / dist + gr_viewy;
|
||||||
|
SETUP3DVERT((&horizonpts[0]), vx, vy);
|
||||||
|
|
||||||
|
// Right side
|
||||||
|
vx = x1 + xd * (j+1) / numplanes;
|
||||||
|
vy = y1 + yd * (j+1) / numplanes;
|
||||||
|
SETUP3DVERT((&horizonpts[2]), vx, vy);
|
||||||
|
|
||||||
|
dist = sqrtf(powf(vx - gr_viewx, 2) + powf(vy - gr_viewy, 2));
|
||||||
|
vx = (vx - gr_viewx) * renderdist / dist + gr_viewx;
|
||||||
|
vy = (vy - gr_viewy) * renderdist / dist + gr_viewy;
|
||||||
|
SETUP3DVERT((&horizonpts[3]), vx, vy);
|
||||||
|
|
||||||
|
// Horizon fills
|
||||||
|
vx = (horizonpts[0].x - gr_viewx) * farrenderdist / renderdist + gr_viewx;
|
||||||
|
vy = (horizonpts[0].z - gr_viewy) * farrenderdist / renderdist + gr_viewy;
|
||||||
|
SETUP3DVERT((&horizonpts[5]), vx, vy);
|
||||||
|
horizonpts[5].y = gr_viewz;
|
||||||
|
|
||||||
|
vx = (horizonpts[3].x - gr_viewx) * farrenderdist / renderdist + gr_viewx;
|
||||||
|
vy = (horizonpts[3].z - gr_viewy) * farrenderdist / renderdist + gr_viewy;
|
||||||
|
SETUP3DVERT((&horizonpts[4]), vx, vy);
|
||||||
|
horizonpts[4].y = gr_viewz;
|
||||||
|
|
||||||
|
// Draw
|
||||||
|
HWD.pfnDrawPolygon(&Surf, horizonpts, 6, PolyFlags, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WALLSPLATS
|
#ifdef WALLSPLATS
|
||||||
@@ -788,8 +912,8 @@ static void HWR_DrawSegsSplats(FSurfaceInfo * pSurf)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnSetShader(2); // wall shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 2); // wall shader
|
||||||
HWD.pfnDrawPolygon(&pSurf, wallVerts, 4, i|PF_Modulated|PF_Decal);
|
HWD.pfnDrawPolygon(&pSurf, wallVerts, 4, i|PF_Modulated|PF_Decal, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -822,7 +946,7 @@ void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend
|
|||||||
{
|
{
|
||||||
HWR_Lighting(pSurf, lightlevel, wallcolormap);
|
HWR_Lighting(pSurf, lightlevel, wallcolormap);
|
||||||
|
|
||||||
HWD.pfnSetShader(2); // wall shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 2); // wall shader
|
||||||
|
|
||||||
// don't draw to color buffer when drawing to stencil
|
// don't draw to color buffer when drawing to stencil
|
||||||
if (gl_drawing_stencil)
|
if (gl_drawing_stencil)
|
||||||
@@ -831,7 +955,7 @@ void HWR_ProjectWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend
|
|||||||
blendmode &= ~PF_Masked;
|
blendmode &= ~PF_Masked;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude);
|
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode|PF_Modulated|PF_Occlude, false);
|
||||||
|
|
||||||
#ifdef WALLSPLATS
|
#ifdef WALLSPLATS
|
||||||
if (gr_curline->linedef->splats && cv_splats.value)
|
if (gr_curline->linedef->splats && cv_splats.value)
|
||||||
@@ -904,13 +1028,15 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
|
|||||||
{
|
{
|
||||||
if (pfloor && (pfloor->flags & FF_FOG))
|
if (pfloor && (pfloor->flags & FF_FOG))
|
||||||
{
|
{
|
||||||
lightnum = HWR_CalcWallLight(pfloor->master->frontsector->lightlevel, v1x, v1y, v2x, v2y);
|
|
||||||
colormap = pfloor->master->frontsector->extra_colormap;
|
colormap = pfloor->master->frontsector->extra_colormap;
|
||||||
|
lightnum = pfloor->master->frontsector->lightlevel;
|
||||||
|
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, v1x, v1y, v2x, v2y);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lightnum = HWR_CalcWallLight(*list[i].lightlevel, v1x, v1y, v2x, v2y);
|
|
||||||
colormap = list[i].extra_colormap;
|
colormap = list[i].extra_colormap;
|
||||||
|
lightnum = *list[i].lightlevel;
|
||||||
|
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, v1x, v1y, v2x, v2y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1001,9 +1127,22 @@ void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, FSurfa
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Found a break
|
#ifdef ESLOPE
|
||||||
bot = min(max(bheight, realbot), top);
|
if (endbheight > endtop)
|
||||||
|
endbot = endtop;
|
||||||
|
#endif
|
||||||
|
if (bheight >= top)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
//Found a break;
|
||||||
|
bot = bheight;
|
||||||
|
|
||||||
|
if (bot < realbot)
|
||||||
|
bot = realbot;
|
||||||
|
|
||||||
|
#ifdef ESLOPE
|
||||||
endbot = min(max(endbheight, endrealbot), endtop);
|
endbot = min(max(endbheight, endrealbot), endtop);
|
||||||
|
#endif
|
||||||
|
|
||||||
Surf->PolyColor.s.alpha = alpha;
|
Surf->PolyColor.s.alpha = alpha;
|
||||||
|
|
||||||
@@ -1125,7 +1264,7 @@ void HWR_DrawSkyWallList()
|
|||||||
HWD.pfnUnSetShader();
|
HWD.pfnUnSetShader();
|
||||||
for (i = 0; i < skyWallVertexArraySize; i++)
|
for (i = 0; i < skyWallVertexArraySize; i++)
|
||||||
{
|
{
|
||||||
HWD.pfnDrawPolygon(&surf, skyWallVertexArray + i * 4, 4, PF_Occlude|PF_Invisible|PF_NoTexture);
|
HWD.pfnDrawPolygon(&surf, skyWallVertexArray + i * 4, 4, PF_Occlude|PF_Invisible|PF_NoTexture, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1297,8 +1436,9 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||||||
cliphigh = (float)(texturehpeg + (gr_curline->flength*FRACUNIT));
|
cliphigh = (float)(texturehpeg + (gr_curline->flength*FRACUNIT));
|
||||||
}
|
}
|
||||||
|
|
||||||
lightnum = HWR_CalcWallLight(gr_frontsector->lightlevel, vs.x, vs.y, ve.x, ve.y);
|
|
||||||
colormap = gr_frontsector->extra_colormap;
|
colormap = gr_frontsector->extra_colormap;
|
||||||
|
lightnum = gr_frontsector->lightlevel;
|
||||||
|
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, vs.x, vs.y, ve.x, ve.y);
|
||||||
|
|
||||||
if (gr_frontsector)
|
if (gr_frontsector)
|
||||||
Surf.PolyColor.s.alpha = 255;
|
Surf.PolyColor.s.alpha = 255;
|
||||||
@@ -2119,8 +2259,10 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||||||
|
|
||||||
blendmode = PF_Fog|PF_NoTexture;
|
blendmode = PF_Fog|PF_NoTexture;
|
||||||
|
|
||||||
lightnum = HWR_CalcWallLight(rover->master->frontsector->lightlevel, vs.x, vs.y, ve.x, ve.y);
|
|
||||||
colormap = rover->master->frontsector->extra_colormap;
|
colormap = rover->master->frontsector->extra_colormap;
|
||||||
|
lightnum = rover->master->frontsector->lightlevel;
|
||||||
|
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, vs.x, vs.y, ve.x, ve.y);
|
||||||
|
|
||||||
|
|
||||||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
||||||
|
|
||||||
@@ -2242,8 +2384,9 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
|
|||||||
|
|
||||||
blendmode = PF_Fog|PF_NoTexture;
|
blendmode = PF_Fog|PF_NoTexture;
|
||||||
|
|
||||||
lightnum = HWR_CalcWallLight(rover->master->frontsector->lightlevel, vs.x, vs.y, ve.x, ve.y);
|
|
||||||
colormap = rover->master->frontsector->extra_colormap;
|
colormap = rover->master->frontsector->extra_colormap;
|
||||||
|
lightnum = rover->master->frontsector->lightlevel;
|
||||||
|
lightnum = colormap ? lightnum : HWR_CalcWallLight(lightnum, vs.x, vs.y, ve.x, ve.y);
|
||||||
|
|
||||||
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
Surf.PolyColor.s.alpha = HWR_FogBlockAlpha(rover->master->frontsector->lightlevel, rover->master->frontsector->extra_colormap);
|
||||||
|
|
||||||
@@ -2950,8 +3093,8 @@ void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t
|
|||||||
else
|
else
|
||||||
blendmode |= PF_Masked|PF_Modulated;
|
blendmode |= PF_Masked|PF_Modulated;
|
||||||
|
|
||||||
HWD.pfnSetShader(1); // floor shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 9 : 1); // floor shader
|
||||||
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode);
|
HWD.pfnDrawPolygon(&Surf, planeVerts, nrPlaneVerts, blendmode, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HWR_AddPolyObjectPlanes(void)
|
void HWR_AddPolyObjectPlanes(void)
|
||||||
@@ -3749,8 +3892,8 @@ static void HWR_DrawSpriteShadow(gr_vissprite_t *spr, GLPatch_t *gpatch, float t
|
|||||||
if (sSurf.PolyColor.s.alpha > floorheight/4)
|
if (sSurf.PolyColor.s.alpha > floorheight/4)
|
||||||
{
|
{
|
||||||
sSurf.PolyColor.s.alpha = (UINT8)(sSurf.PolyColor.s.alpha - floorheight/4);
|
sSurf.PolyColor.s.alpha = (UINT8)(sSurf.PolyColor.s.alpha - floorheight/4);
|
||||||
HWD.pfnSetShader(1); // floor shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 9 : 1); // floor shader
|
||||||
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated);
|
HWD.pfnDrawPolygon(&sSurf, swallVerts, 4, PF_Translucent|PF_Modulated, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3825,7 +3968,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
|||||||
FOutVector baseWallVerts[4]; // This is what the verts should end up as
|
FOutVector baseWallVerts[4]; // This is what the verts should end up as
|
||||||
GLPatch_t *gpatch;
|
GLPatch_t *gpatch;
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)spr->mobj->skin)->flags & SF_HIRES);
|
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->flags & SF_HIRES);
|
||||||
extracolormap_t *colormap;
|
extracolormap_t *colormap;
|
||||||
FUINT lightlevel;
|
FUINT lightlevel;
|
||||||
FBITFIELD blend = 0;
|
FBITFIELD blend = 0;
|
||||||
@@ -3849,7 +3992,7 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
|||||||
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
||||||
|
|
||||||
if (hires)
|
if (hires)
|
||||||
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)spr->mobj->skin)->highresscale);
|
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->highresscale);
|
||||||
|
|
||||||
gpatch = spr->gpatch; //W_CachePatchNum(spr->patchlumpnum, PU_CACHE);
|
gpatch = spr->gpatch; //W_CachePatchNum(spr->patchlumpnum, PU_CACHE);
|
||||||
|
|
||||||
@@ -4116,8 +4259,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
|||||||
|
|
||||||
Surf.PolyColor.s.alpha = alpha;
|
Surf.PolyColor.s.alpha = alpha;
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // sprite shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
|
||||||
|
|
||||||
top = bot;
|
top = bot;
|
||||||
#ifdef ESLOPE
|
#ifdef ESLOPE
|
||||||
@@ -4156,8 +4299,8 @@ static void HWR_SplitSprite(gr_vissprite_t *spr)
|
|||||||
|
|
||||||
Surf.PolyColor.s.alpha = alpha;
|
Surf.PolyColor.s.alpha = alpha;
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // sprite shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
@@ -4171,11 +4314,11 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
|||||||
FOutVector wallVerts[4];
|
FOutVector wallVerts[4];
|
||||||
GLPatch_t *gpatch; // sprite patch converted to hardware
|
GLPatch_t *gpatch; // sprite patch converted to hardware
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)spr->mobj->skin)->flags & SF_HIRES);
|
const boolean hires = (spr->mobj && spr->mobj->skin && ((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->flags & SF_HIRES);
|
||||||
if (spr->mobj)
|
if (spr->mobj)
|
||||||
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
this_scale = FIXED_TO_FLOAT(spr->mobj->scale);
|
||||||
if (hires)
|
if (hires)
|
||||||
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)spr->mobj->skin)->highresscale);
|
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->highresscale);
|
||||||
|
|
||||||
if (!spr->mobj)
|
if (!spr->mobj)
|
||||||
return;
|
return;
|
||||||
@@ -4309,8 +4452,8 @@ static void HWR_DrawSprite(gr_vissprite_t *spr)
|
|||||||
blend = PF_Translucent|PF_Occlude;
|
blend = PF_Translucent|PF_Occlude;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // sprite shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4403,8 +4546,8 @@ static inline void HWR_DrawPrecipitationSprite(gr_vissprite_t *spr)
|
|||||||
blend = PF_Translucent|PF_Occlude;
|
blend = PF_Translucent|PF_Occlude;
|
||||||
}
|
}
|
||||||
|
|
||||||
HWD.pfnSetShader(3); // sprite shader
|
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 3); // sprite shader
|
||||||
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated);
|
HWD.pfnDrawPolygon(&Surf, wallVerts, 4, blend|PF_Modulated, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@@ -4722,8 +4865,19 @@ void HWR_DrawSprites(void)
|
|||||||
else
|
else
|
||||||
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
if (spr->mobj && spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||||
{
|
{
|
||||||
|
md2_t *md2;
|
||||||
|
if (spr->mobj->localskin)
|
||||||
|
{
|
||||||
|
if (spr->mobj->skinlocal)
|
||||||
|
md2 = &md2_localplayermodels[(skin_t *)spr->mobj->localskin - localskins];
|
||||||
|
else
|
||||||
|
md2 = &md2_playermodels [(skin_t *)spr->mobj->localskin - skins];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
md2 = &md2_playermodels[(skin_t *)spr->mobj->skin - skins];
|
||||||
|
|
||||||
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
|
// 8/1/19: Only don't display player models if no default SPR_PLAY is found.
|
||||||
if (!cv_grmdls.value || ((md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound || md2_playermodels[(skin_t*)spr->mobj->skin-skins].scale < 0.0f) && ((!cv_grfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
|
if (!cv_grmdls.value || ((md2->notfound || md2->scale < 0.0f) && ((!cv_grfallbackplayermodel.value) || md2_models[SPR_PLAY].notfound || md2_models[SPR_PLAY].scale < 0.0f)) || spr->mobj->state == &states[S_PLAY_SIGN])
|
||||||
HWR_DrawSprite(spr);
|
HWR_DrawSprite(spr);
|
||||||
else
|
else
|
||||||
HWR_DrawMD2(spr);
|
HWR_DrawMD2(spr);
|
||||||
@@ -4970,7 +5124,7 @@ void HWR_ProjectSprite(mobj_t *thing)
|
|||||||
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
|
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
|
||||||
if (thing->skin && thing->sprite == SPR_PLAY)
|
if (thing->skin && thing->sprite == SPR_PLAY)
|
||||||
{
|
{
|
||||||
sprdef = &((skin_t *)thing->skin)->spritedef;
|
sprdef = &((skin_t *)( (thing->localskin) ? thing->localskin : thing->skin ))->spritedef;
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
sprinfo = &spriteinfo[thing->sprite];
|
sprinfo = &spriteinfo[thing->sprite];
|
||||||
#endif
|
#endif
|
||||||
@@ -5045,8 +5199,8 @@ void HWR_ProjectSprite(mobj_t *thing)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
if (thing->skin && ((skin_t *)( (thing->localskin) ? thing->localskin : thing->skin ))->flags & SF_HIRES)
|
||||||
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)thing->skin)->highresscale);
|
this_scale = this_scale * FIXED_TO_FLOAT(((skin_t *)( (thing->localskin) ? thing->localskin : thing->skin ))->highresscale);
|
||||||
|
|
||||||
spr_width = spritecachedinfo[lumpoff].width;
|
spr_width = spritecachedinfo[lumpoff].width;
|
||||||
spr_height = spritecachedinfo[lumpoff].height;
|
spr_height = spritecachedinfo[lumpoff].height;
|
||||||
@@ -5065,7 +5219,7 @@ void HWR_ProjectSprite(mobj_t *thing)
|
|||||||
rollsum = (thing->rollangle)+(thing->sloperoll);
|
rollsum = (thing->rollangle)+(thing->sloperoll);
|
||||||
|
|
||||||
rollangle = R_GetRollAngle(rollsum);
|
rollangle = R_GetRollAngle(rollsum);
|
||||||
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, sprinfo, rollangle);
|
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
|
||||||
|
|
||||||
if (rotsprite != NULL)
|
if (rotsprite != NULL)
|
||||||
{
|
{
|
||||||
@@ -5205,10 +5359,7 @@ void HWR_ProjectSprite(mobj_t *thing)
|
|||||||
if (thing->colorized)
|
if (thing->colorized)
|
||||||
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
|
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, thing->color, GTC_CACHE);
|
||||||
else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
|
else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
|
||||||
{
|
vis->colormap = R_GetLocalTranslationColormap(thing->skin, thing->localskin, thing->color, GTC_CACHE, thing->skinlocal);
|
||||||
size_t skinnum = (skin_t*)thing->skin-skins;
|
|
||||||
vis->colormap = R_GetTranslationColormap((INT32)skinnum, thing->color, GTC_CACHE);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, thing->color, GTC_CACHE);
|
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, thing->color, GTC_CACHE);
|
||||||
}
|
}
|
||||||
@@ -5696,8 +5847,18 @@ void RecursivePortalRendering(portal_t *rootportal, const float fpov, player_t *
|
|||||||
HWR_SetTransform(fpov, player);// restore transform
|
HWR_SetTransform(fpov, player);// restore transform
|
||||||
}
|
}
|
||||||
gr_collect_skywalls = false;
|
gr_collect_skywalls = false;
|
||||||
|
|
||||||
|
ps_numsprites.value.i = gr_visspritecount;
|
||||||
|
PS_START_TIMING(ps_hw_spritesorttime);
|
||||||
HWR_SortVisSprites();
|
HWR_SortVisSprites();
|
||||||
|
PS_STOP_TIMING(ps_hw_spritesorttime);
|
||||||
|
PS_START_TIMING(ps_hw_spritedrawtime);
|
||||||
HWR_DrawSprites();
|
HWR_DrawSprites();
|
||||||
|
PS_STOP_TIMING(ps_hw_spritedrawtime);
|
||||||
|
|
||||||
|
ps_numdrawnodes.value.i = 0;
|
||||||
|
ps_hw_nodesorttime.value.p = 0;
|
||||||
|
ps_hw_nodedrawtime.value.p = 0;
|
||||||
HWR_RenderDrawNodes();
|
HWR_RenderDrawNodes();
|
||||||
}
|
}
|
||||||
// free memory from portal list allocated by calls to Add2Lines
|
// free memory from portal list allocated by calls to Add2Lines
|
||||||
@@ -5713,6 +5874,7 @@ void RecursivePortalRendering(portal_t *rootportal, const float fpov, player_t *
|
|||||||
// TODO: is it okay if stencil test is on all the time even when its not needed?
|
// TODO: is it okay if stencil test is on all the time even when its not needed?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// Render the current frame.
|
// Render the current frame.
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@@ -5833,7 +5995,6 @@ void HWR_RenderFrame(INT32 viewnumber, player_t *player, boolean skybox)
|
|||||||
HWD.pfnSetSpecialState(HWD_SET_SHADERS, cv_grshaders.value);
|
HWD.pfnSetSpecialState(HWD_SET_SHADERS, cv_grshaders.value);
|
||||||
HWD.pfnSetShader(0);
|
HWD.pfnSetShader(0);
|
||||||
|
|
||||||
//drawcount = 0;
|
|
||||||
validcount++;
|
validcount++;
|
||||||
|
|
||||||
portalclipline = NULL;
|
portalclipline = NULL;
|
||||||
@@ -5871,18 +6032,8 @@ void HWR_RenderSinglePortal(portal_t *portal, size_t portalnum, float fpov, play
|
|||||||
portalcullsector = gr_portalcullsectors[portalnum];
|
portalcullsector = gr_portalcullsectors[portalnum];
|
||||||
HWR_RenderBSPNode((INT32)numnodes - 1);
|
HWR_RenderBSPNode((INT32)numnodes - 1);
|
||||||
|
|
||||||
// Draw MD2 and sprites
|
|
||||||
ps_numsprites.value.i = gr_visspritecount;
|
|
||||||
PS_START_TIMING(ps_hw_spritesorttime);
|
|
||||||
HWR_SortVisSprites();
|
HWR_SortVisSprites();
|
||||||
PS_STOP_TIMING(ps_hw_spritesorttime);
|
|
||||||
PS_START_TIMING(ps_hw_spritedrawtime);
|
|
||||||
HWR_DrawSprites();
|
HWR_DrawSprites();
|
||||||
PS_STOP_TIMING(ps_hw_spritedrawtime);
|
|
||||||
|
|
||||||
ps_numdrawnodes.value.i = 0;
|
|
||||||
ps_hw_nodesorttime.value.p = 0;
|
|
||||||
ps_hw_nodedrawtime.value.p = 0;
|
|
||||||
HWR_RenderDrawNodes();
|
HWR_RenderDrawNodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5951,6 +6102,8 @@ void HWR_AddCommands(void)
|
|||||||
CV_RegisterVar(&cv_portalline);
|
CV_RegisterVar(&cv_portalline);
|
||||||
CV_RegisterVar(&cv_portalonly);
|
CV_RegisterVar(&cv_portalonly);
|
||||||
CV_RegisterVar(&cv_secbright);
|
CV_RegisterVar(&cv_secbright);
|
||||||
|
CV_RegisterVar(&cv_grpaletteshader);
|
||||||
|
CV_RegisterVar(&cv_grflashpal);
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@@ -5992,7 +6145,6 @@ void HWR_Startup(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
// Free resources allocated by the hardware renderer
|
// Free resources allocated by the hardware renderer
|
||||||
// --------------------------------------------------------------------------
|
// --------------------------------------------------------------------------
|
||||||
@@ -6014,8 +6166,6 @@ void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend,
|
|||||||
|
|
||||||
pSurf->PolyColor.s.alpha = alpha; // put the alpha back after lighting
|
pSurf->PolyColor.s.alpha = alpha; // put the alpha back after lighting
|
||||||
|
|
||||||
HWD.pfnSetShader(2); // wall shader
|
|
||||||
|
|
||||||
if (blend & PF_Environment)
|
if (blend & PF_Environment)
|
||||||
blendmode |= PF_Occlude; // PF_Occlude must be used for solid objects
|
blendmode |= PF_Occlude; // PF_Occlude must be used for solid objects
|
||||||
|
|
||||||
@@ -6027,7 +6177,9 @@ void HWR_RenderWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, FBITFIELD blend,
|
|||||||
|
|
||||||
blendmode |= PF_Modulated; // No PF_Occlude means overlapping (incorrect) transparency
|
blendmode |= PF_Modulated; // No PF_Occlude means overlapping (incorrect) transparency
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode);
|
if (!fogwall)
|
||||||
|
HWD.pfnSetShader(gr_use_palette_shader ? 10 : 2); // wall shader
|
||||||
|
HWD.pfnDrawPolygon(pSurf, wallVerts, 4, blendmode, false);
|
||||||
|
|
||||||
#ifdef WALLSPLATS
|
#ifdef WALLSPLATS
|
||||||
if (gr_curline->linedef->splats && cv_splats.value)
|
if (gr_curline->linedef->splats && cv_splats.value)
|
||||||
@@ -6058,7 +6210,7 @@ void HWR_DoPostProcessor(player_t *player)
|
|||||||
|
|
||||||
// Armageddon Blast Flash!
|
// Armageddon Blast Flash!
|
||||||
// Could this even be considered postprocessor?
|
// Could this even be considered postprocessor?
|
||||||
if (player->flashcount)
|
if (player->flashcount && !cv_grpaletteshader.value || player->flashcount && cv_grpaletteshader.value && !cv_grflashpal.value)
|
||||||
{
|
{
|
||||||
FOutVector v[4];
|
FOutVector v[4];
|
||||||
FSurfaceInfo Surf;
|
FSurfaceInfo Surf;
|
||||||
@@ -6078,7 +6230,7 @@ void HWR_DoPostProcessor(player_t *player)
|
|||||||
|
|
||||||
Surf.PolyColor.s.alpha = 0xc0; // match software mode
|
Surf.PolyColor.s.alpha = 0xc0; // match software mode
|
||||||
|
|
||||||
HWD.pfnDrawPolygon(&Surf, v, 4, PF_Modulated|PF_Translucent|PF_NoTexture|PF_NoDepthTest);
|
HWD.pfnDrawPolygon(&Surf, v, 4, PF_Modulated|PF_Translucent|PF_NoTexture|PF_NoDepthTest, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cv_grscreentextures.value) // screen textures are needed for the rest of the effects
|
if (!cv_grscreentextures.value) // screen textures are needed for the rest of the effects
|
||||||
@@ -6187,6 +6339,8 @@ void HWR_MakeScreenFinalTexture(void)
|
|||||||
|
|
||||||
void HWR_DrawScreenFinalTexture(int width, int height)
|
void HWR_DrawScreenFinalTexture(int width, int height)
|
||||||
{
|
{
|
||||||
|
if (gr_use_palette_shader)
|
||||||
|
HWD.pfnSetShader(11); //post processing
|
||||||
HWD.pfnDrawScreenFinalTexture(width, height);
|
HWD.pfnDrawScreenFinalTexture(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -142,6 +142,8 @@ void HWR_AddLine(seg_t *line);
|
|||||||
boolean HWR_CheckBBox(fixed_t *bspcoord);
|
boolean HWR_CheckBBox(fixed_t *bspcoord);
|
||||||
void HWR_RenderDrawNodes(void);
|
void HWR_RenderDrawNodes(void);
|
||||||
|
|
||||||
|
void HWR_ClearLightTableCache(void);
|
||||||
|
|
||||||
// hw_main.c: Sprites
|
// hw_main.c: Sprites
|
||||||
void HWR_AddSprites(sector_t *sec);
|
void HWR_AddSprites(sector_t *sec);
|
||||||
void HWR_ProjectSprite(mobj_t *thing);
|
void HWR_ProjectSprite(mobj_t *thing);
|
||||||
@@ -179,6 +181,8 @@ extern consvar_t cv_grfallbackplayermodel;
|
|||||||
extern consvar_t cv_grbatching;
|
extern consvar_t cv_grbatching;
|
||||||
extern consvar_t cv_grrenderdistance;
|
extern consvar_t cv_grrenderdistance;
|
||||||
extern consvar_t cv_grusecustomshaders;
|
extern consvar_t cv_grusecustomshaders;
|
||||||
|
extern consvar_t cv_grpaletteshader;
|
||||||
|
extern consvar_t cv_grflashpal;
|
||||||
extern consvar_t cv_grportals;
|
extern consvar_t cv_grportals;
|
||||||
extern consvar_t cv_nostencil;
|
extern consvar_t cv_nostencil;
|
||||||
extern consvar_t cv_secbright;
|
extern consvar_t cv_secbright;
|
||||||
|
|||||||
+46
-14
@@ -75,6 +75,7 @@
|
|||||||
|
|
||||||
md2_t md2_models[NUMSPRITES];
|
md2_t md2_models[NUMSPRITES];
|
||||||
md2_t md2_playermodels[MAXSKINS];
|
md2_t md2_playermodels[MAXSKINS];
|
||||||
|
md2_t md2_localplayermodels[MAXSKINS];
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -487,6 +488,13 @@ void HWR_InitMD2(void)
|
|||||||
md2_playermodels[s].skin = -1;
|
md2_playermodels[s].skin = -1;
|
||||||
md2_playermodels[s].notfound = true;
|
md2_playermodels[s].notfound = true;
|
||||||
md2_playermodels[s].error = false;
|
md2_playermodels[s].error = false;
|
||||||
|
|
||||||
|
md2_localplayermodels[s].scale = -1.0f;
|
||||||
|
md2_localplayermodels[s].model = NULL;
|
||||||
|
md2_localplayermodels[s].grpatch = NULL;
|
||||||
|
md2_localplayermodels[s].skin = -1;
|
||||||
|
md2_localplayermodels[s].notfound = true;
|
||||||
|
md2_localplayermodels[s].error = false;
|
||||||
}
|
}
|
||||||
for (i = 0; i < NUMSPRITES; i++)
|
for (i = 0; i < NUMSPRITES; i++)
|
||||||
{
|
{
|
||||||
@@ -559,11 +567,12 @@ md2found:
|
|||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
|
void HWR_AddPlayerMD2(int skin, boolean local) // For MD2's that were added after startup
|
||||||
{
|
{
|
||||||
FILE *f;
|
FILE *f;
|
||||||
char name[20], filename[32];
|
char name[20], filename[32];
|
||||||
float scale, offset;
|
float scale, offset;
|
||||||
|
md2_t *md2s;
|
||||||
|
|
||||||
if (nomd2s)
|
if (nomd2s)
|
||||||
return;
|
return;
|
||||||
@@ -585,22 +594,23 @@ void HWR_AddPlayerMD2(int skin) // For MD2's that were added after startup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for any MD2s that match the names of sprite names!
|
md2s = ( (local) ? md2_localplayermodels : md2_playermodels );
|
||||||
|
// Check for any MD2s that match the names of player skins!
|
||||||
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
while (fscanf(f, "%19s %31s %f %f", name, filename, &scale, &offset) == 4)
|
||||||
{
|
{
|
||||||
if (stricmp(name, skins[skin].name) == 0)
|
if (stricmp(name, ( (local) ? localskins : skins )[skin].name) == 0)
|
||||||
{
|
{
|
||||||
md2_playermodels[skin].skin = skin;
|
md2s[skin].skin = skin;
|
||||||
md2_playermodels[skin].scale = scale;
|
md2s[skin].scale = scale;
|
||||||
md2_playermodels[skin].offset = offset;
|
md2s[skin].offset = offset;
|
||||||
md2_playermodels[skin].notfound = false;
|
md2s[skin].notfound = false;
|
||||||
strcpy(md2_playermodels[skin].filename, filename);
|
strcpy(md2s[skin].filename, filename);
|
||||||
goto playermd2found;
|
goto playermd2found;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//CONS_Printf("MD2 for player skin %s not found\n", skins[skin].name);
|
//CONS_Printf("MD2 for player skin %s not found\n", skins[skin].name);
|
||||||
md2_playermodels[skin].notfound = true;
|
md2s[skin].notfound = true;
|
||||||
playermd2found:
|
playermd2found:
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
@@ -1154,6 +1164,8 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||||||
{
|
{
|
||||||
R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp);
|
R_InterpolateMobjState(spr->mobj, FRACUNIT, &interp);
|
||||||
}
|
}
|
||||||
|
md2_t *md2s;
|
||||||
|
int skinnum;
|
||||||
|
|
||||||
// Apparently people don't like jump frames like that, so back it goes
|
// Apparently people don't like jump frames like that, so back it goes
|
||||||
//if (tics > durs)
|
//if (tics > durs)
|
||||||
@@ -1169,12 +1181,32 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||||||
// dont forget to enabled the depth test because we can't do this like
|
// dont forget to enabled the depth test because we can't do this like
|
||||||
// before: polygons models are not sorted
|
// before: polygons models are not sorted
|
||||||
|
|
||||||
|
/* fuck you */
|
||||||
|
if (spr->mobj->localskin)
|
||||||
|
{
|
||||||
|
if (spr->mobj->skinlocal)
|
||||||
|
{
|
||||||
|
md2s = md2_localplayermodels;
|
||||||
|
skinnum = (skin_t *)spr->mobj->localskin - localskins;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
md2s = md2_playermodels;
|
||||||
|
skinnum = (skin_t *)spr->mobj->localskin - skins;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
md2s = md2_playermodels;
|
||||||
|
skinnum = (skin_t *)spr->mobj->skin - skins;
|
||||||
|
}
|
||||||
|
|
||||||
// 1. load model+texture if not already loaded
|
// 1. load model+texture if not already loaded
|
||||||
// 2. draw model with correct position, rotation,...
|
// 2. draw model with correct position, rotation,...
|
||||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY && !md2_playermodels[(skin_t*)spr->mobj->skin-skins].notfound) // Use the player MD2 list if the mobj has a skin and is using the player sprites
|
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY && !md2s[skinnum].notfound) // Use the player MD2 list if the mobj has a skin and is using the player sprites
|
||||||
{
|
{
|
||||||
md2 = &md2_playermodels[(skin_t*)spr->mobj->skin-skins];
|
md2 = &md2s[skinnum];
|
||||||
md2->skin = (skin_t*)spr->mobj->skin-skins;
|
md2->skin = skinnum;
|
||||||
sprinfo = &spriteinfo[spr->mobj->sprite];
|
sprinfo = &spriteinfo[spr->mobj->sprite];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1239,7 +1271,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||||||
skinnum = TC_RAINBOW;
|
skinnum = TC_RAINBOW;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
skinnum = (INT32)((skin_t*)spr->mobj->skin-skins);
|
skinnum = (INT32)((skin_t*)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ) - ( (spr->mobj->skinlocal) ? localskins : skins ));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else skinnum = TC_DEFAULT;
|
else skinnum = TC_DEFAULT;
|
||||||
@@ -1306,7 +1338,7 @@ void HWR_DrawMD2(gr_vissprite_t *spr)
|
|||||||
p.z = FIXED_TO_FLOAT(interp.z);
|
p.z = FIXED_TO_FLOAT(interp.z);
|
||||||
|
|
||||||
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
if (spr->mobj->skin && spr->mobj->sprite == SPR_PLAY)
|
||||||
sprdef = &((skin_t *)spr->mobj->skin)->spritedef;
|
sprdef = &((skin_t *)( (spr->mobj->localskin) ? spr->mobj->localskin : spr->mobj->skin ))->spritedef;
|
||||||
else
|
else
|
||||||
sprdef = &sprites[spr->mobj->sprite];
|
sprdef = &sprites[spr->mobj->sprite];
|
||||||
|
|
||||||
|
|||||||
@@ -37,10 +37,11 @@ typedef struct
|
|||||||
|
|
||||||
extern md2_t md2_models[NUMSPRITES];
|
extern md2_t md2_models[NUMSPRITES];
|
||||||
extern md2_t md2_playermodels[MAXSKINS];
|
extern md2_t md2_playermodels[MAXSKINS];
|
||||||
|
extern md2_t md2_localplayermodels[MAXSKINS];
|
||||||
|
|
||||||
void HWR_InitMD2(void);
|
void HWR_InitMD2(void);
|
||||||
void HWR_DrawMD2(gr_vissprite_t *spr);
|
void HWR_DrawMD2(gr_vissprite_t *spr);
|
||||||
void HWR_AddPlayerMD2(INT32 skin);
|
void HWR_AddPlayerMD2(INT32 skin, boolean local);
|
||||||
void HWR_AddSpriteMD2(size_t spritenum);
|
void HWR_AddSpriteMD2(size_t spritenum);
|
||||||
|
|
||||||
#endif // _HW_MD2_H_
|
#endif // _HW_MD2_H_
|
||||||
@@ -26,10 +26,15 @@
|
|||||||
#include "r_opengl.h"
|
#include "r_opengl.h"
|
||||||
#include "r_vbo.h"
|
#include "r_vbo.h"
|
||||||
|
|
||||||
|
#include "../../v_video.h" // pLocalPalette
|
||||||
|
#include "../../r_data.h" // NearestColor
|
||||||
|
|
||||||
#include "../../p_tick.h" // for leveltime (NOTE: THIS IS BAD, FIGURE OUT HOW TO PROPERLY IMPLEMENT gl_leveltime)
|
#include "../../p_tick.h" // for leveltime (NOTE: THIS IS BAD, FIGURE OUT HOW TO PROPERLY IMPLEMENT gl_leveltime)
|
||||||
#include "../../i_system.h" // for I_GetPreciseTime (batching time measurements)
|
#include "../../i_system.h" // for I_GetPreciseTime (batching time measurements)
|
||||||
|
|
||||||
// Eeeeh not sure is this right way, but it works
|
#include "../hw_main.h"
|
||||||
|
|
||||||
|
// Eeeeh not sure is this right way, but it works < sry :c
|
||||||
extern consvar_t cv_grusecustomshaders;
|
extern consvar_t cv_grusecustomshaders;
|
||||||
|
|
||||||
extern fixed_t fovtan; // also extremely bad, I'm just too lazy!!!
|
extern fixed_t fovtan; // also extremely bad, I'm just too lazy!!!
|
||||||
@@ -44,12 +49,15 @@ struct GLRGBAFloat
|
|||||||
GLfloat alpha;
|
GLfloat alpha;
|
||||||
};
|
};
|
||||||
typedef struct GLRGBAFloat GLRGBAFloat;
|
typedef struct GLRGBAFloat GLRGBAFloat;
|
||||||
|
|
||||||
static const GLubyte white[4] = { 255, 255, 255, 255 };
|
static const GLubyte white[4] = { 255, 255, 255, 255 };
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// CONSTANTS
|
// CONSTANTS
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// With OpenGL 1.1+, the first texture should be 1
|
// With OpenGL 1.1+, the first texture should be 1
|
||||||
#define NOTEXTURE_NUM 0
|
#define NOTEXTURE_NUM 0
|
||||||
|
|
||||||
@@ -70,8 +78,17 @@ static GLuint tex_downloaded = 0;
|
|||||||
static GLfloat fov = 90.0f;
|
static GLfloat fov = 90.0f;
|
||||||
static FBITFIELD CurrentPolyFlags;
|
static FBITFIELD CurrentPolyFlags;
|
||||||
|
|
||||||
static FTextureInfo* gr_cachetail = NULL;
|
static FTextureInfo *gr_cachetail = NULL;
|
||||||
static FTextureInfo* gr_cachehead = NULL;
|
static FTextureInfo *gr_cachehead = NULL;
|
||||||
|
|
||||||
|
typedef struct LightTableCacheEntry_s
|
||||||
|
{
|
||||||
|
GLuint id;
|
||||||
|
struct LightTableCacheEntry_s *next;
|
||||||
|
} LightTableCacheEntry_t;
|
||||||
|
|
||||||
|
LightTableCacheEntry_t *ltcachehead = NULL;
|
||||||
|
LightTableCacheEntry_t *ltcachetail = NULL;
|
||||||
|
|
||||||
RGBA_t myPaletteData[256];
|
RGBA_t myPaletteData[256];
|
||||||
GLint screen_width = 0; // used by Draw2DLine()
|
GLint screen_width = 0; // used by Draw2DLine()
|
||||||
@@ -235,6 +252,7 @@ FUNCPRINTF void GL_DBG_Printf(const char *format, ...)
|
|||||||
#define pglTexEnvi glTexEnvi
|
#define pglTexEnvi glTexEnvi
|
||||||
#define pglTexParameteri glTexParameteri
|
#define pglTexParameteri glTexParameteri
|
||||||
#define pglTexImage2D glTexImage2D
|
#define pglTexImage2D glTexImage2D
|
||||||
|
#define pglTexImage3D glTexImage3D
|
||||||
|
|
||||||
/* Fog */
|
/* Fog */
|
||||||
#define pglFogf glFogf
|
#define pglFogf glFogf
|
||||||
@@ -355,6 +373,8 @@ typedef void (APIENTRY * PFNglTexParameteri) (GLenum target, GLenum pname, GLint
|
|||||||
static PFNglTexParameteri pglTexParameteri;
|
static PFNglTexParameteri pglTexParameteri;
|
||||||
typedef void (APIENTRY * PFNglTexImage2D) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
typedef void (APIENTRY * PFNglTexImage2D) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||||
static PFNglTexImage2D pglTexImage2D;
|
static PFNglTexImage2D pglTexImage2D;
|
||||||
|
typedef void (APIENTRY * PFNglTexImage3D) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels);
|
||||||
|
static PFNglTexImage3D pglTexImage3D;
|
||||||
|
|
||||||
/* Fog */
|
/* Fog */
|
||||||
typedef void (APIENTRY * PFNglFogf) (GLenum pname, GLfloat param);
|
typedef void (APIENTRY * PFNglFogf) (GLenum pname, GLfloat param);
|
||||||
@@ -511,6 +531,7 @@ typedef void (APIENTRY *PFNglLinkProgram) (GLuint);
|
|||||||
typedef void (APIENTRY *PFNglGetProgramiv) (GLuint, GLenum, GLint*);
|
typedef void (APIENTRY *PFNglGetProgramiv) (GLuint, GLenum, GLint*);
|
||||||
typedef void (APIENTRY *PFNglUseProgram) (GLuint);
|
typedef void (APIENTRY *PFNglUseProgram) (GLuint);
|
||||||
typedef void (APIENTRY *PFNglUniform1i) (GLint, GLint);
|
typedef void (APIENTRY *PFNglUniform1i) (GLint, GLint);
|
||||||
|
typedef void (APIENTRY *PFNglUniform1iv) (GLint, GLsizei, const GLint*);
|
||||||
typedef void (APIENTRY *PFNglUniform1f) (GLint, GLfloat);
|
typedef void (APIENTRY *PFNglUniform1f) (GLint, GLfloat);
|
||||||
typedef void (APIENTRY *PFNglUniform2f) (GLint, GLfloat, GLfloat);
|
typedef void (APIENTRY *PFNglUniform2f) (GLint, GLfloat, GLfloat);
|
||||||
typedef void (APIENTRY *PFNglUniform3f) (GLint, GLfloat, GLfloat, GLfloat);
|
typedef void (APIENTRY *PFNglUniform3f) (GLint, GLfloat, GLfloat, GLfloat);
|
||||||
@@ -532,6 +553,7 @@ static PFNglLinkProgram pglLinkProgram;
|
|||||||
static PFNglGetProgramiv pglGetProgramiv;
|
static PFNglGetProgramiv pglGetProgramiv;
|
||||||
static PFNglUseProgram pglUseProgram;
|
static PFNglUseProgram pglUseProgram;
|
||||||
static PFNglUniform1i pglUniform1i;
|
static PFNglUniform1i pglUniform1i;
|
||||||
|
static PFNglUniform1iv pglUniform1iv;
|
||||||
static PFNglUniform1f pglUniform1f;
|
static PFNglUniform1f pglUniform1f;
|
||||||
static PFNglUniform2f pglUniform2f;
|
static PFNglUniform2f pglUniform2f;
|
||||||
static PFNglUniform3f pglUniform3f;
|
static PFNglUniform3f pglUniform3f;
|
||||||
@@ -555,6 +577,10 @@ static boolean gl_shaderprogramchanged = true;
|
|||||||
|
|
||||||
static boolean gl_batching = false;// are we currently collecting batches?
|
static boolean gl_batching = false;// are we currently collecting batches?
|
||||||
|
|
||||||
|
static GLint gl_palette[768];
|
||||||
|
static INT32 gl_use_palette_shader = 0;
|
||||||
|
boolean gl_palette_initialized = false;
|
||||||
|
|
||||||
static INT32 gl_enable_screen_textures = 1;
|
static INT32 gl_enable_screen_textures = 1;
|
||||||
|
|
||||||
static GLint gl_portal_stencil_level = 0;
|
static GLint gl_portal_stencil_level = 0;
|
||||||
@@ -572,7 +598,12 @@ typedef enum
|
|||||||
gluniform_fade_start,
|
gluniform_fade_start,
|
||||||
gluniform_fade_end,
|
gluniform_fade_end,
|
||||||
|
|
||||||
// misc. (custom shaders)
|
// palette rendering
|
||||||
|
gluniform_palette,
|
||||||
|
gluniform_color_lookup,
|
||||||
|
gluniform_lighttable_tex,
|
||||||
|
|
||||||
|
// misc.
|
||||||
gluniform_leveltime,
|
gluniform_leveltime,
|
||||||
|
|
||||||
gluniform_max,
|
gluniform_max,
|
||||||
@@ -594,6 +625,18 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
|
|||||||
// GLSL Software fragment shader
|
// GLSL Software fragment shader
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#define GLSL_DOOM_COLORMAP_floors \
|
||||||
|
"float R_DoomColormap(float light, float z)\n" \
|
||||||
|
"{\n" \
|
||||||
|
"float lightnum = clamp(light / 17.0, 0.0, 15.0);\n" \
|
||||||
|
"float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \
|
||||||
|
"float startmap = (15.0 - lightnum) * 4.0;\n" \
|
||||||
|
"float scale = 160.0 / (lightz + 1.0);\n" \
|
||||||
|
"return startmap * 1.06 - scale * 0.5 * 1.15;\n" \
|
||||||
|
"}\n"
|
||||||
|
|
||||||
|
// 1.06 and 1.15 were chosen when trying to match software lighting in a test map
|
||||||
|
|
||||||
#define GLSL_DOOM_COLORMAP \
|
#define GLSL_DOOM_COLORMAP \
|
||||||
"float R_DoomColormap(float light, float z)\n" \
|
"float R_DoomColormap(float light, float z)\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
@@ -604,6 +647,16 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
|
|||||||
"return startmap - scale * 0.5;\n" \
|
"return startmap - scale * 0.5;\n" \
|
||||||
"}\n"
|
"}\n"
|
||||||
|
|
||||||
|
#define GLSL_DOOM_COLORMAP_walls \
|
||||||
|
"float R_DoomColormap(float light, float z)\n" \
|
||||||
|
"{\n" \
|
||||||
|
"float lightnum = clamp(light / 17.0, 0.0, 15.0);\n" \
|
||||||
|
"float lightz = clamp(z / 16.0, 0.0, 127.0);\n" \
|
||||||
|
"float startmap = (15.0 - lightnum) * 4.0;\n" \
|
||||||
|
"float scale = 160.0 / (lightz + 1.0);\n" \
|
||||||
|
"return startmap * 1.05 - scale * 1.0 * 1.1;\n" \
|
||||||
|
"}\n"
|
||||||
|
|
||||||
#define GLSL_DOOM_LIGHT_EQUATION \
|
#define GLSL_DOOM_LIGHT_EQUATION \
|
||||||
"float R_DoomLightingEquation(float light)\n" \
|
"float R_DoomLightingEquation(float light)\n" \
|
||||||
"{\n" \
|
"{\n" \
|
||||||
@@ -631,16 +684,16 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
|
|||||||
"}\n" \
|
"}\n" \
|
||||||
"final_color = mix(final_color, fade_color, darkness);\n"
|
"final_color = mix(final_color, fade_color, darkness);\n"
|
||||||
|
|
||||||
#define GLSL_SOFTWARE_FRAGMENT_SHADER \
|
#define GLSL_SOFTWARE_UNIFORMS \
|
||||||
"uniform sampler2D tex;\n" \
|
"uniform sampler2D tex;\n" \
|
||||||
"uniform vec4 poly_color;\n" \
|
"uniform vec4 poly_color;\n" \
|
||||||
"uniform vec4 tint_color;\n" \
|
"uniform vec4 tint_color;\n" \
|
||||||
"uniform vec4 fade_color;\n" \
|
"uniform vec4 fade_color;\n" \
|
||||||
"uniform float lighting;\n" \
|
"uniform float lighting;\n" \
|
||||||
"uniform float fade_start;\n" \
|
"uniform float fade_start;\n" \
|
||||||
"uniform float fade_end;\n" \
|
"uniform float fade_end;\n"
|
||||||
GLSL_DOOM_COLORMAP \
|
|
||||||
GLSL_DOOM_LIGHT_EQUATION \
|
#define GLSL_SOFTWARE_MAIN \
|
||||||
"void main(void) {\n" \
|
"void main(void) {\n" \
|
||||||
"vec4 texel = texture2D(tex, gl_TexCoord[0].st);\n" \
|
"vec4 texel = texture2D(tex, gl_TexCoord[0].st);\n" \
|
||||||
"vec4 base_color = texel * poly_color;\n" \
|
"vec4 base_color = texel * poly_color;\n" \
|
||||||
@@ -649,7 +702,59 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
|
|||||||
GLSL_SOFTWARE_FADE_EQUATION \
|
GLSL_SOFTWARE_FADE_EQUATION \
|
||||||
"final_color.a = texel.a * poly_color.a;\n" \
|
"final_color.a = texel.a * poly_color.a;\n" \
|
||||||
"gl_FragColor = final_color;\n" \
|
"gl_FragColor = final_color;\n" \
|
||||||
"}\0"
|
"}\n"
|
||||||
|
|
||||||
|
#define GLSL_SOFTWARE_FRAGMENT_SHADER_FLOORS \
|
||||||
|
GLSL_SOFTWARE_UNIFORMS \
|
||||||
|
GLSL_DOOM_COLORMAP_floors \
|
||||||
|
GLSL_DOOM_LIGHT_EQUATION \
|
||||||
|
GLSL_SOFTWARE_MAIN \
|
||||||
|
"\0"
|
||||||
|
|
||||||
|
#define GLSL_SOFTWARE_FRAGMENT_SHADER_WALLS \
|
||||||
|
GLSL_SOFTWARE_UNIFORMS \
|
||||||
|
GLSL_DOOM_COLORMAP_walls \
|
||||||
|
GLSL_DOOM_LIGHT_EQUATION \
|
||||||
|
GLSL_SOFTWARE_MAIN \
|
||||||
|
"\0"
|
||||||
|
|
||||||
|
#define GLSL_SOFTWARE_PAL_UNIFORMS \
|
||||||
|
"uniform sampler2D tex;\n" \
|
||||||
|
"uniform sampler2D lighttable_tex;\n" \
|
||||||
|
"uniform sampler3D lookup_tex;\n" \
|
||||||
|
"uniform int palette[768];\n" \
|
||||||
|
"uniform vec4 poly_color;\n" \
|
||||||
|
"uniform float lighting;\n" \
|
||||||
|
|
||||||
|
#define GLSL_SOFTWARE_PAL_MAIN \
|
||||||
|
"void main(void) {\n" \
|
||||||
|
"vec4 texel = texture2D(tex, gl_TexCoord[0].st);\n" \
|
||||||
|
"int tex_pal_idx = int(texture3D(lookup_tex, vec3((texel * 63.0 + 0.5) / 64.0))[0] * 255.0);\n" \
|
||||||
|
"float z = gl_FragCoord.z / gl_FragCoord.w;\n" \
|
||||||
|
"int light_y = int(clamp(floor(R_DoomColormap(lighting, z)), 0.0, 31.0));\n" \
|
||||||
|
"vec2 lighttable_coord = vec2((float(tex_pal_idx) + 0.5) / 256.0, (float(light_y) + 0.5) / 32.0);\n" \
|
||||||
|
"int final_idx = int(texture2D(lighttable_tex, lighttable_coord)[0] * 255.0);\n" \
|
||||||
|
"vec4 final_color = vec4(float(palette[final_idx*3])/255.0, float(palette[final_idx*3+1])/255.0, float(palette[final_idx*3+2])/255.0, 1.0);\n" \
|
||||||
|
"final_color.a = texel.a * poly_color.a;\n" \
|
||||||
|
"gl_FragColor = final_color;\n" \
|
||||||
|
"}\n"
|
||||||
|
|
||||||
|
#define GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_FLOORS \
|
||||||
|
GLSL_SOFTWARE_PAL_UNIFORMS \
|
||||||
|
GLSL_DOOM_COLORMAP_floors \
|
||||||
|
GLSL_SOFTWARE_PAL_MAIN \
|
||||||
|
"\0"
|
||||||
|
|
||||||
|
#define GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_WALLS \
|
||||||
|
GLSL_SOFTWARE_PAL_UNIFORMS \
|
||||||
|
GLSL_DOOM_COLORMAP_walls \
|
||||||
|
GLSL_SOFTWARE_PAL_MAIN \
|
||||||
|
"\0"
|
||||||
|
|
||||||
|
#define GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_POSTPROCESS \
|
||||||
|
GLSL_SOFTWARE_PAL_UNIFORMS \
|
||||||
|
GLSL_SOFTWARE_PAL_MAIN \
|
||||||
|
"\0"
|
||||||
|
|
||||||
//
|
//
|
||||||
// Water surface shader
|
// Water surface shader
|
||||||
@@ -709,6 +814,20 @@ static gl_shaderprogram_t gl_shaderprograms[MAXSHADERPROGRAMS];
|
|||||||
"gl_FragColor = final_color;\n" \
|
"gl_FragColor = final_color;\n" \
|
||||||
"}\0"
|
"}\0"
|
||||||
|
|
||||||
|
//
|
||||||
|
// Palette color quantization shader
|
||||||
|
//
|
||||||
|
|
||||||
|
#define GLSL_PALETTE_FRAGMENT_SHADER \
|
||||||
|
"uniform sampler2D tex;\n" \
|
||||||
|
"uniform sampler3D lookup_tex;\n" \
|
||||||
|
"uniform int palette[768];\n" \
|
||||||
|
"void main(void) {\n" \
|
||||||
|
"vec3 texel = vec3(texture2D(tex, gl_TexCoord[0].st));\n" \
|
||||||
|
"int pal_idx = int(texture3D(lookup_tex, vec3((63.0/64.0) * texel + 1.0 / 128.0))[0] * 255.0);\n" \
|
||||||
|
"gl_FragColor = vec4(float(palette[pal_idx*3])/255.0, float(palette[pal_idx*3+1])/255.0, float(palette[pal_idx*3+2])/255.0, 1.0);\n" \
|
||||||
|
"}\0"
|
||||||
|
|
||||||
//
|
//
|
||||||
// GLSL generic fragment shader
|
// GLSL generic fragment shader
|
||||||
//
|
//
|
||||||
@@ -725,16 +844,16 @@ static const char *fragment_shaders[] = {
|
|||||||
GLSL_DEFAULT_FRAGMENT_SHADER,
|
GLSL_DEFAULT_FRAGMENT_SHADER,
|
||||||
|
|
||||||
// Floor fragment shader
|
// Floor fragment shader
|
||||||
GLSL_SOFTWARE_FRAGMENT_SHADER,
|
GLSL_SOFTWARE_FRAGMENT_SHADER_FLOORS,
|
||||||
|
|
||||||
// Wall fragment shader
|
// Wall fragment shader
|
||||||
GLSL_SOFTWARE_FRAGMENT_SHADER,
|
GLSL_SOFTWARE_FRAGMENT_SHADER_WALLS,
|
||||||
|
|
||||||
// Sprite fragment shader
|
// Sprite fragment shader
|
||||||
GLSL_SOFTWARE_FRAGMENT_SHADER,
|
GLSL_SOFTWARE_FRAGMENT_SHADER_WALLS,
|
||||||
|
|
||||||
// Model fragment shader
|
// Model fragment shader
|
||||||
GLSL_SOFTWARE_FRAGMENT_SHADER,
|
GLSL_SOFTWARE_FRAGMENT_SHADER_WALLS,
|
||||||
|
|
||||||
// Water fragment shader
|
// Water fragment shader
|
||||||
GLSL_WATER_FRAGMENT_SHADER,
|
GLSL_WATER_FRAGMENT_SHADER,
|
||||||
@@ -748,6 +867,15 @@ static const char *fragment_shaders[] = {
|
|||||||
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
|
"gl_FragColor = texture2D(tex, gl_TexCoord[0].st);\n"
|
||||||
"}\0",
|
"}\0",
|
||||||
|
|
||||||
|
// Palette fragment shader
|
||||||
|
GLSL_PALETTE_FRAGMENT_SHADER,
|
||||||
|
|
||||||
|
GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_FLOORS,
|
||||||
|
|
||||||
|
GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_WALLS,
|
||||||
|
|
||||||
|
GLSL_SOFTWARE_PAL_FRAGMENT_SHADER_POSTPROCESS,
|
||||||
|
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -793,6 +921,13 @@ static const char *vertex_shaders[] = {
|
|||||||
// Sky vertex shader
|
// Sky vertex shader
|
||||||
GLSL_DEFAULT_VERTEX_SHADER,
|
GLSL_DEFAULT_VERTEX_SHADER,
|
||||||
|
|
||||||
|
// Palette vertex shader
|
||||||
|
GLSL_DEFAULT_VERTEX_SHADER,
|
||||||
|
|
||||||
|
GLSL_DEFAULT_VERTEX_SHADER,
|
||||||
|
|
||||||
|
GLSL_DEFAULT_VERTEX_SHADER,
|
||||||
|
|
||||||
NULL,
|
NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -800,6 +935,7 @@ static const char *vertex_shaders[] = {
|
|||||||
|
|
||||||
void SetupGLFunc4(void)
|
void SetupGLFunc4(void)
|
||||||
{
|
{
|
||||||
|
pglTexImage3D = GetGLFunc("glTexImage3D");
|
||||||
pglActiveTexture = GetGLFunc("glActiveTexture");
|
pglActiveTexture = GetGLFunc("glActiveTexture");
|
||||||
pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f");
|
pglMultiTexCoord2f = GetGLFunc("glMultiTexCoord2f");
|
||||||
pglClientActiveTexture = GetGLFunc("glClientActiveTexture");
|
pglClientActiveTexture = GetGLFunc("glClientActiveTexture");
|
||||||
@@ -826,6 +962,7 @@ void SetupGLFunc4(void)
|
|||||||
pglGetProgramiv = GetGLFunc("glGetProgramiv");
|
pglGetProgramiv = GetGLFunc("glGetProgramiv");
|
||||||
pglUseProgram = GetGLFunc("glUseProgram");
|
pglUseProgram = GetGLFunc("glUseProgram");
|
||||||
pglUniform1i = GetGLFunc("glUniform1i");
|
pglUniform1i = GetGLFunc("glUniform1i");
|
||||||
|
pglUniform1iv = GetGLFunc("glUniform1iv");
|
||||||
pglUniform1f = GetGLFunc("glUniform1f");
|
pglUniform1f = GetGLFunc("glUniform1f");
|
||||||
pglUniform2f = GetGLFunc("glUniform2f");
|
pglUniform2f = GetGLFunc("glUniform2f");
|
||||||
pglUniform3f = GetGLFunc("glUniform3f");
|
pglUniform3f = GetGLFunc("glUniform3f");
|
||||||
@@ -865,6 +1002,7 @@ EXPORT boolean HWRAPI(LoadShaders) (void)
|
|||||||
if (cv_grusecustomshaders.value && gl_customfragmentshaders[i])
|
if (cv_grusecustomshaders.value && gl_customfragmentshaders[i])
|
||||||
frag_shader = gl_customfragmentshaders[i];
|
frag_shader = gl_customfragmentshaders[i];
|
||||||
|
|
||||||
|
|
||||||
if (i >= MAXSHADERS)
|
if (i >= MAXSHADERS)
|
||||||
break;
|
break;
|
||||||
if (i >= MAXSHADERPROGRAMS)
|
if (i >= MAXSHADERPROGRAMS)
|
||||||
@@ -947,10 +1085,37 @@ EXPORT boolean HWRAPI(LoadShaders) (void)
|
|||||||
shader->uniforms[gluniform_fade_start] = GETUNI("fade_start");
|
shader->uniforms[gluniform_fade_start] = GETUNI("fade_start");
|
||||||
shader->uniforms[gluniform_fade_end] = GETUNI("fade_end");
|
shader->uniforms[gluniform_fade_end] = GETUNI("fade_end");
|
||||||
|
|
||||||
|
// palette rendering
|
||||||
|
shader->uniforms[gluniform_palette] = GETUNI("palette");
|
||||||
|
shader->uniforms[gluniform_color_lookup] = GETUNI("lookup_tex");
|
||||||
|
shader->uniforms[gluniform_lighttable_tex] = GETUNI("lighttable_tex");
|
||||||
|
|
||||||
// misc. (custom shaders)
|
// misc. (custom shaders)
|
||||||
shader->uniforms[gluniform_leveltime] = GETUNI("leveltime");
|
shader->uniforms[gluniform_leveltime] = GETUNI("leveltime");
|
||||||
|
|
||||||
#undef GETUNI
|
#undef GETUNI
|
||||||
|
|
||||||
|
// set permanent uniform values
|
||||||
|
#define UNIFORM_1(uniform, a, function) \
|
||||||
|
if (uniform != -1) \
|
||||||
|
function (uniform, a);
|
||||||
|
|
||||||
|
#define UNIFORM_2(uniform, a, b, function) \
|
||||||
|
if (uniform != -1) \
|
||||||
|
function (uniform, a, b);
|
||||||
|
|
||||||
|
pglUseProgram(shader->program);
|
||||||
|
|
||||||
|
// texture unit numbers for the samplers used for palette rendering
|
||||||
|
UNIFORM_2(shader->uniforms[gluniform_palette], 768, gl_palette, pglUniform1iv);
|
||||||
|
UNIFORM_1(shader->uniforms[gluniform_color_lookup], 1, pglUniform1i);
|
||||||
|
UNIFORM_1(shader->uniforms[gluniform_lighttable_tex], 2, pglUniform1i);
|
||||||
|
|
||||||
|
pglUseProgram(0);
|
||||||
|
|
||||||
|
#undef UNIFORM_1
|
||||||
|
#undef UNIFORM_2
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return true;
|
return true;
|
||||||
@@ -962,7 +1127,9 @@ EXPORT boolean HWRAPI(LoadShaders) (void)
|
|||||||
EXPORT void HWRAPI(LoadCustomShader) (int number, char *shader, size_t size, boolean fragment)
|
EXPORT void HWRAPI(LoadCustomShader) (int number, char *shader, size_t size, boolean fragment)
|
||||||
{
|
{
|
||||||
#ifdef GL_SHADERS
|
#ifdef GL_SHADERS
|
||||||
if (!pglUseProgram) return;
|
if (!pglUseProgram)
|
||||||
|
return;
|
||||||
|
|
||||||
if (number < 1 || number > MAXSHADERS)
|
if (number < 1 || number > MAXSHADERS)
|
||||||
I_Error("LoadCustomShader(): cannot load shader %d (max %d)", number, MAXSHADERS);
|
I_Error("LoadCustomShader(): cannot load shader %d (max %d)", number, MAXSHADERS);
|
||||||
|
|
||||||
@@ -984,8 +1151,14 @@ EXPORT void HWRAPI(LoadCustomShader) (int number, char *shader, size_t size, boo
|
|||||||
EXPORT void HWRAPI(InitCustomShaders) (void)
|
EXPORT void HWRAPI(InitCustomShaders) (void)
|
||||||
{
|
{
|
||||||
#ifdef GL_SHADERS
|
#ifdef GL_SHADERS
|
||||||
|
|
||||||
KillShaders();
|
KillShaders();
|
||||||
LoadShaders();
|
LoadShaders();
|
||||||
|
|
||||||
|
if (gl_use_palette_shader)
|
||||||
|
{
|
||||||
|
InitPalette(0, false);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1022,6 +1195,105 @@ EXPORT void HWRAPI(KillShaders) (void)
|
|||||||
// unused.........................
|
// unused.........................
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GLuint palette_tex_num;
|
||||||
|
// length of one side of lookup texture
|
||||||
|
// smallest separation between all the colors in the srb2 palette is 6, so
|
||||||
|
// possibly a 64x64x64 lookup texture might be enough for 100% correct colors
|
||||||
|
// (min separation for 64^3 size is 4)
|
||||||
|
#define LUT_SIZE 64
|
||||||
|
#define STEP_SIZE (256/LUT_SIZE)
|
||||||
|
// the +2 in the NearestColor call also needs to be adjusted if LUT_SIZE is changed!
|
||||||
|
// the hardcoded values in the shader also need to be adjusted if LUT_SIZE is changed!
|
||||||
|
|
||||||
|
void InitPalette(int flashnum, boolean skiplut)
|
||||||
|
{
|
||||||
|
int i, r, g, b;
|
||||||
|
|
||||||
|
//Hudler: 16/10/99: added for OpenGL gamma correction
|
||||||
|
RGBA_t gamma_correction = {0x7F7F7F7F};
|
||||||
|
|
||||||
|
//Hurdler 16/10/99: added for OpenGL gamma correction
|
||||||
|
gamma_correction.s.red = (UINT8)cv_grgammared.value;
|
||||||
|
gamma_correction.s.green = (UINT8)cv_grgammagreen.value;
|
||||||
|
gamma_correction.s.blue = (UINT8)cv_grgammablue.value;
|
||||||
|
|
||||||
|
// init the palette
|
||||||
|
int flashoffset = flashnum*256;
|
||||||
|
for (i = 0+flashoffset; i < 256+flashoffset; i++)
|
||||||
|
{
|
||||||
|
int fi = i-flashoffset;
|
||||||
|
|
||||||
|
// gamma correction
|
||||||
|
int pr, pg, pb;
|
||||||
|
pr = (UINT8)MIN((pLocalPalette[i].s.red*gamma_correction.s.red)/127, 255);
|
||||||
|
pg = (UINT8)MIN((pLocalPalette[i].s.green*gamma_correction.s.green)/127, 255);
|
||||||
|
pb = (UINT8)MIN((pLocalPalette[i].s.blue*gamma_correction.s.blue)/127, 255);
|
||||||
|
|
||||||
|
// crush to 16-bit rgb565, like software currently does
|
||||||
|
float fred = (float)(pr >> 3);
|
||||||
|
float fgreen = (float)(pg >> 2);
|
||||||
|
float fblue = (float)(pb >> 3);
|
||||||
|
// restore to rgb888
|
||||||
|
gl_palette[fi*3] = (GLint)(fred / 31.0f * 255.0f);
|
||||||
|
gl_palette[fi*3+1] = (GLint)(fgreen / 63.0f * 255.0f);
|
||||||
|
gl_palette[fi*3+2] = (GLint)(fblue / 31.0f * 255.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!skiplut)
|
||||||
|
{
|
||||||
|
// init the palette conversion lookup texture
|
||||||
|
GLubyte *pal_lookup_tex = malloc(LUT_SIZE*LUT_SIZE*LUT_SIZE*sizeof(GLubyte));
|
||||||
|
|
||||||
|
if (!pal_lookup_tex)
|
||||||
|
I_Error("Failed to allocate memory for generating palette lookup texture.");
|
||||||
|
|
||||||
|
for (b = 0; b < LUT_SIZE; b++)
|
||||||
|
{
|
||||||
|
for (g = 0; g < LUT_SIZE; g++)
|
||||||
|
{
|
||||||
|
for (r = 0; r < LUT_SIZE; r++)
|
||||||
|
{
|
||||||
|
pal_lookup_tex[b*LUT_SIZE*LUT_SIZE+g*LUT_SIZE+r] = NearestColor(r*STEP_SIZE+0, g*STEP_SIZE+0, b*STEP_SIZE+0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pglGenTextures(1, &palette_tex_num);
|
||||||
|
pglBindTexture(GL_TEXTURE_3D, palette_tex_num);
|
||||||
|
pglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
pglTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
if (!pglTexImage3D)
|
||||||
|
I_Error("pglTexImage3D is NULL!");
|
||||||
|
pglTexImage3D(GL_TEXTURE_3D, 0, GL_R8, LUT_SIZE, LUT_SIZE, LUT_SIZE, 0, GL_RED, GL_UNSIGNED_BYTE, pal_lookup_tex);
|
||||||
|
free(pal_lookup_tex);
|
||||||
|
}
|
||||||
|
#undef STEP_SIZE
|
||||||
|
|
||||||
|
pglUseProgram(gl_shaderprograms[8].program);
|
||||||
|
pglUniform1i(gl_shaderprograms[8].uniforms[gluniform_color_lookup], 1); // bind sampler to second texture unit
|
||||||
|
pglUniform1iv(gl_shaderprograms[8].uniforms[gluniform_palette], 768, gl_palette);
|
||||||
|
// bind the palette to the fancy shader here
|
||||||
|
pglUseProgram(gl_shaderprograms[9].program);
|
||||||
|
pglUniform1iv(gl_shaderprograms[9].uniforms[gluniform_palette], 768, gl_palette);
|
||||||
|
// bind tex unit 2 to lighttable tex
|
||||||
|
pglUniform1i(gl_shaderprograms[9].uniforms[gluniform_lighttable_tex], 2);
|
||||||
|
pglUniform1i(gl_shaderprograms[9].uniforms[gluniform_color_lookup], 1);
|
||||||
|
// bind the palette to the fancy shader here
|
||||||
|
pglUseProgram(gl_shaderprograms[10].program);
|
||||||
|
pglUniform1iv(gl_shaderprograms[10].uniforms[gluniform_palette], 768, gl_palette);
|
||||||
|
// bind tex unit 2 to lighttable tex
|
||||||
|
pglUniform1i(gl_shaderprograms[10].uniforms[gluniform_lighttable_tex], 2);
|
||||||
|
pglUniform1i(gl_shaderprograms[10].uniforms[gluniform_color_lookup], 1);
|
||||||
|
pglUseProgram(0);
|
||||||
|
pglBindTexture(GL_TEXTURE_3D, 0);
|
||||||
|
|
||||||
|
// bind 3d lookup to unit 1, maybe it can stay there
|
||||||
|
pglActiveTexture(GL_TEXTURE1);
|
||||||
|
pglBindTexture(GL_TEXTURE_3D, palette_tex_num);
|
||||||
|
pglActiveTexture(GL_TEXTURE0);
|
||||||
|
gl_palette_initialized = true;
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
// SetNoTexture : Disable texture
|
// SetNoTexture : Disable texture
|
||||||
// -----------------+
|
// -----------------+
|
||||||
@@ -1201,6 +1473,46 @@ EXPORT void HWRAPI(ClearMipMapCache) (void)
|
|||||||
Flush();
|
Flush();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EXPORT UINT32 HWRAPI(AddLightTable) (UINT8 *lighttable)
|
||||||
|
{
|
||||||
|
LightTableCacheEntry_t *cache_entry = malloc(sizeof(LightTableCacheEntry_t));
|
||||||
|
if (!ltcachetail)
|
||||||
|
{
|
||||||
|
ltcachehead = ltcachetail = cache_entry;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ltcachetail->next = cache_entry;
|
||||||
|
ltcachetail = cache_entry;
|
||||||
|
}
|
||||||
|
ltcachetail->next = NULL;
|
||||||
|
pglGenTextures(1, <cachetail->id);
|
||||||
|
if (!ltcachetail->id)
|
||||||
|
I_Error("hwr lighttable cache entry id is zero");
|
||||||
|
pglBindTexture(GL_TEXTURE_2D, ltcachetail->id);
|
||||||
|
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
|
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
|
pglTexImage2D(GL_TEXTURE_2D, 0, GL_R8, 256, 32, 0, GL_RED, GL_UNSIGNED_BYTE, lighttable);
|
||||||
|
|
||||||
|
// restore previously bound texture
|
||||||
|
if (!gl_batching)
|
||||||
|
pglBindTexture(GL_TEXTURE_2D, tex_downloaded);
|
||||||
|
|
||||||
|
return ltcachetail->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete light table textures, ids given before become invalid and must not be used.
|
||||||
|
EXPORT void HWRAPI(ClearLightTableCache) (void)
|
||||||
|
{
|
||||||
|
while (ltcachehead)
|
||||||
|
{
|
||||||
|
pglDeleteTextures(1, <cachehead->id);
|
||||||
|
LightTableCacheEntry_t *next = ltcachehead->next;
|
||||||
|
free(ltcachehead);
|
||||||
|
ltcachehead = next;
|
||||||
|
}
|
||||||
|
ltcachetail = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------+
|
// -----------------+
|
||||||
// ReadRect : Read a rectangle region of the truecolor framebuffer
|
// ReadRect : Read a rectangle region of the truecolor framebuffer
|
||||||
@@ -1312,6 +1624,9 @@ EXPORT void HWRAPI(ClearBuffer) (FBOOLEAN ColorMask,
|
|||||||
pglClear(ClearMask);
|
pglClear(ClearMask);
|
||||||
pglEnableClientState(GL_VERTEX_ARRAY); // We always use this one
|
pglEnableClientState(GL_VERTEX_ARRAY); // We always use this one
|
||||||
pglEnableClientState(GL_TEXTURE_COORD_ARRAY); // And mostly this one, too
|
pglEnableClientState(GL_TEXTURE_COORD_ARRAY); // And mostly this one, too
|
||||||
|
|
||||||
|
if (!gl_palette_initialized)
|
||||||
|
InitPalette(0, false); // just gonna put this here for now
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1822,6 +2137,8 @@ typedef struct
|
|||||||
FBITFIELD polyFlags;
|
FBITFIELD polyFlags;
|
||||||
GLuint texNum;
|
GLuint texNum;
|
||||||
GLuint shader;
|
GLuint shader;
|
||||||
|
// this tells batching that the plane belongs to a horizon line and must be drawn in correct order with the skywalls
|
||||||
|
boolean horizonSpecial;
|
||||||
} PolygonArrayEntry;
|
} PolygonArrayEntry;
|
||||||
|
|
||||||
FOutVector* finalVertexArray = NULL;// contains subset of sorted vertices and texture coordinates to be sent to gpu
|
FOutVector* finalVertexArray = NULL;// contains subset of sorted vertices and texture coordinates to be sent to gpu
|
||||||
@@ -1861,24 +2178,36 @@ EXPORT void HWRAPI(StartBatching) (void)
|
|||||||
|
|
||||||
static int comparePolygons(const void *p1, const void *p2)
|
static int comparePolygons(const void *p1, const void *p2)
|
||||||
{
|
{
|
||||||
PolygonArrayEntry* poly1 = &polygonArray[*(const unsigned int*)p1];
|
unsigned int index1 = *(const unsigned int*)p1;
|
||||||
PolygonArrayEntry* poly2 = &polygonArray[*(const unsigned int*)p2];
|
unsigned int index2 = *(const unsigned int*)p2;
|
||||||
|
PolygonArrayEntry* poly1 = &polygonArray[index1];
|
||||||
|
PolygonArrayEntry* poly2 = &polygonArray[index2];
|
||||||
int diff;
|
int diff;
|
||||||
INT64 diff64;
|
INT64 diff64;
|
||||||
|
|
||||||
int shader1 = poly1->shader;
|
int shader1 = poly1->shader;
|
||||||
int shader2 = poly2->shader;
|
int shader2 = poly2->shader;
|
||||||
// make skywalls first in order
|
// make skywalls and horizon lines first in order
|
||||||
if (poly1->polyFlags & PF_NoTexture)
|
if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial)
|
||||||
shader1 = -1;
|
shader1 = -1;
|
||||||
if (poly2->polyFlags & PF_NoTexture)
|
if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial)
|
||||||
shader2 = -1;
|
shader2 = -1;
|
||||||
diff = shader1 - shader2;
|
diff = shader1 - shader2;
|
||||||
if (diff != 0) return diff;
|
if (diff != 0) return diff;
|
||||||
|
|
||||||
|
// skywalls and horizon lines must retain their order for horizon lines to work
|
||||||
|
if (shader1 == -1 && shader2 == -1)
|
||||||
|
return index1 - index2;
|
||||||
|
|
||||||
diff = poly1->texNum - poly2->texNum;
|
diff = poly1->texNum - poly2->texNum;
|
||||||
if (diff != 0) return diff;
|
if (diff != 0) return diff;
|
||||||
|
|
||||||
|
if (gl_use_palette_shader)
|
||||||
|
{
|
||||||
|
diff = poly1->surf.LightTableId - poly2->surf.LightTableId;
|
||||||
|
if (diff != 0) return diff;
|
||||||
|
}
|
||||||
|
|
||||||
diff = poly1->polyFlags - poly2->polyFlags;
|
diff = poly1->polyFlags - poly2->polyFlags;
|
||||||
if (diff != 0) return diff;
|
if (diff != 0) return diff;
|
||||||
|
|
||||||
@@ -1899,20 +2228,26 @@ static int comparePolygons(const void *p1, const void *p2)
|
|||||||
|
|
||||||
static int comparePolygonsNoShaders(const void *p1, const void *p2)
|
static int comparePolygonsNoShaders(const void *p1, const void *p2)
|
||||||
{
|
{
|
||||||
PolygonArrayEntry* poly1 = &polygonArray[*(const unsigned int*)p1];
|
unsigned int index1 = *(const unsigned int*)p1;
|
||||||
PolygonArrayEntry* poly2 = &polygonArray[*(const unsigned int*)p2];
|
unsigned int index2 = *(const unsigned int*)p2;
|
||||||
|
PolygonArrayEntry* poly1 = &polygonArray[index1];
|
||||||
|
PolygonArrayEntry* poly2 = &polygonArray[index2];
|
||||||
int diff;
|
int diff;
|
||||||
INT64 diff64;
|
INT64 diff64;
|
||||||
|
|
||||||
GLuint texNum1 = poly1->texNum;
|
GLuint texNum1 = poly1->texNum;
|
||||||
GLuint texNum2 = poly2->texNum;
|
GLuint texNum2 = poly2->texNum;
|
||||||
if (poly1->polyFlags & PF_NoTexture)
|
if (poly1->polyFlags & PF_NoTexture || poly1->horizonSpecial)
|
||||||
texNum1 = 0;
|
texNum1 = 0;
|
||||||
if (poly2->polyFlags & PF_NoTexture)
|
if (poly2->polyFlags & PF_NoTexture || poly2->horizonSpecial)
|
||||||
texNum2 = 0;
|
texNum2 = 0;
|
||||||
diff = texNum1 - texNum2;
|
diff = texNum1 - texNum2;
|
||||||
if (diff != 0) return diff;
|
if (diff != 0) return diff;
|
||||||
|
|
||||||
|
// skywalls and horizon lines must retain their order for horizon lines to work
|
||||||
|
if (texNum1 == 0 && texNum2 == 0)
|
||||||
|
return index1 - index2;
|
||||||
|
|
||||||
diff = poly1->polyFlags - poly2->polyFlags;
|
diff = poly1->polyFlags - poly2->polyFlags;
|
||||||
if (diff != 0) return diff;
|
if (diff != 0) return diff;
|
||||||
|
|
||||||
@@ -2010,7 +2345,15 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
|||||||
firstFade.alpha = byte2float[currentSurfaceInfo.FadeColor.s.alpha];
|
firstFade.alpha = byte2float[currentSurfaceInfo.FadeColor.s.alpha];
|
||||||
|
|
||||||
if (gl_allowshaders)
|
if (gl_allowshaders)
|
||||||
|
{
|
||||||
load_shaders(¤tSurfaceInfo, &firstPoly, &firstTint, &firstFade);
|
load_shaders(¤tSurfaceInfo, &firstPoly, &firstTint, &firstFade);
|
||||||
|
if (gl_use_palette_shader)
|
||||||
|
{
|
||||||
|
pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now
|
||||||
|
pglBindTexture(GL_TEXTURE_2D, currentSurfaceInfo.LightTableId);
|
||||||
|
pglActiveTexture(GL_TEXTURE0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (currentPolyFlags & PF_NoTexture)
|
if (currentPolyFlags & PF_NoTexture)
|
||||||
currentTexture = 0;
|
currentTexture = 0;
|
||||||
@@ -2121,7 +2464,21 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
|||||||
changeState = true;
|
changeState = true;
|
||||||
changePolyFlags = true;
|
changePolyFlags = true;
|
||||||
}
|
}
|
||||||
if (gl_allowshaders)
|
if ((gl_allowshaders) && (gl_use_palette_shader))
|
||||||
|
{
|
||||||
|
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||||
|
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||||
|
currentSurfaceInfo.FadeColor.rgba != nextSurfaceInfo.FadeColor.rgba ||
|
||||||
|
currentSurfaceInfo.LightInfo.light_level != nextSurfaceInfo.LightInfo.light_level ||
|
||||||
|
currentSurfaceInfo.LightInfo.fade_start != nextSurfaceInfo.LightInfo.fade_start ||
|
||||||
|
currentSurfaceInfo.LightInfo.fade_end != nextSurfaceInfo.LightInfo.fade_end ||
|
||||||
|
currentSurfaceInfo.LightTableId != nextSurfaceInfo.LightTableId)
|
||||||
|
{
|
||||||
|
changeState = true;
|
||||||
|
changeSurfaceInfo = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if ((gl_allowshaders) && (!gl_use_palette_shader))
|
||||||
{
|
{
|
||||||
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
if (currentSurfaceInfo.PolyColor.rgba != nextSurfaceInfo.PolyColor.rgba ||
|
||||||
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
currentSurfaceInfo.TintColor.rgba != nextSurfaceInfo.TintColor.rgba ||
|
||||||
@@ -2251,7 +2608,15 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
|||||||
fade.alpha = byte2float[nextSurfaceInfo.FadeColor.s.alpha];
|
fade.alpha = byte2float[nextSurfaceInfo.FadeColor.s.alpha];
|
||||||
|
|
||||||
load_shaders(&nextSurfaceInfo, &poly, &tint, &fade);
|
load_shaders(&nextSurfaceInfo, &poly, &tint, &fade);
|
||||||
|
|
||||||
|
if (gl_use_palette_shader)
|
||||||
|
{
|
||||||
|
pglActiveTexture(GL_TEXTURE2);// this stuff could be done better but gonna do it quick like this for now
|
||||||
|
pglBindTexture(GL_TEXTURE_2D, nextSurfaceInfo.LightTableId);
|
||||||
|
pglActiveTexture(GL_TEXTURE0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
currentSurfaceInfo = nextSurfaceInfo;
|
currentSurfaceInfo = nextSurfaceInfo;
|
||||||
changeSurfaceInfo = false;
|
changeSurfaceInfo = false;
|
||||||
|
|
||||||
@@ -2269,7 +2634,7 @@ EXPORT void HWRAPI(RenderBatches) (precise_t *sSortTime, precise_t *sDrawTime, i
|
|||||||
// -----------------+
|
// -----------------+
|
||||||
// DrawPolygon : Render a polygon, set the texture, set render mode
|
// DrawPolygon : Render a polygon, set the texture, set render mode
|
||||||
// -----------------+
|
// -----------------+
|
||||||
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags)
|
EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUINT iNumPts, FBITFIELD PolyFlags, boolean horizonSpecial)
|
||||||
{
|
{
|
||||||
if (gl_batching)
|
if (gl_batching)
|
||||||
{
|
{
|
||||||
@@ -2309,6 +2674,7 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI
|
|||||||
polygonArray[polygonArraySize].polyFlags = PolyFlags;
|
polygonArray[polygonArraySize].polyFlags = PolyFlags;
|
||||||
polygonArray[polygonArraySize].texNum = tex_downloaded;
|
polygonArray[polygonArraySize].texNum = tex_downloaded;
|
||||||
polygonArray[polygonArraySize].shader = gl_currentshaderprogram;
|
polygonArray[polygonArraySize].shader = gl_currentshaderprogram;
|
||||||
|
polygonArray[polygonArraySize].horizonSpecial = horizonSpecial;
|
||||||
polygonArraySize++;
|
polygonArraySize++;
|
||||||
|
|
||||||
memcpy(&unsortedVertexArray[unsortedVertexArraySize], pOutVerts, iNumPts * sizeof(FOutVector));
|
memcpy(&unsortedVertexArray[unsortedVertexArraySize], pOutVerts, iNumPts * sizeof(FOutVector));
|
||||||
@@ -2350,6 +2716,13 @@ EXPORT void HWRAPI(DrawPolygon) (FSurfaceInfo *pSurf, FOutVector *pOutVerts, FUI
|
|||||||
fade.green = byte2float[pSurf->FadeColor.s.green];
|
fade.green = byte2float[pSurf->FadeColor.s.green];
|
||||||
fade.blue = byte2float[pSurf->FadeColor.s.blue];
|
fade.blue = byte2float[pSurf->FadeColor.s.blue];
|
||||||
fade.alpha = byte2float[pSurf->FadeColor.s.alpha];
|
fade.alpha = byte2float[pSurf->FadeColor.s.alpha];
|
||||||
|
|
||||||
|
if (gl_use_palette_shader && gl_allowshaders)
|
||||||
|
{
|
||||||
|
pglActiveTexture(GL_TEXTURE2);
|
||||||
|
pglBindTexture(GL_TEXTURE_2D, pSurf->LightTableId);
|
||||||
|
pglActiveTexture(GL_TEXTURE0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
load_shaders(pSurf, &poly, &tint, &fade);
|
load_shaders(pSurf, &poly, &tint, &fade);
|
||||||
@@ -2693,6 +3066,10 @@ EXPORT void HWRAPI(SetSpecialState) (hwdspecialstate_t IdState, INT32 Value)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case HWD_SET_PALETTE_SHADER_ENABLED:
|
||||||
|
gl_use_palette_shader = Value;
|
||||||
|
break;
|
||||||
|
|
||||||
case HWD_SET_TEXTUREFILTERMODE:
|
case HWD_SET_TEXTUREFILTERMODE:
|
||||||
switch (Value)
|
switch (Value)
|
||||||
{
|
{
|
||||||
@@ -3761,6 +4138,12 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int width, int height)
|
|||||||
ClearBuffer(true, false, false, &clearColour);
|
ClearBuffer(true, false, false, &clearColour);
|
||||||
pglBindTexture(GL_TEXTURE_2D, finalScreenTexture);
|
pglBindTexture(GL_TEXTURE_2D, finalScreenTexture);
|
||||||
|
|
||||||
|
if (gl_use_palette_shader && cv_grshaders.value)
|
||||||
|
{
|
||||||
|
pglUseProgram(gl_shaderprograms[8].program); // palette shader
|
||||||
|
pglActiveTexture(GL_TEXTURE1);
|
||||||
|
}
|
||||||
|
|
||||||
pglColor4ubv(white);
|
pglColor4ubv(white);
|
||||||
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
pglTexCoordPointer(2, GL_FLOAT, 0, fix);
|
||||||
pglVertexPointer(3, GL_FLOAT, 0, off);
|
pglVertexPointer(3, GL_FLOAT, 0, off);
|
||||||
@@ -3768,6 +4151,12 @@ EXPORT void HWRAPI(DrawScreenFinalTexture)(int width, int height)
|
|||||||
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
pglDrawArrays(GL_TRIANGLE_FAN, 0, 4);
|
||||||
|
|
||||||
tex_downloaded = finalScreenTexture;
|
tex_downloaded = finalScreenTexture;
|
||||||
|
|
||||||
|
if (gl_use_palette_shader && cv_grshaders.value)
|
||||||
|
{
|
||||||
|
pglUseProgram(0);
|
||||||
|
pglActiveTexture(GL_TEXTURE0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //HWRENDER
|
#endif //HWRENDER
|
||||||
@@ -133,4 +133,8 @@ typedef enum
|
|||||||
GLF_NOTEXENV = 0x02,
|
GLF_NOTEXENV = 0x02,
|
||||||
} oglflags_t;
|
} oglflags_t;
|
||||||
|
|
||||||
|
// in order for custom playpals n shit to work properly
|
||||||
|
extern boolean gl_palette_initialized;
|
||||||
|
void InitPalette(int flashnum, boolean skiplut);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
+1
-1
@@ -40,7 +40,7 @@ extern UINT8 keyboard_started;
|
|||||||
|
|
||||||
\return free memory in the system
|
\return free memory in the system
|
||||||
*/
|
*/
|
||||||
UINT32 I_GetFreeMem(UINT32 *total);
|
size_t I_GetFreeMem(size_t *total);
|
||||||
|
|
||||||
/** \brief Returns precise time value for performance measurement. The precise
|
/** \brief Returns precise time value for performance measurement. The precise
|
||||||
time should be a monotonically increasing counter, and will wrap.
|
time should be a monotonically increasing counter, and will wrap.
|
||||||
|
|||||||
+44
-21
@@ -504,7 +504,7 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
|
|||||||
|
|
||||||
\return void
|
\return void
|
||||||
*/
|
*/
|
||||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
|
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, boolean local)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
INT32 starttranscolor;
|
INT32 starttranscolor;
|
||||||
@@ -540,7 +540,7 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
starttranscolor = (skinnum != TC_DEFAULT) ? skins[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR;
|
starttranscolor = (skinnum != TC_DEFAULT) ? ( (local) ? localskins : skins )[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR;
|
||||||
|
|
||||||
// Fill in the entries of the palette that are fixed
|
// Fill in the entries of the palette that are fixed
|
||||||
for (i = 0; i < starttranscolor; i++)
|
for (i = 0; i < starttranscolor; i++)
|
||||||
@@ -3100,7 +3100,7 @@ static void K_QuiteSaltyHop(player_t *p)
|
|||||||
p->mo->spriteyscale += (mos/8);
|
p->mo->spriteyscale += (mos/8);
|
||||||
p->mo->spritexscale -= (mos/8);
|
p->mo->spritexscale -= (mos/8);
|
||||||
}
|
}
|
||||||
p->mo->spriteyoffset = p->mo->salty_zoffset*P_MobjFlip(p->mo);
|
p->mo->spriteyoffset = p->mo->salty_zoffset;
|
||||||
if (S_SoundPlaying(p->mo, sfx_screec))
|
if (S_SoundPlaying(p->mo, sfx_screec))
|
||||||
S_StopSoundByID(p->mo, sfx_screec);
|
S_StopSoundByID(p->mo, sfx_screec);
|
||||||
if (S_SoundPlaying(p->mo, sfx_drift))
|
if (S_SoundPlaying(p->mo, sfx_drift))
|
||||||
@@ -3132,6 +3132,7 @@ static angle_t K_GetSlopeRollAngle(player_t *p, boolean dontflip, boolean useRes
|
|||||||
angle_t zangle = 0;
|
angle_t zangle = 0;
|
||||||
angle_t xydirection = 0;
|
angle_t xydirection = 0;
|
||||||
angle_t an;
|
angle_t an;
|
||||||
|
angle_t final_slope;
|
||||||
INT32 pNum = K_FindPlayerNum(p);
|
INT32 pNum = K_FindPlayerNum(p);
|
||||||
|
|
||||||
I_Assert(p != NULL);
|
I_Assert(p != NULL);
|
||||||
@@ -3171,7 +3172,14 @@ static angle_t K_GetSlopeRollAngle(player_t *p, boolean dontflip, boolean useRes
|
|||||||
zangle = InvAngle(zangle);
|
zangle = InvAngle(zangle);
|
||||||
|
|
||||||
an = (lookAngle - xydirection);
|
an = (lookAngle - xydirection);
|
||||||
return FixedMul(zangle, FINESINE(an>>ANGLETOFINESHIFT));
|
final_slope = -(FixedMul(FINESINE(an>>ANGLETOFINESHIFT), zangle));
|
||||||
|
an = (INT32)(final_slope - p->tilt_sprite) / 3; // instead of just a direct snap
|
||||||
|
|
||||||
|
if (an)
|
||||||
|
p->tilt_sprite += an;
|
||||||
|
else
|
||||||
|
p->tilt_sprite = final_slope;
|
||||||
|
return -p->tilt_sprite;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void K_RollPlayerBySlopes(player_t *p, boolean usedistance)
|
static void K_RollPlayerBySlopes(player_t *p, boolean usedistance)
|
||||||
@@ -6647,7 +6655,7 @@ void K_CheckBumpers(void)
|
|||||||
if (winnernum > -1 && playeringame[winnernum])
|
if (winnernum > -1 && playeringame[winnernum])
|
||||||
{
|
{
|
||||||
players[winnernum].marescore += winnerscoreadd;
|
players[winnernum].marescore += winnerscoreadd;
|
||||||
CONS_Printf(M_GetText("%s recieved %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
|
CONS_Printf(M_GetText("%s received %d point%s for winning!\n"), player_names[winnernum], winnerscoreadd, (winnerscoreadd == 1 ? "" : "s"));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++) // This can't go in the earlier loop because winning adds points
|
for (i = 0; i < MAXPLAYERS; i++) // This can't go in the earlier loop because winning adds points
|
||||||
@@ -8090,7 +8098,11 @@ static boolean K_drawKartPositionFaces(void)
|
|||||||
else
|
else
|
||||||
colormap = R_GetTranslationColormap(players[rankplayer[i]].skin, players[rankplayer[i]].mo->color, GTC_CACHE);
|
colormap = R_GetTranslationColormap(players[rankplayer[i]].skin, players[rankplayer[i]].mo->color, GTC_CACHE);
|
||||||
|
|
||||||
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, facerankprefix[players[rankplayer[i]].skin], colormap);
|
{
|
||||||
|
player_t *p;
|
||||||
|
p = &players[rankplayer[i]];
|
||||||
|
V_DrawMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, ( (p->skinlocal) ? localfacerankprefix : facerankprefix )[( (p->localskin) ? p->localskin-1 : p->skin )], colormap);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_HudEnabled(hud_battlebumpers))
|
if (LUA_HudEnabled(hud_battlebumpers))
|
||||||
@@ -8176,7 +8188,11 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
|
|||||||
else
|
else
|
||||||
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE);
|
colormap = R_GetTranslationColormap(players[tab[i].num].skin, players[tab[i].num].mo->color, GTC_CACHE);
|
||||||
|
|
||||||
V_DrawMappedPatch(x, y-4, 0, facerankprefix[players[tab[i].num].skin], colormap);
|
{
|
||||||
|
player_t *p;
|
||||||
|
p = &players[tab[i].num];
|
||||||
|
V_DrawMappedPatch(x, y-4, 0, ( (p->skinlocal) ? localfacerankprefix : facerankprefix )[( (p->localskin) ? p->localskin-1 : p->skin )], colormap);
|
||||||
|
}
|
||||||
/*if (G_BattleGametype() && players[tab[i].num].kartstuff[k_bumper] > 0) -- not enough space for this
|
/*if (G_BattleGametype() && players[tab[i].num].kartstuff[k_bumper] > 0) -- not enough space for this
|
||||||
{
|
{
|
||||||
INT32 bumperx = x+19;
|
INT32 bumperx = x+19;
|
||||||
@@ -8321,11 +8337,11 @@ static void K_drawKartSpeedometer(void)
|
|||||||
speedtype = 1;
|
speedtype = 1;
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
convSpeed = FixedDiv(FixedMul(stplyr->speed, 142371), mapobjectscale)/FRACUNIT; // 2.172409058
|
convSpeed = FixedDiv(FixedMul(stplyr->speed, 88465), mapobjectscale)/FRACUNIT; // 1.349868774
|
||||||
speedtype = 2;
|
speedtype = 2;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
convSpeed = FixedDiv(FixedMul(stplyr->speed, 88465), mapobjectscale)/FRACUNIT; // 1.349868774
|
convSpeed = FixedDiv(stplyr->speed, mapobjectscale)/FRACUNIT;
|
||||||
speedtype = 3;
|
speedtype = 3;
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
@@ -8342,19 +8358,19 @@ static void K_drawKartSpeedometer(void)
|
|||||||
{
|
{
|
||||||
switch (speedtype) {
|
switch (speedtype) {
|
||||||
case 1:
|
case 1:
|
||||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d km/h", convSpeed));
|
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d km/h", convSpeed));
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d mph", convSpeed));
|
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d mph", convSpeed));
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d fu/t", convSpeed));
|
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/t", convSpeed));
|
||||||
break;
|
break;
|
||||||
case 4: // if extra.kart is found, use its included % symbol
|
case 4: // if extra.kart is found, use its included % symbol
|
||||||
if (!found_extra_kart)
|
if (!found_extra_kart)
|
||||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d P", convSpeed));
|
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%4d P", convSpeed));
|
||||||
else
|
else
|
||||||
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%03d %%", convSpeed));
|
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%4d %%", convSpeed));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (cv_newspeedometer.value && found_extra_kart) { // why bother if we dont?
|
else if (cv_newspeedometer.value && found_extra_kart) { // why bother if we dont?
|
||||||
@@ -8523,7 +8539,7 @@ static void K_drawKartWanted(void)
|
|||||||
if (players[battlewanted[i]].skincolor)
|
if (players[battlewanted[i]].skincolor)
|
||||||
{
|
{
|
||||||
colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE);
|
colormap = R_GetTranslationColormap(TC_RAINBOW, p->skincolor, GTC_CACHE);
|
||||||
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, V_HUDTRANS|(splitscreen < 3 ? V_SNAPTORIGHT : 0)|V_SNAPTOBOTTOM, (scale == FRACUNIT ? facewantprefix[p->skin] : facerankprefix[p->skin]), colormap);
|
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, FRACUNIT, V_HUDTRANS|(splitscreen < 3 ? V_SNAPTORIGHT : 0)|V_SNAPTOBOTTOM, (scale == FRACUNIT ? ( (p->skinlocal) ? localfacewantprefix : facewantprefix )[( (p->localskin) ? p->localskin-1 : p->skin )] : ( (p->skinlocal) ? localfacerankprefix : facerankprefix )[( (p->localskin) ? p->localskin-1 : p->skin )]), colormap);
|
||||||
/*if (basey2) // again with 4p stuff
|
/*if (basey2) // again with 4p stuff
|
||||||
V_DrawFixedPatch(x<<FRACBITS, (y - (basey-basey2))<<FRACBITS, FRACUNIT, V_HUDTRANS|V_SNAPTOTOP, (scale == FRACUNIT ? facewantprefix[p->skin] : facerankprefix[p->skin]), colormap);*/
|
V_DrawFixedPatch(x<<FRACBITS, (y - (basey-basey2))<<FRACBITS, FRACUNIT, V_HUDTRANS|V_SNAPTOTOP, (scale == FRACUNIT ? facewantprefix[p->skin] : facerankprefix[p->skin]), colormap);*/
|
||||||
}
|
}
|
||||||
@@ -8590,6 +8606,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
|
|||||||
// it, they wouldn't 'spawn' on the top-right side of the HUD.
|
// it, they wouldn't 'spawn' on the top-right side of the HUD.
|
||||||
|
|
||||||
UINT8 skin = 0;
|
UINT8 skin = 0;
|
||||||
|
boolean skinlocal = mo->skinlocal;
|
||||||
|
|
||||||
fixed_t amnumxpos, amnumypos;
|
fixed_t amnumxpos, amnumypos;
|
||||||
INT32 amxpos, amypos;
|
INT32 amxpos, amypos;
|
||||||
@@ -8602,7 +8619,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
|
|||||||
fixed_t xscale, yscale, zoom;
|
fixed_t xscale, yscale, zoom;
|
||||||
|
|
||||||
if (mo->skin)
|
if (mo->skin)
|
||||||
skin = ((skin_t*)mo->skin)-skins;
|
skin = ((skin_t*)( (mo->localskin) ? mo->localskin : mo->skin ))-( (skinlocal) ? localskins : skins );
|
||||||
|
|
||||||
maxx = maxy = INT32_MAX;
|
maxx = maxy = INT32_MAX;
|
||||||
minx = miny = INT32_MIN;
|
minx = miny = INT32_MIN;
|
||||||
@@ -8646,19 +8663,25 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags, pat
|
|||||||
if (encoremode)
|
if (encoremode)
|
||||||
amnumxpos = -amnumxpos;
|
amnumxpos = -amnumxpos;
|
||||||
|
|
||||||
amxpos = amnumxpos + ((x + AutomapPic->width/2 - (facemmapprefix[skin]->width/2))<<FRACBITS);
|
amxpos = amnumxpos + ((x + AutomapPic->width/2 - (( (skinlocal) ? localfacemmapprefix : facemmapprefix )[skin]->width/2))<<FRACBITS);
|
||||||
amypos = amnumypos + ((y + AutomapPic->height/2 - (facemmapprefix[skin]->height/2))<<FRACBITS);
|
amypos = amnumypos + ((y + AutomapPic->height/2 - (( (skinlocal) ? localfacemmapprefix : facemmapprefix )[skin]->height/2))<<FRACBITS);
|
||||||
|
|
||||||
if (!mo->color) // 'default' color
|
if (!mo->color) // 'default' color
|
||||||
V_DrawSciencePatch(amxpos, amypos, flags, facemmapprefix[skin], FRACUNIT);
|
V_DrawSciencePatch(amxpos, amypos, flags, ( (skinlocal) ? localfacemmapprefix : facemmapprefix )[skin], FRACUNIT);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UINT8 *colormap = R_GetTranslationColormap((mo->colorized) ? TC_RAINBOW : skin, mo->color, GTC_CACHE);
|
UINT8 *colormap = R_GetTranslationColormap((mo->colorized) ? TC_RAINBOW : skin, mo->color, GTC_CACHE);
|
||||||
|
|
||||||
if (cv_minihead.value == 1)
|
if (cv_minihead.value == 1)
|
||||||
V_DrawFixedPatch(amxpos + (2 * FRACUNIT), amypos + (2 * FRACUNIT), FRACUNIT/2, flags, facemmapprefix[skin], colormap);
|
{
|
||||||
|
colormap = R_GetLocalTranslationColormap(mo->skin, mo->localskin, mo->color, GTC_CACHE, skinlocal);
|
||||||
|
V_DrawFixedPatch(amxpos + (2 * FRACUNIT), amypos + (2 * FRACUNIT), FRACUNIT/2, flags, ( (skinlocal) ? localfacemmapprefix : facemmapprefix )[skin], colormap);
|
||||||
|
}
|
||||||
else if (cv_minihead.value == 0)
|
else if (cv_minihead.value == 0)
|
||||||
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, facemmapprefix[skin], colormap);
|
{
|
||||||
|
colormap = R_GetLocalTranslationColormap(mo->skin, mo->localskin, mo->color, GTC_CACHE, skinlocal);
|
||||||
|
V_DrawFixedPatch(amxpos, amypos, FRACUNIT, flags, ( (skinlocal) ? localfacemmapprefix : facemmapprefix )[skin], colormap);
|
||||||
|
}
|
||||||
|
|
||||||
if (cv_showminimapnames.value && !(modeattacking || gamestate == GS_TIMEATTACK))
|
if (cv_showminimapnames.value && !(modeattacking || gamestate == GS_TIMEATTACK))
|
||||||
{
|
{
|
||||||
|
|||||||
+1
-1
@@ -15,7 +15,7 @@ extern UINT8 colortranslations[MAXTRANSLATIONS][16];
|
|||||||
extern const char *KartColor_Names[MAXSKINCOLORS];
|
extern const char *KartColor_Names[MAXSKINCOLORS];
|
||||||
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
|
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
|
||||||
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
|
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
|
||||||
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color);
|
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, boolean local);
|
||||||
UINT8 K_GetKartColorByName(const char *name);
|
UINT8 K_GetKartColorByName(const char *name);
|
||||||
|
|
||||||
void K_RegisterKartStuff(void);
|
void K_RegisterKartStuff(void);
|
||||||
|
|||||||
@@ -293,6 +293,8 @@ static void Lua_OnChange(void)
|
|||||||
//lua_settop(gL, 0); // Just in case...
|
//lua_settop(gL, 0); // Just in case...
|
||||||
lua_pushcfunction(gL, LUA_GetErrorMessage);
|
lua_pushcfunction(gL, LUA_GetErrorMessage);
|
||||||
|
|
||||||
|
int error_handler_i = abs_index(gL, -1);
|
||||||
|
|
||||||
// From CV_OnChange registry field, get the function for this cvar by name.
|
// From CV_OnChange registry field, get the function for this cvar by name.
|
||||||
lua_getfield(gL, LUA_REGISTRYINDEX, "CV_OnChange");
|
lua_getfield(gL, LUA_REGISTRYINDEX, "CV_OnChange");
|
||||||
I_Assert(lua_istable(gL, -1));
|
I_Assert(lua_istable(gL, -1));
|
||||||
@@ -304,7 +306,7 @@ static void Lua_OnChange(void)
|
|||||||
lua_getfield(gL, -1, cvname); // get consvar_t* userdata.
|
lua_getfield(gL, -1, cvname); // get consvar_t* userdata.
|
||||||
lua_remove(gL, -2); // pop the CV_Vars table.
|
lua_remove(gL, -2); // pop the CV_Vars table.
|
||||||
|
|
||||||
LUA_Call(gL, 1, 0, 1); // call function(cvar)
|
LUA_Call(gL, 1, 0, error_handler_i); // call function(cvar)
|
||||||
lua_pop(gL, 2); // pop CV_OnChange table and error handler
|
lua_pop(gL, 2); // pop CV_OnChange table and error handler
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#include "r_defs.h"
|
#include "r_defs.h"
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
#include "st_stuff.h" // hudinfo[]
|
#include "st_stuff.h" // hudinfo[]
|
||||||
|
#include "y_inter.h"
|
||||||
#include "g_game.h"
|
#include "g_game.h"
|
||||||
#include "i_video.h" // rendermode
|
#include "i_video.h" // rendermode
|
||||||
#include "p_local.h" // camera_t
|
#include "p_local.h" // camera_t
|
||||||
@@ -966,11 +967,46 @@ static int lib_hudadd(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_hudsetvotebackground(lua_State *L)
|
||||||
|
{
|
||||||
|
if (lua_isnoneornil(L, 1))
|
||||||
|
{
|
||||||
|
if (luaVoteScreen)
|
||||||
|
{
|
||||||
|
free(luaVoteScreen);
|
||||||
|
}
|
||||||
|
|
||||||
|
luaVoteScreen = NULL;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
const char *prefix = luaL_checkstring(L, 1);
|
||||||
|
|
||||||
|
if (strlen(prefix) != 4)
|
||||||
|
{
|
||||||
|
return luaL_argerror(L, 1, "prefix should 4 characters wide");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!luaVoteScreen)
|
||||||
|
{
|
||||||
|
luaVoteScreen = (char*)malloc(5);
|
||||||
|
luaVoteScreen[4] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
strncpy(luaVoteScreen, prefix, 4);
|
||||||
|
|
||||||
|
strupr(luaVoteScreen);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static luaL_Reg lib_hud[] = {
|
static luaL_Reg lib_hud[] = {
|
||||||
{"enable", lib_hudenable},
|
{"enable", lib_hudenable},
|
||||||
{"disable", lib_huddisable},
|
{"disable", lib_huddisable},
|
||||||
{"enabled", lib_hudenabled},
|
{"enabled", lib_hudenabled},
|
||||||
{"add", lib_hudadd},
|
{"add", lib_hudadd},
|
||||||
|
{"setVoteBackground", lib_hudsetvotebackground},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+45
-4
@@ -16,9 +16,12 @@
|
|||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
#include "fastcmp.h"
|
#include "fastcmp.h"
|
||||||
#include "r_things.h"
|
#include "r_things.h"
|
||||||
|
#include "r_main.h"
|
||||||
#include "p_local.h"
|
#include "p_local.h"
|
||||||
#include "g_game.h"
|
#include "g_game.h"
|
||||||
#include "p_setup.h"
|
#include "p_setup.h"
|
||||||
|
#include "doomdef.h"
|
||||||
|
#include "d_netcmd.h"
|
||||||
|
|
||||||
#include "lua_script.h"
|
#include "lua_script.h"
|
||||||
#include "lua_libs.h"
|
#include "lua_libs.h"
|
||||||
@@ -65,6 +68,8 @@ int mobj_mobjnum_unimplemented(lua_State *L);
|
|||||||
int mobj_scale_setter(lua_State *L);
|
int mobj_scale_setter(lua_State *L);
|
||||||
int mobj_destscale_setter(lua_State *L);
|
int mobj_destscale_setter(lua_State *L);
|
||||||
int mobj_standingslope_noset(lua_State *L);
|
int mobj_standingslope_noset(lua_State *L);
|
||||||
|
int mobj_rollsum_getter(lua_State *L);
|
||||||
|
int mobj_rollsum_noset(lua_State *L);
|
||||||
|
|
||||||
static const char *const array_opt[] ={"iterate",NULL};
|
static const char *const array_opt[] ={"iterate",NULL};
|
||||||
|
|
||||||
@@ -78,6 +83,8 @@ static const udata_field_t mobj_fields[] = {
|
|||||||
FIELD(mobj_t, angle, udatalib_getter_angle, mobj_angle_setter),
|
FIELD(mobj_t, angle, udatalib_getter_angle, mobj_angle_setter),
|
||||||
FIELD(mobj_t, rollangle, udatalib_getter_angle, udatalib_setter_angle),
|
FIELD(mobj_t, rollangle, udatalib_getter_angle, udatalib_setter_angle),
|
||||||
FIELD(mobj_t, sloperoll, udatalib_getter_angle, mobj_sloperoll_noop),
|
FIELD(mobj_t, sloperoll, udatalib_getter_angle, mobj_sloperoll_noop),
|
||||||
|
// Macro fails here
|
||||||
|
{ "rollsum", 0, mobj_rollsum_getter, mobj_rollsum_noset },
|
||||||
FIELD(mobj_t, sprite, udatalib_getter_spritenum, udatalib_setter_spritenum),
|
FIELD(mobj_t, sprite, udatalib_getter_spritenum, udatalib_setter_spritenum),
|
||||||
FIELD(mobj_t, frame, udatalib_getter_uint32, udatalib_setter_uint32),
|
FIELD(mobj_t, frame, udatalib_getter_uint32, udatalib_setter_uint32),
|
||||||
FIELD(mobj_t, anim_duration, udatalib_getter_uint16, udatalib_setter_uint16),
|
FIELD(mobj_t, anim_duration, udatalib_getter_uint16, udatalib_setter_uint16),
|
||||||
@@ -174,13 +181,21 @@ int mobj_ ## field ## _noset(lua_State *L) \
|
|||||||
return luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " should not be set directly.", #field); \
|
return luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " should not be set directly.", #field); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define NOSET_USE(field, use) \
|
||||||
|
int mobj_ ## field ## _noset(lua_State *L) \
|
||||||
|
{ \
|
||||||
|
return luaL_error(L, LUA_QL("mobj_t") " field " LUA_QS " should not be set directly. Use " LUA_QL(use) " instead.", #field); \
|
||||||
|
}
|
||||||
|
|
||||||
NOSET(snext)
|
NOSET(snext)
|
||||||
NOSET(bnext)
|
NOSET(bnext)
|
||||||
NOSET(info)
|
NOSET(info)
|
||||||
NOSET(player)
|
NOSET(player)
|
||||||
NOSET(standingslope)
|
NOSET(standingslope)
|
||||||
|
NOSET_USE(rollsum, "rollangle")
|
||||||
|
|
||||||
#undef NOSET
|
#undef NOSET
|
||||||
|
#undef NOSET_USE
|
||||||
|
|
||||||
// Unimplemented fields (why would you need to set them like that explicitly?
|
// Unimplemented fields (why would you need to set them like that explicitly?
|
||||||
// No idea, i'm keeping it for synch reasons)
|
// No idea, i'm keeping it for synch reasons)
|
||||||
@@ -350,8 +365,14 @@ int mobj_skin_getter(lua_State *L)
|
|||||||
if (!mo->skin)
|
if (!mo->skin)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
lua_pushstring(L, ((skin_t *)mo->skin)->name);
|
if (hud_running && cv_luaimmersion.value) {
|
||||||
|
if (mo->localskin) // HUD ONLY!!!!!!!!!!
|
||||||
|
lua_pushstring(L, ((skin_t *)mo->localskin)->name);
|
||||||
|
else
|
||||||
|
lua_pushstring(L, ((skin_t *)mo->skin)->name);
|
||||||
|
} else {
|
||||||
|
lua_pushstring(L, ((skin_t *)mo->skin)->name);
|
||||||
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,7 +384,7 @@ int mobj_skin_setter(lua_State *L)
|
|||||||
char skin[SKINNAMESIZE+1]; // all skin names are limited to this length
|
char skin[SKINNAMESIZE+1]; // all skin names are limited to this length
|
||||||
strlcpy(skin, luaL_checkstring(L, 2), sizeof skin);
|
strlcpy(skin, luaL_checkstring(L, 2), sizeof skin);
|
||||||
strlwr(skin); // all skin names are lowercase
|
strlwr(skin); // all skin names are lowercase
|
||||||
for (i = 0; i < numskins; i++)
|
for (i = 0; i < numskins; i++) {
|
||||||
{
|
{
|
||||||
if (fastcmp(skins[i].name, skin))
|
if (fastcmp(skins[i].name, skin))
|
||||||
{
|
{
|
||||||
@@ -372,7 +393,9 @@ int mobj_skin_setter(lua_State *L)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return luaL_error(L, "mobj.skin '%s' not found!", skin);
|
}
|
||||||
|
|
||||||
|
return luaL_error(L, "mobj.skin '%s' not found!", skin);
|
||||||
}
|
}
|
||||||
|
|
||||||
int mobj_color_setter(lua_State *L)
|
int mobj_color_setter(lua_State *L)
|
||||||
@@ -539,6 +562,24 @@ int mobj_destscale_setter(lua_State *L)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// WARNING: Not synch safe!
|
||||||
|
// Don't use this field in game logic code!
|
||||||
|
int mobj_rollsum_getter(lua_State *L)
|
||||||
|
{
|
||||||
|
mobj_t *mo = GETMO();
|
||||||
|
|
||||||
|
angle_t rollsum = mo->rollangle + cv_sloperoll.value ? mo->sloperoll : 0;
|
||||||
|
|
||||||
|
if (mo->player)
|
||||||
|
{
|
||||||
|
rollsum += R_PlayerSliptideAngle(mo->player);
|
||||||
|
}
|
||||||
|
|
||||||
|
lua_pushangle(L, rollsum);
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int mobj_get(lua_State *L)
|
static int mobj_get(lua_State *L)
|
||||||
{
|
{
|
||||||
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
|||||||
@@ -13,6 +13,7 @@
|
|||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
#include "fastcmp.h"
|
#include "fastcmp.h"
|
||||||
|
#include "r_main.h"
|
||||||
#include "p_mobj.h"
|
#include "p_mobj.h"
|
||||||
#include "d_player.h"
|
#include "d_player.h"
|
||||||
#include "g_game.h"
|
#include "g_game.h"
|
||||||
@@ -44,6 +45,10 @@ int player_splitscreenindex_noset(lua_State *L);
|
|||||||
int player_ping_getter(lua_State *L);
|
int player_ping_getter(lua_State *L);
|
||||||
int player_ping_noset(lua_State *L);
|
int player_ping_noset(lua_State *L);
|
||||||
|
|
||||||
|
// Non synch safe!
|
||||||
|
int player_sliproll_getter(lua_State *L);
|
||||||
|
int player_sliproll_noset(lua_State *L);
|
||||||
|
|
||||||
#define FIELD(type, field_name, getter, setter) { #field_name, offsetof(type, field_name), getter, setter }
|
#define FIELD(type, field_name, getter, setter) { #field_name, offsetof(type, field_name), getter, setter }
|
||||||
static const udata_field_t player_fields[] = {
|
static const udata_field_t player_fields[] = {
|
||||||
// Player doesn't actually have field "name" so macro fails. Need to declare field manually.
|
// Player doesn't actually have field "name" so macro fails. Need to declare field manually.
|
||||||
@@ -150,6 +155,7 @@ static const udata_field_t player_fields[] = {
|
|||||||
FIELD(player_t, fovadd, udatalib_getter_fixed, udatalib_setter_fixed), // Mmm yeah thats definitely synch safe
|
FIELD(player_t, fovadd, udatalib_getter_fixed, udatalib_setter_fixed), // Mmm yeah thats definitely synch safe
|
||||||
#endif
|
#endif
|
||||||
// Same as player.name
|
// Same as player.name
|
||||||
|
{ "sliproll", 0, player_sliproll_getter, player_sliproll_noset },
|
||||||
{ "ping", 0, player_ping_getter, player_ping_noset }, // Hmm originally setter doesn't exist so data is written as unreachable custom field...
|
{ "ping", 0, player_ping_getter, player_ping_noset }, // Hmm originally setter doesn't exist so data is written as unreachable custom field...
|
||||||
{ NULL },
|
{ NULL },
|
||||||
};
|
};
|
||||||
@@ -207,6 +213,7 @@ NOSET(kartstuff)
|
|||||||
NOSET(bot)
|
NOSET(bot)
|
||||||
NOSET(splitscreenindex)
|
NOSET(splitscreenindex)
|
||||||
NOSET(ping)
|
NOSET(ping)
|
||||||
|
NOSET(sliproll)
|
||||||
|
|
||||||
#undef NOSET
|
#undef NOSET
|
||||||
|
|
||||||
@@ -331,6 +338,15 @@ int player_ping_getter(lua_State *L)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int player_sliproll_getter(lua_State *L)
|
||||||
|
{
|
||||||
|
player_t *plr = GETPLAYER();
|
||||||
|
|
||||||
|
lua_pushangle(L, R_PlayerSliptideAngle(plr));
|
||||||
|
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
static int lib_iteratePlayers(lua_State *L)
|
static int lib_iteratePlayers(lua_State *L)
|
||||||
{
|
{
|
||||||
INT32 i = -1;
|
INT32 i = -1;
|
||||||
|
|||||||
+1
-1
@@ -280,7 +280,7 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump)
|
|||||||
LUA_LoadFile(&f, name); // actually load file!
|
LUA_LoadFile(&f, name); // actually load file!
|
||||||
|
|
||||||
// Okay, we've modified the game beyond the point of no return.
|
// Okay, we've modified the game beyond the point of no return.
|
||||||
G_SetGameModified(multiplayer, true);
|
G_SetWadModified(multiplayer, true, wad);
|
||||||
|
|
||||||
free(name);
|
free(name);
|
||||||
Z_Free(f.data);
|
Z_Free(f.data);
|
||||||
|
|||||||
+9
-9
@@ -166,14 +166,14 @@ static int lib_iterateSkins(lua_State *L)
|
|||||||
lua_remove(L, 1); // state is unused.
|
lua_remove(L, 1); // state is unused.
|
||||||
|
|
||||||
if (!lua_isnil(L, 1))
|
if (!lua_isnil(L, 1))
|
||||||
i = (INT32)(*((skin_t **)luaL_checkudata(L, 1, META_SKIN)) - skins) + 1;
|
i = (INT32)(*((skin_t **)luaL_checkudata(L, 1, META_SKIN)) - allskins) + 1;
|
||||||
else
|
else
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
// skins are always valid, only added, never removed
|
// skins are always valid, only added, never removed
|
||||||
if (i < numskins)
|
if (i < numallskins)
|
||||||
{
|
{
|
||||||
LUA_PushUserdata(L, &skins[i], META_SKIN);
|
LUA_PushUserdata(L, &allskins[i], META_SKIN);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,9 +191,9 @@ static int lib_getSkin(lua_State *L)
|
|||||||
i = luaL_checkinteger(L, 2);
|
i = luaL_checkinteger(L, 2);
|
||||||
if (i < 0 || i >= MAXSKINS)
|
if (i < 0 || i >= MAXSKINS)
|
||||||
return luaL_error(L, "skins[] index %d out of range (0 - %d)", i, MAXSKINS-1);
|
return luaL_error(L, "skins[] index %d out of range (0 - %d)", i, MAXSKINS-1);
|
||||||
if (i >= numskins)
|
if (i >= numallskins)
|
||||||
return 0;
|
return 0;
|
||||||
LUA_PushUserdata(L, &skins[i], META_SKIN);
|
LUA_PushUserdata(L, &allskins[i], META_SKIN);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,10 +207,10 @@ static int lib_getSkin(lua_State *L)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find skin by name
|
// find skin by name
|
||||||
for (i = 0; i < numskins; i++)
|
for (i = 0; i < numallskins; i++)
|
||||||
if (fastcmp(skins[i].name, field))
|
if (fastcmp(allskins[i].name, field))
|
||||||
{
|
{
|
||||||
LUA_PushUserdata(L, &skins[i], META_SKIN);
|
LUA_PushUserdata(L, &allskins[i], META_SKIN);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +219,7 @@ static int lib_getSkin(lua_State *L)
|
|||||||
|
|
||||||
static int lib_numSkins(lua_State *L)
|
static int lib_numSkins(lua_State *L)
|
||||||
{
|
{
|
||||||
lua_pushinteger(L, numskins);
|
lua_pushinteger(L, numallskins);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+239
-27
@@ -145,6 +145,8 @@ INT32 mapwads[NUMMAPS];
|
|||||||
//static char *char_notes = NULL;
|
//static char *char_notes = NULL;
|
||||||
//static fixed_t char_scroll = 0;
|
//static fixed_t char_scroll = 0;
|
||||||
|
|
||||||
|
boolean browselocalskins = false;
|
||||||
|
|
||||||
boolean menuactive = false;
|
boolean menuactive = false;
|
||||||
boolean fromlevelselect = false;
|
boolean fromlevelselect = false;
|
||||||
|
|
||||||
@@ -234,6 +236,8 @@ menu_t SR_MainDef, SR_UnlockChecklistDef;
|
|||||||
static void M_SinglePlayerMenu(INT32 choice);
|
static void M_SinglePlayerMenu(INT32 choice);
|
||||||
#endif
|
#endif
|
||||||
static void M_Options(INT32 choice);
|
static void M_Options(INT32 choice);
|
||||||
|
static void M_LocalSkinMenu(INT32 choice);
|
||||||
|
static void M_LocalSkinChange(INT32 choice);
|
||||||
static void M_Manual(INT32 choice);
|
static void M_Manual(INT32 choice);
|
||||||
static void M_SelectableClearMenus(INT32 choice);
|
static void M_SelectableClearMenus(INT32 choice);
|
||||||
static void M_Retry(INT32 choice);
|
static void M_Retry(INT32 choice);
|
||||||
@@ -336,7 +340,9 @@ menu_t OP_MonitorToggleDef;
|
|||||||
static void M_ScreenshotOptions(INT32 choice);
|
static void M_ScreenshotOptions(INT32 choice);
|
||||||
static void M_EraseData(INT32 choice);
|
static void M_EraseData(INT32 choice);
|
||||||
|
|
||||||
|
static void M_AddonsInternal();
|
||||||
static void M_Addons(INT32 choice);
|
static void M_Addons(INT32 choice);
|
||||||
|
static void M_LocalSkins(INT32 choice);
|
||||||
static void M_AddonsOptions(INT32 choice);
|
static void M_AddonsOptions(INT32 choice);
|
||||||
static patch_t *addonsp[NUM_EXT+5];
|
static patch_t *addonsp[NUM_EXT+5];
|
||||||
|
|
||||||
@@ -350,6 +356,9 @@ menu_t OP_SaturnCreditsDef;
|
|||||||
|
|
||||||
// Bird
|
// Bird
|
||||||
menu_t OP_BirdDef;
|
menu_t OP_BirdDef;
|
||||||
|
// Stuff, yknow.
|
||||||
|
menu_t OP_ForkedBirdDef;
|
||||||
|
menu_t OP_LocalSkinDef;
|
||||||
menu_t OP_TiltDef;
|
menu_t OP_TiltDef;
|
||||||
menu_t OP_AdvancedBirdDef;
|
menu_t OP_AdvancedBirdDef;
|
||||||
|
|
||||||
@@ -407,6 +416,7 @@ static void M_DrawConnectMenu(void);
|
|||||||
#endif
|
#endif
|
||||||
static void M_DrawJoystick(void);
|
static void M_DrawJoystick(void);
|
||||||
static void M_DrawSetupMultiPlayerMenu(void);
|
static void M_DrawSetupMultiPlayerMenu(void);
|
||||||
|
static void M_DrawLocalSkinMenu(void);
|
||||||
|
|
||||||
// Handling functions
|
// Handling functions
|
||||||
#ifndef NONET
|
#ifndef NONET
|
||||||
@@ -627,12 +637,13 @@ typedef enum
|
|||||||
// ---------------------
|
// ---------------------
|
||||||
static menuitem_t MPauseMenu[] =
|
static menuitem_t MPauseMenu[] =
|
||||||
{
|
{
|
||||||
{IT_STRING | IT_CALL, NULL, "Addons...", M_Addons, 8},
|
{IT_STRING | IT_CALL, NULL, "Addons...", M_Addons, 8},
|
||||||
{IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 16},
|
{IT_STRING | IT_CALL, NULL, "Add local skins...", M_LocalSkins, 16},
|
||||||
{IT_STRING | IT_CALL, NULL, "Switch Map..." , M_MapChange, 24},
|
{IT_STRING | IT_SUBMENU, NULL, "Scramble Teams...", &MISC_ScrambleTeamDef, 24},
|
||||||
|
{IT_STRING | IT_CALL, NULL, "Switch Map..." , M_MapChange, 32},
|
||||||
|
|
||||||
#ifdef HAVE_DISCORDRPC
|
#ifdef HAVE_DISCORDRPC
|
||||||
{IT_STRING | IT_SUBMENU, NULL, "Ask To Join Requests...", &MISC_DiscordRequestsDef, 24},
|
{IT_STRING | IT_SUBMENU, NULL, "Ask To Join Requests...", &MISC_DiscordRequestsDef, 32},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
{IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus, 40},
|
{IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus, 40},
|
||||||
@@ -647,15 +658,17 @@ static menuitem_t MPauseMenu[] =
|
|||||||
{IT_STRING | IT_SUBMENU, NULL, "Switch Team...", &MISC_ChangeTeamDef, 48},
|
{IT_STRING | IT_SUBMENU, NULL, "Switch Team...", &MISC_ChangeTeamDef, 48},
|
||||||
{IT_STRING | IT_SUBMENU, NULL, "Enter/Spectate...", &MISC_ChangeSpectateDef,48},
|
{IT_STRING | IT_SUBMENU, NULL, "Enter/Spectate...", &MISC_ChangeSpectateDef,48},
|
||||||
{IT_CALL | IT_STRING, NULL, "Player Setup...", M_SetupMultiPlayer, 56}, // alone
|
{IT_CALL | IT_STRING, NULL, "Player Setup...", M_SetupMultiPlayer, 56}, // alone
|
||||||
{IT_CALL | IT_STRING, NULL, "Options", M_Options, 64},
|
{IT_CALL | IT_STRING, NULL, "Local Skin...", M_LocalSkinMenu, 64}, // alone
|
||||||
|
{IT_CALL | IT_STRING, NULL, "Options", M_Options, 72},
|
||||||
|
|
||||||
{IT_CALL | IT_STRING, NULL, "Return to Title", M_EndGame, 80},
|
{IT_CALL | IT_STRING, NULL, "Return to Title", M_EndGame, 88},
|
||||||
{IT_CALL | IT_STRING, NULL, "Quit Game", M_QuitSRB2, 88},
|
{IT_CALL | IT_STRING, NULL, "Quit Game", M_QuitSRB2, 96},
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
mpause_addons = 0,
|
mpause_addons = 0,
|
||||||
|
mpause_addlocalskins,
|
||||||
mpause_scramble,
|
mpause_scramble,
|
||||||
mpause_switchmap,
|
mpause_switchmap,
|
||||||
#ifdef HAVE_DISCORDRPC
|
#ifdef HAVE_DISCORDRPC
|
||||||
@@ -674,6 +687,7 @@ typedef enum
|
|||||||
mpause_switchteam,
|
mpause_switchteam,
|
||||||
mpause_switchspectate,
|
mpause_switchspectate,
|
||||||
mpause_psetup,
|
mpause_psetup,
|
||||||
|
mpause_localskin,
|
||||||
mpause_options,
|
mpause_options,
|
||||||
|
|
||||||
mpause_title,
|
mpause_title,
|
||||||
@@ -1128,6 +1142,7 @@ static menuitem_t OP_MainMenu[] =
|
|||||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Options...", &OP_SaturnDef, 140},
|
{IT_SUBMENU|IT_STRING, NULL, "Saturn Options...", &OP_SaturnDef, 140},
|
||||||
|
|
||||||
{IT_SUBMENU|IT_STRING, NULL, "Bird", &OP_BirdDef, 150},
|
{IT_SUBMENU|IT_STRING, NULL, "Bird", &OP_BirdDef, 150},
|
||||||
|
{IT_CALL|IT_STRING, NULL, "Local Skin Options...", M_LocalSkinMenu, 160},
|
||||||
};
|
};
|
||||||
|
|
||||||
static menuitem_t OP_ControlsMenu[] =
|
static menuitem_t OP_ControlsMenu[] =
|
||||||
@@ -1347,7 +1362,8 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
|
|||||||
{IT_STRING | IT_CVAR, NULL, "3D Models", &cv_grmdls, 5},
|
{IT_STRING | IT_CVAR, NULL, "3D Models", &cv_grmdls, 5},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Fallback Player 3D Model", &cv_grfallbackplayermodel, 15},
|
{IT_STRING | IT_CVAR, NULL, "Fallback Player 3D Model", &cv_grfallbackplayermodel, 15},
|
||||||
{IT_STRING|IT_CVAR, NULL, "Shaders", &cv_grshaders, 25},
|
{IT_STRING|IT_CVAR, NULL, "Shaders", &cv_grshaders, 25},
|
||||||
{IT_STRING|IT_CVAR, NULL, "Use custom Shaders", &cv_grusecustomshaders, 35},
|
//{IT_STRING|IT_CVAR, NULL, "Use custom Shaders", &cv_grusecustomshaders, 35},
|
||||||
|
{IT_STRING|IT_CVAR, NULL, "Palette Rendering", &cv_grpaletteshader, 35},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Min Shader Brightness", &cv_secbright, 45},
|
{IT_STRING | IT_CVAR, NULL, "Min Shader Brightness", &cv_secbright, 45},
|
||||||
|
|
||||||
{IT_STRING|IT_CVAR, NULL, "Texture Quality", &cv_scr_depth, 65},
|
{IT_STRING|IT_CVAR, NULL, "Texture Quality", &cv_scr_depth, 65},
|
||||||
@@ -1404,24 +1420,27 @@ static menuitem_t OP_SoundOptionsMenu[] =
|
|||||||
|
|
||||||
{IT_STRING|IT_CVAR, NULL, "Play Music While Unfocused", &cv_playmusicifunfocused, 125},
|
{IT_STRING|IT_CVAR, NULL, "Play Music While Unfocused", &cv_playmusicifunfocused, 125},
|
||||||
{IT_STRING|IT_CVAR, NULL, "Play SFX While Unfocused", &cv_playsoundifunfocused, 135},
|
{IT_STRING|IT_CVAR, NULL, "Play SFX While Unfocused", &cv_playsoundifunfocused, 135},
|
||||||
#ifdef HAVE_OPENMPT
|
|
||||||
{IT_STRING|IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 155}
|
{IT_STRING|IT_SUBMENU, NULL, "Advanced Settings...", &OP_SoundAdvancedDef, 155}
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAVE_OPENMPT
|
|
||||||
static menuitem_t OP_SoundAdvancedMenu[] =
|
static menuitem_t OP_SoundAdvancedMenu[] =
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_OPENMPT
|
||||||
{IT_HEADER, NULL, "Tracker Module Options", NULL, 10},
|
{IT_HEADER, NULL, "Tracker Module Options", NULL, 10},
|
||||||
|
|
||||||
{IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 42},
|
{IT_STRING | IT_CVAR, NULL, "Instrument Filter", &cv_modfilter, 22},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Amiga Resampler", &cv_amigafilter, 62},
|
{IT_STRING | IT_CVAR, NULL, "Amiga Resampler", &cv_amigafilter, 42},
|
||||||
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
|
#if OPENMPT_API_VERSION_MAJOR < 1 && OPENMPT_API_VERSION_MINOR > 4
|
||||||
{IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 82},
|
{IT_STRING | IT_CVAR, NULL, "Amiga Type", &cv_amigatype, 62},
|
||||||
#endif
|
#endif
|
||||||
{IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 102},
|
{IT_STRING | IT_CVAR, NULL, "Stereo Seperation", &cv_stereosep, 82},
|
||||||
|
#endif
|
||||||
|
{IT_HEADER, NULL, "Misc", NULL, 105},
|
||||||
|
|
||||||
|
{IT_STRING | IT_CVAR, NULL, "Grow Music", &cv_growmusic, 117},
|
||||||
|
{IT_STRING | IT_CVAR, NULL, "Invulnerability Music", &cv_supermusic, 137},
|
||||||
};
|
};
|
||||||
#endif
|
|
||||||
|
|
||||||
static menuitem_t OP_DataOptionsMenu[] =
|
static menuitem_t OP_DataOptionsMenu[] =
|
||||||
{
|
{
|
||||||
@@ -1702,8 +1721,9 @@ static menuitem_t OP_SaturnMenu[] =
|
|||||||
{IT_STRING | IT_CVAR, NULL, "Show Minimap Names", &cv_showminimapnames, 80},
|
{IT_STRING | IT_CVAR, NULL, "Show Minimap Names", &cv_showminimapnames, 80},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 90},
|
{IT_STRING | IT_CVAR, NULL, "Small Minimap Players", &cv_minihead, 90},
|
||||||
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 110},
|
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 110},
|
||||||
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 130},
|
{IT_STRING | IT_CVAR, NULL, "Flashpals in Palette Renderer", &cv_grflashpal, 120},
|
||||||
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 145},
|
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 140},
|
||||||
|
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 155},
|
||||||
|
|
||||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 170}, // uwu
|
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 170}, // uwu
|
||||||
};
|
};
|
||||||
@@ -1812,6 +1832,17 @@ static menuitem_t OP_BirdMenu[] =
|
|||||||
{IT_STRING | IT_SUBMENU, NULL, "Advanced Music Options...", &OP_AdvancedBirdDef, 120},
|
{IT_STRING | IT_SUBMENU, NULL, "Advanced Music Options...", &OP_AdvancedBirdDef, 120},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static menuitem_t OP_ForkedBirdMenu[] =
|
||||||
|
{
|
||||||
|
{IT_HEADER, NULL, "Local Skins", NULL, 0},
|
||||||
|
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Local Skin Name", &cv_fakelocalskin, 10},
|
||||||
|
{IT_STRING2 | IT_SPACE, NULL, "Set to None for no Local Skin", NULL, 20},
|
||||||
|
{IT_STRING | IT_CALL, NULL, "Apply to All Players", M_LocalSkinChange, 140},
|
||||||
|
{IT_STRING | IT_CALL, NULL, "Apply to Displaying Player", M_LocalSkinChange, 150},
|
||||||
|
{IT_STRING | IT_CALL, NULL, "Apply to Yourself", M_LocalSkinChange, 160},
|
||||||
|
{IT_STRING | IT_CVAR, NULL, "Lua Immersion", &cv_luaimmersion, 170},
|
||||||
|
};
|
||||||
|
|
||||||
static menuitem_t OP_TiltMenu[] =
|
static menuitem_t OP_TiltMenu[] =
|
||||||
{
|
{
|
||||||
{IT_STRING | IT_CVAR, NULL, "Camera Tilting", &cv_tilting, 0},
|
{IT_STRING | IT_CVAR, NULL, "Camera Tilting", &cv_tilting, 0},
|
||||||
@@ -2375,6 +2406,20 @@ menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30);
|
|||||||
menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60);
|
menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60);
|
||||||
menu_t OP_AdvancedBirdDef = DEFAULTMENUSTYLE(NULL, OP_AdvancedBirdMenu, &OP_BirdDef, 30, 60);
|
menu_t OP_AdvancedBirdDef = DEFAULTMENUSTYLE(NULL, OP_AdvancedBirdMenu, &OP_BirdDef, 30, 60);
|
||||||
|
|
||||||
|
menu_t OP_ForkedBirdDef = {
|
||||||
|
NULL,
|
||||||
|
sizeof(OP_ForkedBirdMenu)/sizeof(menuitem_t),
|
||||||
|
&OP_MainDef,
|
||||||
|
OP_ForkedBirdMenu,
|
||||||
|
M_DrawLocalSkinMenu,
|
||||||
|
30, 6,
|
||||||
|
0,
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
menu_t OP_LocalSkinDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_ForkedBirdDef, 30, 60);
|
||||||
|
|
||||||
|
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
// CVAR ONCHANGE EVENTS GO HERE
|
// CVAR ONCHANGE EVENTS GO HERE
|
||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
@@ -3588,14 +3633,16 @@ void M_StartControlPanel(void)
|
|||||||
|
|
||||||
// Reset these in case splitscreen messes things up
|
// Reset these in case splitscreen messes things up
|
||||||
MPauseMenu[mpause_addons].alphaKey = 8;
|
MPauseMenu[mpause_addons].alphaKey = 8;
|
||||||
|
MPauseMenu[mpause_addlocalskins].alphaKey = 16;
|
||||||
MPauseMenu[mpause_scramble].alphaKey = 8;
|
MPauseMenu[mpause_scramble].alphaKey = 8;
|
||||||
MPauseMenu[mpause_switchmap].alphaKey = 24;
|
MPauseMenu[mpause_switchmap].alphaKey = 24;
|
||||||
|
|
||||||
MPauseMenu[mpause_switchteam].alphaKey = 48;
|
MPauseMenu[mpause_switchteam].alphaKey = 48;
|
||||||
MPauseMenu[mpause_switchspectate].alphaKey = 48;
|
MPauseMenu[mpause_switchspectate].alphaKey = 48;
|
||||||
MPauseMenu[mpause_options].alphaKey = 64;
|
MPauseMenu[mpause_localskin].alphaKey = 64;
|
||||||
MPauseMenu[mpause_title].alphaKey = 80;
|
MPauseMenu[mpause_options].alphaKey = 72;
|
||||||
MPauseMenu[mpause_quit].alphaKey = 88;
|
MPauseMenu[mpause_title].alphaKey = 88;
|
||||||
|
MPauseMenu[mpause_quit].alphaKey = 96;
|
||||||
|
|
||||||
Dummymenuplayer_OnChange();
|
Dummymenuplayer_OnChange();
|
||||||
|
|
||||||
@@ -3618,6 +3665,7 @@ void M_StartControlPanel(void)
|
|||||||
{
|
{
|
||||||
MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU;
|
MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU;
|
||||||
MPauseMenu[mpause_switchteam].alphaKey += ((splitscreen+1) * 8);
|
MPauseMenu[mpause_switchteam].alphaKey += ((splitscreen+1) * 8);
|
||||||
|
MPauseMenu[mpause_localskin].alphaKey += 8;
|
||||||
MPauseMenu[mpause_options].alphaKey += 8;
|
MPauseMenu[mpause_options].alphaKey += 8;
|
||||||
MPauseMenu[mpause_title].alphaKey += 8;
|
MPauseMenu[mpause_title].alphaKey += 8;
|
||||||
MPauseMenu[mpause_quit].alphaKey += 8;
|
MPauseMenu[mpause_quit].alphaKey += 8;
|
||||||
@@ -3626,6 +3674,7 @@ void M_StartControlPanel(void)
|
|||||||
{
|
{
|
||||||
MPauseMenu[mpause_switchspectate].status = IT_STRING | IT_SUBMENU;
|
MPauseMenu[mpause_switchspectate].status = IT_STRING | IT_SUBMENU;
|
||||||
MPauseMenu[mpause_switchspectate].alphaKey += ((splitscreen+1) * 8);
|
MPauseMenu[mpause_switchspectate].alphaKey += ((splitscreen+1) * 8);
|
||||||
|
MPauseMenu[mpause_localskin].alphaKey += 8;
|
||||||
MPauseMenu[mpause_options].alphaKey += 8;
|
MPauseMenu[mpause_options].alphaKey += 8;
|
||||||
MPauseMenu[mpause_title].alphaKey += 8;
|
MPauseMenu[mpause_title].alphaKey += 8;
|
||||||
MPauseMenu[mpause_quit].alphaKey += 8;
|
MPauseMenu[mpause_quit].alphaKey += 8;
|
||||||
@@ -3636,6 +3685,7 @@ void M_StartControlPanel(void)
|
|||||||
{
|
{
|
||||||
MPauseMenu[mpause_psetupsplit3].status = IT_STRING | IT_CALL;
|
MPauseMenu[mpause_psetupsplit3].status = IT_STRING | IT_CALL;
|
||||||
|
|
||||||
|
MPauseMenu[mpause_localskin].alphaKey += 8;
|
||||||
MPauseMenu[mpause_options].alphaKey += 8;
|
MPauseMenu[mpause_options].alphaKey += 8;
|
||||||
MPauseMenu[mpause_title].alphaKey += 8;
|
MPauseMenu[mpause_title].alphaKey += 8;
|
||||||
MPauseMenu[mpause_quit].alphaKey += 8;
|
MPauseMenu[mpause_quit].alphaKey += 8;
|
||||||
@@ -3643,6 +3693,7 @@ void M_StartControlPanel(void)
|
|||||||
if (splitscreen > 2)
|
if (splitscreen > 2)
|
||||||
{
|
{
|
||||||
MPauseMenu[mpause_psetupsplit4].status = IT_STRING | IT_CALL;
|
MPauseMenu[mpause_psetupsplit4].status = IT_STRING | IT_CALL;
|
||||||
|
MPauseMenu[mpause_localskin].alphaKey += 8;
|
||||||
MPauseMenu[mpause_options].alphaKey += 8;
|
MPauseMenu[mpause_options].alphaKey += 8;
|
||||||
MPauseMenu[mpause_title].alphaKey += 8;
|
MPauseMenu[mpause_title].alphaKey += 8;
|
||||||
MPauseMenu[mpause_quit].alphaKey += 8;
|
MPauseMenu[mpause_quit].alphaKey += 8;
|
||||||
@@ -4283,7 +4334,7 @@ static void M_DrawGenericMenu(void)
|
|||||||
y += STRINGHEIGHT;
|
y += STRINGHEIGHT;
|
||||||
break;
|
break;
|
||||||
case IT_STRING2:
|
case IT_STRING2:
|
||||||
V_DrawString(x, y, lowercase, currentMenu->menuitems[i].text);
|
V_DrawString(((BASEVIDWIDTH - V_StringWidth(currentMenu->menuitems[i].text, 0))>>1), y, 0, currentMenu->menuitems[i].text);
|
||||||
/* FALLTHRU */
|
/* FALLTHRU */
|
||||||
case IT_DYLITLSPACE:
|
case IT_DYLITLSPACE:
|
||||||
y += SMALLLINEHEIGHT;
|
y += SMALLLINEHEIGHT;
|
||||||
@@ -5110,12 +5161,10 @@ static void M_AddonsOptions(INT32 choice)
|
|||||||
#define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make addons!"
|
#define LOCATIONSTRING1 "Visit \x83SRB2.ORG/MODS\x80 to get & make addons!"
|
||||||
#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make addons!"
|
#define LOCATIONSTRING2 "Visit \x88SRB2.ORG/MODS\x80 to get & make addons!"
|
||||||
|
|
||||||
static void M_Addons(INT32 choice)
|
static void M_AddonsInternal()
|
||||||
{
|
{
|
||||||
const char *pathname = ".";
|
const char *pathname = ".";
|
||||||
|
|
||||||
(void)choice;
|
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
if (cv_addons_option.value == 0)
|
if (cv_addons_option.value == 0)
|
||||||
pathname = usehome ? srb2home : srb2path;
|
pathname = usehome ? srb2home : srb2path;
|
||||||
@@ -5176,6 +5225,20 @@ static void M_Addons(INT32 choice)
|
|||||||
M_SetupNextMenu(&MISC_AddonsDef);
|
M_SetupNextMenu(&MISC_AddonsDef);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void M_Addons(INT32 choice)
|
||||||
|
{
|
||||||
|
(void)choice;
|
||||||
|
browselocalskins = false;
|
||||||
|
M_AddonsInternal();
|
||||||
|
}
|
||||||
|
|
||||||
|
static void M_LocalSkins(INT32 choice)
|
||||||
|
{
|
||||||
|
(void)choice;
|
||||||
|
browselocalskins = true;
|
||||||
|
M_AddonsInternal();
|
||||||
|
}
|
||||||
|
|
||||||
#define width 4
|
#define width 4
|
||||||
#define vpadding 27
|
#define vpadding 27
|
||||||
#define h (BASEVIDHEIGHT-(2*vpadding))
|
#define h (BASEVIDHEIGHT-(2*vpadding))
|
||||||
@@ -5328,7 +5391,12 @@ static void M_DrawAddons(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (Playing())
|
if (Playing())
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, 5, warningflags, "Adding files mid-game may cause problems.");
|
{
|
||||||
|
if (browselocalskins)
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, 5, V_ALLOWLOWERCASE, "Load \x83local skins\x80 from addons!");
|
||||||
|
else
|
||||||
|
V_DrawCenteredString(BASEVIDWIDTH/2, 5, warningflags, "Adding files mid-game may cause problems.");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
V_DrawCenteredString(BASEVIDWIDTH/2, 5, 0, (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1));
|
V_DrawCenteredString(BASEVIDWIDTH/2, 5, 0, (recommendedflags == V_SKYMAP ? LOCATIONSTRING2 : LOCATIONSTRING1));
|
||||||
|
|
||||||
@@ -5499,6 +5567,14 @@ static boolean M_ChangeStringAddons(INT32 choice)
|
|||||||
}
|
}
|
||||||
#undef len
|
#undef len
|
||||||
|
|
||||||
|
// i hate myself
|
||||||
|
static boolean DumbStartsWith(const char *pre, const char *str)
|
||||||
|
{
|
||||||
|
size_t lenpre = strlen(pre),
|
||||||
|
lenstr = strlen(str);
|
||||||
|
return lenstr < lenpre ? false : memcmp(pre, str, lenpre) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void M_HandleAddons(INT32 choice)
|
static void M_HandleAddons(INT32 choice)
|
||||||
{
|
{
|
||||||
boolean exitmenu = false; // exit to previous menu
|
boolean exitmenu = false; // exit to previous menu
|
||||||
@@ -5617,7 +5693,16 @@ static void M_HandleAddons(INT32 choice)
|
|||||||
case EXT_KART:
|
case EXT_KART:
|
||||||
#endif
|
#endif
|
||||||
case EXT_PK3:
|
case EXT_PK3:
|
||||||
COM_BufAddText(va("addfile \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
|
if (browselocalskins) {
|
||||||
|
if (DumbStartsWith("KC_", dirmenu[dir_on[menudepthleft]]+DIR_STRING)) {
|
||||||
|
M_StartMessage(va("%c%s\x80\nYou are loading a local skin.\nLocal skins will not be usable\nafter going back from\nthe title screen.\n\n(Press a key)\n", ('\x80' + (highlightflags>>V_CHARCOLORSHIFT)), dirmenu[dir_on[menudepthleft]]+DIR_STRING),NULL,MM_NOTHING);
|
||||||
|
COM_BufAddText(va("addskins \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
S_StartSound(NULL, sfx_s26d);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
COM_BufAddText(va("addfile \"%s%s\"", menupath, dirmenu[dir_on[menudepthleft]]+DIR_STRING));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
S_StartSound(NULL, sfx_s26d);
|
S_StartSound(NULL, sfx_s26d);
|
||||||
@@ -11895,6 +11980,133 @@ static void M_DrawHUDOptions(void)
|
|||||||
V_DrawRightAlignedString(x, y, highlightflags, "(");
|
V_DrawRightAlignedString(x, y, highlightflags, "(");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void M_LocalSkinMenu(INT32 choice)
|
||||||
|
{
|
||||||
|
(void)choice;
|
||||||
|
|
||||||
|
multi_state = &states[mobjinfo[MT_PLAYER].seestate];
|
||||||
|
multi_tics = multi_state->tics;
|
||||||
|
|
||||||
|
OP_ForkedBirdDef.prevMenu = currentMenu;
|
||||||
|
M_SetupNextMenu(&OP_ForkedBirdDef);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void M_LocalSkinChange(INT32 choice)
|
||||||
|
{
|
||||||
|
(void)choice;
|
||||||
|
|
||||||
|
switch (itemOn) {
|
||||||
|
case 3:
|
||||||
|
COM_BufAddText(va("localskin -a %s", cv_fakelocalskin.string));
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
COM_BufAddText(va("localskin -d 0 %s", cv_fakelocalskin.string));
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
COM_BufAddText(va("localskin %s", cv_fakelocalskin.string));
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
S_StartSound(NULL, sfx_s221);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Display our localskin in our goofy ahhhh local skin menu
|
||||||
|
static void M_DrawLocalSkinMenu(void)
|
||||||
|
{
|
||||||
|
INT32 mx, my, st, flags = 0;
|
||||||
|
spritedef_t *sprdef;
|
||||||
|
spriteframe_t *sprframe;
|
||||||
|
patch_t *patch;
|
||||||
|
UINT8 frame;
|
||||||
|
UINT8 skintodisplay;
|
||||||
|
UINT32 speenframe;
|
||||||
|
|
||||||
|
mx = OP_ForkedBirdDef.x;
|
||||||
|
my = OP_ForkedBirdDef.y;
|
||||||
|
|
||||||
|
// use generic drawer for cursor, items and title
|
||||||
|
M_DrawGenericMenu();
|
||||||
|
|
||||||
|
#define charw 72
|
||||||
|
|
||||||
|
// anim the player in the box
|
||||||
|
if (--multi_tics <= 0)
|
||||||
|
{
|
||||||
|
st = multi_state->nextstate;
|
||||||
|
if (st != S_NULL)
|
||||||
|
multi_state = &states[st];
|
||||||
|
multi_tics = multi_state->tics;
|
||||||
|
if (multi_tics == -1)
|
||||||
|
multi_tics = 15;
|
||||||
|
}
|
||||||
|
|
||||||
|
// skin 0 is default player sprite
|
||||||
|
if (R_AnySkinAvailable(cv_fakelocalskin.string) != -1)
|
||||||
|
{
|
||||||
|
sprdef = &allskins[R_AnySkinAvailable(cv_fakelocalskin.string)].spritedef;
|
||||||
|
skintodisplay = R_AnySkinAvailable(cv_fakelocalskin.string);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// ATTEMPT TO FIND REAL SKIN
|
||||||
|
if (R_AnySkinAvailable(cv_skin.string) != -1)
|
||||||
|
{
|
||||||
|
sprdef = &allskins[R_AnySkinAvailable(cv_skin.string)].spritedef;
|
||||||
|
skintodisplay = R_AnySkinAvailable(cv_skin.string);
|
||||||
|
} else { // STILL NOTHIN? use sonic instead
|
||||||
|
sprdef = &allskins[0].spritedef;
|
||||||
|
skintodisplay = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sprdef->numframes) // No frames ??
|
||||||
|
return; // Can't render!
|
||||||
|
|
||||||
|
frame = multi_state->frame & FF_FRAMEMASK;
|
||||||
|
if (frame >= sprdef->numframes) // Walking animation missing
|
||||||
|
frame = 0; // Try to use standing frame
|
||||||
|
|
||||||
|
sprframe = &sprdef->spriteframes[frame];
|
||||||
|
|
||||||
|
//minenice's speen css, it's a piece of shit but hey
|
||||||
|
//patch = W_CachePatchNum(sprframe->lumppat[1], PU_CACHE);
|
||||||
|
speenframe = (I_GetTime()*4/TICRATE + 1)%8;
|
||||||
|
|
||||||
|
//this is a very shitty solution for checking if a sprite needs flipping
|
||||||
|
//but it works
|
||||||
|
if ((sprframe->lumppat[speenframe] == sprframe->lumppat[8-speenframe]) && (speenframe > 4)) {
|
||||||
|
flags = V_FLIP; // This sprite is left/right flipped!
|
||||||
|
}
|
||||||
|
patch = W_CachePatchNum(sprframe->lumppat[speenframe], PU_CACHE);
|
||||||
|
|
||||||
|
// draw box around guy
|
||||||
|
V_DrawFill(mx + 220 - (charw/2), my+54, charw, 84, 239);
|
||||||
|
|
||||||
|
// draw player sprite
|
||||||
|
UINT8 *colormap = R_GetTranslationColormap(skintodisplay, cv_playercolor.value, GTC_MENUCACHE);
|
||||||
|
colormap = R_GetLocalTranslationColormap(&skins[allskins[skintodisplay].localnum], (allskins[skintodisplay].localskin ? &localskins[allskins[skintodisplay].localnum] : NULL), cv_playercolor.value, GTC_MENUCACHE, allskins[skintodisplay].localskin);
|
||||||
|
|
||||||
|
V_DrawMappedPatch(mx, my+50, 0, W_CachePatchName(allskins[skintodisplay].facewant, PU_CACHE), colormap);
|
||||||
|
V_DrawMappedPatch(mx+8, my+85, 0, W_CachePatchName(allskins[skintodisplay].facerank, PU_CACHE), colormap);
|
||||||
|
V_DrawString(mx, my+108, V_ALLOWLOWERCASE, "Character");
|
||||||
|
if (strlen(allskins[skintodisplay].realname) > 10)
|
||||||
|
V_DrawThinString(mx+20, my+118, V_ALLOWLOWERCASE|highlightflags, allskins[skintodisplay].realname);
|
||||||
|
else
|
||||||
|
V_DrawString(mx+20, my+118, V_ALLOWLOWERCASE|highlightflags, allskins[skintodisplay].realname);
|
||||||
|
|
||||||
|
if (allskins[skintodisplay].flags & SF_HIRES)
|
||||||
|
{
|
||||||
|
V_DrawFixedPatch((mx+220)<<FRACBITS,
|
||||||
|
(my+120)<<FRACBITS,
|
||||||
|
allskins[skintodisplay].highresscale,
|
||||||
|
flags, patch, colormap);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
V_DrawMappedPatch(mx+220, my+120, flags, patch, colormap);
|
||||||
|
#undef charw
|
||||||
|
}
|
||||||
|
|
||||||
// Draw the video modes list, a-la-Quake
|
// Draw the video modes list, a-la-Quake
|
||||||
static void M_DrawVideoMode(void)
|
static void M_DrawVideoMode(void)
|
||||||
{
|
{
|
||||||
|
|||||||
+19
-6
@@ -2608,6 +2608,7 @@ void A_MonitorPop(mobj_t *actor)
|
|||||||
remains->fuse = actor->fuse; // Transfer respawn timer
|
remains->fuse = actor->fuse; // Transfer respawn timer
|
||||||
remains->threshold = 68;
|
remains->threshold = 68;
|
||||||
remains->skin = NULL;
|
remains->skin = NULL;
|
||||||
|
remains->localskin = NULL;
|
||||||
|
|
||||||
P_SetTarget(&tmthing, remains);
|
P_SetTarget(&tmthing, remains);
|
||||||
|
|
||||||
@@ -4167,6 +4168,18 @@ void A_SignPlayer(mobj_t *actor)
|
|||||||
P_SetTarget(&ov->target, actor);
|
P_SetTarget(&ov->target, actor);
|
||||||
ov->color = actor->target->player->skincolor;
|
ov->color = actor->target->player->skincolor;
|
||||||
ov->skin = &skins[actor->target->player->skin];
|
ov->skin = &skins[actor->target->player->skin];
|
||||||
|
if (actor->target->skinlocal) {
|
||||||
|
// needs - 1 or else it pukes an error out
|
||||||
|
// same thing happens on p_mobj.c
|
||||||
|
ov->localskin = &localskins[actor->target->player->localskin - 1];
|
||||||
|
ov->skinlocal = actor->target->skinlocal;
|
||||||
|
} else {
|
||||||
|
// needs - 1 or else it pukes an error out
|
||||||
|
// same thing happens on p_mobj.c
|
||||||
|
if (actor->target->player->localskin)
|
||||||
|
ov->localskin = &skins[actor->target->player->localskin - 1];
|
||||||
|
ov->skinlocal = actor->target->skinlocal;
|
||||||
|
}
|
||||||
P_SetMobjState(ov, actor->info->seestate); // S_PLAY_SIGN
|
P_SetMobjState(ov, actor->info->seestate); // S_PLAY_SIGN
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -7444,10 +7457,10 @@ void A_RollAngle(mobj_t *actor)
|
|||||||
INT32 locvar2 = var2;
|
INT32 locvar2 = var2;
|
||||||
const angle_t angle = FixedAngle(locvar1*FRACUNIT);
|
const angle_t angle = FixedAngle(locvar1*FRACUNIT);
|
||||||
|
|
||||||
/*#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_RollAngle", actor))
|
if (LUA_CallAction("A_RollAngle", actor))
|
||||||
return;
|
return;
|
||||||
#endif*/
|
#endif
|
||||||
|
|
||||||
// relative (default)
|
// relative (default)
|
||||||
if (!locvar2)
|
if (!locvar2)
|
||||||
@@ -7470,10 +7483,10 @@ void A_ChangeRollAngleRelative(mobj_t *actor)
|
|||||||
INT32 locvar2 = var2;
|
INT32 locvar2 = var2;
|
||||||
const fixed_t amin = locvar1*FRACUNIT;
|
const fixed_t amin = locvar1*FRACUNIT;
|
||||||
const fixed_t amax = locvar2*FRACUNIT;
|
const fixed_t amax = locvar2*FRACUNIT;
|
||||||
/*#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_ChangeRollAngleRelative", actor))
|
if (LUA_CallAction("A_ChangeRollAngleRelative", actor))
|
||||||
return;
|
return;
|
||||||
#endif*/
|
#endif
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
if (amin > amax)
|
if (amin > amax)
|
||||||
@@ -7496,10 +7509,10 @@ void A_ChangeRollAngleAbsolute(mobj_t *actor)
|
|||||||
INT32 locvar2 = var2;
|
INT32 locvar2 = var2;
|
||||||
const fixed_t amin = locvar1*FRACUNIT;
|
const fixed_t amin = locvar1*FRACUNIT;
|
||||||
const fixed_t amax = locvar2*FRACUNIT;
|
const fixed_t amax = locvar2*FRACUNIT;
|
||||||
/*#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (LUA_CallAction("A_ChangeRollAngleAbsolute", actor))
|
if (LUA_CallAction("A_ChangeRollAngleAbsolute", actor))
|
||||||
return;
|
return;
|
||||||
#endif*/
|
#endif
|
||||||
|
|
||||||
#ifdef PARANOIA
|
#ifdef PARANOIA
|
||||||
if (amin > amax)
|
if (amin > amax)
|
||||||
|
|||||||
@@ -10772,6 +10772,16 @@ void P_SpawnPlayer(INT32 playernum)
|
|||||||
// (usefulness: when body mobj is detached from player (who respawns),
|
// (usefulness: when body mobj is detached from player (who respawns),
|
||||||
// the dead body mobj retains the skin through the 'spritedef' override).
|
// the dead body mobj retains the skin through the 'spritedef' override).
|
||||||
mobj->skin = &skins[p->skin];
|
mobj->skin = &skins[p->skin];
|
||||||
|
if (p->localskin > 0)
|
||||||
|
{
|
||||||
|
if (p->skinlocal)
|
||||||
|
mobj->localskin = &localskins[p->localskin - 1];
|
||||||
|
else
|
||||||
|
mobj->localskin = & skins[p->localskin - 1];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
mobj->localskin = 0;
|
||||||
|
mobj->skinlocal = p->skinlocal;
|
||||||
|
|
||||||
mobj->health = p->health;
|
mobj->health = p->health;
|
||||||
p->playerstate = PST_LIVE;
|
p->playerstate = PST_LIVE;
|
||||||
|
|||||||
@@ -327,6 +327,8 @@ typedef struct mobj_s
|
|||||||
UINT16 eflags; // extra flags
|
UINT16 eflags; // extra flags
|
||||||
|
|
||||||
void *skin; // overrides 'sprite' when non-NULL (for player bodies to 'remember' the skin)
|
void *skin; // overrides 'sprite' when non-NULL (for player bodies to 'remember' the skin)
|
||||||
|
void *localskin;
|
||||||
|
boolean skinlocal;
|
||||||
// Player and mobj sprites in multiplayer modes are modified
|
// Player and mobj sprites in multiplayer modes are modified
|
||||||
// using an internal color lookup table for re-indexing.
|
// using an internal color lookup table for re-indexing.
|
||||||
UINT8 color; // This replaces MF_TRANSLATION. Use 0 for default (no translation).
|
UINT8 color; // This replaces MF_TRANSLATION. Use 0 for default (no translation).
|
||||||
|
|||||||
+10
-5
@@ -3433,7 +3433,7 @@ boolean P_RunSOC(const char *socfilename)
|
|||||||
lumpnum_t lump;
|
lumpnum_t lump;
|
||||||
|
|
||||||
if (strstr(socfilename, ".soc") != NULL)
|
if (strstr(socfilename, ".soc") != NULL)
|
||||||
return P_AddWadFile(socfilename);
|
return P_AddWadFile(socfilename, false);
|
||||||
|
|
||||||
lump = W_CheckNumForName(socfilename);
|
lump = W_CheckNumForName(socfilename);
|
||||||
if (lump == LUMPERROR)
|
if (lump == LUMPERROR)
|
||||||
@@ -3449,11 +3449,11 @@ boolean P_RunSOC(const char *socfilename)
|
|||||||
// Add a wadfile to the active wad files,
|
// Add a wadfile to the active wad files,
|
||||||
// replace sounds, musics, patches, textures, sprites and maps
|
// replace sounds, musics, patches, textures, sprites and maps
|
||||||
//
|
//
|
||||||
boolean P_AddWadFile(const char *wadfilename)
|
boolean P_AddWadFile(const char *wadfilename, boolean local)
|
||||||
{
|
{
|
||||||
UINT16 wadnum;
|
UINT16 wadnum;
|
||||||
|
|
||||||
if ((wadnum = P_PartialAddWadFile(wadfilename, false)) == UINT16_MAX)
|
if ((wadnum = P_PartialAddWadFile(wadfilename, local)) == UINT16_MAX)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
P_MultiSetupWadFiles(true);
|
P_MultiSetupWadFiles(true);
|
||||||
@@ -3483,7 +3483,7 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
boolean mapsadded = false;
|
boolean mapsadded = false;
|
||||||
lumpinfo_t *lumpinfo;
|
lumpinfo_t *lumpinfo;
|
||||||
|
|
||||||
if ((numlumps = W_InitFile(wadfilename, local)) == INT16_MAX)
|
if ((numlumps = W_InitFile(wadfilename, 0, &wadnum, local)) == INT16_MAX)
|
||||||
{
|
{
|
||||||
refreshdirmenu |= REFRESHDIR_NOTLOADED;
|
refreshdirmenu |= REFRESHDIR_NOTLOADED;
|
||||||
CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), wadfilename);
|
CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), wadfilename);
|
||||||
@@ -3494,6 +3494,11 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
if (wadfiles[wadnum]->important)
|
if (wadfiles[wadnum]->important)
|
||||||
partadd_important = true;
|
partadd_important = true;
|
||||||
|
|
||||||
|
if (local)
|
||||||
|
wadfiles[wadnum]->localfile = true;
|
||||||
|
else
|
||||||
|
wadfiles[wadnum]->localfile = false;
|
||||||
|
|
||||||
//
|
//
|
||||||
// search for sound replacements
|
// search for sound replacements
|
||||||
//
|
//
|
||||||
@@ -3545,7 +3550,7 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
|
|||||||
//
|
//
|
||||||
// look for skins
|
// look for skins
|
||||||
//
|
//
|
||||||
R_AddSkins(wadnum); // faB: wadfile index in wadfiles[]
|
R_AddSkins(wadnum, local); // faB: wadfile index in wadfiles[]
|
||||||
|
|
||||||
//
|
//
|
||||||
// edit music defs
|
// edit music defs
|
||||||
|
|||||||
+1
-1
@@ -60,7 +60,7 @@ void P_ScanThings(INT16 mapnum, INT16 wadnum, INT16 lumpnum);
|
|||||||
#endif
|
#endif
|
||||||
void P_LoadThingsOnly(void);
|
void P_LoadThingsOnly(void);
|
||||||
boolean P_SetupLevel(boolean skipprecip);
|
boolean P_SetupLevel(boolean skipprecip);
|
||||||
boolean P_AddWadFile(const char *wadfilename);
|
boolean P_AddWadFile(const char *wadfilename, boolean local);
|
||||||
boolean P_AddWadFileLocal(const char *wadfilename);
|
boolean P_AddWadFileLocal(const char *wadfilename);
|
||||||
#ifdef DELFILE
|
#ifdef DELFILE
|
||||||
boolean P_DelWadFile(void);
|
boolean P_DelWadFile(void);
|
||||||
|
|||||||
+17
-6
@@ -1278,13 +1278,13 @@ void P_RestoreMusic(player_t *player)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Item - Grow
|
// Item - Grow
|
||||||
if (wantedmus == 2)
|
if (wantedmus == 2 && cv_growmusic.value)
|
||||||
{
|
{
|
||||||
S_ChangeMusicInternal("kgrow", true);
|
S_ChangeMusicInternal("kgrow", true);
|
||||||
S_SetRestoreMusicFadeInCvar(&cv_growmusicfade);
|
S_SetRestoreMusicFadeInCvar(&cv_growmusicfade);
|
||||||
}
|
}
|
||||||
// Item - Invincibility
|
// Item - Invincibility
|
||||||
else if (wantedmus == 1)
|
else if (wantedmus == 1 && cv_supermusic.value)
|
||||||
{
|
{
|
||||||
S_ChangeMusicInternal("kinvnc", true);
|
S_ChangeMusicInternal("kinvnc", true);
|
||||||
S_SetRestoreMusicFadeInCvar(&cv_invincmusicfade);
|
S_SetRestoreMusicFadeInCvar(&cv_invincmusicfade);
|
||||||
@@ -1696,6 +1696,8 @@ mobj_t *P_SpawnGhostMobj(mobj_t *mobj)
|
|||||||
|
|
||||||
ghost->fuse = ghost->info->damage;
|
ghost->fuse = ghost->info->damage;
|
||||||
ghost->skin = mobj->skin;
|
ghost->skin = mobj->skin;
|
||||||
|
ghost->localskin = mobj->localskin;
|
||||||
|
ghost->skinlocal = mobj->skinlocal;
|
||||||
|
|
||||||
if (mobj->flags2 & MF2_OBJECTFLIP)
|
if (mobj->flags2 & MF2_OBJECTFLIP)
|
||||||
ghost->flags |= MF2_OBJECTFLIP;
|
ghost->flags |= MF2_OBJECTFLIP;
|
||||||
@@ -1737,10 +1739,19 @@ void P_DoPlayerExit(player_t *player)
|
|||||||
if (P_IsLocalPlayer(player))
|
if (P_IsLocalPlayer(player))
|
||||||
{
|
{
|
||||||
sfxenum_t sfx_id;
|
sfxenum_t sfx_id;
|
||||||
if (K_IsPlayerLosing(player))
|
// fix godjjsa win sounds
|
||||||
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_klose].skinsound];
|
if (K_IsPlayerLosing(player)) {
|
||||||
else
|
if (player->mo->localskin)
|
||||||
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_kwin].skinsound];
|
sfx_id = ((skin_t *)player->mo->localskin)->soundsid[S_sfx[sfx_klose].skinsound];
|
||||||
|
else
|
||||||
|
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_klose].skinsound];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (player->mo->localskin)
|
||||||
|
sfx_id = ((skin_t *)player->mo->localskin)->soundsid[S_sfx[sfx_kwin].skinsound];
|
||||||
|
else
|
||||||
|
sfx_id = ((skin_t *)player->mo->skin)->soundsid[S_sfx[sfx_kwin].skinsound];
|
||||||
|
}
|
||||||
S_StartSound(NULL, sfx_id);
|
S_StartSound(NULL, sfx_id);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
+9
-1
@@ -26,6 +26,10 @@
|
|||||||
#include "v_video.h" // pLocalPalette
|
#include "v_video.h" // pLocalPalette
|
||||||
#include "dehacked.h"
|
#include "dehacked.h"
|
||||||
|
|
||||||
|
#ifdef HWRENDER
|
||||||
|
#include "hardware/hw_main.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined (_WIN32) || defined (_WIN32_WCE)
|
#if defined (_WIN32) || defined (_WIN32_WCE)
|
||||||
#include <malloc.h> // alloca(sizeof)
|
#include <malloc.h> // alloca(sizeof)
|
||||||
#endif
|
#endif
|
||||||
@@ -1137,6 +1141,10 @@ void R_ClearColormaps(void)
|
|||||||
foundcolormaps[i] = LUMPERROR;
|
foundcolormaps[i] = LUMPERROR;
|
||||||
|
|
||||||
memset(extra_colormaps, 0, sizeof (extra_colormaps));
|
memset(extra_colormaps, 0, sizeof (extra_colormaps));
|
||||||
|
|
||||||
|
#ifdef HWRENDER
|
||||||
|
HWR_ClearLightTableCache();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*INT32 R_ColormapNumForName(char *name)
|
/*INT32 R_ColormapNumForName(char *name)
|
||||||
@@ -1317,7 +1325,7 @@ INT32 R_CreateColormap(char *p1, char *p2, char *p3)
|
|||||||
extra_colormaps[mapnum].fadeend = (UINT16)fadeend;
|
extra_colormaps[mapnum].fadeend = (UINT16)fadeend;
|
||||||
extra_colormaps[mapnum].fog = fog;
|
extra_colormaps[mapnum].fog = fog;
|
||||||
|
|
||||||
if (rendermode == render_soft)
|
if (rendermode == render_soft || rendermode == render_opengl)
|
||||||
{
|
{
|
||||||
double r, g, b, cbrightness;
|
double r, g, b, cbrightness;
|
||||||
int p;
|
int p;
|
||||||
|
|||||||
@@ -104,6 +104,4 @@ UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b);
|
|||||||
|
|
||||||
extern INT32 numtextures;
|
extern INT32 numtextures;
|
||||||
|
|
||||||
UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
// We rely on the thinker data struct to handle sound origins in sectors.
|
// We rely on the thinker data struct to handle sound origins in sectors.
|
||||||
#include "d_think.h"
|
#include "d_think.h"
|
||||||
|
|
||||||
// SECTORS do store MObjs anyway.
|
// SECTORS do store MObjs anyway.
|
||||||
#include "p_mobj.h"
|
#include "p_mobj.h"
|
||||||
|
|
||||||
@@ -62,6 +63,12 @@ typedef struct
|
|||||||
INT32 fadergba; // The colour the colourmaps fade to
|
INT32 fadergba; // The colour the colourmaps fade to
|
||||||
|
|
||||||
lighttable_t *colormap;
|
lighttable_t *colormap;
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef HWRENDER
|
||||||
|
// The id of the hardware lighttable. Zero means it does not exist yet.
|
||||||
|
UINT32 gl_lighttable_id;
|
||||||
|
#endif
|
||||||
} extracolormap_t;
|
} extracolormap_t;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|||||||
+43
-14
@@ -18,6 +18,7 @@
|
|||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
#include "doomstat.h"
|
#include "doomstat.h"
|
||||||
#include "r_local.h"
|
#include "r_local.h"
|
||||||
|
#include "r_things.h"
|
||||||
#include "st_stuff.h" // need ST_HEIGHT
|
#include "st_stuff.h" // need ST_HEIGHT
|
||||||
#include "i_video.h"
|
#include "i_video.h"
|
||||||
#include "v_video.h"
|
#include "v_video.h"
|
||||||
@@ -141,6 +142,7 @@ UINT32 nflatxshift, nflatyshift, nflatshiftup, nflatmask;
|
|||||||
#define NUM_PALETTE_ENTRIES 256
|
#define NUM_PALETTE_ENTRIES 256
|
||||||
|
|
||||||
static UINT8** translationtablecache[TT_CACHE_SIZE] = {NULL};
|
static UINT8** translationtablecache[TT_CACHE_SIZE] = {NULL};
|
||||||
|
static UINT8** localtranslationtablecache[MAXSKINS] = {NULL};
|
||||||
|
|
||||||
|
|
||||||
// See also the enum skincolors_t
|
// See also the enum skincolors_t
|
||||||
@@ -519,29 +521,39 @@ static void R_GenerateTranslationColormap(UINT8 *dest_colormap, INT32 skinnum, U
|
|||||||
|
|
||||||
\return Colormap. If not cached, caller should Z_Free.
|
\return Colormap. If not cached, caller should Z_Free.
|
||||||
*/
|
*/
|
||||||
UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags)
|
static UINT8* RGetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags, boolean local)
|
||||||
{
|
{
|
||||||
|
UINT8 ***tt;
|
||||||
UINT8* ret;
|
UINT8* ret;
|
||||||
INT32 skintableindex;
|
INT32 skintableindex;
|
||||||
|
|
||||||
// Adjust if we want the default colormap
|
if (local)
|
||||||
if (skinnum == TC_DEFAULT) skintableindex = DEFAULT_TT_CACHE_INDEX;
|
{
|
||||||
else if (skinnum == TC_BOSS) skintableindex = BOSS_TT_CACHE_INDEX;
|
tt = localtranslationtablecache;
|
||||||
else if (skinnum == TC_METALSONIC) skintableindex = METALSONIC_TT_CACHE_INDEX;
|
skintableindex = skinnum;
|
||||||
else if (skinnum == TC_ALLWHITE) skintableindex = ALLWHITE_TT_CACHE_INDEX;
|
}
|
||||||
else if (skinnum == TC_RAINBOW) skintableindex = RAINBOW_TT_CACHE_INDEX;
|
else
|
||||||
else if (skinnum == TC_BLINK) skintableindex = BLINK_TT_CACHE_INDEX;
|
{
|
||||||
else skintableindex = skinnum;
|
tt = translationtablecache;
|
||||||
|
// Adjust if we want the default colormap
|
||||||
|
if (skinnum == TC_DEFAULT) skintableindex = DEFAULT_TT_CACHE_INDEX;
|
||||||
|
else if (skinnum == TC_BOSS) skintableindex = BOSS_TT_CACHE_INDEX;
|
||||||
|
else if (skinnum == TC_METALSONIC) skintableindex = METALSONIC_TT_CACHE_INDEX;
|
||||||
|
else if (skinnum == TC_ALLWHITE) skintableindex = ALLWHITE_TT_CACHE_INDEX;
|
||||||
|
else if (skinnum == TC_RAINBOW) skintableindex = RAINBOW_TT_CACHE_INDEX;
|
||||||
|
else if (skinnum == TC_BLINK) skintableindex = BLINK_TT_CACHE_INDEX;
|
||||||
|
else skintableindex = skinnum;
|
||||||
|
}
|
||||||
|
|
||||||
if (flags & GTC_CACHE)
|
if (flags & GTC_CACHE)
|
||||||
{
|
{
|
||||||
|
|
||||||
// Allocate table for skin if necessary
|
// Allocate table for skin if necessary
|
||||||
if (!translationtablecache[skintableindex])
|
if (!tt[skintableindex])
|
||||||
translationtablecache[skintableindex] = Z_Calloc(MAXTRANSLATIONS * sizeof(UINT8**), PU_STATIC, NULL);
|
tt[skintableindex] = Z_Calloc(MAXTRANSLATIONS * sizeof(UINT8**), PU_STATIC, NULL);
|
||||||
|
|
||||||
// Get colormap
|
// Get colormap
|
||||||
ret = translationtablecache[skintableindex][color];
|
ret = tt[skintableindex][color];
|
||||||
}
|
}
|
||||||
else ret = NULL;
|
else ret = NULL;
|
||||||
|
|
||||||
@@ -549,16 +561,29 @@ UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags)
|
|||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
ret = Z_MallocAlign(NUM_PALETTE_ENTRIES, (flags & GTC_CACHE) ? PU_LEVEL : PU_STATIC, NULL, 8);
|
ret = Z_MallocAlign(NUM_PALETTE_ENTRIES, (flags & GTC_CACHE) ? PU_LEVEL : PU_STATIC, NULL, 8);
|
||||||
K_GenerateKartColormap(ret, skinnum, color); //R_GenerateTranslationColormap(ret, skinnum, color); // SRB2kart
|
K_GenerateKartColormap(ret, skinnum, color, local); //R_GenerateTranslationColormap(ret, skinnum, color); // SRB2kart
|
||||||
|
|
||||||
// Cache the colormap if desired
|
// Cache the colormap if desired
|
||||||
if (flags & GTC_CACHE)
|
if (flags & GTC_CACHE)
|
||||||
translationtablecache[skintableindex][color] = ret;
|
tt[skintableindex][color] = ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags)
|
||||||
|
{
|
||||||
|
return RGetTranslationColormap(skinnum, color, flags, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
UINT8* R_GetLocalTranslationColormap(skin_t *skin, skin_t *localskin, skincolors_t color, UINT8 flags, boolean local)
|
||||||
|
{
|
||||||
|
if (localskin)
|
||||||
|
return RGetTranslationColormap(( localskin - ( (local) ? localskins : skins ) ), color, flags, local);
|
||||||
|
else
|
||||||
|
return RGetTranslationColormap(( skin - skins ), color, flags, false);
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief Flushes cache of translation colormaps.
|
/** \brief Flushes cache of translation colormaps.
|
||||||
|
|
||||||
Flushes cache of translation colormaps, but doesn't actually free the
|
Flushes cache of translation colormaps, but doesn't actually free the
|
||||||
@@ -574,6 +599,10 @@ void R_FlushTranslationColormapCache(void)
|
|||||||
for (i = 0; i < (INT32)(sizeof(translationtablecache) / sizeof(translationtablecache[0])); i++)
|
for (i = 0; i < (INT32)(sizeof(translationtablecache) / sizeof(translationtablecache[0])); i++)
|
||||||
if (translationtablecache[i])
|
if (translationtablecache[i])
|
||||||
memset(translationtablecache[i], 0, MAXTRANSLATIONS * sizeof(UINT8**));
|
memset(translationtablecache[i], 0, MAXTRANSLATIONS * sizeof(UINT8**));
|
||||||
|
|
||||||
|
for (i = 0; i < (INT32)(sizeof(localtranslationtablecache) / sizeof(localtranslationtablecache[0])); i++)
|
||||||
|
if (localtranslationtablecache[i])
|
||||||
|
memset(localtranslationtablecache[i], 0, MAXTRANSLATIONS * sizeof(UINT8**));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
#define __R_DRAW__
|
#define __R_DRAW__
|
||||||
|
|
||||||
#include "r_defs.h"
|
#include "r_defs.h"
|
||||||
|
#include "r_things.h"
|
||||||
|
|
||||||
// -------------------------------
|
// -------------------------------
|
||||||
// COMMON STUFF FOR 8bpp AND 16bpp
|
// COMMON STUFF FOR 8bpp AND 16bpp
|
||||||
@@ -115,6 +116,7 @@ extern lumpnum_t viewborderlump[8];
|
|||||||
// Initialize color translation tables, for player rendering etc.
|
// Initialize color translation tables, for player rendering etc.
|
||||||
void R_InitTranslationTables(void);
|
void R_InitTranslationTables(void);
|
||||||
UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags);
|
UINT8* R_GetTranslationColormap(INT32 skinnum, skincolors_t color, UINT8 flags);
|
||||||
|
UINT8* R_GetLocalTranslationColormap(skin_t *skin, skin_t *localskin, skincolors_t color, UINT8 flags, boolean local);
|
||||||
void R_FlushTranslationColormapCache(void);
|
void R_FlushTranslationColormapCache(void);
|
||||||
UINT8 R_GetColorByName(const char *name);
|
UINT8 R_GetColorByName(const char *name);
|
||||||
|
|
||||||
|
|||||||
@@ -439,6 +439,60 @@ fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1)
|
|||||||
return FixedHypot(px1 - px2, py1 - py2);
|
return FixedHypot(px1 - px2, py1 - py2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
angle_t R_PlayerSliptideAngle(player_t *player)
|
||||||
|
{
|
||||||
|
mobj_t *mo = player->mo;
|
||||||
|
|
||||||
|
if (!cv_sliptideroll.value || !mo || P_MobjWasRemoved(mo)) return 0;
|
||||||
|
|
||||||
|
size_t rot = mo->frame&FF_FRAMEMASK;
|
||||||
|
boolean papersprite = (mo->frame & FF_PAPERSPRITE);
|
||||||
|
|
||||||
|
spritedef_t *sprdef;
|
||||||
|
spriteframe_t *sprframe;
|
||||||
|
angle_t ang = 0;
|
||||||
|
|
||||||
|
interpmobjstate_t interp = {0};
|
||||||
|
|
||||||
|
// Yes.
|
||||||
|
if (R_UsingFrameInterpolation() && !paused)
|
||||||
|
{
|
||||||
|
R_InterpolateMobjState(mo, rendertimefrac, &interp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
R_InterpolateMobjState(mo, FRACUNIT, &interp);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mo->skin && mo->sprite == SPR_PLAY)
|
||||||
|
{
|
||||||
|
sprdef = &((skin_t *)mo->skin)->spritedef;
|
||||||
|
|
||||||
|
if (rot >= sprdef->numframes)
|
||||||
|
sprdef = &sprites[mo->sprite];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprdef = &sprites[mo->sprite];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rot >= sprdef->numframes)
|
||||||
|
{
|
||||||
|
sprdef = &sprites[states[S_UNKNOWN].sprite];
|
||||||
|
rot = states[S_UNKNOWN].frame&FF_FRAMEMASK;
|
||||||
|
}
|
||||||
|
|
||||||
|
sprframe = &sprdef->spriteframes[rot];
|
||||||
|
|
||||||
|
// No sprite frame? I guess it is possible
|
||||||
|
if (!sprframe) return 0;
|
||||||
|
|
||||||
|
if (sprframe->rotate != SRF_SINGLE || papersprite)
|
||||||
|
ang = R_PointToAngle(interp.x, interp.y) - interp.angle;
|
||||||
|
|
||||||
|
return FixedMul(FINECOSINE((ang) >> ANGLETOFINESHIFT), mo->player->sliproll*(mo->player->sliptidemem));
|
||||||
|
}
|
||||||
|
|
||||||
// Little extra utility. Works in the same way as R_PointToAngle2
|
// Little extra utility. Works in the same way as R_PointToAngle2
|
||||||
fixed_t R_PointToDist(fixed_t x, fixed_t y)
|
fixed_t R_PointToDist(fixed_t x, fixed_t y)
|
||||||
{
|
{
|
||||||
@@ -1955,6 +2009,8 @@ void R_RegisterEngineStuff(void)
|
|||||||
CV_RegisterVar(&cv_grshearing);
|
CV_RegisterVar(&cv_grshearing);
|
||||||
CV_RegisterVar(&cv_grshaders);
|
CV_RegisterVar(&cv_grshaders);
|
||||||
CV_RegisterVar(&cv_grusecustomshaders);
|
CV_RegisterVar(&cv_grusecustomshaders);
|
||||||
|
CV_RegisterVar(&cv_grpaletteshader);
|
||||||
|
CV_RegisterVar(&cv_grflashpal);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ angle_t R_PointToAngle2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
|||||||
angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1);
|
angle_t R_PointToAngleEx(INT32 x2, INT32 y2, INT32 x1, INT32 y1);
|
||||||
fixed_t R_PointToDist(fixed_t x, fixed_t y);
|
fixed_t R_PointToDist(fixed_t x, fixed_t y);
|
||||||
fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
||||||
|
angle_t R_PlayerSliptideAngle(player_t *player);
|
||||||
|
|
||||||
fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
|
fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
|
||||||
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
|
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
|
||||||
|
|||||||
+21
-105
@@ -584,20 +584,6 @@ static void R_ParseSpriteInfo(boolean spr2)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/*for (i = 0; i <= NUMPLAYERSPRITES; i++)
|
|
||||||
{
|
|
||||||
if (i == NUMPLAYERSPRITES)
|
|
||||||
I_Error("Error parsing SPRTINFO lump: Unknown sprite2 name \"%s\"", newSpriteName);
|
|
||||||
if (!memcmp(newSpriteName,spr2names[i],4))
|
|
||||||
{
|
|
||||||
spr2num = i;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
// Fuckal: 2.1; playersprites don't exist
|
|
||||||
}
|
|
||||||
|
|
||||||
// allocate a spriteinfo
|
// allocate a spriteinfo
|
||||||
info = Z_Calloc(sizeof(spriteinfo_t), PU_STATIC, NULL);
|
info = Z_Calloc(sizeof(spriteinfo_t), PU_STATIC, NULL);
|
||||||
@@ -654,22 +640,6 @@ static void R_ParseSpriteInfo(boolean spr2)
|
|||||||
{
|
{
|
||||||
R_ParseSpriteInfoFrame(info);
|
R_ParseSpriteInfoFrame(info);
|
||||||
Z_Free(sprinfoToken);
|
Z_Free(sprinfoToken);
|
||||||
/*if (spr2)
|
|
||||||
{
|
|
||||||
if (!foundskins)
|
|
||||||
I_Error("Error parsing SPRTINFO lump: No skins specified in this sprite2 definition");
|
|
||||||
for (i = 0; i < foundskins; i++)
|
|
||||||
{
|
|
||||||
size_t skinnum = skinnumbers[i];
|
|
||||||
skin_t *skin = &skins[skinnum];
|
|
||||||
spriteinfo_t *sprinfo = skin->sprinfo;
|
|
||||||
#ifdef ROTSPRITE
|
|
||||||
R_FreeSkinRotSprite(skinnum);
|
|
||||||
#endif
|
|
||||||
M_Memcpy(&sprinfo[spr2num], info, sizeof(spriteinfo_t));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else*/
|
|
||||||
M_Memcpy(&spriteinfo[sprnum], info, sizeof(spriteinfo_t));
|
M_Memcpy(&spriteinfo[sprnum], info, sizeof(spriteinfo_t));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -793,6 +763,7 @@ static UINT16 GetPatchPixel(patch_t *patch, INT32 x, INT32 y, boolean flip)
|
|||||||
//
|
//
|
||||||
fixed_t rollcosang[ROTANGLES];
|
fixed_t rollcosang[ROTANGLES];
|
||||||
fixed_t rollsinang[ROTANGLES];
|
fixed_t rollsinang[ROTANGLES];
|
||||||
|
|
||||||
INT32 R_GetRollAngle(angle_t rollangle)
|
INT32 R_GetRollAngle(angle_t rollangle)
|
||||||
{
|
{
|
||||||
INT32 ra = AngleFixed(rollangle)>>FRACBITS;
|
INT32 ra = AngleFixed(rollangle)>>FRACBITS;
|
||||||
@@ -807,15 +778,11 @@ INT32 R_GetRollAngle(angle_t rollangle)
|
|||||||
patch_t *Patch_GetRotatedSprite(
|
patch_t *Patch_GetRotatedSprite(
|
||||||
spriteframe_t *sprite,
|
spriteframe_t *sprite,
|
||||||
size_t frame, size_t spriteangle,
|
size_t frame, size_t spriteangle,
|
||||||
boolean flip, void *info,
|
boolean flip, boolean adjustfeet,
|
||||||
INT32 rotationangle)
|
void *info, INT32 rotationangle)
|
||||||
{
|
{
|
||||||
rotsprite_t *rotsprite;
|
rotsprite_t *rotsprite;
|
||||||
spriteinfo_t *sprinfo = (spriteinfo_t *)info;
|
spriteinfo_t *sprinfo = (spriteinfo_t *)info;
|
||||||
boolean adjustfeet;
|
|
||||||
|
|
||||||
adjustfeet = (rendermode == render_none);
|
|
||||||
|
|
||||||
INT32 idx = rotationangle;
|
INT32 idx = rotationangle;
|
||||||
UINT8 type = (adjustfeet ? 1 : 0);
|
UINT8 type = (adjustfeet ? 1 : 0);
|
||||||
|
|
||||||
@@ -903,17 +870,11 @@ static patch_t *R_CreateHardwarePatch(patch_t *patch)
|
|||||||
GLPatch_t *grPatch = Z_Calloc(sizeof(GLPatch_t), PU_HWRPATCHINFO, NULL);
|
GLPatch_t *grPatch = Z_Calloc(sizeof(GLPatch_t), PU_HWRPATCHINFO, NULL);
|
||||||
grPatch->mipmap = Z_Calloc(sizeof(GLMipmap_t), PU_HWRPATCHINFO, NULL);
|
grPatch->mipmap = Z_Calloc(sizeof(GLMipmap_t), PU_HWRPATCHINFO, NULL);
|
||||||
grPatch->rawpatch = patch;
|
grPatch->rawpatch = patch;
|
||||||
//sprframe->rotsprite.patch[rot][angle] = (patch_t *)grPatch;
|
|
||||||
HWR_MakePatch(patch, grPatch, grPatch->mipmap, false);
|
HWR_MakePatch(patch, grPatch, grPatch->mipmap, false);
|
||||||
return (patch_t *)grPatch;
|
return (patch_t *)grPatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip)
|
||||||
// R_CacheRotSprite
|
|
||||||
//
|
|
||||||
// Create a rotated sprite.
|
|
||||||
//
|
|
||||||
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, UINT8 flip)
|
|
||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
patch_t *rotated, *hwpatch;
|
patch_t *rotated, *hwpatch;
|
||||||
@@ -947,15 +908,14 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
|||||||
leftoffset = width - leftoffset;
|
leftoffset = width - leftoffset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (rotsprite->patches[idx])
|
||||||
if (rotsprite->patches[idx])
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Find the dimensions of the rotated patch.
|
// Find the dimensions of the rotated patch.
|
||||||
RotatedPatch_CalculateDimensions(width, height, ca, sa, &newwidth, &newheight);
|
RotatedPatch_CalculateDimensions(width, height, ca, sa, &newwidth, &newheight);
|
||||||
|
|
||||||
xcenter = (xpivot * FRACUNIT);
|
xcenter = (xpivot * FRACUNIT);
|
||||||
ycenter = (ypivot * FRACUNIT);
|
ycenter = (ypivot * FRACUNIT);
|
||||||
|
|
||||||
if (xpivot != width / 2 || ypivot != height / 2)
|
if (xpivot != width / 2 || ypivot != height / 2)
|
||||||
{
|
{
|
||||||
@@ -968,13 +928,12 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
|||||||
maxx = 0;
|
maxx = 0;
|
||||||
maxy = 0;
|
maxy = 0;
|
||||||
|
|
||||||
|
// Draw the rotated sprite to a temporary buffer.
|
||||||
// Draw the rotated sprite to a temporary buffer.
|
|
||||||
size = (newwidth * newheight);
|
size = (newwidth * newheight);
|
||||||
if (!size)
|
if (!size)
|
||||||
size = (width * height);
|
size = (width * height);
|
||||||
|
rawdst = Z_Calloc(size * sizeof(UINT16), PU_STATIC, NULL);
|
||||||
|
|
||||||
rawdst = Z_Malloc(size * sizeof(UINT16), PU_STATIC, NULL);
|
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
rawdst[i] = 0xFF00;
|
rawdst[i] = 0xFF00;
|
||||||
|
|
||||||
@@ -995,24 +954,21 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ox = (newwidth / 2) + (leftoffset - xpivot);
|
ox = (newwidth / 2) + (leftoffset - xpivot);
|
||||||
oy = (newheight / 2) + (patch->topoffset - ypivot);
|
oy = (newheight / 2) + (patch->topoffset - ypivot);
|
||||||
width = (maxx+1 - minx);
|
width = (maxx - minx);
|
||||||
height = (maxy+1 - miny);
|
height = (maxy - miny);
|
||||||
|
|
||||||
if ((unsigned)(width * height) > size)
|
if ((unsigned)(width * height) > size)
|
||||||
{
|
{
|
||||||
UINT16 *src, *dest;
|
UINT16 *src, *dest;
|
||||||
|
|
||||||
|
size = (width * height);
|
||||||
|
rawconv = Z_Calloc(size * sizeof(UINT16), PU_STATIC, NULL);
|
||||||
|
|
||||||
size = (width * height);
|
src = &rawdst[(miny * newwidth) + minx];
|
||||||
rawconv = Z_Malloc(size * sizeof(UINT16), PU_STATIC, NULL);
|
dest = rawconv;
|
||||||
|
dy = height;
|
||||||
src = &rawdst[(miny * newwidth) + minx];
|
|
||||||
dest = rawconv;
|
|
||||||
dy = height;
|
|
||||||
|
|
||||||
|
|
||||||
while (dy--)
|
while (dy--)
|
||||||
{
|
{
|
||||||
@@ -1021,11 +977,9 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
|||||||
src += newwidth;
|
src += newwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ox -= minx;
|
ox -= minx;
|
||||||
oy -= miny;
|
oy -= miny;
|
||||||
|
|
||||||
|
|
||||||
Z_Free(rawdst);
|
Z_Free(rawdst);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1058,45 +1012,7 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
|||||||
|
|
||||||
Z_Free(rawconv);
|
Z_Free(rawconv);
|
||||||
|
|
||||||
//rotated->leftoffset = ox;
|
rotated->leftoffset = ox;
|
||||||
//rotated->topoffset = oy;
|
rotated->topoffset = oy;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// R_FreeSingleRotSprite
|
|
||||||
//
|
|
||||||
// IS DEAD BECAUSE OF SIGSEG HELL
|
|
||||||
//
|
|
||||||
|
|
||||||
//
|
|
||||||
// R_FreeSkinRotSprite
|
|
||||||
//
|
|
||||||
// Free sprite rotation data from memory, for a skin.
|
|
||||||
// Calls R_FreeSingleRotSprite.
|
|
||||||
//
|
|
||||||
/*void R_FreeSkinRotSprite(size_t skinnum)
|
|
||||||
{
|
|
||||||
size_t i;
|
|
||||||
skin_t *skin = &skins[skinnum];
|
|
||||||
spritedef_t *skinsprites = skin->sprites;
|
|
||||||
for (i = 0; i < NUMPLAYERSPRITES*2; i++)
|
|
||||||
{
|
|
||||||
R_FreeSingleRotSprite(skinsprites);
|
|
||||||
skinsprites++;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
//
|
|
||||||
// R_FreeAllRotSprite
|
|
||||||
//
|
|
||||||
// Free ALL sprite rotation data from memory.
|
|
||||||
//
|
|
||||||
void R_FreeAllRotSprite(void)
|
|
||||||
{
|
|
||||||
//INT32 i;
|
|
||||||
size_t s;
|
|
||||||
/*for (i = 0; i < numskins; ++i)
|
|
||||||
R_FreeSkinRotSprite(i);*/
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
+4
-5
@@ -56,14 +56,13 @@ INT32 R_GetRollAngle(angle_t rollangle);
|
|||||||
patch_t *Patch_GetRotatedSprite(
|
patch_t *Patch_GetRotatedSprite(
|
||||||
spriteframe_t *sprite,
|
spriteframe_t *sprite,
|
||||||
size_t frame, size_t spriteangle,
|
size_t frame, size_t spriteangle,
|
||||||
boolean flip, void *info,
|
boolean flip, boolean adjustfeet,
|
||||||
INT32 rotationangle);
|
void *info, INT32 rotationangle);
|
||||||
rotsprite_t *RotatedPatch_Create(INT32 numangles);
|
rotsprite_t *RotatedPatch_Create(INT32 numangles);
|
||||||
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, UINT8 flip);
|
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip);
|
||||||
//void R_FreeSkinRotSprite(size_t skinnum);
|
|
||||||
extern fixed_t rollcosang[ROTANGLES];
|
extern fixed_t rollcosang[ROTANGLES];
|
||||||
extern fixed_t rollsinang[ROTANGLES];
|
extern fixed_t rollsinang[ROTANGLES];
|
||||||
void R_FreeAllRotSprite(void);
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif // __R_PATCH__
|
#endif // __R_PATCH__
|
||||||
@@ -1770,6 +1770,9 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||||||
openings = Z_Realloc(openings, maxopenings * sizeof (*openings), PU_STATIC, NULL);
|
openings = Z_Realloc(openings, maxopenings * sizeof (*openings), PU_STATIC, NULL);
|
||||||
lastopening = openings + pos;
|
lastopening = openings + pos;
|
||||||
|
|
||||||
|
if (oldopenings == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
// borrowed fix from *cough* zdoom *cough*
|
// borrowed fix from *cough* zdoom *cough*
|
||||||
// [RH] We also need to adjust the openings pointers that
|
// [RH] We also need to adjust the openings pointers that
|
||||||
// were already stored in drawsegs.
|
// were already stored in drawsegs.
|
||||||
|
|||||||
+169
-37
@@ -643,7 +643,7 @@ void R_InitSprites(void)
|
|||||||
// it can be is do before loading config for skin cvar possible value
|
// it can be is do before loading config for skin cvar possible value
|
||||||
R_InitSkins();
|
R_InitSkins();
|
||||||
for (i = 0; i < numwadfiles; i++)
|
for (i = 0; i < numwadfiles; i++)
|
||||||
R_AddSkins((UINT16)i);
|
R_AddSkins((UINT16)i, false);
|
||||||
|
|
||||||
//
|
//
|
||||||
// check if all sprites have frames
|
// check if all sprites have frames
|
||||||
@@ -852,6 +852,15 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||||||
if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // ditto
|
if ((UINT64)overflow_test&0xFFFFFFFF80000000ULL) return; // ditto
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO This check should not be necessary. But Papersprites near to the camera will sometimes create invalid values
|
||||||
|
// for the vissprite's startfrac. This happens because they are not depth culled like other sprites.
|
||||||
|
// Someone who is more familiar with papersprites pls check and try to fix <3
|
||||||
|
if (vis->startfrac < 0 || vis->startfrac > (patch->width << FRACBITS))
|
||||||
|
{
|
||||||
|
// never draw vissprites with startfrac out of patch range
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
colfunc = basecolfunc; // hack: this isn't resetting properly somewhere.
|
colfunc = basecolfunc; // hack: this isn't resetting properly somewhere.
|
||||||
dc_colormap = vis->colormap;
|
dc_colormap = vis->colormap;
|
||||||
if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
|
if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
|
||||||
@@ -872,10 +881,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||||||
if (vis->mobj->colorized)
|
if (vis->mobj->colorized)
|
||||||
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
|
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
|
||||||
else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_>
|
else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // MT_GHOST LOOKS LIKE A PLAYER SO USE THE PLAYER TRANSLATION TABLES. >_>
|
||||||
{
|
dc_translation = R_GetLocalTranslationColormap(vis->mobj->skin, vis->mobj->localskin, vis->mobj->color, GTC_CACHE, vis->mobj->skinlocal);
|
||||||
size_t skinnum = (skin_t*)vis->mobj->skin-skins;
|
|
||||||
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
|
|
||||||
}
|
|
||||||
else // Use the defaults
|
else // Use the defaults
|
||||||
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
|
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
|
||||||
}
|
}
|
||||||
@@ -893,10 +899,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||||||
if (vis->mobj->colorized)
|
if (vis->mobj->colorized)
|
||||||
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
|
dc_translation = R_GetTranslationColormap(TC_RAINBOW, vis->mobj->color, GTC_CACHE);
|
||||||
else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player!
|
else if (vis->mobj->skin && vis->mobj->sprite == SPR_PLAY) // This thing is a player!
|
||||||
{
|
dc_translation = R_GetLocalTranslationColormap(vis->mobj->skin, vis->mobj->localskin, vis->mobj->color, GTC_CACHE, vis->mobj->skinlocal);
|
||||||
size_t skinnum = (skin_t*)vis->mobj->skin-skins;
|
|
||||||
dc_translation = R_GetTranslationColormap((INT32)skinnum, vis->mobj->color, GTC_CACHE);
|
|
||||||
}
|
|
||||||
else // Use the defaults
|
else // Use the defaults
|
||||||
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
|
dc_translation = R_GetTranslationColormap(TC_DEFAULT, vis->mobj->color, GTC_CACHE);
|
||||||
}
|
}
|
||||||
@@ -925,7 +928,9 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||||||
frac = vis->startfrac;
|
frac = vis->startfrac;
|
||||||
windowtop = windowbottom = sprbotscreen = INT32_MAX;
|
windowtop = windowbottom = sprbotscreen = INT32_MAX;
|
||||||
|
|
||||||
if (vis->mobj->skin && ((skin_t *)vis->mobj->skin)->flags & SF_HIRES)
|
if (vis->mobj->localskin && ((skin_t *)vis->mobj->localskin)->flags & SF_HIRES)
|
||||||
|
this_scale = FixedMul(this_scale, ((skin_t *)vis->mobj->localskin)->highresscale);
|
||||||
|
else if (vis->mobj->skin && ((skin_t *)vis->mobj->skin)->flags & SF_HIRES)
|
||||||
this_scale = FixedMul(this_scale, ((skin_t *)vis->mobj->skin)->highresscale);
|
this_scale = FixedMul(this_scale, ((skin_t *)vis->mobj->skin)->highresscale);
|
||||||
if (this_scale <= 0)
|
if (this_scale <= 0)
|
||||||
this_scale = 1;
|
this_scale = 1;
|
||||||
@@ -1274,7 +1279,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||||||
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
|
//Fab : 02-08-98: 'skin' override spritedef currently used for skin
|
||||||
if (thing->skin && thing->sprite == SPR_PLAY)
|
if (thing->skin && thing->sprite == SPR_PLAY)
|
||||||
{
|
{
|
||||||
sprdef = &((skin_t *)thing->skin)->spritedef;
|
sprdef = &((skin_t *)( (thing->localskin) ? thing->localskin : thing->skin ))->spritedef;
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
sprinfo = &spriteinfo[thing->sprite];
|
sprinfo = &spriteinfo[thing->sprite];
|
||||||
#endif
|
#endif
|
||||||
@@ -1348,7 +1353,9 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||||||
|
|
||||||
I_Assert(lump < max_spritelumps);
|
I_Assert(lump < max_spritelumps);
|
||||||
|
|
||||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
if (thing->localskin && ((skin_t *)thing->localskin)->flags & SF_HIRES)
|
||||||
|
this_scale = FixedMul(this_scale, ((skin_t *)thing->localskin)->highresscale);
|
||||||
|
else if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||||
this_scale = FixedMul(this_scale, ((skin_t *)thing->skin)->highresscale);
|
this_scale = FixedMul(this_scale, ((skin_t *)thing->skin)->highresscale);
|
||||||
|
|
||||||
spr_width = spritecachedinfo[lump].width;
|
spr_width = spritecachedinfo[lump].width;
|
||||||
@@ -1373,7 +1380,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||||||
rollsum = (thing->rollangle) + (thing->sloperoll);
|
rollsum = (thing->rollangle) + (thing->sloperoll);
|
||||||
|
|
||||||
rollangle = R_GetRollAngle(rollsum);
|
rollangle = R_GetRollAngle(rollsum);
|
||||||
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, sprinfo, rollangle);
|
rotsprite = Patch_GetRotatedSprite(sprframe, (thing->frame & FF_FRAMEMASK), rot, flip, false, sprinfo, rollangle);
|
||||||
|
|
||||||
if (rotsprite != NULL)
|
if (rotsprite != NULL)
|
||||||
{
|
{
|
||||||
@@ -2784,6 +2791,8 @@ void R_DrawMasked(void)
|
|||||||
// ==========================================================================
|
// ==========================================================================
|
||||||
|
|
||||||
INT32 numskins = 0;
|
INT32 numskins = 0;
|
||||||
|
INT32 numallskins = 0;
|
||||||
|
INT32 numlocalskins = 0;
|
||||||
skin_t skins[MAXSKINS];
|
skin_t skins[MAXSKINS];
|
||||||
UINT8 skinstats[9][9][MAXSKINS];
|
UINT8 skinstats[9][9][MAXSKINS];
|
||||||
UINT8 skinstatscount[9][9] = {
|
UINT8 skinstatscount[9][9] = {
|
||||||
@@ -2798,13 +2807,16 @@ UINT8 skinstatscount[9][9] = {
|
|||||||
{0, 0, 0, 0, 0, 0, 0, 0, 0}
|
{0, 0, 0, 0, 0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
UINT8 skinsorted[MAXSKINS];
|
UINT8 skinsorted[MAXSKINS];
|
||||||
|
skin_t localskins[MAXSKINS];
|
||||||
|
skin_t allskins[MAXSKINS*2];
|
||||||
// FIXTHIS: don't work because it must be inistilised before the config load
|
// FIXTHIS: don't work because it must be inistilised before the config load
|
||||||
//#define SKINVALUES
|
//#define SKINVALUES
|
||||||
#ifdef SKINVALUES
|
#ifdef SKINVALUES
|
||||||
CV_PossibleValue_t skin_cons_t[MAXSKINS+1];
|
CV_PossibleValue_t skin_cons_t[MAXSKINS+1];
|
||||||
|
CV_PossibleValue_t localskin_cons_t[MAXSKINS+1];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void Sk_SetDefaultValue(skin_t *skin)
|
static void Sk_SetDefaultValue(skin_t *skin, boolean local)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
//
|
//
|
||||||
@@ -2812,7 +2824,7 @@ static void Sk_SetDefaultValue(skin_t *skin)
|
|||||||
//
|
//
|
||||||
memset(skin, 0, sizeof (skin_t));
|
memset(skin, 0, sizeof (skin_t));
|
||||||
snprintf(skin->name,
|
snprintf(skin->name,
|
||||||
sizeof skin->name, "skin %u", (UINT32)(skin-skins));
|
sizeof skin->name, "skin %u", (UINT32)(skin-( (local) ? localskins : skins )));
|
||||||
skin->name[sizeof skin->name - 1] = '\0';
|
skin->name[sizeof skin->name - 1] = '\0';
|
||||||
skin->wadnum = INT16_MAX;
|
skin->wadnum = INT16_MAX;
|
||||||
strcpy(skin->sprite, "");
|
strcpy(skin->sprite, "");
|
||||||
@@ -2853,13 +2865,15 @@ void R_InitSkins(void)
|
|||||||
{
|
{
|
||||||
skin_cons_t[i].value = 0;
|
skin_cons_t[i].value = 0;
|
||||||
skin_cons_t[i].strvalue = NULL;
|
skin_cons_t[i].strvalue = NULL;
|
||||||
|
localskin_cons_t[i].value = 0;
|
||||||
|
localskin_cons_t[i].strvalue = NULL;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// skin[0] = Sonic skin
|
// skin[0] = Sonic skin
|
||||||
skin = &skins[0];
|
skin = &skins[0];
|
||||||
numskins = 1;
|
numskins = 1;
|
||||||
Sk_SetDefaultValue(skin);
|
Sk_SetDefaultValue(skin, false);
|
||||||
memset(skinstats, 0, sizeof(skinstats));
|
memset(skinstats, 0, sizeof(skinstats));
|
||||||
memset(skinsorted, 0, sizeof(skinsorted));
|
memset(skinsorted, 0, sizeof(skinsorted));
|
||||||
|
|
||||||
@@ -2875,7 +2889,10 @@ void R_InitSkins(void)
|
|||||||
strncpy(skin->facerank, "PLAYRANK", 9);
|
strncpy(skin->facerank, "PLAYRANK", 9);
|
||||||
strncpy(skin->facewant, "PLAYWANT", 9);
|
strncpy(skin->facewant, "PLAYWANT", 9);
|
||||||
strncpy(skin->facemmap, "PLAYMMAP", 9);
|
strncpy(skin->facemmap, "PLAYMMAP", 9);
|
||||||
|
skin->wadnum = 0; // god what have you brought to this world
|
||||||
skin->prefcolor = SKINCOLOR_BLUE;
|
skin->prefcolor = SKINCOLOR_BLUE;
|
||||||
|
skin->localskin = false;
|
||||||
|
skin->localnum = 0;
|
||||||
|
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
skin->kartspeed = 8;
|
skin->kartspeed = 8;
|
||||||
@@ -2893,8 +2910,12 @@ void R_InitSkins(void)
|
|||||||
//MD2 for sonic doesn't want to load in Linux.
|
//MD2 for sonic doesn't want to load in Linux.
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
HWR_AddPlayerMD2(0);
|
HWR_AddPlayerMD2(0, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// lets set it
|
||||||
|
allskins[0] = skins[0];
|
||||||
|
numallskins = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// returns true if the skin name is found (loaded from pwad)
|
// returns true if the skin name is found (loaded from pwad)
|
||||||
@@ -2911,6 +2932,37 @@ INT32 R_SkinAvailable(const char *name)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// returns true if the skin name is found (loaded from pwad)
|
||||||
|
// warning return -1 if not found
|
||||||
|
INT32 R_AnySkinAvailable(const char *name)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
for (i = 0; i < numallskins; i++)
|
||||||
|
{
|
||||||
|
if (stricmp(allskins[i].name,name)==0)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 R_LocalSkinAvailable(const char *name, boolean local)
|
||||||
|
{
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
if (local)
|
||||||
|
{
|
||||||
|
for (i = 0; i < numlocalskins; i++)
|
||||||
|
{
|
||||||
|
if (stricmp(localskins[i].name,name)==0)
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return R_SkinAvailable(name);
|
||||||
|
}
|
||||||
|
|
||||||
// network code calls this when a 'skin change' is received
|
// network code calls this when a 'skin change' is received
|
||||||
boolean SetPlayerSkin(INT32 playernum, const char *skinname)
|
boolean SetPlayerSkin(INT32 playernum, const char *skinname)
|
||||||
{
|
{
|
||||||
@@ -2936,6 +2988,67 @@ boolean SetPlayerSkin(INT32 playernum, const char *skinname)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetLocalPlayerSkin(INT32 playernum, const char *skinname, consvar_t *cvar)
|
||||||
|
{
|
||||||
|
player_t *player = &players[playernum];
|
||||||
|
INT32 i;
|
||||||
|
|
||||||
|
if (strcasecmp(skinname, "none"))
|
||||||
|
{
|
||||||
|
for (i = 0; i < numlocalskins; i++)
|
||||||
|
{
|
||||||
|
// search in the skin list
|
||||||
|
if (stricmp(localskins[i].name, skinname) == 0)
|
||||||
|
{
|
||||||
|
player->localskin = 1 + i;
|
||||||
|
player->skinlocal = true;
|
||||||
|
if (player->mo)
|
||||||
|
{
|
||||||
|
player->mo->localskin = &localskins[i];
|
||||||
|
player->mo->skinlocal = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (i = 0; i < numskins; i++)
|
||||||
|
{
|
||||||
|
// search in the skin list
|
||||||
|
if (stricmp(skins[i].name, skinname) == 0)
|
||||||
|
{
|
||||||
|
player->localskin = 1 + i;
|
||||||
|
player->skinlocal = false;
|
||||||
|
if (player->mo)
|
||||||
|
{
|
||||||
|
player->mo->localskin = &skins[i];
|
||||||
|
player->mo->skinlocal = false;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player->localskin = 0;
|
||||||
|
player->skinlocal = false;
|
||||||
|
if (player->mo)
|
||||||
|
{
|
||||||
|
player->mo->localskin = 0;
|
||||||
|
player->mo->skinlocal = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cvar != NULL) {
|
||||||
|
if (player->localskin > 0) {
|
||||||
|
CV_StealthSet(&cv_fakelocalskin, ( (player->skinlocal) ? localskins : skins )[player->localskin - 1].name);
|
||||||
|
CV_StealthSet(cvar, ( (player->skinlocal) ? localskins : skins )[player->localskin - 1].name);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CV_StealthSet(&cv_fakelocalskin, "none");
|
||||||
|
CV_StealthSet(cvar, "none");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Same as SetPlayerSkin, but uses the skin #.
|
// Same as SetPlayerSkin, but uses the skin #.
|
||||||
// network code calls this when a 'skin change' is received
|
// network code calls this when a 'skin change' is received
|
||||||
void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
|
void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum)
|
||||||
@@ -3120,7 +3233,7 @@ void sortSkinGrid(void)
|
|||||||
//
|
//
|
||||||
// Find skin sprites, sounds & optional status bar face, & add them
|
// Find skin sprites, sounds & optional status bar face, & add them
|
||||||
//
|
//
|
||||||
void R_AddSkins(UINT16 wadnum)
|
void R_AddSkins(UINT16 wadnum, boolean local)
|
||||||
{
|
{
|
||||||
UINT16 lump, lastlump = 0;
|
UINT16 lump, lastlump = 0;
|
||||||
char *buf;
|
char *buf;
|
||||||
@@ -3140,7 +3253,7 @@ void R_AddSkins(UINT16 wadnum)
|
|||||||
// advance by default
|
// advance by default
|
||||||
lastlump = lump + 1;
|
lastlump = lump + 1;
|
||||||
|
|
||||||
if (numskins >= MAXSKINS)
|
if (( (local) ? numlocalskins : numskins ) >= MAXSKINS)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, M_GetText("Unable to add skin, too many characters are loaded (%d maximum)\n"), MAXSKINS);
|
CONS_Alert(CONS_WARNING, M_GetText("Unable to add skin, too many characters are loaded (%d maximum)\n"), MAXSKINS);
|
||||||
continue; // so we know how many skins couldn't be added
|
continue; // so we know how many skins couldn't be added
|
||||||
@@ -3156,8 +3269,8 @@ void R_AddSkins(UINT16 wadnum)
|
|||||||
buf2[size] = '\0';
|
buf2[size] = '\0';
|
||||||
|
|
||||||
// set defaults
|
// set defaults
|
||||||
skin = &skins[numskins];
|
skin = &( (local) ? localskins : skins )[( (local) ? numlocalskins : numskins )];
|
||||||
Sk_SetDefaultValue(skin);
|
Sk_SetDefaultValue(skin, local);
|
||||||
skin->wadnum = wadnum;
|
skin->wadnum = wadnum;
|
||||||
hudname = realname = false;
|
hudname = realname = false;
|
||||||
// parse
|
// parse
|
||||||
@@ -3181,7 +3294,7 @@ void R_AddSkins(UINT16 wadnum)
|
|||||||
// the skin name must uniquely identify a single skin
|
// the skin name must uniquely identify a single skin
|
||||||
// I'm lazy so if name is already used I leave the 'skin x'
|
// I'm lazy so if name is already used I leave the 'skin x'
|
||||||
// default skin name set in Sk_SetDefaultValue
|
// default skin name set in Sk_SetDefaultValue
|
||||||
if (R_SkinAvailable(value) == -1)
|
if (R_LocalSkinAvailable(value, local) == -1)
|
||||||
{
|
{
|
||||||
STRBUFCPY(skin->name, value);
|
STRBUFCPY(skin->name, value);
|
||||||
strlwr(skin->name);
|
strlwr(skin->name);
|
||||||
@@ -3191,12 +3304,12 @@ void R_AddSkins(UINT16 wadnum)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
const size_t stringspace =
|
const size_t stringspace =
|
||||||
strlen(value) + sizeof (numskins) + 1;
|
strlen(value) + sizeof (( (local) ? numlocalskins : numskins )) + 1;
|
||||||
char *value2 = Z_Malloc(stringspace, PU_STATIC, NULL);
|
char *value2 = Z_Malloc(stringspace, PU_STATIC, NULL);
|
||||||
snprintf(value2, stringspace,
|
snprintf(value2, stringspace,
|
||||||
"%s%d", value, numskins);
|
"%s%d", value, ( (local) ? numlocalskins : numskins ));
|
||||||
value2[stringspace - 1] = '\0';
|
value2[stringspace - 1] = '\0';
|
||||||
if (R_SkinAvailable(value2) == -1)
|
if (R_LocalSkinAvailable(value2, local) == -1)
|
||||||
{
|
{
|
||||||
STRBUFCPY(skin->name,
|
STRBUFCPY(skin->name,
|
||||||
value2);
|
value2);
|
||||||
@@ -3379,29 +3492,48 @@ next_token:
|
|||||||
|
|
||||||
CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name);
|
CONS_Printf(M_GetText("Added skin '%s'\n"), skin->name);
|
||||||
#ifdef SKINVALUES
|
#ifdef SKINVALUES
|
||||||
skin_cons_t[numskins].value = numskins;
|
( (local) ? localskin_cons_t : skin_cons_t )[( (local) ? numlocalskins : numskins )].value = ( (local) ? numlocalskins : numskins );
|
||||||
skin_cons_t[numskins].strvalue = skin->name;
|
( (local) ? localskin_cons_t : skin_cons_t )[( (local) ? numlocalskins : numskins )].strvalue = skin->name;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Update the forceskin possiblevalues
|
// Update the forceskin possiblevalues
|
||||||
Forceskin_cons_t[numskins+1].value = numskins;
|
if (!local)
|
||||||
Forceskin_cons_t[numskins+1].strvalue = skins[numskins].name;
|
{
|
||||||
|
Forceskin_cons_t[numskins+1].value = numskins;
|
||||||
|
Forceskin_cons_t[numskins+1].strvalue = skins[numskins].name;
|
||||||
|
}
|
||||||
|
|
||||||
|
skin->localskin = local;
|
||||||
|
// so we dont have to guess
|
||||||
|
if (local)
|
||||||
|
skin->localnum = numlocalskins;
|
||||||
|
else
|
||||||
|
skin->localnum = numskins;
|
||||||
|
|
||||||
// add face graphics
|
// add face graphics
|
||||||
ST_LoadFaceGraphics(skin->facerank, skin->facewant, skin->facemmap, numskins);
|
if (local) {
|
||||||
|
ST_LoadLocalFaceGraphics(skin->facerank, skin->facewant, skin->facemmap, numlocalskins);
|
||||||
|
} else {
|
||||||
|
ST_LoadFaceGraphics(skin->facerank, skin->facewant, skin->facemmap, numskins);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl)
|
||||||
HWR_AddPlayerMD2(numskins);
|
HWR_AddPlayerMD2(( (local) ? numlocalskins : numskins ), local);
|
||||||
#endif
|
#endif
|
||||||
skinstats[skin->kartspeed-1][skin->kartweight-1][skinstatscount[skin->kartspeed-1][skin->kartweight-1]] = numskins;
|
if (!local) {
|
||||||
CONS_Debug(DBG_SETUP, M_GetText("Added %d to %d, %d\n"), numskins, skin->kartweight, skin->kartweight);
|
skinstats[skin->kartspeed-1][skin->kartweight-1][skinstatscount[skin->kartspeed-1][skin->kartweight-1]] = numskins;
|
||||||
skinstatscount[skin->kartspeed-1][skin->kartweight-1]++;
|
CONS_Debug(DBG_SETUP, M_GetText("Added %d to %d, %d\n"), numskins, skin->kartweight, skin->kartweight);
|
||||||
CONS_Debug(DBG_SETUP, M_GetText("Incremented %d, %d to %d\n"), skin->kartspeed, skin->kartweight, skinstatscount[skin->kartspeed - 1][skin->kartweight - 1]);
|
skinstatscount[skin->kartspeed-1][skin->kartweight-1]++;
|
||||||
|
CONS_Debug(DBG_SETUP, M_GetText("Incremented %d, %d to %d\n"), skin->kartspeed, skin->kartweight, skinstatscount[skin->kartspeed - 1][skin->kartweight - 1]);
|
||||||
|
|
||||||
skinsorted[numskins] = numskins;
|
skinsorted[numskins] = numskins;
|
||||||
|
}
|
||||||
|
|
||||||
numskins++;
|
allskins[numallskins] = ( (local) ? localskins : skins )[( (local) ? numlocalskins : numskins )];
|
||||||
|
|
||||||
|
( (local) ? numlocalskins++ : numskins++ );
|
||||||
|
numallskins++;
|
||||||
}
|
}
|
||||||
|
|
||||||
sortSkinGrid();
|
sortSkinGrid();
|
||||||
|
|||||||
+11
-3
@@ -97,6 +97,9 @@ typedef struct
|
|||||||
|
|
||||||
// specific sounds per skin
|
// specific sounds per skin
|
||||||
sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
|
sfxenum_t soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table
|
||||||
|
|
||||||
|
boolean localskin;
|
||||||
|
INT32 localnum;
|
||||||
} skin_t;
|
} skin_t;
|
||||||
|
|
||||||
extern CV_PossibleValue_t Forceskin_cons_t[];
|
extern CV_PossibleValue_t Forceskin_cons_t[];
|
||||||
@@ -152,8 +155,6 @@ typedef struct vissprite_s
|
|||||||
|
|
||||||
extracolormap_t *extra_colormap; // global colormaps
|
extracolormap_t *extra_colormap; // global colormaps
|
||||||
|
|
||||||
//fixed_t xscale;
|
|
||||||
|
|
||||||
// Precalculated top and bottom screen coords for the sprite.
|
// Precalculated top and bottom screen coords for the sprite.
|
||||||
fixed_t thingheight; // The actual height of the thing (for 3D floors)
|
fixed_t thingheight; // The actual height of the thing (for 3D floors)
|
||||||
sector_t *sector; // The sector containing the thing.
|
sector_t *sector; // The sector containing the thing.
|
||||||
@@ -201,17 +202,24 @@ typedef struct drawnode_s
|
|||||||
} drawnode_t;
|
} drawnode_t;
|
||||||
|
|
||||||
extern INT32 numskins;
|
extern INT32 numskins;
|
||||||
|
extern INT32 numlocalskins;
|
||||||
|
extern INT32 numallskins;
|
||||||
extern skin_t skins[MAXSKINS];
|
extern skin_t skins[MAXSKINS];
|
||||||
extern UINT8 skinstats[9][9][MAXSKINS];
|
extern UINT8 skinstats[9][9][MAXSKINS];
|
||||||
extern UINT8 skinstatscount[9][9];
|
extern UINT8 skinstatscount[9][9];
|
||||||
extern UINT8 skinsorted[MAXSKINS];
|
extern UINT8 skinsorted[MAXSKINS];
|
||||||
|
|
||||||
void sortSkinGrid(void);
|
void sortSkinGrid(void);
|
||||||
|
extern skin_t localskins[MAXSKINS];
|
||||||
|
extern skin_t allskins[MAXSKINS*2];
|
||||||
|
|
||||||
boolean SetPlayerSkin(INT32 playernum,const char *skinname);
|
boolean SetPlayerSkin(INT32 playernum,const char *skinname);
|
||||||
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
|
void SetPlayerSkinByNum(INT32 playernum,INT32 skinnum); // Tails 03-16-2002
|
||||||
|
void SetLocalPlayerSkin(INT32 playernum,const char *skinname, consvar_t *cvar);
|
||||||
INT32 R_SkinAvailable(const char *name);
|
INT32 R_SkinAvailable(const char *name);
|
||||||
void R_AddSkins(UINT16 wadnum);
|
INT32 R_AnySkinAvailable(const char *name);
|
||||||
|
INT32 R_LocalSkinAvailable(const char *name, boolean local);
|
||||||
|
void R_AddSkins(UINT16 wadnum, boolean local);
|
||||||
|
|
||||||
#ifdef DELFILE
|
#ifdef DELFILE
|
||||||
void R_DelSkins(UINT16 wadnum);
|
void R_DelSkins(UINT16 wadnum);
|
||||||
|
|||||||
+1
-1
@@ -578,7 +578,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
|
|||||||
if (sfx->skinsound != -1 && origin && origin->skin)
|
if (sfx->skinsound != -1 && origin && origin->skin)
|
||||||
{
|
{
|
||||||
// redirect player sound to the sound in the skin table
|
// redirect player sound to the sound in the skin table
|
||||||
sfx_id = ((skin_t *)origin->skin)->soundsid[sfx->skinsound];
|
sfx_id = ((skin_t *)( (origin->localskin) ? origin->localskin : origin->skin ))->soundsid[sfx->skinsound];
|
||||||
sfx = &S_sfx[sfx_id];
|
sfx = &S_sfx[sfx_id];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -114,6 +114,9 @@ void *hwSym(const char *funcName,void *handle)
|
|||||||
GETFUNC(StartBatching);
|
GETFUNC(StartBatching);
|
||||||
GETFUNC(RenderBatches);
|
GETFUNC(RenderBatches);
|
||||||
|
|
||||||
|
GETFUNC(AddLightTable);
|
||||||
|
GETFUNC(ClearLightTableCache);
|
||||||
|
|
||||||
#else //HWRENDER
|
#else //HWRENDER
|
||||||
if (0 == strcmp("FinishUpdate", funcName))
|
if (0 == strcmp("FinishUpdate", funcName))
|
||||||
return funcPointer; //&FinishUpdate;
|
return funcPointer; //&FinishUpdate;
|
||||||
|
|||||||
+6
-7
@@ -3806,8 +3806,7 @@ static long get_entry(const char* name, const char* buf)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// quick fix for compil
|
size_t I_GetFreeMem(size_t *total)
|
||||||
UINT32 I_GetFreeMem(UINT32 *total)
|
|
||||||
{
|
{
|
||||||
#ifdef FREEBSD
|
#ifdef FREEBSD
|
||||||
struct vmmeter sum;
|
struct vmmeter sum;
|
||||||
@@ -3855,8 +3854,8 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||||||
info.dwLength = sizeof (MEMORYSTATUS);
|
info.dwLength = sizeof (MEMORYSTATUS);
|
||||||
GlobalMemoryStatus( &info );
|
GlobalMemoryStatus( &info );
|
||||||
if (total)
|
if (total)
|
||||||
*total = (UINT32)info.dwTotalPhys;
|
*total = (size_t)info.dwTotalPhys;
|
||||||
return (UINT32)info.dwAvailPhys;
|
return (size_t)info.dwAvailPhys;
|
||||||
#elif defined (__OS2__)
|
#elif defined (__OS2__)
|
||||||
UINT32 pr_arena;
|
UINT32 pr_arena;
|
||||||
|
|
||||||
@@ -3871,8 +3870,8 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||||||
/* Linux */
|
/* Linux */
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
char *memTag;
|
char *memTag;
|
||||||
UINT32 freeKBytes;
|
size_t freeKBytes;
|
||||||
UINT32 totalKBytes;
|
size_t totalKBytes;
|
||||||
INT32 n;
|
INT32 n;
|
||||||
INT32 meminfo_fd = -1;
|
INT32 meminfo_fd = -1;
|
||||||
long Cached;
|
long Cached;
|
||||||
@@ -3903,7 +3902,7 @@ UINT32 I_GetFreeMem(UINT32 *total)
|
|||||||
}
|
}
|
||||||
|
|
||||||
memTag += sizeof (MEMTOTAL);
|
memTag += sizeof (MEMTOTAL);
|
||||||
totalKBytes = atoi(memTag);
|
totalKBytes = (size_t)atoi(memTag);
|
||||||
|
|
||||||
if ((memTag = strstr(buf, MEMAVAILABLE)) == NULL)
|
if ((memTag = strstr(buf, MEMAVAILABLE)) == NULL)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "../doomstat.h"
|
#include "../doomstat.h"
|
||||||
|
#include "../p_setup.h"
|
||||||
#include "../i_system.h"
|
#include "../i_system.h"
|
||||||
#include "../v_video.h"
|
#include "../v_video.h"
|
||||||
#include "../m_argv.h"
|
#include "../m_argv.h"
|
||||||
@@ -969,6 +970,7 @@ static void Impl_HandleControllerButtonEvent(SDL_ControllerButtonEvent evt, Uint
|
|||||||
void I_GetEvent(void)
|
void I_GetEvent(void)
|
||||||
{
|
{
|
||||||
SDL_Event evt;
|
SDL_Event evt;
|
||||||
|
char* dropped_filedir;
|
||||||
// We only want the first motion event,
|
// We only want the first motion event,
|
||||||
// otherwise we'll end up catching the warp back to center.
|
// otherwise we'll end up catching the warp back to center.
|
||||||
//int mouseMotionOnce = 0;
|
//int mouseMotionOnce = 0;
|
||||||
@@ -1293,6 +1295,11 @@ void I_GetEvent(void)
|
|||||||
if (currentMenu == &OP_JoystickSetDef)
|
if (currentMenu == &OP_JoystickSetDef)
|
||||||
M_SetupJoystickMenu(0);
|
M_SetupJoystickMenu(0);
|
||||||
break;
|
break;
|
||||||
|
case SDL_DROPFILE:
|
||||||
|
dropped_filedir = evt.drop.file;
|
||||||
|
P_AddWadFile(dropped_filedir, false);
|
||||||
|
SDL_free(dropped_filedir); // Free dropped_filedir memory
|
||||||
|
break;
|
||||||
case SDL_QUIT:
|
case SDL_QUIT:
|
||||||
I_Quit();
|
I_Quit();
|
||||||
M_QuitResponse('y');
|
M_QuitResponse('y');
|
||||||
@@ -2142,6 +2149,9 @@ void I_StartupGraphics(void)
|
|||||||
HWD.pfnStartBatching = hwSym("StartBatching",NULL);
|
HWD.pfnStartBatching = hwSym("StartBatching",NULL);
|
||||||
HWD.pfnRenderBatches = hwSym("RenderBatches",NULL);
|
HWD.pfnRenderBatches = hwSym("RenderBatches",NULL);
|
||||||
|
|
||||||
|
HWD.pfnAddLightTable = hwSym("AddLightTable",NULL);
|
||||||
|
HWD.pfnClearLightTableCache = hwSym("ClearLightTableCache",NULL);
|
||||||
|
|
||||||
if (!HWD.pfnInit()) // load the OpenGL library
|
if (!HWD.pfnInit()) // load the OpenGL library
|
||||||
rendermode = render_soft;
|
rendermode = render_soft;
|
||||||
}
|
}
|
||||||
|
|||||||
+45
-6
@@ -58,6 +58,18 @@ patch_t *facerankprefix[MAXSKINS]; // ranking
|
|||||||
patch_t *facewantprefix[MAXSKINS]; // wanted
|
patch_t *facewantprefix[MAXSKINS]; // wanted
|
||||||
patch_t *facemmapprefix[MAXSKINS]; // minimap
|
patch_t *facemmapprefix[MAXSKINS]; // minimap
|
||||||
|
|
||||||
|
patch_t *localfacerankprefix[MAXSKINS]; // ranking
|
||||||
|
patch_t *localfacewantprefix[MAXSKINS]; // wanted
|
||||||
|
patch_t *localfacemmapprefix[MAXSKINS]; // minimap
|
||||||
|
|
||||||
|
char *facerankprefix_name[MAXSKINS]; // ranking
|
||||||
|
char *facewantprefix_name[MAXSKINS]; // wanted
|
||||||
|
char *facemmapprefix_name[MAXSKINS]; // minimap
|
||||||
|
|
||||||
|
char *localfacerankprefix_name[MAXSKINS]; // ranking
|
||||||
|
char *localfacewantprefix_name[MAXSKINS]; // wanted
|
||||||
|
char *localfacemmapprefix_name[MAXSKINS]; // minimap
|
||||||
|
|
||||||
// ------------------------------------------
|
// ------------------------------------------
|
||||||
// status bar overlay
|
// status bar overlay
|
||||||
// ------------------------------------------
|
// ------------------------------------------
|
||||||
@@ -232,18 +244,22 @@ void ST_doPaletteStuff(void)
|
|||||||
else
|
else
|
||||||
palette = 0;
|
palette = 0;
|
||||||
|
|
||||||
|
palette = min(max(palette, 0), 13);
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode == render_opengl)
|
if (rendermode == render_opengl && !cv_grpaletteshader.value || rendermode == render_opengl && cv_grpaletteshader.value && !cv_grflashpal.value)
|
||||||
palette = 0; // No flashpals here in OpenGL
|
palette = 0; // No flashpals here in OpenGL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
palette = min(max(palette, 0), 13);
|
|
||||||
|
|
||||||
if (palette != st_palette)
|
if (palette != st_palette)
|
||||||
{
|
{
|
||||||
st_palette = palette;
|
st_palette = palette;
|
||||||
|
|
||||||
if (rendermode == render_soft)
|
#ifdef HWRENDER
|
||||||
|
if (rendermode != render_none && cv_grpaletteshader.value && cv_grflashpal.value)
|
||||||
|
#else
|
||||||
|
if (rendermode != render_none)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
//V_SetPaletteLump(GetPalette()); // Reset the palette -- is this needed?
|
//V_SetPaletteLump(GetPalette()); // Reset the palette -- is this needed?
|
||||||
if (!splitscreen)
|
if (!splitscreen)
|
||||||
@@ -378,6 +394,25 @@ void ST_LoadFaceGraphics(char *rankstr, char *wantstr, char *mmapstr, INT32 skin
|
|||||||
facerankprefix[skinnum] = W_CachePatchName(rankstr, PU_HUDGFX);
|
facerankprefix[skinnum] = W_CachePatchName(rankstr, PU_HUDGFX);
|
||||||
facewantprefix[skinnum] = W_CachePatchName(wantstr, PU_HUDGFX);
|
facewantprefix[skinnum] = W_CachePatchName(wantstr, PU_HUDGFX);
|
||||||
facemmapprefix[skinnum] = W_CachePatchName(mmapstr, PU_HUDGFX);
|
facemmapprefix[skinnum] = W_CachePatchName(mmapstr, PU_HUDGFX);
|
||||||
|
|
||||||
|
facerankprefix_name[skinnum] = rankstr;
|
||||||
|
facewantprefix_name[skinnum] = wantstr;
|
||||||
|
facemmapprefix_name[skinnum] = mmapstr;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ST_LoadLocalFaceGraphics(char *rankstr, char *wantstr, char *mmapstr, INT32 skinnum)
|
||||||
|
{
|
||||||
|
localfacerankprefix[skinnum] = W_CachePatchName(rankstr, PU_HUDGFX);
|
||||||
|
localfacewantprefix[skinnum] = W_CachePatchName(wantstr, PU_HUDGFX);
|
||||||
|
localfacemmapprefix[skinnum] = W_CachePatchName(mmapstr, PU_HUDGFX);
|
||||||
|
|
||||||
|
localfacerankprefix_name[skinnum] = rankstr;
|
||||||
|
localfacewantprefix_name[skinnum] = wantstr;
|
||||||
|
localfacemmapprefix_name[skinnum] = mmapstr;
|
||||||
|
|
||||||
|
//CONS_Printf("Added rank prefix %s\n", rankstr);
|
||||||
|
//CONS_Printf("Added want prefix %s\n", wantstr);
|
||||||
|
//CONS_Printf("Added mmap prefix %s\n", mmapstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ST_ReloadSkinFaceGraphics(void)
|
void ST_ReloadSkinFaceGraphics(void)
|
||||||
@@ -386,6 +421,10 @@ void ST_ReloadSkinFaceGraphics(void)
|
|||||||
|
|
||||||
for (i = 0; i < numskins; i++)
|
for (i = 0; i < numskins; i++)
|
||||||
ST_LoadFaceGraphics(skins[i].facerank, skins[i].facewant, skins[i].facemmap, i);
|
ST_LoadFaceGraphics(skins[i].facerank, skins[i].facewant, skins[i].facemmap, i);
|
||||||
|
|
||||||
|
for (i = 0; i < numlocalskins; i++) {
|
||||||
|
ST_LoadLocalFaceGraphics(localskins[i].facerank, localskins[i].facewant, localskins[i].facemmap, i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void ST_InitData(void)
|
static inline void ST_InitData(void)
|
||||||
@@ -2167,9 +2206,9 @@ void ST_Drawer(void)
|
|||||||
//25/08/99: Hurdler: palette changes is done for all players,
|
//25/08/99: Hurdler: palette changes is done for all players,
|
||||||
// not only player1! That's why this part
|
// not only player1! That's why this part
|
||||||
// of code is moved somewhere else.
|
// of code is moved somewhere else.
|
||||||
if (rendermode == render_soft)
|
if (rendermode == render_soft || rendermode == render_opengl && cv_grpaletteshader.value && cv_grflashpal.value)
|
||||||
#endif
|
#endif
|
||||||
if (rendermode != render_none) ST_doPaletteStuff();
|
if (rendermode != render_none) ST_doPaletteStuff();
|
||||||
|
|
||||||
if (st_overlay)
|
if (st_overlay)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ void ST_LoadGraphics(void);
|
|||||||
|
|
||||||
// face load graphics, called when skin changes
|
// face load graphics, called when skin changes
|
||||||
void ST_LoadFaceGraphics(char *rankstr, char *wantstr, char *mmapstr, INT32 playernum);
|
void ST_LoadFaceGraphics(char *rankstr, char *wantstr, char *mmapstr, INT32 playernum);
|
||||||
|
void ST_LoadLocalFaceGraphics(char *rankstr, char *wantstr, char *mmapstr, INT32 playernum);
|
||||||
void ST_ReloadSkinFaceGraphics(void);
|
void ST_ReloadSkinFaceGraphics(void);
|
||||||
#ifdef DELFILE
|
#ifdef DELFILE
|
||||||
void ST_UnLoadFaceGraphics(INT32 skinnum);
|
void ST_UnLoadFaceGraphics(INT32 skinnum);
|
||||||
@@ -78,6 +79,15 @@ extern patch_t *sboperiod;
|
|||||||
extern patch_t *facerankprefix[MAXSKINS]; // ranking
|
extern patch_t *facerankprefix[MAXSKINS]; // ranking
|
||||||
extern patch_t *facewantprefix[MAXSKINS]; // wanted
|
extern patch_t *facewantprefix[MAXSKINS]; // wanted
|
||||||
extern patch_t *facemmapprefix[MAXSKINS]; // minimap
|
extern patch_t *facemmapprefix[MAXSKINS]; // minimap
|
||||||
|
extern patch_t *localfacerankprefix[MAXSKINS]; // ranking
|
||||||
|
extern patch_t *localfacewantprefix[MAXSKINS]; // wanted
|
||||||
|
extern patch_t *localfacemmapprefix[MAXSKINS]; // minimap
|
||||||
|
extern char *facerankprefix_name[MAXSKINS]; // ranking
|
||||||
|
extern char *facewantprefix_name[MAXSKINS]; // wanted
|
||||||
|
extern char *facemmapprefix_name[MAXSKINS]; // minimap
|
||||||
|
extern char *localfacerankprefix_name[MAXSKINS]; // ranking
|
||||||
|
extern char *localfacewantprefix_name[MAXSKINS]; // wanted
|
||||||
|
extern char *localfacemmapprefix_name[MAXSKINS]; // minimap
|
||||||
extern patch_t *livesback;
|
extern patch_t *livesback;
|
||||||
extern patch_t *ngradeletters[7];
|
extern patch_t *ngradeletters[7];
|
||||||
|
|
||||||
|
|||||||
+22
-4
@@ -28,6 +28,7 @@
|
|||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
#include "hardware/hw_main.h"
|
#include "hardware/hw_main.h"
|
||||||
|
#include "hardware/r_opengl/r_opengl.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Each screen is [vid.width*vid.height];
|
// Each screen is [vid.width*vid.height];
|
||||||
@@ -224,8 +225,17 @@ void V_SetPalette(INT32 palettenum)
|
|||||||
LoadMapPalette();
|
LoadMapPalette();
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode != render_soft && rendermode != render_none)
|
if (rendermode != render_soft && rendermode != render_none) {
|
||||||
HWR_SetPalette(&pLocalPalette[palettenum*256]);
|
// in palette rendering mode, we already manage our palette ourselves
|
||||||
|
if (cv_grpaletteshader.value == 1)
|
||||||
|
{
|
||||||
|
// reset our palette lookups n shit
|
||||||
|
gl_palette_initialized = false;
|
||||||
|
InitPalette(palettenum, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
HWR_SetPalette(pLocalPalette);
|
||||||
|
}
|
||||||
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
@@ -238,8 +248,16 @@ void V_SetPaletteLump(const char *pal)
|
|||||||
{
|
{
|
||||||
LoadPalette(pal);
|
LoadPalette(pal);
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
if (rendermode != render_soft && rendermode != render_none)
|
if (rendermode != render_soft && rendermode != render_none) {
|
||||||
HWR_SetPalette(pLocalPalette);
|
if (cv_grpaletteshader.value == 1)
|
||||||
|
{
|
||||||
|
// reset our palette lookups n shit
|
||||||
|
gl_palette_initialized = false;
|
||||||
|
InitPalette(0, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
HWR_SetPalette(pLocalPalette);
|
||||||
|
}
|
||||||
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+50
-9
@@ -65,6 +65,7 @@
|
|||||||
#include "i_system.h"
|
#include "i_system.h"
|
||||||
#include "md5.h"
|
#include "md5.h"
|
||||||
#include "lua_script.h"
|
#include "lua_script.h"
|
||||||
|
#include "st_stuff.h"
|
||||||
#ifdef SCANTHINGS
|
#ifdef SCANTHINGS
|
||||||
#include "p_setup.h" // P_ScanThings
|
#include "p_setup.h" // P_ScanThings
|
||||||
#endif
|
#endif
|
||||||
@@ -148,6 +149,40 @@ void W_Shutdown(void)
|
|||||||
|
|
||||||
static char filenamebuf[MAX_WADPATH];
|
static char filenamebuf[MAX_WADPATH];
|
||||||
|
|
||||||
|
// This #if is copied from filesrch.c, so not sure if it is 100% suitable for
|
||||||
|
// this
|
||||||
|
#if defined (_WIN32) && !defined (_XBOX)
|
||||||
|
//#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define RPC_NO_WINDOWS_H
|
||||||
|
#include <windows.h>
|
||||||
|
|
||||||
|
// Windows can't open utf-8 path so it must be converted to utf-16
|
||||||
|
FILE* fopen_utf8(const char* filename, const char* mode)
|
||||||
|
{
|
||||||
|
static const int MY_PATH_MAX = 2048;
|
||||||
|
WCHAR nameW[MY_PATH_MAX];
|
||||||
|
memset(nameW, 0, sizeof(WCHAR)*MY_PATH_MAX);
|
||||||
|
WCHAR modeW[16];
|
||||||
|
memset(modeW, 0, sizeof(WCHAR)*16);
|
||||||
|
// the following function converts the UTF-8 filename to UTF-16 (WCHAR) nameW
|
||||||
|
int len = MultiByteToWideChar(CP_UTF8, 0, filename, -1, nameW, MY_PATH_MAX);
|
||||||
|
if(len > 0 && MultiByteToWideChar(CP_UTF8, 0, mode, -1, modeW, 16) > 0)
|
||||||
|
{
|
||||||
|
// using _wfopen_s() shuts up MSVC's complaints
|
||||||
|
// about _wfopen() being unsafe..
|
||||||
|
FILE* ret = NULL;
|
||||||
|
if(_wfopen_s(&ret, nameW, modeW) == 0)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
|
#define fopen_utf8 fopen
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
// W_OpenWadFile
|
// W_OpenWadFile
|
||||||
// Helper function for opening the WAD file.
|
// Helper function for opening the WAD file.
|
||||||
// Returns the FILE * handle for the file, or NULL if not found or could not be opened
|
// Returns the FILE * handle for the file, or NULL if not found or could not be opened
|
||||||
@@ -165,7 +200,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors)
|
|||||||
*filename = filenamebuf;
|
*filename = filenamebuf;
|
||||||
|
|
||||||
// open wad file
|
// open wad file
|
||||||
if ((handle = fopen(*filename, "rb")) == NULL)
|
if ((handle = fopen_utf8(*filename, "rb")) == NULL)
|
||||||
{
|
{
|
||||||
// If we failed to load the file with the path as specified by
|
// If we failed to load the file with the path as specified by
|
||||||
// the user, strip the directories and search for the file.
|
// the user, strip the directories and search for the file.
|
||||||
@@ -175,7 +210,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors)
|
|||||||
// in filenamebuf == *filename.
|
// in filenamebuf == *filename.
|
||||||
if (findfile(filenamebuf, NULL, true))
|
if (findfile(filenamebuf, NULL, true))
|
||||||
{
|
{
|
||||||
if ((handle = fopen(*filename, "rb")) == NULL)
|
if ((handle = fopen_utf8(*filename, "rb")) == NULL)
|
||||||
{
|
{
|
||||||
if (useerrors)
|
if (useerrors)
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("Can't open %s\n"), *filename);
|
CONS_Alert(CONS_ERROR, M_GetText("Can't open %s\n"), *filename);
|
||||||
@@ -690,7 +725,7 @@ static void W_ReadFileShaders(wadfile_t *wadfile)
|
|||||||
//
|
//
|
||||||
// Can now load dehacked files (.soc)
|
// Can now load dehacked files (.soc)
|
||||||
//
|
//
|
||||||
UINT16 W_InitFile(const char *filename, boolean local)
|
UINT16 W_InitFile(const char *filename, const char *lumpname, UINT16 *wadnump, boolean local)
|
||||||
{
|
{
|
||||||
FILE *handle;
|
FILE *handle;
|
||||||
lumpinfo_t *lumpinfo = NULL;
|
lumpinfo_t *lumpinfo = NULL;
|
||||||
@@ -743,10 +778,13 @@ UINT16 W_InitFile(const char *filename, boolean local)
|
|||||||
{
|
{
|
||||||
if (!memcmp(wadfiles[i]->md5sum, md5sum, 16))
|
if (!memcmp(wadfiles[i]->md5sum, md5sum, 16))
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), filename);
|
if (!local) {
|
||||||
if (handle)
|
CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), filename);
|
||||||
fclose(handle);
|
if (handle)
|
||||||
return INT16_MAX;
|
fclose(handle);
|
||||||
|
return INT16_MAX;
|
||||||
|
}
|
||||||
|
CONS_Alert(CONS_WARNING, M_GetText("%s is a local skin that is already loaded\n"), filename);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@@ -789,6 +827,7 @@ UINT16 W_InitFile(const char *filename, boolean local)
|
|||||||
fseek(handle, 0, SEEK_END);
|
fseek(handle, 0, SEEK_END);
|
||||||
wadfile->filesize = (unsigned)ftell(handle);
|
wadfile->filesize = (unsigned)ftell(handle);
|
||||||
wadfile->type = type;
|
wadfile->type = type;
|
||||||
|
wadfile->majormod = false;
|
||||||
|
|
||||||
// already generated, just copy it over
|
// already generated, just copy it over
|
||||||
M_Memcpy(&wadfile->md5sum, &md5sum, 16);
|
M_Memcpy(&wadfile->md5sum, &md5sum, 16);
|
||||||
@@ -898,7 +937,7 @@ INT32 W_InitMultipleFiles(char **filenames, boolean addons)
|
|||||||
G_SetGameModified(true, false);
|
G_SetGameModified(true, false);
|
||||||
|
|
||||||
//CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames);
|
//CONS_Debug(DBG_SETUP, "Loading %s\n", *filenames);
|
||||||
rc = W_InitFile(*filenames, false);
|
rc = W_InitFile(*filenames, 0, 0, false);
|
||||||
if (rc == INT16_MAX)
|
if (rc == INT16_MAX)
|
||||||
CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), *filenames);
|
CONS_Printf(M_GetText("Errors occurred while loading %s; not added.\n"), *filenames);
|
||||||
overallrc &= (rc != INT16_MAX) ? 1 : 0;
|
overallrc &= (rc != INT16_MAX) ? 1 : 0;
|
||||||
@@ -1727,7 +1766,9 @@ void *W_CachePatchName(const char *name, INT32 tag)
|
|||||||
{
|
{
|
||||||
lumpnum_t num;
|
lumpnum_t num;
|
||||||
|
|
||||||
num = W_CheckNumForName(name);
|
const char *finalname = name;
|
||||||
|
|
||||||
|
num = W_CheckNumForName(finalname);
|
||||||
|
|
||||||
if (num == LUMPERROR)
|
if (num == LUMPERROR)
|
||||||
return W_CachePatchNum(W_GetNumForName("MISSING"), tag);
|
return W_CachePatchNum(W_GetNumForName("MISSING"), tag);
|
||||||
|
|||||||
+3
-1
@@ -114,6 +114,8 @@ typedef struct wadfile_s
|
|||||||
UINT32 filesize; // for network
|
UINT32 filesize; // for network
|
||||||
UINT8 md5sum[16];
|
UINT8 md5sum[16];
|
||||||
boolean important;
|
boolean important;
|
||||||
|
boolean majormod;
|
||||||
|
boolean localfile; // only for skins
|
||||||
} wadfile_t;
|
} wadfile_t;
|
||||||
|
|
||||||
#define WADFILENUM(lumpnum) (UINT16)((lumpnum)>>16) // wad flumpnum>>16) // wad file number in upper word
|
#define WADFILENUM(lumpnum) (UINT16)((lumpnum)>>16) // wad flumpnum>>16) // wad file number in upper word
|
||||||
@@ -132,7 +134,7 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors);
|
|||||||
//
|
//
|
||||||
// if local is true, it wouldn't check if file adds complex things, therefore
|
// if local is true, it wouldn't check if file adds complex things, therefore
|
||||||
// allowing to still join server without the "you have wrong addons loaded" error
|
// allowing to still join server without the "you have wrong addons loaded" error
|
||||||
UINT16 W_InitFile(const char *filename, boolean local);
|
UINT16 W_InitFile(const char *filename, const char *lumpname, UINT16 *wadnump, boolean local);
|
||||||
#ifdef DELFILE
|
#ifdef DELFILE
|
||||||
void W_UnloadWadFile(UINT16 num);
|
void W_UnloadWadFile(UINT16 num);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
+140
-10
@@ -116,6 +116,19 @@ static INT32 intertic;
|
|||||||
static INT32 endtic = -1;
|
static INT32 endtic = -1;
|
||||||
static INT32 sorttic = -1;
|
static INT32 sorttic = -1;
|
||||||
|
|
||||||
|
patch_t *animVoteFramesPatches = NULL;
|
||||||
|
// VEXTRN - Vote (V) Extra (EXT) Race (R) Normal (N - Normal sized patch)
|
||||||
|
// VEXTBN - Vote (V) Extra (EXT) Battle (B) Normal (N - Normal sized patch)
|
||||||
|
// VEXTBW - Vote (V) Extra (EXT) Battle (B) Normal (W - Wide patch used in software)
|
||||||
|
// VEXTRW - Vote (V) Extra (EXT) Race (R) Normal (W - Wide patch used in software)
|
||||||
|
char animPrefix[] = "INTSC";
|
||||||
|
char animWidePrefix[] = "INTSW";
|
||||||
|
char *luaVoteScreen = NULL;
|
||||||
|
|
||||||
|
INT32 currentAnimFrame = 0;
|
||||||
|
static INT32 foundAnimVoteFrames = 0;
|
||||||
|
static INT32 foundAnimVoteWideFrames = 0;
|
||||||
|
|
||||||
intertype_t intertype = int_none;
|
intertype_t intertype = int_none;
|
||||||
|
|
||||||
|
|
||||||
@@ -159,6 +172,7 @@ typedef struct
|
|||||||
static y_votelvlinfo levelinfo[5];
|
static y_votelvlinfo levelinfo[5];
|
||||||
static y_voteclient voteclient;
|
static y_voteclient voteclient;
|
||||||
static INT32 votetic;
|
static INT32 votetic;
|
||||||
|
static INT32 lastvotetic;
|
||||||
static INT32 voteendtic = -1;
|
static INT32 voteendtic = -1;
|
||||||
static patch_t *cursor = NULL;
|
static patch_t *cursor = NULL;
|
||||||
static patch_t *cursor1 = NULL;
|
static patch_t *cursor1 = NULL;
|
||||||
@@ -325,6 +339,54 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Y_AnimatedVoteScreenCheck
|
||||||
|
//
|
||||||
|
// Check if the lumps exist (checking for VEXTR(N|W)xx for race and VEXTRB(N|W)xx for battle)
|
||||||
|
void Y_AnimatedVoteScreenCheck(void)
|
||||||
|
{
|
||||||
|
char tmpPrefix[] = "INTS";
|
||||||
|
boolean stopSearching = false;
|
||||||
|
|
||||||
|
if (luaVoteScreen)
|
||||||
|
{
|
||||||
|
strncpy(tmpPrefix, luaVoteScreen, 4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(G_BattleGametype()) {
|
||||||
|
strcpy(tmpPrefix, "BTLS");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
strncpy(animPrefix, tmpPrefix, 4);
|
||||||
|
animPrefix[4] = 'C';
|
||||||
|
strncpy(animWidePrefix, tmpPrefix, 4);
|
||||||
|
animWidePrefix[4] = 'W';
|
||||||
|
|
||||||
|
foundAnimVoteFrames = 0;
|
||||||
|
foundAnimVoteWideFrames = 0;
|
||||||
|
currentAnimFrame = 0;
|
||||||
|
|
||||||
|
INT32 i = 1;
|
||||||
|
while(!stopSearching){
|
||||||
|
boolean normalLumpExists = W_LumpExists(va("%sC%d", tmpPrefix, i));
|
||||||
|
boolean wideLumpExists = W_LumpExists(va("%sW%d", tmpPrefix, i));
|
||||||
|
|
||||||
|
if(normalLumpExists || wideLumpExists){
|
||||||
|
if(normalLumpExists){
|
||||||
|
foundAnimVoteFrames++;
|
||||||
|
}
|
||||||
|
if(wideLumpExists){
|
||||||
|
foundAnimVoteWideFrames++;
|
||||||
|
}
|
||||||
|
} else { // If we don't find at least frame 1 (e.g VEXTRN1), let's just stop looking
|
||||||
|
stopSearching = true;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y_IntermissionDrawer
|
// Y_IntermissionDrawer
|
||||||
//
|
//
|
||||||
@@ -482,7 +544,15 @@ void Y_IntermissionDrawer(void)
|
|||||||
if (data.match.color[i])
|
if (data.match.color[i])
|
||||||
{
|
{
|
||||||
UINT8 *colormap = R_GetTranslationColormap(*data.match.character[i], *data.match.color[i], GTC_CACHE);
|
UINT8 *colormap = R_GetTranslationColormap(*data.match.character[i], *data.match.color[i], GTC_CACHE);
|
||||||
V_DrawMappedPatch(x+16, y-4, 0, facerankprefix[*data.match.character[i]], colormap);
|
// i fucking hate this i fucking hate this i hate this so much
|
||||||
|
if (!players[data.match.num[i]].skinlocal) {
|
||||||
|
if (!players[data.match.num[i]].localskin)
|
||||||
|
V_DrawMappedPatch(x+16, y-4, 0, facerankprefix[*data.match.character[i]], colormap);
|
||||||
|
else
|
||||||
|
V_DrawMappedPatch(x+16, y-4, 0, facerankprefix[players[data.match.num[i]].localskin - 1], colormap);
|
||||||
|
} else {
|
||||||
|
V_DrawMappedPatch(x+16, y-4, 0, localfacerankprefix[players[data.match.num[i]].localskin - 1], colormap);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.match.num[i] == whiteplayer)
|
if (data.match.num[i] == whiteplayer)
|
||||||
@@ -978,6 +1048,42 @@ static void Y_UnloadData(void)
|
|||||||
|
|
||||||
// SRB2Kart: Voting!
|
// SRB2Kart: Voting!
|
||||||
|
|
||||||
|
// Y_DrawAnimatedVoteScreenPatch
|
||||||
|
//
|
||||||
|
// Draw animated patch based on frame counter on vote screen
|
||||||
|
//
|
||||||
|
void Y_DrawAnimatedVoteScreenPatch(boolean widePatch){
|
||||||
|
char tempAnimPrefix[7];
|
||||||
|
(widePatch) ? strcpy(tempAnimPrefix, animWidePrefix) : strcpy(tempAnimPrefix, animPrefix);
|
||||||
|
INT32 tempFoundAnimVoteFrames = (widePatch) ? foundAnimVoteWideFrames : foundAnimVoteFrames;
|
||||||
|
INT32 flags = V_SNAPTOBOTTOM | V_SNAPTOTOP;
|
||||||
|
|
||||||
|
// Just in case someone provides LESS widescreen frames than normal frames or vice versa, reset the frame counter to 0
|
||||||
|
if(widePatch) {
|
||||||
|
if(currentAnimFrame > foundAnimVoteWideFrames-1){
|
||||||
|
currentAnimFrame = 0;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(currentAnimFrame > foundAnimVoteFrames-1){
|
||||||
|
currentAnimFrame = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*patch_t *currPatch = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame+1), PU_CACHE);
|
||||||
|
V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(currPatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?)
|
||||||
|
(vid.height / vid.dupy) - SHORT(currPatch->height),
|
||||||
|
V_SNAPTOTOP|V_SNAPTOLEFT, currPatch);
|
||||||
|
if(votetic % 3 == 0 && !paused){*/
|
||||||
|
|
||||||
|
{
|
||||||
|
patch_t *background = W_CachePatchName(va("%s%d", tempAnimPrefix, currentAnimFrame + 1), PU_CACHE);
|
||||||
|
V_DrawScaledPatch(160 - (background->width / 2), (200 - (background->height)), flags, background);
|
||||||
|
}
|
||||||
|
if (lastvotetic != votetic && lastvotetic % 2 == 0) {
|
||||||
|
currentAnimFrame = (currentAnimFrame+1 > tempFoundAnimVoteFrames-1) ? 0 : currentAnimFrame + 1; // jeez no fucking idea how to make this shit not go nuts with interpolation
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Y_VoteDrawer
|
// Y_VoteDrawer
|
||||||
//
|
//
|
||||||
@@ -1006,14 +1112,34 @@ void Y_VoteDrawer(void)
|
|||||||
|
|
||||||
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
|
||||||
|
|
||||||
if (widebgpatch && rendermode == render_soft && vid.width / vid.dupx > 320)
|
if (widebgpatch && vid.width / vid.dupx > 320) {
|
||||||
V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(widebgpatch->width)/2),
|
|
||||||
(vid.height / vid.dupy) - SHORT(widebgpatch->height),
|
if(foundAnimVoteWideFrames == 0){
|
||||||
V_SNAPTOTOP|V_SNAPTOLEFT, widebgpatch);
|
V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(widebgpatch->width)/2),
|
||||||
else
|
(vid.height / vid.dupy) - SHORT(widebgpatch->height),
|
||||||
V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(bgpatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?)
|
V_SNAPTOTOP|V_SNAPTOLEFT, widebgpatch);
|
||||||
(vid.height / vid.dupy) - SHORT(bgpatch->height),
|
} else {
|
||||||
V_SNAPTOTOP|V_SNAPTOLEFT, bgpatch);
|
// patch_t *currPatch = W_CachePatchName(va("%s%d", animPrefix, currentAnimFrame+1), PU_CACHE);
|
||||||
|
// V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(currPatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?)
|
||||||
|
// (vid.height / vid.dupy) - SHORT(currPatch->height),
|
||||||
|
// V_SNAPTOTOP|V_SNAPTOLEFT, currPatch);
|
||||||
|
// if(votetic % 4 == 0 && !paused){
|
||||||
|
// currentAnimFrame = (currentAnimFrame+1 > foundAnimVoteFrames-1) ? 0 : currentAnimFrame + 1;
|
||||||
|
// }
|
||||||
|
Y_DrawAnimatedVoteScreenPatch(true);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if(foundAnimVoteFrames == 0) {
|
||||||
|
V_DrawScaledPatch(((vid.width/2) / vid.dupx) - (SHORT(bgpatch->width)/2), // Keep the width/height adjustments, for screens that are less wide than 320(?)
|
||||||
|
(vid.height / vid.dupy) - SHORT(bgpatch->height),
|
||||||
|
V_SNAPTOTOP|V_SNAPTOLEFT, bgpatch);
|
||||||
|
} else {
|
||||||
|
Y_DrawAnimatedVoteScreenPatch(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < 4; i++) // First, we need to figure out the height of this thing...
|
for (i = 0; i < 4; i++) // First, we need to figure out the height of this thing...
|
||||||
{
|
{
|
||||||
@@ -1200,7 +1326,7 @@ void Y_VoteDrawer(void)
|
|||||||
if (players[i].skincolor)
|
if (players[i].skincolor)
|
||||||
{
|
{
|
||||||
UINT8 *colormap = R_GetTranslationColormap(players[i].skin, players[i].skincolor, GTC_CACHE);
|
UINT8 *colormap = R_GetTranslationColormap(players[i].skin, players[i].skincolor, GTC_CACHE);
|
||||||
V_DrawMappedPatch(x+24, y+9, V_SNAPTOLEFT, facerankprefix[players[i].skin], colormap);
|
V_DrawMappedPatch(x+24, y+9, V_SNAPTOLEFT, (players[i].skinlocal ? localfacerankprefix : facerankprefix)[((players[i].localskin) ? players[i].localskin-1 : players[i].skin)], colormap);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!splitscreen && i == consoleplayer)
|
if (!splitscreen && i == consoleplayer)
|
||||||
@@ -1232,6 +1358,8 @@ void Y_VoteDrawer(void)
|
|||||||
va("Vote ends in %d", tickdown));
|
va("Vote ends in %d", tickdown));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastvotetic = votetic;
|
||||||
|
|
||||||
#ifdef HAVE_BLUA
|
#ifdef HAVE_BLUA
|
||||||
if (renderisnewtic)
|
if (renderisnewtic)
|
||||||
{
|
{
|
||||||
@@ -1487,6 +1615,8 @@ void Y_StartVote(void)
|
|||||||
I_Error("voteendtic is dirty");
|
I_Error("voteendtic is dirty");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Y_AnimatedVoteScreenCheck();
|
||||||
|
|
||||||
widebgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCW" : "INTERSCW"), PU_STATIC);
|
widebgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCW" : "INTERSCW"), PU_STATIC);
|
||||||
bgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCR" : "INTERSCR"), PU_STATIC);
|
bgpatch = W_CachePatchName(((prefgametype == GT_MATCH) ? "BATTLSCR" : "INTERSCR"), PU_STATIC);
|
||||||
cursor = W_CachePatchName("M_CURSOR", PU_STATIC);
|
cursor = W_CachePatchName("M_CURSOR", PU_STATIC);
|
||||||
|
|||||||
@@ -10,6 +10,7 @@
|
|||||||
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
/// \brief Tally screens, or "Intermissions" as they were formally called in Doom
|
||||||
|
|
||||||
extern boolean usebuffer;
|
extern boolean usebuffer;
|
||||||
|
extern char *luaVoteScreen;
|
||||||
|
|
||||||
void Y_IntermissionDrawer(void);
|
void Y_IntermissionDrawer(void);
|
||||||
void Y_Ticker(void);
|
void Y_Ticker(void);
|
||||||
|
|||||||
+6
-5
@@ -140,14 +140,14 @@ static void Command_Memdump_f(void);
|
|||||||
|
|
||||||
void Z_Init(void)
|
void Z_Init(void)
|
||||||
{
|
{
|
||||||
UINT32 total, memfree;
|
size_t total, memfree;
|
||||||
|
|
||||||
memset(&head, 0x00, sizeof(head));
|
memset(&head, 0x00, sizeof(head));
|
||||||
|
|
||||||
head.next = head.prev = &head;
|
head.next = head.prev = &head;
|
||||||
|
|
||||||
memfree = I_GetFreeMem(&total)>>20;
|
memfree = I_GetFreeMem(&total)>>20;
|
||||||
CONS_Printf("System memory: %uMB - Free: %uMB\n", total>>20, memfree);
|
CONS_Printf("System memory: %sMB - Free: %sMB\n", sizeu1(total>>20), sizeu2(memfree));
|
||||||
|
|
||||||
// Note: This allocates memory. Watch out.
|
// Note: This allocates memory. Watch out.
|
||||||
COM_AddCommand("memfree", Command_Memfree_f);
|
COM_AddCommand("memfree", Command_Memfree_f);
|
||||||
@@ -616,12 +616,13 @@ size_t Z_TagUsage(INT32 tagnum)
|
|||||||
|
|
||||||
void Command_Memfree_f(void)
|
void Command_Memfree_f(void)
|
||||||
{
|
{
|
||||||
UINT32 freebytes, totalbytes;
|
size_t freebytes, totalbytes;
|
||||||
|
|
||||||
Z_CheckHeap(-1);
|
Z_CheckHeap(-1);
|
||||||
CONS_Printf("\x82%s", M_GetText("Memory Info\n"));
|
CONS_Printf("\x82%s", M_GetText("Memory Info\n"));
|
||||||
CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1(Z_TagsUsage(0, INT32_MAX)>>10));
|
CONS_Printf(M_GetText("Total heap used : %7s KB\n"), sizeu1(Z_TagsUsage(0, INT32_MAX)>>10));
|
||||||
CONS_Printf(M_GetText("Static : %7s KB\n"), sizeu1(Z_TagUsage(PU_STATIC)>>10));
|
CONS_Printf(M_GetText("Static : %7s KB\n"), sizeu1(Z_TagUsage(PU_STATIC)>>10));
|
||||||
|
CONS_Printf(M_GetText("Lua : %7s KB\n"), sizeu1(Z_TagUsage(PU_LUA)>>10));
|
||||||
CONS_Printf(M_GetText("Static (sound) : %7s KB\n"), sizeu1(Z_TagUsage(PU_SOUND)>>10));
|
CONS_Printf(M_GetText("Static (sound) : %7s KB\n"), sizeu1(Z_TagUsage(PU_SOUND)>>10));
|
||||||
CONS_Printf(M_GetText("Static (music) : %7s KB\n"), sizeu1(Z_TagUsage(PU_MUSIC)>>10));
|
CONS_Printf(M_GetText("Static (music) : %7s KB\n"), sizeu1(Z_TagUsage(PU_MUSIC)>>10));
|
||||||
CONS_Printf(M_GetText("Locked cache : %7s KB\n"), sizeu1(Z_TagUsage(PU_CACHE)>>10));
|
CONS_Printf(M_GetText("Locked cache : %7s KB\n"), sizeu1(Z_TagUsage(PU_CACHE)>>10));
|
||||||
@@ -643,8 +644,8 @@ void Command_Memfree_f(void)
|
|||||||
|
|
||||||
CONS_Printf("\x82%s", M_GetText("System Memory Info\n"));
|
CONS_Printf("\x82%s", M_GetText("System Memory Info\n"));
|
||||||
freebytes = I_GetFreeMem(&totalbytes);
|
freebytes = I_GetFreeMem(&totalbytes);
|
||||||
CONS_Printf(M_GetText(" Total physical memory: %7u KB\n"), totalbytes>>10);
|
CONS_Printf(M_GetText(" Total physical memory: %s KB\n"), sizeu1(totalbytes>>10));
|
||||||
CONS_Printf(M_GetText("Available physical memory: %7u KB\n"), freebytes>>10);
|
CONS_Printf(M_GetText("Available physical memory: %s KB\n"), sizeu1(freebytes>>10));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ZDEBUG
|
#ifdef ZDEBUG
|
||||||
|
|||||||
Reference in new issue
Block a user