mirror of
				https://github.com/KartKrewDev/RingRacers.git
				synced 2025-10-30 08:01:28 +00:00 
			
		
		
		
	Merge remote-tracking branch 'srb2/master' into the-scary-22-merge
This commit is contained in:
		
						commit
						9b6aa946ea
					
				
					 70 changed files with 3527 additions and 2667 deletions
				
			
		|  | @ -43,12 +43,7 @@ jobs: | |||
|             - v1-SRB2-APT | ||||
|       - run: | ||||
|           name: Install SDK | ||||
| <<<<<<< HEAD | ||||
|           command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 gettext ccache wget gcc-multilib upx openssh-client | ||||
| ======= | ||||
|           command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client | ||||
| 
 | ||||
| >>>>>>> srb2/next | ||||
|           command: apt-get -qq -y --no-install-recommends install git build-essential nasm libpng-dev:i386 libsdl2-mixer-dev:i386 libgme-dev:i386 libcurl4-openssl-dev:i386 libopenmpt-dev:i386 gettext ccache wget gcc-multilib upx openssh-client | ||||
|       - save_cache: | ||||
|           key: v1-SRB2-APT | ||||
|           paths: | ||||
|  | @ -75,4 +70,4 @@ jobs: | |||
|       - save_cache: | ||||
|           key: v1-SRB2-{{ .Branch }}-{{ checksum "objs/Linux/SDL/Release/depend.dep" }} | ||||
|           paths: | ||||
|             - /root/.ccache | ||||
|             - /root/.ccache | ||||
|  |  | |||
|  | @ -128,7 +128,8 @@ set(SRB2_CORE_RENDER_SOURCES | |||
| 	r_sky.c | ||||
| 	r_splats.c | ||||
| 	r_things.c | ||||
| 	r_patch.c | ||||
| 	r_textures.c | ||||
| 	r_picformats.c | ||||
| 	r_portal.c | ||||
| 
 | ||||
| 	r_bsp.h | ||||
|  | @ -144,7 +145,8 @@ set(SRB2_CORE_RENDER_SOURCES | |||
| 	r_splats.h | ||||
| 	r_state.h | ||||
| 	r_things.h | ||||
| 	r_patch.h | ||||
| 	r_textures.h | ||||
| 	r_picformats.h | ||||
| 	r_portal.h | ||||
| ) | ||||
| 
 | ||||
|  | @ -260,6 +262,8 @@ set(SRB2_CONFIG_HAVE_OPENMPT ON CACHE BOOL | |||
| 	"Enable OpenMPT support.") | ||||
| set(SRB2_CONFIG_HAVE_CURL ON CACHE BOOL | ||||
| 	"Enable curl support, used for downloading files via HTTP.") | ||||
| set(SRB2_CONFIG_HAVE_THREADS ON CACHE BOOL | ||||
| 	"Enable multithreading support.") | ||||
| if(${CMAKE_SYSTEM} MATCHES Windows) | ||||
| 	set(SRB2_CONFIG_HAVE_MIXERX ON CACHE BOOL | ||||
| 		"Enable SDL Mixer X support.") | ||||
|  | @ -525,6 +529,12 @@ if(${SRB2_CONFIG_HAVE_CURL}) | |||
| 	endif() | ||||
| endif() | ||||
| 
 | ||||
| if(${SRB2_CONFIG_HAVE_THREADS}) | ||||
| 	set(SRB2_HAVE_THREADS ON) | ||||
| 	set(SRB2_CORE_HEADERS ${SRB2_CORE_HEADERS} ${CMAKE_CURRENT_SOURCE_DIR}/i_threads.h) | ||||
| 	add_definitions(-DHAVE_THREADS) | ||||
| endif() | ||||
| 
 | ||||
| if(${SRB2_CONFIG_HWRENDER}) | ||||
| 	add_definitions(-DHWRENDER) | ||||
| 	set(SRB2_HWRENDER_SOURCES | ||||
|  |  | |||
|  | @ -539,7 +539,8 @@ OBJS:=$(i_main_o) \ | |||
| 		$(OBJDIR)/r_sky.o    \
 | ||||
| 		$(OBJDIR)/r_splats.o \
 | ||||
| 		$(OBJDIR)/r_things.o \
 | ||||
| 		$(OBJDIR)/r_patch.o \
 | ||||
| 		$(OBJDIR)/r_textures.o \
 | ||||
| 		$(OBJDIR)/r_picformats.o \
 | ||||
| 		$(OBJDIR)/r_portal.o \
 | ||||
| 		$(OBJDIR)/screen.o   \
 | ||||
| 		$(OBJDIR)/v_video.o  \
 | ||||
|  | @ -641,8 +642,9 @@ ifndef VALGRIND | |||
| ifndef NOOBJDUMP | ||||
| 	@echo Dumping debugging info | ||||
| 	$(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(EXENAME) > $(BIN)/$(DBGNAME).txt | ||||
| ifdef WINDOWSHELL | ||||
| 	-$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt | ||||
| ifndef WINDOWSHELL | ||||
| else | ||||
| 	-$(GZIP) $(GZIP_OPT2) $(BIN)/$(DBGNAME).txt | ||||
| endif | ||||
| endif | ||||
|  | @ -662,8 +664,9 @@ endif | |||
| reobjdump: | ||||
| 	@echo Redumping debugging info | ||||
| 	$(OBJDUMP) $(OBJDUMP_OPTS) $(BIN)/$(DBGNAME) > $(BIN)/$(DBGNAME).txt | ||||
| ifdef WINDOWSHELL | ||||
| 	-$(GZIP) $(GZIP_OPTS) $(BIN)/$(DBGNAME).txt | ||||
| ifndef WINDOWSHELL | ||||
| else | ||||
| 	-$(GZIP) $(GZIP_OPT2) $(BIN)/$(DBGNAME).txt | ||||
| endif | ||||
| 
 | ||||
|  |  | |||
|  | @ -19,6 +19,7 @@ | |||
| #include "lauxlib.h" | ||||
| #include "lualib.h" | ||||
| 
 | ||||
| #include "../m_fixed.h" | ||||
| 
 | ||||
| /* macro to `unsign' a character */ | ||||
| #define uchar(c)        ((unsigned char)(c)) | ||||
|  | @ -790,7 +791,7 @@ static int str_format (lua_State *L) { | |||
|         case 'e':  case 'E': case 'f': | ||||
|         case 'g': case 'G': { | ||||
| 					lua_Number n = luaL_checknumber(L, arg); | ||||
|           sprintf(buff, form, (double)n); | ||||
|           sprintf(buff, form, (double)n / FRACUNIT); | ||||
|           break; | ||||
|         } | ||||
|         case 'q': { | ||||
|  |  | |||
|  | @ -1174,7 +1174,7 @@ static consvar_t *CV_FindNetVar(UINT16 netid) | |||
| { | ||||
| 	consvar_t *cvar; | ||||
| 
 | ||||
| 	if (netid >= consvar_number_of_netids) | ||||
| 	if (netid > consvar_number_of_netids) | ||||
| 		return NULL; | ||||
| 
 | ||||
| 	for (cvar = consvar_vars; cvar; cvar = cvar->next) | ||||
|  | @ -1212,11 +1212,11 @@ void CV_RegisterVar(consvar_t *variable) | |||
| 	// check net variables
 | ||||
| 	if (variable->flags & CV_NETVAR) | ||||
| 	{ | ||||
| 		variable->netid = consvar_number_of_netids++; | ||||
| 
 | ||||
| 		/* in case of overflow... */ | ||||
| 		if (variable->netid > consvar_number_of_netids) | ||||
| 		if (consvar_number_of_netids == UINT16_MAX) | ||||
| 			I_Error("Way too many netvars"); | ||||
| 
 | ||||
| 		variable->netid = ++consvar_number_of_netids; | ||||
| 	} | ||||
| 
 | ||||
| 	// link the variable in
 | ||||
|  | @ -2262,15 +2262,6 @@ skipwhite: | |||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// parse single characters
 | ||||
| 	if (c == '{' || c == '}' || c == ')' || c == '(' || c == '\'') | ||||
| 	{ | ||||
| 		com_token[len] = c; | ||||
| 		len++; | ||||
| 		com_token[len] = 0; | ||||
| 		return data + 1; | ||||
| 	} | ||||
| 
 | ||||
| 	// parse a regular word
 | ||||
| 	do | ||||
| 	{ | ||||
|  | @ -2290,8 +2281,6 @@ skipwhite: | |||
| 			len++; | ||||
| 			c = *data; | ||||
| 		} | ||||
| 		if (c == '{' || c == '}' || c == ')'|| c == '(' || c == '\'') | ||||
| 			break; | ||||
| 	} while (c > 32); | ||||
| 
 | ||||
| 	com_token[len] = 0; | ||||
|  |  | |||
|  | @ -1727,8 +1727,12 @@ static void CON_DrawBackpic(void) | |||
| 	int x, w, h; | ||||
| 	int scale; | ||||
| 
 | ||||
| 	// Get the lumpnum for CONSBACK, or fallback into MISSING.
 | ||||
| 	piclump = W_CheckNumForName("KARTKREW"); | ||||
| 	// Get the lumpnum for CONSBACK, STARTUP (Only during game startup) or fallback into MISSING.
 | ||||
| 	if (con_startup) | ||||
| 		piclump = W_CheckNumForName("STARTUP"); | ||||
| 	else | ||||
| 		piclump = W_CheckNumForName("KARTKREW"); | ||||
| 
 | ||||
| 	if (piclump == LUMPERROR) | ||||
| 		piclump = W_GetNumForName("MISSING"); | ||||
| 
 | ||||
|  |  | |||
|  | @ -184,7 +184,7 @@ ticcmd_t netcmds[TICQUEUE][MAXPLAYERS]; | |||
| static textcmdtic_t *textcmds[TEXTCMD_HASH_SIZE] = {NULL}; | ||||
| 
 | ||||
| 
 | ||||
| consvar_t cv_showjoinaddress = {"showjoinaddress", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; | ||||
| consvar_t cv_showjoinaddress = {"showjoinaddress", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; | ||||
| 
 | ||||
| static CV_PossibleValue_t playbackspeed_cons_t[] = {{1, "MIN"}, {10, "MAX"}, {0, NULL}}; | ||||
| consvar_t cv_playbackspeed = {"playbackspeed", "1", 0, playbackspeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; | ||||
|  | @ -2054,23 +2054,51 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node) | |||
| 	M_SortServerList(); | ||||
| } | ||||
| 
 | ||||
| void CL_UpdateServerList (void) | ||||
| #if defined (MASTERSERVER) && defined (HAVE_THREADS) | ||||
| struct Fetch_servers_ctx | ||||
| { | ||||
| 	SL_ClearServerList(0); | ||||
| 	int id; | ||||
| }; | ||||
| 
 | ||||
| 	if (!netgame && I_NetOpenSocket) | ||||
| static void | ||||
| Fetch_servers_thread (struct Fetch_servers_ctx *ctx) | ||||
| { | ||||
| 	msg_server_t *server_list; | ||||
| 
 | ||||
| 	server_list = GetShortServersList(ctx->id); | ||||
| 
 | ||||
| 	if (server_list) | ||||
| 	{ | ||||
| 		if (I_NetOpenSocket()) | ||||
| 		I_lock_mutex(&ms_QueryId_mutex); | ||||
| 		{ | ||||
| 			netgame = true; | ||||
| 			multiplayer = true; | ||||
| 			if (ctx->id != ms_QueryId) | ||||
| 			{ | ||||
| 				free(server_list); | ||||
| 				server_list = NULL; | ||||
| 			} | ||||
| 		} | ||||
| 		I_unlock_mutex(ms_QueryId_mutex); | ||||
| 
 | ||||
| 		if (server_list) | ||||
| 		{ | ||||
| 			I_lock_mutex(&m_menu_mutex); | ||||
| 			{ | ||||
| 				if (m_waiting_mode == M_WAITING_SERVERS) | ||||
| 					m_waiting_mode = M_NOT_WAITING; | ||||
| 			} | ||||
| 			I_unlock_mutex(m_menu_mutex); | ||||
| 
 | ||||
| 			I_lock_mutex(&ms_ServerList_mutex); | ||||
| 			{ | ||||
| 				ms_ServerList = server_list; | ||||
| 			} | ||||
| 			I_unlock_mutex(ms_ServerList_mutex); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// search for local servers
 | ||||
| 	if (netgame) | ||||
| 		SendAskInfo(BROADCASTADDR); | ||||
| 	free(ctx); | ||||
| } | ||||
| #endif/*defined (MASTERSERVER) && defined (HAVE_THREADS)*/ | ||||
| 
 | ||||
| void CL_QueryServerList (msg_server_t *server_list) | ||||
| { | ||||
|  | @ -2106,6 +2134,25 @@ void CL_QueryServerList (msg_server_t *server_list) | |||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| void CL_UpdateServerList (void) | ||||
| { | ||||
| 	SL_ClearServerList(0); | ||||
| 
 | ||||
| 	if (!netgame && I_NetOpenSocket) | ||||
| 	{ | ||||
| 		if (I_NetOpenSocket()) | ||||
| 		{ | ||||
| 			netgame = true; | ||||
| 			multiplayer = true; | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// search for local servers
 | ||||
| 	if (netgame) | ||||
| 		SendAskInfo(BROADCASTADDR); | ||||
| } | ||||
| 
 | ||||
| #endif // ifndef NONET
 | ||||
| 
 | ||||
| static void M_ConfirmConnect(event_t *ev) | ||||
|  | @ -5834,11 +5881,15 @@ void TryRunTics(tic_t realtics) | |||
| 			{ | ||||
| 				DEBFILE(va("============ Running tic %d (local %d)\n", gametic, localgametic)); | ||||
| 
 | ||||
| 				rs_tictime = I_GetTimeMicros(); | ||||
| 
 | ||||
| 				G_Ticker((gametic % NEWTICRATERATIO) == 0); | ||||
| 				ExtraDataTicker(); | ||||
| 				gametic++; | ||||
| 				consistancy[gametic%TICQUEUE] = Consistancy(); | ||||
| 
 | ||||
| 				rs_tictime = I_GetTimeMicros() - rs_tictime; | ||||
| 
 | ||||
| 				// Leave a certain amount of tics present in the net buffer as long as we've ran at least one tic this frame.
 | ||||
| 				if (client && gamestate == GS_LEVEL && leveltime > 3 && neededtic <= gametic + cv_netticbuffer.value) | ||||
| 					break; | ||||
|  |  | |||
							
								
								
									
										85
									
								
								src/d_main.c
									
										
									
									
									
								
							
							
						
						
									
										85
									
								
								src/d_main.c
									
										
									
									
									
								
							|  | @ -557,6 +557,8 @@ static void D_Display(void) | |||
| 				lastdraw = false; | ||||
| 			} | ||||
| 
 | ||||
| 			rs_uitime = I_GetTimeMicros(); | ||||
| 
 | ||||
| 			if (gamestate == GS_LEVEL) | ||||
| 			{ | ||||
| 				ST_Drawer(); | ||||
|  | @ -566,6 +568,10 @@ static void D_Display(void) | |||
| 			else | ||||
| 				F_TitleScreenDrawer(); | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			rs_uitime = I_GetTimeMicros(); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	// change gamma if needed
 | ||||
|  | @ -609,6 +615,8 @@ static void D_Display(void) | |||
| 
 | ||||
| 	CON_Drawer(); | ||||
| 
 | ||||
| 	rs_uitime = I_GetTimeMicros() - rs_uitime; | ||||
| 
 | ||||
| 	//
 | ||||
| 	// wipe update
 | ||||
| 	//
 | ||||
|  | @ -709,6 +717,7 @@ static void D_Display(void) | |||
| 			V_DrawThinString(80, 40, V_MONOSPACE | V_BLUEMAP, s); | ||||
| 			if (rendermode == render_opengl) // OpenGL specific stats
 | ||||
| 			{ | ||||
| #ifdef HWRENDER | ||||
| 				snprintf(s, sizeof s - 1, "nsrt %d", rs_hw_nodesorttime / divisor); | ||||
| 				V_DrawThinString(30, 40, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "ndrw %d", rs_hw_nodedrawtime / divisor); | ||||
|  | @ -717,8 +726,12 @@ static void D_Display(void) | |||
| 				V_DrawThinString(30, 60, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "sdrw %d", rs_hw_spritedrawtime / divisor); | ||||
| 				V_DrawThinString(30, 70, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "fin  %d", rs_swaptime / divisor); | ||||
| 				snprintf(s, sizeof s - 1, "ui   %d", rs_uitime / divisor); | ||||
| 				V_DrawThinString(30, 80, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "fin  %d", rs_swaptime / divisor); | ||||
| 				V_DrawThinString(30, 90, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "tic  %d", rs_tictime / divisor); | ||||
| 				V_DrawThinString(30, 105, V_MONOSPACE | V_GRAYMAP, s); | ||||
| 				if (cv_glbatching.value) | ||||
| 				{ | ||||
| 					snprintf(s, sizeof s - 1, "bsrt %d", rs_hw_batchsorttime / divisor); | ||||
|  | @ -741,6 +754,7 @@ static void D_Display(void) | |||
| 					snprintf(s, sizeof s - 1, "ncol %d", rs_hw_numcolors); | ||||
| 					V_DrawThinString(185, 30, V_MONOSPACE | V_PURPLEMAP, s); | ||||
| 				} | ||||
| #endif | ||||
| 			} | ||||
| 			else // software specific stats
 | ||||
| 			{ | ||||
|  | @ -750,8 +764,12 @@ static void D_Display(void) | |||
| 				V_DrawThinString(30, 50, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "mskd %d", rs_sw_maskedtime / divisor); | ||||
| 				V_DrawThinString(30, 60, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "fin  %d", rs_swaptime / divisor); | ||||
| 				snprintf(s, sizeof s - 1, "ui   %d", rs_uitime / divisor); | ||||
| 				V_DrawThinString(30, 70, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "fin  %d", rs_swaptime / divisor); | ||||
| 				V_DrawThinString(30, 80, V_MONOSPACE | V_YELLOWMAP, s); | ||||
| 				snprintf(s, sizeof s - 1, "tic  %d", rs_tictime / divisor); | ||||
| 				V_DrawThinString(30, 95, V_MONOSPACE | V_GRAYMAP, s); | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
|  | @ -790,6 +808,7 @@ tic_t rendergametic; | |||
| void D_SRB2Loop(void) | ||||
| { | ||||
| 	tic_t oldentertics = 0, entertic = 0, realtics = 0, rendertimeout = INFTICS; | ||||
| 	static lumpnum_t gstartuplumpnum; | ||||
| 
 | ||||
| 	if (dedicated) | ||||
| 		server = true; | ||||
|  | @ -828,7 +847,12 @@ void D_SRB2Loop(void) | |||
| 	*/ | ||||
| 	/* Smells like a hack... Don't fade Sonic's ass into the title screen. */ | ||||
| 	if (gamestate != GS_TITLESCREEN) | ||||
| 		V_DrawFixedPatch(0, 0, FRACUNIT/2, 0, W_CachePatchNum(W_GetNumForName("KARTKREW"), PU_PATCH), NULL); | ||||
| 	{ | ||||
| 		gstartuplumpnum = W_CheckNumForName("STARTUP"); | ||||
| 		if (gstartuplumpnum == LUMPERROR) | ||||
| 			gstartuplumpnum = W_GetNumForName("MISSING"); | ||||
| 		V_DrawScaledPatch(0, 0, 0, W_CachePatchNum(gstartuplumpnum, PU_PATCH)); | ||||
| 	} | ||||
| 
 | ||||
| 	for (;;) | ||||
| 	{ | ||||
|  | @ -1019,12 +1043,12 @@ void D_StartTitle(void) | |||
| //
 | ||||
| // D_AddFile
 | ||||
| //
 | ||||
| static void D_AddFile(const char *file, char **filearray) | ||||
| static void D_AddFile(char **list, const char *file) | ||||
| { | ||||
| 	size_t pnumwadfiles; | ||||
| 	char *newfile; | ||||
| 
 | ||||
| 	for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++) | ||||
| 	for (pnumwadfiles = 0; list[pnumwadfiles]; pnumwadfiles++) | ||||
| 		; | ||||
| 
 | ||||
| 	newfile = malloc(strlen(file) + 1); | ||||
|  | @ -1034,16 +1058,16 @@ static void D_AddFile(const char *file, char **filearray) | |||
| 	} | ||||
| 	strcpy(newfile, file); | ||||
| 
 | ||||
| 	filearray[pnumwadfiles] = newfile; | ||||
| 	list[pnumwadfiles] = newfile; | ||||
| } | ||||
| 
 | ||||
| static inline void D_CleanFile(char **filearray) | ||||
| static inline void D_CleanFile(char **list) | ||||
| { | ||||
| 	size_t pnumwadfiles; | ||||
| 	for (pnumwadfiles = 0; filearray[pnumwadfiles]; pnumwadfiles++) | ||||
| 	for (pnumwadfiles = 0; list[pnumwadfiles]; pnumwadfiles++) | ||||
| 	{ | ||||
| 		free(filearray[pnumwadfiles]); | ||||
| 		filearray[pnumwadfiles] = NULL; | ||||
| 		free(list[pnumwadfiles]); | ||||
| 		list[pnumwadfiles] = NULL; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  | @ -1091,7 +1115,7 @@ static boolean AddIWAD(void) | |||
| 
 | ||||
| 	if (FIL_ReadFileOK(path)) | ||||
| 	{ | ||||
| 		D_AddFile(path, startupiwads); | ||||
| 		D_AddFile(startupiwads, path); | ||||
| 		return true; | ||||
| 	} | ||||
| 	else | ||||
|  | @ -1135,20 +1159,20 @@ static void IdentifyVersion(void) | |||
| 	// if you change the ordering of this or add/remove a file, be sure to update the md5
 | ||||
| 	// checking in D_SRB2Main
 | ||||
| 
 | ||||
| 	D_AddFile(va(pandf,srb2waddir,"gfx.pk3"), startupiwads); | ||||
| 	D_AddFile(va(pandf,srb2waddir,"textures.pk3"), startupiwads); | ||||
| 	D_AddFile(va(pandf,srb2waddir,"chars.pk3"), startupiwads); | ||||
| 	D_AddFile(va(pandf,srb2waddir,"maps.pk3"), startupiwads); | ||||
| 	D_AddFile(startupiwads, va(pandf,srb2waddir,"gfx.pk3")); | ||||
| 	D_AddFile(startupiwads, va(pandf,srb2waddir,"textures.pk3")); | ||||
| 	D_AddFile(startupiwads, va(pandf,srb2waddir,"chars.pk3")); | ||||
| 	D_AddFile(startupiwads, va(pandf,srb2waddir,"maps.pk3")); | ||||
| #ifdef USE_PATCH_FILE | ||||
| 	D_AddFile(va(pandf,srb2waddir,"patch.pk3"), startupiwads); | ||||
| 	D_AddFile(startupiwads, va(pandf,srb2waddir,"patch.pk3")); | ||||
| #endif | ||||
| 
 | ||||
| #if 0 | ||||
| 	// TODO: pk3 doesn't support music replacement IIRC
 | ||||
| 	// music barely benefits from the compression anyway
 | ||||
| 	// would be nice for the folders, though
 | ||||
| 	D_AddFile(va(pandf,srb2waddir,"sounds.pk3"), startupiwads); | ||||
| 	D_AddFile(va(pandf,srb2waddir,"music.pk3"), startupiwads); | ||||
| 	D_AddFile(startupiwads, va(pandf,srb2waddir,"sounds.pk3")); | ||||
| 	D_AddFile(startupiwads, va(pandf,srb2waddir,"music.pk3")); | ||||
| 
 | ||||
| #else | ||||
| 
 | ||||
|  | @ -1159,7 +1183,7 @@ static void IdentifyVersion(void) | |||
| 		const char *musicpath = va(pandf,srb2waddir,str);\ | ||||
| 		int ms = W_VerifyNMUSlumps(musicpath); \ | ||||
| 		if (ms == 1) \ | ||||
| 			D_AddFile(musicpath, startupiwads); \ | ||||
| 			D_AddFile(startupiwads, musicpath); \ | ||||
| 		else if (ms == 0) \ | ||||
| 			I_Error("File "str" has been modified with non-music/sound lumps"); \ | ||||
| 	} | ||||
|  | @ -1348,7 +1372,11 @@ void D_SRB2Main(void) | |||
| 				const char *s = M_GetNextParm(); | ||||
| 
 | ||||
| 				if (s) // Check for NULL?
 | ||||
| 					D_AddFile(s, startuppwads); | ||||
| 				{ | ||||
| 					if (!W_VerifyNMUSlumps(s)) | ||||
| 						G_SetGameModified(true, true); | ||||
| 					D_AddFile(startuppwads, s); | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
|  | @ -1419,13 +1447,8 @@ void D_SRB2Main(void) | |||
| 	M_InitCharacterTables(); | ||||
| 
 | ||||
| 	// load wad, including the main wad file
 | ||||
| 	CONS_Printf("W_InitMultipleFiles(): Adding main IWAD and PWADs.\n"); | ||||
| 	if (!W_InitMultipleFiles(startupiwads, false)) | ||||
| #ifdef _DEBUG | ||||
| 		CONS_Error("A main WAD file was not found or not valid.\nCheck the log to see which ones.\n"); | ||||
| #else | ||||
| 		I_Error("A main WAD file was not found or not valid.\nCheck the log to see which ones.\n"); | ||||
| #endif | ||||
| 	CONS_Printf("W_InitMultipleFiles(): Adding IWAD and main PWADs.\n"); | ||||
| 	W_InitMultipleFiles(startupiwads, false); | ||||
| 	D_CleanFile(startupiwads); | ||||
| 
 | ||||
| 	mainwads = 0; | ||||
|  | @ -1479,8 +1502,7 @@ void D_SRB2Main(void) | |||
| 	} | ||||
| 
 | ||||
| 	CONS_Printf("W_InitMultipleFiles(): Adding external PWADs.\n"); | ||||
| 	if (!W_InitMultipleFiles(startuppwads, true)) | ||||
| 		M_StartMessage(M_GetText("A PWAD file was not found or not valid.\nCheck log.txt to see which ones.\n\nPress ESC\n"), NULL, MM_NOTHING); | ||||
| 	W_InitMultipleFiles(startuppwads, true); | ||||
| 	D_CleanFile(startuppwads); | ||||
| 
 | ||||
| 	//
 | ||||
|  | @ -1535,8 +1557,6 @@ void D_SRB2Main(void) | |||
| 	// setup loading screen
 | ||||
| 	SCR_Startup(); | ||||
| 
 | ||||
| 	// we need the font of the console
 | ||||
| 	CONS_Printf("HU_Init(): Setting up heads up display.\n"); | ||||
| 	HU_Init(); | ||||
| 
 | ||||
| 	CON_Init(); | ||||
|  | @ -1548,6 +1568,9 @@ void D_SRB2Main(void) | |||
| 
 | ||||
| 	I_RegisterSysCommands(); | ||||
| 
 | ||||
| 	CONS_Printf("HU_LoadGraphics()...\n"); | ||||
| 	HU_LoadGraphics(); | ||||
| 
 | ||||
| 	//--------------------------------------------------------- CONFIG.CFG
 | ||||
| 	M_FirstLoadConfig(); // WARNING : this do a "COM_BufExecute()"
 | ||||
| 
 | ||||
|  |  | |||
|  | @ -995,9 +995,6 @@ void D_RegisterClientCommands(void) | |||
| 	CV_RegisterVar(&cv_vhseffect); | ||||
| 	CV_RegisterVar(&cv_shittyscreen); | ||||
| 	CV_RegisterVar(&cv_renderer); | ||||
| #ifdef HWRENDER | ||||
| 	CV_RegisterVar(&cv_newrenderer); | ||||
| #endif | ||||
| 	CV_RegisterVar(&cv_scr_depth); | ||||
| 	CV_RegisterVar(&cv_scr_width); | ||||
| 	CV_RegisterVar(&cv_scr_height); | ||||
|  | @ -1541,8 +1538,11 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum) | |||
| 	followercolor = READUINT16(*cp); | ||||
| 
 | ||||
| 	// set name
 | ||||
| 	if (strcasecmp(player_names[playernum], name) != 0) | ||||
| 		SetPlayerName(playernum, name); | ||||
| 	if (player_name_changes[playernum] < MAXNAMECHANGES) | ||||
| 	{ | ||||
| 		if (strcasecmp(player_names[playernum], name) != 0) | ||||
| 			SetPlayerName(playernum, name); | ||||
| 	} | ||||
| 
 | ||||
| 	// set color
 | ||||
| 	p->skincolor = color % numskincolors; | ||||
|  |  | |||
|  | @ -67,7 +67,7 @@ typedef enum | |||
| 
 | ||||
| 	// True if button down last tic.
 | ||||
| 	PF_ATTACKDOWN = 1<<7, | ||||
| 	PF_USEDOWN    = 1<<8, | ||||
| 	PF_SPINDOWN   = 1<<8, | ||||
| 	PF_JUMPDOWN   = 1<<9, | ||||
| 	PF_WPNDOWN    = 1<<10, | ||||
| 
 | ||||
|  |  | |||
|  | @ -29,8 +29,9 @@ | |||
| #include "p_local.h" // for var1 and var2, and some constants | ||||
| #include "p_setup.h" | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "r_draw.h" | ||||
| #include "r_patch.h" | ||||
| #include "r_picformats.h" | ||||
| #include "r_things.h" // R_Char2Frame | ||||
| #include "r_sky.h" | ||||
| #include "fastcmp.h" | ||||
|  | @ -10506,7 +10507,7 @@ static const char *const PLAYERFLAG_LIST[] = { | |||
| 
 | ||||
| 	// True if button down last tic.
 | ||||
| 	"ATTACKDOWN", | ||||
| 	"USEDOWN", | ||||
| 	"SPINDOWN", | ||||
| 	"JUMPDOWN", | ||||
| 	"WPNDOWN", | ||||
| 
 | ||||
|  | @ -12408,6 +12409,11 @@ static inline int lib_getenum(lua_State *L) | |||
| 			lua_pushinteger(L, (lua_Integer)PF_FULLSTASIS); | ||||
| 			return 1; | ||||
| 		} | ||||
| 		else if (fastcmp(p, "USEDOWN")) // Remove case when 2.3 nears release...
 | ||||
| 		{ | ||||
| 			lua_pushinteger(L, (lua_Integer)PF_SPINDOWN); | ||||
| 			return 1; | ||||
| 		} | ||||
| 		if (mathlib) return luaL_error(L, "playerflag '%s' could not be found.\n", word); | ||||
| 		return 0; | ||||
| 	} | ||||
|  |  | |||
|  | @ -129,8 +129,15 @@ extern char logfilename[1024]; | |||
| #define VERSIONSTRING "Development EXE" | ||||
| // most interface strings are ignored in development mode.
 | ||||
| // we use comprevision and compbranch instead.
 | ||||
| // VERSIONSTRING_RC is for the resource-definition script used by windows builds
 | ||||
| #else | ||||
| #ifdef BETAVERSION | ||||
| #define VERSIONSTRING "v"SRB2VERSION" "BETAVERSION | ||||
| #define VERSIONSTRING_RC SRB2VERSION " " BETAVERSION "\0" | ||||
| #else | ||||
| #define VERSIONSTRING "v"SRB2VERSION | ||||
| #define VERSIONSTRING_RC SRB2VERSION "\0" | ||||
| #endif | ||||
| // Hey! If you change this, add 1 to the MODVERSION below!
 | ||||
| // Otherwise we can't force updates!
 | ||||
| #endif | ||||
|  | @ -153,7 +160,9 @@ extern char logfilename[1024]; | |||
| // the other options the same.
 | ||||
| 
 | ||||
| // Comment out this line to completely disable update alerts (recommended for testing, but not for release)
 | ||||
| #ifndef BETAVERSION | ||||
| #define UPDATE_ALERT | ||||
| #endif | ||||
| 
 | ||||
| // The string used in the alert that pops up in the event of an update being available.
 | ||||
| // Please change to apply to your modification (we don't want everyone asking where your mod is on SRB2.org!).
 | ||||
|  | @ -667,4 +676,10 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; | |||
| #undef UPDATE_ALERT | ||||
| #endif | ||||
| 
 | ||||
| #if defined (HAVE_CURL) && ! defined (NONET) | ||||
| #define MASTERSERVER | ||||
| #else | ||||
| #undef UPDATE_ALERT | ||||
| #endif | ||||
| 
 | ||||
| #endif // __DOOMDEF__
 | ||||
|  |  | |||
|  | @ -152,6 +152,9 @@ static INT32 cutscene_textspeed = 0; | |||
| static UINT8 cutscene_boostspeed = 0; | ||||
| static tic_t cutscene_lasttextwrite = 0; | ||||
| 
 | ||||
| // STJR Intro
 | ||||
| char stjrintro[9] = "STJRI000"; | ||||
| 
 | ||||
| //
 | ||||
| // This alters the text string cutscene_disptext.
 | ||||
| // Use the typical string drawing functions to display it.
 | ||||
|  | @ -618,9 +621,7 @@ static const char *credits[] = { | |||
| 	"SEGA", | ||||
| 	"Sonic Team", | ||||
| 	"SRB2 & Sonic Team Jr. (www.srb2.org)", | ||||
| 	"\"blazethecat\"", | ||||
| 	"\"Chaos Zero 64\"", | ||||
| 	"\"Rob\"", | ||||
| 	"", | ||||
| 	"\1Produced By", | ||||
| 	"Kart Krew", | ||||
|  |  | |||
|  | @ -2245,7 +2245,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps) | |||
| 
 | ||||
| 
 | ||||
| 	// Don't do anything immediately
 | ||||
| 	p->pflags |= PF_USEDOWN; | ||||
| 	p->pflags |= PF_SPINDOWN; | ||||
| 	p->pflags |= PF_ATTACKDOWN; | ||||
| 	p->pflags |= PF_JUMPDOWN; | ||||
| 
 | ||||
|  | @ -3529,7 +3529,8 @@ static void G_DoCompleted(void) | |||
| 		if (nextmap < 0 || (nextmap >= NUMMAPS && nextmap < 1100-1) || nextmap > 1103-1) | ||||
| 			I_Error("Followed map %d to invalid map %d\n", prevmap + 1, nextmap + 1); | ||||
| 
 | ||||
| 		lastmap = nextmap; // Remember last map for when you come out of the special stage.
 | ||||
| 		if (!spec) | ||||
| 			lastmap = nextmap; // Remember last map for when you come out of the special stage.
 | ||||
| 	} | ||||
| 
 | ||||
| 	automapactive = false; | ||||
|  |  | |||
|  | @ -18,6 +18,7 @@ | |||
| #include "doomstat.h" | ||||
| #include "d_event.h" | ||||
| #include "g_demo.h" | ||||
| #include "m_cheat.h" // objectplacing | ||||
| 
 | ||||
| extern char gamedatafilename[64]; | ||||
| extern char timeattackfolder[64]; | ||||
|  |  | |||
|  | @ -1044,7 +1044,7 @@ static INT32 G_FilterKeyByVersion(INT32 numctrl, INT32 keyidx, INT32 player, INT | |||
| #else | ||||
| 	if (GETMAJOREXECVERSION(cv_execversion.value) < 27 && ( // v2.1.22
 | ||||
| 		numctrl == gc_weaponnext || numctrl == gc_weaponprev || numctrl == gc_tossflag || | ||||
| 		numctrl == gc_use || numctrl == gc_camreset || numctrl == gc_jump || | ||||
| 		numctrl == gc_spin || numctrl == gc_camreset || numctrl == gc_jump || | ||||
| 		numctrl == gc_pause || numctrl == gc_systemmenu || numctrl == gc_camtoggle || | ||||
| 		numctrl == gc_screenshot || numctrl == gc_talkkey || numctrl == gc_scores || | ||||
| 		numctrl == gc_centerview | ||||
|  | @ -1158,6 +1158,7 @@ static void setcontrol(INT32 (*gc)[2]) | |||
| 		player = 0; | ||||
| 
 | ||||
| 	namectrl = COM_Argv(1); | ||||
| 
 | ||||
| 	for (numctrl = 0; numctrl < num_gamecontrols && stricmp(namectrl, gamecontrolname[numctrl]); | ||||
| 		numctrl++) | ||||
| 		; | ||||
|  |  | |||
|  | @ -21,11 +21,12 @@ | |||
| #include "../doomstat.h"    //gamemode | ||||
| #include "../i_video.h"     //rendermode | ||||
| #include "../r_data.h" | ||||
| #include "../r_textures.h" | ||||
| #include "../w_wad.h" | ||||
| #include "../z_zone.h" | ||||
| #include "../v_video.h" | ||||
| #include "../r_draw.h" | ||||
| #include "../r_patch.h" | ||||
| #include "../r_picformats.h" | ||||
| #include "../p_setup.h" | ||||
| 
 | ||||
| INT32 patchformat = GL_TEXFMT_AP_88; // use alpha for holes
 | ||||
|  | @ -100,17 +101,15 @@ static void HWR_DrawColumnInCache(const column_t *patchcol, UINT8 *block, GLMipm | |||
| 			count--; | ||||
| 
 | ||||
| 			texel = source[yfrac>>FRACBITS]; | ||||
| 			alpha = 0xFF; | ||||
| 			// Make pixel transparent if chroma keyed
 | ||||
| 			if ((mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) | ||||
| 				alpha = 0x00; | ||||
| 
 | ||||
| 			//Hurdler: 25/04/2000: now support colormap in hardware mode
 | ||||
| 			if (mipmap->colormap) | ||||
| 				texel = mipmap->colormap[texel]; | ||||
| 
 | ||||
| 			// If the mipmap is chromakeyed, check if the texel's color
 | ||||
| 			// is equivalent to the chroma key's color index.
 | ||||
| 			alpha = 0xff; | ||||
| 			if ((mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) | ||||
| 				alpha = 0x00; | ||||
| 
 | ||||
| 			// hope compiler will get this switch out of the loops (dreams...)
 | ||||
| 			// gcc do it ! but vcc not ! (why don't use cygwin gcc for win32 ?)
 | ||||
| 			// Alam: SRB2 uses Mingw, HUGS
 | ||||
|  | @ -212,17 +211,15 @@ static void HWR_DrawFlippedColumnInCache(const column_t *patchcol, UINT8 *block, | |||
| 			count--; | ||||
| 
 | ||||
| 			texel = source[yfrac>>FRACBITS]; | ||||
| 			alpha = 0xFF; | ||||
| 			// Make pixel transparent if chroma keyed
 | ||||
| 			if ((mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) | ||||
| 				alpha = 0x00; | ||||
| 
 | ||||
| 			//Hurdler: 25/04/2000: now support colormap in hardware mode
 | ||||
| 			if (mipmap->colormap) | ||||
| 				texel = mipmap->colormap[texel]; | ||||
| 
 | ||||
| 			// If the mipmap is chromakeyed, check if the texel's color
 | ||||
| 			// is equivalent to the chroma key's color index.
 | ||||
| 			alpha = 0xff; | ||||
| 			if ((mipmap->flags & TF_CHROMAKEYED) && (texel == HWR_PATCHES_CHROMAKEY_COLORINDEX)) | ||||
| 				alpha = 0x00; | ||||
| 
 | ||||
| 			// hope compiler will get this switch out of the loops (dreams...)
 | ||||
| 			// gcc do it ! but vcc not ! (why don't use cygwin gcc for win32 ?)
 | ||||
| 			// Alam: SRB2 uses Mingw, HUGS
 | ||||
|  | @ -516,13 +513,13 @@ static void HWR_GenerateTexture(INT32 texnum, GLMapTexture_t *grtex) | |||
| 		realpatch = (patch_t *)pdata; | ||||
| 
 | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 		if (R_IsLumpPNG((UINT8 *)realpatch, lumplength)) | ||||
| 			realpatch = R_PNGToPatch((UINT8 *)realpatch, lumplength, NULL); | ||||
| 		if (Picture_IsLumpPNG((UINT8 *)realpatch, lumplength)) | ||||
| 			realpatch = (patch_t *)Picture_PNGConvert(pdata, PICFMT_PATCH, NULL, NULL, NULL, NULL, lumplength, NULL, 0); | ||||
| 		else | ||||
| #endif | ||||
| #ifdef WALLFLATS | ||||
| 		if (texture->type == TEXTURETYPE_FLAT) | ||||
| 			realpatch = R_FlatToPatch(pdata, texture->width, texture->height, 0, 0, NULL, false); | ||||
| 			realpatch = (patch_t *)Picture_Convert(PICFMT_FLAT, pdata, PICFMT_PATCH, 0, NULL, texture->width, texture->height, 0, 0, 0); | ||||
| 		else | ||||
| #endif | ||||
| 		{ | ||||
|  | @ -558,8 +555,8 @@ void HWR_MakePatch (patch_t *patch, GLPatch_t *grPatch, GLMipmap_t *grMipmap, bo | |||
| #ifndef NO_PNG_LUMPS | ||||
| 	// lump is a png so convert it
 | ||||
| 	size_t len = W_LumpLengthPwad(grPatch->wadnum, grPatch->lumpnum); | ||||
| 	if ((patch != NULL) && R_IsLumpPNG((const UINT8 *)patch, len)) | ||||
| 		patch = R_PNGToPatch((const UINT8 *)patch, len, NULL); | ||||
| 	if ((patch != NULL) && Picture_IsLumpPNG((const UINT8 *)patch, len)) | ||||
| 		patch = (patch_t *)Picture_PNGConvert((const UINT8 *)patch, PICFMT_PATCH, NULL, NULL, NULL, NULL, len, NULL, 0); | ||||
| #endif | ||||
| 
 | ||||
| 	// don't do it twice (like a cache)
 | ||||
|  | @ -806,6 +803,8 @@ static void HWR_CacheFlat(GLMipmap_t *grMipmap, lumpnum_t flatlumpnum) | |||
| static void HWR_CacheTextureAsFlat(GLMipmap_t *grMipmap, INT32 texturenum) | ||||
| { | ||||
| 	UINT8 *flat; | ||||
| 	UINT8 *converted; | ||||
| 	size_t size; | ||||
| 
 | ||||
| 	// setup the texture info
 | ||||
| 	grMipmap->format = GL_TEXFMT_P_8; | ||||
|  | @ -813,11 +812,12 @@ static void HWR_CacheTextureAsFlat(GLMipmap_t *grMipmap, INT32 texturenum) | |||
| 
 | ||||
| 	grMipmap->width  = (UINT16)textures[texturenum]->width; | ||||
| 	grMipmap->height = (UINT16)textures[texturenum]->height; | ||||
| 	size = (grMipmap->width * grMipmap->height); | ||||
| 
 | ||||
| 	flat = Z_Malloc(grMipmap->width * grMipmap->height, PU_HWRCACHE, &grMipmap->data); | ||||
| 	memset(flat, TRANSPARENTPIXEL, grMipmap->width * grMipmap->height); | ||||
| 
 | ||||
| 	R_TextureToFlat(texturenum, flat); | ||||
| 	flat = Z_Malloc(size, PU_HWRCACHE, &grMipmap->data); | ||||
| 	converted = (UINT8 *)Picture_TextureToFlat(texturenum); | ||||
| 	M_Memcpy(flat, converted, size); | ||||
| 	Z_Free(converted); | ||||
| } | ||||
| 
 | ||||
| // Download a Doom 'flat' to the hardware cache and make it ready for use
 | ||||
|  | @ -864,7 +864,7 @@ void HWR_GetLevelFlat(levelflat_t *levelflat, boolean noencoremap) | |||
| 		INT32 texturenum = levelflat->u.texture.num; | ||||
| #ifdef PARANOIA | ||||
| 		if ((unsigned)texturenum >= gl_numtextures) | ||||
| 			I_Error("HWR_GetLevelFlat: texturenum >= numtextures\n"); | ||||
| 			I_Error("HWR_GetLevelFlat: texturenum >= numtextures"); | ||||
| #endif | ||||
| 
 | ||||
| 		// Who knows?
 | ||||
|  | @ -887,6 +887,53 @@ void HWR_GetLevelFlat(levelflat_t *levelflat, boolean noencoremap) | |||
| 		// The system-memory data can be purged now.
 | ||||
| 		Z_ChangeTag(grtex->mipmap.data, PU_HWRCACHE_UNLOCKED); | ||||
| 	} | ||||
| 	else if (levelflat->type == LEVELFLAT_PATCH) | ||||
| 	{ | ||||
| 		GLPatch_t *patch = W_CachePatchNum(levelflat->u.flat.lumpnum, PU_CACHE); | ||||
| 		levelflat->width = (UINT16)SHORT(patch->width); | ||||
| 		levelflat->height = (UINT16)SHORT(patch->height); | ||||
| 		HWR_GetPatch(patch); | ||||
| 	} | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 	else if (levelflat->type == LEVELFLAT_PNG) | ||||
| 	{ | ||||
| 		INT32 pngwidth = 0, pngheight = 0; | ||||
| 		GLMipmap_t *mipmap = levelflat->mipmap; | ||||
| 		UINT8 *flat; | ||||
| 		size_t size; | ||||
| 
 | ||||
| 		// Cache the picture.
 | ||||
| 		if (!levelflat->picture) | ||||
| 		{ | ||||
| 			levelflat->picture = Picture_PNGConvert(W_CacheLumpNum(levelflat->u.flat.lumpnum, PU_CACHE), PICFMT_FLAT, &pngwidth, &pngheight, NULL, NULL, W_LumpLength(levelflat->u.flat.lumpnum), NULL, 0); | ||||
| 			levelflat->width = (UINT16)pngwidth; | ||||
| 			levelflat->height = (UINT16)pngheight; | ||||
| 		} | ||||
| 
 | ||||
| 		// Make the mipmap.
 | ||||
| 		if (mipmap == NULL) | ||||
| 		{ | ||||
| 			mipmap = Z_Calloc(sizeof(GLMipmap_t), PU_LEVEL, NULL); | ||||
| 			mipmap->format = GL_TEXFMT_P_8; | ||||
| 			mipmap->flags = TF_WRAPXY|TF_CHROMAKEYED; | ||||
| 			levelflat->mipmap = mipmap; | ||||
| 		} | ||||
| 
 | ||||
| 		if (!mipmap->data && !mipmap->downloaded) | ||||
| 		{ | ||||
| 			mipmap->width = levelflat->width; | ||||
| 			mipmap->height = levelflat->height; | ||||
| 			size = (mipmap->width * mipmap->height); | ||||
| 			flat = Z_Malloc(size, PU_LEVEL, &mipmap->data); | ||||
| 			if (levelflat->picture == NULL) | ||||
| 				I_Error("HWR_GetLevelFlat: levelflat->picture == NULL"); | ||||
| 			M_Memcpy(flat, levelflat->picture, size); | ||||
| 		} | ||||
| 
 | ||||
| 		// Tell the hardware driver to bind the current texture to the flat's mipmap
 | ||||
| 		HWD.pfnSetTexture(mipmap); | ||||
| 	} | ||||
| #endif | ||||
| 	else // set no texture
 | ||||
| 		HWR_SetCurrentTexture(NULL); | ||||
| } | ||||
|  |  | |||
|  | @ -25,7 +25,7 @@ | |||
| #include "../p_local.h" | ||||
| #include "../p_setup.h" | ||||
| #include "../r_local.h" | ||||
| #include "../r_patch.h" | ||||
| #include "../r_picformats.h" | ||||
| #include "../r_bsp.h" | ||||
| #include "../d_clisrv.h" | ||||
| #include "../w_wad.h" | ||||
|  | @ -358,7 +358,6 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool | |||
| 	float fflatwidth = 64.0f, fflatheight = 64.0f; | ||||
| 	INT32 flatflag = 63; | ||||
| 	boolean texflat = false; | ||||
| 	size_t len; | ||||
| 	float scrollx = 0.0f, scrolly = 0.0f; | ||||
| 	angle_t angle = 0; | ||||
| 	FSurfaceInfo    Surf; | ||||
|  | @ -413,16 +412,9 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool | |||
| 	// set texture for polygon
 | ||||
| 	if (levelflat != NULL) | ||||
| 	{ | ||||
| 		if (levelflat->type == LEVELFLAT_TEXTURE) | ||||
| 		if (levelflat->type == LEVELFLAT_FLAT) | ||||
| 		{ | ||||
| 			fflatwidth = textures[levelflat->u.texture.num]->width; | ||||
| 			fflatheight = textures[levelflat->u.texture.num]->height; | ||||
| 			texflat = true; | ||||
| 		} | ||||
| 		else if (levelflat->type == LEVELFLAT_FLAT) | ||||
| 		{ | ||||
| 			len = W_LumpLength(levelflat->u.flat.lumpnum); | ||||
| 
 | ||||
| 			size_t len = W_LumpLength(levelflat->u.flat.lumpnum); | ||||
| 			switch (len) | ||||
| 			{ | ||||
| 				case 4194304: // 2048x2048 lump
 | ||||
|  | @ -447,9 +439,22 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool | |||
| 					fflatwidth = fflatheight = 64.0f; | ||||
| 					break; | ||||
| 			} | ||||
| 
 | ||||
| 			flatflag = ((INT32)fflatwidth)-1; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			if (levelflat->type == LEVELFLAT_TEXTURE) | ||||
| 			{ | ||||
| 				fflatwidth = textures[levelflat->u.texture.num]->width; | ||||
| 				fflatheight = textures[levelflat->u.texture.num]->height; | ||||
| 			} | ||||
| 			else if (levelflat->type == LEVELFLAT_PATCH || levelflat->type == LEVELFLAT_PNG) | ||||
| 			{ | ||||
| 				fflatwidth = levelflat->width; | ||||
| 				fflatheight = levelflat->height; | ||||
| 			} | ||||
| 			texflat = true; | ||||
| 		} | ||||
| 	} | ||||
| 	else // set no texture
 | ||||
| 		HWR_SetCurrentTexture(NULL); | ||||
|  | @ -2659,7 +2664,6 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, | |||
| 	float fflatwidth = 64.0f, fflatheight = 64.0f; | ||||
| 	INT32 flatflag = 63; | ||||
| 	boolean texflat = false; | ||||
| 	size_t len; | ||||
| 	float scrollx = 0.0f, scrolly = 0.0f; | ||||
| 	angle_t angle = 0; | ||||
| 	FSurfaceInfo    Surf; | ||||
|  | @ -2693,16 +2697,9 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, | |||
| 	// set texture for polygon
 | ||||
| 	if (levelflat != NULL) | ||||
| 	{ | ||||
| 		if (levelflat->type == LEVELFLAT_TEXTURE) | ||||
| 		if (levelflat->type == LEVELFLAT_FLAT) | ||||
| 		{ | ||||
| 			fflatwidth = textures[levelflat->u.texture.num]->width; | ||||
| 			fflatheight = textures[levelflat->u.texture.num]->height; | ||||
| 			texflat = true; | ||||
| 		} | ||||
| 		else if (levelflat->type == LEVELFLAT_FLAT) | ||||
| 		{ | ||||
| 			len = W_LumpLength(levelflat->u.flat.lumpnum); | ||||
| 
 | ||||
| 			size_t len = W_LumpLength(levelflat->u.flat.lumpnum); | ||||
| 			switch (len) | ||||
| 			{ | ||||
| 				case 4194304: // 2048x2048 lump
 | ||||
|  | @ -2727,9 +2724,22 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, | |||
| 					fflatwidth = fflatheight = 64.0f; | ||||
| 					break; | ||||
| 			} | ||||
| 
 | ||||
| 			flatflag = ((INT32)fflatwidth)-1; | ||||
| 		} | ||||
| 		else | ||||
| 		{ | ||||
| 			if (levelflat->type == LEVELFLAT_TEXTURE) | ||||
| 			{ | ||||
| 				fflatwidth = textures[levelflat->u.texture.num]->width; | ||||
| 				fflatheight = textures[levelflat->u.texture.num]->height; | ||||
| 			} | ||||
| 			else if (levelflat->type == LEVELFLAT_PATCH || levelflat->type == LEVELFLAT_PNG) | ||||
| 			{ | ||||
| 				fflatwidth = levelflat->width; | ||||
| 				fflatheight = levelflat->height; | ||||
| 			} | ||||
| 			texflat = true; | ||||
| 		} | ||||
| 	} | ||||
| 	else // set no texture
 | ||||
| 		HWR_SetCurrentTexture(NULL); | ||||
|  |  | |||
|  | @ -1201,6 +1201,7 @@ static UINT8 HWR_GetModelSprite2(md2_t *md2, skin_t *skin, UINT8 spr2, player_t | |||
| 	return spr2; | ||||
| } | ||||
| 
 | ||||
| // Adjust texture coords of model to fit into a patch's max_s and max_t
 | ||||
| static void adjustTextureCoords(model_t *model, GLPatch_t *gpatch) | ||||
| { | ||||
| 	int i; | ||||
|  | @ -1209,24 +1210,35 @@ static void adjustTextureCoords(model_t *model, GLPatch_t *gpatch) | |||
| 		int j; | ||||
| 		mesh_t *mesh = &model->meshes[i]; | ||||
| 		int numVertices; | ||||
| 		float *uvPtr = mesh->uvs; | ||||
| 		float *uvReadPtr = mesh->originaluvs; | ||||
| 		float *uvWritePtr; | ||||
| 
 | ||||
| 		// i dont know if this is actually possible, just logical conclusion of structure in CreateModelVBOs
 | ||||
| 		if (!mesh->frames && !mesh->tinyframes) return; | ||||
| 		if (!mesh->frames && !mesh->tinyframes) continue; | ||||
| 
 | ||||
| 		if (mesh->frames) // again CreateModelVBO and CreateModelVBOTiny iterate like this so I'm gonna do that too
 | ||||
| 			numVertices = mesh->numTriangles * 3; | ||||
| 		else | ||||
| 			numVertices = mesh->numVertices; | ||||
| 
 | ||||
| 		// if originaluvs points to uvs, we need to allocate new memory for adjusted uvs
 | ||||
| 		// the old uvs are kept around for use in possible readjustments
 | ||||
| 		if (mesh->uvs == mesh->originaluvs) | ||||
| 			mesh->uvs = Z_Malloc(numVertices * 2 * sizeof(float), PU_STATIC, NULL); | ||||
| 
 | ||||
| 		uvWritePtr = mesh->uvs; | ||||
| 
 | ||||
| 		// fix uvs (texture coordinates) to take into account that the actual texture
 | ||||
| 		// has empty space added until the next power of two
 | ||||
| 		for (j = 0; j < numVertices; j++) | ||||
| 		{ | ||||
| 			*uvPtr++ *= gpatch->max_s; | ||||
| 			*uvPtr++ *= gpatch->max_t; | ||||
| 			*uvWritePtr++ = *uvReadPtr++ * gpatch->max_s; | ||||
| 			*uvWritePtr++ = *uvReadPtr++ * gpatch->max_t; | ||||
| 		} | ||||
| 	} | ||||
| 	// Save the values we adjusted the uvs for
 | ||||
| 	model->max_s = gpatch->max_s; | ||||
| 	model->max_t = gpatch->max_t; | ||||
| } | ||||
| 
 | ||||
| //
 | ||||
|  | @ -1250,6 +1262,10 @@ boolean HWR_DrawModel(gl_vissprite_t *spr) | |||
| 	if (spr->precip) | ||||
| 		return false; | ||||
| 
 | ||||
| 	// Lactozilla: Disallow certain models from rendering
 | ||||
| 	if (!HWR_AllowModel(spr->mobj)) | ||||
| 		return false; | ||||
| 
 | ||||
| 	memset(&p, 0x00, sizeof(FTransform)); | ||||
| 
 | ||||
| 	// MD2 colormap fix
 | ||||
|  | @ -1378,10 +1394,13 @@ boolean HWR_DrawModel(gl_vissprite_t *spr) | |||
| 			if (md2->model) | ||||
| 			{ | ||||
| 				md2_printModelInfo(md2->model); | ||||
| 				// if model uses sprite patch as texture, then
 | ||||
| 				// If model uses sprite patch as texture, then
 | ||||
| 				// adjust texture coordinates to take power of two textures into account
 | ||||
| 				if (!gpatch || !gpatch->mipmap->format) | ||||
| 					adjustTextureCoords(md2->model, spr->gpatch); | ||||
| 				// note down the max_s and max_t that end up in the VBO
 | ||||
| 				md2->model->vbo_max_s = md2->model->max_s; | ||||
| 				md2->model->vbo_max_t = md2->model->max_t; | ||||
| 				HWD.pfnCreateModelVBOs(md2->model); | ||||
| 			} | ||||
| 			else | ||||
|  | @ -1392,10 +1411,6 @@ boolean HWR_DrawModel(gl_vissprite_t *spr) | |||
| 			} | ||||
| 		} | ||||
| 
 | ||||
| 		// Lactozilla: Disallow certain models from rendering
 | ||||
| 		if (!HWR_AllowModel(spr->mobj)) | ||||
| 			return false; | ||||
| 
 | ||||
| 		//HWD.pfnSetBlend(blend); // This seems to actually break translucency?
 | ||||
| 		finalscale = md2->scale; | ||||
| 		//Hurdler: arf, I don't like that implementation at all... too much crappy
 | ||||
|  | @ -1430,6 +1445,14 @@ boolean HWR_DrawModel(gl_vissprite_t *spr) | |||
| 		{ | ||||
| 			// Sprite
 | ||||
| 			gpatch = spr->gpatch; //W_CachePatchNum(spr->patchlumpnum, PU_CACHE);
 | ||||
| 			// Check if sprite dimensions are different from previously used sprite.
 | ||||
| 			// If so, uvs need to be readjusted.
 | ||||
| 			// Comparing floats with the != operator here should be okay because they
 | ||||
| 			// are just copies of glpatches' max_s and max_t values.
 | ||||
| 			// Instead of the != operator, memcmp is used to avoid a compiler warning.
 | ||||
| 			if (memcmp(&(gpatch->max_s), &(md2->model->max_s), sizeof(md2->model->max_s)) != 0 || | ||||
| 				memcmp(&(gpatch->max_t), &(md2->model->max_t), sizeof(md2->model->max_t)) != 0) | ||||
| 				adjustTextureCoords(md2->model, gpatch); | ||||
| 			HWR_GetMappedPatch(gpatch, spr->colormap); | ||||
| 		} | ||||
| 
 | ||||
|  |  | |||
|  | @ -221,6 +221,15 @@ model_t *LoadModel(const char *filename, int ztag) | |||
| 		material->shininess = 25.0f; | ||||
| 	} | ||||
| 
 | ||||
| 	// Set originaluvs to point to uvs
 | ||||
| 	for (i = 0; i < model->numMeshes; i++) | ||||
| 		model->meshes[i].originaluvs = model->meshes[i].uvs; | ||||
| 
 | ||||
| 	model->max_s = 1.0; | ||||
| 	model->max_t = 1.0; | ||||
| 	model->vbo_max_s = 1.0; | ||||
| 	model->vbo_max_t = 1.0; | ||||
| 
 | ||||
| 	return model; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -59,6 +59,11 @@ typedef struct mesh_s | |||
| 	int numTriangles; | ||||
| 
 | ||||
| 	float *uvs; | ||||
| 	// if uv adjustment is needed, uvs is changed to point to adjusted ones and
 | ||||
| 	// this one retains the originals
 | ||||
| 	// note: this member has been added with the assumption that models are never freed.
 | ||||
| 	// (UnloadModel is called by nobody at the time of writing.)
 | ||||
| 	float *originaluvs; | ||||
| 	float *lightuvs; | ||||
| 
 | ||||
| 	int numFrames; | ||||
|  | @ -99,6 +104,15 @@ typedef struct model_s | |||
| 	char *framenames; | ||||
| 	boolean interpolate[256]; | ||||
| 	modelspr2frames_t *spr2frames; | ||||
| 
 | ||||
| 	// the max_s and max_t values that the uvs are currently adjusted to
 | ||||
| 	// (if a sprite is used as a texture)
 | ||||
| 	float max_s; | ||||
| 	float max_t; | ||||
| 	// These are the values that the uvs in the VBO have been adjusted to.
 | ||||
| 	// If they are not same as max_s and max_t, then the VBO won't be used.
 | ||||
| 	float vbo_max_s; | ||||
| 	float vbo_max_t; | ||||
| } model_t; | ||||
| 
 | ||||
| extern int numModels; | ||||
|  |  | |||
|  | @ -2533,6 +2533,8 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 | |||
| 
 | ||||
| 	boolean useTinyFrames; | ||||
| 
 | ||||
| 	boolean useVBO = true; | ||||
| 
 | ||||
| 	int i; | ||||
| 
 | ||||
| 	// Because otherwise, scaling the screen negatively vertically breaks the lighting
 | ||||
|  | @ -2676,6 +2678,15 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 | |||
| 	if (useTinyFrames) | ||||
| 		pglScalef(1 / 64.0f, 1 / 64.0f, 1 / 64.0f); | ||||
| 
 | ||||
| 	// Don't use the VBO if it does not have the correct texture coordinates.
 | ||||
| 	// (Can happen when model uses a sprite as a texture and the sprite changes)
 | ||||
| 	// Comparing floats with the != operator here should be okay because they
 | ||||
| 	// are just copies of glpatches' max_s and max_t values.
 | ||||
| 	// Instead of the != operator, memcmp is used to avoid a compiler warning.
 | ||||
| 	if (memcmp(&(model->vbo_max_s), &(model->max_s), sizeof(model->max_s)) != 0 || | ||||
| 		memcmp(&(model->vbo_max_t), &(model->max_t), sizeof(model->max_t)) != 0) | ||||
| 		useVBO = false; | ||||
| 
 | ||||
| 	pglEnableClientState(GL_NORMAL_ARRAY); | ||||
| 
 | ||||
| 	for (i = 0; i < model->numMeshes; i++) | ||||
|  | @ -2692,13 +2703,23 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 | |||
| 
 | ||||
| 			if (!nextframe || fpclassify(pol) == FP_ZERO) | ||||
| 			{ | ||||
| 				pglBindBuffer(GL_ARRAY_BUFFER, frame->vboID); | ||||
| 				pglVertexPointer(3, GL_SHORT, sizeof(vbotiny_t), BUFFER_OFFSET(0)); | ||||
| 				pglNormalPointer(GL_BYTE, sizeof(vbotiny_t), BUFFER_OFFSET(sizeof(short)*3)); | ||||
| 				pglTexCoordPointer(2, GL_FLOAT, sizeof(vbotiny_t), BUFFER_OFFSET(sizeof(short) * 3 + sizeof(char) * 6)); | ||||
| 				if (useVBO) | ||||
| 				{ | ||||
| 					pglBindBuffer(GL_ARRAY_BUFFER, frame->vboID); | ||||
| 					pglVertexPointer(3, GL_SHORT, sizeof(vbotiny_t), BUFFER_OFFSET(0)); | ||||
| 					pglNormalPointer(GL_BYTE, sizeof(vbotiny_t), BUFFER_OFFSET(sizeof(short)*3)); | ||||
| 					pglTexCoordPointer(2, GL_FLOAT, sizeof(vbotiny_t), BUFFER_OFFSET(sizeof(short) * 3 + sizeof(char) * 6)); | ||||
| 
 | ||||
| 				pglDrawElements(GL_TRIANGLES, mesh->numTriangles * 3, GL_UNSIGNED_SHORT, mesh->indices); | ||||
| 				pglBindBuffer(GL_ARRAY_BUFFER, 0); | ||||
| 					pglDrawElements(GL_TRIANGLES, mesh->numTriangles * 3, GL_UNSIGNED_SHORT, mesh->indices); | ||||
| 					pglBindBuffer(GL_ARRAY_BUFFER, 0); | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					pglVertexPointer(3, GL_SHORT, 0, frame->vertices); | ||||
| 					pglNormalPointer(GL_BYTE, 0, frame->normals); | ||||
| 					pglTexCoordPointer(2, GL_FLOAT, 0, mesh->uvs); | ||||
| 					pglDrawElements(GL_TRIANGLES, mesh->numTriangles * 3, GL_UNSIGNED_SHORT, mesh->indices); | ||||
| 				} | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
|  | @ -2734,21 +2755,25 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 | |||
| 
 | ||||
| 			if (!nextframe || fpclassify(pol) == FP_ZERO) | ||||
| 			{ | ||||
| 				// Zoom! Take advantage of just shoving the entire arrays to the GPU.
 | ||||
| /*				pglVertexPointer(3, GL_FLOAT, 0, frame->vertices);
 | ||||
| 				pglNormalPointer(GL_FLOAT, 0, frame->normals); | ||||
| 				pglTexCoordPointer(2, GL_FLOAT, 0, mesh->uvs); | ||||
| 				pglDrawArrays(GL_TRIANGLES, 0, mesh->numTriangles * 3);*/ | ||||
| 				if (useVBO) | ||||
| 				{ | ||||
| 					pglBindBuffer(GL_ARRAY_BUFFER, frame->vboID); | ||||
| 					pglVertexPointer(3, GL_FLOAT, sizeof(vbo64_t), BUFFER_OFFSET(0)); | ||||
| 					pglNormalPointer(GL_FLOAT, sizeof(vbo64_t), BUFFER_OFFSET(sizeof(float) * 3)); | ||||
| 					pglTexCoordPointer(2, GL_FLOAT, sizeof(vbo64_t), BUFFER_OFFSET(sizeof(float) * 6)); | ||||
| 
 | ||||
| 				pglBindBuffer(GL_ARRAY_BUFFER, frame->vboID); | ||||
| 				pglVertexPointer(3, GL_FLOAT, sizeof(vbo64_t), BUFFER_OFFSET(0)); | ||||
| 				pglNormalPointer(GL_FLOAT, sizeof(vbo64_t), BUFFER_OFFSET(sizeof(float) * 3)); | ||||
| 				pglTexCoordPointer(2, GL_FLOAT, sizeof(vbo64_t), BUFFER_OFFSET(sizeof(float) * 6)); | ||||
| 
 | ||||
| 				pglDrawArrays(GL_TRIANGLES, 0, mesh->numTriangles * 3); | ||||
| 				// No tinyframes, no mesh indices
 | ||||
| 				//pglDrawElements(GL_TRIANGLES, mesh->numTriangles * 3, GL_UNSIGNED_SHORT, mesh->indices);
 | ||||
| 				pglBindBuffer(GL_ARRAY_BUFFER, 0); | ||||
| 					pglDrawArrays(GL_TRIANGLES, 0, mesh->numTriangles * 3); | ||||
| 					// No tinyframes, no mesh indices
 | ||||
| 					//pglDrawElements(GL_TRIANGLES, mesh->numTriangles * 3, GL_UNSIGNED_SHORT, mesh->indices);
 | ||||
| 					pglBindBuffer(GL_ARRAY_BUFFER, 0); | ||||
| 				} | ||||
| 				else | ||||
| 				{ | ||||
| 					pglVertexPointer(3, GL_FLOAT, 0, frame->vertices); | ||||
| 					pglNormalPointer(GL_FLOAT, 0, frame->normals); | ||||
| 					pglTexCoordPointer(2, GL_FLOAT, 0, mesh->uvs); | ||||
| 					pglDrawArrays(GL_TRIANGLES, 0, mesh->numTriangles * 3); | ||||
| 				} | ||||
| 			} | ||||
| 			else | ||||
| 			{ | ||||
|  |  | |||
|  | @ -364,14 +364,27 @@ HMS_list_servers (void) | |||
| { | ||||
| 	struct HMS_buffer *hms; | ||||
| 
 | ||||
| 	hms = HMS_connect("games/%s/%d/servers", SRB2APPLICATION, MODVERSION); | ||||
| 	char *list; | ||||
| 	char *p; | ||||
| 
 | ||||
| 	hms = HMS_connect("servers"); | ||||
| 
 | ||||
| 	if (! hms) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (HMS_do(hms)) | ||||
| 	{ | ||||
| 		CONS_Printf("%s\n", hms->buffer); | ||||
| 		list = curl_easy_unescape(hms->curl, hms->buffer, 0, NULL); | ||||
| 
 | ||||
| 		p = strtok(list, "\n"); | ||||
| 
 | ||||
| 		while (p != NULL) | ||||
| 		{ | ||||
| 			CONS_Printf("\x80%s\n", p); | ||||
| 			p = strtok(NULL, "\n"); | ||||
| 		} | ||||
| 
 | ||||
| 		curl_free(list); | ||||
| 	} | ||||
| 
 | ||||
| 	HMS_end(hms); | ||||
|  |  | |||
|  | @ -1,4 +1,4 @@ | |||
| // SONIC ROBO BLAST 2 KART
 | ||||
| // SONIC ROBO BLAST 2
 | ||||
| //-----------------------------------------------------------------------------
 | ||||
| // Copyright (C) 2020 by James R.
 | ||||
| //
 | ||||
|  |  | |||
|  | @ -6190,7 +6190,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = | |||
| 		100,            // mass
 | ||||
| 		0,              // damage
 | ||||
| 		sfx_None,       // activesound
 | ||||
| 		MF_NOCLIP|MF_SPECIAL, // flags
 | ||||
| 		MF_SPECIAL,     // flags
 | ||||
| 		S_NULL          // raisestate
 | ||||
| 	}, | ||||
| 
 | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| #include "p_mobj.h" | ||||
| #include "p_local.h" | ||||
| #include "z_zone.h" | ||||
| #include "r_patch.h" | ||||
| #include "r_picformats.h" | ||||
| #include "r_things.h" | ||||
| #include "r_draw.h" // R_GetColorByName | ||||
| #include "doomstat.h" // luabanks[] | ||||
|  | @ -1552,8 +1552,10 @@ static int lib_setSkinColor(lua_State *L) | |||
| 			strlcpy(info->name, n, MAXCOLORNAME+1); | ||||
| 			if (strlen(n) > MAXCOLORNAME) | ||||
| 				CONS_Alert(CONS_WARNING, "skincolor_t field 'name' ('%s') longer than %d chars; clipped to %s.\n", n, MAXCOLORNAME, info->name); | ||||
| #if 0 | ||||
| 			if (strchr(info->name, ' ') != NULL) | ||||
| 				CONS_Alert(CONS_WARNING, "skincolor_t field 'name' ('%s') contains spaces.\n", info->name); | ||||
| #endif | ||||
| 
 | ||||
| 			if (info->name[0] != '\0') // don't check empty string for dupe
 | ||||
| 			{ | ||||
|  | @ -1643,8 +1645,10 @@ static int skincolor_set(lua_State *L) | |||
| 		strlcpy(info->name, n, MAXCOLORNAME+1); | ||||
| 		if (strlen(n) > MAXCOLORNAME) | ||||
| 			CONS_Alert(CONS_WARNING, "skincolor_t field 'name' ('%s') longer than %d chars; clipped to %s.\n", n, MAXCOLORNAME, info->name); | ||||
| #if 0 | ||||
| 		if (strchr(info->name, ' ') != NULL) | ||||
| 			CONS_Alert(CONS_WARNING, "skincolor_t field 'name' ('%s') contains spaces.\n", info->name); | ||||
| #endif | ||||
| 
 | ||||
| 		if (info->name[0] != '\0') // don't check empty string for dupe
 | ||||
| 		{ | ||||
|  |  | |||
|  | @ -499,20 +499,22 @@ static size_t gifframe_size = 8192; | |||
| // converts an RGB frame to a frame with a palette.
 | ||||
| //
 | ||||
| #ifdef HWRENDER | ||||
| static colorlookup_t gif_colorlookup; | ||||
| 
 | ||||
| static void GIF_rgbconvert(UINT8 *linear, UINT8 *scr) | ||||
| { | ||||
| 	UINT8 r, g, b; | ||||
| 	size_t src = 0, dest = 0; | ||||
| 	size_t size = (vid.width * vid.height * 3); | ||||
| 
 | ||||
| 	InitColorLUT(gif_framepalette); | ||||
| 	InitColorLUT(&gif_colorlookup, gif_framepalette, true); | ||||
| 
 | ||||
| 	while (src < size) | ||||
| 	{ | ||||
| 		r = (UINT8)linear[src]; | ||||
| 		g = (UINT8)linear[src + 1]; | ||||
| 		b = (UINT8)linear[src + 2]; | ||||
| 		scr[dest] = colorlookup[r >> SHIFTCOLORBITS][g >> SHIFTCOLORBITS][b >> SHIFTCOLORBITS]; | ||||
| 		scr[dest] = GetColorLUTDirect(&gif_colorlookup, r, g, b); | ||||
| 		src += (3 * scrbuf_downscaleamt); | ||||
| 		dest += scrbuf_downscaleamt; | ||||
| 	} | ||||
|  |  | |||
							
								
								
									
										129
									
								
								src/m_cheat.c
									
										
									
									
									
								
							
							
						
						
									
										129
									
								
								src/m_cheat.c
									
										
									
									
									
								
							|  | @ -920,8 +920,8 @@ static void OP_CycleThings(INT32 amt) | |||
| 		states[S_OBJPLACE_DUMMY].frame = states[mobjinfo[op_currentthing].spawnstate].frame; | ||||
| 	} | ||||
| 	if (players[0].mo->eflags & MFE_VERTICALFLIP) // correct z when flipped
 | ||||
| 		players[0].mo->z += players[0].mo->height - mobjinfo[op_currentthing].height; | ||||
| 	players[0].mo->height = mobjinfo[op_currentthing].height; | ||||
| 		players[0].mo->z += players[0].mo->height - FixedMul(mobjinfo[op_currentthing].height, players[0].mo->scale); | ||||
| 	players[0].mo->height = FixedMul(mobjinfo[op_currentthing].height, players[0].mo->scale); | ||||
| 	P_SetPlayerMobjState(players[0].mo, S_OBJPLACE_DUMMY); | ||||
| 
 | ||||
| 	op_currentdoomednum = mobjinfo[op_currentthing].doomednum; | ||||
|  | @ -1004,6 +1004,11 @@ static mapthing_t *OP_CreateNewMapThing(player_t *player, UINT16 type, boolean c | |||
| 	mt->angle = (INT16)(FixedInt(AngleFixed(player->mo->angle))); | ||||
| 
 | ||||
| 	mt->options = (mt->z << ZSHIFT) | (UINT16)cv_opflags.value; | ||||
| 	mt->scale = player->mo->scale; | ||||
| 	mt->tag = 0; | ||||
| 	memset(mt->args, 0, NUMMAPTHINGARGS*sizeof(*mt->args)); | ||||
| 	memset(mt->stringargs, 0x00, NUMMAPTHINGSTRINGARGS*sizeof(*mt->stringargs)); | ||||
| 	mt->pitch = mt->roll = 0; | ||||
| 	return mt; | ||||
| } | ||||
| 
 | ||||
|  | @ -1040,13 +1045,13 @@ void OP_ObjectplaceMovement(player_t *player) | |||
| 		ticmiss++; | ||||
| 
 | ||||
| 	if (cmd->buttons & BT_ACCELERATE) | ||||
| 		player->mo->z += FRACUNIT*cv_speed.value; | ||||
| 		player->mo->z += player->mo->scale * cv_speed.value; | ||||
| 	else if (cmd->buttons & BT_BRAKE) | ||||
| 		player->mo->z -= FRACUNIT*cv_speed.value; | ||||
| 		player->mo->z -= player->mo->scale * cv_speed.value; | ||||
| 
 | ||||
| 	if (cmd->forwardmove != 0) | ||||
| 	{ | ||||
| 		P_Thrust(player->mo, player->mo->angle, (cmd->forwardmove*FRACUNIT/MAXPLMOVE)*cv_speed.value); | ||||
| 		P_Thrust(player->mo, player->mo->angle, (cmd->forwardmove*player->mo->scale/MAXPLMOVE)*cv_speed.value); | ||||
| 		P_TeleportMove(player->mo, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, player->mo->z); | ||||
| 		player->mo->momx = player->mo->momy = 0; | ||||
| 	} | ||||
|  | @ -1171,59 +1176,75 @@ void Command_ObjectPlace_f(void) | |||
| 	G_SetGameModified(multiplayer, true); | ||||
| 
 | ||||
| 	// Entering objectplace?
 | ||||
| 	if (!objectplacing) | ||||
| 	if (!objectplacing || COM_Argc() > 1) | ||||
| 	{ | ||||
| 		objectplacing = true; | ||||
| 
 | ||||
| 		if (!COM_CheckParm("-silent")) | ||||
| 		if (!objectplacing) | ||||
| 		{ | ||||
| 			HU_SetCEchoFlags(V_RETURN8|V_MONOSPACE); | ||||
| 			HU_SetCEchoDuration(10); | ||||
| 			HU_DoCEcho(va(M_GetText( | ||||
| 				"\\\\\\\\\\\\\\\\\\\\\\\\\x82" | ||||
| 				"   Objectplace Controls:   \x80\\\\" | ||||
| 				"     Drift: Cycle mapthings\\" | ||||
| 				"Accelerate: Float up       \\" | ||||
| 				"     Brake: Float down     \\" | ||||
| 				"      Item: Place object   \\"))); | ||||
| 			objectplacing = true; | ||||
| 
 | ||||
| 			if (players[0].powers[pw_carry] == CR_NIGHTSMODE) | ||||
| 				return; | ||||
| 
 | ||||
| 			if (!COM_CheckParm("-silent")) | ||||
| 			{ | ||||
| 				HU_SetCEchoFlags(V_RETURN8|V_MONOSPACE|V_AUTOFADEOUT); | ||||
| 				HU_SetCEchoDuration(10); | ||||
| 				HU_DoCEcho(va(M_GetText( | ||||
| 					"\\\\\\\\\\\\\\\\\\\\\\\\\x82" | ||||
| 					"   Objectplace Controls:   \x80\\\\" | ||||
| 					"Weapon Next/Prev: Cycle mapthings\\" | ||||
| 					"            Jump: Float up       \\" | ||||
| 					"            Spin: Float down     \\" | ||||
| 					"       Fire Ring: Place object   \\"))); | ||||
| 			} | ||||
| 
 | ||||
| 			// Save all the player's data.
 | ||||
| 			op_oldflags1 = players[0].mo->flags; | ||||
| 			op_oldflags2 = players[0].mo->flags2; | ||||
| 			op_oldeflags = players[0].mo->eflags; | ||||
| 			op_oldpflags = players[0].pflags; | ||||
| 			op_oldmomx = players[0].mo->momx; | ||||
| 			op_oldmomy = players[0].mo->momy; | ||||
| 			op_oldmomz = players[0].mo->momz; | ||||
| 			op_oldheight = players[0].mo->height; | ||||
| 			op_oldstate = S_KART_STILL; | ||||
| 			op_oldcolor = players[0].mo->color; // save color too in case of super/fireflower
 | ||||
| 
 | ||||
| 			// Remove ALL flags and motion.
 | ||||
| 			P_UnsetThingPosition(players[0].mo); | ||||
| 			players[0].pflags = 0; | ||||
| 			players[0].mo->flags2 = 0; | ||||
| 			players[0].mo->eflags = 0; | ||||
| 			players[0].mo->flags = (MF_NOCLIP|MF_NOGRAVITY|MF_NOBLOCKMAP); | ||||
| 			players[0].mo->momx = players[0].mo->momy = players[0].mo->momz = 0; | ||||
| 			P_SetThingPosition(players[0].mo); | ||||
| 
 | ||||
| 			// Take away color so things display properly
 | ||||
| 			players[0].mo->color = 0; | ||||
| 
 | ||||
| 			// Like the classics, recover from death by entering objectplace
 | ||||
| 			if (players[0].mo->health <= 0) | ||||
| 			{ | ||||
| 				players[0].mo->health = 1; | ||||
| 				players[0].deadtimer = 0; | ||||
| 				op_oldflags1 = mobjinfo[MT_PLAYER].flags; | ||||
| 				++players[0].lives; | ||||
| 				players[0].playerstate = PST_LIVE; | ||||
| 				P_RestoreMusic(&players[0]); | ||||
| 			} | ||||
| 			else | ||||
| 				op_oldstate = (statenum_t)(players[0].mo->state-states); | ||||
| 		} | ||||
| 
 | ||||
| 		// Save all the player's data.
 | ||||
| 		op_oldflags1 = players[0].mo->flags; | ||||
| 		op_oldflags2 = players[0].mo->flags2; | ||||
| 		op_oldeflags = players[0].mo->eflags; | ||||
| 		op_oldpflags = players[0].pflags; | ||||
| 		op_oldmomx = players[0].mo->momx; | ||||
| 		op_oldmomy = players[0].mo->momy; | ||||
| 		op_oldmomz = players[0].mo->momz; | ||||
| 		op_oldheight = players[0].mo->height; | ||||
| 		op_oldstate = S_KART_STILL; | ||||
| 		op_oldcolor = players[0].mo->color; // save color too in case of super/fireflower
 | ||||
| 
 | ||||
| 		// Remove ALL flags and motion.
 | ||||
| 		P_UnsetThingPosition(players[0].mo); | ||||
| 		players[0].pflags = 0; | ||||
| 		players[0].mo->flags2 = 0; | ||||
| 		players[0].mo->eflags = 0; | ||||
| 		players[0].mo->flags = (MF_NOCLIP|MF_NOGRAVITY|MF_NOBLOCKMAP); | ||||
| 		players[0].mo->momx = players[0].mo->momy = players[0].mo->momz = 0; | ||||
| 		P_SetThingPosition(players[0].mo); | ||||
| 
 | ||||
| 		// Take away color so things display properly
 | ||||
| 		players[0].mo->color = 0; | ||||
| 
 | ||||
| 		// Like the classics, recover from death by entering objectplace
 | ||||
| 		if (players[0].mo->health <= 0) | ||||
| 		if (COM_Argc() > 1) | ||||
| 		{ | ||||
| 			players[0].mo->health = 1; | ||||
| 			players[0].deadtimer = 0; | ||||
| 			op_oldflags1 = mobjinfo[MT_PLAYER].flags; | ||||
| 			++players[0].lives; | ||||
| 			players[0].playerstate = PST_LIVE; | ||||
| 			P_RestoreMusic(&players[0]); | ||||
| 			UINT16 mapthingnum = atoi(COM_Argv(1)); | ||||
| 			mobjtype_t type = P_GetMobjtype(mapthingnum); | ||||
| 			if (type == MT_UNKNOWN) | ||||
| 				CONS_Printf(M_GetText("No mobj type delegated to thing type %d.\n"), mapthingnum); | ||||
| 			else | ||||
| 				op_currentthing = type; | ||||
| 		} | ||||
| 		else | ||||
| 			op_oldstate = (statenum_t)(players[0].mo->state-states); | ||||
| 
 | ||||
| 		// If no thing set, then cycle a little
 | ||||
| 		if (!op_currentthing) | ||||
|  | @ -1231,8 +1252,8 @@ void Command_ObjectPlace_f(void) | |||
| 			op_currentthing = 1; | ||||
| 			OP_CycleThings(1); | ||||
| 		} | ||||
| 		else // Cycle things sets this for the former.
 | ||||
| 			players[0].mo->height = mobjinfo[op_currentthing].height; | ||||
| 		else | ||||
| 			OP_CycleThings(0); // sets all necessary height values without cycling op_currentthing
 | ||||
| 
 | ||||
| 		P_SetPlayerMobjState(players[0].mo, S_OBJPLACE_DUMMY); | ||||
| 	} | ||||
|  |  | |||
|  | @ -332,7 +332,7 @@ typedef struct menuitem_s | |||
| 	void *itemaction; | ||||
| 
 | ||||
| 	// hotkey in menu or y of the item
 | ||||
| 	UINT8 alphaKey; | ||||
| 	UINT16 alphaKey; | ||||
| } menuitem_t; | ||||
| 
 | ||||
| typedef struct menu_s | ||||
|  |  | |||
|  | @ -2861,11 +2861,11 @@ void A_Boss1Laser(mobj_t *actor) | |||
| 				z = actor->z + FixedMul(56*FRACUNIT, actor->scale); | ||||
| 			break; | ||||
| 		case 2: | ||||
| 			var2 = 3; // Fire middle laser
 | ||||
| 			var1 = locvar1; var2 = 3; // Fire middle laser
 | ||||
| 			A_Boss1Laser(actor); | ||||
| 			var2 = 0; // Fire left laser
 | ||||
| 			var1 = locvar1; var2 = 0; // Fire left laser
 | ||||
| 			A_Boss1Laser(actor); | ||||
| 			var2 = 1; // Fire right laser
 | ||||
| 			var1 = locvar1; var2 = 1; // Fire right laser
 | ||||
| 			A_Boss1Laser(actor); | ||||
| 			return; | ||||
| 			break; | ||||
|  | @ -8035,25 +8035,26 @@ void A_Dye(mobj_t *actor) | |||
| 	INT32 locvar2 = var2; | ||||
| 
 | ||||
| 	mobj_t *target = ((locvar1 && actor->target) ? actor->target : actor); | ||||
| 	UINT8 color = (UINT8)locvar2; | ||||
| 	UINT16 color = (UINT16)locvar2; | ||||
| 	if (LUA_CallAction("A_Dye", actor)) | ||||
| 		return; | ||||
| 	if (color >= numskincolors) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (!color) | ||||
| 		target->colorized = false; | ||||
| 	else | ||||
| 		target->colorized = true; | ||||
| 
 | ||||
| 	// What if it's a player?
 | ||||
| 	if (target->player) | ||||
| 	{ | ||||
| 		target->player->powers[pw_dye] = color; | ||||
| 		return; | ||||
| 	} | ||||
| 
 | ||||
| 	target->color = color; | ||||
| 	if (!color) | ||||
| 	{ | ||||
| 		target->colorized = false; | ||||
| 		target->color = target->player ? target->player->skincolor : SKINCOLOR_NONE; | ||||
| 	} | ||||
| 	else if (!(target->player)) | ||||
| 	{ | ||||
| 		target->colorized = true; | ||||
| 		target->color = color; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| // Function: A_MoveRelative
 | ||||
|  |  | |||
|  | @ -268,6 +268,8 @@ extern size_t iquehead, iquetail; | |||
| extern consvar_t cv_gravity, cv_movebob; | ||||
| 
 | ||||
| void P_RespawnBattleBoxes(void); | ||||
| mobjtype_t P_GetMobjtype(UINT16 mthingtype); | ||||
| 
 | ||||
| void P_RespawnSpecials(void); | ||||
| 
 | ||||
| mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type); | ||||
|  |  | |||
|  | @ -18,6 +18,7 @@ | |||
| #include "p_local.h" | ||||
| #include "r_main.h" | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "p_maputl.h" | ||||
| #include "p_polyobj.h" | ||||
| #include "p_slopes.h" | ||||
|  |  | |||
|  | @ -3732,7 +3732,7 @@ boolean P_SupermanLook4Players(mobj_t *actor) | |||
| 
 | ||||
| 	for (c = 0; c < MAXPLAYERS; c++) | ||||
| 	{ | ||||
| 		if (playeringame[c]) | ||||
| 		if (playeringame[c] && !players[c].spectator) | ||||
| 		{ | ||||
| 			if (players[c].pflags & PF_INVIS) | ||||
| 				continue; // ignore notarget
 | ||||
|  | @ -9951,7 +9951,7 @@ void P_RespawnBattleBoxes(void) | |||
|  * \param mthingtype Mapthing number in question. | ||||
|  * \return Mobj type; MT_UNKNOWN if nothing found. | ||||
|  */ | ||||
| static mobjtype_t P_GetMobjtype(UINT16 mthingtype) | ||||
| mobjtype_t P_GetMobjtype(UINT16 mthingtype) | ||||
| { | ||||
| 	mobjtype_t i; | ||||
| 	for (i = 0; i < NUMMOBJTYPES; i++) | ||||
|  |  | |||
|  | @ -22,6 +22,8 @@ | |||
| #include "p_setup.h" | ||||
| #include "p_saveg.h" | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "r_things.h" | ||||
| #include "r_skins.h" | ||||
| #include "r_state.h" | ||||
| #include "w_wad.h" | ||||
|  |  | |||
|  | @ -27,7 +27,8 @@ | |||
| 
 | ||||
| #include "r_data.h" | ||||
| #include "r_things.h" // for R_AddSpriteDefs | ||||
| #include "r_patch.h" | ||||
| #include "r_textures.h" | ||||
| #include "r_picformats.h" | ||||
| #include "r_sky.h" | ||||
| #include "r_draw.h" | ||||
| 
 | ||||
|  | @ -572,6 +573,8 @@ Ploadflat (levelflat_t *levelflat, const char *flatname, boolean resize) | |||
| 
 | ||||
| 	lumpnum_t    flatnum; | ||||
| 	int       texturenum; | ||||
| 	patch_t   *flatpatch; | ||||
| 	size_t    lumplength; | ||||
| 
 | ||||
| 	size_t i; | ||||
| 
 | ||||
|  | @ -628,7 +631,9 @@ texturefound: | |||
| 	{ | ||||
| flatfound: | ||||
| 		/* This could be a flat, patch, or PNG. */ | ||||
| 		if (R_CheckIfPatch(flatnum)) | ||||
| 		flatpatch = W_CacheLumpNum(flatnum, PU_CACHE); | ||||
| 		lumplength = W_LumpLength(flatnum); | ||||
| 		if (Picture_CheckIfPatch(flatpatch, lumplength)) | ||||
| 			levelflat->type = LEVELFLAT_PATCH; | ||||
| 		else | ||||
| 		{ | ||||
|  | @ -638,12 +643,14 @@ flatfound: | |||
| 			FIXME: Put this elsewhere. | ||||
| 			*/ | ||||
| 			W_ReadLumpHeader(flatnum, buffer, 8, 0); | ||||
| 			if (R_IsLumpPNG(buffer, W_LumpLength(flatnum))) | ||||
| 			if (Picture_IsLumpPNG(buffer, lumplength)) | ||||
| 				levelflat->type = LEVELFLAT_PNG; | ||||
| 			else | ||||
| #endif/*NO_PNG_LUMPS*/ | ||||
| 				levelflat->type = LEVELFLAT_FLAT;/* phew */ | ||||
| 		} | ||||
| 		if (flatpatch) | ||||
| 			Z_Free(flatpatch); | ||||
| 
 | ||||
| 		levelflat->u.flat.    lumpnum = flatnum; | ||||
| 		levelflat->u.flat.baselumpnum = LUMPERROR; | ||||
|  |  | |||
|  | @ -37,9 +37,7 @@ enum | |||
| 	LEVELFLAT_NONE,/* HOM time my friend */ | ||||
| 	LEVELFLAT_FLAT, | ||||
| 	LEVELFLAT_PATCH, | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 	LEVELFLAT_PNG, | ||||
| #endif | ||||
| 	LEVELFLAT_TEXTURE, | ||||
| }; | ||||
| 
 | ||||
|  | @ -72,15 +70,17 @@ typedef struct | |||
| 	u; | ||||
| 
 | ||||
| 	UINT16 width, height; | ||||
| 	fixed_t topoffset, leftoffset; | ||||
| 
 | ||||
| 	// for flat animation
 | ||||
| 	INT32 animseq; // start pos. in the anim sequence
 | ||||
| 	INT32 numpics; | ||||
| 	INT32 speed; | ||||
| 
 | ||||
| 	// for patchflats
 | ||||
| 	UINT8 *flatpatch; | ||||
| 	// for textures
 | ||||
| 	UINT8 *picture; | ||||
| #ifdef HWRENDER | ||||
| 	void *mipmap; | ||||
| #endif | ||||
| } levelflat_t; | ||||
| 
 | ||||
| extern size_t numlevelflats; | ||||
|  |  | |||
|  | @ -20,6 +20,7 @@ | |||
| #include "p_local.h" | ||||
| #include "p_setup.h" // levelflats for flat animation | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "m_random.h" | ||||
| #include "p_mobj.h" | ||||
| #include "i_system.h" | ||||
|  | @ -1697,7 +1698,7 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller | |||
| 		case 336: // object dye - once
 | ||||
| 			{ | ||||
| 				INT32 triggercolor = (INT32)sides[triggerline->sidenum[0]].toptexture; | ||||
| 				UINT8 color = (actor->player ? actor->player->powers[pw_dye] : actor->color); | ||||
| 				UINT16 color = (actor->player ? actor->player->powers[pw_dye] : actor->color); | ||||
| 				boolean invert = (triggerline->flags & ML_NOCLIMB ? true : false); | ||||
| 
 | ||||
| 				if (invert ^ (triggercolor != color)) | ||||
|  | @ -4422,7 +4423,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers | |||
| 	// Ignore dead players.
 | ||||
| 	// If this strange phenomenon could be potentially used in levels,
 | ||||
| 	// TODO: modify this to accommodate for it.
 | ||||
| 	if (player->playerstate == PST_DEAD) | ||||
| 	if (player->playerstate != PST_LIVE) | ||||
| 		return; | ||||
| 
 | ||||
| 	// Conveyor stuff
 | ||||
|  |  | |||
							
								
								
									
										1467
									
								
								src/r_data.c
									
										
									
									
									
								
							
							
						
						
									
										1467
									
								
								src/r_data.c
									
										
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										93
									
								
								src/r_data.h
									
										
									
									
									
								
							
							
						
						
									
										93
									
								
								src/r_data.h
									
										
									
									
									
								
							|  | @ -22,6 +22,14 @@ | |||
| #pragma interface | ||||
| #endif | ||||
| 
 | ||||
| // Store lists of lumps for F_START/F_END etc.
 | ||||
| typedef struct | ||||
| { | ||||
| 	UINT16 wadfile; | ||||
| 	UINT16 firstlump; | ||||
| 	size_t numlumps; | ||||
| } lumplist_t; | ||||
| 
 | ||||
| // Possible alpha types for a patch.
 | ||||
| enum patchalphastyle {AST_COPY, AST_TRANSLUCENT, AST_ADD, AST_SUBTRACT, AST_REVERSESUBTRACT, AST_MODULATE, AST_OVERLAY}; | ||||
| 
 | ||||
|  | @ -31,98 +39,18 @@ UINT8 ASTBlendPaletteIndexes(UINT8 background, UINT8 foreground, int style, UINT | |||
| 
 | ||||
| extern INT32 ASTTextureBlendingThreshold[2]; | ||||
| 
 | ||||
| UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b); | ||||
| 
 | ||||
| // moved here for r_sky.c (texpatch_t is used)
 | ||||
| 
 | ||||
| // A single patch from a texture definition,
 | ||||
| //  basically a rectangular area within
 | ||||
| //  the texture rectangle.
 | ||||
| typedef struct | ||||
| { | ||||
| 	// Block origin (always UL), which has already accounted for the internal origin of the patch.
 | ||||
| 	INT16 originx, originy; | ||||
| 	UINT16 wad, lump; | ||||
| 	UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both
 | ||||
| 	UINT8 alpha; // Translucency value
 | ||||
| 	enum patchalphastyle style; | ||||
| } texpatch_t; | ||||
| 
 | ||||
| // texture type
 | ||||
| enum | ||||
| { | ||||
| 	TEXTURETYPE_UNKNOWN, | ||||
| 	TEXTURETYPE_SINGLEPATCH, | ||||
| 	TEXTURETYPE_COMPOSITE, | ||||
| #ifdef WALLFLATS | ||||
| 	TEXTURETYPE_FLAT, | ||||
| #endif | ||||
| }; | ||||
| 
 | ||||
| // A maptexturedef_t describes a rectangular texture,
 | ||||
| //  which is composed of one or more mappatch_t structures
 | ||||
| //  that arrange graphic patches.
 | ||||
| typedef struct | ||||
| { | ||||
| 	// Keep name for switch changing, etc.
 | ||||
| 	char name[8]; | ||||
| 	UINT8 type; // TEXTURETYPE_
 | ||||
| 	INT16 width, height; | ||||
| 	boolean holes; | ||||
| 	UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both
 | ||||
| 
 | ||||
| 	// All the patches[patchcount] are drawn back to front into the cached texture.
 | ||||
| 	INT16 patchcount; | ||||
| 	texpatch_t patches[0]; | ||||
| } texture_t; | ||||
| 
 | ||||
| typedef struct | ||||
| { | ||||
| 	UINT8 *flat; | ||||
| 	INT16 width, height; | ||||
| } textureflat_t; | ||||
| 
 | ||||
| // all loaded and prepared textures from the start of the game
 | ||||
| extern texture_t **textures; | ||||
| extern textureflat_t *texflats; | ||||
| 
 | ||||
| extern INT32 *texturewidth; | ||||
| extern fixed_t *textureheight; // needed for texture pegging
 | ||||
| 
 | ||||
| extern INT16 color8to16[256]; // remap color index to highcolor
 | ||||
| extern INT16 *hicolormaps; // remap high colors to high colors..
 | ||||
| 
 | ||||
| extern CV_PossibleValue_t Color_cons_t[]; | ||||
| extern CV_PossibleValue_t Followercolor_cons_t[];	// follower colours table, not a duplicate because of the "Match" option.
 | ||||
| 
 | ||||
| // Load TEXTURES definitions, create lookup tables
 | ||||
| void R_LoadTextures(void); | ||||
| void R_FlushTextureCache(void); | ||||
| 
 | ||||
| INT32 R_GetTextureNum(INT32 texnum); | ||||
| void R_CheckTextureCache(INT32 tex); | ||||
| 
 | ||||
| // Retrieve column data for span blitting.
 | ||||
| UINT8 *R_GetColumn(fixed_t tex, INT32 col); | ||||
| UINT8 *R_GetFlat(lumpnum_t flatnum); | ||||
| 
 | ||||
| // I/O, setting up the stuff.
 | ||||
| void R_InitData(void); | ||||
| void R_PrecacheLevel(void); | ||||
| 
 | ||||
| extern size_t flatmemory, spritememory, texturememory; | ||||
| 
 | ||||
| // Retrieval.
 | ||||
| // Floor/ceiling opaque texture tiles,
 | ||||
| // lookup by name. For animation?
 | ||||
| lumpnum_t R_GetFlatNumForName(const char *name); | ||||
| 
 | ||||
| // Called by P_Ticker for switches and animations,
 | ||||
| // returns the texture number for the texture name.
 | ||||
| void R_ClearTextureNumCache(boolean btell); | ||||
| INT32 R_TextureNumForName(const char *name); | ||||
| INT32 R_CheckTextureNumForName(const char *name); | ||||
| 
 | ||||
| // Extra Colormap lumps (C_START/C_END) are not used anywhere
 | ||||
| // Uncomment to enable
 | ||||
| //#define EXTRACOLORMAPLUMPS
 | ||||
|  | @ -196,9 +124,4 @@ const char *R_NameForColormap(extracolormap_t *extra_colormap); | |||
| UINT8 NearestPaletteColor(UINT8 r, UINT8 g, UINT8 b, RGBA_t *palette); | ||||
| #define NearestColor(r, g, b) NearestPaletteColor(r, g, b, NULL) | ||||
| 
 | ||||
| UINT8 NearestPaletteColor(UINT8 r, UINT8 g, UINT8 b, RGBA_t *palette); | ||||
| #define NearestColor(r, g, b) NearestPaletteColor(r, g, b, NULL) | ||||
| 
 | ||||
| extern INT32 numtextures; | ||||
| 
 | ||||
| #endif | ||||
|  |  | |||
|  | @ -31,6 +31,7 @@ | |||
| #include "r_plane.h" | ||||
| #include "r_sky.h" | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "r_things.h" | ||||
| #include "r_draw.h" | ||||
| 
 | ||||
|  |  | |||
							
								
								
									
										19
									
								
								src/r_main.c
									
										
									
									
									
								
							
							
						
						
									
										19
									
								
								src/r_main.c
									
										
									
									
									
								
							|  | @ -106,7 +106,9 @@ extracolormap_t *extra_colormaps = NULL; | |||
| // Render stats
 | ||||
| int rs_prevframetime = 0; | ||||
| int rs_rendercalltime = 0; | ||||
| int rs_uitime = 0; | ||||
| int rs_swaptime = 0; | ||||
| int rs_tictime = 0; | ||||
| 
 | ||||
| int rs_bsptime = 0; | ||||
| 
 | ||||
|  | @ -1151,15 +1153,22 @@ subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y) | |||
| // recalc necessary stuff for mouseaiming
 | ||||
| // slopes are already calculated for the full possible view (which is 4*viewheight).
 | ||||
| // 18/08/18: (No it's actually 16*viewheight, thanks Jimita for finding this out)
 | ||||
| static void R_SetupFreelook(void) | ||||
| static void R_SetupFreelook(player_t *player, boolean skybox) | ||||
| { | ||||
| 	INT32 dy = 0; | ||||
| 
 | ||||
| #ifndef HWRENDER | ||||
| 	(void)player; | ||||
| 	(void)skybox; | ||||
| #endif | ||||
| 
 | ||||
| 	// clip it in the case we are looking a hardware 90 degrees full aiming
 | ||||
| 	// (lmps, network and use F12...)
 | ||||
| 	if (rendermode == render_soft | ||||
| #ifdef HWRENDER | ||||
| 		|| cv_glshearing.value | ||||
| 		|| (rendermode == render_opengl | ||||
| 			&& (cv_glshearing.value == 1 | ||||
| 			|| (cv_glshearing.value == 2 && R_IsViewpointThirdPerson(player, skybox)))) | ||||
| #endif | ||||
| 		) | ||||
| 	{ | ||||
|  | @ -1274,7 +1283,7 @@ void R_SetupFrame(player_t *player) | |||
| 	viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); | ||||
| 	viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); | ||||
| 
 | ||||
| 	R_SetupFreelook(); | ||||
| 	R_SetupFreelook(player, false); | ||||
| } | ||||
| 
 | ||||
| void R_SkyboxFrame(player_t *player) | ||||
|  | @ -1415,7 +1424,7 @@ void R_SkyboxFrame(player_t *player) | |||
| 	viewsin = FINESINE(viewangle>>ANGLETOFINESHIFT); | ||||
| 	viewcos = FINECOSINE(viewangle>>ANGLETOFINESHIFT); | ||||
| 
 | ||||
| 	R_SetupFreelook(); | ||||
| 	R_SetupFreelook(player, true); | ||||
| } | ||||
| 
 | ||||
| boolean R_ViewpointHasChasecam(player_t *player) | ||||
|  | @ -1648,7 +1657,6 @@ void R_RenderPlayerView(void) | |||
| 	free(masks); | ||||
| } | ||||
| 
 | ||||
| // Lactozilla: Renderer switching
 | ||||
| #ifdef HWRENDER | ||||
| void R_InitHardwareMode(void) | ||||
| { | ||||
|  | @ -1662,7 +1670,6 @@ void R_InitHardwareMode(void) | |||
| 
 | ||||
| void R_ReloadHUDGraphics(void) | ||||
| { | ||||
| 	CONS_Debug(DBG_RENDER, "R_ReloadHUDGraphics()...\n"); | ||||
| 	ST_LoadGraphics(); | ||||
| 	HU_LoadGraphics(); | ||||
| 	ST_ReloadSkinFaceGraphics(); | ||||
|  |  | |||
|  | @ -16,6 +16,7 @@ | |||
| 
 | ||||
| #include "d_player.h" | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| 
 | ||||
| //
 | ||||
| // POV related.
 | ||||
|  | @ -80,7 +81,9 @@ extern consvar_t cv_renderstats; | |||
| 
 | ||||
| extern int rs_prevframetime;// time when previous frame was rendered
 | ||||
| extern int rs_rendercalltime; | ||||
| extern int rs_uitime; | ||||
| extern int rs_swaptime; | ||||
| extern int rs_tictime; | ||||
| 
 | ||||
| extern int rs_bsptime; | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,74 +0,0 @@ | |||
| // SONIC ROBO BLAST 2
 | ||||
| //-----------------------------------------------------------------------------
 | ||||
| // Copyright (C) 1993-1996 by id Software, Inc.
 | ||||
| // Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos.
 | ||||
| // Copyright (C) 2019-2020 by Sonic Team Junior.
 | ||||
| //
 | ||||
| // This program is free software distributed under the
 | ||||
| // terms of the GNU General Public License, version 2.
 | ||||
| // See the 'LICENSE' file for more details.
 | ||||
| //-----------------------------------------------------------------------------
 | ||||
| /// \file  r_patch.h
 | ||||
| /// \brief Patch generation.
 | ||||
| 
 | ||||
| #ifndef __R_PATCH__ | ||||
| #define __R_PATCH__ | ||||
| 
 | ||||
| #include "r_defs.h" | ||||
| #include "doomdef.h" | ||||
| 
 | ||||
| // Structs
 | ||||
| typedef enum | ||||
| { | ||||
| 	ROTAXIS_X, // Roll (the default)
 | ||||
| 	ROTAXIS_Y, // Pitch
 | ||||
| 	ROTAXIS_Z  // Yaw
 | ||||
| } rotaxis_t; | ||||
| 
 | ||||
| typedef struct | ||||
| { | ||||
| 	INT32 x, y; | ||||
| 	rotaxis_t rotaxis; | ||||
| } spriteframepivot_t; | ||||
| 
 | ||||
| typedef struct | ||||
| { | ||||
| 	spriteframepivot_t pivot[64]; | ||||
| 	boolean available; | ||||
| } spriteinfo_t; | ||||
| 
 | ||||
| // Conversions between patches / flats / textures...
 | ||||
| boolean R_CheckIfPatch(lumpnum_t lump); | ||||
| void R_TextureToFlat(size_t tex, UINT8 *flat); | ||||
| void R_PatchToFlat(patch_t *patch, UINT8 *flat); | ||||
| void R_PatchToMaskedFlat(patch_t *patch, UINT16 *raw, boolean flip); | ||||
| patch_t *R_FlatToPatch(UINT8 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize, boolean transparency); | ||||
| patch_t *R_MaskedFlatToPatch(UINT16 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize); | ||||
| 
 | ||||
| // Portable Network Graphics
 | ||||
| boolean R_IsLumpPNG(const UINT8 *d, size_t s); | ||||
| #define W_ThrowPNGError(lumpname, wadfilename) I_Error("W_Wad: Lump \"%s\" in file \"%s\" is a .png - please convert to either Doom or Flat (raw) image format.", lumpname, wadfilename); // Fears Of LJ Sonic
 | ||||
| 
 | ||||
| #ifndef NO_PNG_LUMPS | ||||
| UINT8 *R_PNGToFlat(UINT16 *width, UINT16 *height, UINT8 *png, size_t size); | ||||
| patch_t *R_PNGToPatch(const UINT8 *png, size_t size, size_t *destsize); | ||||
| boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size); | ||||
| #endif | ||||
| 
 | ||||
| // SpriteInfo
 | ||||
| extern spriteinfo_t spriteinfo[NUMSPRITES]; | ||||
| void R_LoadSpriteInfoLumps(UINT16 wadnum, UINT16 numlumps); | ||||
| void R_ParseSPRTINFOLump(UINT16 wadNum, UINT16 lumpNum); | ||||
| 
 | ||||
| // Sprite rotation
 | ||||
| #ifdef ROTSPRITE | ||||
| INT32 R_GetRollAngle(angle_t rollangle); | ||||
| void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, spriteframe_t *sprframe, INT32 rot, UINT8 flip); | ||||
| void R_FreeSingleRotSprite(spritedef_t *spritedef); | ||||
| void R_FreeSkinRotSprite(size_t skinnum); | ||||
| extern fixed_t rollcosang[ROTANGLES]; | ||||
| extern fixed_t rollsinang[ROTANGLES]; | ||||
| void R_FreeAllRotSprite(void); | ||||
| #endif | ||||
| 
 | ||||
| #endif // __R_PATCH__
 | ||||
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										134
									
								
								src/r_picformats.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										134
									
								
								src/r_picformats.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,134 @@ | |||
| // SONIC ROBO BLAST 2
 | ||||
| //-----------------------------------------------------------------------------
 | ||||
| // Copyright (C) 1993-1996 by id Software, Inc.
 | ||||
| // Copyright (C) 2018-2020 by Jaime "Lactozilla" Passos.
 | ||||
| // Copyright (C) 2019-2020 by Sonic Team Junior.
 | ||||
| //
 | ||||
| // This program is free software distributed under the
 | ||||
| // terms of the GNU General Public License, version 2.
 | ||||
| // See the 'LICENSE' file for more details.
 | ||||
| //-----------------------------------------------------------------------------
 | ||||
| /// \file  r_picformats.h
 | ||||
| /// \brief Patch generation.
 | ||||
| 
 | ||||
| #ifndef __R_PICFORMATS__ | ||||
| #define __R_PICFORMATS__ | ||||
| 
 | ||||
| #include "r_defs.h" | ||||
| #include "doomdef.h" | ||||
| 
 | ||||
| typedef enum | ||||
| { | ||||
| 	PICFMT_NONE = 0, | ||||
| 
 | ||||
| 	// Doom formats
 | ||||
| 	PICFMT_PATCH, | ||||
| 	PICFMT_FLAT, | ||||
| 
 | ||||
| 	// PNG
 | ||||
| 	PICFMT_PNG, | ||||
| 
 | ||||
| 	// 16bpp
 | ||||
| 	PICFMT_PATCH16, | ||||
| 	PICFMT_FLAT16, | ||||
| 
 | ||||
| 	// 32bpp
 | ||||
| 	PICFMT_PATCH32, | ||||
| 	PICFMT_FLAT32 | ||||
| } pictureformat_t; | ||||
| 
 | ||||
| typedef enum | ||||
| { | ||||
| 	PICFLAGS_XFLIP = 1, | ||||
| 	PICFLAGS_YFLIP = 1<<1 | ||||
| } pictureflags_t; | ||||
| 
 | ||||
| enum | ||||
| { | ||||
| 	PICDEPTH_NONE = 0, | ||||
| 	PICDEPTH_8BPP = 8, | ||||
| 	PICDEPTH_16BPP = 16, | ||||
| 	PICDEPTH_32BPP = 32 | ||||
| }; | ||||
| 
 | ||||
| void *Picture_Convert( | ||||
| 	pictureformat_t informat, void *picture, pictureformat_t outformat, | ||||
| 	size_t insize, size_t *outsize, | ||||
| 	INT32 inwidth, INT32 inheight, INT32 inleftoffset, INT32 intopoffset, | ||||
| 	pictureflags_t flags); | ||||
| 
 | ||||
| void *Picture_PatchConvert( | ||||
| 	pictureformat_t informat, void *picture, pictureformat_t outformat, | ||||
| 	size_t insize, size_t *outsize, | ||||
| 	INT16 inwidth, INT16 inheight, INT16 inleftoffset, INT16 intopoffset, | ||||
| 	pictureflags_t flags); | ||||
| void *Picture_FlatConvert( | ||||
| 	pictureformat_t informat, void *picture, pictureformat_t outformat, | ||||
| 	size_t insize, size_t *outsize, | ||||
| 	INT16 inwidth, INT16 inheight, INT16 inleftoffset, INT16 intopoffset, | ||||
| 	pictureflags_t flags); | ||||
| void *Picture_GetPatchPixel( | ||||
| 	patch_t *patch, pictureformat_t informat, | ||||
| 	INT32 x, INT32 y, | ||||
| 	pictureflags_t flags); | ||||
| 
 | ||||
| void *Picture_TextureToFlat(size_t trickytex); | ||||
| 
 | ||||
| INT32 Picture_FormatBPP(pictureformat_t format); | ||||
| boolean Picture_IsPatchFormat(pictureformat_t format); | ||||
| boolean Picture_IsFlatFormat(pictureformat_t format); | ||||
| boolean Picture_CheckIfPatch(patch_t *patch, size_t size); | ||||
| 
 | ||||
| // Structs
 | ||||
| typedef enum | ||||
| { | ||||
| 	ROTAXIS_X, // Roll (the default)
 | ||||
| 	ROTAXIS_Y, // Pitch
 | ||||
| 	ROTAXIS_Z  // Yaw
 | ||||
| } rotaxis_t; | ||||
| 
 | ||||
| typedef struct | ||||
| { | ||||
| 	INT32 x, y; | ||||
| 	rotaxis_t rotaxis; | ||||
| } spriteframepivot_t; | ||||
| 
 | ||||
| typedef struct | ||||
| { | ||||
| 	spriteframepivot_t pivot[64]; | ||||
| 	boolean available; | ||||
| } spriteinfo_t; | ||||
| 
 | ||||
| // Portable Network Graphics
 | ||||
| boolean Picture_IsLumpPNG(const UINT8 *d, size_t s); | ||||
| #define Picture_ThrowPNGError(lumpname, wadfilename) I_Error("W_Wad: Lump \"%s\" in file \"%s\" is a .png - please convert to either Doom or Flat (raw) image format.", lumpname, wadfilename); // Fears Of LJ Sonic
 | ||||
| 
 | ||||
| #ifndef NO_PNG_LUMPS | ||||
| void *Picture_PNGConvert( | ||||
| 	const UINT8 *png, pictureformat_t outformat, | ||||
| 	INT32 *w, INT32 *h, | ||||
| 	INT16 *topoffset, INT16 *leftoffset, | ||||
| 	size_t insize, size_t *outsize, | ||||
| 	pictureflags_t flags); | ||||
| boolean Picture_PNGDimensions(UINT8 *png, INT32 *width, INT32 *height, INT16 *topoffset, INT16 *leftoffset, size_t size); | ||||
| #endif | ||||
| 
 | ||||
| #define PICTURE_PNG_USELOOKUP | ||||
| 
 | ||||
| // SpriteInfo
 | ||||
| extern spriteinfo_t spriteinfo[NUMSPRITES]; | ||||
| void R_LoadSpriteInfoLumps(UINT16 wadnum, UINT16 numlumps); | ||||
| void R_ParseSPRTINFOLump(UINT16 wadNum, UINT16 lumpNum); | ||||
| 
 | ||||
| // Sprite rotation
 | ||||
| #ifdef ROTSPRITE | ||||
| INT32 R_GetRollAngle(angle_t rollangle); | ||||
| void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, spriteframe_t *sprframe, INT32 rot, UINT8 flip); | ||||
| void R_FreeSingleRotSprite(spritedef_t *spritedef); | ||||
| void R_FreeSkinRotSprite(size_t skinnum); | ||||
| extern fixed_t rollcosang[ROTANGLES]; | ||||
| extern fixed_t rollsinang[ROTANGLES]; | ||||
| void R_FreeAllRotSprite(void); | ||||
| #endif | ||||
| 
 | ||||
| #endif // __R_PATCH__
 | ||||
							
								
								
									
										209
									
								
								src/r_plane.c
									
										
									
									
									
								
							
							
						
						
									
										209
									
								
								src/r_plane.c
									
										
									
									
									
								
							|  | @ -19,6 +19,7 @@ | |||
| #include "p_setup.h" // levelflats | ||||
| #include "p_slopes.h" | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "r_local.h" | ||||
| #include "r_state.h" | ||||
| #include "r_splats.h" // faB(21jan):testing | ||||
|  | @ -650,188 +651,6 @@ static void R_DrawSkyPlane(visplane_t *pl) | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| //
 | ||||
| // R_CheckPowersOfTwo
 | ||||
| //
 | ||||
| // Self-explanatory?
 | ||||
| //
 | ||||
| boolean R_CheckPowersOfTwo(void) | ||||
| { | ||||
| 	boolean wpow2 = (!(ds_flatwidth & (ds_flatwidth - 1))); | ||||
| 	boolean hpow2 = (!(ds_flatheight & (ds_flatheight - 1))); | ||||
| 
 | ||||
| 	// Initially, the flat isn't powers-of-two-sized.
 | ||||
| 	ds_powersoftwo = false; | ||||
| 
 | ||||
| 	// But if the width and height are powers of two,
 | ||||
| 	// and are EQUAL, then it's okay :]
 | ||||
| 	if ((ds_flatwidth == ds_flatheight) && (wpow2 && hpow2)) | ||||
| 		ds_powersoftwo = true; | ||||
| 
 | ||||
| 	// Just return ds_powersoftwo.
 | ||||
| 	return ds_powersoftwo; | ||||
| } | ||||
| 
 | ||||
| //
 | ||||
| // R_CheckFlatLength
 | ||||
| //
 | ||||
| // Determine the flat's dimensions from the lump length.
 | ||||
| //
 | ||||
| void R_CheckFlatLength(size_t size) | ||||
| { | ||||
| 	switch (size) | ||||
| 	{ | ||||
| 		case 4194304: // 2048x2048 lump
 | ||||
| 			nflatmask = 0x3FF800; | ||||
| 			nflatxshift = 21; | ||||
| 			nflatyshift = 10; | ||||
| 			nflatshiftup = 5; | ||||
| 			ds_flatwidth = ds_flatheight = 2048; | ||||
| 			break; | ||||
| 		case 1048576: // 1024x1024 lump
 | ||||
| 			nflatmask = 0xFFC00; | ||||
| 			nflatxshift = 22; | ||||
| 			nflatyshift = 12; | ||||
| 			nflatshiftup = 6; | ||||
| 			ds_flatwidth = ds_flatheight = 1024; | ||||
| 			break; | ||||
| 		case 262144:// 512x512 lump
 | ||||
| 			nflatmask = 0x3FE00; | ||||
| 			nflatxshift = 23; | ||||
| 			nflatyshift = 14; | ||||
| 			nflatshiftup = 7; | ||||
| 			ds_flatwidth = ds_flatheight = 512; | ||||
| 			break; | ||||
| 		case 65536: // 256x256 lump
 | ||||
| 			nflatmask = 0xFF00; | ||||
| 			nflatxshift = 24; | ||||
| 			nflatyshift = 16; | ||||
| 			nflatshiftup = 8; | ||||
| 			ds_flatwidth = ds_flatheight = 256; | ||||
| 			break; | ||||
| 		case 16384: // 128x128 lump
 | ||||
| 			nflatmask = 0x3F80; | ||||
| 			nflatxshift = 25; | ||||
| 			nflatyshift = 18; | ||||
| 			nflatshiftup = 9; | ||||
| 			ds_flatwidth = ds_flatheight = 128; | ||||
| 			break; | ||||
| 		case 1024: // 32x32 lump
 | ||||
| 			nflatmask = 0x3E0; | ||||
| 			nflatxshift = 27; | ||||
| 			nflatyshift = 22; | ||||
| 			nflatshiftup = 11; | ||||
| 			ds_flatwidth = ds_flatheight = 32; | ||||
| 			break; | ||||
| 		default: // 64x64 lump
 | ||||
| 			nflatmask = 0xFC0; | ||||
| 			nflatxshift = 26; | ||||
| 			nflatyshift = 20; | ||||
| 			nflatshiftup = 10; | ||||
| 			ds_flatwidth = ds_flatheight = 64; | ||||
| 			break; | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| //
 | ||||
| // R_GenerateFlat
 | ||||
| //
 | ||||
| // Generate a flat from specified width and height.
 | ||||
| //
 | ||||
| static UINT8 *R_GenerateFlat(UINT16 width, UINT16 height) | ||||
| { | ||||
| 	UINT8 *flat = Z_Malloc(width * height, PU_LEVEL, NULL); | ||||
| 	memset(flat, TRANSPARENTPIXEL, width * height); | ||||
| 	return flat; | ||||
| } | ||||
| 
 | ||||
| //
 | ||||
| // R_GetTextureFlat
 | ||||
| //
 | ||||
| // Convert a texture or patch to a flat.
 | ||||
| //
 | ||||
| static UINT8 *R_GetTextureFlat(levelflat_t *levelflat, boolean leveltexture, boolean ispng) | ||||
| { | ||||
| 	UINT8 *flat; | ||||
| 	textureflat_t *texflat = &texflats[levelflat->u.texture.num]; | ||||
| 	patch_t *patch = NULL; | ||||
| 	boolean texturechanged = (leveltexture ? (levelflat->u.texture.num != levelflat->u.texture.lastnum) : false); | ||||
| 
 | ||||
| 	(void)ispng; | ||||
| 
 | ||||
| 	// Check if the texture changed.
 | ||||
| 	if (leveltexture && (!texturechanged)) | ||||
| 	{ | ||||
| 		if (texflat != NULL && texflat->flat) | ||||
| 		{ | ||||
| 			flat = texflat->flat; | ||||
| 			ds_flatwidth = texflat->width; | ||||
| 			ds_flatheight = texflat->height; | ||||
| 			texturechanged = false; | ||||
| 		} | ||||
| 		else | ||||
| 			texturechanged = true; | ||||
| 	} | ||||
| 
 | ||||
| 	// If the texture changed, or the patch doesn't exist, convert either of them to a flat.
 | ||||
| 	if (levelflat->flatpatch == NULL || texturechanged) | ||||
| 	{ | ||||
| 		// Level texture
 | ||||
| 		if (leveltexture) | ||||
| 		{ | ||||
| 			texture_t *texture = textures[levelflat->u.texture.num]; | ||||
| 			texflat->width = ds_flatwidth = texture->width; | ||||
| 			texflat->height = ds_flatheight = texture->height; | ||||
| 
 | ||||
| 			texflat->flat = R_GenerateFlat(ds_flatwidth, ds_flatheight); | ||||
| 			R_TextureToFlat(levelflat->u.texture.num, texflat->flat); | ||||
| 			flat = texflat->flat; | ||||
| 
 | ||||
| 			levelflat->flatpatch = flat; | ||||
| 			levelflat->width = ds_flatwidth; | ||||
| 			levelflat->height = ds_flatheight; | ||||
| 		} | ||||
| 		// Patch (never happens yet)
 | ||||
| 		else | ||||
| 		{ | ||||
| 			patch = (patch_t *)ds_source; | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 			if (ispng) | ||||
| 			{ | ||||
| 				levelflat->flatpatch = R_PNGToFlat(&levelflat->width, &levelflat->height, ds_source, W_LumpLength(levelflat->u.flat.lumpnum)); | ||||
| 				levelflat->topoffset = levelflat->leftoffset = 0; | ||||
| 				ds_flatwidth = levelflat->width; | ||||
| 				ds_flatheight = levelflat->height; | ||||
| 			} | ||||
| 			else | ||||
| #endif | ||||
| 			{ | ||||
| 				levelflat->width = ds_flatwidth = SHORT(patch->width); | ||||
| 				levelflat->height = ds_flatheight = SHORT(patch->height); | ||||
| 
 | ||||
| 				levelflat->topoffset = patch->topoffset * FRACUNIT; | ||||
| 				levelflat->leftoffset = patch->leftoffset * FRACUNIT; | ||||
| 
 | ||||
| 				levelflat->flatpatch = R_GenerateFlat(ds_flatwidth, ds_flatheight); | ||||
| 				R_PatchToFlat(patch, levelflat->flatpatch); | ||||
| 			} | ||||
| 			flat = levelflat->flatpatch; | ||||
| 		} | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| 		flat = levelflat->flatpatch; | ||||
| 		ds_flatwidth = levelflat->width; | ||||
| 		ds_flatheight = levelflat->height; | ||||
| 	} | ||||
| 
 | ||||
| 	xoffs += levelflat->leftoffset; | ||||
| 	yoffs += levelflat->topoffset; | ||||
| 
 | ||||
| 	levelflat->u.texture.lastnum = levelflat->u.texture.num; | ||||
| 	return flat; | ||||
| } | ||||
| 
 | ||||
| static void R_SlopeVectors(visplane_t *pl, INT32 i, float fudge) | ||||
| { | ||||
| 	// Potentially override other stuff for now cus we're mean. :< But draw a slope plane!
 | ||||
|  | @ -925,12 +744,11 @@ d.z = (v1.x * v2.y) - (v1.y * v2.x) | |||
| 
 | ||||
| void R_DrawSinglePlane(visplane_t *pl) | ||||
| { | ||||
| 	UINT8 *flat; | ||||
| 	levelflat_t *levelflat; | ||||
| 	INT32 light = 0; | ||||
| 	INT32 x; | ||||
| 	INT32 stop, angle; | ||||
| 	ffloor_t *rover; | ||||
| 	levelflat_t *levelflat; | ||||
| 	int type; | ||||
| 	int spanfunctype = BASEDRAWFUNC; | ||||
| 
 | ||||
|  | @ -1118,30 +936,15 @@ void R_DrawSinglePlane(visplane_t *pl) | |||
| 		case LEVELFLAT_NONE: | ||||
| 			return; | ||||
| 		case LEVELFLAT_FLAT: | ||||
| 			ds_source = W_CacheLumpNum(levelflat->u.flat.lumpnum, PU_CACHE); | ||||
| 			ds_source = (UINT8 *)R_GetFlat(levelflat->u.flat.lumpnum); | ||||
| 			R_CheckFlatLength(W_LumpLength(levelflat->u.flat.lumpnum)); | ||||
| 			// Raw flats always have dimensions that are powers-of-two numbers.
 | ||||
| 			ds_powersoftwo = true; | ||||
| 			break; | ||||
| 		default: | ||||
| 			switch (type) | ||||
| 			{ | ||||
| 				case LEVELFLAT_TEXTURE: | ||||
| 					/* Textures get cached differently and don't need ds_source */ | ||||
| 					ds_source = R_GetTextureFlat(levelflat, true, false); | ||||
| 					break; | ||||
| 				default: | ||||
| 					ds_source = W_CacheLumpNum(levelflat->u.flat.lumpnum, PU_STATIC); | ||||
| 					flat      = R_GetTextureFlat(levelflat, false, | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 							( type == LEVELFLAT_PNG ) | ||||
| #else | ||||
| 							false | ||||
| #endif | ||||
| 					); | ||||
| 					Z_ChangeTag(ds_source, PU_CACHE); | ||||
| 					ds_source = flat; | ||||
| 			} | ||||
| 			ds_source = (UINT8 *)R_GetLevelFlat(levelflat); | ||||
| 			if (!ds_source) | ||||
| 				return; | ||||
| 			// Check if this texture or patch has power-of-two dimensions.
 | ||||
| 			if (R_CheckPowersOfTwo()) | ||||
| 				R_CheckFlatLength(ds_flatwidth * ds_flatheight); | ||||
|  |  | |||
|  | @ -16,6 +16,7 @@ | |||
| 
 | ||||
| #include "screen.h" // needs MAXVIDWIDTH/MAXVIDHEIGHT | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "p_polyobj.h" | ||||
| 
 | ||||
| #define MAXVISPLANES 512 | ||||
|  |  | |||
|  | @ -15,6 +15,7 @@ | |||
| #define __R_PORTAL__ | ||||
| 
 | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "r_plane.h" // visplanes | ||||
| 
 | ||||
| /** Portal structure for the software renderer.
 | ||||
|  |  | |||
|  | @ -299,6 +299,11 @@ void SetPlayerSkinByNum(INT32 playernum, INT32 skinnum) | |||
| 			} | ||||
| 
 | ||||
| 			player->skincolor = newcolor = skin->prefcolor; | ||||
| 			if (player->bot && botingame) | ||||
| 			{ | ||||
| 				botskin = (UINT8)(skinnum + 1); | ||||
| 				botcolor = skin->prefcolor; | ||||
| 			} | ||||
| 		} | ||||
| #endif | ||||
| 
 | ||||
|  |  | |||
|  | @ -17,7 +17,7 @@ | |||
| #include "info.h" | ||||
| #include "sounds.h" | ||||
| #include "d_player.h" // skinflags | ||||
| #include "r_patch.h" // spriteinfo_t | ||||
| #include "r_picformats.h" // spriteinfo_t | ||||
| #include "r_defs.h" // spritedef_t | ||||
| 
 | ||||
| /// Defaults
 | ||||
|  |  | |||
							
								
								
									
										1648
									
								
								src/r_textures.c
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1648
									
								
								src/r_textures.c
									
										
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load diff
											
										
									
								
							
							
								
								
									
										103
									
								
								src/r_textures.h
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										103
									
								
								src/r_textures.h
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,103 @@ | |||
| // SONIC ROBO BLAST 2
 | ||||
| //-----------------------------------------------------------------------------
 | ||||
| // Copyright (C) 1993-1996 by id Software, Inc.
 | ||||
| // Copyright (C) 1998-2000 by DooM Legacy Team.
 | ||||
| // Copyright (C) 1999-2020 by Sonic Team Junior.
 | ||||
| //
 | ||||
| // This program is free software distributed under the
 | ||||
| // terms of the GNU General Public License, version 2.
 | ||||
| // See the 'LICENSE' file for more details.
 | ||||
| //-----------------------------------------------------------------------------
 | ||||
| /// \file  r_textures.h
 | ||||
| /// \brief Texture generation.
 | ||||
| 
 | ||||
| #ifndef __R_TEXTURES__ | ||||
| #define __R_TEXTURES__ | ||||
| 
 | ||||
| #include "r_defs.h" | ||||
| #include "r_state.h" | ||||
| #include "p_setup.h" // levelflats | ||||
| #include "r_data.h" | ||||
| 
 | ||||
| #ifdef __GNUG__ | ||||
| #pragma interface | ||||
| #endif | ||||
| 
 | ||||
| // A single patch from a texture definition,
 | ||||
| //  basically a rectangular area within
 | ||||
| //  the texture rectangle.
 | ||||
| typedef struct | ||||
| { | ||||
| 	// Block origin (always UL), which has already accounted for the internal origin of the patch.
 | ||||
| 	INT16 originx, originy; | ||||
| 	UINT16 wad, lump; | ||||
| 	UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both
 | ||||
| 	UINT8 alpha; // Translucency value
 | ||||
| 	enum patchalphastyle style; | ||||
| } texpatch_t; | ||||
| 
 | ||||
| // texture type
 | ||||
| enum | ||||
| { | ||||
| 	TEXTURETYPE_UNKNOWN, | ||||
| 	TEXTURETYPE_SINGLEPATCH, | ||||
| 	TEXTURETYPE_COMPOSITE, | ||||
| #ifdef WALLFLATS | ||||
| 	TEXTURETYPE_FLAT, | ||||
| #endif | ||||
| }; | ||||
| 
 | ||||
| // A texture_t describes a rectangular texture,
 | ||||
| //  which is composed of one or more texpatch_t structures
 | ||||
| //  that arrange graphic patches.
 | ||||
| typedef struct | ||||
| { | ||||
| 	// Keep name for switch changing, etc.
 | ||||
| 	char name[8]; | ||||
| 	UINT8 type; // TEXTURETYPE_
 | ||||
| 	INT16 width, height; | ||||
| 	boolean holes; | ||||
| 	UINT8 flip; // 1 = flipx, 2 = flipy, 3 = both
 | ||||
| 	void *flat; // The texture, as a flat.
 | ||||
| 
 | ||||
| 	// All the patches[patchcount] are drawn back to front into the cached texture.
 | ||||
| 	INT16 patchcount; | ||||
| 	texpatch_t patches[0]; | ||||
| } texture_t; | ||||
| 
 | ||||
| // all loaded and prepared textures from the start of the game
 | ||||
| extern texture_t **textures; | ||||
| 
 | ||||
| extern INT32 *texturewidth; | ||||
| extern fixed_t *textureheight; // needed for texture pegging
 | ||||
| 
 | ||||
| extern UINT32 **texturecolumnofs; // column offset lookup table for each texture
 | ||||
| extern UINT8 **texturecache; // graphics data for each generated full-size texture
 | ||||
| 
 | ||||
| // Load TEXTURES definitions, create lookup tables
 | ||||
| void R_LoadTextures(void); | ||||
| void R_FlushTextureCache(void); | ||||
| 
 | ||||
| // Texture generation
 | ||||
| UINT8 *R_GenerateTexture(size_t texnum); | ||||
| UINT8 *R_GenerateTextureAsFlat(size_t texnum); | ||||
| INT32 R_GetTextureNum(INT32 texnum); | ||||
| void R_CheckTextureCache(INT32 tex); | ||||
| void R_ClearTextureNumCache(boolean btell); | ||||
| 
 | ||||
| // Retrieve texture data.
 | ||||
| void *R_GetLevelFlat(levelflat_t *levelflat); | ||||
| UINT8 *R_GetColumn(fixed_t tex, INT32 col); | ||||
| void *R_GetFlat(lumpnum_t flatnum); | ||||
| 
 | ||||
| boolean R_CheckPowersOfTwo(void); | ||||
| void R_CheckFlatLength(size_t size); | ||||
| 
 | ||||
| // Returns the texture number for the texture name.
 | ||||
| INT32 R_TextureNumForName(const char *name); | ||||
| INT32 R_CheckTextureNumForName(const char *name); | ||||
| lumpnum_t R_GetFlatNumForName(const char *name); | ||||
| 
 | ||||
| extern INT32 numtextures; | ||||
| 
 | ||||
| #endif | ||||
|  | @ -24,7 +24,7 @@ | |||
| #include "i_video.h" // rendermode | ||||
| #include "i_system.h" | ||||
| #include "r_things.h" | ||||
| #include "r_patch.h" | ||||
| #include "r_picformats.h" | ||||
| #include "r_plane.h" | ||||
| #include "r_portal.h" | ||||
| #include "p_tick.h" | ||||
|  | @ -261,6 +261,12 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 | |||
| 	{ | ||||
| 		if (memcmp(lumpinfo[l].name,sprname,4)==0) | ||||
| 		{ | ||||
| 			INT32 width, height; | ||||
| 			INT16 topoffset, leftoffset; | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 			boolean isPNG = false; | ||||
| #endif | ||||
| 
 | ||||
| 			frame = R_Char2Frame(lumpinfo[l].name[4]); | ||||
| 			rotation = R_Char2Rotation(lumpinfo[l].name[5]); | ||||
| 
 | ||||
|  | @ -276,24 +282,35 @@ boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef, UINT16 | |||
| 
 | ||||
| 			// store sprite info in lookup tables
 | ||||
| 			//FIXME : numspritelumps do not duplicate sprite replacements
 | ||||
| 			W_ReadLumpHeaderPwad(wadnum, l, &patch, sizeof (patch_t), 0); | ||||
| 
 | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 			{ | ||||
| 				patch_t *png = W_CacheLumpNumPwad(wadnum, l, PU_STATIC); | ||||
| 				size_t len = W_LumpLengthPwad(wadnum, l); | ||||
| 				// lump is a png so convert it
 | ||||
| 				if (R_IsLumpPNG((UINT8 *)png, len)) | ||||
| 
 | ||||
| 				if (Picture_IsLumpPNG((UINT8 *)png, len)) | ||||
| 				{ | ||||
| 					png = R_PNGToPatch((UINT8 *)png, len, NULL); | ||||
| 					M_Memcpy(&patch, png, sizeof(INT16)*4); | ||||
| 					Picture_PNGDimensions((UINT8 *)png, &width, &height, &topoffset, &leftoffset, len); | ||||
| 					isPNG = true; | ||||
| 				} | ||||
| 
 | ||||
| 				Z_Free(png); | ||||
| 			} | ||||
| 
 | ||||
| 			if (!isPNG) | ||||
| #endif | ||||
| 			spritecachedinfo[numspritelumps].width = SHORT(patch.width)<<FRACBITS; | ||||
| 			spritecachedinfo[numspritelumps].offset = SHORT(patch.leftoffset)<<FRACBITS; | ||||
| 			spritecachedinfo[numspritelumps].topoffset = SHORT(patch.topoffset)<<FRACBITS; | ||||
| 			spritecachedinfo[numspritelumps].height = SHORT(patch.height)<<FRACBITS; | ||||
| 			{ | ||||
| 				W_ReadLumpHeaderPwad(wadnum, l, &patch, sizeof (patch_t), 0); | ||||
| 				width = SHORT(patch.width); | ||||
| 				height = SHORT(patch.height); | ||||
| 				topoffset = SHORT(patch.topoffset); | ||||
| 				leftoffset = SHORT(patch.leftoffset); | ||||
| 			} | ||||
| 
 | ||||
| 			spritecachedinfo[numspritelumps].width = width<<FRACBITS; | ||||
| 			spritecachedinfo[numspritelumps].offset = leftoffset<<FRACBITS; | ||||
| 			spritecachedinfo[numspritelumps].topoffset = topoffset<<FRACBITS; | ||||
| 			spritecachedinfo[numspritelumps].height = height<<FRACBITS; | ||||
| 
 | ||||
| 			//BP: we cannot use special tric in hardware mode because feet in ground caused by z-buffer
 | ||||
| 			if (rendermode != render_none) // not for psprite
 | ||||
|  |  | |||
|  | @ -15,7 +15,7 @@ | |||
| #define __R_THINGS__ | ||||
| 
 | ||||
| #include "r_plane.h" | ||||
| #include "r_patch.h" | ||||
| #include "r_picformats.h" | ||||
| #include "r_portal.h" | ||||
| #include "r_defs.h" | ||||
| #include "r_skins.h" | ||||
|  |  | |||
|  | @ -68,7 +68,7 @@ consvar_t cv_vhseffect = {"vhspause", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NU | |||
| consvar_t cv_shittyscreen = {"televisionsignal", "Okay", CV_NOSHOWHELP, shittyscreen_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; | ||||
| 
 | ||||
| static void SCR_ActuallyChangeRenderer(void); | ||||
| CV_PossibleValue_t cv_renderer_t[] = { | ||||
| static CV_PossibleValue_t cv_renderer_t[] = { | ||||
| 	{1, "Software"}, | ||||
| #ifdef HWRENDER | ||||
| 	{2, "OpenGL"}, | ||||
|  | @ -503,9 +503,6 @@ void SCR_ChangeRendererCVars(INT32 mode) | |||
| 		CV_StealthSetValue(&cv_renderer, 1); | ||||
| 	else if (mode == render_opengl) | ||||
| 		CV_StealthSetValue(&cv_renderer, 2); | ||||
| #ifdef HWRENDER | ||||
| 	CV_StealthSetValue(&cv_newrenderer, cv_renderer.value); | ||||
| #endif | ||||
| } | ||||
| 
 | ||||
| boolean SCR_IsAspectCorrect(INT32 width, INT32 height) | ||||
|  |  | |||
|  | @ -168,7 +168,6 @@ extern boolean R_SSE2; | |||
| // ----------------
 | ||||
| // screen variables
 | ||||
| // ----------------
 | ||||
| 
 | ||||
| extern viddef_t vid; | ||||
| extern INT32 setmodeneeded; // mode number to set if needed, or 0
 | ||||
| 
 | ||||
|  | @ -179,12 +178,9 @@ extern UINT8 setrenderneeded; | |||
| extern INT32 scr_bpp; | ||||
| extern UINT8 *scr_borderpatch; // patch used to fill the view borders
 | ||||
| 
 | ||||
| extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderer, cv_fullscreen, cv_vhseffect, cv_shittyscreen; | ||||
| extern CV_PossibleValue_t cv_renderer_t[]; | ||||
| extern consvar_t cv_scr_width, cv_scr_height, cv_scr_depth, cv_renderview, cv_renderer, cv_fullscreen; | ||||
| extern consvar_t cv_vhseffect, cv_shittyscreen; | ||||
| 
 | ||||
| #ifdef HWRENDER | ||||
| extern consvar_t cv_newrenderer; | ||||
| #endif | ||||
| // wait for page flipping to end or not
 | ||||
| extern consvar_t cv_vidwait; | ||||
| 
 | ||||
|  |  | |||
|  | @ -55,6 +55,10 @@ set(SRB2_SDL2_HEADERS | |||
| 	sdlmain.h | ||||
| ) | ||||
| 
 | ||||
| if(${SRB2_CONFIG_HAVE_THREADS}) | ||||
| 	set(SRB2_SDL2_SOURCES ${SRB2_SDL2_SOURCES} i_threads.c) | ||||
| endif() | ||||
| 
 | ||||
| source_group("Interface Code" FILES ${SRB2_SDL2_SOURCES} ${SRB2_SDL2_HEADERS}) | ||||
| 
 | ||||
| # Dependency | ||||
|  |  | |||
|  | @ -284,14 +284,15 @@ | |||
|     <ClInclude Include="..\r_draw.h" /> | ||||
|     <ClInclude Include="..\r_local.h" /> | ||||
|     <ClInclude Include="..\r_main.h" /> | ||||
|     <ClInclude Include="..\r_picformats.h" /> | ||||
|     <ClInclude Include="..\r_plane.h" /> | ||||
|     <ClInclude Include="..\r_patch.h" /> | ||||
|     <ClInclude Include="..\r_portal.h" /> | ||||
|     <ClInclude Include="..\r_segs.h" /> | ||||
|     <ClInclude Include="..\r_skins.h" /> | ||||
|     <ClInclude Include="..\r_sky.h" /> | ||||
|     <ClInclude Include="..\r_splats.h" /> | ||||
|     <ClInclude Include="..\r_state.h" /> | ||||
|     <ClInclude Include="..\r_textures.h" /> | ||||
|     <ClInclude Include="..\r_things.h" /> | ||||
|     <ClInclude Include="..\screen.h" /> | ||||
|     <ClInclude Include="..\sounds.h" /> | ||||
|  | @ -452,13 +453,14 @@ | |||
|       <ExcludedFromBuild>true</ExcludedFromBuild> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\r_main.c" /> | ||||
|     <ClCompile Include="..\r_picformats.c" /> | ||||
|     <ClCompile Include="..\r_plane.c" /> | ||||
| 	<ClCompile Include="..\r_patch.c" /> | ||||
|     <ClCompile Include="..\r_portal.c" /> | ||||
|     <ClCompile Include="..\r_segs.c" /> | ||||
|     <ClCompile Include="..\r_skins.c" /> | ||||
|     <ClCompile Include="..\r_sky.c" /> | ||||
|     <ClCompile Include="..\r_splats.c" /> | ||||
|     <ClCompile Include="..\r_textures.c" /> | ||||
|     <ClCompile Include="..\r_things.c" /> | ||||
|     <ClCompile Include="..\screen.c" /> | ||||
|     <ClCompile Include="..\sounds.c" /> | ||||
|  |  | |||
|  | @ -478,7 +478,10 @@ | |||
|     <ClInclude Include="..\hardware\hw_clip.h"> | ||||
|       <Filter>Hw_Hardware</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="..\r_patch.h"> | ||||
|     <ClInclude Include="..\r_textures.h"> | ||||
|       <Filter>R_Rend</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="..\r_picformats.h"> | ||||
|       <Filter>R_Rend</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="..\r_portal.h"> | ||||
|  | @ -962,7 +965,10 @@ | |||
|       <Filter>Hw_Hardware</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\apng.c" /> | ||||
|     <ClCompile Include="..\r_patch.c"> | ||||
|     <ClCompile Include="..\r_textures.c"> | ||||
|       <Filter>R_Rend</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\r_picformats.c"> | ||||
|       <Filter>R_Rend</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\r_portal.c"> | ||||
|  |  | |||
|  | @ -542,14 +542,12 @@ static void Impl_HandleKeyboardConsoleEvent(KEY_EVENT_RECORD evt, HANDLE co) | |||
| 			case VK_TAB: | ||||
| 				event.data1 = KEY_NULL; | ||||
| 				break; | ||||
| 			case VK_SHIFT: | ||||
| 				event.data1 = KEY_LSHIFT; | ||||
| 				break; | ||||
| 			case VK_RETURN: | ||||
| 				entering_con_command = false; | ||||
| 				/* FALLTHRU */ | ||||
| 			default: | ||||
| 				event.data1 = MapVirtualKey(evt.wVirtualKeyCode,2); // convert in to char
 | ||||
| 				//event.data1 = MapVirtualKey(evt.wVirtualKeyCode,2); // convert in to char
 | ||||
| 				event.data1 = evt.uChar.AsciiChar; | ||||
| 		} | ||||
| 		if (co != INVALID_HANDLE_VALUE && GetFileType(co) == FILE_TYPE_CHAR && GetConsoleMode(co, &t)) | ||||
| 		{ | ||||
|  | @ -568,18 +566,6 @@ static void Impl_HandleKeyboardConsoleEvent(KEY_EVENT_RECORD evt, HANDLE co) | |||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| 	else | ||||
| 	{ | ||||
| 		event.type = ev_keyup; | ||||
| 		switch (evt.wVirtualKeyCode) | ||||
| 		{ | ||||
| 			case VK_SHIFT: | ||||
| 				event.data1 = KEY_LSHIFT; | ||||
| 				break; | ||||
| 			default: | ||||
| 				break; | ||||
| 		} | ||||
| 	} | ||||
| 	if (event.data1) D_PostEvent(&event); | ||||
| } | ||||
| 
 | ||||
|  | @ -2102,7 +2088,7 @@ void I_GetDiskFreeSpace(INT64 *freespace) | |||
| 	return; | ||||
| #else // Both Linux and BSD have this, apparently.
 | ||||
| 	struct statfs stfs; | ||||
| 	if (statfs(".", &stfs) == -1) | ||||
| 	if (statfs(srb2home, &stfs) == -1) | ||||
| 	{ | ||||
| 		*freespace = INT32_MAX; | ||||
| 		return; | ||||
|  | @ -2121,7 +2107,7 @@ void I_GetDiskFreeSpace(INT64 *freespace) | |||
| 	} | ||||
| 	if (pfnGetDiskFreeSpaceEx) | ||||
| 	{ | ||||
| 		if (pfnGetDiskFreeSpaceEx(NULL, &lfreespace, &usedbytes, NULL)) | ||||
| 		if (pfnGetDiskFreeSpaceEx(srb2home, &lfreespace, &usedbytes, NULL)) | ||||
| 			*freespace = lfreespace.QuadPart; | ||||
| 		else | ||||
| 			*freespace = INT32_MAX; | ||||
|  | @ -2227,10 +2213,10 @@ const char *I_ClipboardPaste(void) | |||
| 
 | ||||
| 	if (!SDL_HasClipboardText()) | ||||
| 		return NULL; | ||||
| 
 | ||||
| 	clipboard_contents = SDL_GetClipboardText(); | ||||
| 	memcpy(clipboard_modified, clipboard_contents, 255); | ||||
| 	strlcpy(clipboard_modified, clipboard_contents, 256); | ||||
| 	SDL_free(clipboard_contents); | ||||
| 	clipboard_modified[255] = 0; | ||||
| 
 | ||||
| 	while (*i) | ||||
| 	{ | ||||
|  |  | |||
|  | @ -1597,6 +1597,7 @@ static SDL_bool Impl_CreateContext(void) | |||
| 
 | ||||
| void VID_CheckGLLoaded(rendermode_t oldrender) | ||||
| { | ||||
| 	(void)oldrender; | ||||
| #ifdef HWRENDER | ||||
| 	if (vid_opengl_state == -1) // Well, it didn't work the first time anyway.
 | ||||
| 	{ | ||||
|  | @ -1607,7 +1608,6 @@ void VID_CheckGLLoaded(rendermode_t oldrender) | |||
| 		if (setrenderneeded) | ||||
| 		{ | ||||
| 			CV_StealthSetValue(&cv_renderer, oldrender); | ||||
| 			CV_StealthSetValue(&cv_newrenderer, oldrender); | ||||
| 			setrenderneeded = 0; | ||||
| 		} | ||||
| 	} | ||||
|  |  | |||
|  | @ -157,6 +157,7 @@ static void var_cleanup(void) | |||
| 	internal_volume = 100; | ||||
| } | ||||
| 
 | ||||
| #if defined (HAVE_LIBGME) && defined (HAVE_ZLIB) | ||||
| static const char* get_zlib_error(int zErr) | ||||
| { | ||||
| 	switch (zErr) | ||||
|  | @ -177,6 +178,7 @@ static const char* get_zlib_error(int zErr) | |||
| 			return "unknown error"; | ||||
| 	} | ||||
| } | ||||
| #endif | ||||
| 
 | ||||
| /// ------------------------
 | ||||
| /// Audio System
 | ||||
|  |  | |||
|  | @ -2257,8 +2257,8 @@ INT32 V_StringWidth(const char *string, INT32 option) | |||
| 			w += (charwidth ? charwidth : SHORT(fontv[HU_FONT].font[c]->width)); | ||||
| 	} | ||||
| 
 | ||||
| 	if (option & V_NOSCALESTART) | ||||
| 	w *= vid.dupx; | ||||
| 	if (option & (V_NOSCALESTART|V_NOSCALEPATCH)) | ||||
| 		w *= vid.dupx; | ||||
| 
 | ||||
| 	return w; | ||||
| } | ||||
|  | @ -2550,29 +2550,51 @@ Unoptimized version | |||
| #endif | ||||
| } | ||||
| 
 | ||||
| // Generates a color look-up table
 | ||||
| // which has up to 64 colors at each channel
 | ||||
| // (see the defines in v_video.h)
 | ||||
| 
 | ||||
| UINT8 colorlookup[CLUTSIZE][CLUTSIZE][CLUTSIZE]; | ||||
| 
 | ||||
| void InitColorLUT(RGBA_t *palette) | ||||
| // Generates a RGB565 color look-up table
 | ||||
| void InitColorLUT(colorlookup_t *lut, RGBA_t *palette, boolean makecolors) | ||||
| { | ||||
| 	UINT8 r, g, b; | ||||
| 	static boolean clutinit = false; | ||||
| 	static RGBA_t *lastpalette = NULL; | ||||
| 	size_t palsize = (sizeof(RGBA_t) * 256); | ||||
| 
 | ||||
| 	if ((!clutinit) || (lastpalette != palette)) | ||||
| 	if (!lut->init || memcmp(lut->palette, palette, palsize)) | ||||
| 	{ | ||||
| 		for (r = 0; r < CLUTSIZE; r++) | ||||
| 			for (g = 0; g < CLUTSIZE; g++) | ||||
| 				for (b = 0; b < CLUTSIZE; b++) | ||||
| 					colorlookup[r][g][b] = NearestPaletteColor(r << SHIFTCOLORBITS, g << SHIFTCOLORBITS, b << SHIFTCOLORBITS, palette); | ||||
| 		clutinit = true; | ||||
| 		lastpalette = palette; | ||||
| 		INT32 i; | ||||
| 
 | ||||
| 		lut->init = true; | ||||
| 		memcpy(lut->palette, palette, palsize); | ||||
| 
 | ||||
| 		for (i = 0; i < 0xFFFF; i++) | ||||
| 			lut->table[i] = 0xFFFF; | ||||
| 
 | ||||
| 		if (makecolors) | ||||
| 		{ | ||||
| 			UINT8 r, g, b; | ||||
| 
 | ||||
| 			for (r = 0; r < 0xFF; r++) | ||||
| 			for (g = 0; g < 0xFF; g++) | ||||
| 			for (b = 0; b < 0xFF; b++) | ||||
| 			{ | ||||
| 				i = CLUTINDEX(r, g, b); | ||||
| 				if (lut->table[i] == 0xFFFF) | ||||
| 					lut->table[i] = NearestPaletteColor(r, g, b, palette); | ||||
| 			} | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
| UINT8 GetColorLUT(colorlookup_t *lut, UINT8 r, UINT8 g, UINT8 b) | ||||
| { | ||||
| 	INT32 i = CLUTINDEX(r, g, b); | ||||
| 	if (lut->table[i] == 0xFFFF) | ||||
| 		lut->table[i] = NearestPaletteColor(r, g, b, lut->palette); | ||||
| 	return lut->table[i]; | ||||
| } | ||||
| 
 | ||||
| UINT8 GetColorLUTDirect(colorlookup_t *lut, UINT8 r, UINT8 g, UINT8 b) | ||||
| { | ||||
| 	INT32 i = CLUTINDEX(r, g, b); | ||||
| 	return lut->table[i]; | ||||
| } | ||||
| 
 | ||||
| // V_Init
 | ||||
| // old software stuff, buffers are allocated at video mode setup
 | ||||
| // here we set the screens[x] pointers accordingly
 | ||||
|  |  | |||
|  | @ -27,23 +27,28 @@ | |||
| 
 | ||||
| extern UINT8 *screens[5]; | ||||
| 
 | ||||
| extern consvar_t cv_ticrate, cv_constextsize,\ | ||||
| cv_globalgamma, cv_globalsaturation, \ | ||||
| cv_rhue, cv_yhue, cv_ghue, cv_chue, cv_bhue, cv_mhue,\ | ||||
| cv_rgamma, cv_ygamma, cv_ggamma, cv_cgamma, cv_bgamma, cv_mgamma, \ | ||||
| extern consvar_t cv_ticrate, cv_constextsize, | ||||
| cv_globalgamma, cv_globalsaturation, | ||||
| cv_rhue, cv_yhue, cv_ghue, cv_chue, cv_bhue, cv_mhue, | ||||
| cv_rgamma, cv_ygamma, cv_ggamma, cv_cgamma, cv_bgamma, cv_mgamma, | ||||
| cv_rsaturation, cv_ysaturation, cv_gsaturation, cv_csaturation, cv_bsaturation, cv_msaturation; | ||||
| 
 | ||||
| // Allocates buffer screens, call before R_Init.
 | ||||
| void V_Init(void); | ||||
| 
 | ||||
| // Color look-up table
 | ||||
| #define COLORBITS 6 | ||||
| #define SHIFTCOLORBITS (8-COLORBITS) | ||||
| #define CLUTSIZE (1<<COLORBITS) | ||||
| #define CLUTINDEX(r, g, b) (((r) >> 3) << 11) | (((g) >> 2) << 5) | ((b) >> 3) | ||||
| 
 | ||||
| extern UINT8 colorlookup[CLUTSIZE][CLUTSIZE][CLUTSIZE]; | ||||
| typedef struct | ||||
| { | ||||
| 	boolean init; | ||||
| 	RGBA_t palette[256]; | ||||
| 	UINT16 table[0xFFFF]; | ||||
| } colorlookup_t; | ||||
| 
 | ||||
| void InitColorLUT(RGBA_t *palette); | ||||
| void InitColorLUT(colorlookup_t *lut, RGBA_t *palette, boolean makecolors); | ||||
| UINT8 GetColorLUT(colorlookup_t *lut, UINT8 r, UINT8 g, UINT8 b); | ||||
| UINT8 GetColorLUTDirect(colorlookup_t *lut, UINT8 r, UINT8 g, UINT8 b); | ||||
| 
 | ||||
| // Set the current RGB palette lookup to use for palettized graphics
 | ||||
| void V_SetPalette(INT32 palettenum); | ||||
|  |  | |||
|  | @ -10,3 +10,6 @@ | |||
| // Only set it higher, not lower, obviously.
 | ||||
| // Note that we use this to help keep internal testing in check; this is why v2.0 is not version "2".
 | ||||
| #define MODVERSION 6 | ||||
| 
 | ||||
| // Define this as a prerelease version suffix
 | ||||
| // #define BETAVERSION "Alpha"
 | ||||
|  |  | |||
							
								
								
									
										21
									
								
								src/w_wad.c
									
										
									
									
									
								
							
							
						
						
									
										21
									
								
								src/w_wad.c
									
										
									
									
									
								
							|  | @ -57,6 +57,8 @@ | |||
| #include "d_clisrv.h" | ||||
| #include "r_defs.h" | ||||
| #include "r_data.h" | ||||
| #include "r_textures.h" | ||||
| #include "r_picformats.h" | ||||
| #include "i_system.h" | ||||
| #include "md5.h" | ||||
| #include "lua_script.h" | ||||
|  | @ -66,7 +68,6 @@ | |||
| #include "m_misc.h" // M_MapNumber | ||||
| 
 | ||||
| #ifdef HWRENDER | ||||
| #include "r_data.h" | ||||
| #include "hardware/hw_main.h" | ||||
| #include "hardware/hw_glob.h" | ||||
| #endif | ||||
|  | @ -759,6 +760,8 @@ UINT16 W_InitFile(const char *filename, boolean mainfile, boolean startup) | |||
| 		if (!memcmp(wadfiles[i]->md5sum, md5sum, 16)) | ||||
| 		{ | ||||
| 			CONS_Alert(CONS_ERROR, M_GetText("%s is already loaded\n"), filename); | ||||
| 			if (important) | ||||
| 				packetsizetally -= nameonlylength(filename) + 22; | ||||
| 			if (handle) | ||||
| 				fclose(handle); | ||||
| 			return W_InitFileError(filename, false); | ||||
|  | @ -1407,8 +1410,8 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si | |||
| #ifdef NO_PNG_LUMPS | ||||
| 		{ | ||||
| 			size_t bytesread = fread(dest, 1, size, handle); | ||||
| 			if (R_IsLumpPNG((UINT8 *)dest, bytesread)) | ||||
| 				W_ThrowPNGError(l->fullname, wadfiles[wad]->filename); | ||||
| 			if (Picture_IsLumpPNG((UINT8 *)dest, bytesread)) | ||||
| 				Picture_ThrowPNGError(l->fullname, wadfiles[wad]->filename); | ||||
| 			return bytesread; | ||||
| 		} | ||||
| #else | ||||
|  | @ -1449,8 +1452,8 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si | |||
| 			Z_Free(rawData); | ||||
| 			Z_Free(decData); | ||||
| #ifdef NO_PNG_LUMPS | ||||
| 			if (R_IsLumpPNG((UINT8 *)dest, size)) | ||||
| 				W_ThrowPNGError(l->fullname, wadfiles[wad]->filename); | ||||
| 			if (Picture_IsLumpPNG((UINT8 *)dest, size)) | ||||
| 				Picture_ThrowPNGError(l->fullname, wadfiles[wad]->filename); | ||||
| #endif | ||||
| 			return size; | ||||
| #else | ||||
|  | @ -1511,8 +1514,8 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si | |||
| 			Z_Free(decData); | ||||
| 
 | ||||
| #ifdef NO_PNG_LUMPS | ||||
| 			if (R_IsLumpPNG((UINT8 *)dest, size)) | ||||
| 				W_ThrowPNGError(l->fullname, wadfiles[wad]->filename); | ||||
| 			if (Picture_IsLumpPNG((UINT8 *)dest, size)) | ||||
| 				Picture_ThrowPNGError(l->fullname, wadfiles[wad]->filename); | ||||
| #endif | ||||
| 			return size; | ||||
| 		} | ||||
|  | @ -1706,10 +1709,10 @@ void *W_CacheSoftwarePatchNumPwad(UINT16 wad, UINT16 lump, INT32 tag) | |||
| 
 | ||||
| #ifndef NO_PNG_LUMPS | ||||
| 		// lump is a png so convert it
 | ||||
| 		if (R_IsLumpPNG((UINT8 *)lumpdata, len)) | ||||
| 		if (Picture_IsLumpPNG((UINT8 *)lumpdata, len)) | ||||
| 		{ | ||||
| 			size_t newlen; | ||||
| 			srcdata = R_PNGToPatch((UINT8 *)lumpdata, len, &newlen); | ||||
| 			srcdata = Picture_PNGConvert((UINT8 *)lumpdata, PICFMT_PATCH, NULL, NULL, NULL, NULL, len, &newlen, 0); | ||||
| 			ptr = Z_Realloc(ptr, newlen, tag, &lumpcache[lump]); | ||||
| 			M_Memcpy(ptr, srcdata, newlen); | ||||
| 			Z_Free(srcdata); | ||||
|  |  | |||
|  | @ -299,12 +299,13 @@ | |||
|       <ExcludedFromBuild>true</ExcludedFromBuild> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\r_main.c" /> | ||||
|     <ClCompile Include="..\r_picformats.c" /> | ||||
|     <ClCompile Include="..\r_plane.c" /> | ||||
|     <ClCompile Include="..\r_patch.c" /> | ||||
|     <ClCompile Include="..\r_portal.c" /> | ||||
|     <ClCompile Include="..\r_segs.c" /> | ||||
|     <ClCompile Include="..\r_sky.c" /> | ||||
|     <ClCompile Include="..\r_splats.c" /> | ||||
|     <ClCompile Include="..\r_textures.c" /> | ||||
|     <ClCompile Include="..\r_things.c" /> | ||||
|     <ClCompile Include="..\screen.c" /> | ||||
|     <ClCompile Include="..\sounds.c" /> | ||||
|  | @ -455,13 +456,14 @@ | |||
|     <ClInclude Include="..\r_draw.h" /> | ||||
|     <ClInclude Include="..\r_local.h" /> | ||||
|     <ClInclude Include="..\r_main.h" /> | ||||
|     <ClInclude Include="..\r_picformats.h" /> | ||||
|     <ClInclude Include="..\r_plane.h" /> | ||||
| 	<ClInclude Include="..\r_patch.h" /> | ||||
|     <ClInclude Include="..\r_portal.h" /> | ||||
|     <ClInclude Include="..\r_segs.h" /> | ||||
|     <ClInclude Include="..\r_sky.h" /> | ||||
|     <ClInclude Include="..\r_splats.h" /> | ||||
|     <ClInclude Include="..\r_state.h" /> | ||||
|     <ClInclude Include="..\r_textures.h" /> | ||||
|     <ClInclude Include="..\r_things.h" /> | ||||
|     <ClInclude Include="..\screen.h" /> | ||||
|     <ClInclude Include="..\sounds.h" /> | ||||
|  |  | |||
|  | @ -473,7 +473,7 @@ | |||
|       <Filter>Hw_Hardware</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\apng.c" /> | ||||
|     <ClCompile Include="..\r_patch.c"> | ||||
|     <ClCompile Include="..\r_picformats.c"> | ||||
|       <Filter>R_Rend</Filter> | ||||
|     </ClCompile> | ||||
|     <ClCompile Include="..\r_portal.c"> | ||||
|  | @ -890,7 +890,10 @@ | |||
|       <Filter>Hw_Hardware</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="..\apng.h" /> | ||||
|     <ClInclude Include="..\r_patch.h"> | ||||
|     <ClInclude Include="..\r_textures.h"> | ||||
|       <Filter>R_Rend</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="..\r_picformats.h"> | ||||
|       <Filter>R_Rend</Filter> | ||||
|     </ClInclude> | ||||
|     <ClInclude Include="..\r_portal.h"> | ||||
|  |  | |||
|  | @ -97,14 +97,14 @@ BEGIN | |||
|             VALUE "Comments", "Go go-karting with Dr. Eggman!\0" | ||||
|             VALUE "CompanyName", "Kart Krew\0" | ||||
|             VALUE "FileDescription", "SRB2Kart\0" | ||||
|             VALUE "FileVersion", VERSIONSTRING | ||||
|             VALUE "FileVersion", VERSIONSTRING_RC | ||||
|             VALUE "InternalName", "srb2kart\0" | ||||
|             VALUE "LegalCopyright", "Copyright 1998-2020 by Kart Krew\0" | ||||
|             VALUE "LegalCopyright", "Copyright 2018-2020 by Kart Krew\0" | ||||
|             VALUE "LegalTrademarks", "Dr. Eggman and related characters are trademarks of Sega.\0" | ||||
|             VALUE "OriginalFilename", "srb2kart.exe\0" | ||||
|             VALUE "PrivateBuild", "\0" | ||||
|             VALUE "ProductName", "SRB2Kart\0" | ||||
|             VALUE "ProductVersion", VERSIONSTRING | ||||
|             VALUE "ProductVersion", VERSIONSTRING_RC | ||||
|             VALUE "SpecialBuild", "\0" | ||||
|         END | ||||
|     END | ||||
|  |  | |||
|  | @ -27,7 +27,7 @@ | |||
| 
 | ||||
| #include "doomdef.h" | ||||
| #include "doomstat.h" | ||||
| #include "r_patch.h" | ||||
| #include "r_picformats.h" | ||||
| #include "i_system.h" // I_GetFreeMem | ||||
| #include "i_video.h" // rendermode | ||||
| #include "z_zone.h" | ||||
|  | @ -517,7 +517,6 @@ void Z_FlushCachedPatches(void) | |||
| 	Z_FreeTag(PU_HWRMODELTEXTURE_UNLOCKED); | ||||
| } | ||||
| 
 | ||||
| // happens before a renderer switch
 | ||||
| void Z_PreparePatchFlush(void) | ||||
| { | ||||
| 	CONS_Debug(DBG_RENDER, "Z_PreparePatchFlush()...\n"); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Sally Coolatta
						Sally Coolatta