Beginning cleanup process
This commit is contained in:
parent
c7019911ef
commit
726ecb8b7d
40 changed files with 0 additions and 21981 deletions
244
CMakeLists.txt
244
CMakeLists.txt
|
@ -1,244 +0,0 @@
|
|||
cmake_minimum_required(VERSION 2.8)
|
||||
project(Engoo)
|
||||
|
||||
if( MSVC )
|
||||
# Statically link the run time and disable run time checks in debug mode.
|
||||
string(REPLACE "/MD " " " CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} )
|
||||
string(REPLACE "/MD " " " CMAKE_CXX_FLAGS_MINSIZEREL ${CMAKE_CXX_FLAGS_MINSIZEREL} )
|
||||
string(REPLACE "/MD " " " CMAKE_CXX_FLAGS_RELWITHDEBINFO ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} )
|
||||
string(REPLACE "/MDd " " " CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
|
||||
string(REPLACE "/MD " " " CMAKE_C_FLAGS_RELEASE ${CMAKE_C_FLAGS_RELEASE} )
|
||||
string(REPLACE "/MD " " " CMAKE_C_FLAGS_MINSIZEREL ${CMAKE_C_FLAGS_MINSIZEREL} )
|
||||
string(REPLACE "/MD " " " CMAKE_C_FLAGS_RELWITHDEBINFO ${CMAKE_C_FLAGS_RELWITHDEBINFO} )
|
||||
string(REPLACE "/MDd " " " CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} )
|
||||
|
||||
string(REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
|
||||
string(REPLACE "/RTC1" "" CMAKE_C_FLAGS_DEBUG ${CMAKE_C_FLAGS_DEBUG} )
|
||||
|
||||
set( CMAKE_C_FLAGS_RELEASE "/MT ${CMAKE_C_FLAGS_RELEASE}" )
|
||||
set( CMAKE_C_FLAGS_MINSIZEREL "/MT ${CMAKE_C_FLAGS_MINSIZEREL}" )
|
||||
set( CMAKE_C_FLAGS_RELWITHDEBINFO "/MT ${CMAKE_C_FLAGS_RELWITHDEBINFO}" )
|
||||
set( CMAKE_C_FLAGS_DEBUG "/MTd ${CMAKE_C_FLAGS_DEBUG}" )
|
||||
|
||||
set( CMAKE_CXX_FLAGS_RELEASE "/MT ${CMAKE_CXX_FLAGS_RELEASE}" )
|
||||
set( CMAKE_CXX_FLAGS_MINSIZEREL "/MT ${CMAKE_CXX_FLAGS_MINSIZEREL}" )
|
||||
set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
|
||||
set( CMAKE_CXX_FLAGS_DEBUG "/MTd ${CMAKE_CXX_FLAGS_DEBUG}" )
|
||||
|
||||
add_definitions("/D_CRT_SECURE_NO_WARNINGS")
|
||||
endif( MSVC )
|
||||
|
||||
# On for now until the ASM is made to work on newer compilers
|
||||
option( NO_ASM "Disable assembly code" ON )
|
||||
|
||||
if( NOT NO_ASM )
|
||||
if( MSVC )
|
||||
add_subdirectory( gas2masm )
|
||||
endif( MSVC )
|
||||
|
||||
set( ASM_SOURCE_EXTENSION .s )
|
||||
if( UNIX )
|
||||
set( ASM_OUTPUT_EXTENSION .o )
|
||||
else( UNIX )
|
||||
set( ASM_OUTPUT_EXTENSION .obj )
|
||||
endif( UNIX )
|
||||
MACRO( ADD_ASM_FILE indir infile )
|
||||
set( ASM_OUTPUT_${infile} "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Engoo.dir/${indir}/${infile}${ASM_OUTPUT_EXTENSION}" )
|
||||
set( ASM_TEMP_${infile} "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Engoo.dir/${indir}/${infile}.spp" )
|
||||
set( ASM_TEMP2_${infile} "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Engoo.dir/${indir}/${infile}.asm" )
|
||||
if( MSVC )
|
||||
add_custom_command( OUTPUT ${ASM_OUTPUT_${infile}}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Engoo.dir/${indir}
|
||||
COMMAND cl /EP "${CMAKE_CURRENT_SOURCE_DIR}/${indir}/${infile}${ASM_SOURCE_EXTENSION}" > "${ASM_TEMP_${infile}}"
|
||||
COMMAND gas2masm < "${ASM_TEMP_${infile}}" > "${ASM_TEMP2_${infile}}"
|
||||
COMMAND ml /c /Cp /coff "/Fo${ASM_OUTPUT_${infile}}" /Zm /Zi "${ASM_TEMP2_${infile}}"
|
||||
MAIN_DEPENDENCY gas2masm )
|
||||
else( MSVC )
|
||||
add_custom_command( OUTPUT ${ASM_OUTPUT_${infile}}
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Engoo.dir/${indir}
|
||||
COMMAND mingw32-gcc -x assembler-with-cpp -o "${ASM_OUTPUT_${infile}}" -c "${CMAKE_CURRENT_SOURCE_DIR}/${indir}/${infile}${ASM_SOURCE_EXTENSION}" )
|
||||
endif( MSVC )
|
||||
set( ASM_SOURCES ${ASM_SOURCES} "${ASM_OUTPUT_${infile}}" )
|
||||
ENDMACRO( ADD_ASM_FILE )
|
||||
endif( NOT NO_ASM )
|
||||
|
||||
if( WIN32 )
|
||||
if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
# CMake is not set up to compile and link rc files with GCC. :(
|
||||
add_custom_command( OUTPUT WinQuake_vc.o
|
||||
COMMAND windres -o WinQuake_vc.o -i ${CMAKE_CURRENT_SOURCE_DIR}/WinQuake/WinQuake_vc.rc
|
||||
DEPENDS WinQuake/WinQuake_vc.rc )
|
||||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} WinQuake_vc.o )
|
||||
else( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
set( SYSTEM_SOURCES ${SYSTEM_SOURCES} WinQuake/WinQuake_vc.rc )
|
||||
endif( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" )
|
||||
|
||||
find_path( DINPUT_INCLUDE_DIR dinput.h
|
||||
PATHS ENV DXSDK_DIR
|
||||
PATH_SUFFIXES Include )
|
||||
if( NOT DINPUT_INCLUDE_DIR )
|
||||
message( SEND_ERROR "Could not find DirectX header files" )
|
||||
else( NOT DINPUT_INCLUDE_DIR )
|
||||
include_directories( ${DINPUT_INCLUDE_DIR} )
|
||||
endif( NOT DINPUT_INCLUDE_DIR )
|
||||
endif( WIN32 )
|
||||
|
||||
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/SciTech/include")
|
||||
|
||||
if( NOT NO_ASM )
|
||||
ADD_ASM_FILE( asm d_draw )
|
||||
ADD_ASM_FILE( asm d_draw16 )
|
||||
ADD_ASM_FILE( asm d_parta )
|
||||
ADD_ASM_FILE( asm d_polysa )
|
||||
ADD_ASM_FILE( asm d_scana )
|
||||
ADD_ASM_FILE( asm d_spr8 )
|
||||
ADD_ASM_FILE( asm d_varsa )
|
||||
ADD_ASM_FILE( asm math )
|
||||
ADD_ASM_FILE( asm r_aclipa )
|
||||
ADD_ASM_FILE( asm r_aliasa )
|
||||
ADD_ASM_FILE( asm r_drawa )
|
||||
ADD_ASM_FILE( asm r_edgea )
|
||||
ADD_ASM_FILE( asm r_varsa )
|
||||
ADD_ASM_FILE( asm snd_mixa )
|
||||
ADD_ASM_FILE( asm surf16 )
|
||||
ADD_ASM_FILE( asm surf8 )
|
||||
ADD_ASM_FILE( asm surf8b )
|
||||
ADD_ASM_FILE( asm surf8fst )
|
||||
ADD_ASM_FILE( asm surf8g )
|
||||
ADD_ASM_FILE( asm surf8r )
|
||||
ADD_ASM_FILE( asm surf8rgb )
|
||||
ADD_ASM_FILE( asm sys_wina )
|
||||
ADD_ASM_FILE( asm worlda )
|
||||
else( NOT NO_ASM )
|
||||
add_definitions( -DNOASM )
|
||||
endif( NOT NO_ASM )
|
||||
|
||||
set( NOT_COMPILED_SOURCE_FILES
|
||||
|
||||
# ASM files are included here so they show up in the project
|
||||
asm/d_draw.s
|
||||
asm/d_draw16.s
|
||||
asm/d_parta.s
|
||||
asm/d_polysa.s
|
||||
asm/d_scana.s
|
||||
asm/d_spr8.s
|
||||
asm/d_varsa.s
|
||||
asm/math.s
|
||||
asm/r_aclipa.s
|
||||
asm/r_aliasa.s
|
||||
asm/r_drawa.s
|
||||
asm/r_edgea.s
|
||||
asm/r_varsa.s
|
||||
asm/snd_mixa.s
|
||||
asm/surf16.s
|
||||
asm/surf8.s
|
||||
asm/surf8b.s
|
||||
asm/surf8fst.s
|
||||
asm/surf8g.s
|
||||
asm/surf8r.s
|
||||
asm/surf8rgb.s
|
||||
asm/sys_wina.s
|
||||
asm/worlda.s
|
||||
)
|
||||
|
||||
# Headers usually correspond to c files so we might as well just glob them
|
||||
file( GLOB HEADER_SOURCES asm/*.h WinQuake/*.h midilib/*.h )
|
||||
|
||||
add_executable(engoo WIN32
|
||||
${ASM_SOURCES}
|
||||
${SYSTEM_SOURCES}
|
||||
${HEADER_SOURCES}
|
||||
${NOT_COMPILED_SOURCE_FILES}
|
||||
|
||||
midilib/midi.c
|
||||
midilib/mpu401.c
|
||||
midilib/music.c
|
||||
|
||||
WinQuake/bot.c
|
||||
WinQuake/cd_win.c
|
||||
WinQuake/chase.c
|
||||
WinQuake/cl_demo.c
|
||||
WinQuake/cl_input.c
|
||||
WinQuake/cl_main.c
|
||||
WinQuake/cl_parse.c
|
||||
WinQuake/cl_tent.c
|
||||
WinQuake/cmd.c
|
||||
WinQuake/common.c
|
||||
WinQuake/conproc.c
|
||||
WinQuake/console.c
|
||||
WinQuake/crc.c
|
||||
WinQuake/cvar.c
|
||||
WinQuake/d_edge.c
|
||||
WinQuake/d_fill.c
|
||||
WinQuake/d_init.c
|
||||
WinQuake/d_modech.c
|
||||
WinQuake/d_part.c
|
||||
WinQuake/d_polyse.c
|
||||
WinQuake/d_scan.c
|
||||
WinQuake/d_sky.c
|
||||
WinQuake/d_sprite.c
|
||||
WinQuake/d_surf.c
|
||||
WinQuake/d_vars.c
|
||||
WinQuake/d_zpoint.c
|
||||
WinQuake/draw.c
|
||||
WinQuake/host.c
|
||||
WinQuake/host_cmd.c
|
||||
WinQuake/in_win.c
|
||||
WinQuake/keys.c
|
||||
WinQuake/mathlib.c
|
||||
WinQuake/menu.c
|
||||
WinQuake/model.c
|
||||
WinQuake/model_common.c
|
||||
WinQuake/net_dgrm.c
|
||||
WinQuake/net_loop.c
|
||||
WinQuake/net_main.c
|
||||
WinQuake/net_vcr.c
|
||||
WinQuake/net_win.c
|
||||
WinQuake/net_wins.c
|
||||
WinQuake/net_wipx.c
|
||||
WinQuake/nvs_client.c
|
||||
WinQuake/nvs_common.c
|
||||
WinQuake/nvs_server.c
|
||||
WinQuake/nvs_server_data.c
|
||||
WinQuake/pr_cmds.c
|
||||
WinQuake/pr_edict.c
|
||||
WinQuake/pr_exec.c
|
||||
WinQuake/r_aclip.c
|
||||
WinQuake/r_alias.c
|
||||
WinQuake/r_bsp.c
|
||||
WinQuake/r_draw.c
|
||||
WinQuake/r_edge.c
|
||||
WinQuake/r_efrag.c
|
||||
WinQuake/r_light.c
|
||||
WinQuake/r_main.c
|
||||
WinQuake/r_misc.c
|
||||
WinQuake/r_part.c
|
||||
WinQuake/r_sky.c
|
||||
WinQuake/r_sprite.c
|
||||
WinQuake/r_surf.c
|
||||
WinQuake/r_vars.c
|
||||
WinQuake/sbar.c
|
||||
WinQuake/screen.c
|
||||
WinQuake/snd_dma.c
|
||||
WinQuake/snd_mem.c
|
||||
WinQuake/snd_mix.c
|
||||
WinQuake/snd_win.c
|
||||
WinQuake/sv_main.c
|
||||
WinQuake/sv_move.c
|
||||
WinQuake/sv_phys.c
|
||||
WinQuake/sv_user.c
|
||||
WinQuake/sys_win.c
|
||||
WinQuake/vid_win.c
|
||||
WinQuake/view.c
|
||||
WinQuake/wad.c
|
||||
WinQuake/world.c
|
||||
WinQuake/zone.c
|
||||
)
|
||||
|
||||
set_source_files_properties( ${NOT_COMPILED_SOURCE_FILES} PROPERTIES HEADER_FILE_ONLY TRUE )
|
||||
|
||||
target_link_libraries( engoo "${CMAKE_CURRENT_SOURCE_DIR}/SciTech/lib/win32/vc/mgllt.lib" dxguid winmm wsock32 )
|
||||
|
||||
source_group("Assembler Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/asm/.+$" )
|
||||
source_group("Midi" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/midilib/.+$" )
|
||||
source_group("Resources Files" REGULAR_EXPRESSION "^${CMAKE_CURRENT_SOURCE_DIR}/WinQuake/.+.rc$" )
|
|
@ -1,483 +0,0 @@
|
|||
#
|
||||
# Quake Makefile for Solaris
|
||||
#
|
||||
# Nov '97 by Zoid <zoid@idsoftware.com>
|
||||
#
|
||||
# ELF only
|
||||
#
|
||||
|
||||
VERSION=1.09
|
||||
|
||||
ifneq (,$(findstring i86pc,$(shell uname -m)))
|
||||
ARCH=i386
|
||||
else
|
||||
ARCH=sparc
|
||||
endif
|
||||
|
||||
MOUNT_DIR=/grog/Projects/WinQuake
|
||||
|
||||
BUILD_DEBUG_DIR=debug$(ARCH)
|
||||
BUILD_RELEASE_DIR=release$(ARCH)
|
||||
|
||||
CC=gcc
|
||||
BASE_CFLAGS=-I/usr/openwin/include
|
||||
|
||||
RELEASE_CFLAGS=$(BASE_CFLAGS) -O6 -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations
|
||||
DEBUG_CFLAGS=$(BASE_CFLAGS) -g
|
||||
LDFLAGS=-R /usr/openwin/lib -L /usr/openwin/lib -lm -lX11 -lXext -lsocket -lnsl -lthread -ldl
|
||||
XIL_LDFLAGS=-L /opt/SUNWits/Graphics-sw/xil/lib -R /opt/SUNWits/Graphics-sw/xil/lib:/usr/openwin/lib -L /usr/openwin/lib -lm -lxil -lX11 -lXext -lsocket -lnsl -lthread -ldl
|
||||
|
||||
DO_CC=$(CC) $(CFLAGS) -o $@ -c $<
|
||||
DO_AS=$(CC) $(CFLAGS) -DELF -x assembler-with-cpp -o $@ -c $<
|
||||
|
||||
#############################################################################
|
||||
# SETUP AND BUILD
|
||||
#############################################################################
|
||||
|
||||
TARGETS=$(BUILDDIR)/quake.sw $(BUILDDIR)/quake.xil
|
||||
|
||||
build_debug:
|
||||
@-mkdir $(BUILD_DEBUG_DIR)
|
||||
$(MAKE) targets BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
|
||||
|
||||
build_release:
|
||||
@-mkdir $(BUILD_RELEASE_DIR)
|
||||
$(MAKE) targets BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(RELEASE_CFLAGS)"
|
||||
|
||||
all: build_debug build_release
|
||||
|
||||
targets: $(TARGETS)
|
||||
|
||||
#############################################################################
|
||||
# CLIENT/SERVER
|
||||
#############################################################################
|
||||
|
||||
QUAKE_OBJS= \
|
||||
$(BUILDDIR)/chase.o \
|
||||
$(BUILDDIR)/cl_demo.o \
|
||||
$(BUILDDIR)/cl_input.o \
|
||||
$(BUILDDIR)/cl_main.o \
|
||||
$(BUILDDIR)/cl_parse.o \
|
||||
$(BUILDDIR)/cl_tent.o \
|
||||
$(BUILDDIR)/cmd.o \
|
||||
$(BUILDDIR)/common.o \
|
||||
$(BUILDDIR)/console.o \
|
||||
$(BUILDDIR)/crc.o \
|
||||
$(BUILDDIR)/cvar.o \
|
||||
$(BUILDDIR)/draw.o \
|
||||
$(BUILDDIR)/d_edge.o \
|
||||
$(BUILDDIR)/d_fill.o \
|
||||
$(BUILDDIR)/d_init.o \
|
||||
$(BUILDDIR)/d_modech.o \
|
||||
$(BUILDDIR)/d_part.o \
|
||||
$(BUILDDIR)/d_polyse.o \
|
||||
$(BUILDDIR)/d_scan.o \
|
||||
$(BUILDDIR)/d_sky.o \
|
||||
$(BUILDDIR)/d_sprite.o \
|
||||
$(BUILDDIR)/d_surf.o \
|
||||
$(BUILDDIR)/d_vars.o \
|
||||
$(BUILDDIR)/d_zpoint.o \
|
||||
$(BUILDDIR)/host.o \
|
||||
$(BUILDDIR)/host_cmd.o \
|
||||
$(BUILDDIR)/keys.o \
|
||||
$(BUILDDIR)/menu.o \
|
||||
$(BUILDDIR)/mathlib.o \
|
||||
$(BUILDDIR)/model.o \
|
||||
$(BUILDDIR)/nonintel.o \
|
||||
$(BUILDDIR)/pr_cmds.o \
|
||||
$(BUILDDIR)/pr_edict.o \
|
||||
$(BUILDDIR)/pr_exec.o \
|
||||
$(BUILDDIR)/r_aclip.o \
|
||||
$(BUILDDIR)/r_alias.o \
|
||||
$(BUILDDIR)/r_bsp.o \
|
||||
$(BUILDDIR)/r_light.o \
|
||||
$(BUILDDIR)/r_draw.o \
|
||||
$(BUILDDIR)/r_efrag.o \
|
||||
$(BUILDDIR)/r_edge.o \
|
||||
$(BUILDDIR)/r_misc.o \
|
||||
$(BUILDDIR)/r_main.o \
|
||||
$(BUILDDIR)/r_sky.o \
|
||||
$(BUILDDIR)/r_sprite.o \
|
||||
$(BUILDDIR)/r_surf.o \
|
||||
$(BUILDDIR)/r_part.o \
|
||||
$(BUILDDIR)/r_vars.o \
|
||||
$(BUILDDIR)/screen.o \
|
||||
$(BUILDDIR)/sbar.o \
|
||||
$(BUILDDIR)/sv_main.o \
|
||||
$(BUILDDIR)/sv_phys.o \
|
||||
$(BUILDDIR)/sv_move.o \
|
||||
$(BUILDDIR)/sv_user.o \
|
||||
$(BUILDDIR)/zone.o \
|
||||
$(BUILDDIR)/view.o \
|
||||
$(BUILDDIR)/wad.o \
|
||||
$(BUILDDIR)/world.o \
|
||||
$(BUILDDIR)/cd_null.o \
|
||||
$(BUILDDIR)/snd_dma.o \
|
||||
$(BUILDDIR)/snd_mix.o \
|
||||
$(BUILDDIR)/snd_mem.o \
|
||||
$(BUILDDIR)/net_dgrm.o \
|
||||
$(BUILDDIR)/net_loop.o \
|
||||
$(BUILDDIR)/net_main.o \
|
||||
$(BUILDDIR)/net_vcr.o \
|
||||
$(BUILDDIR)/net_udp.o \
|
||||
$(BUILDDIR)/net_bsd.o \
|
||||
$(BUILDDIR)/sys_sun.o \
|
||||
$(BUILDDIR)/snd_sun.o
|
||||
|
||||
QUAKE_AS_OBJS= \
|
||||
$(BUILDDIR)/d_copy.o \
|
||||
$(BUILDDIR)/d_draw.o \
|
||||
$(BUILDDIR)/d_draw16.o \
|
||||
$(BUILDDIR)/d_parta.o \
|
||||
$(BUILDDIR)/d_polysa.o \
|
||||
$(BUILDDIR)/d_scana.o \
|
||||
$(BUILDDIR)/d_spr8.o \
|
||||
$(BUILDDIR)/d_varsa.o \
|
||||
$(BUILDDIR)/math.o \
|
||||
$(BUILDDIR)/r_aliasa.o \
|
||||
$(BUILDDIR)/r_drawa.o \
|
||||
$(BUILDDIR)/r_edgea.o \
|
||||
$(BUILDDIR)/r_varsa.o \
|
||||
$(BUILDDIR)/surf16.o \
|
||||
$(BUILDDIR)/surf8.o \
|
||||
$(BUILDDIR)/worlda.o \
|
||||
$(BUILDDIR)/r_aclipa.o \
|
||||
$(BUILDDIR)/snd_mixa.o \
|
||||
$(BUILDDIR)/sys_dosa.o
|
||||
|
||||
QUAKE_X_OBJS = $(BUILDDIR)/vid_sunx.o
|
||||
|
||||
QUAKE_XIL_OBJS = $(BUILDDIR)/vid_sunxil.o
|
||||
|
||||
ifeq ($(ARCH),i386)
|
||||
$(BUILDDIR)/quake.sw : $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_X_OBJS)
|
||||
$(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_X_OBJS) $(LDFLAGS)
|
||||
|
||||
$(BUILDDIR)/quake.xil: $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_XIL_OBJS)
|
||||
$(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_AS_OBJS) $(QUAKE_XIL_OBJS) $(XIL_LDFLAGS)
|
||||
else
|
||||
$(BUILDDIR)/quake.sw : $(QUAKE_OBJS) $(QUAKE_X_OBJS)
|
||||
$(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_X_OBJS) $(LDFLAGS)
|
||||
|
||||
$(BUILDDIR)/quake.xil: $(QUAKE_OBJS) $(QUAKE_XIL_OBJS)
|
||||
$(CC) -o $(@) $(QUAKE_OBJS) $(QUAKE_XIL_OBJS) $(XIL_LDFLAGS)
|
||||
endif
|
||||
|
||||
##
|
||||
|
||||
$(BUILDDIR)/chase.o : $(MOUNT_DIR)/chase.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cl_demo.o : $(MOUNT_DIR)/cl_demo.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cl_input.o : $(MOUNT_DIR)/cl_input.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cl_main.o : $(MOUNT_DIR)/cl_main.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cl_parse.o : $(MOUNT_DIR)/cl_parse.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cl_tent.o : $(MOUNT_DIR)/cl_tent.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cmd.o : $(MOUNT_DIR)/cmd.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/common.o : $(MOUNT_DIR)/common.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/console.o : $(MOUNT_DIR)/console.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/crc.o : $(MOUNT_DIR)/crc.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cvar.o : $(MOUNT_DIR)/cvar.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/draw.o : $(MOUNT_DIR)/draw.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_edge.o : $(MOUNT_DIR)/d_edge.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_fill.o : $(MOUNT_DIR)/d_fill.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_init.o : $(MOUNT_DIR)/d_init.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_modech.o : $(MOUNT_DIR)/d_modech.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_part.o : $(MOUNT_DIR)/d_part.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_polyse.o : $(MOUNT_DIR)/d_polyse.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_scan.o : $(MOUNT_DIR)/d_scan.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_sky.o : $(MOUNT_DIR)/d_sky.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_sprite.o : $(MOUNT_DIR)/d_sprite.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_surf.o : $(MOUNT_DIR)/d_surf.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_vars.o : $(MOUNT_DIR)/d_vars.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/d_zpoint.o : $(MOUNT_DIR)/d_zpoint.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/host.o : $(MOUNT_DIR)/host.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/host_cmd.o : $(MOUNT_DIR)/host_cmd.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/keys.o : $(MOUNT_DIR)/keys.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/menu.o : $(MOUNT_DIR)/menu.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/mathlib.o : $(MOUNT_DIR)/mathlib.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/model.o : $(MOUNT_DIR)/model.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/nonintel.o : $(MOUNT_DIR)/nonintel.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/pr_cmds.o : $(MOUNT_DIR)/pr_cmds.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/pr_edict.o : $(MOUNT_DIR)/pr_edict.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/pr_exec.o : $(MOUNT_DIR)/pr_exec.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_aclip.o : $(MOUNT_DIR)/r_aclip.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_alias.o : $(MOUNT_DIR)/r_alias.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_bsp.o : $(MOUNT_DIR)/r_bsp.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_light.o : $(MOUNT_DIR)/r_light.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_draw.o : $(MOUNT_DIR)/r_draw.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_efrag.o : $(MOUNT_DIR)/r_efrag.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_edge.o : $(MOUNT_DIR)/r_edge.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_misc.o : $(MOUNT_DIR)/r_misc.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_main.o : $(MOUNT_DIR)/r_main.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_sky.o : $(MOUNT_DIR)/r_sky.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_sprite.o : $(MOUNT_DIR)/r_sprite.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_surf.o : $(MOUNT_DIR)/r_surf.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_part.o : $(MOUNT_DIR)/r_part.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/r_vars.o : $(MOUNT_DIR)/r_vars.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/screen.o : $(MOUNT_DIR)/screen.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/sbar.o : $(MOUNT_DIR)/sbar.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/sv_main.o : $(MOUNT_DIR)/sv_main.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/sv_phys.o : $(MOUNT_DIR)/sv_phys.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/sv_move.o : $(MOUNT_DIR)/sv_move.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/sv_user.o : $(MOUNT_DIR)/sv_user.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/zone.o : $(MOUNT_DIR)/zone.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/view.o : $(MOUNT_DIR)/view.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/wad.o : $(MOUNT_DIR)/wad.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/world.o : $(MOUNT_DIR)/world.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/cd_null.o : $(MOUNT_DIR)/cd_null.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/snd_dma.o : $(MOUNT_DIR)/snd_dma.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/snd_mix.o : $(MOUNT_DIR)/snd_mix.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/snd_mem.o : $(MOUNT_DIR)/snd_mem.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/net_dgrm.o : $(MOUNT_DIR)/net_dgrm.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/net_loop.o : $(MOUNT_DIR)/net_loop.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/net_main.o : $(MOUNT_DIR)/net_main.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/net_vcr.o : $(MOUNT_DIR)/net_vcr.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/net_udp.o : $(MOUNT_DIR)/net_udp.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/net_bsd.o : $(MOUNT_DIR)/net_bsd.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/sys_sun.o : $(MOUNT_DIR)/sys_sun.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/snd_sun.o : $(MOUNT_DIR)/snd_sun.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/in_sun.o : $(MOUNT_DIR)/in_sun.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/vid_sunx.o : $(MOUNT_DIR)/vid_sunx.c
|
||||
$(DO_CC)
|
||||
|
||||
$(BUILDDIR)/vid_sunxil.o : $(MOUNT_DIR)/vid_sunxil.c
|
||||
$(DO_CC)
|
||||
|
||||
#####
|
||||
|
||||
$(BUILDDIR)/d_copy.o : $(MOUNT_DIR)/d_copy.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/d_draw.o : $(MOUNT_DIR)/d_draw.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/d_draw16.o : $(MOUNT_DIR)/d_draw16.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/d_parta.o : $(MOUNT_DIR)/d_parta.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/d_polysa.o : $(MOUNT_DIR)/d_polysa.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/d_scana.o : $(MOUNT_DIR)/d_scana.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/d_spr8.o : $(MOUNT_DIR)/d_spr8.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/d_varsa.o : $(MOUNT_DIR)/d_varsa.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/math.o : $(MOUNT_DIR)/math.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/r_aliasa.o : $(MOUNT_DIR)/r_aliasa.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/r_drawa.o : $(MOUNT_DIR)/r_drawa.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/r_edgea.o : $(MOUNT_DIR)/r_edgea.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/r_varsa.o : $(MOUNT_DIR)/r_varsa.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/surf16.o : $(MOUNT_DIR)/surf16.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/surf8.o : $(MOUNT_DIR)/surf8.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/worlda.o : $(MOUNT_DIR)/worlda.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/r_aclipa.o : $(MOUNT_DIR)/r_aclipa.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/snd_mixa.o : $(MOUNT_DIR)/snd_mixa.s
|
||||
$(DO_AS)
|
||||
|
||||
$(BUILDDIR)/sys_dosa.o : $(MOUNT_DIR)/sys_dosa.s
|
||||
$(DO_AS)
|
||||
|
||||
#############################################################################
|
||||
# TAR
|
||||
#############################################################################
|
||||
|
||||
# Make RPMs. You need to be root to make this work
|
||||
RPMDIR = /var/tmp/quake-$(VERSION)
|
||||
|
||||
tar:
|
||||
if [ ! -d archives ];then mkdir archives;fi
|
||||
$(MAKE) copyfiles COPYDIR=$(RPMDIR)
|
||||
cd $(RPMDIR); tar cvf q2ded-$(VERSION)-$(ARCH)-sun-solaris2.5.1.tar *
|
||||
cd $(RPMDIR); compress q2ded-$(VERSION)-$(ARCH)-sun-solaris2.5.1.tar
|
||||
mv $(RPMDIR)/*.tar.Z archives/.
|
||||
rm -rf $(RPMDIR)
|
||||
|
||||
copyfiles:
|
||||
-mkdirhier $(COPYDIR)
|
||||
cp $(BUILD_RELEASE_DIR)/quake.sw $(COPYDIR)
|
||||
cp $(BUILD_RELEASE_DIR)/quake.xil $(COPYDIR)
|
||||
strip $(COPYDIR)/quake
|
||||
strip $(COPYDIR)/quake.xil
|
||||
cp $(MOUNT_DIR)/README.Solaris $(COPYDIR)/README.Solaris
|
||||
|
||||
#############################################################################
|
||||
# MISC
|
||||
#############################################################################
|
||||
|
||||
clean: clean-debug clean-release
|
||||
|
||||
clean-debug:
|
||||
$(MAKE) clean2 BUILDDIR=$(BUILD_DEBUG_DIR) CFLAGS="$(DEBUG_CFLAGS)"
|
||||
|
||||
clean-release:
|
||||
$(MAKE) clean2 BUILDDIR=$(BUILD_RELEASE_DIR) CFLAGS="$(DEBUG_CFLAGS)"
|
||||
|
||||
clean2:
|
||||
-rm -f $(QUAKE_OBJS) $(QUAKE_X_OBJS) $(QUAKE_XIL_OBJS)
|
||||
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,44 +0,0 @@
|
|||
Microsoft Developer Studio Workspace File, Format Version 6.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "gas2masm"=..\gas2masm\gas2masm.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "winquake"=.\WinQuake.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
Begin Project Dependency
|
||||
Project_Dep_Name gas2masm
|
||||
End Project Dependency
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
/* Wedit generated resource file */
|
||||
#include <windows.h>
|
||||
#include "resource.h"
|
||||
|
||||
IDI_ICON1 ICON DISCARDABLE "../icons/qplayer_256.ico"
|
||||
IDI_ICON2 ICON DISCARDABLE "../icons/qsymbol_16.ico"
|
||||
IDI_ICON3 ICON DISCARDABLE "../icons/qsymbol_16_alpha.ico"
|
||||
IDI_ICON4 ICON DISCARDABLE "../icons/mhquake_256.ico"
|
||||
|
||||
IDD_DIALOG1 DIALOGEX 0, 0, 62, 21
|
||||
STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | DS_SETFOREGROUND | WS_POPUP
|
||||
EXSTYLE WS_EX_CLIENTEDGE | WS_EX_TOOLWINDOW
|
||||
FONT 16, "Times New Roman", 0, 0, 0x1
|
||||
BEGIN
|
||||
CTEXT "Starting Quake...", IDC_STATIC, 4, 6, 54, 8
|
||||
END
|
||||
|
||||
IDD_PROGRESS DIALOGEX 0, 0, 333, 45
|
||||
STYLE DS_MODALFRAME | DS_CENTER | DS_3DLOOK | DS_SETFOREGROUND | WS_POPUP |
|
||||
WS_VISIBLE
|
||||
EXSTYLE WS_EX_CLIENTEDGE | WS_EX_TOOLWINDOW
|
||||
FONT 8, "MS Sans Serif"
|
||||
BEGIN
|
||||
LTEXT "Creating 15 bit inverse palette. This is only done once, so just be patient for the next 30-60 seconds.",
|
||||
IDC_STATIC, 7, 19, 319, 10
|
||||
CONTROL "Progress1", IDC_PROGRESS, "msctls_progress32", 0x0, 7,
|
||||
29, 319, 11
|
||||
LTEXT "Starting Quake...", IDC_STATIC, 7, 4, 54, 8
|
||||
END
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
IDS_STRING1, "WinQuake"
|
||||
END
|
|
@ -1,136 +0,0 @@
|
|||
//Microsoft Developer Studio generated resource script.
|
||||
//
|
||||
#include "resource.h"
|
||||
|
||||
#define APSTUDIO_READONLY_SYMBOLS
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 2 resource.
|
||||
//
|
||||
#include "afxres.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#undef APSTUDIO_READONLY_SYMBOLS
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
// English (U.S.) resources
|
||||
|
||||
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
|
||||
#ifdef _WIN32
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
#pragma code_page(1252)
|
||||
#endif //_WIN32
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// TEXTINCLUDE
|
||||
//
|
||||
|
||||
1 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"resource.h\0"
|
||||
END
|
||||
|
||||
2 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"#include ""afxres.h""\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
3 TEXTINCLUDE DISCARDABLE
|
||||
BEGIN
|
||||
"\r\n"
|
||||
"\0"
|
||||
END
|
||||
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Icon
|
||||
//
|
||||
|
||||
// Icon with lowest ID value placed first to ensure application icon
|
||||
// remains consistent on all systems.
|
||||
IDI_ICON1 ICON DISCARDABLE "../icons/k.ico"
|
||||
IDI_ICON2 ICON DISCARDABLE "../icons/k.ico"
|
||||
IDI_ICON3 ICON DISCARDABLE "../icons/k.ico"
|
||||
IDI_ICON4 ICON DISCARDABLE "../icons/k.ico"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Dialog
|
||||
//
|
||||
|
||||
IDD_DIALOG1 DIALOGEX 0, 0, 242, 94
|
||||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_CENTER | WS_POPUP
|
||||
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_STATICEDGE
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Engoo",IDC_STATIC,27,5,21,8
|
||||
LTEXT "Version 2.77",IDC_STATIC,28,17,60,8
|
||||
CTEXT "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.",
|
||||
IDC_STATIC,15,52,193,37
|
||||
LTEXT "If loading takes too long, add -no18, -ugly, or -nolookups to skip lookup generation.",
|
||||
IDC_STATIC,8,33,213,18
|
||||
ICON IDI_ICON2,IDC_STATIC,5,5,20,20
|
||||
END
|
||||
|
||||
IDD_PROGRESS DIALOGEX 0, 0, 333, 45
|
||||
STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP |
|
||||
WS_VISIBLE
|
||||
EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE
|
||||
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||
BEGIN
|
||||
LTEXT "Creating 15 bit inverse palette. This is only done once, so just be patient for the next 30-60 seconds.",
|
||||
IDC_STATIC,7,19,319,10
|
||||
CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,7,29,
|
||||
319,11
|
||||
LTEXT "BOOTING",IDC_STATIC,7,4,54,8
|
||||
END
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// DESIGNINFO
|
||||
//
|
||||
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
GUIDELINES DESIGNINFO DISCARDABLE
|
||||
BEGIN
|
||||
IDD_DIALOG1, DIALOG
|
||||
BEGIN
|
||||
RIGHTMARGIN, 223
|
||||
TOPMARGIN, 5
|
||||
END
|
||||
END
|
||||
#endif // APSTUDIO_INVOKED
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// String Table
|
||||
//
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
BEGIN
|
||||
IDS_STRING1 "GAME!"
|
||||
END
|
||||
|
||||
#endif // English (U.S.) resources
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
|
||||
#ifndef APSTUDIO_INVOKED
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Generated from the TEXTINCLUDE 3 resource.
|
||||
//
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
#endif // not APSTUDIO_INVOKED
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
rmdir /s /q debug
|
||||
rmdir /s /q release
|
||||
rmdir /s /q debug_gl
|
||||
rmdir /s /q release_gl
|
||||
|
||||
rmdir /s /q gas2masm\debug
|
||||
rmdir /s /q gas2masm\release
|
||||
|
||||
del gas2masm\gas2masm.opt
|
||||
del gas2masm\gas2masm.plg
|
||||
del gas2masm\gas2masm.ncb
|
||||
del gas2masm\gas2masm.stt
|
||||
|
||||
del WinQuake.opt
|
||||
del WinQuake.plg
|
||||
del WinQuake.ncb
|
||||
del WinQuake.stt
|
||||
|
|
@ -1 +0,0 @@
|
|||
make -f makefile.djgpp
|
1566
WinQuake/gl_draw.c
1566
WinQuake/gl_draw.c
File diff suppressed because it is too large
Load diff
|
@ -1,360 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// gl_mesh.c: triangle model functions
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
/*
|
||||
=================================================================
|
||||
|
||||
ALIAS MODEL DISPLAY LIST GENERATION
|
||||
|
||||
=================================================================
|
||||
*/
|
||||
|
||||
model_t *aliasmodel;
|
||||
aliashdr_t *paliashdr;
|
||||
|
||||
qboolean used[8192];
|
||||
|
||||
// the command list holds counts and s/t values that are valid for
|
||||
// every frame
|
||||
int commands[8192];
|
||||
int numcommands;
|
||||
|
||||
// all frames will have their vertexes rearranged and expanded
|
||||
// so they are in the order expected by the command list
|
||||
int vertexorder[8192];
|
||||
int numorder;
|
||||
|
||||
int allverts, alltris;
|
||||
|
||||
int stripverts[128];
|
||||
int striptris[128];
|
||||
int stripcount;
|
||||
|
||||
/*
|
||||
================
|
||||
StripLength
|
||||
================
|
||||
*/
|
||||
int StripLength (int starttri, int startv)
|
||||
{
|
||||
int m1, m2;
|
||||
int j;
|
||||
mtriangle_t *last, *check;
|
||||
int k;
|
||||
|
||||
used[starttri] = 2;
|
||||
|
||||
last = &triangles[starttri];
|
||||
|
||||
stripverts[0] = last->vertindex[(startv)%3];
|
||||
stripverts[1] = last->vertindex[(startv+1)%3];
|
||||
stripverts[2] = last->vertindex[(startv+2)%3];
|
||||
|
||||
striptris[0] = starttri;
|
||||
stripcount = 1;
|
||||
|
||||
m1 = last->vertindex[(startv+2)%3];
|
||||
m2 = last->vertindex[(startv+1)%3];
|
||||
|
||||
// look for a matching triangle
|
||||
nexttri:
|
||||
for (j=starttri+1, check=&triangles[starttri+1] ; j<pheader->numtris ; j++, check++)
|
||||
{
|
||||
if (check->facesfront != last->facesfront)
|
||||
continue;
|
||||
for (k=0 ; k<3 ; k++)
|
||||
{
|
||||
if (check->vertindex[k] != m1)
|
||||
continue;
|
||||
if (check->vertindex[ (k+1)%3 ] != m2)
|
||||
continue;
|
||||
|
||||
// this is the next part of the fan
|
||||
|
||||
// if we can't use this triangle, this tristrip is done
|
||||
if (used[j])
|
||||
goto done;
|
||||
|
||||
// the new edge
|
||||
if (stripcount & 1)
|
||||
m2 = check->vertindex[ (k+2)%3 ];
|
||||
else
|
||||
m1 = check->vertindex[ (k+2)%3 ];
|
||||
|
||||
stripverts[stripcount+2] = check->vertindex[ (k+2)%3 ];
|
||||
striptris[stripcount] = j;
|
||||
stripcount++;
|
||||
|
||||
used[j] = 2;
|
||||
goto nexttri;
|
||||
}
|
||||
}
|
||||
done:
|
||||
|
||||
// clear the temp used flags
|
||||
for (j=starttri+1 ; j<pheader->numtris ; j++)
|
||||
if (used[j] == 2)
|
||||
used[j] = 0;
|
||||
|
||||
return stripcount;
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
FanLength
|
||||
===========
|
||||
*/
|
||||
int FanLength (int starttri, int startv)
|
||||
{
|
||||
int m1, m2;
|
||||
int j;
|
||||
mtriangle_t *last, *check;
|
||||
int k;
|
||||
|
||||
used[starttri] = 2;
|
||||
|
||||
last = &triangles[starttri];
|
||||
|
||||
stripverts[0] = last->vertindex[(startv)%3];
|
||||
stripverts[1] = last->vertindex[(startv+1)%3];
|
||||
stripverts[2] = last->vertindex[(startv+2)%3];
|
||||
|
||||
striptris[0] = starttri;
|
||||
stripcount = 1;
|
||||
|
||||
m1 = last->vertindex[(startv+0)%3];
|
||||
m2 = last->vertindex[(startv+2)%3];
|
||||
|
||||
|
||||
// look for a matching triangle
|
||||
nexttri:
|
||||
for (j=starttri+1, check=&triangles[starttri+1] ; j<pheader->numtris ; j++, check++)
|
||||
{
|
||||
if (check->facesfront != last->facesfront)
|
||||
continue;
|
||||
for (k=0 ; k<3 ; k++)
|
||||
{
|
||||
if (check->vertindex[k] != m1)
|
||||
continue;
|
||||
if (check->vertindex[ (k+1)%3 ] != m2)
|
||||
continue;
|
||||
|
||||
// this is the next part of the fan
|
||||
|
||||
// if we can't use this triangle, this tristrip is done
|
||||
if (used[j])
|
||||
goto done;
|
||||
|
||||
// the new edge
|
||||
m2 = check->vertindex[ (k+2)%3 ];
|
||||
|
||||
stripverts[stripcount+2] = m2;
|
||||
striptris[stripcount] = j;
|
||||
stripcount++;
|
||||
|
||||
used[j] = 2;
|
||||
goto nexttri;
|
||||
}
|
||||
}
|
||||
done:
|
||||
|
||||
// clear the temp used flags
|
||||
for (j=starttri+1 ; j<pheader->numtris ; j++)
|
||||
if (used[j] == 2)
|
||||
used[j] = 0;
|
||||
|
||||
return stripcount;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
BuildTris
|
||||
|
||||
Generate a list of trifans or strips
|
||||
for the model, which holds for all frames
|
||||
================
|
||||
*/
|
||||
void BuildTris (void)
|
||||
{
|
||||
int i, j, k;
|
||||
int startv;
|
||||
mtriangle_t *last, *check;
|
||||
int m1, m2;
|
||||
int striplength;
|
||||
trivertx_t *v;
|
||||
mtriangle_t *tv;
|
||||
float s, t;
|
||||
int index;
|
||||
int len, bestlen, besttype;
|
||||
int bestverts[1024];
|
||||
int besttris[1024];
|
||||
int type;
|
||||
|
||||
//
|
||||
// build tristrips
|
||||
//
|
||||
numorder = 0;
|
||||
numcommands = 0;
|
||||
memset (used, 0, sizeof(used));
|
||||
for (i=0 ; i<pheader->numtris ; i++)
|
||||
{
|
||||
// pick an unused triangle and start the trifan
|
||||
if (used[i])
|
||||
continue;
|
||||
|
||||
bestlen = 0;
|
||||
for (type = 0 ; type < 2 ; type++)
|
||||
// type = 1;
|
||||
{
|
||||
for (startv =0 ; startv < 3 ; startv++)
|
||||
{
|
||||
if (type == 1)
|
||||
len = StripLength (i, startv);
|
||||
else
|
||||
len = FanLength (i, startv);
|
||||
if (len > bestlen)
|
||||
{
|
||||
besttype = type;
|
||||
bestlen = len;
|
||||
for (j=0 ; j<bestlen+2 ; j++)
|
||||
bestverts[j] = stripverts[j];
|
||||
for (j=0 ; j<bestlen ; j++)
|
||||
besttris[j] = striptris[j];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// mark the tris on the best strip as used
|
||||
for (j=0 ; j<bestlen ; j++)
|
||||
used[besttris[j]] = 1;
|
||||
|
||||
if (besttype == 1)
|
||||
commands[numcommands++] = (bestlen+2);
|
||||
else
|
||||
commands[numcommands++] = -(bestlen+2);
|
||||
|
||||
for (j=0 ; j<bestlen+2 ; j++)
|
||||
{
|
||||
// emit a vertex into the reorder buffer
|
||||
k = bestverts[j];
|
||||
vertexorder[numorder++] = k;
|
||||
|
||||
// emit s/t coords into the commands stream
|
||||
s = stverts[k].s;
|
||||
t = stverts[k].t;
|
||||
if (!triangles[besttris[0]].facesfront && stverts[k].onseam)
|
||||
s += pheader->skinwidth / 2; // on back side
|
||||
s = (s + 0.5) / pheader->skinwidth;
|
||||
t = (t + 0.5) / pheader->skinheight;
|
||||
|
||||
*(float *)&commands[numcommands++] = s;
|
||||
*(float *)&commands[numcommands++] = t;
|
||||
}
|
||||
}
|
||||
|
||||
commands[numcommands++] = 0; // end of list marker
|
||||
|
||||
Con_DPrintf ("%3i tri %3i vert %3i cmd\n", pheader->numtris, numorder, numcommands);
|
||||
|
||||
allverts += numorder;
|
||||
alltris += pheader->numtris;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
GL_MakeAliasModelDisplayLists
|
||||
================
|
||||
*/
|
||||
void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr)
|
||||
{
|
||||
int i, j;
|
||||
maliasgroup_t *paliasgroup;
|
||||
int *cmds;
|
||||
trivertx_t *verts;
|
||||
char cache[MAX_QPATH], fullpath[MAX_OSPATH], *c;
|
||||
FILE *f;
|
||||
int len;
|
||||
byte *data;
|
||||
|
||||
aliasmodel = m;
|
||||
paliashdr = hdr; // (aliashdr_t *)Mod_Extradata (m);
|
||||
|
||||
//
|
||||
// look for a cached version
|
||||
//
|
||||
strcpy (cache, "glquake/");
|
||||
COM_StripExtension (m->name+strlen("progs/"), cache+strlen("glquake/"));
|
||||
strcat (cache, ".ms2");
|
||||
|
||||
COM_FOpenFile (cache, &f, NULL); // 2001-09-12 Returning from which searchpath a file was loaded by Maddes
|
||||
if (f)
|
||||
{
|
||||
fread (&numcommands, 4, 1, f);
|
||||
fread (&numorder, 4, 1, f);
|
||||
fread (&commands, numcommands * sizeof(commands[0]), 1, f);
|
||||
fread (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f);
|
||||
fclose (f);
|
||||
}
|
||||
else
|
||||
{
|
||||
//
|
||||
// build it from scratch
|
||||
//
|
||||
Con_Printf ("meshing %s...\n",m->name);
|
||||
|
||||
BuildTris (); // trifans or lists
|
||||
|
||||
//
|
||||
// save out the cached version
|
||||
//
|
||||
sprintf (fullpath, "%s/%s", com_gamedir, cache);
|
||||
f = fopen (fullpath, "wb");
|
||||
if (f)
|
||||
{
|
||||
fwrite (&numcommands, 4, 1, f);
|
||||
fwrite (&numorder, 4, 1, f);
|
||||
fwrite (&commands, numcommands * sizeof(commands[0]), 1, f);
|
||||
fwrite (&vertexorder, numorder * sizeof(vertexorder[0]), 1, f);
|
||||
fclose (f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// save the data out
|
||||
|
||||
paliashdr->poseverts = numorder;
|
||||
|
||||
cmds = Hunk_Alloc (numcommands * 4);
|
||||
paliashdr->commands = (byte *)cmds - (byte *)paliashdr;
|
||||
memcpy (cmds, commands, numcommands * 4);
|
||||
|
||||
verts = Hunk_Alloc (paliashdr->numposes * paliashdr->poseverts
|
||||
* sizeof(trivertx_t) );
|
||||
paliashdr->posedata = (byte *)verts - (byte *)paliashdr;
|
||||
for (i=0 ; i<paliashdr->numposes ; i++)
|
||||
for (j=0 ; j<numorder ; j++)
|
||||
*verts++ = poseverts[i][vertexorder[j]];
|
||||
}
|
||||
|
1402
WinQuake/gl_model.c
1402
WinQuake/gl_model.c
File diff suppressed because it is too large
Load diff
|
@ -1,452 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#ifndef __MODEL__
|
||||
#define __MODEL__
|
||||
|
||||
#include "modelgen.h"
|
||||
#include "spritegn.h"
|
||||
|
||||
/*
|
||||
|
||||
d*_t structures are on-disk representations
|
||||
m*_t structures are in-memory
|
||||
|
||||
*/
|
||||
|
||||
// entity effects
|
||||
|
||||
#define EF_BRIGHTFIELD 1
|
||||
#define EF_MUZZLEFLASH 2
|
||||
#define EF_BRIGHTLIGHT 4
|
||||
#define EF_DIMLIGHT 8
|
||||
#define EF_ADDITIVE 32
|
||||
#define EF_BLUE 64
|
||||
#define EF_RED 128
|
||||
|
||||
#define EF_FLAME 1024
|
||||
|
||||
// TODO FIXME: sync gl port
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
BRUSH MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
//
|
||||
// in memory representation
|
||||
//
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
vec3_t position;
|
||||
} mvertex_t;
|
||||
|
||||
#define SIDE_FRONT 0
|
||||
#define SIDE_BACK 1
|
||||
#define SIDE_ON 2
|
||||
|
||||
|
||||
// plane_t structure
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct mplane_s
|
||||
{
|
||||
vec3_t normal;
|
||||
float dist;
|
||||
byte type; // for texture axis selection and fast side tests
|
||||
byte signbits; // signx + signy<<1 + signz<<1
|
||||
byte pad[2];
|
||||
} mplane_t;
|
||||
|
||||
#define FLAG_HAS_GLOWMAP 0x0001 // 1999-12-28 OpenGL fullbright fix by Neal White III
|
||||
|
||||
typedef struct texture_s
|
||||
{
|
||||
char name[16];
|
||||
unsigned width, height;
|
||||
int gl_texturenum;
|
||||
struct msurface_s *texturechain; // for gl_texsort drawing
|
||||
int anim_total; // total tenths in sequence ( 0 = no)
|
||||
int anim_min, anim_max; // time for this frame min <=time< max
|
||||
struct texture_s *anim_next; // in the animation sequence
|
||||
struct texture_s *alternate_anims; // bmodels in frmae 1 use these
|
||||
unsigned offsets[MIPLEVELS]; // four mip maps stored
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III start
|
||||
int gl_glowtexnum;
|
||||
unsigned flags; // FLAG_HAS_GLOWMAP
|
||||
unsigned glowoffsets[MIPLEVELS]; // four mip maps stored
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III end
|
||||
} texture_t;
|
||||
|
||||
|
||||
#define SURF_PLANEBACK 2
|
||||
#define SURF_DRAWSKY 4
|
||||
#define SURF_DRAWSPRITE 8
|
||||
#define SURF_DRAWTURB 0x10
|
||||
#define SURF_DRAWTILED 0x20
|
||||
#define SURF_DRAWBACKGROUND 0x40
|
||||
#define SURF_UNDERWATER 0x80
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
unsigned short v[2];
|
||||
unsigned int cachededgeoffset;
|
||||
} medge_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float vecs[2][4];
|
||||
float mipadjust;
|
||||
texture_t *texture;
|
||||
int flags;
|
||||
} mtexinfo_t;
|
||||
|
||||
#define VERTEXSIZE 7
|
||||
|
||||
typedef struct glpoly_s
|
||||
{
|
||||
struct glpoly_s *next;
|
||||
struct glpoly_s *chain;
|
||||
int numverts;
|
||||
int flags; // for SURF_UNDERWATER
|
||||
float verts[4][VERTEXSIZE]; // variable sized (xyz s1t1 s2t2)
|
||||
} glpoly_t;
|
||||
|
||||
typedef struct msurface_s
|
||||
{
|
||||
int visframe; // should be drawn when node is crossed
|
||||
|
||||
mplane_t *plane;
|
||||
int flags;
|
||||
|
||||
int firstedge; // look up in model->surfedges[], negative numbers
|
||||
int numedges; // are backwards edges
|
||||
|
||||
short texturemins[2];
|
||||
short extents[2];
|
||||
|
||||
int light_s, light_t; // gl lightmap coordinates
|
||||
|
||||
glpoly_t *polys; // multiple if warped
|
||||
struct msurface_s *texturechain;
|
||||
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
// lighting info
|
||||
int dlightframe;
|
||||
int dlightbits;
|
||||
|
||||
int lightmaptexturenum;
|
||||
byte styles[MAXLIGHTMAPS];
|
||||
int cached_light[MAXLIGHTMAPS]; // values currently used in lightmap
|
||||
qboolean cached_dlight; // true if dynamic light in cache
|
||||
byte *samples; // [numstyles*surfsize]
|
||||
} msurface_t;
|
||||
|
||||
typedef struct mnode_s
|
||||
{
|
||||
// common with leaf
|
||||
int contents; // 0, to differentiate from leafs
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// node specific
|
||||
mplane_t *plane;
|
||||
struct mnode_s *children[2];
|
||||
|
||||
unsigned short firstsurface;
|
||||
unsigned short numsurfaces;
|
||||
} mnode_t;
|
||||
|
||||
|
||||
|
||||
typedef struct mleaf_s
|
||||
{
|
||||
// common with node
|
||||
int contents; // wil be a negative contents number
|
||||
int visframe; // node needs to be traversed if current
|
||||
|
||||
float minmaxs[6]; // for bounding box culling
|
||||
|
||||
struct mnode_s *parent;
|
||||
|
||||
// leaf specific
|
||||
byte *compressed_vis;
|
||||
efrag_t *efrags;
|
||||
|
||||
msurface_t **firstmarksurface;
|
||||
int nummarksurfaces;
|
||||
int key; // BSP sequence number for leaf's contents
|
||||
byte ambient_sound_level[NUM_AMBIENTS];
|
||||
} mleaf_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_i386.h too !!!
|
||||
typedef struct
|
||||
{
|
||||
dclipnode_t *clipnodes;
|
||||
mplane_t *planes;
|
||||
int firstclipnode;
|
||||
int lastclipnode;
|
||||
vec3_t clip_mins;
|
||||
vec3_t clip_maxs;
|
||||
} hull_t;
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
SPRITE MODELS
|
||||
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
|
||||
// FIXME: shorten these?
|
||||
typedef struct mspriteframe_s
|
||||
{
|
||||
int width;
|
||||
int height;
|
||||
float up, down, left, right;
|
||||
int gl_texturenum;
|
||||
} mspriteframe_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numframes;
|
||||
float *intervals;
|
||||
mspriteframe_t *frames[1];
|
||||
} mspritegroup_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
spriteframetype_t type;
|
||||
mspriteframe_t *frameptr;
|
||||
} mspriteframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int type;
|
||||
int maxwidth;
|
||||
int maxheight;
|
||||
int numframes;
|
||||
float beamlength; // remove?
|
||||
void *cachespot; // remove?
|
||||
mspriteframedesc_t frames[1];
|
||||
} msprite_t;
|
||||
|
||||
|
||||
/*
|
||||
==============================================================================
|
||||
|
||||
ALIAS MODELS
|
||||
|
||||
Alias models are position independent, so the cache manager can move them.
|
||||
==============================================================================
|
||||
*/
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int firstpose;
|
||||
int numposes;
|
||||
float interval;
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
char name[16];
|
||||
} maliasframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
trivertx_t bboxmin;
|
||||
trivertx_t bboxmax;
|
||||
int frame;
|
||||
} maliasgroupframedesc_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int numframes;
|
||||
int intervals;
|
||||
maliasgroupframedesc_t frames[1];
|
||||
} maliasgroup_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in asm_draw.h too !!!
|
||||
typedef struct mtriangle_s {
|
||||
int facesfront;
|
||||
int vertindex[3];
|
||||
} mtriangle_t;
|
||||
|
||||
|
||||
#define MAX_SKINS 32
|
||||
typedef struct {
|
||||
int ident;
|
||||
int version;
|
||||
vec3_t scale;
|
||||
vec3_t scale_origin;
|
||||
float boundingradius;
|
||||
vec3_t eyeposition;
|
||||
int numskins;
|
||||
int skinwidth;
|
||||
int skinheight;
|
||||
int numverts;
|
||||
int numtris;
|
||||
int numframes;
|
||||
synctype_t synctype;
|
||||
int flags;
|
||||
float size;
|
||||
|
||||
int numposes;
|
||||
int poseverts;
|
||||
int posedata; // numposes*poseverts trivert_t
|
||||
int commands; // gl command list with embedded s/t
|
||||
int gl_texturenum[MAX_SKINS][4];
|
||||
int texels[MAX_SKINS]; // only for player skins
|
||||
maliasframedesc_t frames[1]; // variable sized
|
||||
} aliashdr_t;
|
||||
|
||||
#define MAXALIASVERTS 1024
|
||||
#define MAXALIASFRAMES 256
|
||||
#define MAXALIASTRIS 2048
|
||||
extern aliashdr_t *pheader;
|
||||
extern stvert_t stverts[MAXALIASVERTS];
|
||||
extern mtriangle_t triangles[MAXALIASTRIS];
|
||||
extern trivertx_t *poseverts[MAXALIASFRAMES];
|
||||
|
||||
//===================================================================
|
||||
typedef enum {fg_quake, fg_quake2, fg_quake3, fg_halflife, fg_new, fg_doom, fg_quakeold} fromgame_t; //useful when we have very similar model types. (eg quake/halflife bsps)
|
||||
//
|
||||
// Whole model
|
||||
//
|
||||
|
||||
typedef enum {mod_brush, mod_sprite, mod_alias} modtype_t;
|
||||
|
||||
#define EF_ROCKET 1 // leave a trail
|
||||
#define EF_GRENADE 2 // leave a trail
|
||||
#define EF_GIB 4 // leave a trail
|
||||
#define EF_ROTATE 8 // rotate (bonus items)
|
||||
#define EF_TRACER 16 // green split trail
|
||||
#define EF_ZOMGIB 32 // small blood trail
|
||||
#define EF_TRACER2 64 // orange split trail + rotate
|
||||
#define EF_TRACER3 128 // purple trail
|
||||
|
||||
typedef struct model_s
|
||||
{
|
||||
char name[MAX_QPATH];
|
||||
qboolean needload; // bmodels and sprites don't cache normally
|
||||
|
||||
modtype_t type;
|
||||
int numframes;
|
||||
synctype_t synctype;
|
||||
|
||||
int flags;
|
||||
|
||||
//
|
||||
// volume occupied by the model graphics
|
||||
//
|
||||
vec3_t mins, maxs;
|
||||
float radius;
|
||||
|
||||
//
|
||||
// solid volume for clipping
|
||||
//
|
||||
qboolean clipbox;
|
||||
vec3_t clipmins, clipmaxs;
|
||||
|
||||
//
|
||||
// brush model
|
||||
//
|
||||
int firstmodelsurface, nummodelsurfaces;
|
||||
|
||||
int numsubmodels;
|
||||
dmodel_t *submodels;
|
||||
|
||||
int numplanes;
|
||||
mplane_t *planes;
|
||||
|
||||
int numleafs; // number of visible leafs, not counting 0
|
||||
mleaf_t *leafs;
|
||||
|
||||
int numvertexes;
|
||||
mvertex_t *vertexes;
|
||||
|
||||
int numedges;
|
||||
medge_t *edges;
|
||||
|
||||
int numnodes;
|
||||
mnode_t *nodes;
|
||||
|
||||
int numtexinfo;
|
||||
mtexinfo_t *texinfo;
|
||||
|
||||
int numsurfaces;
|
||||
msurface_t *surfaces;
|
||||
|
||||
int numsurfedges;
|
||||
int *surfedges;
|
||||
|
||||
int numclipnodes;
|
||||
dclipnode_t *clipnodes;
|
||||
|
||||
int nummarksurfaces;
|
||||
msurface_t **marksurfaces;
|
||||
|
||||
hull_t hulls[MAX_MAP_HULLS];
|
||||
|
||||
int numtextures;
|
||||
texture_t **textures;
|
||||
|
||||
byte *visdata;
|
||||
byte *lightdata;
|
||||
char *entities;
|
||||
|
||||
//
|
||||
// additional model data
|
||||
//
|
||||
cache_user_t cache; // only access through Mod_Extradata
|
||||
// NEW STRUCTS
|
||||
fromgame_t fromgame; // fteqw 'from game' check
|
||||
byte *avgcol; // leilei for coloring dimlight/brightlight glows
|
||||
int dontshadow;
|
||||
} model_t;
|
||||
|
||||
//============================================================================
|
||||
|
||||
void Mod_ClearAll (void);
|
||||
|
||||
void Mod_TouchModel (char *name);
|
||||
|
||||
// 2001-12-28 Merged model functions by Maddes start
|
||||
model_t *Mod_LoadModel (model_t *mod, qboolean crash);
|
||||
model_t *Mod_FindName (char *name);
|
||||
|
||||
void Mod_LoadSpriteModel (model_t *mod, void *buffer);
|
||||
void Mod_LoadAliasModel (model_t *mod, void *buffer);
|
||||
model_t *Mod_LoadModel (model_t *mod, qboolean crash);
|
||||
|
||||
void Mod_LoadTextures (lump_t *l);
|
||||
void Mod_LoadLighting (lump_t *l);
|
||||
void Mod_LoadFaces (lump_t *l);
|
||||
// 2001-12-28 Merged model functions by Maddes end
|
||||
#endif // __MODEL__
|
|
@ -1,235 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_efrag.c
|
||||
|
||||
#include "quakedef.h"
|
||||
#include "mathlib.h"
|
||||
|
||||
mnode_t *r_pefragtopnode;
|
||||
|
||||
|
||||
//===========================================================================
|
||||
|
||||
/*
|
||||
===============================================================================
|
||||
|
||||
ENTITY FRAGMENT FUNCTIONS
|
||||
|
||||
===============================================================================
|
||||
*/
|
||||
|
||||
efrag_t **lastlink;
|
||||
|
||||
vec3_t r_emins, r_emaxs;
|
||||
|
||||
entity_t *r_addent;
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
R_RemoveEfrags
|
||||
|
||||
Call when removing an object from the world or moving it to another position
|
||||
================
|
||||
*/
|
||||
void R_RemoveEfrags (entity_t *ent)
|
||||
{
|
||||
efrag_t *ef, *old, *walk, **prev;
|
||||
|
||||
ef = ent->efrag;
|
||||
|
||||
while (ef)
|
||||
{
|
||||
prev = &ef->leaf->efrags;
|
||||
while (1)
|
||||
{
|
||||
walk = *prev;
|
||||
if (!walk)
|
||||
break;
|
||||
if (walk == ef)
|
||||
{ // remove this fragment
|
||||
*prev = ef->leafnext;
|
||||
break;
|
||||
}
|
||||
else
|
||||
prev = &walk->leafnext;
|
||||
}
|
||||
|
||||
old = ef;
|
||||
ef = ef->entnext;
|
||||
|
||||
// put it on the free list
|
||||
old->entnext = cl.free_efrags;
|
||||
cl.free_efrags = old;
|
||||
}
|
||||
|
||||
ent->efrag = NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
===================
|
||||
R_SplitEntityOnNode
|
||||
===================
|
||||
*/
|
||||
void R_SplitEntityOnNode (mnode_t *node)
|
||||
{
|
||||
efrag_t *ef;
|
||||
mplane_t *splitplane;
|
||||
mleaf_t *leaf;
|
||||
int sides;
|
||||
|
||||
if (node->contents == CONTENTS_SOLID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// add an efrag if the node is a leaf
|
||||
|
||||
if ( node->contents < 0)
|
||||
{
|
||||
if (!r_pefragtopnode)
|
||||
r_pefragtopnode = node;
|
||||
|
||||
leaf = (mleaf_t *)node;
|
||||
|
||||
// grab an efrag off the free list
|
||||
ef = cl.free_efrags;
|
||||
if (!ef)
|
||||
{
|
||||
Con_Printf ("Too many efrags!\n");
|
||||
return; // no free fragments...
|
||||
}
|
||||
cl.free_efrags = cl.free_efrags->entnext;
|
||||
|
||||
ef->entity = r_addent;
|
||||
|
||||
// add the entity link
|
||||
*lastlink = ef;
|
||||
lastlink = &ef->entnext;
|
||||
ef->entnext = NULL;
|
||||
|
||||
// set the leaf links
|
||||
ef->leaf = leaf;
|
||||
ef->leafnext = leaf->efrags;
|
||||
leaf->efrags = ef;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// NODE_MIXED
|
||||
|
||||
splitplane = node->plane;
|
||||
sides = BOX_ON_PLANE_SIDE(r_emins, r_emaxs, splitplane);
|
||||
|
||||
if (sides == 3)
|
||||
{
|
||||
// split on this plane
|
||||
// if this is the first splitter of this bmodel, remember it
|
||||
if (!r_pefragtopnode)
|
||||
r_pefragtopnode = node;
|
||||
}
|
||||
|
||||
// recurse down the contacted sides
|
||||
if (sides & 1)
|
||||
R_SplitEntityOnNode (node->children[0]);
|
||||
|
||||
if (sides & 2)
|
||||
R_SplitEntityOnNode (node->children[1]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
===========
|
||||
R_AddEfrags
|
||||
===========
|
||||
*/
|
||||
void R_AddEfrags (entity_t *ent)
|
||||
{
|
||||
model_t *entmodel;
|
||||
int i;
|
||||
|
||||
if (!ent->model)
|
||||
return;
|
||||
|
||||
r_addent = ent;
|
||||
|
||||
lastlink = &ent->efrag;
|
||||
r_pefragtopnode = NULL;
|
||||
|
||||
entmodel = ent->model;
|
||||
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
r_emins[i] = ent->origin[i] + entmodel->mins[i];
|
||||
r_emaxs[i] = ent->origin[i] + entmodel->maxs[i];
|
||||
}
|
||||
|
||||
R_SplitEntityOnNode (cl.worldmodel->nodes);
|
||||
|
||||
ent->topnode = r_pefragtopnode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
================
|
||||
R_StoreEfrags
|
||||
|
||||
// FIXME: a lot of this goes away with edge-based
|
||||
================
|
||||
*/
|
||||
void R_StoreEfrags (efrag_t **ppefrag)
|
||||
{
|
||||
entity_t *pent;
|
||||
model_t *clmodel;
|
||||
efrag_t *pefrag;
|
||||
|
||||
|
||||
while ((pefrag = *ppefrag) != NULL)
|
||||
{
|
||||
pent = pefrag->entity;
|
||||
clmodel = pent->model;
|
||||
|
||||
switch (clmodel->type)
|
||||
{
|
||||
case mod_alias:
|
||||
case mod_brush:
|
||||
case mod_sprite:
|
||||
pent = pefrag->entity;
|
||||
|
||||
if ((pent->visframe != r_framecount) &&
|
||||
(cl_numvisedicts < MAX_VISEDICTS))
|
||||
{
|
||||
cl_visedicts[cl_numvisedicts++] = pent;
|
||||
|
||||
// mark that we've recorded this entity for this frame
|
||||
pent->visframe = r_framecount;
|
||||
}
|
||||
|
||||
ppefrag = &pefrag->leafnext;
|
||||
break;
|
||||
|
||||
default:
|
||||
Sys_Error ("R_StoreEfrags: Bad entity type %d\n", clmodel->type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,563 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_light.c
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
int r_dlightframecount;
|
||||
|
||||
|
||||
/*
|
||||
==================
|
||||
R_AnimateLight
|
||||
==================
|
||||
*/
|
||||
void R_AnimateLight (void)
|
||||
{
|
||||
int i,j,k;
|
||||
|
||||
//
|
||||
// light animations
|
||||
// 'm' is normal light, 'a' is no light, 'z' is double bright
|
||||
i = (int)(cl.time*10);
|
||||
for (j=0 ; j<MAX_LIGHTSTYLES ; j++)
|
||||
{
|
||||
if (!cl_lightstyle[j].length)
|
||||
{
|
||||
d_lightstylevalue[j] = 256;
|
||||
continue;
|
||||
}
|
||||
k = i % cl_lightstyle[j].length;
|
||||
k = cl_lightstyle[j].map[k] - 'a';
|
||||
k = k*22;
|
||||
d_lightstylevalue[j] = k;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS BLEND RENDERING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
void AddLightBlend (float r, float g, float b, float a2)
|
||||
{
|
||||
float a;
|
||||
|
||||
v_blend[3] = a = v_blend[3] + a2*(1-v_blend[3]);
|
||||
|
||||
a2 = a2/a;
|
||||
|
||||
v_blend[0] = v_blend[1]*(1-a2) + r*a2;
|
||||
v_blend[1] = v_blend[1]*(1-a2) + g*a2;
|
||||
v_blend[2] = v_blend[2]*(1-a2) + b*a2;
|
||||
}
|
||||
|
||||
void R_RenderDlight (dlight_t *light)
|
||||
{
|
||||
int i, j;
|
||||
float a;
|
||||
vec3_t v;
|
||||
float rad;
|
||||
vec3_t vp2; // 2001-12-17 Model glow fix by Krimzon
|
||||
|
||||
rad = light->radius * 0.35;
|
||||
|
||||
VectorSubtract (light->origin, r_origin, v);
|
||||
if (Length (v) < rad)
|
||||
{ // view is inside the dlight
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes start
|
||||
if (light->flashcolor[0] || light->flashcolor[1] || light->flashcolor[2] || light->flashcolor[3])
|
||||
{
|
||||
AddLightBlend (light->flashcolor[0], light->flashcolor[1], light->flashcolor[2], light->radius * light->flashcolor[3] * 0.0015);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes end
|
||||
AddLightBlend (1, 0.5, 0, light->radius * 0.0003);
|
||||
} // 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes
|
||||
return;
|
||||
}
|
||||
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes start
|
||||
if (!gl_flashblend->value)
|
||||
return;
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes end
|
||||
|
||||
// 2001-12-17 Model glow fix by Krimzon start
|
||||
VectorSubtract (light->origin, r_origin, vp2);
|
||||
VectorNormalize(vp2);
|
||||
// 2001-12-17 Model glow fix by Krimzon end
|
||||
|
||||
glBegin (GL_TRIANGLE_FAN);
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes start
|
||||
if (light->flashcolor[0] || light->flashcolor[1] || light->flashcolor[2])
|
||||
{
|
||||
glColor3f (light->flashcolor[0] * 0.2f, light->flashcolor[1] * 0.2f, light->flashcolor[2] * 0.2f);
|
||||
}
|
||||
else
|
||||
{
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes end
|
||||
glColor3f (0.2,0.1,0.0);
|
||||
} // 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes
|
||||
for (i=0 ; i<3 ; i++)
|
||||
// 2001-12-17 Model glow fix by Krimzon start
|
||||
// v[i] = light->origin[i] - vpn[i]*rad;
|
||||
v[i] = light->origin[i] - vp2[i]*rad;
|
||||
// 2001-12-17 Model glow fix by Krimzon end
|
||||
glVertex3fv (v);
|
||||
glColor3f (0,0,0);
|
||||
for (i=16 ; i>=0 ; i--)
|
||||
{
|
||||
a = i/16.0 * M_PI*2;
|
||||
for (j=0 ; j<3 ; j++)
|
||||
v[j] = light->origin[j] + vright[j]*cos(a)*rad
|
||||
+ vup[j]*sin(a)*rad;
|
||||
glVertex3fv (v);
|
||||
}
|
||||
glEnd ();
|
||||
}
|
||||
|
||||
/*
|
||||
=============
|
||||
R_RenderDlights
|
||||
=============
|
||||
*/
|
||||
void R_RenderDlights (void)
|
||||
{
|
||||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes start
|
||||
/*
|
||||
if (!gl_flashblend->value)
|
||||
return;
|
||||
*/
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes end
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
// advanced yet for this frame
|
||||
glDepthMask (0);
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glShadeModel (GL_SMOOTH);
|
||||
glEnable (GL_BLEND);
|
||||
glBlendFunc (GL_ONE, GL_ONE);
|
||||
|
||||
l = cl_dlights;
|
||||
for (i=0 ; i<MAX_DLIGHTS ; i++, l++)
|
||||
{
|
||||
if (l->die < cl.time || !l->radius)
|
||||
continue;
|
||||
R_RenderDlight (l);
|
||||
}
|
||||
|
||||
glColor3f (1,1,1);
|
||||
glDisable (GL_BLEND);
|
||||
glEnable (GL_TEXTURE_2D);
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDepthMask (1);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
DYNAMIC LIGHTS
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
/*
|
||||
=============
|
||||
R_MarkLights
|
||||
=============
|
||||
*/
|
||||
void R_MarkLights (dlight_t *light, int bit, mnode_t *node)
|
||||
{
|
||||
mplane_t *splitplane;
|
||||
float dist;
|
||||
msurface_t *surf;
|
||||
int i;
|
||||
// 2001-09-11 Major light speedup by LordHavoc start
|
||||
float l, maxdist;
|
||||
int j, s, t;
|
||||
vec3_t impact;
|
||||
|
||||
loc0:
|
||||
// 2001-09-11 Major light speedup by LordHavoc end
|
||||
|
||||
if (node->contents < 0)
|
||||
return;
|
||||
|
||||
splitplane = node->plane;
|
||||
// 2001-09-11 Major light speedup by LordHavoc start
|
||||
if (splitplane->type < 3)
|
||||
dist = light->origin[splitplane->type] - splitplane->dist;
|
||||
else
|
||||
// 2001-09-11 Major light speedup by LordHavoc end
|
||||
dist = DotProduct (light->origin, splitplane->normal) - splitplane->dist;
|
||||
|
||||
if (dist > light->radius)
|
||||
{
|
||||
// 2001-09-11 Major light speedup by LordHavoc start
|
||||
/*
|
||||
R_MarkLights (light, bit, node->children[0]);
|
||||
return;
|
||||
*/
|
||||
node = node->children[0];
|
||||
goto loc0;
|
||||
// 2001-09-11 Major light speedup by LordHavoc end
|
||||
}
|
||||
if (dist < -light->radius)
|
||||
{
|
||||
// 2001-09-11 Major light speedup by LordHavoc start
|
||||
/*
|
||||
R_MarkLights (light, bit, node->children[1]);
|
||||
return;
|
||||
*/
|
||||
node = node->children[1];
|
||||
goto loc0;
|
||||
// 2001-09-11 Major light speedup by LordHavoc end
|
||||
}
|
||||
|
||||
maxdist = light->radius*light->radius; // 2001-09-11 Major light speedup by LordHavoc
|
||||
|
||||
// mark the polygons
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
for (i=0 ; i<node->numsurfaces ; i++, surf++)
|
||||
{
|
||||
// 2001-09-11 Major light speedup by LordHavoc start
|
||||
/*
|
||||
if (surf->dlightframe != r_dlightframecount)
|
||||
{
|
||||
surf->dlightbits = 0;
|
||||
surf->dlightframe = r_dlightframecount;
|
||||
}
|
||||
surf->dlightbits |= bit;
|
||||
*/
|
||||
// eliminates marking of surfaces that are too far away from light, thus preventing unnecessary renders and uploads
|
||||
for (j=0 ; j<3 ; j++)
|
||||
impact[j] = light->origin[j] - surf->plane->normal[j]*dist;
|
||||
|
||||
// clamp center of light to corner and check brightness
|
||||
l = DotProduct (impact, surf->texinfo->vecs[0]) + surf->texinfo->vecs[0][3] - surf->texturemins[0];
|
||||
s = l+0.5;if (s < 0) s = 0;else if (s > surf->extents[0]) s = surf->extents[0];
|
||||
s = l - s;
|
||||
l = DotProduct (impact, surf->texinfo->vecs[1]) + surf->texinfo->vecs[1][3] - surf->texturemins[1];
|
||||
t = l+0.5;if (t < 0) t = 0;else if (t > surf->extents[1]) t = surf->extents[1];
|
||||
t = l - t;
|
||||
// compare to minimum light
|
||||
if ((s*s+t*t+dist*dist) < maxdist)
|
||||
{
|
||||
if (surf->dlightframe != r_dlightframecount) // not dynamic until now
|
||||
{
|
||||
surf->dlightbits = bit;
|
||||
surf->dlightframe = r_dlightframecount;
|
||||
}
|
||||
else // already dynamic
|
||||
surf->dlightbits |= bit;
|
||||
}
|
||||
// 2001-09-11 Major light speedup by LordHavoc end
|
||||
}
|
||||
|
||||
if (node->children[0]->contents >= 0) // 2001-09-11 Major light speedup by LordHavoc
|
||||
R_MarkLights (light, bit, node->children[0]);
|
||||
if (node->children[1]->contents >= 0) // 2001-09-11 Major light speedup by LordHavoc
|
||||
R_MarkLights (light, bit, node->children[1]);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============
|
||||
R_PushDlights
|
||||
=============
|
||||
*/
|
||||
void R_PushDlights (void)
|
||||
{
|
||||
int i;
|
||||
dlight_t *l;
|
||||
|
||||
if (gl_flashblend->value)
|
||||
return;
|
||||
|
||||
r_dlightframecount = r_framecount + 1; // because the count hasn't
|
||||
// advanced yet for this frame
|
||||
l = cl_dlights;
|
||||
|
||||
for (i=0 ; i<MAX_DLIGHTS ; i++, l++)
|
||||
{
|
||||
if (l->die < cl.time || !l->radius)
|
||||
continue;
|
||||
R_MarkLights ( l, 1<<i, cl.worldmodel->nodes );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
=============================================================================
|
||||
|
||||
LIGHT SAMPLING
|
||||
|
||||
=============================================================================
|
||||
*/
|
||||
|
||||
mplane_t *lightplane;
|
||||
vec3_t lightspot;
|
||||
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes start
|
||||
/*
|
||||
int RecursiveLightPoint (mnode_t *node, vec3_t start, vec3_t end)
|
||||
{
|
||||
int r;
|
||||
float front, back, frac;
|
||||
int side;
|
||||
mplane_t *plane;
|
||||
vec3_t mid;
|
||||
msurface_t *surf;
|
||||
int s, t, ds, dt;
|
||||
int i;
|
||||
mtexinfo_t *tex;
|
||||
byte *lightmap;
|
||||
unsigned scale;
|
||||
int maps;
|
||||
|
||||
if (node->contents < 0)
|
||||
return -1; // didn't hit anything
|
||||
|
||||
// calculate mid point
|
||||
|
||||
// FIXME: optimize for axial
|
||||
plane = node->plane;
|
||||
front = DotProduct (start, plane->normal) - plane->dist;
|
||||
back = DotProduct (end, plane->normal) - plane->dist;
|
||||
side = front < 0;
|
||||
|
||||
if ( (back < 0) == side)
|
||||
return RecursiveLightPoint (node->children[side], start, end);
|
||||
|
||||
frac = front / (front-back);
|
||||
mid[0] = start[0] + (end[0] - start[0])*frac;
|
||||
mid[1] = start[1] + (end[1] - start[1])*frac;
|
||||
mid[2] = start[2] + (end[2] - start[2])*frac;
|
||||
|
||||
// go down front side
|
||||
r = RecursiveLightPoint (node->children[side], start, mid);
|
||||
if (r >= 0)
|
||||
return r; // hit something
|
||||
|
||||
if ( (back < 0) == side )
|
||||
return -1; // didn't hit anuthing
|
||||
|
||||
// check for impact on this node
|
||||
VectorCopy (mid, lightspot);
|
||||
lightplane = plane;
|
||||
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
for (i=0 ; i<node->numsurfaces ; i++, surf++)
|
||||
{
|
||||
if (surf->flags & SURF_DRAWTILED)
|
||||
continue; // no lightmaps
|
||||
|
||||
tex = surf->texinfo;
|
||||
|
||||
s = DotProduct (mid, tex->vecs[0]) + tex->vecs[0][3];
|
||||
t = DotProduct (mid, tex->vecs[1]) + tex->vecs[1][3];;
|
||||
|
||||
if (s < surf->texturemins[0] ||
|
||||
t < surf->texturemins[1])
|
||||
continue;
|
||||
|
||||
ds = s - surf->texturemins[0];
|
||||
dt = t - surf->texturemins[1];
|
||||
|
||||
if ( ds > surf->extents[0] || dt > surf->extents[1] )
|
||||
continue;
|
||||
|
||||
if (!surf->samples)
|
||||
return 0;
|
||||
|
||||
ds >>= 4;
|
||||
dt >>= 4;
|
||||
|
||||
lightmap = surf->samples;
|
||||
r = 0;
|
||||
if (lightmap)
|
||||
{
|
||||
|
||||
lightmap += dt * ((surf->extents[0]>>4)+1) + ds;
|
||||
|
||||
for (maps = 0 ; maps < MAXLIGHTMAPS && surf->styles[maps] != 255 ;
|
||||
maps++)
|
||||
{
|
||||
scale = d_lightstylevalue[surf->styles[maps]];
|
||||
r += *lightmap * scale;
|
||||
lightmap += ((surf->extents[0]>>4)+1) *
|
||||
((surf->extents[1]>>4)+1);
|
||||
}
|
||||
|
||||
r >>= 8;
|
||||
}
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
// go down back side
|
||||
return RecursiveLightPoint (node->children[!side], mid, end);
|
||||
}
|
||||
|
||||
int R_LightPoint (vec3_t p)
|
||||
{
|
||||
vec3_t end;
|
||||
int r;
|
||||
|
||||
if (!cl.worldmodel->lightdata)
|
||||
return 255;
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
r = RecursiveLightPoint (cl.worldmodel->nodes, p, end);
|
||||
|
||||
if (r == -1)
|
||||
r = 0;
|
||||
|
||||
return r;
|
||||
}
|
||||
*/
|
||||
|
||||
vec3_t lightcolor; // used by model rendering
|
||||
|
||||
int RecursiveLightPoint (vec3_t color, mnode_t *node, vec3_t start, vec3_t end)
|
||||
{
|
||||
float front, back, frac;
|
||||
vec3_t mid;
|
||||
|
||||
loc0:
|
||||
if (node->contents < 0)
|
||||
return false; // didn't hit anything
|
||||
|
||||
// calculate mid point
|
||||
if (node->plane->type < 3)
|
||||
{
|
||||
front = start[node->plane->type] - node->plane->dist;
|
||||
back = end[node->plane->type] - node->plane->dist;
|
||||
}
|
||||
else
|
||||
{
|
||||
front = DotProduct(start, node->plane->normal) - node->plane->dist;
|
||||
back = DotProduct(end, node->plane->normal) - node->plane->dist;
|
||||
}
|
||||
|
||||
// optimized recursion
|
||||
if ((back < 0) == (front < 0))
|
||||
// return RecursiveLightPoint (color, node->children[front < 0], start, end);
|
||||
{
|
||||
node = node->children[front < 0];
|
||||
goto loc0;
|
||||
}
|
||||
|
||||
frac = front / (front-back);
|
||||
mid[0] = start[0] + (end[0] - start[0])*frac;
|
||||
mid[1] = start[1] + (end[1] - start[1])*frac;
|
||||
mid[2] = start[2] + (end[2] - start[2])*frac;
|
||||
|
||||
// go down front side
|
||||
if (RecursiveLightPoint (color, node->children[front < 0], start, mid))
|
||||
return true; // hit something
|
||||
else
|
||||
{
|
||||
int i, ds, dt;
|
||||
msurface_t *surf;
|
||||
// check for impact on this node
|
||||
VectorCopy (mid, lightspot);
|
||||
lightplane = node->plane;
|
||||
|
||||
surf = cl.worldmodel->surfaces + node->firstsurface;
|
||||
for (i = 0;i < node->numsurfaces;i++, surf++)
|
||||
{
|
||||
if (surf->flags & SURF_DRAWTILED)
|
||||
continue; // no lightmaps
|
||||
|
||||
ds = (int) ((float) DotProduct (mid, surf->texinfo->vecs[0]) + surf->texinfo->vecs[0][3]);
|
||||
dt = (int) ((float) DotProduct (mid, surf->texinfo->vecs[1]) + surf->texinfo->vecs[1][3]);
|
||||
|
||||
if (ds < surf->texturemins[0] || dt < surf->texturemins[1])
|
||||
continue;
|
||||
|
||||
ds -= surf->texturemins[0];
|
||||
dt -= surf->texturemins[1];
|
||||
|
||||
if (ds > surf->extents[0] || dt > surf->extents[1])
|
||||
continue;
|
||||
|
||||
if (surf->samples)
|
||||
{
|
||||
// enhanced to interpolate lighting
|
||||
byte *lightmap;
|
||||
int maps, line3, dsfrac = ds & 15, dtfrac = dt & 15, r00 = 0, g00 = 0, b00 = 0, r01 = 0, g01 = 0, b01 = 0, r10 = 0, g10 = 0, b10 = 0, r11 = 0, g11 = 0, b11 = 0;
|
||||
float scale;
|
||||
line3 = ((surf->extents[0]>>4)+1)*3;
|
||||
|
||||
lightmap = surf->samples + ((dt>>4) * ((surf->extents[0]>>4)+1) + (ds>>4))*3; // LordHavoc: *3 for color
|
||||
|
||||
for (maps = 0;maps < MAXLIGHTMAPS && surf->styles[maps] != 255;maps++)
|
||||
{
|
||||
scale = (float) d_lightstylevalue[surf->styles[maps]] * 1.0 / 256.0;
|
||||
r00 += (float) lightmap[ 0] * scale;g00 += (float) lightmap[ 1] * scale;b00 += (float) lightmap[2] * scale;
|
||||
r01 += (float) lightmap[ 3] * scale;g01 += (float) lightmap[ 4] * scale;b01 += (float) lightmap[5] * scale;
|
||||
r10 += (float) lightmap[line3+0] * scale;g10 += (float) lightmap[line3+1] * scale;b10 += (float) lightmap[line3+2] * scale;
|
||||
r11 += (float) lightmap[line3+3] * scale;g11 += (float) lightmap[line3+4] * scale;b11 += (float) lightmap[line3+5] * scale;
|
||||
lightmap += ((surf->extents[0]>>4)+1) * ((surf->extents[1]>>4)+1)*3; // LordHavoc: *3 for colored lighting
|
||||
}
|
||||
|
||||
color[0] += (float) ((int) ((((((((r11-r10) * dsfrac) >> 4) + r10)-((((r01-r00) * dsfrac) >> 4) + r00)) * dtfrac) >> 4) + ((((r01-r00) * dsfrac) >> 4) + r00)));
|
||||
color[1] += (float) ((int) ((((((((g11-g10) * dsfrac) >> 4) + g10)-((((g01-g00) * dsfrac) >> 4) + g00)) * dtfrac) >> 4) + ((((g01-g00) * dsfrac) >> 4) + g00)));
|
||||
color[2] += (float) ((int) ((((((((b11-b10) * dsfrac) >> 4) + b10)-((((b01-b00) * dsfrac) >> 4) + b00)) * dtfrac) >> 4) + ((((b01-b00) * dsfrac) >> 4) + b00)));
|
||||
}
|
||||
return true; // success
|
||||
}
|
||||
|
||||
// go down back side
|
||||
return RecursiveLightPoint (color, node->children[front >= 0], mid, end);
|
||||
}
|
||||
}
|
||||
|
||||
int R_LightPoint (vec3_t p)
|
||||
{
|
||||
vec3_t end;
|
||||
|
||||
if (r_fullbright->value || !cl.worldmodel->lightdata)
|
||||
{
|
||||
lightcolor[0] = lightcolor[1] = lightcolor[2] = 255;
|
||||
return 255;
|
||||
}
|
||||
|
||||
end[0] = p[0];
|
||||
end[1] = p[1];
|
||||
end[2] = p[2] - 2048;
|
||||
|
||||
lightcolor[0] = lightcolor[1] = lightcolor[2] = 0;
|
||||
RecursiveLightPoint (lightcolor, cl.worldmodel->nodes, p, end);
|
||||
return ((lightcolor[0] + lightcolor[1] + lightcolor[2]) * (1.0f / 3.0f));
|
||||
}
|
||||
// 2001-09-11 Colored lightning by LordHavoc/Sarcazm/Maddes end
|
1270
WinQuake/gl_rmain.c
1270
WinQuake/gl_rmain.c
File diff suppressed because it is too large
Load diff
|
@ -1,529 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// r_misc.c
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
cvar_t *gl_glowmap; // 1999-12-28 OpenGL fullbright fix by Neal White III
|
||||
cvar_t *gl_maxdepth; // 2002-01-31 GLQuake HOM fix by Matador
|
||||
|
||||
/*
|
||||
==================
|
||||
R_InitTextures
|
||||
==================
|
||||
*/
|
||||
void R_InitTextures (void)
|
||||
{
|
||||
int x,y, m;
|
||||
byte *dest;
|
||||
|
||||
// create a simple checkerboard texture for the default
|
||||
r_notexture_mip = Hunk_AllocName (sizeof(texture_t) + 16*16+8*8+4*4+2*2, "notexture");
|
||||
|
||||
r_notexture_mip->width = r_notexture_mip->height = 16;
|
||||
r_notexture_mip->offsets[0] = sizeof(texture_t);
|
||||
r_notexture_mip->offsets[1] = r_notexture_mip->offsets[0] + 16*16;
|
||||
r_notexture_mip->offsets[2] = r_notexture_mip->offsets[1] + 8*8;
|
||||
r_notexture_mip->offsets[3] = r_notexture_mip->offsets[2] + 4*4;
|
||||
|
||||
for (m=0 ; m<4 ; m++)
|
||||
{
|
||||
dest = (byte *)r_notexture_mip + r_notexture_mip->offsets[m];
|
||||
for (y=0 ; y< (16>>m) ; y++)
|
||||
for (x=0 ; x< (16>>m) ; x++)
|
||||
{
|
||||
if ( (y< (8>>m) ) ^ (x< (8>>m) ) )
|
||||
*dest++ = 0;
|
||||
else
|
||||
*dest++ = 0xff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
byte dottexture[8][8] =
|
||||
{
|
||||
{0,1,1,0,0,0,0,0},
|
||||
{1,1,1,1,0,0,0,0},
|
||||
{1,1,1,1,0,0,0,0},
|
||||
{0,1,1,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
{0,0,0,0,0,0,0,0},
|
||||
};
|
||||
void R_InitParticleTexture (void)
|
||||
{
|
||||
int x,y;
|
||||
byte data[8][8][4];
|
||||
|
||||
//
|
||||
// particle texture
|
||||
//
|
||||
particletexture = texture_extension_number++;
|
||||
GL_Bind(particletexture);
|
||||
|
||||
for (x=0 ; x<8 ; x++)
|
||||
{
|
||||
for (y=0 ; y<8 ; y++)
|
||||
{
|
||||
data[y][x][0] = 255;
|
||||
data[y][x][1] = 255;
|
||||
data[y][x][2] = 255;
|
||||
data[y][x][3] = dottexture[x][y]*255;
|
||||
}
|
||||
}
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_alpha_format, 8, 8, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_Envmap_f
|
||||
|
||||
Grab six views for environment mapping tests
|
||||
===============
|
||||
*/
|
||||
void R_Envmap_f (void)
|
||||
{
|
||||
byte buffer[256*256*4];
|
||||
char name[1024];
|
||||
|
||||
glDrawBuffer (GL_FRONT);
|
||||
glReadBuffer (GL_FRONT);
|
||||
envmap = true;
|
||||
|
||||
r_refdef.vrect.x = 0;
|
||||
r_refdef.vrect.y = 0;
|
||||
r_refdef.vrect.width = 256;
|
||||
r_refdef.vrect.height = 256;
|
||||
|
||||
r_refdef.viewangles[0] = 0;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
r_refdef.viewangles[2] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env0.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 90;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env1.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 180;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env2.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[1] = 270;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env3.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[0] = -90;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env4.rgb", buffer, sizeof(buffer));
|
||||
|
||||
r_refdef.viewangles[0] = 90;
|
||||
r_refdef.viewangles[1] = 0;
|
||||
GL_BeginRendering (&glx, &gly, &glwidth, &glheight);
|
||||
R_RenderView ();
|
||||
glReadPixels (0, 0, 256, 256, GL_RGBA, GL_UNSIGNED_BYTE, buffer);
|
||||
COM_WriteFile ("env5.rgb", buffer, sizeof(buffer));
|
||||
|
||||
envmap = false;
|
||||
glDrawBuffer (GL_BACK);
|
||||
glReadBuffer (GL_BACK);
|
||||
GL_EndRendering ();
|
||||
}
|
||||
|
||||
// 2001-09-18 New cvar system by Maddes (Init) start
|
||||
/*
|
||||
===============
|
||||
R_Init_Cvars
|
||||
===============
|
||||
*/
|
||||
void
|
||||
R_Init_Cvars (void)
|
||||
{
|
||||
extern cvar_t *gl_finish;
|
||||
|
||||
r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_ORIGINAL);
|
||||
r_lightmap = Cvar_Get ("r_lightmap", "0", CVAR_ORIGINAL);
|
||||
r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_ORIGINAL);
|
||||
r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_ORIGINAL);
|
||||
r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ORIGINAL);
|
||||
r_shadows = Cvar_Get ("r_shadows", "0", CVAR_ORIGINAL);
|
||||
r_mirroralpha = Cvar_Get ("r_mirroralpha", "1", CVAR_ORIGINAL);
|
||||
r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_ORIGINAL);
|
||||
r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_ORIGINAL);
|
||||
r_novis = Cvar_Get ("r_novis", "0", CVAR_ORIGINAL);
|
||||
r_speeds = Cvar_Get ("r_speeds", "0", CVAR_ORIGINAL);
|
||||
r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_ORIGINAL); // 2000-01-02 Missing R_WATERWARP fix by Radix
|
||||
|
||||
gl_finish = Cvar_Get ("gl_finish", "0", CVAR_ORIGINAL);
|
||||
gl_clear = Cvar_Get ("gl_clear", "0", CVAR_ORIGINAL);
|
||||
gl_texsort = Cvar_Get ("gl_texsort", "1", CVAR_ORIGINAL);
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III start
|
||||
gl_glowmap = Cvar_Get ("gl_glowmap", "0", CVAR_NONE);
|
||||
Cvar_SetRangecheck (gl_glowmap, Cvar_RangecheckBool, 0, 1);
|
||||
Cvar_Set(gl_glowmap, gl_glowmap->string); // do rangecheck
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III end
|
||||
|
||||
if (gl_mtexable)
|
||||
{ // 1999-12-28 OpenGL fullbright fix by Neal White III
|
||||
Cvar_Set (gl_texsort, "0");
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III start
|
||||
Cvar_Set (gl_glowmap, "1");
|
||||
}
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III end
|
||||
|
||||
gl_cull = Cvar_Get ("gl_cull", "1", CVAR_ORIGINAL);
|
||||
gl_smoothmodels = Cvar_Get ("gl_smoothmodels", "1", CVAR_ORIGINAL);
|
||||
gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_ORIGINAL);
|
||||
gl_polyblend = Cvar_Get ("gl_polyblend", "1", CVAR_ORIGINAL);
|
||||
gl_flashblend = Cvar_Get ("gl_flashblend", "1", CVAR_ORIGINAL);
|
||||
gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_ORIGINAL);
|
||||
gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_ORIGINAL);
|
||||
gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "0", CVAR_ORIGINAL);
|
||||
gl_reporttjunctions = Cvar_Get ("gl_reporttjunctions", "0", CVAR_ORIGINAL);
|
||||
gl_doubleeyes = Cvar_Get ("gl_doubleeys", "1", CVAR_ORIGINAL);
|
||||
|
||||
// 2002-01-31 GLQuake HOM fix by Matador start
|
||||
gl_maxdepth = Cvar_Get ("gl_maxdepth", "4096", CVAR_NONE);
|
||||
Cvar_SetRangecheck (gl_maxdepth, Cvar_RangecheckInt, 4096, 8192);
|
||||
Cvar_Set(gl_maxdepth, gl_maxdepth->string); // do rangecheck
|
||||
// 2002-01-31 GLQuake HOM fix by Matador end
|
||||
}
|
||||
// 2001-09-18 New cvar system by Maddes (Init) end
|
||||
|
||||
/*
|
||||
===============
|
||||
R_Init
|
||||
===============
|
||||
*/
|
||||
void R_Init (void)
|
||||
{
|
||||
extern byte *hunk_base;
|
||||
// extern cvar_t *gl_finish; // 2001-09-18 New cvar system by Maddes (Init)
|
||||
|
||||
Cmd_AddCommand ("timerefresh", R_TimeRefresh_f);
|
||||
Cmd_AddCommand ("envmap", R_Envmap_f);
|
||||
Cmd_AddCommand ("pointfile", R_ReadPointFile_f);
|
||||
|
||||
// 2001-09-18 New cvar system by Maddes (Init) start
|
||||
/*
|
||||
r_norefresh = Cvar_Get ("r_norefresh", "0", CVAR_ORIGINAL);
|
||||
r_lightmap = Cvar_Get ("r_lightmap", "0", CVAR_ORIGINAL);
|
||||
r_fullbright = Cvar_Get ("r_fullbright", "0", CVAR_ORIGINAL);
|
||||
r_drawentities = Cvar_Get ("r_drawentities", "1", CVAR_ORIGINAL);
|
||||
r_drawviewmodel = Cvar_Get ("r_drawviewmodel", "1", CVAR_ORIGINAL);
|
||||
r_shadows = Cvar_Get ("r_shadows", "0", CVAR_ORIGINAL);
|
||||
r_mirroralpha = Cvar_Get ("r_mirroralpha", "1", CVAR_ORIGINAL);
|
||||
r_wateralpha = Cvar_Get ("r_wateralpha", "1", CVAR_ORIGINAL);
|
||||
r_dynamic = Cvar_Get ("r_dynamic", "1", CVAR_ORIGINAL);
|
||||
r_novis = Cvar_Get ("r_novis", "0", CVAR_ORIGINAL);
|
||||
r_speeds = Cvar_Get ("r_speeds", "0", CVAR_ORIGINAL);
|
||||
r_waterwarp = Cvar_Get ("r_waterwarp", "1", CVAR_ORIGINAL); // 2000-01-02 Missing R_WATERWARP fix by Radix
|
||||
|
||||
gl_finish = Cvar_Get ("gl_finish", "0", CVAR_ORIGINAL);
|
||||
gl_clear = Cvar_Get ("gl_clear", "0", CVAR_ORIGINAL);
|
||||
gl_texsort = Cvar_Get ("gl_texsort", "1", CVAR_ORIGINAL);
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III start
|
||||
gl_glowmap = Cvar_Get ("gl_glowmap", "0", CVAR_NONE);
|
||||
Cvar_SetRangecheck (gl_glowmap, Cvar_RangecheckBool, 0, 1);
|
||||
Cvar_Set(gl_glowmap, gl_glowmap->string); // do rangecheck
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III end
|
||||
|
||||
if (gl_mtexable)
|
||||
{ // 1999-12-28 OpenGL fullbright fix by Neal White III
|
||||
Cvar_Set (gl_texsort, "0");
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III start
|
||||
Cvar_Set (gl_glowmap, "1");
|
||||
}
|
||||
// 1999-12-28 OpenGL fullbright fix by Neal White III end
|
||||
|
||||
gl_cull = Cvar_Get ("gl_cull", "1", CVAR_ORIGINAL);
|
||||
gl_smoothmodels = Cvar_Get ("gl_smoothmodels", "1", CVAR_ORIGINAL);
|
||||
gl_affinemodels = Cvar_Get ("gl_affinemodels", "0", CVAR_ORIGINAL);
|
||||
gl_polyblend = Cvar_Get ("gl_polyblend", "1", CVAR_ORIGINAL);
|
||||
gl_flashblend = Cvar_Get ("gl_flashblend", "1", CVAR_ORIGINAL);
|
||||
gl_playermip = Cvar_Get ("gl_playermip", "0", CVAR_ORIGINAL);
|
||||
gl_nocolors = Cvar_Get ("gl_nocolors", "0", CVAR_ORIGINAL);
|
||||
gl_keeptjunctions = Cvar_Get ("gl_keeptjunctions", "0", CVAR_ORIGINAL);
|
||||
gl_reporttjunctions = Cvar_Get ("gl_reporttjunctions", "0", CVAR_ORIGINAL);
|
||||
gl_doubleeyes = Cvar_Get ("gl_doubleeys", "1", CVAR_ORIGINAL);
|
||||
*/
|
||||
// 2001-09-18 New cvar system by Maddes (Init) end
|
||||
|
||||
R_InitParticles ();
|
||||
R_InitParticleTexture ();
|
||||
|
||||
#ifdef GLTEST
|
||||
Test_Init ();
|
||||
#endif
|
||||
|
||||
playertextures = texture_extension_number;
|
||||
texture_extension_number += 16;
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
R_TranslatePlayerSkin
|
||||
|
||||
Translates a skin texture by the per-player color lookup
|
||||
===============
|
||||
*/
|
||||
void R_TranslatePlayerSkin (int playernum)
|
||||
{
|
||||
int top, bottom;
|
||||
byte translate[256];
|
||||
unsigned translate32[256];
|
||||
int i, j, s;
|
||||
model_t *model;
|
||||
aliashdr_t *paliashdr;
|
||||
byte *original;
|
||||
unsigned pixels[512*256], *out;
|
||||
unsigned scaled_width, scaled_height;
|
||||
int inwidth, inheight;
|
||||
byte *inrow;
|
||||
unsigned frac, fracstep;
|
||||
extern byte **player_8bit_texels_tbl;
|
||||
|
||||
GL_DisableMultitexture();
|
||||
|
||||
top = cl.scores[playernum].colors & 0xf0;
|
||||
bottom = (cl.scores[playernum].colors &15)<<4;
|
||||
|
||||
for (i=0 ; i<256 ; i++)
|
||||
translate[i] = i;
|
||||
|
||||
for (i=0 ; i<16 ; i++)
|
||||
{
|
||||
if (top < 128) // the artists made some backwards ranges. sigh.
|
||||
translate[TOP_RANGE+i] = top+i;
|
||||
else
|
||||
translate[TOP_RANGE+i] = top+15-i;
|
||||
|
||||
if (bottom < 128)
|
||||
translate[BOTTOM_RANGE+i] = bottom+i;
|
||||
else
|
||||
translate[BOTTOM_RANGE+i] = bottom+15-i;
|
||||
}
|
||||
|
||||
//
|
||||
// locate the original skin pixels
|
||||
//
|
||||
currententity = &cl_entities[1+playernum];
|
||||
model = currententity->model;
|
||||
if (!model)
|
||||
return; // player doesn't have a model yet
|
||||
if (model->type != mod_alias)
|
||||
return; // only translate skins on alias models
|
||||
|
||||
paliashdr = (aliashdr_t *)Mod_Extradata (model);
|
||||
s = paliashdr->skinwidth * paliashdr->skinheight;
|
||||
if (currententity->skinnum < 0 || currententity->skinnum >= paliashdr->numskins) {
|
||||
Con_DPrintf("(%d): Invalid player skin #%d\n", playernum, currententity->skinnum); // 1999-12-27 Invalid skin number as developer message by Maddes
|
||||
original = (byte *)paliashdr + paliashdr->texels[0];
|
||||
} else
|
||||
original = (byte *)paliashdr + paliashdr->texels[currententity->skinnum];
|
||||
if (s & 3)
|
||||
Sys_Error ("R_TranslateSkin: s&3");
|
||||
|
||||
inwidth = paliashdr->skinwidth;
|
||||
inheight = paliashdr->skinheight;
|
||||
|
||||
// because this happens during gameplay, do it fast
|
||||
// instead of sending it through gl_upload 8
|
||||
GL_Bind(playertextures + playernum);
|
||||
|
||||
#if 0
|
||||
byte translated[320*200];
|
||||
|
||||
for (i=0 ; i<s ; i+=4)
|
||||
{
|
||||
translated[i] = translate[original[i]];
|
||||
translated[i+1] = translate[original[i+1]];
|
||||
translated[i+2] = translate[original[i+2]];
|
||||
translated[i+3] = translate[original[i+3]];
|
||||
}
|
||||
|
||||
|
||||
// don't mipmap these, because it takes too long
|
||||
GL_Upload8 (translated, paliashdr->skinwidth, paliashdr->skinheight, false, false, true);
|
||||
#else
|
||||
scaled_width = gl_max_size->value < 512 ? gl_max_size->value : 512;
|
||||
scaled_height = gl_max_size->value < 256 ? gl_max_size->value : 256;
|
||||
|
||||
// allow users to crunch sizes down even more if they want
|
||||
scaled_width >>= (int)gl_playermip->value;
|
||||
scaled_height >>= (int)gl_playermip->value;
|
||||
|
||||
if (VID_Is8bit()) { // 8bit texture upload
|
||||
byte *out2;
|
||||
|
||||
out2 = (byte *)pixels;
|
||||
memset(pixels, 0, sizeof(pixels));
|
||||
fracstep = inwidth*0x10000/scaled_width;
|
||||
for (i=0 ; i<scaled_height ; i++, out2 += scaled_width)
|
||||
{
|
||||
inrow = original + inwidth*(i*inheight/scaled_height);
|
||||
frac = fracstep >> 1;
|
||||
for (j=0 ; j<scaled_width ; j+=4)
|
||||
{
|
||||
out2[j] = translate[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
out2[j+1] = translate[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
out2[j+2] = translate[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
out2[j+3] = translate[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
}
|
||||
}
|
||||
|
||||
GL_Upload8_EXT ((byte *)pixels, scaled_width, scaled_height, false, false);
|
||||
return;
|
||||
}
|
||||
|
||||
for (i=0 ; i<256 ; i++)
|
||||
translate32[i] = d_8to24table[translate[i]];
|
||||
|
||||
out = pixels;
|
||||
fracstep = inwidth*0x10000/scaled_width;
|
||||
for (i=0 ; i<scaled_height ; i++, out += scaled_width)
|
||||
{
|
||||
inrow = original + inwidth*(i*inheight/scaled_height);
|
||||
frac = fracstep >> 1;
|
||||
for (j=0 ; j<scaled_width ; j+=4)
|
||||
{
|
||||
out[j] = translate32[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
out[j+1] = translate32[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
out[j+2] = translate32[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
out[j+3] = translate32[inrow[frac>>16]];
|
||||
frac += fracstep;
|
||||
}
|
||||
}
|
||||
glTexImage2D (GL_TEXTURE_2D, 0, gl_solid_format, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, pixels);
|
||||
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
===============
|
||||
R_NewMap
|
||||
===============
|
||||
*/
|
||||
void R_NewMap (void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0 ; i<256 ; i++)
|
||||
d_lightstylevalue[i] = 264; // normal light value
|
||||
|
||||
memset (&r_worldentity, 0, sizeof(r_worldentity));
|
||||
r_worldentity.model = cl.worldmodel;
|
||||
|
||||
// clear out efrags in case the level hasn't been reloaded
|
||||
// FIXME: is this one short?
|
||||
for (i=0 ; i<cl.worldmodel->numleafs ; i++)
|
||||
cl.worldmodel->leafs[i].efrags = NULL;
|
||||
|
||||
r_viewleaf = NULL;
|
||||
R_ClearParticles ();
|
||||
|
||||
GL_BuildLightmaps ();
|
||||
|
||||
// identify sky texture
|
||||
skytexturenum = -1;
|
||||
mirrortexturenum = -1;
|
||||
for (i=0 ; i<cl.worldmodel->numtextures ; i++)
|
||||
{
|
||||
if (!cl.worldmodel->textures[i])
|
||||
continue;
|
||||
if (!strncmp(cl.worldmodel->textures[i]->name,"sky",3) )
|
||||
skytexturenum = i;
|
||||
if (!strncmp(cl.worldmodel->textures[i]->name,"window02_1",10) )
|
||||
mirrortexturenum = i;
|
||||
cl.worldmodel->textures[i]->texturechain = NULL;
|
||||
}
|
||||
#ifdef QUAKE2
|
||||
R_LoadSkys ();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
====================
|
||||
R_TimeRefresh_f
|
||||
|
||||
For program optimization
|
||||
====================
|
||||
*/
|
||||
void R_TimeRefresh_f (void)
|
||||
{
|
||||
int i;
|
||||
float start, stop, time;
|
||||
int startangle;
|
||||
vrect_t vr;
|
||||
|
||||
glDrawBuffer (GL_FRONT);
|
||||
glFinish ();
|
||||
|
||||
start = Sys_FloatTime ();
|
||||
for (i=0 ; i<128 ; i++)
|
||||
{
|
||||
r_refdef.viewangles[1] = i/128.0*360.0;
|
||||
R_RenderView ();
|
||||
}
|
||||
|
||||
glFinish ();
|
||||
stop = Sys_FloatTime ();
|
||||
time = stop-start;
|
||||
Con_Printf ("%f seconds (%f fps)\n", time, 128/time);
|
||||
|
||||
glDrawBuffer (GL_BACK);
|
||||
GL_EndRendering ();
|
||||
}
|
||||
|
||||
void D_FlushCaches (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
1887
WinQuake/gl_rsurf.c
1887
WinQuake/gl_rsurf.c
File diff suppressed because it is too large
Load diff
1024
WinQuake/gl_screen.c
1024
WinQuake/gl_screen.c
File diff suppressed because it is too large
Load diff
|
@ -1,182 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
|
||||
#include "quakedef.h"
|
||||
|
||||
#ifdef GLTEST
|
||||
|
||||
typedef struct
|
||||
{
|
||||
plane_t *plane;
|
||||
vec3_t origin;
|
||||
vec3_t normal;
|
||||
vec3_t up;
|
||||
vec3_t right;
|
||||
vec3_t reflect;
|
||||
float length;
|
||||
} puff_t;
|
||||
|
||||
#define MAX_PUFFS 64
|
||||
|
||||
puff_t puffs[MAX_PUFFS];
|
||||
|
||||
|
||||
void Test_Init (void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
plane_t junk;
|
||||
plane_t *HitPlane (vec3_t start, vec3_t end)
|
||||
{
|
||||
trace_t trace;
|
||||
|
||||
// fill in a default trace
|
||||
memset (&trace, 0, sizeof(trace_t));
|
||||
trace.fraction = 1;
|
||||
trace.allsolid = true;
|
||||
VectorCopy (end, trace.endpos);
|
||||
|
||||
SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace);
|
||||
|
||||
junk = trace.plane;
|
||||
return &junk;
|
||||
}
|
||||
|
||||
void Test_Spawn (vec3_t origin)
|
||||
{
|
||||
int i;
|
||||
puff_t *p;
|
||||
vec3_t temp;
|
||||
vec3_t normal;
|
||||
vec3_t incoming;
|
||||
plane_t *plane;
|
||||
float d;
|
||||
|
||||
for (i=0,p=puffs ; i<MAX_PUFFS ; i++,p++)
|
||||
{
|
||||
if (p->length <= 0)
|
||||
break;
|
||||
}
|
||||
if (i == MAX_PUFFS)
|
||||
return;
|
||||
|
||||
VectorSubtract (r_refdef.vieworg, origin, incoming);
|
||||
VectorSubtract (origin, incoming, temp);
|
||||
plane = HitPlane (r_refdef.vieworg, temp);
|
||||
|
||||
VectorNormalize (incoming);
|
||||
d = DotProduct (incoming, plane->normal);
|
||||
VectorSubtract (vec3_origin, incoming, p->reflect);
|
||||
VectorMA (p->reflect, d*2, plane->normal, p->reflect);
|
||||
|
||||
VectorCopy (origin, p->origin);
|
||||
VectorCopy (plane->normal, p->normal);
|
||||
|
||||
CrossProduct (incoming, p->normal, p->up);
|
||||
|
||||
CrossProduct (p->up, p->normal, p->right);
|
||||
|
||||
p->length = 8;
|
||||
}
|
||||
|
||||
void DrawPuff (puff_t *p)
|
||||
{
|
||||
vec3_t pts[2][3];
|
||||
int i, j;
|
||||
float s, d;
|
||||
|
||||
for (i=0 ; i<2 ; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
{
|
||||
s = 6;
|
||||
d = p->length;
|
||||
}
|
||||
else
|
||||
{
|
||||
s = 2;
|
||||
d = 0;
|
||||
}
|
||||
|
||||
for (j=0 ; j<3 ; j++)
|
||||
{
|
||||
pts[i][0][j] = p->origin[j] + p->up[j]*s + p->reflect[j]*d;
|
||||
pts[i][1][j] = p->origin[j] + p->right[j]*s + p->reflect[j]*d;
|
||||
pts[i][2][j] = p->origin[j] + -p->right[j]*s + p->reflect[j]*d;
|
||||
}
|
||||
}
|
||||
|
||||
glColor3f (1, 0, 0);
|
||||
|
||||
#if 0
|
||||
glBegin (GL_LINES);
|
||||
glVertex3fv (p->origin);
|
||||
glVertex3f (p->origin[0] + p->length*p->reflect[0],
|
||||
p->origin[1] + p->length*p->reflect[1],
|
||||
p->origin[2] + p->length*p->reflect[2]);
|
||||
|
||||
glVertex3fv (pts[0][0]);
|
||||
glVertex3fv (pts[1][0]);
|
||||
|
||||
glVertex3fv (pts[0][1]);
|
||||
glVertex3fv (pts[1][1]);
|
||||
|
||||
glVertex3fv (pts[0][2]);
|
||||
glVertex3fv (pts[1][2]);
|
||||
|
||||
glEnd ();
|
||||
#endif
|
||||
|
||||
glBegin (GL_QUADS);
|
||||
for (i=0 ; i<3 ; i++)
|
||||
{
|
||||
j = (i+1)%3;
|
||||
glVertex3fv (pts[0][j]);
|
||||
glVertex3fv (pts[1][j]);
|
||||
glVertex3fv (pts[1][i]);
|
||||
glVertex3fv (pts[0][i]);
|
||||
}
|
||||
glEnd ();
|
||||
|
||||
glBegin (GL_TRIANGLES);
|
||||
glVertex3fv (pts[1][0]);
|
||||
glVertex3fv (pts[1][1]);
|
||||
glVertex3fv (pts[1][2]);
|
||||
glEnd ();
|
||||
|
||||
p->length -= host_frametime*2;
|
||||
}
|
||||
|
||||
|
||||
void Test_Draw (void)
|
||||
{
|
||||
int i;
|
||||
puff_t *p;
|
||||
|
||||
for (i=0, p=puffs ; i<MAX_PUFFS ; i++,p++)
|
||||
{
|
||||
if (p->length > 0)
|
||||
DrawPuff (p);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
|
@ -1,894 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/vt.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
#include <dlfcn.h>
|
||||
|
||||
/*#include "vga.h" */
|
||||
#include "vgakeyboard.h"
|
||||
#include "vgamouse.h"
|
||||
|
||||
#include "quakedef.h"
|
||||
#include "GL/fxmesa.h"
|
||||
|
||||
#define WARP_WIDTH 320
|
||||
#define WARP_HEIGHT 200
|
||||
|
||||
static fxMesaContext fc = NULL;
|
||||
#define stringify(m) { #m, m }
|
||||
|
||||
unsigned short d_8to16table[256];
|
||||
unsigned d_8to24table[256];
|
||||
unsigned char d_15to8table[65536];
|
||||
|
||||
int num_shades=32;
|
||||
|
||||
struct
|
||||
{
|
||||
char *name;
|
||||
int num;
|
||||
} mice[] =
|
||||
{
|
||||
stringify(MOUSE_MICROSOFT),
|
||||
stringify(MOUSE_MOUSESYSTEMS),
|
||||
stringify(MOUSE_MMSERIES),
|
||||
stringify(MOUSE_LOGITECH),
|
||||
stringify(MOUSE_BUSMOUSE),
|
||||
stringify(MOUSE_PS2),
|
||||
};
|
||||
|
||||
static unsigned char scantokey[128];
|
||||
|
||||
int num_mice = sizeof (mice) / sizeof(mice[0]);
|
||||
|
||||
int d_con_indirect = 0;
|
||||
|
||||
int svgalib_inited=0;
|
||||
int UseMouse = 1;
|
||||
int UseKeyboard = 1;
|
||||
|
||||
int mouserate = MOUSE_DEFAULTSAMPLERATE;
|
||||
|
||||
cvar_t *vid_mode;
|
||||
cvar_t *vid_redrawfull;
|
||||
cvar_t *vid_waitforrefresh;
|
||||
|
||||
char *framebuffer_ptr;
|
||||
|
||||
cvar_t *mouse_button_commands[3];
|
||||
|
||||
int mouse_buttons;
|
||||
int mouse_buttonstate;
|
||||
int mouse_oldbuttonstate;
|
||||
float mouse_x, mouse_y;
|
||||
float old_mouse_x, old_mouse_y;
|
||||
int mx, my;
|
||||
|
||||
cvar_t *m_filter;
|
||||
|
||||
int scr_width, scr_height;
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
|
||||
//int texture_mode = GL_NEAREST;
|
||||
//int texture_mode = GL_NEAREST_MIPMAP_NEAREST;
|
||||
//int texture_mode = GL_NEAREST_MIPMAP_LINEAR;
|
||||
int texture_mode = GL_LINEAR;
|
||||
//int texture_mode = GL_LINEAR_MIPMAP_NEAREST;
|
||||
//int texture_mode = GL_LINEAR_MIPMAP_LINEAR;
|
||||
|
||||
int texture_extension_number = 1;
|
||||
|
||||
float gldepthmin, gldepthmax;
|
||||
|
||||
cvar_t *gl_ztrick;
|
||||
|
||||
const char *gl_vendor;
|
||||
const char *gl_renderer;
|
||||
const char *gl_version;
|
||||
const char *gl_extensions;
|
||||
|
||||
void (*qgl3DfxSetPaletteEXT) (GLuint *);
|
||||
void (*qglColorTableEXT) (int, int, int, int, int, const void *);
|
||||
|
||||
static float vid_gamma = 1.0;
|
||||
|
||||
qboolean is8bit = false;
|
||||
qboolean isPermedia = false;
|
||||
qboolean gl_mtexable = false;
|
||||
|
||||
/*-----------------------------------------------------------------------*/
|
||||
void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
void D_EndDirectRect (int x, int y, int width, int height)
|
||||
{
|
||||
}
|
||||
|
||||
int matchmouse(int mouse, char *name)
|
||||
{
|
||||
int i;
|
||||
for (i=0 ; i<num_mice ; i++)
|
||||
if (!strcmp(mice[i].name, name))
|
||||
return i;
|
||||
return mouse;
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
void vtswitch(int newconsole)
|
||||
{
|
||||
|
||||
int fd;
|
||||
struct vt_stat x;
|
||||
|
||||
// switch consoles and wait until reactivated
|
||||
fd = open("/dev/console", O_RDONLY);
|
||||
ioctl(fd, VT_GETSTATE, &x);
|
||||
ioctl(fd, VT_ACTIVATE, newconsole);
|
||||
ioctl(fd, VT_WAITACTIVE, x.v_active);
|
||||
close(fd);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void keyhandler(int scancode, int state)
|
||||
{
|
||||
|
||||
int sc;
|
||||
|
||||
sc = scancode & 0x7f;
|
||||
|
||||
Key_Event(scantokey[sc], state == KEY_EVENTPRESS);
|
||||
|
||||
}
|
||||
|
||||
void VID_Shutdown(void)
|
||||
{
|
||||
if (!fc)
|
||||
return;
|
||||
|
||||
fxMesaDestroyContext(fc);
|
||||
|
||||
if (UseKeyboard)
|
||||
keyboard_close();
|
||||
}
|
||||
|
||||
void signal_handler(int sig)
|
||||
{
|
||||
printf("Received signal %d, exiting...\n", sig);
|
||||
Sys_Quit();
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void InitSig(void)
|
||||
{
|
||||
signal(SIGHUP, signal_handler);
|
||||
signal(SIGINT, signal_handler);
|
||||
signal(SIGQUIT, signal_handler);
|
||||
signal(SIGILL, signal_handler);
|
||||
signal(SIGTRAP, signal_handler);
|
||||
signal(SIGIOT, signal_handler);
|
||||
signal(SIGBUS, signal_handler);
|
||||
signal(SIGFPE, signal_handler);
|
||||
signal(SIGSEGV, signal_handler);
|
||||
signal(SIGTERM, signal_handler);
|
||||
}
|
||||
|
||||
void VID_ShiftPalette(unsigned char *p)
|
||||
{
|
||||
// VID_SetPalette(p);
|
||||
}
|
||||
|
||||
void VID_SetPalette (unsigned char *palette)
|
||||
{
|
||||
byte *pal;
|
||||
unsigned r,g,b;
|
||||
unsigned v;
|
||||
int r1,g1,b1;
|
||||
int j,k,l,m;
|
||||
unsigned short i;
|
||||
unsigned *table;
|
||||
FILE *f;
|
||||
char s[255];
|
||||
int dist, bestdist;
|
||||
static qboolean palflag = false;
|
||||
|
||||
//
|
||||
// 8 8 8 encoding
|
||||
//
|
||||
pal = palette;
|
||||
table = d_8to24table;
|
||||
for (i=0 ; i<256 ; i++)
|
||||
{
|
||||
r = pal[0];
|
||||
g = pal[1];
|
||||
b = pal[2];
|
||||
pal += 3;
|
||||
|
||||
v = (255<<24) + (r<<0) + (g<<8) + (b<<16);
|
||||
*table++ = v;
|
||||
}
|
||||
d_8to24table[255] &= 0xffffff; // 255 is transparent
|
||||
|
||||
// JACK: 3D distance calcs - k is last closest, l is the distance.
|
||||
for (i=0; i < (1<<15); i++) {
|
||||
/* Maps
|
||||
000000000000000
|
||||
000000000011111 = Red = 0x1F
|
||||
000001111100000 = Blue = 0x03E0
|
||||
111110000000000 = Grn = 0x7C00
|
||||
*/
|
||||
r = ((i & 0x1F) << 3)+4;
|
||||
g = ((i & 0x03E0) >> 2)+4;
|
||||
b = ((i & 0x7C00) >> 7)+4;
|
||||
pal = (unsigned char *)d_8to24table;
|
||||
for (v=0,k=0,bestdist=10000*10000; v<256; v++,pal+=4) {
|
||||
r1 = (int)r - (int)pal[0];
|
||||
g1 = (int)g - (int)pal[1];
|
||||
b1 = (int)b - (int)pal[2];
|
||||
dist = (r1*r1)+(g1*g1)+(b1*b1);
|
||||
if (dist < bestdist) {
|
||||
k=v;
|
||||
bestdist = dist;
|
||||
}
|
||||
}
|
||||
d_15to8table[i]=k;
|
||||
}
|
||||
}
|
||||
|
||||
void CheckMultiTextureExtensions(void)
|
||||
{
|
||||
void *prjobj;
|
||||
|
||||
if (strstr(gl_extensions, "GL_SGIS_multitexture ") && !COM_CheckParm("-nomtex")) {
|
||||
Con_Printf("Found GL_SGIS_multitexture...\n");
|
||||
|
||||
if ((prjobj = dlopen(NULL, RTLD_LAZY)) == NULL) {
|
||||
Con_Printf("Unable to open symbol list for main program.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
qglMTexCoord2fSGIS = (void *) dlsym(prjobj, "glMTexCoord2fSGIS");
|
||||
qglSelectTextureSGIS = (void *) dlsym(prjobj, "glSelectTextureSGIS");
|
||||
|
||||
if (qglMTexCoord2fSGIS && qglSelectTextureSGIS) {
|
||||
Con_Printf("Multitexture extensions found.\n");
|
||||
gl_mtexable = true;
|
||||
} else
|
||||
Con_Printf("Symbol not found, disabled.\n");
|
||||
|
||||
dlclose(prjobj);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
GL_Init
|
||||
===============
|
||||
*/
|
||||
void GL_Init (void)
|
||||
{
|
||||
gl_vendor = glGetString (GL_VENDOR);
|
||||
Con_Printf ("GL_VENDOR: %s\n", gl_vendor);
|
||||
gl_renderer = glGetString (GL_RENDERER);
|
||||
Con_Printf ("GL_RENDERER: %s\n", gl_renderer);
|
||||
|
||||
gl_version = glGetString (GL_VERSION);
|
||||
Con_Printf ("GL_VERSION: %s\n", gl_version);
|
||||
gl_extensions = glGetString (GL_EXTENSIONS);
|
||||
Con_Printf ("GL_EXTENSIONS: %s\n", gl_extensions);
|
||||
|
||||
// Con_Printf ("%s %s\n", gl_renderer, gl_version);
|
||||
|
||||
CheckMultiTextureExtensions ();
|
||||
|
||||
glClearColor (1,0,0,0);
|
||||
glCullFace(GL_FRONT);
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
|
||||
glEnable(GL_ALPHA_TEST);
|
||||
glAlphaFunc(GL_GREATER, 0.666);
|
||||
|
||||
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
|
||||
glShadeModel (GL_FLAT);
|
||||
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
|
||||
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
|
||||
|
||||
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
// glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
|
||||
glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
GL_BeginRendering
|
||||
|
||||
=================
|
||||
*/
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height)
|
||||
{
|
||||
extern cvar_t *gl_clear;
|
||||
|
||||
*x = *y = 0;
|
||||
*width = scr_width;
|
||||
*height = scr_height;
|
||||
|
||||
// if (!wglMakeCurrent( maindc, baseRC ))
|
||||
// Sys_Error ("wglMakeCurrent failed");
|
||||
|
||||
// glViewport (*x, *y, *width, *height);
|
||||
}
|
||||
|
||||
|
||||
void GL_EndRendering (void)
|
||||
{
|
||||
glFlush();
|
||||
fxMesaSwapBuffers();
|
||||
}
|
||||
|
||||
void Init_KBD(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (COM_CheckParm("-nokbd")) UseKeyboard = 0;
|
||||
|
||||
if (UseKeyboard)
|
||||
{
|
||||
for (i=0 ; i<128 ; i++)
|
||||
scantokey[i] = ' ';
|
||||
|
||||
scantokey[42] = K_SHIFT;
|
||||
scantokey[54] = K_SHIFT;
|
||||
scantokey[72] = K_UPARROW;
|
||||
scantokey[103] = K_UPARROW;
|
||||
scantokey[80] = K_DOWNARROW;
|
||||
scantokey[108] = K_DOWNARROW;
|
||||
scantokey[75] = K_LEFTARROW;
|
||||
scantokey[105] = K_LEFTARROW;
|
||||
scantokey[77] = K_RIGHTARROW;
|
||||
scantokey[106] = K_RIGHTARROW;
|
||||
scantokey[29] = K_CTRL;
|
||||
scantokey[97] = K_CTRL;
|
||||
scantokey[56] = K_ALT;
|
||||
scantokey[100] = K_ALT;
|
||||
// scantokey[58] = JK_CAPS;
|
||||
// scantokey[69] = JK_NUM_LOCK;
|
||||
scantokey[71] = K_HOME;
|
||||
scantokey[73] = K_PGUP;
|
||||
scantokey[79] = K_END;
|
||||
scantokey[81] = K_PGDN;
|
||||
scantokey[82] = K_INS;
|
||||
scantokey[83] = K_DEL;
|
||||
scantokey[1 ] = K_ESCAPE;
|
||||
scantokey[28] = K_ENTER;
|
||||
scantokey[15] = K_TAB;
|
||||
scantokey[14] = K_BACKSPACE;
|
||||
scantokey[119] = K_PAUSE;
|
||||
scantokey[57] = ' ';
|
||||
|
||||
scantokey[102] = K_HOME;
|
||||
scantokey[104] = K_PGUP;
|
||||
scantokey[107] = K_END;
|
||||
scantokey[109] = K_PGDN;
|
||||
scantokey[110] = K_INS;
|
||||
scantokey[111] = K_DEL;
|
||||
|
||||
scantokey[2] = '1';
|
||||
scantokey[3] = '2';
|
||||
scantokey[4] = '3';
|
||||
scantokey[5] = '4';
|
||||
scantokey[6] = '5';
|
||||
scantokey[7] = '6';
|
||||
scantokey[8] = '7';
|
||||
scantokey[9] = '8';
|
||||
scantokey[10] = '9';
|
||||
scantokey[11] = '0';
|
||||
scantokey[12] = '-';
|
||||
scantokey[13] = '=';
|
||||
scantokey[41] = '`';
|
||||
scantokey[26] = '[';
|
||||
scantokey[27] = ']';
|
||||
scantokey[39] = ';';
|
||||
scantokey[40] = '\'';
|
||||
scantokey[51] = ',';
|
||||
scantokey[52] = '.';
|
||||
scantokey[53] = '/';
|
||||
scantokey[43] = '\\';
|
||||
|
||||
scantokey[59] = K_F1;
|
||||
scantokey[60] = K_F2;
|
||||
scantokey[61] = K_F3;
|
||||
scantokey[62] = K_F4;
|
||||
scantokey[63] = K_F5;
|
||||
scantokey[64] = K_F6;
|
||||
scantokey[65] = K_F7;
|
||||
scantokey[66] = K_F8;
|
||||
scantokey[67] = K_F9;
|
||||
scantokey[68] = K_F10;
|
||||
scantokey[87] = K_F11;
|
||||
scantokey[88] = K_F12;
|
||||
scantokey[30] = 'a';
|
||||
scantokey[48] = 'b';
|
||||
scantokey[46] = 'c';
|
||||
scantokey[32] = 'd';
|
||||
scantokey[18] = 'e';
|
||||
scantokey[33] = 'f';
|
||||
scantokey[34] = 'g';
|
||||
scantokey[35] = 'h';
|
||||
scantokey[23] = 'i';
|
||||
scantokey[36] = 'j';
|
||||
scantokey[37] = 'k';
|
||||
scantokey[38] = 'l';
|
||||
scantokey[50] = 'm';
|
||||
scantokey[49] = 'n';
|
||||
scantokey[24] = 'o';
|
||||
scantokey[25] = 'p';
|
||||
scantokey[16] = 'q';
|
||||
scantokey[19] = 'r';
|
||||
scantokey[31] = 's';
|
||||
scantokey[20] = 't';
|
||||
scantokey[22] = 'u';
|
||||
scantokey[47] = 'v';
|
||||
scantokey[17] = 'w';
|
||||
scantokey[45] = 'x';
|
||||
scantokey[21] = 'y';
|
||||
scantokey[44] = 'z';
|
||||
|
||||
scantokey[78] = '+';
|
||||
scantokey[74] = '-';
|
||||
|
||||
if (keyboard_init())
|
||||
Sys_Error("keyboard_init() failed");
|
||||
keyboard_seteventhandler(keyhandler);
|
||||
}
|
||||
}
|
||||
|
||||
#define NUM_RESOLUTIONS 16
|
||||
|
||||
static int resolutions[NUM_RESOLUTIONS][3]={
|
||||
320,200, GR_RESOLUTION_320x200,
|
||||
320,240, GR_RESOLUTION_320x240,
|
||||
400,256, GR_RESOLUTION_400x256,
|
||||
400,300, GR_RESOLUTION_400x300,
|
||||
512,384, GR_RESOLUTION_512x384,
|
||||
640,200, GR_RESOLUTION_640x200,
|
||||
640,350, GR_RESOLUTION_640x350,
|
||||
640,400, GR_RESOLUTION_640x400,
|
||||
640,480, GR_RESOLUTION_640x480,
|
||||
800,600, GR_RESOLUTION_800x600,
|
||||
960,720, GR_RESOLUTION_960x720,
|
||||
856,480, GR_RESOLUTION_856x480,
|
||||
512,256, GR_RESOLUTION_512x256,
|
||||
1024,768, GR_RESOLUTION_1024x768,
|
||||
1280,1024,GR_RESOLUTION_1280x1024,
|
||||
1600,1200,GR_RESOLUTION_1600x1200
|
||||
};
|
||||
|
||||
int findres(int *width, int *height)
|
||||
{
|
||||
int i;
|
||||
|
||||
for(i=0;i<NUM_RESOLUTIONS;i++)
|
||||
if((*width<=resolutions[i][0]) && (*height<=resolutions[i][1])) {
|
||||
*width = resolutions[i][0];
|
||||
*height = resolutions[i][1];
|
||||
return resolutions[i][2];
|
||||
}
|
||||
|
||||
*width = 640;
|
||||
*height = 480;
|
||||
return GR_RESOLUTION_640x480;
|
||||
}
|
||||
|
||||
qboolean VID_Is8bit(void)
|
||||
{
|
||||
return is8bit;
|
||||
}
|
||||
|
||||
void VID_Init8bitPalette(void)
|
||||
{
|
||||
// Check for 8bit Extensions and initialize them.
|
||||
int i;
|
||||
void *prjobj;
|
||||
|
||||
if (COM_CheckParm("-no8bit"))
|
||||
return;
|
||||
|
||||
if ((prjobj = dlopen(NULL, RTLD_LAZY)) == NULL) {
|
||||
Con_Printf("Unable to open symbol list for main program.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strstr(gl_extensions, "3DFX_set_global_palette") &&
|
||||
(qgl3DfxSetPaletteEXT = dlsym(prjobj, "gl3DfxSetPaletteEXT")) != NULL) {
|
||||
GLubyte table[256][4];
|
||||
char *oldpal;
|
||||
|
||||
Con_SafePrintf("... Using 3DFX_set_global_palette\n");
|
||||
glEnable( GL_SHARED_TEXTURE_PALETTE_EXT );
|
||||
oldpal = (char *) d_8to24table; //d_8to24table3dfx;
|
||||
for (i=0;i<256;i++) {
|
||||
table[i][2] = *oldpal++;
|
||||
table[i][1] = *oldpal++;
|
||||
table[i][0] = *oldpal++;
|
||||
table[i][3] = 255;
|
||||
oldpal++;
|
||||
}
|
||||
qgl3DfxSetPaletteEXT((GLuint *)table);
|
||||
is8bit = true;
|
||||
|
||||
} else if (strstr(gl_extensions, "GL_EXT_shared_texture_palette") &&
|
||||
(qglColorTableEXT = dlsym(prjobj, "glColorTableEXT")) != NULL) {
|
||||
char thePalette[256*3];
|
||||
char *oldPalette, *newPalette;
|
||||
|
||||
Con_SafePrintf("... Using GL_EXT_shared_texture_palette\n");
|
||||
glEnable( GL_SHARED_TEXTURE_PALETTE_EXT );
|
||||
oldPalette = (char *) d_8to24table; //d_8to24table3dfx;
|
||||
newPalette = thePalette;
|
||||
for (i=0;i<256;i++) {
|
||||
*newPalette++ = *oldPalette++;
|
||||
*newPalette++ = *oldPalette++;
|
||||
*newPalette++ = *oldPalette++;
|
||||
oldPalette++;
|
||||
}
|
||||
qglColorTableEXT(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB, GL_UNSIGNED_BYTE, (void *) thePalette);
|
||||
is8bit = true;
|
||||
|
||||
}
|
||||
|
||||
dlclose(prjobj);
|
||||
}
|
||||
|
||||
static void Check_Gamma (unsigned char *pal)
|
||||
{
|
||||
float f, inf;
|
||||
unsigned char palette[768];
|
||||
int i;
|
||||
|
||||
if ((i = COM_CheckParm("-gamma")) == 0) {
|
||||
if ((gl_renderer && strstr(gl_renderer, "Voodoo")) ||
|
||||
(gl_vendor && strstr(gl_vendor, "3Dfx")))
|
||||
vid_gamma = 1;
|
||||
else
|
||||
vid_gamma = 0.7; // default to 0.7 on non-3dfx hardware
|
||||
} else
|
||||
vid_gamma = Q_atof(com_argv[i+1]);
|
||||
|
||||
for (i=0 ; i<768 ; i++)
|
||||
{
|
||||
f = pow ( (pal[i]+1)/256.0 , vid_gamma );
|
||||
inf = f*255 + 0.5;
|
||||
if (inf < 0)
|
||||
inf = 0;
|
||||
if (inf > 255)
|
||||
inf = 255;
|
||||
palette[i] = inf;
|
||||
}
|
||||
|
||||
memcpy (pal, palette, sizeof(palette));
|
||||
}
|
||||
|
||||
// 2001-09-18 New cvar system by Maddes (Init) start
|
||||
/*
|
||||
===================
|
||||
VID_Init_Cvars
|
||||
===================
|
||||
*/
|
||||
void VID_Init_Cvars (void)
|
||||
{
|
||||
vid_mode = Cvar_Get ("vid_mode", "5", CVAR_ORIGINAL);
|
||||
vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_ORIGINAL);
|
||||
vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE|CVAR_ORIGINAL);
|
||||
gl_ztrick = Cvar_Get ("gl_ztrick", "1", CVAR_ORIGINAL);
|
||||
}
|
||||
// 2001-09-18 New cvar system by Maddes (Init) end
|
||||
|
||||
void VID_Init(unsigned char *palette)
|
||||
{
|
||||
int i;
|
||||
GLint attribs[32];
|
||||
char gldir[MAX_OSPATH];
|
||||
int width = 640, height = 480;
|
||||
|
||||
Init_KBD();
|
||||
|
||||
// 2001-09-18 New cvar system by Maddes (Init) start
|
||||
/*
|
||||
vid_mode = Cvar_Get ("vid_mode", "5", CVAR_ORIGINAL);
|
||||
vid_redrawfull = Cvar_Get ("vid_redrawfull", "0", CVAR_ORIGINAL);
|
||||
vid_waitforrefresh = Cvar_Get ("vid_waitforrefresh", "0", CVAR_ARCHIVE|CVAR_ORIGINAL);
|
||||
m_filter = Cvar_Get ("m_filter", "1", CVAR_ORIGINAL); // 2001-09-18 New cvar system by Maddes (Is this correct?)
|
||||
gl_ztrick = Cvar_Get ("gl_ztrick", "1", CVAR_ORIGINAL);
|
||||
*/
|
||||
// 2001-09-18 New cvar system by Maddes (Init) end
|
||||
|
||||
vid.maxwarpwidth = WARP_WIDTH;
|
||||
vid.maxwarpheight = WARP_HEIGHT;
|
||||
vid.maxlowwidth = LOW_WIDTH;
|
||||
vid.maxlowheight = LOW_HEIGHT;
|
||||
vid.colormap = host_colormap;
|
||||
vid.fullbright = 256 - LittleLong (*((int *)vid.colormap + 2048));
|
||||
|
||||
// interpret command-line params
|
||||
|
||||
// set vid parameters
|
||||
attribs[0] = FXMESA_DOUBLEBUFFER;
|
||||
attribs[1] = FXMESA_ALPHA_SIZE;
|
||||
attribs[2] = 1;
|
||||
attribs[3] = FXMESA_DEPTH_SIZE;
|
||||
attribs[4] = 1;
|
||||
attribs[5] = FXMESA_NONE;
|
||||
|
||||
if ((i = COM_CheckParm("-width")) != 0)
|
||||
width = atoi(com_argv[i+1]);
|
||||
if ((i = COM_CheckParm("-height")) != 0)
|
||||
height = atoi(com_argv[i+1]);
|
||||
|
||||
if ((i = COM_CheckParm("-conwidth")) != 0)
|
||||
vid.conwidth = Q_atoi(com_argv[i+1]);
|
||||
else
|
||||
vid.conwidth = 640;
|
||||
|
||||
vid.conwidth &= 0xfff8; // make it a multiple of eight
|
||||
|
||||
if (vid.conwidth < 320)
|
||||
vid.conwidth = 320;
|
||||
|
||||
// pick a conheight that matches with correct aspect
|
||||
vid.conheight = vid.conwidth*3 / 4;
|
||||
|
||||
if ((i = COM_CheckParm("-conheight")) != 0)
|
||||
vid.conheight = Q_atoi(com_argv[i+1]);
|
||||
if (vid.conheight < 200)
|
||||
vid.conheight = 200;
|
||||
|
||||
fc = fxMesaCreateContext(0, findres(&width, &height), GR_REFRESH_75Hz,
|
||||
attribs);
|
||||
if (!fc)
|
||||
Sys_Error("Unable to create 3DFX context.\n");
|
||||
|
||||
InitSig(); // trap evil signals
|
||||
|
||||
scr_width = width;
|
||||
scr_height = height;
|
||||
|
||||
fxMesaMakeCurrent(fc);
|
||||
|
||||
if (vid.conheight > height)
|
||||
vid.conheight = height;
|
||||
if (vid.conwidth > width)
|
||||
vid.conwidth = width;
|
||||
vid.width = vid.conwidth;
|
||||
vid.height = vid.conheight;
|
||||
|
||||
vid.aspect = ((float)vid.height / (float)vid.width) *
|
||||
(320.0 / 240.0);
|
||||
vid.numpages = 2;
|
||||
|
||||
GL_Init();
|
||||
|
||||
sprintf (gldir, "%s/glquake", com_gamedir);
|
||||
Sys_mkdir (gldir);
|
||||
|
||||
Check_Gamma(palette);
|
||||
VID_SetPalette(palette);
|
||||
|
||||
// Check for 3DFX Extensions and initialize them.
|
||||
VID_Init8bitPalette();
|
||||
|
||||
Con_SafePrintf ("Video mode %dx%d initialized.\n", width, height);
|
||||
|
||||
vid.recalc_refdef = 1; // force a surface cache flush
|
||||
}
|
||||
|
||||
void Sys_SendKeyEvents(void)
|
||||
{
|
||||
if (UseKeyboard)
|
||||
while (keyboard_update());
|
||||
}
|
||||
|
||||
void Force_CenterView_f (void)
|
||||
{
|
||||
cl.viewangles[PITCH] = 0;
|
||||
}
|
||||
|
||||
|
||||
void mousehandler(int buttonstate, int dx, int dy)
|
||||
{
|
||||
mouse_buttonstate = buttonstate;
|
||||
mx += dx;
|
||||
my += dy;
|
||||
}
|
||||
|
||||
// 2001-09-18 New cvar system by Maddes (Init) start
|
||||
/*
|
||||
===================
|
||||
IN_Init_Cvars
|
||||
===================
|
||||
*/
|
||||
void IN_Init_Cvars (void)
|
||||
{
|
||||
m_filter = Cvar_Get ("m_filter", "1", CVAR_ORIGINAL); // 2001-09-18 New cvar system by Maddes (Is this correct?)
|
||||
}
|
||||
// 2001-09-18 New cvar system by Maddes (Init) end
|
||||
|
||||
void IN_Init(void)
|
||||
{
|
||||
|
||||
int mtype;
|
||||
char *mousedev;
|
||||
int mouserate;
|
||||
|
||||
if (UseMouse)
|
||||
{
|
||||
mouse_button_commands[0] = Cvar_Get ("mouse1", "+attack", CVAR_ORIGINAL);
|
||||
mouse_button_commands[1] = Cvar_Get ("mouse2", "+strafe", CVAR_ORIGINAL);
|
||||
mouse_button_commands[2] = Cvar_Get ("mouse3", "+forward", CVAR_ORIGINAL);
|
||||
Cmd_AddCommand ("force_centerview", Force_CenterView_f);
|
||||
|
||||
mouse_buttons = 3;
|
||||
|
||||
mtype = vga_getmousetype();
|
||||
|
||||
mousedev = "/dev/mouse";
|
||||
if (getenv("MOUSEDEV")) mousedev = getenv("MOUSEDEV");
|
||||
if (COM_CheckParm("-mdev"))
|
||||
mousedev = com_argv[COM_CheckParm("-mdev")+1];
|
||||
|
||||
mouserate = 1200;
|
||||
if (getenv("MOUSERATE")) mouserate = atoi(getenv("MOUSERATE"));
|
||||
if (COM_CheckParm("-mrate"))
|
||||
mouserate = atoi(com_argv[COM_CheckParm("-mrate")+1]);
|
||||
|
||||
if (mouse_init(mousedev, mtype, mouserate))
|
||||
{
|
||||
Con_Printf("No mouse found\n");
|
||||
UseMouse = 0;
|
||||
}
|
||||
else
|
||||
mouse_seteventhandler(mousehandler);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void IN_Shutdown(void)
|
||||
{
|
||||
if (UseMouse)
|
||||
mouse_close();
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
IN_Commands
|
||||
===========
|
||||
*/
|
||||
void IN_Commands (void)
|
||||
{
|
||||
if (UseMouse && cls.state != ca_dedicated)
|
||||
{
|
||||
// poll mouse values
|
||||
while (mouse_update())
|
||||
;
|
||||
|
||||
// perform button actions
|
||||
if ((mouse_buttonstate & MOUSE_LEFTBUTTON) &&
|
||||
!(mouse_oldbuttonstate & MOUSE_LEFTBUTTON))
|
||||
Key_Event (K_MOUSE1, true);
|
||||
else if (!(mouse_buttonstate & MOUSE_LEFTBUTTON) &&
|
||||
(mouse_oldbuttonstate & MOUSE_LEFTBUTTON))
|
||||
Key_Event (K_MOUSE1, false);
|
||||
|
||||
if ((mouse_buttonstate & MOUSE_RIGHTBUTTON) &&
|
||||
!(mouse_oldbuttonstate & MOUSE_RIGHTBUTTON))
|
||||
Key_Event (K_MOUSE2, true);
|
||||
else if (!(mouse_buttonstate & MOUSE_RIGHTBUTTON) &&
|
||||
(mouse_oldbuttonstate & MOUSE_RIGHTBUTTON))
|
||||
Key_Event (K_MOUSE2, false);
|
||||
|
||||
if ((mouse_buttonstate & MOUSE_MIDDLEBUTTON) &&
|
||||
!(mouse_oldbuttonstate & MOUSE_MIDDLEBUTTON))
|
||||
Key_Event (K_MOUSE3, true);
|
||||
else if (!(mouse_buttonstate & MOUSE_MIDDLEBUTTON) &&
|
||||
(mouse_oldbuttonstate & MOUSE_MIDDLEBUTTON))
|
||||
Key_Event (K_MOUSE3, false);
|
||||
|
||||
mouse_oldbuttonstate = mouse_buttonstate;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===========
|
||||
IN_Move
|
||||
===========
|
||||
*/
|
||||
void IN_MouseMove (usercmd_t *cmd)
|
||||
{
|
||||
if (!UseMouse)
|
||||
return;
|
||||
|
||||
// poll mouse values
|
||||
while (mouse_update())
|
||||
;
|
||||
|
||||
if (m_filter->value)
|
||||
{
|
||||
mouse_x = (mx + old_mouse_x) * 0.5;
|
||||
mouse_y = (my + old_mouse_y) * 0.5;
|
||||
}
|
||||
else
|
||||
{
|
||||
mouse_x = mx;
|
||||
mouse_y = my;
|
||||
}
|
||||
old_mouse_x = mx;
|
||||
old_mouse_y = my;
|
||||
mx = my = 0; // clear for next update
|
||||
|
||||
mouse_x *= sensitivity->value;
|
||||
mouse_y *= sensitivity->value;
|
||||
|
||||
// add mouse X/Y movement to cmd
|
||||
if ( (in_strafe.state & 1) || (lookstrafe->value && ((in_mlook.state & 1) ^ ((int)m_look->value & 1)) )) // 2001-12-16 M_LOOK cvar by Heffo/Maddes
|
||||
cmd->sidemove += m_side->value * mouse_x;
|
||||
else
|
||||
cl.viewangles[YAW] -= m_yaw->value * mouse_x;
|
||||
|
||||
if ((in_mlook.state & 1) ^ ((int)m_look->value & 1)) // 2001-12-16 M_LOOK cvar by Heffo/Maddes
|
||||
V_StopPitchDrift ();
|
||||
|
||||
if ( ((in_mlook.state & 1) ^ ((int)m_look->value & 1)) && !(in_strafe.state & 1)) // 2001-12-16 M_LOOK cvar by Heffo/Maddes
|
||||
{
|
||||
cl.viewangles[PITCH] += m_pitch->value * mouse_y;
|
||||
if (cl.viewangles[PITCH] > 80)
|
||||
cl.viewangles[PITCH] = 80;
|
||||
if (cl.viewangles[PITCH] < -70)
|
||||
cl.viewangles[PITCH] = -70;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((in_strafe.state & 1) && noclip_anglehack)
|
||||
cmd->upmove -= m_forward->value * mouse_y;
|
||||
else
|
||||
cmd->forwardmove -= m_forward->value * mouse_y;
|
||||
}
|
||||
}
|
||||
|
||||
void IN_Move (usercmd_t *cmd)
|
||||
{
|
||||
IN_MouseMove(cmd);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
1983
WinQuake/gl_vidnt.c
1983
WinQuake/gl_vidnt.c
File diff suppressed because it is too large
Load diff
1092
WinQuake/gl_warp.c
1092
WinQuake/gl_warp.c
File diff suppressed because it is too large
Load diff
|
@ -1,51 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
0, 0.19633, 0.392541, 0.588517, 0.784137, 0.979285, 1.17384, 1.3677,
|
||||
1.56072, 1.75281, 1.94384, 2.1337, 2.32228, 2.50945, 2.69512, 2.87916,
|
||||
3.06147, 3.24193, 3.42044, 3.59689, 3.77117, 3.94319, 4.11282, 4.27998,
|
||||
4.44456, 4.60647, 4.76559, 4.92185, 5.07515, 5.22538, 5.37247, 5.51632,
|
||||
5.65685, 5.79398, 5.92761, 6.05767, 6.18408, 6.30677, 6.42566, 6.54068,
|
||||
6.65176, 6.75883, 6.86183, 6.9607, 7.05537, 7.14579, 7.23191, 7.31368,
|
||||
7.39104, 7.46394, 7.53235, 7.59623, 7.65552, 7.71021, 7.76025, 7.80562,
|
||||
7.84628, 7.88222, 7.91341, 7.93984, 7.96148, 7.97832, 7.99036, 7.99759,
|
||||
8, 7.99759, 7.99036, 7.97832, 7.96148, 7.93984, 7.91341, 7.88222,
|
||||
7.84628, 7.80562, 7.76025, 7.71021, 7.65552, 7.59623, 7.53235, 7.46394,
|
||||
7.39104, 7.31368, 7.23191, 7.14579, 7.05537, 6.9607, 6.86183, 6.75883,
|
||||
6.65176, 6.54068, 6.42566, 6.30677, 6.18408, 6.05767, 5.92761, 5.79398,
|
||||
5.65685, 5.51632, 5.37247, 5.22538, 5.07515, 4.92185, 4.76559, 4.60647,
|
||||
4.44456, 4.27998, 4.11282, 3.94319, 3.77117, 3.59689, 3.42044, 3.24193,
|
||||
3.06147, 2.87916, 2.69512, 2.50945, 2.32228, 2.1337, 1.94384, 1.75281,
|
||||
1.56072, 1.3677, 1.17384, 0.979285, 0.784137, 0.588517, 0.392541, 0.19633,
|
||||
9.79717e-16, -0.19633, -0.392541, -0.588517, -0.784137, -0.979285, -1.17384, -1.3677,
|
||||
-1.56072, -1.75281, -1.94384, -2.1337, -2.32228, -2.50945, -2.69512, -2.87916,
|
||||
-3.06147, -3.24193, -3.42044, -3.59689, -3.77117, -3.94319, -4.11282, -4.27998,
|
||||
-4.44456, -4.60647, -4.76559, -4.92185, -5.07515, -5.22538, -5.37247, -5.51632,
|
||||
-5.65685, -5.79398, -5.92761, -6.05767, -6.18408, -6.30677, -6.42566, -6.54068,
|
||||
-6.65176, -6.75883, -6.86183, -6.9607, -7.05537, -7.14579, -7.23191, -7.31368,
|
||||
-7.39104, -7.46394, -7.53235, -7.59623, -7.65552, -7.71021, -7.76025, -7.80562,
|
||||
-7.84628, -7.88222, -7.91341, -7.93984, -7.96148, -7.97832, -7.99036, -7.99759,
|
||||
-8, -7.99759, -7.99036, -7.97832, -7.96148, -7.93984, -7.91341, -7.88222,
|
||||
-7.84628, -7.80562, -7.76025, -7.71021, -7.65552, -7.59623, -7.53235, -7.46394,
|
||||
-7.39104, -7.31368, -7.23191, -7.14579, -7.05537, -6.9607, -6.86183, -6.75883,
|
||||
-6.65176, -6.54068, -6.42566, -6.30677, -6.18408, -6.05767, -5.92761, -5.79398,
|
||||
-5.65685, -5.51632, -5.37247, -5.22538, -5.07515, -4.92185, -4.76559, -4.60647,
|
||||
-4.44456, -4.27998, -4.11282, -3.94319, -3.77117, -3.59689, -3.42044, -3.24193,
|
||||
-3.06147, -2.87916, -2.69512, -2.50945, -2.32228, -2.1337, -1.94384, -1.75281,
|
||||
-1.56072, -1.3677, -1.17384, -0.979285, -0.784137, -0.588517, -0.392541, -0.19633,
|
|
@ -1,300 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// disable data conversion warnings
|
||||
|
||||
#pragma warning(disable : 4244) // MIPS
|
||||
#pragma warning(disable : 4136) // X86
|
||||
#pragma warning(disable : 4051) // ALPHA
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <GL/gl.h>
|
||||
#include <GL/glu.h>
|
||||
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
||||
void GL_EndRendering (void);
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
// Function prototypes for the Texture Object Extension routines
|
||||
typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLboolean *);
|
||||
typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
|
||||
typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
|
||||
typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
|
||||
typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLclampf *);
|
||||
typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *);
|
||||
|
||||
extern BINDTEXFUNCPTR bindTexFunc;
|
||||
extern DELTEXFUNCPTR delTexFunc;
|
||||
extern TEXSUBIMAGEPTR TexSubImage2DFunc;
|
||||
#endif
|
||||
|
||||
extern int texture_extension_number;
|
||||
extern int texture_mode;
|
||||
|
||||
extern float gldepthmin, gldepthmax;
|
||||
|
||||
void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
int GL_LoadTexture (char *identifier, int width, int height, byte *data, qboolean mipmap, qboolean alpha);
|
||||
int GL_FindTexture (char *identifier);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x, y, z;
|
||||
float s, t;
|
||||
float r, g, b;
|
||||
} glvert_t;
|
||||
|
||||
extern glvert_t glv;
|
||||
|
||||
extern int glx, gly, glwidth, glheight;
|
||||
|
||||
#ifdef _WIN32
|
||||
extern PROC glArrayElementEXT;
|
||||
extern PROC glColorPointerEXT;
|
||||
extern PROC glTexturePointerEXT;
|
||||
extern PROC glVertexPointerEXT;
|
||||
#endif
|
||||
|
||||
// r_local.h -- private refresh defs
|
||||
|
||||
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
|
||||
// normalizing factor so player model works out to about
|
||||
// 1 pixel per triangle
|
||||
#define MAX_LBM_HEIGHT 480
|
||||
|
||||
#define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
|
||||
|
||||
#define SKYSHIFT 7
|
||||
#define SKYSIZE (1 << SKYSHIFT)
|
||||
#define SKYMASK (SKYSIZE - 1)
|
||||
|
||||
#define BACKFACE_EPSILON 0.01
|
||||
|
||||
|
||||
void R_TimeRefresh_f (void);
|
||||
void R_ReadPointFile_f (void);
|
||||
texture_t *R_TextureAnimation (texture_t *base);
|
||||
|
||||
typedef struct surfcache_s
|
||||
{
|
||||
struct surfcache_s *next;
|
||||
struct surfcache_s **owner; // NULL is an empty chunk of memory
|
||||
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
|
||||
int dlight;
|
||||
int size; // including header
|
||||
unsigned width;
|
||||
unsigned height; // DEBUG only needed for debug
|
||||
float mipscale;
|
||||
struct texture_s *texture; // checked for animating textures
|
||||
byte data[4]; // width*height elements
|
||||
} surfcache_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pixel_t *surfdat; // destination for generated surface
|
||||
int rowbytes; // destination logical width in bytes
|
||||
msurface_t *surf; // description for surface to generate
|
||||
fixed8_t lightadj[MAXLIGHTMAPS];
|
||||
// adjust for lightmap levels for dynamic lighting
|
||||
texture_t *texture; // corrected for animating textures
|
||||
int surfmip; // mipmapped ratio of surface texels / world pixels
|
||||
int surfwidth; // in mipmapped texels
|
||||
int surfheight; // in mipmapped texels
|
||||
} drawsurf_t;
|
||||
|
||||
|
||||
//typedef enum {
|
||||
//pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2, pt_fastgrav, pt_smoke, pt_decel, pt_blood, pt_add, pt_staticfade, pt_addfade,pt_staticfadeadd, pt_slowgravaddfade, pt_bloodsplatten, pt_bloodsplat, pt_blooddrip, pt_bloodrun, pt_bloodfloor, pt_trail, pt_spark, pt_snow, pt_fire6, pt_decal, pt_flare, pt_flare_will_die, pt_sparkvel
|
||||
//} ptype_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct farticle_s
|
||||
{
|
||||
// driver-usable fields
|
||||
vec3_t org;
|
||||
float color;
|
||||
// drivers never touch the following fields
|
||||
struct particle_s *next;
|
||||
vec3_t vel;
|
||||
float ramp;
|
||||
float die;
|
||||
ptype_t type;
|
||||
|
||||
|
||||
// NEW STRUCTS
|
||||
float alpha;
|
||||
// float splatter;
|
||||
int blend;
|
||||
float alphavel;
|
||||
int lit;
|
||||
int polor;
|
||||
int trail;
|
||||
} farticle_t;
|
||||
|
||||
|
||||
//====================================================
|
||||
|
||||
|
||||
extern entity_t r_worldentity;
|
||||
extern qboolean r_cache_thrash; // compatability
|
||||
extern vec3_t modelorg, r_entorigin;
|
||||
extern entity_t *currententity;
|
||||
extern int r_visframecount; // ??? what difs?
|
||||
extern int r_framecount;
|
||||
extern mplane_t frustum[4];
|
||||
extern int c_brush_polys, c_alias_polys;
|
||||
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
extern vec3_t vup;
|
||||
extern vec3_t vpn;
|
||||
extern vec3_t vright;
|
||||
extern vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
extern refdef_t r_refdef;
|
||||
extern mleaf_t *r_viewleaf, *r_oldviewleaf;
|
||||
extern texture_t *r_notexture_mip;
|
||||
extern int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
||||
|
||||
extern qboolean envmap;
|
||||
extern int currenttexture;
|
||||
extern int cnttextures[2];
|
||||
extern int particletexture;
|
||||
extern int playertextures;
|
||||
|
||||
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
|
||||
|
||||
extern cvar_t *r_norefresh;
|
||||
extern cvar_t *r_drawentities;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_drawviewmodel;
|
||||
extern cvar_t *r_speeds;
|
||||
extern cvar_t *r_waterwarp;
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_lightmap;
|
||||
extern cvar_t *r_shadows;
|
||||
extern cvar_t *r_mirroralpha;
|
||||
extern cvar_t *r_wateralpha;
|
||||
extern cvar_t *r_dynamic;
|
||||
extern cvar_t *r_novis;
|
||||
|
||||
extern cvar_t *gl_clear;
|
||||
extern cvar_t *gl_cull;
|
||||
extern cvar_t *gl_poly;
|
||||
extern cvar_t *gl_texsort;
|
||||
extern cvar_t *gl_smoothmodels;
|
||||
extern cvar_t *gl_affinemodels;
|
||||
extern cvar_t *gl_polyblend;
|
||||
extern cvar_t *gl_keeptjunctions;
|
||||
extern cvar_t *gl_reporttjunctions;
|
||||
extern cvar_t *gl_flashblend;
|
||||
extern cvar_t *gl_nocolors;
|
||||
extern cvar_t *gl_doubleeyes;
|
||||
extern cvar_t *gl_maxdepth; // 2002-01-31 GLQuake HOM fix by Matador
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
extern int gl_alpha_format;
|
||||
|
||||
extern cvar_t *gl_max_size;
|
||||
extern cvar_t *gl_playermip;
|
||||
|
||||
extern int mirrortexturenum; // quake texturenum, not gltexturenum
|
||||
extern qboolean mirror;
|
||||
extern mplane_t *mirror_plane;
|
||||
|
||||
extern float r_world_matrix[16];
|
||||
|
||||
extern const char *gl_vendor;
|
||||
extern const char *gl_renderer;
|
||||
extern const char *gl_version;
|
||||
extern const char *gl_extensions;
|
||||
|
||||
void R_TranslatePlayerSkin (int playernum);
|
||||
void GL_Bind (int texnum);
|
||||
|
||||
// Multitexture
|
||||
#define TEXTURE0_SGIS 0x835E
|
||||
#define TEXTURE1_SGIS 0x835F
|
||||
|
||||
#ifndef _WIN32
|
||||
#define APIENTRY /* */
|
||||
#endif
|
||||
|
||||
typedef void (APIENTRY *lpMTexFUNC) (GLenum, GLfloat, GLfloat);
|
||||
typedef void (APIENTRY *lpSelTexFUNC) (GLenum);
|
||||
extern lpMTexFUNC qglMTexCoord2fSGIS;
|
||||
extern lpSelTexFUNC qglSelectTextureSGIS;
|
||||
|
||||
extern qboolean gl_mtexable;
|
||||
|
||||
void GL_DisableMultitexture(void);
|
||||
void GL_EnableMultitexture(void);
|
||||
|
||||
// 2001-12-10 Reduced compiler warnings by Jeff Ford start
|
||||
int GL_LoadPicTexture (qpic_t *pic);
|
||||
void GL_SubdivideSurface (msurface_t *fa);
|
||||
void GL_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr);
|
||||
void GL_Upload8_EXT (byte *data, int width, int height, qboolean mipmap, qboolean alpha);
|
||||
void GL_BuildLightmaps (void);
|
||||
void GL_Set2D (void);
|
||||
void EmitWaterPolys (msurface_t *fa);
|
||||
void EmitSkyPolys (msurface_t *fa);
|
||||
void EmitBothSkyLayers (msurface_t *fa);
|
||||
qboolean VID_Is8bit();
|
||||
int R_LightPoint (vec3_t p);
|
||||
void R_DrawBrushModel (entity_t *e);
|
||||
void R_AnimateLight (void);
|
||||
void V_CalcBlend (void);
|
||||
void R_DrawWorld (void);
|
||||
void R_RenderDlights (void);
|
||||
void R_DrawParticles (void);
|
||||
void R_DrawWaterSurfaces (void);
|
||||
void R_RenderBrushPoly (msurface_t *fa);
|
||||
void R_DrawWaterSurfaces (void);
|
||||
void R_InitParticles (void);
|
||||
void R_ClearParticles (void);
|
||||
void R_DrawSkyChain (msurface_t *s);
|
||||
qboolean R_CullBox (vec3_t mins, vec3_t maxs);
|
||||
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
|
||||
void R_RotateForEntity (entity_t *e);
|
||||
void R_StoreEfrags (efrag_t **ppefrag);
|
||||
// 2001-12-10 Reduced compiler warnings by Jeff Ford end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void GrabColorMap(void);
|
||||
void MakeMy15to8(void);
|
|
@ -1,209 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// disable data conversion warnings
|
||||
|
||||
#pragma warning(disable : 4244) // MIPS
|
||||
#pragma warning(disable : 4136) // X86
|
||||
#pragma warning(disable : 4051) // ALPHA
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
#include <gl\gl.h>
|
||||
#include <gl\glu.h>
|
||||
|
||||
void GL_BeginRendering (int *x, int *y, int *width, int *height);
|
||||
void GL_EndRendering (void);
|
||||
|
||||
|
||||
// Function prototypes for the Texture Object Extension routines
|
||||
typedef GLboolean (APIENTRY *ARETEXRESFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLboolean *);
|
||||
typedef void (APIENTRY *BINDTEXFUNCPTR)(GLenum, GLuint);
|
||||
typedef void (APIENTRY *DELTEXFUNCPTR)(GLsizei, const GLuint *);
|
||||
typedef void (APIENTRY *GENTEXFUNCPTR)(GLsizei, GLuint *);
|
||||
typedef GLboolean (APIENTRY *ISTEXFUNCPTR)(GLuint);
|
||||
typedef void (APIENTRY *PRIORTEXFUNCPTR)(GLsizei, const GLuint *,
|
||||
const GLclampf *);
|
||||
typedef void (APIENTRY *TEXSUBIMAGEPTR)(int, int, int, int, int, int, int, int, void *);
|
||||
|
||||
extern BINDTEXFUNCPTR bindTexFunc;
|
||||
extern DELTEXFUNCPTR delTexFunc;
|
||||
extern TEXSUBIMAGEPTR TexSubImage2DFunc;
|
||||
|
||||
extern int texture_extension_number;
|
||||
extern int texture_mode;
|
||||
|
||||
extern float gldepthmin, gldepthmax;
|
||||
|
||||
void GL_Upload32 (unsigned *data, int width, int height, qboolean mipmap, qboolean alpha, qboolean modulate);
|
||||
void GL_Upload8 (byte *data, int width, int height, qboolean mipmap, qboolean alpha, qboolean modulate);
|
||||
int GL_LoadTexture (char *identifier, int width, int height, byte *data, int mipmap, int alpha, int modulate);
|
||||
int GL_FindTexture (char *identifier);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
float x, y, z;
|
||||
float s, t;
|
||||
float r, g, b;
|
||||
} glvert_t;
|
||||
|
||||
extern glvert_t glv;
|
||||
|
||||
extern int glx, gly, glwidth, glheight;
|
||||
|
||||
extern PROC glArrayElementEXT;
|
||||
extern PROC glColorPointerEXT;
|
||||
extern PROC glTexturePointerEXT;
|
||||
extern PROC glVertexPointerEXT;
|
||||
|
||||
|
||||
// r_local.h -- private refresh defs
|
||||
|
||||
#define MAXALIASVERTS 2000 // TODO: tune this
|
||||
|
||||
#define ALIAS_BASE_SIZE_RATIO (1.0 / 11.0)
|
||||
// normalizing factor so player model works out to about
|
||||
// 1 pixel per triangle
|
||||
#define MAX_LBM_HEIGHT 480
|
||||
|
||||
#define TILE_SIZE 128 // size of textures generated by R_GenTiledSurf
|
||||
|
||||
#define SKYSHIFT 7
|
||||
#define SKYSIZE (1 << SKYSHIFT)
|
||||
#define SKYMASK (SKYSIZE - 1)
|
||||
|
||||
#define BACKFACE_EPSILON 0.01
|
||||
|
||||
|
||||
void R_TimeRefresh_f (void);
|
||||
void R_ReadPointFile_f (void);
|
||||
texture_t *R_TextureAnimation (texture_t *base);
|
||||
|
||||
typedef struct surfcache_s
|
||||
{
|
||||
struct surfcache_s *next;
|
||||
struct surfcache_s **owner; // NULL is an empty chunk of memory
|
||||
int lightadj[MAXLIGHTMAPS]; // checked for strobe flush
|
||||
int dlight;
|
||||
int size; // including header
|
||||
unsigned width;
|
||||
unsigned height; // DEBUG only needed for debug
|
||||
float mipscale;
|
||||
struct texture_s *texture; // checked for animating textures
|
||||
byte data[4]; // width*height elements
|
||||
} surfcache_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
pixel_t *surfdat; // destination for generated surface
|
||||
int rowbytes; // destination logical width in bytes
|
||||
msurface_t *surf; // description for surface to generate
|
||||
fixed8_t lightadj[MAXLIGHTMAPS];
|
||||
// adjust for lightmap levels for dynamic lighting
|
||||
texture_t *texture; // corrected for animating textures
|
||||
int surfmip; // mipmapped ratio of surface texels / world pixels
|
||||
int surfwidth; // in mipmapped texels
|
||||
int surfheight; // in mipmapped texels
|
||||
} drawsurf_t;
|
||||
|
||||
|
||||
typedef enum {
|
||||
pt_static, pt_grav, pt_slowgrav, pt_fire, pt_explode, pt_explode2, pt_blob, pt_blob2
|
||||
} ptype_t;
|
||||
|
||||
// !!! if this is changed, it must be changed in d_ifacea.h too !!!
|
||||
typedef struct particle_s
|
||||
{
|
||||
// driver-usable fields
|
||||
vec3_t org;
|
||||
float color;
|
||||
// drivers never touch the following fields
|
||||
struct particle_s *next;
|
||||
vec3_t vel;
|
||||
float ramp;
|
||||
float die;
|
||||
ptype_t type;
|
||||
} particle_t;
|
||||
|
||||
|
||||
//====================================================
|
||||
|
||||
|
||||
extern entity_t r_worldentity;
|
||||
extern qboolean r_cache_thrash; // compatability
|
||||
extern vec3_t modelorg, r_entorigin;
|
||||
extern entity_t *currententity;
|
||||
extern int r_visframecount; // ??? what difs?
|
||||
extern int r_framecount;
|
||||
extern mplane_t frustum[4];
|
||||
extern int c_brush_polys, c_alias_polys;
|
||||
|
||||
|
||||
//
|
||||
// view origin
|
||||
//
|
||||
extern vec3_t vup;
|
||||
extern vec3_t vpn;
|
||||
extern vec3_t vright;
|
||||
extern vec3_t r_origin;
|
||||
|
||||
//
|
||||
// screen size info
|
||||
//
|
||||
extern refdef_t r_refdef;
|
||||
extern mleaf_t *r_viewleaf, *r_oldviewleaf;
|
||||
extern texture_t *r_notexture_mip;
|
||||
extern int d_lightstylevalue[256]; // 8.8 fraction of base light value
|
||||
|
||||
extern qboolean envmap;
|
||||
extern int currenttexture;
|
||||
extern int particletexture;
|
||||
extern int playertextures;
|
||||
|
||||
extern int skytexturenum; // index in cl.loadmodel, not gl texture object
|
||||
|
||||
extern cvar_t *r_drawentities;
|
||||
extern cvar_t *r_drawworld;
|
||||
extern cvar_t *r_drawviewmodel;
|
||||
extern cvar_t *r_speeds;
|
||||
extern cvar_t *r_waterwarp;
|
||||
extern cvar_t *r_fullbright;
|
||||
extern cvar_t *r_lightmap;
|
||||
extern cvar_t *r_shadows;
|
||||
extern cvar_t *r_dynamic;
|
||||
|
||||
extern cvar_t *gl_clear;
|
||||
extern cvar_t *gl_cull;
|
||||
extern cvar_t *gl_poly;
|
||||
extern cvar_t *gl_texsort;
|
||||
extern cvar_t *gl_smoothmodels;
|
||||
extern cvar_t *gl_affinemodels;
|
||||
extern cvar_t *gl_fogblend;
|
||||
extern cvar_t *gl_polyblend;
|
||||
extern cvar_t *gl_keeptjunctions;
|
||||
extern cvar_t *gl_reporttjunctions;
|
||||
|
||||
extern int gl_lightmap_format;
|
||||
extern int gl_solid_format;
|
||||
extern int gl_alpha_format;
|
||||
|
||||
void R_TranslatePlayerSkin (int playernum);
|
||||
void GL_Bind (int texnum);
|
|
@ -1,106 +0,0 @@
|
|||
; Wedit project file. Syntax: Name=value
|
||||
[glquake]
|
||||
CmsDirectory=D:\Coding\Quake\QIP_Quake\lcc_cms
|
||||
CompilerFlags=25296965
|
||||
DbgDir=e:\quake
|
||||
DbgExeName=d:\coding\quake\qip_quake\lcc_release_gl\glquake.exe
|
||||
DebuggerArguments=
|
||||
Defines=WIN32 _WIN32 NDEBUG _WINDOWS GLQUAKE
|
||||
EiffelFlags=0
|
||||
ErrorFile=D:\Coding\Quake\QIP_Quake\lcc_release_gl\glquake.err
|
||||
Exe=d:\coding\quake\qip_quake\lcc_release_gl\glquake.exe
|
||||
FileOptions=0
|
||||
FortranFlags=0
|
||||
Frame=220 180 512 384
|
||||
GetOptions=0
|
||||
Includes=D:\Programme\Coding\lcc\include
|
||||
Libraries=..\LCC_LIB\OPENGL32.LIB ..\LCC_LIB\QUAKEASM_GL.LIB DXGUID.LIB GC.LIB WINMM.LIB WSOCK32.LIB
|
||||
LinkerArgs=
|
||||
LockOptions=1
|
||||
MakeArgs=
|
||||
MakeDir=D:\Coding\Quake\QIP_Quake\lcc_release_gl
|
||||
MakeName=D:\Programme\Coding\lcc\bin\make.exe
|
||||
Name=glquake
|
||||
NrOfFileProcessors=0
|
||||
NumberOfBreakpoints=0
|
||||
OpenFiles=0
|
||||
ProjectFlags=0
|
||||
ProjectPath=D:\Coding\Quake\QIP_Quake
|
||||
PutOptions=4
|
||||
SourcesDir=D:\Coding\Quake\QIP_Quake
|
||||
UserCount=0
|
||||
UsersOptions=1
|
||||
ExtraCmsFilesCount=0
|
||||
CurrentFile=
|
||||
ProjectTime=15474
|
||||
Useframework=0
|
||||
StatusBar=0,0,0,0
|
||||
PrjFiles=68
|
||||
File1=ZONE.C
|
||||
File2=WSOCK32.LIB
|
||||
File3=WORLD.C
|
||||
File4=WINQUAKE_LCC.RC
|
||||
File5=WINMM.LIB
|
||||
File6=WAD.C
|
||||
File7=VIEW.C
|
||||
File8=SYS_WIN.C
|
||||
File9=SV_USER.C
|
||||
File10=SV_PHYS.C
|
||||
File11=SV_MOVE.C
|
||||
File12=SV_MAIN.C
|
||||
File13=SND_WIN.C
|
||||
File14=SND_MIX.C
|
||||
File15=SND_MEM.C
|
||||
File16=SND_DMA.C
|
||||
File17=SBAR.C
|
||||
File18=R_PART.C
|
||||
File19=PR_EXEC.C
|
||||
File20=PR_EDICT.C
|
||||
File21=PR_CMDS.C
|
||||
File22=NVS_SERVER_DATA.C
|
||||
File23=NVS_SERVER.C
|
||||
File24=NVS_COMMON.C
|
||||
File25=NVS_CLIENT.C
|
||||
File26=NET_WIPX.C
|
||||
File27=NET_WINS.C
|
||||
File28=NET_WIN.C
|
||||
File29=NET_VCR.C
|
||||
File30=NET_MAIN.C
|
||||
File31=NET_LOOP.C
|
||||
File32=NET_DGRM.C
|
||||
File33=MENU.C
|
||||
File34=MATHLIB.C
|
||||
File35=KEYS.C
|
||||
File36=IN_WIN.C
|
||||
File37=HOST_CMD.C
|
||||
File38=HOST.C
|
||||
File39=GL_WARP.C
|
||||
File40=GL_VIDNT.C
|
||||
File41=GL_TEST.C
|
||||
File42=GL_SCREEN.C
|
||||
File43=GL_RSURF.C
|
||||
File44=GL_RMISC.C
|
||||
File45=GL_RMAIN.C
|
||||
File46=GL_RLIGHT.C
|
||||
File47=GL_REFRAG.C
|
||||
File48=GL_MODEL.C
|
||||
File49=GL_MESH.C
|
||||
File50=GL_DRAW.C
|
||||
File51=GC.LIB
|
||||
File52=DXGUID.LIB
|
||||
File53=CVAR.C
|
||||
File54=CRC.C
|
||||
File55=CONSOLE.C
|
||||
File56=CONPROC.C
|
||||
File57=COMMON.C
|
||||
File58=CMD.C
|
||||
File59=CL_TENT.C
|
||||
File60=CL_PARSE.C
|
||||
File61=CL_MAIN.C
|
||||
File62=CL_INPUT.C
|
||||
File63=CL_DEMO.C
|
||||
File64=CHASE.C
|
||||
File65=CD_WIN.C
|
||||
File66=..\LCC_LIB\QUAKEASM_GL.LIB
|
||||
File67=..\LCC_LIB\OPENGL32.LIB
|
||||
File68=MODEL_COMMON.C
|
|
@ -1,39 +0,0 @@
|
|||
LCC-Win32 compiling information
|
||||
===============================
|
||||
Unfortunately there are currently (version 2002-01-29) a lot of problems with LCC-Win32.
|
||||
If the engine reaches an unknown size in code or data, the executable crashes on startup.
|
||||
This also varies between different LCC-Win32 versions:
|
||||
* I get a working executable of my GLQuake port from 2002-01-04 with LCC-Win32
|
||||
version 2001-12-05, WinQuake works when the optimzer was disabled. With later
|
||||
LCC-Win32 versions no executable works.
|
||||
* My source from 2002-02-01, which included only minor changes, only produce a
|
||||
working GLQuake executable with LCC-Win32 version 2001-12-05. With later LCC-Win32
|
||||
versions no executable works.
|
||||
So take these information to test new versions of LCC-Win32.
|
||||
|
||||
The project files have been adapted from the QBism port http://qbism.telefragged.com/
|
||||
The OpenGL library is also taken from QBism, the assembler libraries have been recreated.
|
||||
For the case you have to change the assembler coding, I added some useful batch
|
||||
files to recreate the libraries. Note that you currently need Microsoft's MASM
|
||||
to compile the assembler code (see the QSML FAQ at http://www.quake-info-pool.net/
|
||||
how to obtain it for free legally).
|
||||
|
||||
Before using the project files with WEdit32 you have to adapt them to your directory structure.
|
||||
1. Replace D:\Coding\Quake with the directory you extracted the QIP Quake source
|
||||
2. Replace D:\Programme\Coding\lcc with the directory you installed LCC
|
||||
|
||||
You need the following packages from LCC-Win32 http://www.cs.virginia.edu/~lcc-win32/
|
||||
* lccwin32.exe from 2001-12-05(!!!)
|
||||
The later versions, currently 2002-01-23, do not compile Quake correctly and crash when the demo playing starts.
|
||||
The version 2001-12-05 is also available from my homepage.
|
||||
* lccdoc.exe from 2001-11-04 or later
|
||||
* manual.exe from 2001-11-04 or later
|
||||
* win32hlp.exe from 2001-08-06 or later
|
||||
* win32apidoc.exe from 2000-12-08 or later
|
||||
|
||||
If you want to compile id's original sourcecode, then you have to redo the
|
||||
changes to the source, which are mentioned in my changelog.
|
||||
|
||||
Good luck
|
||||
Maddes
|
||||
Quake Info Pool - http://www.quake-info-pool.net/
|
|
@ -1,123 +0,0 @@
|
|||
; Wedit project file. Syntax: Name=value
|
||||
[winquake]
|
||||
CmsDirectory=D:\Coding\Quake\QIP_Quake\lcc_cms
|
||||
CompilerFlags=25296965
|
||||
DbgDir=e:\quake
|
||||
DbgExeName=d:\coding\quake\qip_quake\lcc_release\winquake.exe
|
||||
DebuggerArguments=
|
||||
Defines=WIN32 _WIN32 NDEBUG _WINDOWS
|
||||
EiffelFlags=0
|
||||
ErrorFile=D:\Coding\Quake\QIP_Quake\lcc_release\winquake.err
|
||||
Exe=d:\coding\quake\qip_quake\lcc_release\winquake.exe
|
||||
FileOptions=0
|
||||
FortranFlags=0
|
||||
Frame=220 180 512 384
|
||||
GetOptions=0
|
||||
Includes=D:\Programme\Coding\lcc\include;D:\Coding\Quake\SciTech\include
|
||||
Libraries=..\..\SCITECH\LIB\WIN32\VC\MGLLT.LIB ..\LCC_LIB\QUAKEASM_WQ.LIB DXGUID.LIB GC.LIB WINMM.LIB WSOCK32.LIB
|
||||
LinkerArgs=
|
||||
LockOptions=1
|
||||
MakeArgs=
|
||||
MakeDir=D:\Coding\Quake\QIP_Quake\lcc_release
|
||||
MakeName=D:\Programme\Coding\lcc\bin\make.exe
|
||||
Name=winquake
|
||||
NrOfFileProcessors=0
|
||||
NumberOfBreakpoints=0
|
||||
OpenFiles=0
|
||||
ProjectFlags=0
|
||||
ProjectPath=D:\Coding\Quake\QIP_Quake
|
||||
PutOptions=4
|
||||
SourcesDir=D:\Coding\Quake\QIP_Quake
|
||||
UserCount=0
|
||||
UsersOptions=1
|
||||
ExtraCmsFilesCount=0
|
||||
CurrentFile=
|
||||
ProjectTime=12918
|
||||
Useframework=0
|
||||
StatusBar=0,0,0,0
|
||||
PrjFiles=85
|
||||
File1=ZONE.C
|
||||
File2=WSOCK32.LIB
|
||||
File3=WORLD.C
|
||||
File4=WINQUAKE_LCC.RC
|
||||
File5=WINMM.LIB
|
||||
File6=WAD.C
|
||||
File7=VIEW.C
|
||||
File8=VID_WIN.C
|
||||
File9=SYS_WIN.C
|
||||
File10=SV_USER.C
|
||||
File11=SV_PHYS.C
|
||||
File12=SV_MOVE.C
|
||||
File13=SV_MAIN.C
|
||||
File14=SND_WIN.C
|
||||
File15=SND_MIX.C
|
||||
File16=SND_MEM.C
|
||||
File17=SND_DMA.C
|
||||
File18=SCREEN.C
|
||||
File19=SBAR.C
|
||||
File20=R_VARS.C
|
||||
File21=R_SURF.C
|
||||
File22=R_SPRITE.C
|
||||
File23=R_SKY.C
|
||||
File24=R_PART.C
|
||||
File25=R_MISC.C
|
||||
File26=R_MAIN.C
|
||||
File27=R_LIGHT.C
|
||||
File28=R_EFRAG.C
|
||||
File29=R_EDGE.C
|
||||
File30=R_DRAW.C
|
||||
File31=R_BSP.C
|
||||
File32=R_ALIAS.C
|
||||
File33=R_ACLIP.C
|
||||
File34=PR_EXEC.C
|
||||
File35=PR_EDICT.C
|
||||
File36=PR_CMDS.C
|
||||
File37=NVS_SERVER_DATA.C
|
||||
File38=NVS_SERVER.C
|
||||
File39=NVS_COMMON.C
|
||||
File40=NVS_CLIENT.C
|
||||
File41=NET_WIPX.C
|
||||
File42=NET_WINS.C
|
||||
File43=NET_WIN.C
|
||||
File44=NET_VCR.C
|
||||
File45=NET_MAIN.C
|
||||
File46=NET_LOOP.C
|
||||
File47=NET_DGRM.C
|
||||
File48=MODEL.C
|
||||
File49=MENU.C
|
||||
File50=MATHLIB.C
|
||||
File51=KEYS.C
|
||||
File52=IN_WIN.C
|
||||
File53=HOST_CMD.C
|
||||
File54=HOST.C
|
||||
File55=GC.LIB
|
||||
File56=DXGUID.LIB
|
||||
File57=DRAW.C
|
||||
File58=D_ZPOINT.C
|
||||
File59=D_VARS.C
|
||||
File60=D_SURF.C
|
||||
File61=D_SPRITE.C
|
||||
File62=D_SKY.C
|
||||
File63=D_SCAN.C
|
||||
File64=D_POLYSE.C
|
||||
File65=D_PART.C
|
||||
File66=D_MODECH.C
|
||||
File67=D_INIT.C
|
||||
File68=D_FILL.C
|
||||
File69=D_EDGE.C
|
||||
File70=CVAR.C
|
||||
File71=CRC.C
|
||||
File72=CONSOLE.C
|
||||
File73=CONPROC.C
|
||||
File74=COMMON.C
|
||||
File75=CMD.C
|
||||
File76=CL_TENT.C
|
||||
File77=CL_PARSE.C
|
||||
File78=CL_MAIN.C
|
||||
File79=CL_INPUT.C
|
||||
File80=CL_DEMO.C
|
||||
File81=CHASE.C
|
||||
File82=CD_WIN.C
|
||||
File83=..\LCC_LIB\QUAKEASM_WQ.LIB
|
||||
File84=..\..\SCITECH\LIB\WIN32\VC\MGLLT.LIB
|
||||
File85=MODEL_COMMON.C
|
|
@ -1,331 +0,0 @@
|
|||
#
|
||||
# DJGPP makefile for DOSQuake by Norberto Alfredo Bensa <nbensa@hotmail.com>
|
||||
# Usage: make -f makefile.djgpp [DEBUG=X] [VERBOSE=X]
|
||||
#
|
||||
# Use DEBUG=X for a debug version
|
||||
# Use VERBOSE=X to see all the tool calls
|
||||
#
|
||||
# --------------------------------------------------------------------------
|
||||
#
|
||||
# Necessary changes for the code to work with DJGPP:
|
||||
# 1. Remove the "static" statement for the isDedicated variable in SYS_DOS.C
|
||||
# 2. Add the following to lines to SYS_DOS.C to fix the memory detection bug
|
||||
# #include <crt0.h>
|
||||
# int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK;
|
||||
# 3. There are more bugs in DOSQuake, for a list of known Quake bugs visit
|
||||
# the Quake Info Pool through http://www.bigfoot.com/~maddes (redirection)
|
||||
#
|
||||
# --------------------------------------------------------------------------
|
||||
#
|
||||
# Packages needed to build DOSQuake can be downloaded at http://www.delorie.com/djgpp/
|
||||
# (ftp://ftp.simtelnet.net/pub/simtelnet/gnu/djgpp/)
|
||||
#
|
||||
# Go to the ZipPicker page and choose the following for the minimum download:
|
||||
# - "Build and run programs with DJGPP"
|
||||
# - state your OS
|
||||
# - online-documentation: "yes" (not necessary, but helpful)
|
||||
# - programming language: "C"
|
||||
# - you don't need RHide or the GNU debugger
|
||||
# - get the extra documentation formats if you are not used to info
|
||||
#
|
||||
# As of 2000-07-27 you will get the following download list (older versions may work too)
|
||||
# - v2/copying.dj DJGPP Copyright info 3 kb
|
||||
# - v2/djdev203.zip DJGPP Basic Development Kit 1.5 mb
|
||||
# - v2/faq230b.zip Frequently Asked Questions 664 kb
|
||||
# - v2/readme.1st Installation instructions 20 kb
|
||||
# - v2gnu/bnu2951b.zip Basic assembler, linker 2.4 mb
|
||||
# - v2gnu/gcc2952b.zip Basic GCC compiler 1.8 mb
|
||||
# - v2gnu/gdb418b.zip GNU debugger 1.1 mb
|
||||
# - v2gnu/mak379b.zip Make (processes makefiles) 263 kb
|
||||
# - v2gnu/txi40b.zip Info file viewer 632 kb
|
||||
#
|
||||
# Additional tools needed:
|
||||
# - v2gnu/bsh203b.zip BASH ported to DJGPP 483 kb
|
||||
# - v2gnu/fil316b.zip Unix tools ported to DJGPP 979 kb
|
||||
# - v2gnu/sed302b.zip SED ported to DJGPP 105 kb
|
||||
#
|
||||
#
|
||||
# NOTE: You can compress the final executable with UPX (http://upx.tsx.org/)
|
||||
#
|
||||
# --------------------------------------------------------------------------
|
||||
#
|
||||
# Enjoy,
|
||||
# Norberto Alfredo Bensa, Argentina
|
||||
#
|
||||
|
||||
# 2000-05-02 NVS Network Versioning by Maddes
|
||||
# added NVS files
|
||||
|
||||
|
||||
#
|
||||
# General and compiler variables
|
||||
#
|
||||
|
||||
ifndef VERBOSE
|
||||
MAKEFLAGS+=-s
|
||||
endif
|
||||
|
||||
SHELL=/bin/sh
|
||||
|
||||
CC=gcc
|
||||
LD=gcc
|
||||
AS=gcc -x assembler-with-cpp
|
||||
|
||||
RM=rm -f
|
||||
|
||||
CFLAGS=\
|
||||
-DDOSQUAKE \
|
||||
-O9 \
|
||||
-march=i586 \
|
||||
-Wall \
|
||||
-fomit-frame-pointer \
|
||||
-ffast-math \
|
||||
-fno-unroll-loops \
|
||||
-fno-inline-functions
|
||||
LDFLAGS=
|
||||
CSTUB=
|
||||
LIBS=-lc -lgcc -lm -lalleg
|
||||
|
||||
ifdef DEBUG
|
||||
CFLAGS+=\
|
||||
-gstabs+3 \
|
||||
-O0 \
|
||||
-fno-omit-frame-pointer \
|
||||
-fno-fast-math
|
||||
OBJDIR=debug_dos
|
||||
else
|
||||
CFLAGS+=-DNDEBUG
|
||||
LDFLAGS+=-s
|
||||
OBJDIR=release_dos
|
||||
endif
|
||||
|
||||
#
|
||||
# Filename variables
|
||||
#
|
||||
|
||||
# Executable
|
||||
BUILD=$(OBJDIR)/tnqdos.exe
|
||||
|
||||
# Source files
|
||||
NET= \
|
||||
net_dgrm.c \
|
||||
net_loop.c \
|
||||
net_main.c \
|
||||
net_vcr.c
|
||||
|
||||
RENDER= \
|
||||
r_aclip.c \
|
||||
r_aclipa.s \
|
||||
r_alias.c \
|
||||
r_aliasa.s \
|
||||
r_bsp.c \
|
||||
r_draw.c \
|
||||
r_drawa.s \
|
||||
r_edge.c \
|
||||
r_edgea.s \
|
||||
r_efrag.c \
|
||||
r_light.c \
|
||||
r_main.c \
|
||||
r_misc.c \
|
||||
r_part.c \
|
||||
r_sky.c \
|
||||
r_sprite.c \
|
||||
r_surf.c \
|
||||
r_vars.c \
|
||||
r_varsa.s
|
||||
|
||||
DRAW= \
|
||||
d_copy.s \
|
||||
d_draw.s \
|
||||
d_draw16.s \
|
||||
d_fog16.s \
|
||||
d_edge.c \
|
||||
d_fill.c \
|
||||
d_init.c \
|
||||
d_modech.c \
|
||||
d_part.c \
|
||||
d_polyse.c \
|
||||
d_polysa.s \
|
||||
d_parta.s \
|
||||
d_scan.c \
|
||||
d_scana.s \
|
||||
d_sky.c \
|
||||
d_spr8.s \
|
||||
d_sprite.c \
|
||||
d_surf.c \
|
||||
d_vars.c \
|
||||
d_varsa.s \
|
||||
d_zpoint.c
|
||||
|
||||
CLIENT= \
|
||||
nvs_client.c \
|
||||
cl_demo.c \
|
||||
cl_input.c \
|
||||
cl_main.c \
|
||||
cl_parse.c \
|
||||
cl_tent.c
|
||||
|
||||
SERVER= \
|
||||
nvs_server.c \
|
||||
nvs_server_data.c \
|
||||
sv_main.c \
|
||||
sv_move.c \
|
||||
sv_phys.c \
|
||||
bot.c \
|
||||
sv_user.c
|
||||
|
||||
SOUND= \
|
||||
snd_dma.c \
|
||||
snd_mem.c \
|
||||
snd_mix.c \
|
||||
snd_mixa.s
|
||||
|
||||
PROGRAMS= \
|
||||
pr_cmds.c \
|
||||
pr_edict.c \
|
||||
pr_exec.c
|
||||
|
||||
DOS= \
|
||||
cd_audio.c \
|
||||
dos_v2.c \
|
||||
dosasm.s \
|
||||
in_dos.c \
|
||||
mplib.c \
|
||||
mplpc.c \
|
||||
net_bw.c \
|
||||
net_dos.c \
|
||||
net_ipx.c \
|
||||
net_mp.c \
|
||||
net_ser.c \
|
||||
snd_dos.c \
|
||||
snd_gus.c \
|
||||
sys_dos.c \
|
||||
sys_dosa.s \
|
||||
vid_vga.c \
|
||||
vid_ext.c \
|
||||
vid_dos.c \
|
||||
vregset.c
|
||||
|
||||
SOURCES= \
|
||||
$(CLIENT) \
|
||||
$(DRAW) \
|
||||
$(NET) \
|
||||
$(PROGRAMS) \
|
||||
$(RENDER) \
|
||||
$(SERVER) \
|
||||
$(SOUND) \
|
||||
$(DOS) \
|
||||
chase.c \
|
||||
cmd.c \
|
||||
nvs_common.c \
|
||||
common.c \
|
||||
console.c \
|
||||
crc.c \
|
||||
cvar.c \
|
||||
draw.c \
|
||||
host.c \
|
||||
host_cmd.c \
|
||||
keys.c \
|
||||
math.s \
|
||||
mathlib.c \
|
||||
menu.c \
|
||||
model_common.c \
|
||||
model.c \
|
||||
nonintel.c \
|
||||
sbar.c \
|
||||
screen.c \
|
||||
surf8.s \
|
||||
surf8fst.s \
|
||||
surf16.s \
|
||||
view.c \
|
||||
wad.c \
|
||||
world.c \
|
||||
worlda.s \
|
||||
zone.c
|
||||
|
||||
# Compute object files from source files
|
||||
OBJS=\
|
||||
$(addprefix $(OBJDIR)/,\
|
||||
$(addsuffix .o,\
|
||||
$(basename $(SOURCES))\
|
||||
)\
|
||||
)
|
||||
|
||||
# Compute dependency files from source files
|
||||
DEPS=\
|
||||
$(addprefix $(OBJDIR)/,\
|
||||
$(addsuffix .d,\
|
||||
$(basename $(SOURCES))\
|
||||
)\
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
# Rules
|
||||
#
|
||||
|
||||
# Standard for "Build it, please"
|
||||
.PHONY : all
|
||||
all : $(BUILD)
|
||||
@echo "Done."
|
||||
|
||||
# Compile directory
|
||||
$(OBJDIR) :
|
||||
@echo "Creating compiling directory $(OBJDIR)..."
|
||||
mkdir $(OBJDIR)
|
||||
|
||||
# Dependencies
|
||||
SEDDEP=\
|
||||
sed '1s|$*.o|$(OBJDIR)/& $@ |' > $@;\
|
||||
[ -s $@ ] || $(RM) $@
|
||||
|
||||
$(OBJDIR)/%.d : %.c $(OBJDIR)
|
||||
@echo "Generating dependencies for $<..."
|
||||
set -e; $(CC) -MM $(CFLAGS) $< | $(SEDDEP)
|
||||
|
||||
$(OBJDIR)/%.d : ../asm/%.s $(OBJDIR)
|
||||
@echo "Generating dependencies for $<..."
|
||||
set -e; $(AS) -MM $(CFLAGS) $< | $(SEDDEP)
|
||||
|
||||
# Objects
|
||||
$(OBJDIR)/%.o : %.c $(OBJDIR)
|
||||
@echo "Compiling $<..."
|
||||
$(CC) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
$(OBJDIR)/%.o : ../asm/%.s $(OBJDIR)
|
||||
@echo "Assembling $<..."
|
||||
$(AS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
# Include all dependencies
|
||||
ifeq (,$(filter $(MAKECMDGOALS),\
|
||||
clean \
|
||||
cleanexe \
|
||||
cleanobj \
|
||||
cleandep))
|
||||
-include $(DEPS)
|
||||
endif
|
||||
|
||||
# Executable
|
||||
$(BUILD) : $(OBJS)
|
||||
@echo "Linking $@..."
|
||||
$(LD) -o $(BUILD) $(LDFLAGS) $(CSTUB) $(OBJS) $(LIBS)
|
||||
|
||||
|
||||
#
|
||||
# Cleaning procedures
|
||||
#
|
||||
.PHONY : clean cleanexe cleanobj cleandep
|
||||
|
||||
clean : cleanexe cleanobj cleandep
|
||||
|
||||
cleanexe :
|
||||
@echo "Cleaning executable from $(OBJDIR)..."
|
||||
$(RM) $(BUILD)
|
||||
|
||||
cleanobj :
|
||||
@echo "Cleaning objects from $(OBJDIR)..."
|
||||
$(RM) $(OBJS)
|
||||
|
||||
cleandep :
|
||||
@echo "Cleaning dependecies from $(OBJDIR)..."
|
||||
$(RM) $(DEPS)
|
|
@ -1,60 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Generate quake-data.spec
|
||||
# $1 is version
|
||||
# $2 is release
|
||||
# $3 is install dir (assumed to be in /var/tmp)
|
||||
cat <<EOF
|
||||
%define name quake-data
|
||||
%define version ${1}
|
||||
%define release ${2}
|
||||
%define builddir \$RPM_BUILD_DIR/%{name}-%{version}
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Vendor: id Software
|
||||
Packager: Dave "Zoid" Kirsch <zoid@idsoftware.com>
|
||||
URL: http://www.idsoftware.com/
|
||||
Source: quake-data-%{version}.tar.gz
|
||||
BuildArchitectures: noarch
|
||||
Group: Games
|
||||
Copyright: Restricted
|
||||
Icon: quake.gif
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Summary: Quake for Linux
|
||||
|
||||
%description
|
||||
"Quake is the biggest, baddest, and bloodiest 3-D action game ever
|
||||
conceived" - PC GAMER
|
||||
|
||||
"The most important PC game ever" - PC ZONE
|
||||
|
||||
""Quake": Bloody Amazing" - USA TODAY
|
||||
|
||||
"The Vanguard of a terrifying new level of immersive interactivity" -
|
||||
COMPUTER GAMING WORLD
|
||||
|
||||
From the creators of DOOM and DOOM II comes the most intense, technologically
|
||||
advanced 3-D experience ever captured on CD ROM. Features free and fluid
|
||||
motion, ambient sound and lighting, and unmatched multiplayer capabilities
|
||||
(play with up to 15 others).
|
||||
|
||||
This package contians the Quake data files needed to play the game.
|
||||
|
||||
%install
|
||||
|
||||
%files
|
||||
%attr(644,root,root) $3/comexp.txt
|
||||
%attr(644,root,root) $3/help.txt
|
||||
%attr(644,root,root) $3/licinfo.txt
|
||||
%attr(644,root,root) $3/manual.txt
|
||||
%attr(644,root,root) $3/readme.txt
|
||||
%attr(644,root,root) $3/rlicnse.txt
|
||||
%attr(644,root,root) $3/techinfo.txt
|
||||
%attr(644,root,root) $3/id1/pak0.pak
|
||||
%attr(644,root,root) $3/id1/pak1.pak
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
|
||||
EOF
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Generate quake-hipnotic.spec
|
||||
# $1 is version
|
||||
# $2 is release
|
||||
# $3 is install dir (assumed to be in /var/tmp)
|
||||
cat <<EOF
|
||||
%define name quake-hipnotic
|
||||
%define version ${1}
|
||||
%define release ${2}
|
||||
%define builddir \$RPM_BUILD_DIR/%{name}-%{version}
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Vendor: id Software/Ritual Entertainment
|
||||
Packager: Dave "Zoid" Kirsch <zoid@idsoftware.com>
|
||||
URL: http://www.ritual.com/
|
||||
Source: quake-hipnotic-%{version}.tar.gz
|
||||
BuildArchitectures: noarch
|
||||
Group: Games
|
||||
Copyright: Restricted
|
||||
Icon: quake.gif
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Summary: Quake Hipnotic Mission Pack #1: Scourge of Armagon
|
||||
|
||||
%description
|
||||
|
||||
The Scourge of Armagon is the highly acclaimed mission pack for id Software's
|
||||
Quake. Scourge offers 3 new episodes that continue off where Quake ended. Add
|
||||
some incredible new effects such as rotating doors and objects, new creatures
|
||||
to battle, and new weapons and powerups to assist you in these battles.
|
||||
|
||||
Looking for a way to breath some new life into Quake? Get Mission Pack #1:
|
||||
Scourge of Armagon.
|
||||
|
||||
Here is a breakdown of exactly what you will get inside Scourge of Armagon:
|
||||
|
||||
18 Beastly Levels
|
||||
Strafe and slaughter your way through 18 levels contained in three
|
||||
monster-infested episodes. Fight your way through the intense Military
|
||||
Base and Research Facilities, sneak around in the Ancient Realm, and dash
|
||||
into the final domain controlled by Armagon. You’ll also be able to tear
|
||||
your friends apart in an all-new DeathMatch level: Edge of Oblivion.
|
||||
|
||||
All-New Flesh-Ripping Demons
|
||||
Gremlins: Small, blood-thirsty creatures that attack in swarms and can even
|
||||
steal your weapons. Watch out or these little bastards will turn them back on
|
||||
you!
|
||||
|
||||
Centroids: Armor-plated scorpion cyborgs with two nail guns fused to their
|
||||
monstrous bodies. These bad boy monsters can shred you to bits in just
|
||||
seconds.
|
||||
|
||||
Armagon: This is the father of all monsters. This huge metallic behemoth will
|
||||
rock your world with rockets and laser fire, so be prepared to die.
|
||||
|
||||
Never-Before-Seen Weapons
|
||||
Mjolnir: When this war hammer pounds the floor, it fires an electrical force
|
||||
along the ground, striking and shocking several enemies with its lethal
|
||||
current.
|
||||
|
||||
Laser Cannon: Disintegrate scores of creatures with scorching laser blasts.
|
||||
Use the rebounding properties of this weapon to tag your enemies around
|
||||
corners.
|
||||
|
||||
Proximity Mines: Gameplay reaches new heights with motion sensitive mines.
|
||||
Plant these nasty toys on walls, floors, or even the ceiling and watch as
|
||||
unsuspecting foes are blown into little bits.
|
||||
|
||||
Inventive New Powerups
|
||||
Empathy Shield: This shield allows you to turn the table on those unwitting
|
||||
opponents. Whatever damage you take they receive half of it back in kind.
|
||||
|
||||
Horn of Conjuring: Blow this horn and out of the mystical bowels of eternity
|
||||
a new ally will appear. This horn allows you to call upon any of the
|
||||
creatures in the game to come to your aid in the fight against Armagon.
|
||||
|
||||
Wet Suit: What better way to survive under water longer. Not only that, those
|
||||
flippers help speed you along as you paddle your way through the dangers that
|
||||
lucky deep under the surface of those calm waters.
|
||||
|
||||
Environmental Dangers
|
||||
Undertake atmospheric nightmares like lightning traps, floating spike mines,
|
||||
gondolas, outdoor environments and stunning architecture never seen before in
|
||||
Quake. Travel through the dangerous and treacherous mines under the Military
|
||||
Base. Creep through the catacombs and dark cathedrals that lie in wait for
|
||||
you in the Ancient Realms. Swallow your fear as you wind our way through the
|
||||
immense fortress that protect the Lair of Armagon.
|
||||
|
||||
System Requirements
|
||||
|
||||
Full Version of QUAKE required to operate.
|
||||
CD ROM drive required for Installation
|
||||
Linux 2.0
|
||||
16 MB RAM
|
||||
Hard Disk Space: 40 MB for Mission Pack
|
||||
VGA & SVGA graphics support
|
||||
Mouse support (3 Button Mouse recommended)
|
||||
Supports IP (Internet) play
|
||||
|
||||
%install
|
||||
|
||||
%files
|
||||
%attr(644,root,root) $3/hipnotic/pak0.pak
|
||||
%attr(644,root,root) $3/hipnotic/config.cfg
|
||||
%attr(644,root,root) $3/hipnotic/docs/manual.doc
|
||||
%attr(644,root,root) $3/hipnotic/docs/manual.htm
|
||||
%attr(644,root,root) $3/hipnotic/docs/manual.txt
|
||||
%attr(644,root,root) $3/hipnotic/docs/readme.doc
|
||||
%attr(644,root,root) $3/hipnotic/docs/readme.htm
|
||||
%attr(644,root,root) $3/hipnotic/docs/readme.txt
|
||||
|
||||
EOF
|
||||
|
|
@ -1,108 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Generate quake-rogue.spec
|
||||
# $1 is version
|
||||
# $2 is release
|
||||
# $3 is install dir (assumed to be in /var/tmp)
|
||||
cat <<EOF
|
||||
%define name quake-rogue
|
||||
%define version ${1}
|
||||
%define release ${2}
|
||||
%define builddir \$RPM_BUILD_DIR/%{name}-%{version}
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Vendor: id Software/Rogue Entertainment
|
||||
Packager: Dave "Zoid" Kirsch <zoid@idsoftware.com>
|
||||
URL: http://www.rogue-ent.com/
|
||||
Source: quake-rogue-%{version}.tar.gz
|
||||
BuildArchitectures: noarch
|
||||
Group: Games
|
||||
Copyright: Restricted
|
||||
Icon: quake.gif
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Summary: Quake Rogue Mission Pack #2: Dissolution of Eternity
|
||||
|
||||
%description
|
||||
|
||||
16 entirely new, and totally intense levels! The environmental experience of
|
||||
Quake is unparalleled. Dissolution of Eternity sustains the same dynamic
|
||||
sense of reality and dramatic visuals; yet adds an impression of purpose
|
||||
and continuity. This expansion pack is most definitely not a conglomeration
|
||||
of clone levels!
|
||||
|
||||
8 new monsters! Quake is solid, hard-hitting action with a host of evil
|
||||
enemies. We've made additions to the Quake monster roster to intensify the
|
||||
action and fill every dimly lit and evil corner of the game.
|
||||
|
||||
4 new weapons! The Quake weapons are awesome, but we've pushed them beyond
|
||||
that with the addition of extreme power-ups to make the arsenal more
|
||||
effective, and more deadly.
|
||||
|
||||
Oh yeah, the Power-Ups!
|
||||
|
||||
Single player mode power-ups include:
|
||||
|
||||
The Anti-Grav Belt. The theory here is simple. It counters the force of
|
||||
gravity and allows the player to make difficult jumps.
|
||||
|
||||
The Power Shield. This 'little gem' significantly decreases the damage you
|
||||
receive from most enemy attacks. If you're feelin' frisky in Deathmatch,
|
||||
try out the ram attack. It's an added 'weapon' to send your opponents flying.
|
||||
|
||||
Deathmatch will introduce the player to:
|
||||
|
||||
The Vengeance Sphere. We'd like you to experience it before we let you in on
|
||||
what it does. Here's a hint: Ultimate retribution from the grave!
|
||||
|
||||
Random Respawn. This feature will toss in a bit of Deathmatch variety. Hey,
|
||||
we can't be responsible for what awesome power up 'pops up' next.
|
||||
|
||||
Multi-player!
|
||||
|
||||
Normal Deathmatch. Friend fraggin' action!
|
||||
Team Play. Bring a friend, to kill a foe.
|
||||
Tag. You played it as a kid, but nothin' says "Tag!" like a face full of
|
||||
Plasma.
|
||||
|
||||
And, a much enhanced version of Capture the Flag!
|
||||
Capture the Flag. You've seen it on the Internet; now it's in your hands.
|
||||
Additional value, additional excitement, and additional Deathmatch 'down and
|
||||
dirty' devastation. CTF is one of the most exciting team multi-player
|
||||
directions for Quake to date; and the most popular too!
|
||||
|
||||
Including two brand new CTF features.
|
||||
|
||||
One Flag - It's a mad race for the flag, the loser gets a rocket up his
|
||||
privates.
|
||||
Three Team - Red, Blue, and the new Rogue (pun intended) Grey team. The good
|
||||
news? You can take either flag and bring to it either Red or Blue base. The
|
||||
bad news? You don't have your own base!
|
||||
|
||||
Also, a collection of lethal environmental hazards have been placed at every
|
||||
turn. They are challenging, and terminal! Here are just a few of them.
|
||||
|
||||
The Pendulums - Set to slice the player to shreds when he least expects it!
|
||||
Lightning Shooters - Well, they shoot lightning and can be directed at any
|
||||
angle to make some rooms extremely hazardous.
|
||||
Lava Nail Shooters - Well, they shoot, you get the idea here!
|
||||
Earthquakes - Earthshaking environments! Level areas that tremor with
|
||||
seismic activity. Now the Quake player can literally quake!
|
||||
Buzz Saws - Compact. Cordless. And completely gib-o-matic! These dreaded
|
||||
traps are set in floors and ceilings.
|
||||
|
||||
%install
|
||||
|
||||
%files
|
||||
%attr(644,root,root) $3/rogue/pak0.pak
|
||||
%attr(644,root,root) $3/rogue/docs/manual.doc
|
||||
%attr(644,root,root) $3/rogue/docs/manual.htm
|
||||
%attr(644,root,root) $3/rogue/docs/manual.txt
|
||||
%attr(644,root,root) $3/rogue/docs/readme.doc
|
||||
%attr(644,root,root) $3/rogue/docs/readme.htm
|
||||
%attr(644,root,root) $3/rogue/docs/readme.txt
|
||||
%attr(644,root,root) $3/rogue/docs/ctf.doc
|
||||
%attr(644,root,root) $3/rogue/docs/ctf.htm
|
||||
%attr(644,root,root) $3/rogue/docs/ctf.txt
|
||||
|
||||
EOF
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Generate quake-shareware.spec
|
||||
# $1 is version
|
||||
# $2 is release
|
||||
# $3 is install dir (assumed to be in /var/tmp)
|
||||
cat <<EOF
|
||||
%define name quake
|
||||
%define version ${1}-shareware
|
||||
%define release ${2}
|
||||
%define builddir \$RPM_BUILD_DIR/%{name}-%{version}
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Vendor: id Software
|
||||
Packager: Dave "Zoid" Kirsch <zoid@idsoftware.com>
|
||||
URL: http://www.idsoftware.com/
|
||||
Source: quake-%{version}.tar.gz
|
||||
Group: Games
|
||||
Copyright: Restricted
|
||||
Icon: quake.gif
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Summary: Quake for Linux
|
||||
|
||||
%description
|
||||
"Quake is the biggest, baddest, and bloodiest 3-D action game ever
|
||||
conceived" - PC GAMER
|
||||
|
||||
"The most important PC game ever" - PC ZONE
|
||||
|
||||
""Quake": Bloody Amazing" - USA TODAY
|
||||
|
||||
"The Vanguard of a terrifying new level of immersive interactivity" -
|
||||
COMPUTER GAMING WORLD
|
||||
|
||||
From the creators of DOOM and DOOM II comes the most intense, technologically
|
||||
advanced 3-D experience ever captured on CD ROM. Features free and fluid
|
||||
motion, ambient sound and lighting, and unmatched multiplayer capabilities
|
||||
(play with up to 15 others).
|
||||
|
||||
Included in this archive are several different versions of Quake.
|
||||
|
||||
- SQuake for SVGALib Console Graphics
|
||||
- GLQuake for 3DFX and other glX based hardware OpenGL
|
||||
- Quake.X11 for running Quake under X11
|
||||
|
||||
%install
|
||||
|
||||
%files
|
||||
%attr(644,root,root) $3/README
|
||||
%attr(4755,root,root) $3/squake
|
||||
%attr(4755,root,root) $3/glquake
|
||||
%attr(4755,root,root) $3/glquake.glx
|
||||
%attr(4755,root,root) $3/glquake.3dfxgl
|
||||
%attr(755,root,root) $3/quake.x11
|
||||
%attr(644,root,root) $3/help.txt
|
||||
%attr(644,root,root) $3/licinfo.txt
|
||||
%attr(644,root,root) $3/manual.txt
|
||||
%attr(644,root,root) $3/readme.txt
|
||||
%attr(644,root,root) $3/slicnse.txt
|
||||
%attr(644,root,root) $3/techinfo.txt
|
||||
%attr(644,root,root) $3/id1/pak0.pak
|
||||
%attr(755,root,root) /usr/lib/lib3dfxgl.so
|
||||
%attr(755,root,root) /usr/lib/libMesaGL.so.2.6
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
|
||||
EOF
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
#!/bin/sh
|
||||
# Generate quake.spec
|
||||
# $1 is version
|
||||
# $2 is release
|
||||
# $3 is install dir (assumed to be in /var/tmp)
|
||||
cat <<EOF
|
||||
%define name quake
|
||||
%define version ${1}
|
||||
%define release ${2}
|
||||
%define builddir \$RPM_BUILD_DIR/%{name}-%{version}
|
||||
Name: %{name}
|
||||
Version: %{version}
|
||||
Release: %{release}
|
||||
Vendor: id Software
|
||||
Packager: Dave "Zoid" Kirsch <zoid@idsoftware.com>
|
||||
URL: http://www.idsoftware.com/
|
||||
Source: quake-%{version}.tar.gz
|
||||
Group: Games
|
||||
Copyright: Restricted
|
||||
Icon: quake.gif
|
||||
BuildRoot: /var/tmp/%{name}-%{version}
|
||||
Summary: Quake for Linux
|
||||
|
||||
%description
|
||||
"Quake is the biggest, baddest, and bloodiest 3-D action game ever
|
||||
conceived" - PC GAMER
|
||||
|
||||
"The most important PC game ever" - PC ZONE
|
||||
|
||||
""Quake": Bloody Amazing" - USA TODAY
|
||||
|
||||
"The Vanguard of a terrifying new level of immersive interactivity" -
|
||||
COMPUTER GAMING WORLD
|
||||
|
||||
From the creators of DOOM and DOOM II comes the most intense, technologically
|
||||
advanced 3-D experience ever captured on CD ROM. Features free and fluid
|
||||
motion, ambient sound and lighting, and unmatched multiplayer capabilities
|
||||
(play with up to 15 others).
|
||||
|
||||
Included in this archive are several different versions of Quake.
|
||||
|
||||
- SQuake for SVGALib Console Graphics
|
||||
- GLQuake for 3DFX and other glX based hardware OpenGL
|
||||
- Quake.X11 for running Quake under X11
|
||||
|
||||
%install
|
||||
|
||||
%files
|
||||
%attr(644,root,root) $3/README
|
||||
%attr(4755,root,root) $3/squake
|
||||
%attr(4755,root,root) $3/glquake
|
||||
%attr(4755,root,root) $3/glquake.glx
|
||||
%attr(4755,root,root) $3/glquake.3dfxgl
|
||||
%attr(755,root,root) $3/quake.x11
|
||||
%attr(755,root,root) /usr/lib/lib3dfxgl.so
|
||||
%attr(755,root,root) /usr/lib/libMesaGL.so.2.6
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
EOF
|
||||
|
|
@ -1,124 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 1996-1997 Id Software, Inc.
|
||||
|
||||
This program is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU General Public License
|
||||
as published by the Free Software Foundation; either version 2
|
||||
of the License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
See the GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
|
||||
*/
|
||||
// winquake.h: Win32-specific Quake header file
|
||||
|
||||
#pragma warning( disable : 4229 ) // mgraph gets this
|
||||
|
||||
#include <windows.h>
|
||||
// 2001-12-10 Compilable with LCC-Win32 by Jeff Ford start
|
||||
#ifdef __LCC__
|
||||
#include <ws2spi.h>
|
||||
#endif
|
||||
#include <mmsystem.h>
|
||||
// 2001-12-10 Compilable with LCC-Win32 by Jeff Ford end
|
||||
#define WM_MOUSEWHEEL 0x020A
|
||||
//#define PROTO
|
||||
#ifndef SERVERONLY
|
||||
#include <ddraw.h>
|
||||
#include <dsound.h>
|
||||
#ifndef GLQUAKE
|
||||
#include <mgraph.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
extern HINSTANCE global_hInstance;
|
||||
extern int global_nCmdShow;
|
||||
|
||||
#ifndef SERVERONLY
|
||||
|
||||
extern LPDIRECTDRAW lpDD;
|
||||
extern qboolean DDActive;
|
||||
extern LPDIRECTDRAWSURFACE lpPrimary;
|
||||
extern LPDIRECTDRAWSURFACE lpFrontBuffer;
|
||||
extern LPDIRECTDRAWSURFACE lpBackBuffer;
|
||||
extern LPDIRECTDRAWPALETTE lpDDPal;
|
||||
extern LPDIRECTSOUND pDS;
|
||||
extern LPDIRECTSOUNDBUFFER pDSBuf;
|
||||
|
||||
extern DWORD gSndBufSize;
|
||||
//#define SNDBUFSIZE 65536
|
||||
|
||||
void VID_LockBuffer (void);
|
||||
void VID_UnlockBuffer (void);
|
||||
|
||||
#endif
|
||||
|
||||
typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t;
|
||||
|
||||
extern modestate_t modestate;
|
||||
|
||||
extern HWND mainwindow;
|
||||
extern qboolean ActiveApp, Minimized;
|
||||
|
||||
extern qboolean WinNT;
|
||||
|
||||
int VID_ForceUnlockedAndReturnState (void);
|
||||
void VID_ForceLockState (int lk);
|
||||
|
||||
void IN_ShowMouse (void);
|
||||
void IN_DeactivateMouse (void);
|
||||
void IN_HideMouse (void);
|
||||
void IN_ActivateMouse (void);
|
||||
void IN_RestoreOriginalMouseState (void);
|
||||
void IN_SetQuakeMouseState (void);
|
||||
void IN_MouseEvent (int mstate);
|
||||
|
||||
extern qboolean winsock_lib_initialized;
|
||||
|
||||
extern cvar_t *_windowed_mouse;
|
||||
|
||||
extern int window_center_x, window_center_y;
|
||||
extern RECT window_rect;
|
||||
|
||||
extern qboolean mouseinitialized;
|
||||
extern HWND hwnd_dialog;
|
||||
|
||||
extern HANDLE hinput, houtput;
|
||||
|
||||
void IN_UpdateClipCursor (void);
|
||||
void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify);
|
||||
|
||||
void S_BlockSound (void);
|
||||
void S_UnblockSound (void);
|
||||
|
||||
void VID_SetDefaultMode (void);
|
||||
|
||||
int (PASCAL FAR *pWSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData);
|
||||
int (PASCAL FAR *pWSACleanup)(void);
|
||||
int (PASCAL FAR *pWSAGetLastError)(void);
|
||||
SOCKET (PASCAL FAR *psocket)(int af, int type, int protocol);
|
||||
int (PASCAL FAR *pioctlsocket)(SOCKET s, long cmd, u_long FAR *argp);
|
||||
int (PASCAL FAR *psetsockopt)(SOCKET s, int level, int optname,
|
||||
const char FAR * optval, int optlen);
|
||||
int (PASCAL FAR *precvfrom)(SOCKET s, char FAR * buf, int len, int flags,
|
||||
struct sockaddr FAR *from, int FAR * fromlen);
|
||||
int (PASCAL FAR *psendto)(SOCKET s, const char FAR * buf, int len, int flags,
|
||||
const struct sockaddr FAR *to, int tolen);
|
||||
int (PASCAL FAR *pclosesocket)(SOCKET s);
|
||||
int (PASCAL FAR *pgethostname)(char FAR * name, int namelen);
|
||||
struct hostent FAR * (PASCAL FAR *pgethostbyname)(const char FAR * name);
|
||||
struct hostent FAR * (PASCAL FAR *pgethostbyaddr)(const char FAR * addr,
|
||||
int len, int type);
|
||||
int (PASCAL FAR *pgetsockname)(SOCKET s, struct sockaddr FAR *name, int FAR * namelen);
|
||||
|
||||
// 2001-12-10 Reduced compiler warnings by Jeff Ford start
|
||||
LONG CDAudio_MessageHandler(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
||||
void IN_Accumulate (void);
|
||||
// 2001-12-10 Reduced compiler warnings by Jeff Ford end
|
87
gnu.txt
87
gnu.txt
|
@ -1,87 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
Preamble
|
||||
The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and modification follow.
|
||||
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
|
||||
|
||||
|
||||
a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.)
|
||||
These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
|
||||
Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.)
|
||||
The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
|
||||
If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
60
readme.id
60
readme.id
|
@ -1,60 +0,0 @@
|
|||
|
||||
This is the complete source code for winquake, glquake, quakeworld, and
|
||||
glquakeworld.
|
||||
|
||||
The projects have been tested with visual C++ 6.0, but masm is also required
|
||||
to build the assembly language files. It is possible to change a #define and
|
||||
build with only C code, but the software rendering versions lose almost half
|
||||
its speed. The OpenGL versions will not be effected very much. The
|
||||
gas2masm tool was created to allow us to use the same source for the dos,
|
||||
linux, and windows versions, but I don't really recommend anyone mess
|
||||
with the asm code.
|
||||
|
||||
The original dos version of Quake should also be buildable from these
|
||||
sources, but we didn't bother trying.
|
||||
|
||||
The code is all licensed under the terms of the GPL (gnu public license).
|
||||
You should read the entire license, but the gist of it is that you can do
|
||||
anything you want with the code, including sell your new version. The catch
|
||||
is that if you distribute new binary versions, you are required to make the
|
||||
entire source code available for free to everyone.
|
||||
|
||||
Our previous code releases have been under licenses that preclude
|
||||
commercial exploitation, but have no clause forcing sharing of source code.
|
||||
There have been some unfortunate losses to the community as a result of
|
||||
mod teams keeping their sources closed (and sometimes losing them). If
|
||||
you are going to publicly release modified versions of this code, you must
|
||||
also make source code available. I would encourage teams to even go a step
|
||||
farther and investigate using public CVS servers for development where
|
||||
possible.
|
||||
|
||||
The primary intent of this release is for entertainment and educational
|
||||
purposes, but the GPL does allow commercial exploitation if you obey the
|
||||
full license. If you want to do something commercial and you just can't bear
|
||||
to have your source changes released, we could still negotiate a separate
|
||||
license agreement (for $$$), but I would encourage you to just live with the
|
||||
GPL.
|
||||
|
||||
All of the Quake data files remain copyrighted and licensed under the
|
||||
original terms, so you cannot redistribute data from the original game, but if
|
||||
you do a true total conversion, you can create a standalone game based on
|
||||
this code.
|
||||
|
||||
I will see about having the license changed on the shareware episode of
|
||||
quake to allow it to be duplicated more freely (for linux distributions, for
|
||||
example), but I can't give a timeframe for it. You can still download one of
|
||||
the original quake demos and use that data with the code, but there are
|
||||
restrictions on the redistribution of the demo data.
|
||||
|
||||
If you never actually bought a complete version of Quake, you might want
|
||||
to rummage around in a local software bargain bin for one of the originals,
|
||||
or perhaps find a copy of the "Quake: the offering" boxed set with both
|
||||
mission packs.
|
||||
|
||||
Thanks to Dave "Zoid" Kirsh and Robert Duffy for doing the grunt work of
|
||||
building this release.
|
||||
|
||||
John Carmack
|
||||
Id Software
|
||||
|
||||
|
Loading…
Reference in a new issue