Imported Upstream version 1.42b+20150713+dfsg1
Simon McVittie
8 years ago
51 | 51 | 4.) mingw64-x86_64-gcc-g++ (For 64bit, same as above) |
52 | 52 | 5.) make |
53 | 53 | 6.) bison |
54 | 7.) subversion | |
54 | 7.) git-core | |
55 | 55 | |
56 | 56 | When you search for your packages you'll see category listings. These packages would all be under the 'Devel' category. |
57 | 57 | |
68 | 68 | After the install has completed you should have a 'Cygwin Terminal' icon on your Desktop. This is the bash shell for Cygwin, so go ahead and run it. |
69 | 69 | |
70 | 70 | At the command prompt type: |
71 | svn co http://iortcw.googlecode.com/svn/trunk iortcw | |
71 | git clone https://github.com/iortcw/iortcw.git iortcw | |
72 | 72 | |
73 | 73 | This will pull the iortcw trunk source. |
74 | 74 | |
78 | 78 | or |
79 | 79 | cd iortcw/SP (Single-Player) |
80 | 80 | |
81 | ./cross-make-mingw.sh (to build 32bit binaries) | |
81 | ARCH=x86 make (to build 32bit binaries) | |
82 | 82 | or |
83 | ./cross-make-mingw64.sh (for 64bit binaries) | |
83 | ARCH=x86_64 make (for 64bit binaries) | |
84 | 84 | |
85 | 85 | Wait for build to complete. |
86 | 86 |
60 | 60 | endif |
61 | 61 | export PLATFORM |
62 | 62 | |
63 | ifeq ($(PLATFORM),mingw32) | |
64 | MINGW=1 | |
65 | endif | |
66 | ifeq ($(PLATFORM),mingw64) | |
67 | MINGW=1 | |
68 | endif | |
69 | ||
63 | 70 | ifeq ($(COMPILE_ARCH),i386) |
64 | 71 | COMPILE_ARCH=x86 |
65 | 72 | endif |
97 | 104 | # For historical compatibility reasons on non-windows |
98 | 105 | # platform output files use i386 instead of x86 |
99 | 106 | ifeq ($(ARCH),x86) |
100 | ifneq ($(PLATFORM),mingw32) | |
107 | ifndef MINGW | |
101 | 108 | FILE_ARCH=i386 |
102 | 109 | endif |
103 | 110 | endif |
123 | 130 | endif |
124 | 131 | |
125 | 132 | ifndef CLIENTBIN |
126 | ifeq ($(PLATFORM),mingw32) | |
133 | ifdef MINGW | |
127 | 134 | CLIENTBIN=ioWolfMP |
128 | 135 | else |
129 | 136 | CLIENTBIN=iowolfmp |
131 | 138 | endif |
132 | 139 | |
133 | 140 | ifndef SERVERBIN |
134 | ifeq ($(PLATFORM),mingw32) | |
141 | ifdef MINGW | |
135 | 142 | SERVERBIN=ioWolfDED |
136 | 143 | else |
137 | 144 | SERVERBIN=iowolfded |
183 | 190 | endif |
184 | 191 | |
185 | 192 | ifndef USE_CURL_DLOPEN |
186 | ifeq ($(PLATFORM),mingw32) | |
193 | ifdef MINGW | |
187 | 194 | USE_CURL_DLOPEN=0 |
188 | 195 | else |
189 | 196 | USE_CURL_DLOPEN=1 |
232 | 239 | |
233 | 240 | ifndef USE_INTERNAL_JPEG |
234 | 241 | USE_INTERNAL_JPEG=$(USE_INTERNAL_LIBS) |
242 | endif | |
243 | ||
244 | ifndef USE_INTERNAL_FREETYPE | |
245 | USE_INTERNAL_FREETYPE=$(USE_INTERNAL_LIBS) | |
235 | 246 | endif |
236 | 247 | |
237 | 248 | ifndef USE_LOCAL_HEADERS |
290 | 301 | OPUSDIR=$(MOUNT_DIR)/opus-1.1 |
291 | 302 | OPUSFILEDIR=$(MOUNT_DIR)/opusfile-0.6 |
292 | 303 | ZDIR=$(MOUNT_DIR)/zlib |
304 | FTDIR=$(MOUNT_DIR)/freetype-2.5.5 | |
293 | 305 | SPLDIR=$(MOUNT_DIR)/splines |
294 | 306 | Q3ASMDIR=$(MOUNT_DIR)/tools/asm |
295 | 307 | LBURGDIR=$(MOUNT_DIR)/tools/lcc/lburg |
312 | 324 | OPENAL_LIBS ?= $(shell pkg-config --silence-errors --libs openal) |
313 | 325 | SDL_CFLAGS ?= $(shell pkg-config --silence-errors --cflags sdl2|sed 's/-Dmain=SDL_main//') |
314 | 326 | SDL_LIBS ?= $(shell pkg-config --silence-errors --libs sdl2) |
315 | FREETYPE_CFLAGS ?= $(shell pkg-config --silence-errors --cflags freetype2) | |
316 | 327 | else |
317 | 328 | # assume they're in the system default paths (no -I or -L needed) |
318 | 329 | CURL_LIBS ?= -lcurl |
350 | 361 | EXTRA_FILES= |
351 | 362 | CLIENT_EXTRA_FILES= |
352 | 363 | |
353 | ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu")) | |
364 | ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")) | |
354 | 365 | |
355 | 366 | ifeq ($(ARCH),x86_64) |
356 | 367 | LIB=lib64 |
360 | 371 | else |
361 | 372 | ifeq ($(ARCH),s390x) |
362 | 373 | LIB=lib64 |
374 | else | |
375 | ifeq ($(ARCH),aarch64) | |
376 | LIB=lib64 | |
377 | endif | |
363 | 378 | endif |
364 | 379 | endif |
365 | 380 | endif |
368 | 383 | -pipe -DUSE_ICON |
369 | 384 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
370 | 385 | |
371 | OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer | |
386 | OPTIMIZEVM = -O3 | |
372 | 387 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
373 | 388 | |
374 | 389 | ifeq ($(ARCH),x86_64) |
375 | OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops | |
376 | # clang 3.5 doesn't support this | |
377 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
378 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
379 | endif | |
390 | OPTIMIZEVM = -O3 | |
380 | 391 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
381 | 392 | HAVE_VM_COMPILED = true |
382 | 393 | else |
383 | 394 | ifeq ($(ARCH),x86) |
384 | OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer -funroll-loops | |
385 | # clang 3.5 doesn't support this | |
386 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
387 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
388 | endif | |
395 | OPTIMIZEVM = -O3 -march=i586 | |
389 | 396 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
390 | 397 | HAVE_VM_COMPILED=true |
391 | 398 | else |
523 | 530 | |
524 | 531 | ifeq ($(USE_OPENAL),1) |
525 | 532 | ifneq ($(USE_OPENAL_DLOPEN),1) |
526 | CLIENT_LIBS += -framework OpenAL | |
533 | ifneq ($(USE_INTERNAL_LIBS),1) | |
534 | CLIENT_CFLAGS += $(OPENAL_CFLAGS) | |
535 | CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS) | |
536 | else | |
537 | CLIENT_LIBS += -framework OpenAL | |
538 | endif | |
527 | 539 | endif |
528 | 540 | endif |
529 | 541 | |
538 | 550 | |
539 | 551 | ifeq ($(USE_LOCAL_HEADERS),1) |
540 | 552 | BASE_CFLAGS += -I$(SDLHDIR)/include |
553 | else | |
554 | BASE_CFLAGS += $(SDL_CFLAGS) | |
541 | 555 | endif |
542 | 556 | |
543 | 557 | # We copy sdlmain before ranlib'ing it so that subversion doesn't think |
544 | 558 | # the file has been modified by each build. |
545 | LIBSDLMAIN=$(B)/libSDL2main.a | |
546 | LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDL2main.a | |
547 | CLIENT_LIBS += -framework IOKit \ | |
548 | $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
549 | RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
550 | CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib $(LIBSDIR)/macosx/libopenal.dylib | |
559 | ifeq ($(USE_INTERNAL_LIBS),1) | |
560 | LIBSDLMAIN=$(B)/libSDL2main.a | |
561 | LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDL2main.a | |
562 | CLIENT_LIBS += -framework IOKit $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
563 | RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
564 | else | |
565 | CLIENT_LIBS += -framework IOKit $(SDL_LIBS) | |
566 | RENDERER_LIBS += -framework OpenGL $(SDL_LIBS) | |
567 | endif | |
568 | ||
569 | ifeq ($(USE_INTERNAL_LIBS),1) | |
570 | CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib $(LIBSDIR)/macosx/libopenal.dylib | |
571 | endif | |
551 | 572 | |
552 | 573 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
553 | 574 | |
564 | 585 | # SETUP AND BUILD -- MINGW32 |
565 | 586 | ############################################################################# |
566 | 587 | |
567 | ifeq ($(PLATFORM),mingw32) | |
588 | ifdef MINGW | |
568 | 589 | |
569 | 590 | ifeq ($(CROSS_COMPILING),1) |
570 | 591 | # If CC is already set to something generic, we probably want to use |
581 | 602 | MINGW_PREFIXES=amd64-mingw32msvc x86_64-w64-mingw32 |
582 | 603 | endif |
583 | 604 | ifeq ($(ARCH),x86) |
584 | MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32 | |
605 | MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32 i686-pc-mingw32 | |
585 | 606 | endif |
586 | 607 | |
587 | 608 | ifndef CC |
634 | 655 | endif |
635 | 656 | |
636 | 657 | ifeq ($(ARCH),x86_64) |
637 | OPTIMIZEVM = -O3 -fno-omit-frame-pointer -funroll-loops | |
638 | # clang 3.5 doesn't support this | |
639 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
640 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
641 | endif | |
658 | OPTIMIZEVM = -O3 | |
642 | 659 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
643 | 660 | HAVE_VM_COMPILED = true |
644 | 661 | FILE_ARCH=x64 |
645 | 662 | endif |
646 | 663 | ifeq ($(ARCH),x86) |
647 | OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer -funroll-loops | |
648 | # clang 3.5 doesn't support this | |
649 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
650 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
651 | endif | |
664 | OPTIMIZEVM = -O3 -march=i586 | |
652 | 665 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
653 | 666 | HAVE_VM_COMPILED = true |
654 | 667 | endif |
677 | 690 | RENDERER_LIBS = -lgdi32 -lole32 -lopengl32 |
678 | 691 | |
679 | 692 | ifeq ($(USE_FREETYPE),1) |
680 | FREETYPE_CFLAGS = -Ifreetype2 | |
693 | ifneq ($(USE_INTERNAL_FREETYPE),1) | |
694 | FREETYPE_CFLAGS = -Ifreetype2 | |
695 | endif | |
681 | 696 | endif |
682 | 697 | |
683 | 698 | ifeq ($(USE_CURL),1) |
731 | 746 | SDLDLL=SDL2.dll |
732 | 747 | endif |
733 | 748 | |
734 | else # ifeq mingw32 | |
749 | else # ifdef MINGW | |
735 | 750 | |
736 | 751 | ############################################################################# |
737 | 752 | # SETUP AND BUILD -- FREEBSD |
746 | 761 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
747 | 762 | HAVE_VM_COMPILED = true |
748 | 763 | |
749 | OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer | |
764 | OPTIMIZEVM = -O3 | |
750 | 765 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
751 | 766 | |
752 | 767 | SHLIBEXT=so |
799 | 814 | -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON |
800 | 815 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
801 | 816 | |
802 | OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer | |
817 | OPTIMIZEVM = -O3 | |
803 | 818 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
804 | 819 | |
805 | 820 | ifeq ($(ARCH),x86_64) |
806 | OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops | |
807 | # clang 3.5 doesn't support this | |
808 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
809 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
810 | endif | |
821 | OPTIMIZEVM = -O3 | |
811 | 822 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
812 | 823 | HAVE_VM_COMPILED = true |
813 | 824 | else |
814 | 825 | ifeq ($(ARCH),x86) |
815 | OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer -funroll-loops | |
816 | # clang 3.5 doesn't support this | |
817 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
818 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
819 | endif | |
826 | OPTIMIZEVM = -O3 -march=i586 | |
820 | 827 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
821 | 828 | HAVE_VM_COMPILED=true |
822 | 829 | else |
944 | 951 | -pipe -DUSE_ICON |
945 | 952 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
946 | 953 | |
947 | OPTIMIZEVM = -O3 -funroll-loops | |
954 | OPTIMIZEVM = -O3 | |
948 | 955 | |
949 | 956 | ifeq ($(ARCH),sparc) |
950 | 957 | OPTIMIZEVM += -O3 -mtune=ultrasparc3 -mv8plus -mno-faster-structs |
951 | # clang 3.5 doesn't support this | |
952 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
953 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
954 | endif | |
955 | 958 | HAVE_VM_COMPILED=true |
956 | 959 | else |
957 | 960 | ifeq ($(ARCH),x86) |
958 | OPTIMIZEVM += -march=i586 -fomit-frame-pointer | |
959 | # clang 3.5 doesn't support this | |
960 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
961 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
962 | endif | |
961 | OPTIMIZEVM += -march=i586 | |
963 | 962 | HAVE_VM_COMPILED=true |
964 | 963 | BASE_CFLAGS += -m32 |
965 | 964 | CLIENT_CFLAGS += -I/usr/X11/include/NVIDIA |
995 | 994 | |
996 | 995 | endif #Linux |
997 | 996 | endif #darwin |
998 | endif #mingw32 | |
997 | endif #MINGW | |
999 | 998 | endif #FreeBSD |
1000 | 999 | endif #OpenBSD |
1001 | 1000 | endif #NetBSD |
1045 | 1044 | |
1046 | 1045 | ifneq ($(BUILD_GAME_SO),0) |
1047 | 1046 | ifneq ($(BUILD_BASEGAME),0) |
1048 | ifeq ($(PLATFORM),mingw32) | |
1047 | ifdef MINGW | |
1049 | 1048 | TARGETS += \ |
1050 | 1049 | $(B)/$(BASEGAME)/cgame_mp_$(SHLIBNAME) \ |
1051 | 1050 | $(B)/$(BASEGAME)/qagame_mp_$(SHLIBNAME) \ |
1152 | 1151 | BASE_CFLAGS += -DUSE_INTERNAL_JPEG |
1153 | 1152 | BASE_CFLAGS += -I$(JPDIR) |
1154 | 1153 | else |
1155 | # libjpeg doesn't have pkg-config yet, but let users override with | |
1156 | # "make JPEG_CFLAGS=-I/opt/jpeg/include JPEG_LIBS='-L/opt/jpeg/lib -ljpeg'" | |
1157 | # if they need to | |
1158 | JPEG_CFLAGS ?= | |
1159 | JPEG_LIBS ?= -ljpeg | |
1154 | # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc; | |
1155 | # we fall back to hard-coded answers if libjpeg.pc is unavailable | |
1156 | JPEG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libjpeg || true) | |
1157 | JPEG_LIBS ?= $(shell pkg-config --silence-errors --libs libjpeg || echo -ljpeg) | |
1160 | 1158 | BASE_CFLAGS += $(JPEG_CFLAGS) |
1161 | 1159 | RENDERER_LIBS += $(JPEG_LIBS) |
1162 | 1160 | endif |
1163 | 1161 | |
1164 | 1162 | ifeq ($(USE_FREETYPE),1) |
1165 | FREETYPE_CFLAGS ?= $(shell pkg-config --silence-errors --cflags freetype2 || true) | |
1166 | FREETYPE_LIBS ?= $(shell pkg-config --silence-errors --libs freetype2 || echo -lfreetype) | |
1167 | ||
1163 | ifeq ($(USE_INTERNAL_FREETYPE),1) | |
1164 | FREETYPE_CFLAGS += -I$(FTDIR)/include -DFT2_BUILD_LIBRARY | |
1165 | else | |
1166 | FREETYPE_CFLAGS ?= $(shell pkg-config --silence-errors --cflags freetype2 || true) | |
1167 | FREETYPE_LIBS ?= $(shell pkg-config --silence-errors --libs freetype2 || echo -lfreetype) | |
1168 | endif | |
1168 | 1169 | BASE_CFLAGS += -DBUILD_FREETYPE $(FREETYPE_CFLAGS) |
1169 | 1170 | RENDERER_LIBS += $(FREETYPE_LIBS) |
1170 | 1171 | endif |
1369 | 1370 | @echo " COMPILE_ARCH: $(COMPILE_ARCH)" |
1370 | 1371 | @echo " CC: $(CC)" |
1371 | 1372 | @echo " CXX: $(CXX)" |
1372 | ifeq ($(PLATFORM),mingw32) | |
1373 | ifdef MINGW | |
1373 | 1374 | @echo " WINDRES: $(WINDRES)" |
1374 | 1375 | endif |
1375 | 1376 | @echo "" |
1709 | 1710 | $(B)/client/con_log.o \ |
1710 | 1711 | $(B)/client/sys_main.o |
1711 | 1712 | |
1712 | ifeq ($(PLATFORM),mingw32) | |
1713 | ifdef MINGW | |
1713 | 1714 | Q3OBJ += \ |
1714 | 1715 | $(B)/client/con_passive.o |
1715 | 1716 | else |
1730 | 1731 | $(B)/rend2/tr_font.o \ |
1731 | 1732 | $(B)/rend2/tr_glsl.o \ |
1732 | 1733 | $(B)/rend2/tr_image.o \ |
1734 | $(B)/rend2/tr_image_bmp.o \ | |
1735 | $(B)/rend2/tr_image_jpg.o \ | |
1736 | $(B)/rend2/tr_image_pcx.o \ | |
1733 | 1737 | $(B)/rend2/tr_image_png.o \ |
1734 | $(B)/rend2/tr_image_jpg.o \ | |
1735 | $(B)/rend2/tr_image_bmp.o \ | |
1736 | 1738 | $(B)/rend2/tr_image_tga.o \ |
1737 | $(B)/rend2/tr_image_pcx.o \ | |
1738 | 1739 | $(B)/rend2/tr_init.o \ |
1739 | 1740 | $(B)/rend2/tr_light.o \ |
1740 | 1741 | $(B)/rend2/tr_main.o \ |
1797 | 1798 | $(B)/renderer/tr_flares.o \ |
1798 | 1799 | $(B)/renderer/tr_font.o \ |
1799 | 1800 | $(B)/renderer/tr_image.o \ |
1801 | $(B)/renderer/tr_image_bmp.o \ | |
1802 | $(B)/renderer/tr_image_jpg.o \ | |
1803 | $(B)/renderer/tr_image_pcx.o \ | |
1800 | 1804 | $(B)/renderer/tr_image_png.o \ |
1801 | $(B)/renderer/tr_image_jpg.o \ | |
1802 | $(B)/renderer/tr_image_bmp.o \ | |
1803 | 1805 | $(B)/renderer/tr_image_tga.o \ |
1804 | $(B)/renderer/tr_image_pcx.o \ | |
1805 | 1806 | $(B)/renderer/tr_init.o \ |
1806 | 1807 | $(B)/renderer/tr_light.o \ |
1807 | 1808 | $(B)/renderer/tr_main.o \ |
1888 | 1889 | $(B)/renderer/jquant1.o \ |
1889 | 1890 | $(B)/renderer/jquant2.o \ |
1890 | 1891 | $(B)/renderer/jutils.o |
1892 | endif | |
1893 | ||
1894 | ifeq ($(USE_FREETYPE),1) | |
1895 | ifneq ($(USE_INTERNAL_FREETYPE),0) | |
1896 | FTOBJ += \ | |
1897 | $(B)/renderer/ftsystem.o \ | |
1898 | $(B)/renderer/ftdebug.o \ | |
1899 | $(B)/renderer/ftinit.o \ | |
1900 | $(B)/renderer/ftbase.o \ | |
1901 | $(B)/renderer/ftbbox.o \ | |
1902 | $(B)/renderer/ftbdf.o \ | |
1903 | $(B)/renderer/ftbitmap.o \ | |
1904 | $(B)/renderer/ftcid.o \ | |
1905 | $(B)/renderer/ftfstype.o \ | |
1906 | $(B)/renderer/ftgasp.o \ | |
1907 | $(B)/renderer/ftglyph.o \ | |
1908 | $(B)/renderer/ftgxval.o \ | |
1909 | $(B)/renderer/ftlcdfil.o \ | |
1910 | $(B)/renderer/ftmm.o \ | |
1911 | $(B)/renderer/ftotval.o \ | |
1912 | $(B)/renderer/ftpatent.o \ | |
1913 | $(B)/renderer/ftpfr.o \ | |
1914 | $(B)/renderer/ftstroke.o \ | |
1915 | $(B)/renderer/ftsynth.o \ | |
1916 | $(B)/renderer/fttype1.o \ | |
1917 | $(B)/renderer/ftwinfnt.o \ | |
1918 | $(B)/renderer/ftxf86.o \ | |
1919 | $(B)/renderer/truetype.o \ | |
1920 | $(B)/renderer/type1.o \ | |
1921 | $(B)/renderer/cff.o \ | |
1922 | $(B)/renderer/type1cid.o \ | |
1923 | $(B)/renderer/pfr.o \ | |
1924 | $(B)/renderer/type42.o \ | |
1925 | $(B)/renderer/winfnt.o \ | |
1926 | $(B)/renderer/pcf.o \ | |
1927 | $(B)/renderer/bdf.o \ | |
1928 | $(B)/renderer/sfnt.o \ | |
1929 | $(B)/renderer/autofit.o \ | |
1930 | $(B)/renderer/pshinter.o \ | |
1931 | $(B)/renderer/raster.o \ | |
1932 | $(B)/renderer/smooth.o \ | |
1933 | $(B)/renderer/ftcache.o \ | |
1934 | $(B)/renderer/ftgzip.o \ | |
1935 | $(B)/renderer/ftlzw.o \ | |
1936 | $(B)/renderer/ftbzip2.o \ | |
1937 | $(B)/renderer/psaux.o \ | |
1938 | $(B)/renderer/psnames.o | |
1939 | endif | |
1891 | 1940 | endif |
1892 | 1941 | |
1893 | 1942 | ifeq ($(ARCH),x86) |
2050 | 2099 | $(B)/client/internal.o \ |
2051 | 2100 | $(B)/client/opusfile.o \ |
2052 | 2101 | $(B)/client/stream.o |
2053 | ifeq ($(PLATFORM),mingw32) | |
2102 | ifdef MINGW | |
2054 | 2103 | Q3OBJ += \ |
2055 | 2104 | $(B)/client/wincerts.o |
2056 | 2105 | endif |
2120 | 2169 | endif |
2121 | 2170 | endif |
2122 | 2171 | |
2123 | ifeq ($(PLATFORM),mingw32) | |
2172 | ifdef MINGW | |
2124 | 2173 | Q3OBJ += \ |
2125 | 2174 | $(B)/client/win_resource.o \ |
2126 | 2175 | $(B)/client/sys_win32.o |
2146 | 2195 | -o $@ $(Q3OBJ) \ |
2147 | 2196 | $(LIBSDLMAIN) $(CLIENT_LIBS) $(LIBS) |
2148 | 2197 | |
2149 | $(B)/renderer_mp_opengl1_$(SHLIBNAME): $(Q3ROBJ) $(JPGOBJ) | |
2198 | $(B)/renderer_mp_opengl1_$(SHLIBNAME): $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) | |
2150 | 2199 | $(echo_cmd) "LD $@" |
2151 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3ROBJ) $(JPGOBJ) \ | |
2200 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) \ | |
2152 | 2201 | $(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS) |
2153 | 2202 | |
2154 | $(B)/renderer_mp_rend2_$(SHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) | |
2203 | $(B)/renderer_mp_rend2_$(SHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) | |
2155 | 2204 | $(echo_cmd) "LD $@" |
2156 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) \ | |
2205 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) \ | |
2157 | 2206 | $(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS) |
2158 | 2207 | else |
2159 | $(B)/$(CLIENTBIN)$(FULLBINEXT): $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) $(LIBSDLMAIN) | |
2208 | $(B)/$(CLIENTBIN)$(FULLBINEXT): $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) $(LIBSDLMAIN) | |
2160 | 2209 | $(echo_cmd) "LD $@" |
2161 | 2210 | $(Q)$(CXX) $(CLIENT_CFLAGS) $(CFLAGS) $(CLIENT_LDFLAGS) $(LDFLAGS) \ |
2162 | -o $@ $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) \ | |
2211 | -o $@ $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) \ | |
2163 | 2212 | $(LIBSDLMAIN) $(CLIENT_LIBS) $(RENDERER_LIBS) $(LIBS) |
2164 | 2213 | |
2165 | $(B)/$(CLIENTBIN)_rend2$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(LIBSDLMAIN) | |
2214 | $(B)/$(CLIENTBIN)_rend2$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) $(LIBSDLMAIN) | |
2166 | 2215 | $(echo_cmd) "LD $@" |
2167 | 2216 | $(Q)$(CXX) $(CLIENT_CFLAGS) $(CFLAGS) $(CLIENT_LDFLAGS) $(LDFLAGS) \ |
2168 | -o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) \ | |
2217 | -o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) \ | |
2169 | 2218 | $(LIBSDLMAIN) $(CLIENT_LIBS) $(RENDERER_LIBS) $(LIBS) |
2170 | 2219 | endif |
2171 | 2220 | |
2293 | 2342 | endif |
2294 | 2343 | endif |
2295 | 2344 | |
2296 | ifeq ($(PLATFORM),mingw32) | |
2345 | ifdef MINGW | |
2297 | 2346 | Q3DOBJ += \ |
2298 | 2347 | $(B)/ded/win_resource.o \ |
2299 | 2348 | $(B)/ded/sys_win32.o \ |
2357 | 2406 | Q3CGOBJ = $(Q3CGOBJ_) $(B)/$(BASEGAME)/cgame/cg_syscalls.o |
2358 | 2407 | Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) |
2359 | 2408 | |
2360 | ifeq ($(PLATFORM),mingw32) | |
2409 | ifdef MINGW | |
2361 | 2410 | $(B)/$(BASEGAME)/cgame_mp_$(SHLIBNAME): $(Q3CGOBJ) |
2362 | 2411 | $(echo_cmd) "LD $@" |
2363 | 2412 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) |
2432 | 2481 | Q3GOBJ = $(Q3GOBJ_) $(B)/$(BASEGAME)/game/g_syscalls.o |
2433 | 2482 | Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) |
2434 | 2483 | |
2435 | ifeq ($(PLATFORM),mingw32) | |
2484 | ifdef MINGW | |
2436 | 2485 | $(B)/$(BASEGAME)/qagame_mp_$(SHLIBNAME): $(Q3GOBJ) |
2437 | 2486 | $(echo_cmd) "LD $@" |
2438 | 2487 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) |
2466 | 2515 | Q3UIOBJ = $(Q3UIOBJ_) $(B)/$(BASEGAME)/ui/ui_syscalls.o |
2467 | 2516 | Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm) |
2468 | 2517 | |
2469 | ifeq ($(PLATFORM),mingw32) | |
2518 | ifdef MINGW | |
2470 | 2519 | $(B)/$(BASEGAME)/ui_mp_$(SHLIBNAME): $(Q3UIOBJ) |
2471 | 2520 | $(echo_cmd) "LD $@" |
2472 | 2521 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) |
2563 | 2612 | $(B)/rend2/%.o: $(R2DIR)/%.c |
2564 | 2613 | $(DO_REF_CC) |
2565 | 2614 | |
2615 | $(B)/renderer/%.o: $(FTDIR)/src/autofit/%.c | |
2616 | $(DO_REF_CC) | |
2617 | ||
2618 | $(B)/renderer/%.o: $(FTDIR)/src/base/%.c | |
2619 | $(DO_REF_CC) | |
2620 | ||
2621 | $(B)/renderer/%.o: $(FTDIR)/src/bdf/%.c | |
2622 | $(DO_REF_CC) | |
2623 | ||
2624 | $(B)/renderer/%.o: $(FTDIR)/src/bzip2/%.c | |
2625 | $(DO_REF_CC) | |
2626 | ||
2627 | $(B)/renderer/%.o: $(FTDIR)/src/cache/%.c | |
2628 | $(DO_REF_CC) | |
2629 | ||
2630 | $(B)/renderer/%.o: $(FTDIR)/src/cff/%.c | |
2631 | $(DO_REF_CC) | |
2632 | ||
2633 | $(B)/renderer/%.o: $(FTDIR)/src/cid/%.c | |
2634 | $(DO_REF_CC) | |
2635 | ||
2636 | $(B)/renderer/%.o: $(FTDIR)/src/gxvalid/%.c | |
2637 | $(DO_REF_CC) | |
2638 | ||
2639 | $(B)/renderer/%.o: $(FTDIR)/src/gzip/%.c | |
2640 | $(DO_REF_CC) | |
2641 | ||
2642 | $(B)/renderer/%.o: $(FTDIR)/src/lzw/%.c | |
2643 | $(DO_REF_CC) | |
2644 | ||
2645 | $(B)/renderer/%.o: $(FTDIR)/src/otvalid/%.c | |
2646 | $(DO_REF_CC) | |
2647 | ||
2648 | $(B)/renderer/%.o: $(FTDIR)/src/pcf/%.c | |
2649 | $(DO_REF_CC) | |
2650 | ||
2651 | $(B)/renderer/%.o: $(FTDIR)/src/pfr/%.c | |
2652 | $(DO_REF_CC) | |
2653 | ||
2654 | $(B)/renderer/%.o: $(FTDIR)/src/psaux/%.c | |
2655 | $(DO_REF_CC) | |
2656 | ||
2657 | $(B)/renderer/%.o: $(FTDIR)/src/pshinter/%.c | |
2658 | $(DO_REF_CC) | |
2659 | ||
2660 | $(B)/renderer/%.o: $(FTDIR)/src/psnames/%.c | |
2661 | $(DO_REF_CC) | |
2662 | ||
2663 | $(B)/renderer/%.o: $(FTDIR)/src/raster/%.c | |
2664 | $(DO_REF_CC) | |
2665 | ||
2666 | $(B)/renderer/%.o: $(FTDIR)/src/sfnt/%.c | |
2667 | $(DO_REF_CC) | |
2668 | ||
2669 | $(B)/renderer/%.o: $(FTDIR)/src/smooth/%.c | |
2670 | $(DO_REF_CC) | |
2671 | ||
2672 | $(B)/renderer/%.o: $(FTDIR)/src/tools/%.c | |
2673 | $(DO_REF_CC) | |
2674 | ||
2675 | $(B)/renderer/%.o: $(FTDIR)/src/truetype/%.c | |
2676 | $(DO_REF_CC) | |
2677 | ||
2678 | $(B)/renderer/%.o: $(FTDIR)/src/type1/%.c | |
2679 | $(DO_REF_CC) | |
2680 | ||
2681 | $(B)/renderer/%.o: $(FTDIR)/src/type42/%.c | |
2682 | $(DO_REF_CC) | |
2683 | ||
2684 | $(B)/renderer/%.o: $(FTDIR)/src/winfonts/%.c | |
2685 | $(DO_REF_CC) | |
2566 | 2686 | |
2567 | 2687 | $(B)/ded/%.o: $(ASMDIR)/%.s |
2568 | 2688 | $(DO_AS) |
2648 | 2768 | # MISC |
2649 | 2769 | ############################################################################# |
2650 | 2770 | |
2651 | OBJ = $(Q3OBJ) $(Q3ROBJ) $(Q3R2OBJ) $(Q3DOBJ) $(JPGOBJ) \ | |
2771 | OBJ = $(Q3OBJ) $(Q3ROBJ) $(Q3R2OBJ) $(Q3DOBJ) $(JPGOBJ) $(FTOBJ) \ | |
2652 | 2772 | $(Q3GOBJ) $(Q3CGOBJ) $(Q3UIOBJ) \ |
2653 | 2773 | $(Q3GVMOBJ) $(Q3CGVMOBJ) $(Q3UIVMOBJ) |
2654 | 2774 | TOOLSOBJ = $(LBURGOBJ) $(Q3CPPOBJ) $(Q3RCCOBJ) $(Q3LCCOBJ) $(Q3ASMOBJ) |
0 | To run iortcw on the Raspberry Pi requires SDL2. | |
0 | To run iortcw on the Raspberry Pi requires SDL2 and at least 128M for GPU memory. | |
1 | ||
2 | (Under Raspbian, you can set the GPU memory using the raspi-config tool under Advanced Options->Memory Split) | |
1 | 3 | |
2 | 4 | SDL2 will need to be built in a particular way to have hardware accelerated |
3 | 5 | graphics. |
18 | 20 | |
19 | 21 | ./configure --disable-video-x11 --disable-video-opengl |
20 | 22 | |
23 | Note: On the newer Raspberry Pi 2 (due to a change in the toolchain naming) use: | |
24 | ||
25 | ./configure --host=armv7l-raspberry-linux-gnueabihf --disable-video-x11 --disable-video-opengl | |
26 | ||
21 | 27 | After that has completed, type: |
22 | 28 | make |
23 | 29 |
34 | 34 | ALIGN 16 |
35 | 35 | ssemask DWORD 0FFFFFFFFh, 0FFFFFFFFh, 0FFFFFFFFh, 00000000h |
36 | 36 | ssecw DWORD 00001F80h |
37 | ||
38 | IFNDEF idx64 | |
39 | fpucw WORD 037Fh | |
40 | ENDIF | |
41 | 37 | |
42 | 38 | .code |
43 | 39 |
1708 | 1708 | } |
1709 | 1709 | } |
1710 | 1710 | // -NERVE - SMF |
1711 | ||
1712 | trap_R_SetColor( NULL ); | |
1711 | 1713 | } |
1712 | 1714 | |
1713 | 1715 |
587 | 587 | int CG_WaterLevel(centity_t *cent) { |
588 | 588 | vec3_t point; |
589 | 589 | int contents, sample1, sample2, anim, waterlevel; |
590 | ||
590 | int viewheight; | |
591 | ||
592 | anim = cent->currentState.legsAnim & ~ANIM_TOGGLEBIT; | |
593 | ||
594 | if (anim == LEGS_WALKCR || anim == LEGS_IDLECR) { | |
595 | viewheight = CROUCH_VIEWHEIGHT; | |
596 | } else { | |
597 | viewheight = DEFAULT_VIEWHEIGHT; | |
598 | } | |
599 | ||
600 | // | |
591 | 601 | // get waterlevel, accounting for ducking |
602 | // | |
592 | 603 | waterlevel = 0; |
593 | VectorCopy(cent->lerpOrigin, point); | |
594 | point[2] += MINS_Z + 1; | |
595 | anim = cent->currentState.legsAnim & ~ANIM_TOGGLEBIT; | |
596 | ||
597 | if (anim == LEGS_WALKCR || anim == LEGS_IDLECR) { | |
598 | point[2] += CROUCH_VIEWHEIGHT; | |
599 | } else { | |
600 | point[2] += DEFAULT_VIEWHEIGHT; | |
601 | } | |
602 | ||
604 | ||
605 | point[0] = cent->lerpOrigin[0]; | |
606 | point[1] = cent->lerpOrigin[1]; | |
607 | point[2] = cent->lerpOrigin[2] + MINS_Z + 1; | |
603 | 608 | contents = CG_PointContents(point, -1); |
604 | 609 | |
605 | 610 | if (contents & MASK_WATER) { |
606 | sample2 = point[2] - MINS_Z; | |
611 | sample2 = viewheight - MINS_Z; | |
607 | 612 | sample1 = sample2 / 2; |
608 | 613 | waterlevel = 1; |
609 | 614 | point[2] = cent->lerpOrigin[2] + MINS_Z + sample1; |
743 | 748 | } |
744 | 749 | |
745 | 750 | // play a gurp sound instead of a normal pain sound |
746 | if (CG_WaterLevel(cent) >= 1) { | |
751 | if (CG_WaterLevel(cent) == 3) { | |
747 | 752 | if (rand()&1) { |
748 | 753 | trap_S_StartSound(NULL, cent->currentState.number, CHAN_VOICE, CG_CustomSound(cent->currentState.number, "sound/player/gurp1.wav")); |
749 | 754 | } else { |
2301 | 2306 | case EV_DEATH3: |
2302 | 2307 | DEBUGNAME( "EV_DEATHx" ); |
2303 | 2308 | |
2304 | if (CG_WaterLevel(cent) >= 1) { | |
2309 | if (CG_WaterLevel(cent) == 3) { | |
2305 | 2310 | trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, "*drown.wav")); |
2306 | 2311 | } else { |
2307 | 2312 | trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, va("*death%i.wav", event - EV_DEATH1 + 1))); |
1659 | 1659 | extern vmCvar_t cg_ignore; |
1660 | 1660 | extern vmCvar_t cg_simpleItems; |
1661 | 1661 | extern vmCvar_t cg_fov; |
1662 | extern vmCvar_t cg_fixedAspect; | |
1662 | 1663 | extern vmCvar_t cg_zoomFov; |
1663 | 1664 | extern vmCvar_t cg_zoomDefaultBinoc; |
1664 | 1665 | extern vmCvar_t cg_zoomDefaultSniper; |
163 | 163 | vmCvar_t cg_ignore; |
164 | 164 | vmCvar_t cg_simpleItems; |
165 | 165 | vmCvar_t cg_fov; |
166 | vmCvar_t cg_fixedAspect; | |
166 | 167 | vmCvar_t cg_zoomFov; |
167 | 168 | vmCvar_t cg_zoomStepBinoc; |
168 | 169 | vmCvar_t cg_zoomStepSniper; |
303 | 304 | { &cg_zoomStepSnooper, "cg_zoomStepSnooper", "5", CVAR_ARCHIVE }, |
304 | 305 | { &cg_zoomStepFG, "cg_zoomStepFG", "10", CVAR_ARCHIVE }, //----(SA) added |
305 | 306 | { &cg_fov, "cg_fov", "90", CVAR_ARCHIVE }, |
307 | { &cg_fixedAspect, "cg_fixedAspect", "0", CVAR_ARCHIVE }, // Essentially the same as setting DF_FIXED_FOV for widescreen aspects | |
306 | 308 | { &cg_viewsize, "cg_viewsize", "100", CVAR_ARCHIVE }, |
307 | 309 | { &cg_letterbox, "cg_letterbox", "0", CVAR_TEMP }, //----(SA) added |
308 | 310 | { &cg_shadows, "cg_shadows", "1", CVAR_ARCHIVE }, |
406 | 406 | cgs.teamVoteNo[num - CS_TEAMVOTE_NO] = atoi( str ); |
407 | 407 | cgs.teamVoteModified[num - CS_TEAMVOTE_NO] = qtrue; |
408 | 408 | } else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1 ) { |
409 | Q_strncpyz( cgs.teamVoteString[num - CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString ) ); | |
409 | Q_strncpyz( cgs.teamVoteString[num - CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString[0] ) ); | |
410 | 410 | trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); |
411 | 411 | #endif |
412 | 412 | } else if ( num == CS_INTERMISSION ) { |
763 | 763 | #ifdef MISSIONPACK |
764 | 764 | if ( cg_singlePlayerActive.integer ) { |
765 | 765 | trap_Cvar_Set( "ui_matchStartTime", va( "%i", cg.time ) ); |
766 | if ( cg_recordSPDemo.integer && cg_recordSPDemoName.string && *cg_recordSPDemoName.string ) { | |
766 | if ( cg_recordSPDemo.integer && *cg_recordSPDemoName.string ) { | |
767 | 767 | trap_SendConsoleCommand( va( "set g_synchronousclients 1 ; record %s \n", cg_recordSPDemoName.string ) ); |
768 | 768 | } |
769 | 769 | } |
804 | 804 | */ |
805 | 805 | #define WAVE_AMPLITUDE 1 |
806 | 806 | #define WAVE_FREQUENCY 0.4 |
807 | #define STANDARD_ASPECT_RATIO ( (float)640 / (float)480 ) | |
807 | 808 | |
808 | 809 | static int CG_CalcFov( void ) { |
809 | 810 | static float lastfov = 90; // for transitions back from zoomed in modes |
829 | 830 | fov_x = 90; |
830 | 831 | } else { |
831 | 832 | // user selectable |
832 | if ( cgs.dmflags & DF_FIXED_FOV ) { | |
833 | if ( ( cgs.dmflags & DF_FIXED_FOV ) || cg_fixedAspect.value ) { | |
833 | 834 | // dmflag to prevent wide fov for all clients |
834 | 835 | fov_x = 90; |
835 | 836 | } else { |
892 | 893 | fov_x = 55; |
893 | 894 | } |
894 | 895 | |
896 | if ( cg_fixedAspect.value ) { | |
897 | float aspectRatio = (float)cg.refdef.width / (float)cg.refdef.height; | |
898 | ||
899 | if ( aspectRatio > STANDARD_ASPECT_RATIO ) | |
900 | fov_x = RAD2DEG( 2 * atan2( ( aspectRatio / STANDARD_ASPECT_RATIO ) * tan( DEG2RAD( fov_x ) * 0.5 ), 1 ) ); | |
901 | fov_x = min( fov_x, 160 ); | |
902 | } | |
903 | ||
895 | 904 | x = cg.refdef.width / tan( fov_x / 360 * M_PI ); |
896 | 905 | fov_y = atan2( cg.refdef.height, x ); |
897 | 906 | fov_y = fov_y * 360 / M_PI; |
1122 | 1131 | angles[PITCH] = -angles[PITCH]; // (SA) compensate for reversed pitch (this makes the game match the editor, however I'm guessing the real fix is to be done there) |
1123 | 1132 | VectorCopy( angles, cg.refdefViewAngles ); |
1124 | 1133 | AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); |
1134 | ||
1135 | if ( cg_fixedAspect.value ) { | |
1136 | float aspectRatio = (float)cg.refdef.width / (float)cg.refdef.height; | |
1137 | ||
1138 | if ( aspectRatio > STANDARD_ASPECT_RATIO ) | |
1139 | fov = RAD2DEG( 2 * atan2( ( aspectRatio / STANDARD_ASPECT_RATIO ) * tan( DEG2RAD( fov ) * 0.5 ), 1 ) ); | |
1140 | fov = min( fov, 160 ); | |
1141 | } | |
1125 | 1142 | |
1126 | 1143 | x = cg.refdef.width / tan( fov / 360 * M_PI ); |
1127 | 1144 | cg.refdef.fov_y = atan2( cg.refdef.height, x ); |
1402 | 1419 | fov_x = 90; |
1403 | 1420 | } else { |
1404 | 1421 | // user selectable |
1405 | if ( cgs.dmflags & DF_FIXED_FOV ) { | |
1422 | if ( ( cgs.dmflags & DF_FIXED_FOV ) || cg_fixedAspect.value ) { | |
1406 | 1423 | // dmflag to prevent wide fov for all clients |
1407 | 1424 | fov_x = 90; |
1408 | 1425 | } else { |
1457 | 1474 | fov_x = 55; |
1458 | 1475 | } |
1459 | 1476 | |
1477 | if ( cg_fixedAspect.value ) { | |
1478 | float aspectRatio = (float)cg.refdef.width / (float)cg.refdef.height; | |
1479 | ||
1480 | if ( aspectRatio > STANDARD_ASPECT_RATIO ) | |
1481 | fov_x = RAD2DEG( 2 * atan2( ( aspectRatio / STANDARD_ASPECT_RATIO ) * tan( DEG2RAD( fov_x ) * 0.5 ), 1 ) ); | |
1482 | fov_x = min( fov_x, 160 ); | |
1483 | } | |
1484 | ||
1460 | 1485 | cg.refdef.time = cg.time; |
1461 | 1486 | |
1462 | 1487 | x = cg.refdef.width / tan( fov_x / 360 * M_PI ); |
2816 | 2816 | } |
2817 | 2817 | |
2818 | 2818 | // drop gun lower at higher fov |
2819 | if ( cg_fov.integer > 90 ) { | |
2819 | if ( cg_fov.integer > 90 && !cg_fixedAspect.value ) { | |
2820 | 2820 | fovOffset = -0.2 * ( cg_fov.integer - 90 ); |
2821 | 2821 | } else { |
2822 | 2822 | fovOffset = 0; |
119 | 119 | buffer[ bufIndex + 1 ] = (byte)( ( x >> 8 ) & 0xFF ); |
120 | 120 | bufIndex += 2; |
121 | 121 | } |
122 | ||
123 | /* | |
124 | =============== | |
125 | WRITE_1BYTES | |
126 | =============== | |
127 | */ | |
128 | #if 0 | |
129 | static ID_INLINE void WRITE_1BYTES( int x ) { | |
130 | buffer[ bufIndex ] = x; | |
131 | bufIndex += 1; | |
132 | } | |
133 | #endif | |
134 | 122 | |
135 | 123 | /* |
136 | 124 | =============== |
106 | 106 | qboolean looping, holdAtEnd, dirty, alterGameState, silent, shader; |
107 | 107 | fileHandle_t iFile; |
108 | 108 | e_status status; |
109 | unsigned int startTime; | |
110 | unsigned int lastTime; | |
109 | int startTime; | |
110 | int lastTime; | |
111 | 111 | long tfps; |
112 | 112 | long RoQPlayed; |
113 | 113 | long ROQSize; |
178 | 178 | } serverStatus_t; |
179 | 179 | |
180 | 180 | serverStatus_t cl_serverStatusList[MAX_SERVERSTATUSREQUESTS]; |
181 | int serverStatusCount; | |
182 | 181 | |
183 | 182 | // DHM - Nerve :: Have we heard from the auto-update server this session? |
184 | 183 | qboolean autoupdateChecked; |
2478 | 2477 | ================= |
2479 | 2478 | */ |
2480 | 2479 | void CL_CheckForResend( void ) { |
2481 | int port, i; | |
2480 | int port; | |
2482 | 2481 | char info[MAX_INFO_STRING]; |
2483 | char data[MAX_INFO_STRING]; | |
2482 | char data[MAX_INFO_STRING + 10]; | |
2484 | 2483 | |
2485 | 2484 | // don't send anything if playing back a demo |
2486 | 2485 | if ( clc.demoplaying ) { |
2534 | 2533 | Info_SetValueForKey( info, "qport", va("%i", port ) ); |
2535 | 2534 | Info_SetValueForKey( info, "challenge", va("%i", clc.challenge ) ); |
2536 | 2535 | |
2537 | strcpy(data, "connect "); | |
2538 | // TTimo adding " " around the userinfo string to avoid truncated userinfo on the server | |
2539 | // (Com_TokenizeString tokenizes around spaces) | |
2540 | data[8] = '"'; | |
2541 | ||
2542 | for(i=0;i<strlen(info);i++) { | |
2543 | data[9+i] = info[i]; // + (clc.challenge)&0x3; | |
2544 | } | |
2545 | data[9+i] = '"'; | |
2546 | data[10+i] = 0; | |
2547 | ||
2548 | // NOTE TTimo don't forget to set the right data length! | |
2549 | NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) &data[0], i+10 ); | |
2536 | Com_sprintf( data, sizeof(data), "connect \"%s\"", info ); | |
2537 | NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) data, strlen ( data ) ); | |
2550 | 2538 | // the most current userinfo has been sent, so watch for any |
2551 | 2539 | // newer changes to userinfo variables |
2552 | 2540 | cvar_modifiedFlags &= ~CVAR_USERINFO; |
4578 | 4566 | oldestTime = cl_serverStatusList[i].startTime; |
4579 | 4567 | } |
4580 | 4568 | } |
4581 | if (oldest != -1) { | |
4582 | return &cl_serverStatusList[oldest]; | |
4583 | } | |
4584 | serverStatusCount++; | |
4585 | return &cl_serverStatusList[serverStatusCount & (MAX_SERVERSTATUSREQUESTS-1)]; | |
4569 | return &cl_serverStatusList[oldest]; | |
4586 | 4570 | } |
4587 | 4571 | |
4588 | 4572 | /* |
1361 | 1361 | BotAI_Trace( &trace, start, NULL, NULL, end, passent, contents_mask ); |
1362 | 1362 | //if water was hit |
1363 | 1363 | waterfactor = 1.0; |
1364 | //note: trace.contents is always 0, see BotAI_Trace | |
1364 | 1365 | if ( trace.contents & ( CONTENTS_LAVA | CONTENTS_SLIME | CONTENTS_WATER ) ) { |
1365 | 1366 | //if the water surface is translucent |
1366 | 1367 | if ( 1 ) { |
890 | 890 | } |
891 | 891 | |
892 | 892 | if ( i == facet->numBorders ) { |
893 | if ( facet->numBorders > 4 + 6 + 16 ) { | |
893 | if ( facet->numBorders >= 4 + 6 + 16 ) { | |
894 | 894 | Com_Printf( "ERROR: too many bevels\n" ); |
895 | continue; | |
895 | 896 | } |
896 | 897 | facet->borderPlanes[facet->numBorders] = CM_FindPlane2( plane, &flipped ); |
897 | 898 | facet->borderNoAdjust[facet->numBorders] = 0; |
960 | 961 | } |
961 | 962 | |
962 | 963 | if ( i == facet->numBorders ) { |
963 | if ( facet->numBorders > 4 + 6 + 16 ) { | |
964 | if ( facet->numBorders >= 4 + 6 + 16 ) { | |
964 | 965 | Com_Printf( "ERROR: too many bevels\n" ); |
966 | continue; | |
965 | 967 | } |
966 | 968 | facet->borderPlanes[facet->numBorders] = CM_FindPlane2( plane, &flipped ); |
967 | 969 | |
1001 | 1003 | |
1002 | 1004 | #ifndef BSPC |
1003 | 1005 | //add opposite plane |
1006 | if ( facet->numBorders >= 4 + 6 + 16 ) { | |
1007 | Com_Printf( "ERROR: too many bevels\n" ); | |
1008 | return; | |
1009 | } | |
1004 | 1010 | facet->borderPlanes[facet->numBorders] = facet->surfacePlane; |
1005 | 1011 | facet->borderNoAdjust[facet->numBorders] = 0; |
1006 | 1012 | facet->borderInward[facet->numBorders] = qtrue; |
3637 | 3637 | |
3638 | 3638 | Com_Printf( "Com_RandomBytes: using weak randomization\n" ); |
3639 | 3639 | for( i = 0; i < len; i++ ) |
3640 | string[i] = (unsigned char)( rand() % 255 ); | |
3640 | string[i] = (unsigned char)( rand() % 256 ); | |
3641 | 3641 | } |
3642 | 3642 | |
3643 | 3643 |
539 | 539 | |
540 | 540 | // Skip creation of the root directory as it will always be there |
541 | 541 | ofs = strchr( path, PATH_SEP ); |
542 | ofs++; | |
542 | if ( ofs != NULL ) { | |
543 | ofs++; | |
544 | } | |
543 | 545 | |
544 | 546 | for (; ofs != NULL && *ofs ; ofs++) { |
545 | 547 | if (*ofs == PATH_SEP) { |
3711 | 3713 | Com_Printf("\n\n" |
3712 | 3714 | "**************************************************\n" |
3713 | 3715 | "WARNING: " BASEGAME "/mp_pak0.pk3 is present but its checksum (%u)\n" |
3714 | "is not correct. Please re-copy pak0.pk3 from your\n" | |
3716 | "is not correct. Please re-copy mp_pak0.pk3 from your\n" | |
3715 | 3717 | "legitimate RTCW CDROM.\n" |
3716 | 3718 | "**************************************************\n\n\n", |
3717 | 3719 | curpack->checksum ); |
168 | 168 | |
169 | 169 | //================================================================= LINUX === |
170 | 170 | |
171 | #if defined(__linux__) || defined(__FreeBSD_kernel__) | |
171 | #if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__) | |
172 | 172 | |
173 | 173 | #include <endian.h> |
174 | 174 | |
175 | 175 | #if defined(__linux__) |
176 | 176 | #define OS_STRING "linux" |
177 | #else | |
177 | #elif defined(__FreeBSD_kernel__) | |
178 | 178 | #define OS_STRING "kFreeBSD" |
179 | #else | |
180 | #define OS_STRING "GNU" | |
179 | 181 | #endif |
180 | 182 | |
181 | 183 | #define ID_INLINE inline |
204 | 206 | #define ARCH_STRING "sparc" |
205 | 207 | #elif defined __arm__ |
206 | 208 | #define ARCH_STRING "arm" |
209 | #elif defined __aarch64__ | |
210 | #define ARCH_STRING "aarch64" | |
207 | 211 | #elif defined __cris__ |
208 | 212 | #define ARCH_STRING "cris" |
209 | 213 | #elif defined __hppa__ |
1385 | 1385 | *o = 0; |
1386 | 1386 | |
1387 | 1387 | if ( !strcmp( key, pkey ) ) { |
1388 | strcpy( start, s ); // remove this part | |
1388 | memmove(start, s, strlen(s) + 1); // remove this part | |
1389 | 1389 | return; |
1390 | 1390 | } |
1391 | 1391 |
0 | 0 | /* unzip.c -- IO for uncompress .zip files using zlib |
1 | ||
2 | Modified for Quake III Arena to use the Z_Malloc() memory pool; | |
3 | this means a system copy of minizip is not a suitable replacement. | |
4 | ||
5 | Based on minizip: | |
6 | ||
1 | 7 | Version 1.01e, February 12th, 2005 |
2 | 8 | |
3 | 9 | Copyright (C) 1998-2005 Gilles Vollant |
712 | 718 | |
713 | 719 | if (lSeek!=0) |
714 | 720 | { |
715 | if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0) | |
716 | err=UNZ_ERRNO; | |
721 | if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0) | |
722 | err=UNZ_ERRNO; | |
717 | 723 | } |
718 | 724 | if ((file_info.size_file_comment>0) && (commentBufferSize>0)) |
719 | 725 | if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) |
1139 | 1145 | pfile_in_zip_read_info->stream.avail_in = 0; |
1140 | 1146 | |
1141 | 1147 | if (inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS) == Z_OK) |
1142 | pfile_in_zip_read_info->stream_initialised=1; | |
1148 | pfile_in_zip_read_info->stream_initialised=1; | |
1143 | 1149 | else |
1144 | 1150 | { |
1145 | 1151 | TRYFREE(pfile_in_zip_read_info); |
202 | 202 | |
203 | 203 | |
204 | 204 | #define MASK_REG(modrm, mask) \ |
205 | EmitString("81"); \ | |
206 | EmitString((modrm)); \ | |
207 | Emit4((mask)) | |
205 | do { \ | |
206 | EmitString("81"); \ | |
207 | EmitString((modrm)); \ | |
208 | Emit4((mask)); \ | |
209 | } while(0) | |
208 | 210 | |
209 | 211 | // add bl, bytes |
210 | 212 | #define STACK_PUSH(bytes) \ |
211 | EmitString("80 C3"); \ | |
212 | Emit1(bytes) | |
213 | do { \ | |
214 | EmitString("80 C3"); \ | |
215 | Emit1(bytes); \ | |
216 | } while(0) | |
213 | 217 | |
214 | 218 | // sub bl, bytes |
215 | 219 | #define STACK_POP(bytes) \ |
216 | EmitString("80 EB"); \ | |
217 | Emit1(bytes) | |
220 | do { \ | |
221 | EmitString("80 EB"); \ | |
222 | Emit1(bytes); \ | |
223 | } while(0) | |
218 | 224 | |
219 | 225 | static void EmitCommand(ELastCommand command) |
220 | 226 | { |
411 | 417 | |
412 | 418 | if(vm_syscallNum < 0) |
413 | 419 | { |
414 | int *data; | |
420 | int *data, *ret; | |
415 | 421 | #if idx64 |
416 | 422 | int index; |
417 | 423 | intptr_t args[MAX_VMSYSCALL_ARGS]; |
418 | 424 | #endif |
419 | 425 | |
420 | 426 | data = (int *) (savedVM->dataBase + vm_programStack + 4); |
427 | ret = &vm_opStackBase[vm_opStackOfs + 1]; | |
421 | 428 | |
422 | 429 | #if idx64 |
423 | 430 | args[0] = ~vm_syscallNum; |
424 | 431 | for(index = 1; index < ARRAY_LEN(args); index++) |
425 | 432 | args[index] = data[index]; |
426 | 433 | |
427 | vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall(args); | |
434 | *ret = savedVM->systemCall(args); | |
428 | 435 | #else |
429 | 436 | data[0] = ~vm_syscallNum; |
430 | vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall((intptr_t *) data); | |
437 | *ret = savedVM->systemCall((intptr_t *) data); | |
431 | 438 | #endif |
432 | 439 | } |
433 | 440 | else |
41 | 41 | uniform mat4 u_ModelViewProjectionMatrix; |
42 | 42 | uniform vec4 u_BaseColor; |
43 | 43 | uniform vec4 u_VertColor; |
44 | ||
45 | #if defined(USE_DEFORM_VERTEXES) || defined(USE_RGBAGEN) | |
46 | uniform vec3 u_FireRiseDir; | |
47 | #endif | |
44 | 48 | |
45 | 49 | #if defined(USE_RGBAGEN) |
46 | 50 | uniform int u_ColorGen; |
49 | 53 | uniform vec3 u_DirectedLight; |
50 | 54 | uniform vec3 u_ModelLightDir; |
51 | 55 | uniform float u_PortalRange; |
56 | uniform float u_ZFadeLowest; | |
57 | uniform float u_ZFadeHighest; | |
52 | 58 | #endif |
53 | 59 | |
54 | 60 | #if defined(USE_VERTEX_ANIMATION) |
67 | 73 | float frequency = u_DeformParams[3]; |
68 | 74 | float spread = u_DeformParams[4]; |
69 | 75 | |
76 | // a negative frequency is for Z deformation based on normal | |
77 | float zDeformScale = 0; | |
78 | if (frequency < 0) | |
79 | { | |
80 | zDeformScale = 1; | |
81 | frequency *= -1; | |
82 | ||
83 | if (frequency > 999) | |
84 | { | |
85 | frequency -= 999; | |
86 | zDeformScale = -1; | |
87 | } | |
88 | } | |
89 | ||
70 | 90 | if (u_DeformGen == DGEN_BULGE) |
71 | 91 | { |
72 | 92 | phase *= st.x; |
102 | 122 | else // if (u_DeformGen == DGEN_BULGE) |
103 | 123 | { |
104 | 124 | func = sin(value); |
125 | } | |
126 | ||
127 | if (zDeformScale != 0) | |
128 | { | |
129 | vec3 dir = u_FireRiseDir * (0.4 + 0.6 * u_FireRiseDir.z); | |
130 | float nDot = dot(dir, normal); | |
131 | float scale = base + func * amplitude; | |
132 | ||
133 | if (nDot * scale > 0) | |
134 | { | |
135 | return pos + dir * nDot * scale * zDeformScale; | |
136 | } | |
137 | ||
138 | return pos; | |
105 | 139 | } |
106 | 140 | |
107 | 141 | return pos + normal * (base + func * amplitude); |
176 | 210 | else if (u_AlphaGen == AGEN_PORTAL) |
177 | 211 | { |
178 | 212 | color.a = clamp(length(viewer) / u_PortalRange, 0.0, 1.0); |
213 | } | |
214 | else if (u_AlphaGen == AGEN_NORMALZFADE) | |
215 | { | |
216 | float nDot = dot(normal, u_FireRiseDir); | |
217 | float halfRange = (u_ZFadeHighest - u_ZFadeLowest) / 2.0; | |
218 | ||
219 | if (nDot < u_ZFadeHighest) { | |
220 | if (nDot > u_ZFadeLowest) { | |
221 | float frac; | |
222 | if (nDot < u_ZFadeLowest + halfRange) { | |
223 | frac = ( nDot - u_ZFadeLowest ) / halfRange; | |
224 | } else { | |
225 | frac = 1.0 - ( nDot - u_ZFadeLowest - halfRange ) / halfRange; | |
226 | } | |
227 | color.a *= clamp(frac, 0.0, 1.0); | |
228 | } else { | |
229 | color.a = 0; | |
230 | } | |
231 | } else { | |
232 | color.a = 0; | |
233 | } | |
179 | 234 | } |
180 | 235 | |
181 | 236 | return color; |
30 | 30 | #else |
31 | 31 | # include <SDL_opengl.h> |
32 | 32 | #endif |
33 | ||
34 | extern void ( APIENTRY * qglActiveTextureARB )( GLenum texture ); | |
35 | extern void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture ); | |
36 | extern void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t ); | |
37 | ||
38 | extern void ( APIENTRY * qglLockArraysEXT )( GLint, GLint ); | |
39 | extern void ( APIENTRY * qglUnlockArraysEXT )( void ); | |
33 | 40 | |
34 | 41 | //=========================================================================== |
35 | 42 | |
77 | 84 | typedef void ( APIENTRY * PFNGLPNTRIANGLESFATIPROC )( GLenum pname, GLfloat param ); |
78 | 85 | #endif |
79 | 86 | |
87 | //----(SA) added | |
88 | extern void ( APIENTRY * qglPNTrianglesiATI )( GLenum pname, GLint param ); | |
89 | extern void ( APIENTRY * qglPNTrianglesfATI )( GLenum pname, GLfloat param ); | |
90 | //----(SA) end | |
91 | ||
80 | 92 | // for NV fog distance |
81 | 93 | #ifndef GL_NV_fog_distance |
82 | 94 | #define GL_FOG_DISTANCE_MODE_NV 0x855A |
101 | 113 | #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF |
102 | 114 | #endif |
103 | 115 | |
116 | ||
104 | 117 | // extensions will be function pointers on all platforms |
105 | ||
106 | extern void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t ); | |
107 | extern void ( APIENTRY * qglActiveTextureARB )( GLenum texture ); | |
108 | extern void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture ); | |
109 | ||
110 | extern void ( APIENTRY * qglLockArraysEXT )( GLint, GLint ); | |
111 | extern void ( APIENTRY * qglUnlockArraysEXT )( void ); | |
112 | ||
113 | //----(SA) added | |
114 | extern void ( APIENTRY * qglPNTrianglesiATI )( GLenum pname, GLint param ); | |
115 | extern void ( APIENTRY * qglPNTrianglesfATI )( GLenum pname, GLfloat param ); | |
116 | //----(SA) end | |
117 | ||
118 | // GL_EXT_draw_range_elements | |
119 | extern void (APIENTRY * qglDrawRangeElementsEXT) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); | |
120 | ||
121 | // rend2 | |
122 | ||
123 | // GL_EXT_multi_draw_arrays | |
124 | extern void (APIENTRY * qglMultiDrawArraysEXT) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); | |
125 | extern void (APIENTRY * qglMultiDrawElementsEXT) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); | |
126 | ||
127 | // GL_ARB_shading_language_100 | |
128 | #ifndef GL_ARB_shading_language_100 | |
129 | #define GL_ARB_shading_language_100 | |
130 | #define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C | |
131 | #endif | |
132 | ||
133 | // GL_ARB_vertex_program | |
134 | extern void (APIENTRY * qglVertexAttrib4fARB) (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); | |
135 | extern void (APIENTRY * qglVertexAttrib4fvARB) (GLuint, const GLfloat *); | |
136 | extern void (APIENTRY * qglVertexAttribPointerARB) (GLuint index, GLint size, GLenum type, GLboolean normalized, | |
137 | GLsizei stride, const GLvoid * pointer); | |
138 | extern void (APIENTRY * qglEnableVertexAttribArrayARB) (GLuint index); | |
139 | extern void (APIENTRY * qglDisableVertexAttribArrayARB) (GLuint index); | |
140 | ||
141 | // GL_ARB_vertex_buffer_object | |
142 | extern void (APIENTRY * qglBindBufferARB) (GLenum target, GLuint buffer); | |
143 | extern void (APIENTRY * qglDeleteBuffersARB) (GLsizei n, const GLuint * buffers); | |
144 | extern void (APIENTRY * qglGenBuffersARB) (GLsizei n, GLuint * buffers); | |
145 | extern GLboolean(APIENTRY * qglIsBufferARB) (GLuint buffer); | |
146 | extern void (APIENTRY * qglBufferDataARB) (GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); | |
147 | extern void (APIENTRY * qglBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); | |
148 | extern void (APIENTRY * qglGetBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); | |
149 | extern void (APIENTRY * qglGetBufferParameterivARB) (GLenum target, GLenum pname, GLint * params); | |
150 | extern void (APIENTRY * qglGetBufferPointervARB) (GLenum target, GLenum pname, GLvoid * *params); | |
151 | ||
152 | // GL_ARB_shader_objects | |
153 | extern void (APIENTRY * qglDeleteObjectARB) (GLhandleARB obj); | |
154 | extern GLhandleARB(APIENTRY * qglGetHandleARB) (GLenum pname); | |
155 | extern void (APIENTRY * qglDetachObjectARB) (GLhandleARB containerObj, GLhandleARB attachedObj); | |
156 | extern GLhandleARB(APIENTRY * qglCreateShaderObjectARB) (GLenum shaderType); | |
157 | extern void (APIENTRY * qglShaderSourceARB) (GLhandleARB shaderObj, GLsizei count, const GLcharARB * *string, | |
158 | const GLint * length); | |
159 | extern void (APIENTRY * qglCompileShaderARB) (GLhandleARB shaderObj); | |
160 | extern GLhandleARB(APIENTRY * qglCreateProgramObjectARB) (void); | |
161 | extern void (APIENTRY * qglAttachObjectARB) (GLhandleARB containerObj, GLhandleARB obj); | |
162 | extern void (APIENTRY * qglLinkProgramARB) (GLhandleARB programObj); | |
163 | extern void (APIENTRY * qglUseProgramObjectARB) (GLhandleARB programObj); | |
164 | extern void (APIENTRY * qglValidateProgramARB) (GLhandleARB programObj); | |
165 | extern void (APIENTRY * qglUniform1fARB) (GLint location, GLfloat v0); | |
166 | extern void (APIENTRY * qglUniform2fARB) (GLint location, GLfloat v0, GLfloat v1); | |
167 | extern void (APIENTRY * qglUniform3fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); | |
168 | extern void (APIENTRY * qglUniform4fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); | |
169 | extern void (APIENTRY * qglUniform1iARB) (GLint location, GLint v0); | |
170 | extern void (APIENTRY * qglUniform2iARB) (GLint location, GLint v0, GLint v1); | |
171 | extern void (APIENTRY * qglUniform3iARB) (GLint location, GLint v0, GLint v1, GLint v2); | |
172 | extern void (APIENTRY * qglUniform4iARB) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); | |
173 | extern void (APIENTRY * qglUniform1fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
174 | extern void (APIENTRY * qglUniform2fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
175 | extern void (APIENTRY * qglUniform3fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
176 | extern void (APIENTRY * qglUniform4fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
177 | extern void (APIENTRY * qglUniform2ivARB) (GLint location, GLsizei count, const GLint * value); | |
178 | extern void (APIENTRY * qglUniform3ivARB) (GLint location, GLsizei count, const GLint * value); | |
179 | extern void (APIENTRY * qglUniform4ivARB) (GLint location, GLsizei count, const GLint * value); | |
180 | extern void (APIENTRY * qglUniformMatrix2fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
181 | extern void (APIENTRY * qglUniformMatrix3fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
182 | extern void (APIENTRY * qglUniformMatrix4fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
183 | extern void (APIENTRY * qglGetObjectParameterfvARB) (GLhandleARB obj, GLenum pname, GLfloat * params); | |
184 | extern void (APIENTRY * qglGetObjectParameterivARB) (GLhandleARB obj, GLenum pname, GLint * params); | |
185 | extern void (APIENTRY * qglGetInfoLogARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); | |
186 | extern void (APIENTRY * qglGetAttachedObjectsARB) (GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, | |
187 | GLhandleARB * obj); | |
188 | extern GLint(APIENTRY * qglGetUniformLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
189 | extern void (APIENTRY * qglGetActiveUniformARB) (GLhandleARB programObj, GLuint index, GLsizei maxIndex, GLsizei * length, | |
190 | GLint * size, GLenum * type, GLcharARB * name); | |
191 | extern void (APIENTRY * qglGetUniformfvARB) (GLhandleARB programObj, GLint location, GLfloat * params); | |
192 | extern void (APIENTRY * qglGetUniformivARB) (GLhandleARB programObj, GLint location, GLint * params); | |
193 | extern void (APIENTRY * qglGetShaderSourceARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); | |
194 | ||
195 | // GL_ARB_vertex_shader | |
196 | extern void (APIENTRY * qglBindAttribLocationARB) (GLhandleARB programObj, GLuint index, const GLcharARB * name); | |
197 | extern void (APIENTRY * qglGetActiveAttribARB) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, | |
198 | GLint * size, GLenum * type, GLcharARB * name); | |
199 | extern GLint(APIENTRY * qglGetAttribLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
200 | ||
201 | // GL_ARB_texture_compression | |
202 | extern void (APIENTRY * qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
203 | GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); | |
204 | extern void (APIENTRY * qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
205 | GLint border, GLsizei imageSize, const GLvoid *data); | |
206 | extern void (APIENTRY * qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, | |
207 | GLsizei imageSize, const GLvoid *data); | |
208 | extern void (APIENTRY * qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | |
209 | GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); | |
210 | extern void (APIENTRY * qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, | |
211 | GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); | |
212 | extern void (APIENTRY * qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, | |
213 | GLsizei imageSize, const GLvoid *data); | |
214 | extern void (APIENTRY * qglGetCompressedTexImageARB)(GLenum target, GLint lod, | |
215 | GLvoid *img); | |
216 | ||
217 | // GL_NVX_gpu_memory_info | |
218 | #ifndef GL_NVX_gpu_memory_info | |
219 | #define GL_NVX_gpu_memory_info | |
220 | #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 | |
221 | #define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 | |
222 | #define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 | |
223 | #define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A | |
224 | #define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B | |
225 | #endif | |
226 | ||
227 | // GL_ATI_meminfo | |
228 | #ifndef GL_ATI_meminfo | |
229 | #define GL_ATI_meminfo | |
230 | #define GL_VBO_FREE_MEMORY_ATI 0x87FB | |
231 | #define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC | |
232 | #define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD | |
233 | #endif | |
234 | ||
235 | // GL_ARB_texture_float | |
236 | #ifndef GL_ARB_texture_float | |
237 | #define GL_ARB_texture_float | |
238 | #define GL_TEXTURE_RED_TYPE_ARB 0x8C10 | |
239 | #define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 | |
240 | #define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 | |
241 | #define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 | |
242 | #define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 | |
243 | #define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 | |
244 | #define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 | |
245 | #define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 | |
246 | #define GL_RGBA32F_ARB 0x8814 | |
247 | #define GL_RGB32F_ARB 0x8815 | |
248 | #define GL_ALPHA32F_ARB 0x8816 | |
249 | #define GL_INTENSITY32F_ARB 0x8817 | |
250 | #define GL_LUMINANCE32F_ARB 0x8818 | |
251 | #define GL_LUMINANCE_ALPHA32F_ARB 0x8819 | |
252 | #define GL_RGBA16F_ARB 0x881A | |
253 | #define GL_RGB16F_ARB 0x881B | |
254 | #define GL_ALPHA16F_ARB 0x881C | |
255 | #define GL_INTENSITY16F_ARB 0x881D | |
256 | #define GL_LUMINANCE16F_ARB 0x881E | |
257 | #define GL_LUMINANCE_ALPHA16F_ARB 0x881F | |
258 | #endif | |
259 | ||
260 | #ifndef GL_ARB_half_float_pixel | |
261 | #define GL_ARB_half_float_pixel | |
262 | #define GL_HALF_FLOAT_ARB 0x140B | |
263 | #endif | |
264 | ||
265 | // GL_EXT_framebuffer_object | |
266 | extern GLboolean (APIENTRY * qglIsRenderbufferEXT)(GLuint renderbuffer); | |
267 | extern void (APIENTRY * qglBindRenderbufferEXT)(GLenum target, GLuint renderbuffer); | |
268 | extern void (APIENTRY * qglDeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers); | |
269 | extern void (APIENTRY * qglGenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers); | |
270 | extern void (APIENTRY * qglRenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); | |
271 | extern void (APIENTRY * qglGetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params); | |
272 | extern GLboolean (APIENTRY * qglIsFramebufferEXT)(GLuint framebuffer); | |
273 | extern void (APIENTRY * qglBindFramebufferEXT)(GLenum target, GLuint framebuffer); | |
274 | extern void (APIENTRY * qglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers); | |
275 | extern void (APIENTRY * qglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers); | |
276 | extern GLenum (APIENTRY * qglCheckFramebufferStatusEXT)(GLenum target); | |
277 | extern void (APIENTRY * qglFramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
278 | GLint level); | |
279 | extern void (APIENTRY * qglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
280 | GLint level); | |
281 | extern void (APIENTRY * qglFramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
282 | GLint level, GLint zoffset); | |
283 | extern void (APIENTRY * qglFramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, | |
284 | GLuint renderbuffer); | |
285 | extern void (APIENTRY * qglGetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params); | |
286 | extern void (APIENTRY * qglGenerateMipmapEXT)(GLenum target); | |
287 | ||
288 | #ifndef GL_EXT_framebuffer_object | |
289 | #define GL_EXT_framebuffer_object | |
290 | #define GL_FRAMEBUFFER_EXT 0x8D40 | |
291 | #define GL_RENDERBUFFER_EXT 0x8D41 | |
292 | #define GL_STENCIL_INDEX1_EXT 0x8D46 | |
293 | #define GL_STENCIL_INDEX4_EXT 0x8D47 | |
294 | #define GL_STENCIL_INDEX8_EXT 0x8D48 | |
295 | #define GL_STENCIL_INDEX16_EXT 0x8D49 | |
296 | #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 | |
297 | #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 | |
298 | #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 | |
299 | #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 | |
300 | #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 | |
301 | #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 | |
302 | #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 | |
303 | #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 | |
304 | #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 | |
305 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 | |
306 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 | |
307 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 | |
308 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 | |
309 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 | |
310 | #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 | |
311 | #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 | |
312 | #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 | |
313 | #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 | |
314 | #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 | |
315 | #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 | |
316 | #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 | |
317 | #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 | |
318 | #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 | |
319 | #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 | |
320 | #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA | |
321 | #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB | |
322 | #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC | |
323 | #define GL_COLOR_ATTACHMENT13_EXT 0x8CED | |
324 | #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE | |
325 | #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF | |
326 | #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 | |
327 | #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 | |
328 | #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 | |
329 | #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 | |
330 | #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 | |
331 | #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 | |
332 | #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA | |
333 | #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB | |
334 | #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC | |
335 | #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD | |
336 | #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
337 | #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 | |
338 | #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF | |
339 | #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 | |
340 | #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 | |
341 | #endif | |
342 | ||
343 | // GL_EXT_packed_depth_stencil | |
344 | #ifndef GL_EXT_packed_depth_stencil | |
345 | #define GL_EXT_packed_depth_stencil | |
346 | #define GL_DEPTH_STENCIL_EXT 0x84F9 | |
347 | #define GL_UNSIGNED_INT_24_8_EXT 0x84FA | |
348 | #define GL_DEPTH24_STENCIL8_EXT 0x88F0 | |
349 | #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 | |
350 | #endif | |
351 | ||
352 | // GL_ARB_occlusion_query | |
353 | extern void (APIENTRY * qglGenQueriesARB)(GLsizei n, GLuint *ids); | |
354 | extern void (APIENTRY * qglDeleteQueriesARB)(GLsizei n, const GLuint *ids); | |
355 | extern GLboolean (APIENTRY * qglIsQueryARB)(GLuint id); | |
356 | extern void (APIENTRY * qglBeginQueryARB)(GLenum target, GLuint id); | |
357 | extern void (APIENTRY * qglEndQueryARB)(GLenum target); | |
358 | extern void (APIENTRY * qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params); | |
359 | extern void (APIENTRY * qglGetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params); | |
360 | extern void (APIENTRY * qglGetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params); | |
361 | ||
362 | #ifndef GL_ARB_occlusion_query | |
363 | #define GL_ARB_occlusion_query | |
364 | #define GL_SAMPLES_PASSED_ARB 0x8914 | |
365 | #define GL_QUERY_COUNTER_BITS_ARB 0x8864 | |
366 | #define GL_CURRENT_QUERY_ARB 0x8865 | |
367 | #define GL_QUERY_RESULT_ARB 0x8866 | |
368 | #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 | |
369 | #endif | |
370 | ||
371 | // GL_EXT_framebuffer_blit | |
372 | extern void (APIENTRY * qglBlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | |
373 | GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | |
374 | GLbitfield mask, GLenum filter); | |
375 | ||
376 | #ifndef GL_EXT_framebuffer_blit | |
377 | #define GL_EXT_framebuffer_blit | |
378 | #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 | |
379 | #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 | |
380 | #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
381 | #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA | |
382 | #endif | |
383 | ||
384 | // GL_EXT_framebuffer_multisample | |
385 | extern void (APIENTRY * qglRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, | |
386 | GLenum internalformat, GLsizei width, GLsizei height); | |
387 | ||
388 | #ifndef GL_EXT_framebuffer_multisample | |
389 | #define GL_EXT_framebuffer_multisample | |
390 | #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB | |
391 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 | |
392 | #define GL_MAX_SAMPLES_EXT 0x8D57 | |
393 | #endif | |
394 | ||
395 | #ifndef GL_EXT_texture_sRGB | |
396 | #define GL_EXT_texture_sRGB | |
397 | #define GL_SRGB_EXT 0x8C40 | |
398 | #define GL_SRGB8_EXT 0x8C41 | |
399 | #define GL_SRGB_ALPHA_EXT 0x8C42 | |
400 | #define GL_SRGB8_ALPHA8_EXT 0x8C43 | |
401 | #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 | |
402 | #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 | |
403 | #define GL_SLUMINANCE_EXT 0x8C46 | |
404 | #define GL_SLUMINANCE8_EXT 0x8C47 | |
405 | #define GL_COMPRESSED_SRGB_EXT 0x8C48 | |
406 | #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 | |
407 | #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A | |
408 | #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B | |
409 | #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C | |
410 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D | |
411 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E | |
412 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F | |
413 | #endif | |
414 | ||
415 | #ifndef GL_EXT_framebuffer_sRGB | |
416 | #define GL_EXT_framebuffer_sRGB | |
417 | #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 | |
418 | #endif | |
419 | ||
420 | #ifndef GL_EXT_texture_compression_latc | |
421 | #define GL_EXT_texture_compression_latc | |
422 | #define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 | |
423 | #define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 | |
424 | #define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 | |
425 | #define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 | |
426 | #endif | |
427 | ||
428 | #ifndef GL_ARB_texture_compression_bptc | |
429 | #define GL_ARB_texture_compression_bptc | |
430 | #define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C | |
431 | #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D | |
432 | #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E | |
433 | #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F | |
434 | #endif | |
435 | ||
436 | // GL_ARB_draw_buffers | |
437 | extern void (APIENTRY * qglDrawBuffersARB)(GLsizei n, const GLenum *bufs); | |
438 | #ifndef GL_ARB_draw_buffers | |
439 | #define GL_ARB_draw_buffers | |
440 | #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 | |
441 | #define GL_DRAW_BUFFER0_ARB 0x8825 | |
442 | #define GL_DRAW_BUFFER1_ARB 0x8826 | |
443 | #define GL_DRAW_BUFFER2_ARB 0x8827 | |
444 | #define GL_DRAW_BUFFER3_ARB 0x8828 | |
445 | #define GL_DRAW_BUFFER4_ARB 0x8829 | |
446 | #define GL_DRAW_BUFFER5_ARB 0x882A | |
447 | #define GL_DRAW_BUFFER6_ARB 0x882B | |
448 | #define GL_DRAW_BUFFER7_ARB 0x882C | |
449 | #define GL_DRAW_BUFFER8_ARB 0x882D | |
450 | #define GL_DRAW_BUFFER9_ARB 0x882E | |
451 | #define GL_DRAW_BUFFER10_ARB 0x882F | |
452 | #define GL_DRAW_BUFFER11_ARB 0x8830 | |
453 | #define GL_DRAW_BUFFER12_ARB 0x8831 | |
454 | #define GL_DRAW_BUFFER13_ARB 0x8832 | |
455 | #define GL_DRAW_BUFFER14_ARB 0x8833 | |
456 | #define GL_DRAW_BUFFER15_ARB 0x8834 | |
457 | #endif | |
458 | ||
459 | #ifndef GL_ARB_depth_clamp | |
460 | #define GL_ARB_depth_clamp | |
461 | #define GL_DEPTH_CLAMP 0x864F | |
462 | #endif | |
463 | ||
464 | #ifndef GL_ARB_seamless_cube_map | |
465 | #define GL_ARB_seamless_cube_map | |
466 | #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F | |
467 | #endif | |
468 | ||
469 | // GL_ARB_vertex_array_object | |
470 | extern void (APIENTRY * qglBindVertexArrayARB)(GLuint array); | |
471 | extern void (APIENTRY * qglDeleteVertexArraysARB)(GLsizei n, const GLuint *arrays); | |
472 | extern void (APIENTRY * qglGenVertexArraysARB)(GLsizei n, GLuint *arrays); | |
473 | extern GLboolean (APIENTRY * qglIsVertexArrayARB)(GLuint array); | |
474 | #ifndef GL_ARB_vertex_array_object | |
475 | #define GL_ARB_vertex_array_object | |
476 | #define GL_VERTEX_ARRAY_BINDING_ARB 0x85B5 | |
477 | #endif | |
478 | ||
479 | #if defined(WIN32) | |
480 | // WGL_ARB_create_context | |
481 | #ifndef WGL_ARB_create_context | |
482 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
483 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
484 | #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 | |
485 | #define WGL_CONTEXT_FLAGS_ARB 0x2094 | |
486 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 | |
487 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 | |
488 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 | |
489 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 | |
490 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 | |
491 | #define ERROR_INVALID_VERSION_ARB 0x2095 | |
492 | #define ERROR_INVALID_PROFILE_ARB 0x2096 | |
493 | #endif | |
494 | ||
495 | extern HGLRC(APIENTRY * qwglCreateContextAttribsARB) (HDC hdC, HGLRC hShareContext, const int *attribList); | |
496 | #endif | |
497 | ||
498 | #if 0 //defined(__linux__) | |
499 | // GLX_ARB_create_context | |
500 | #ifndef GLX_ARB_create_context | |
501 | #define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 | |
502 | #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 | |
503 | #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
504 | #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
505 | #define GLX_CONTEXT_FLAGS_ARB 0x2094 | |
506 | #endif | |
507 | ||
508 | extern GLXContext (APIENTRY * qglXCreateContextAttribsARB) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); | |
509 | #endif | |
510 | ||
511 | 118 | //=========================================================================== |
512 | 119 | |
513 | 120 | #define qglAccum glAccum |
845 | 452 | #define qglVertexPointer glVertexPointer |
846 | 453 | #define qglViewport glViewport |
847 | 454 | |
848 | #endif | |
455 | // GL_EXT_draw_range_elements | |
456 | extern void (APIENTRY * qglDrawRangeElementsEXT) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); | |
457 | ||
458 | // GL_EXT_multi_draw_arrays | |
459 | extern void (APIENTRY * qglMultiDrawArraysEXT) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); | |
460 | extern void (APIENTRY * qglMultiDrawElementsEXT) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); | |
461 | ||
462 | // rend2 | |
463 | ||
464 | // GL_ARB_shading_language_100 | |
465 | #ifndef GL_ARB_shading_language_100 | |
466 | #define GL_ARB_shading_language_100 | |
467 | #define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C | |
468 | #endif | |
469 | ||
470 | // GL_ARB_vertex_program | |
471 | extern void (APIENTRY * qglVertexAttrib4fARB) (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); | |
472 | extern void (APIENTRY * qglVertexAttrib4fvARB) (GLuint, const GLfloat *); | |
473 | extern void (APIENTRY * qglVertexAttribPointerARB) (GLuint index, GLint size, GLenum type, GLboolean normalized, | |
474 | GLsizei stride, const GLvoid * pointer); | |
475 | extern void (APIENTRY * qglEnableVertexAttribArrayARB) (GLuint index); | |
476 | extern void (APIENTRY * qglDisableVertexAttribArrayARB) (GLuint index); | |
477 | ||
478 | // GL_ARB_vertex_buffer_object | |
479 | extern void (APIENTRY * qglBindBufferARB) (GLenum target, GLuint buffer); | |
480 | extern void (APIENTRY * qglDeleteBuffersARB) (GLsizei n, const GLuint * buffers); | |
481 | extern void (APIENTRY * qglGenBuffersARB) (GLsizei n, GLuint * buffers); | |
482 | extern GLboolean(APIENTRY * qglIsBufferARB) (GLuint buffer); | |
483 | extern void (APIENTRY * qglBufferDataARB) (GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); | |
484 | extern void (APIENTRY * qglBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); | |
485 | extern void (APIENTRY * qglGetBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); | |
486 | extern void (APIENTRY * qglGetBufferParameterivARB) (GLenum target, GLenum pname, GLint * params); | |
487 | extern void (APIENTRY * qglGetBufferPointervARB) (GLenum target, GLenum pname, GLvoid * *params); | |
488 | ||
489 | // GL_ARB_shader_objects | |
490 | extern void (APIENTRY * qglDeleteObjectARB) (GLhandleARB obj); | |
491 | extern GLhandleARB(APIENTRY * qglGetHandleARB) (GLenum pname); | |
492 | extern void (APIENTRY * qglDetachObjectARB) (GLhandleARB containerObj, GLhandleARB attachedObj); | |
493 | extern GLhandleARB(APIENTRY * qglCreateShaderObjectARB) (GLenum shaderType); | |
494 | extern void (APIENTRY * qglShaderSourceARB) (GLhandleARB shaderObj, GLsizei count, const GLcharARB * *string, | |
495 | const GLint * length); | |
496 | extern void (APIENTRY * qglCompileShaderARB) (GLhandleARB shaderObj); | |
497 | extern GLhandleARB(APIENTRY * qglCreateProgramObjectARB) (void); | |
498 | extern void (APIENTRY * qglAttachObjectARB) (GLhandleARB containerObj, GLhandleARB obj); | |
499 | extern void (APIENTRY * qglLinkProgramARB) (GLhandleARB programObj); | |
500 | extern void (APIENTRY * qglUseProgramObjectARB) (GLhandleARB programObj); | |
501 | extern void (APIENTRY * qglValidateProgramARB) (GLhandleARB programObj); | |
502 | extern void (APIENTRY * qglUniform1fARB) (GLint location, GLfloat v0); | |
503 | extern void (APIENTRY * qglUniform2fARB) (GLint location, GLfloat v0, GLfloat v1); | |
504 | extern void (APIENTRY * qglUniform3fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); | |
505 | extern void (APIENTRY * qglUniform4fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); | |
506 | extern void (APIENTRY * qglUniform1iARB) (GLint location, GLint v0); | |
507 | extern void (APIENTRY * qglUniform2iARB) (GLint location, GLint v0, GLint v1); | |
508 | extern void (APIENTRY * qglUniform3iARB) (GLint location, GLint v0, GLint v1, GLint v2); | |
509 | extern void (APIENTRY * qglUniform4iARB) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); | |
510 | extern void (APIENTRY * qglUniform1fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
511 | extern void (APIENTRY * qglUniform2fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
512 | extern void (APIENTRY * qglUniform3fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
513 | extern void (APIENTRY * qglUniform4fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
514 | extern void (APIENTRY * qglUniform2ivARB) (GLint location, GLsizei count, const GLint * value); | |
515 | extern void (APIENTRY * qglUniform3ivARB) (GLint location, GLsizei count, const GLint * value); | |
516 | extern void (APIENTRY * qglUniform4ivARB) (GLint location, GLsizei count, const GLint * value); | |
517 | extern void (APIENTRY * qglUniformMatrix2fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
518 | extern void (APIENTRY * qglUniformMatrix3fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
519 | extern void (APIENTRY * qglUniformMatrix4fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
520 | extern void (APIENTRY * qglGetObjectParameterfvARB) (GLhandleARB obj, GLenum pname, GLfloat * params); | |
521 | extern void (APIENTRY * qglGetObjectParameterivARB) (GLhandleARB obj, GLenum pname, GLint * params); | |
522 | extern void (APIENTRY * qglGetInfoLogARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); | |
523 | extern void (APIENTRY * qglGetAttachedObjectsARB) (GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, | |
524 | GLhandleARB * obj); | |
525 | extern GLint(APIENTRY * qglGetUniformLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
526 | extern void (APIENTRY * qglGetActiveUniformARB) (GLhandleARB programObj, GLuint index, GLsizei maxIndex, GLsizei * length, | |
527 | GLint * size, GLenum * type, GLcharARB * name); | |
528 | extern void (APIENTRY * qglGetUniformfvARB) (GLhandleARB programObj, GLint location, GLfloat * params); | |
529 | extern void (APIENTRY * qglGetUniformivARB) (GLhandleARB programObj, GLint location, GLint * params); | |
530 | extern void (APIENTRY * qglGetShaderSourceARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); | |
531 | ||
532 | // GL_ARB_vertex_shader | |
533 | extern void (APIENTRY * qglBindAttribLocationARB) (GLhandleARB programObj, GLuint index, const GLcharARB * name); | |
534 | extern void (APIENTRY * qglGetActiveAttribARB) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, | |
535 | GLint * size, GLenum * type, GLcharARB * name); | |
536 | extern GLint(APIENTRY * qglGetAttribLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
537 | ||
538 | // GL_ARB_texture_compression | |
539 | extern void (APIENTRY * qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
540 | GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); | |
541 | extern void (APIENTRY * qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
542 | GLint border, GLsizei imageSize, const GLvoid *data); | |
543 | extern void (APIENTRY * qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, | |
544 | GLsizei imageSize, const GLvoid *data); | |
545 | extern void (APIENTRY * qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | |
546 | GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); | |
547 | extern void (APIENTRY * qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, | |
548 | GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); | |
549 | extern void (APIENTRY * qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, | |
550 | GLsizei imageSize, const GLvoid *data); | |
551 | extern void (APIENTRY * qglGetCompressedTexImageARB)(GLenum target, GLint lod, | |
552 | GLvoid *img); | |
553 | ||
554 | // GL_NVX_gpu_memory_info | |
555 | #ifndef GL_NVX_gpu_memory_info | |
556 | #define GL_NVX_gpu_memory_info | |
557 | #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 | |
558 | #define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 | |
559 | #define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 | |
560 | #define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A | |
561 | #define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B | |
562 | #endif | |
563 | ||
564 | // GL_ATI_meminfo | |
565 | #ifndef GL_ATI_meminfo | |
566 | #define GL_ATI_meminfo | |
567 | #define GL_VBO_FREE_MEMORY_ATI 0x87FB | |
568 | #define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC | |
569 | #define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD | |
570 | #endif | |
571 | ||
572 | // GL_ARB_texture_float | |
573 | #ifndef GL_ARB_texture_float | |
574 | #define GL_ARB_texture_float | |
575 | #define GL_TEXTURE_RED_TYPE_ARB 0x8C10 | |
576 | #define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 | |
577 | #define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 | |
578 | #define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 | |
579 | #define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 | |
580 | #define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 | |
581 | #define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 | |
582 | #define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 | |
583 | #define GL_RGBA32F_ARB 0x8814 | |
584 | #define GL_RGB32F_ARB 0x8815 | |
585 | #define GL_ALPHA32F_ARB 0x8816 | |
586 | #define GL_INTENSITY32F_ARB 0x8817 | |
587 | #define GL_LUMINANCE32F_ARB 0x8818 | |
588 | #define GL_LUMINANCE_ALPHA32F_ARB 0x8819 | |
589 | #define GL_RGBA16F_ARB 0x881A | |
590 | #define GL_RGB16F_ARB 0x881B | |
591 | #define GL_ALPHA16F_ARB 0x881C | |
592 | #define GL_INTENSITY16F_ARB 0x881D | |
593 | #define GL_LUMINANCE16F_ARB 0x881E | |
594 | #define GL_LUMINANCE_ALPHA16F_ARB 0x881F | |
595 | #endif | |
596 | ||
597 | #ifndef GL_ARB_half_float_pixel | |
598 | #define GL_ARB_half_float_pixel | |
599 | #define GL_HALF_FLOAT_ARB 0x140B | |
600 | #endif | |
601 | ||
602 | // GL_EXT_framebuffer_object | |
603 | extern GLboolean (APIENTRY * qglIsRenderbufferEXT)(GLuint renderbuffer); | |
604 | extern void (APIENTRY * qglBindRenderbufferEXT)(GLenum target, GLuint renderbuffer); | |
605 | extern void (APIENTRY * qglDeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers); | |
606 | extern void (APIENTRY * qglGenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers); | |
607 | extern void (APIENTRY * qglRenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); | |
608 | extern void (APIENTRY * qglGetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params); | |
609 | extern GLboolean (APIENTRY * qglIsFramebufferEXT)(GLuint framebuffer); | |
610 | extern void (APIENTRY * qglBindFramebufferEXT)(GLenum target, GLuint framebuffer); | |
611 | extern void (APIENTRY * qglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers); | |
612 | extern void (APIENTRY * qglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers); | |
613 | extern GLenum (APIENTRY * qglCheckFramebufferStatusEXT)(GLenum target); | |
614 | extern void (APIENTRY * qglFramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
615 | GLint level); | |
616 | extern void (APIENTRY * qglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
617 | GLint level); | |
618 | extern void (APIENTRY * qglFramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
619 | GLint level, GLint zoffset); | |
620 | extern void (APIENTRY * qglFramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, | |
621 | GLuint renderbuffer); | |
622 | extern void (APIENTRY * qglGetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params); | |
623 | extern void (APIENTRY * qglGenerateMipmapEXT)(GLenum target); | |
624 | ||
625 | #ifndef GL_EXT_framebuffer_object | |
626 | #define GL_EXT_framebuffer_object | |
627 | #define GL_FRAMEBUFFER_EXT 0x8D40 | |
628 | #define GL_RENDERBUFFER_EXT 0x8D41 | |
629 | #define GL_STENCIL_INDEX1_EXT 0x8D46 | |
630 | #define GL_STENCIL_INDEX4_EXT 0x8D47 | |
631 | #define GL_STENCIL_INDEX8_EXT 0x8D48 | |
632 | #define GL_STENCIL_INDEX16_EXT 0x8D49 | |
633 | #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 | |
634 | #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 | |
635 | #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 | |
636 | #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 | |
637 | #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 | |
638 | #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 | |
639 | #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 | |
640 | #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 | |
641 | #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 | |
642 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 | |
643 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 | |
644 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 | |
645 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 | |
646 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 | |
647 | #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 | |
648 | #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 | |
649 | #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 | |
650 | #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 | |
651 | #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 | |
652 | #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 | |
653 | #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 | |
654 | #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 | |
655 | #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 | |
656 | #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 | |
657 | #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA | |
658 | #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB | |
659 | #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC | |
660 | #define GL_COLOR_ATTACHMENT13_EXT 0x8CED | |
661 | #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE | |
662 | #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF | |
663 | #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 | |
664 | #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 | |
665 | #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 | |
666 | #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 | |
667 | #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 | |
668 | #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 | |
669 | #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA | |
670 | #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB | |
671 | #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC | |
672 | #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD | |
673 | #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
674 | #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 | |
675 | #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF | |
676 | #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 | |
677 | #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 | |
678 | #endif | |
679 | ||
680 | // GL_EXT_packed_depth_stencil | |
681 | #ifndef GL_EXT_packed_depth_stencil | |
682 | #define GL_EXT_packed_depth_stencil | |
683 | #define GL_DEPTH_STENCIL_EXT 0x84F9 | |
684 | #define GL_UNSIGNED_INT_24_8_EXT 0x84FA | |
685 | #define GL_DEPTH24_STENCIL8_EXT 0x88F0 | |
686 | #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 | |
687 | #endif | |
688 | ||
689 | // GL_ARB_occlusion_query | |
690 | extern void (APIENTRY * qglGenQueriesARB)(GLsizei n, GLuint *ids); | |
691 | extern void (APIENTRY * qglDeleteQueriesARB)(GLsizei n, const GLuint *ids); | |
692 | extern GLboolean (APIENTRY * qglIsQueryARB)(GLuint id); | |
693 | extern void (APIENTRY * qglBeginQueryARB)(GLenum target, GLuint id); | |
694 | extern void (APIENTRY * qglEndQueryARB)(GLenum target); | |
695 | extern void (APIENTRY * qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params); | |
696 | extern void (APIENTRY * qglGetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params); | |
697 | extern void (APIENTRY * qglGetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params); | |
698 | ||
699 | #ifndef GL_ARB_occlusion_query | |
700 | #define GL_ARB_occlusion_query | |
701 | #define GL_SAMPLES_PASSED_ARB 0x8914 | |
702 | #define GL_QUERY_COUNTER_BITS_ARB 0x8864 | |
703 | #define GL_CURRENT_QUERY_ARB 0x8865 | |
704 | #define GL_QUERY_RESULT_ARB 0x8866 | |
705 | #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 | |
706 | #endif | |
707 | ||
708 | // GL_EXT_framebuffer_blit | |
709 | extern void (APIENTRY * qglBlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | |
710 | GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | |
711 | GLbitfield mask, GLenum filter); | |
712 | ||
713 | #ifndef GL_EXT_framebuffer_blit | |
714 | #define GL_EXT_framebuffer_blit | |
715 | #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 | |
716 | #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 | |
717 | #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
718 | #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA | |
719 | #endif | |
720 | ||
721 | // GL_EXT_framebuffer_multisample | |
722 | extern void (APIENTRY * qglRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, | |
723 | GLenum internalformat, GLsizei width, GLsizei height); | |
724 | ||
725 | #ifndef GL_EXT_framebuffer_multisample | |
726 | #define GL_EXT_framebuffer_multisample | |
727 | #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB | |
728 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 | |
729 | #define GL_MAX_SAMPLES_EXT 0x8D57 | |
730 | #endif | |
731 | ||
732 | #ifndef GL_EXT_texture_sRGB | |
733 | #define GL_EXT_texture_sRGB | |
734 | #define GL_SRGB_EXT 0x8C40 | |
735 | #define GL_SRGB8_EXT 0x8C41 | |
736 | #define GL_SRGB_ALPHA_EXT 0x8C42 | |
737 | #define GL_SRGB8_ALPHA8_EXT 0x8C43 | |
738 | #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 | |
739 | #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 | |
740 | #define GL_SLUMINANCE_EXT 0x8C46 | |
741 | #define GL_SLUMINANCE8_EXT 0x8C47 | |
742 | #define GL_COMPRESSED_SRGB_EXT 0x8C48 | |
743 | #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 | |
744 | #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A | |
745 | #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B | |
746 | #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C | |
747 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D | |
748 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E | |
749 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F | |
750 | #endif | |
751 | ||
752 | #ifndef GL_EXT_framebuffer_sRGB | |
753 | #define GL_EXT_framebuffer_sRGB | |
754 | #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 | |
755 | #endif | |
756 | ||
757 | #ifndef GL_EXT_texture_compression_latc | |
758 | #define GL_EXT_texture_compression_latc | |
759 | #define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 | |
760 | #define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 | |
761 | #define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 | |
762 | #define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 | |
763 | #endif | |
764 | ||
765 | #ifndef GL_ARB_texture_compression_bptc | |
766 | #define GL_ARB_texture_compression_bptc | |
767 | #define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C | |
768 | #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D | |
769 | #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E | |
770 | #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F | |
771 | #endif | |
772 | ||
773 | // GL_ARB_draw_buffers | |
774 | extern void (APIENTRY * qglDrawBuffersARB)(GLsizei n, const GLenum *bufs); | |
775 | #ifndef GL_ARB_draw_buffers | |
776 | #define GL_ARB_draw_buffers | |
777 | #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 | |
778 | #define GL_DRAW_BUFFER0_ARB 0x8825 | |
779 | #define GL_DRAW_BUFFER1_ARB 0x8826 | |
780 | #define GL_DRAW_BUFFER2_ARB 0x8827 | |
781 | #define GL_DRAW_BUFFER3_ARB 0x8828 | |
782 | #define GL_DRAW_BUFFER4_ARB 0x8829 | |
783 | #define GL_DRAW_BUFFER5_ARB 0x882A | |
784 | #define GL_DRAW_BUFFER6_ARB 0x882B | |
785 | #define GL_DRAW_BUFFER7_ARB 0x882C | |
786 | #define GL_DRAW_BUFFER8_ARB 0x882D | |
787 | #define GL_DRAW_BUFFER9_ARB 0x882E | |
788 | #define GL_DRAW_BUFFER10_ARB 0x882F | |
789 | #define GL_DRAW_BUFFER11_ARB 0x8830 | |
790 | #define GL_DRAW_BUFFER12_ARB 0x8831 | |
791 | #define GL_DRAW_BUFFER13_ARB 0x8832 | |
792 | #define GL_DRAW_BUFFER14_ARB 0x8833 | |
793 | #define GL_DRAW_BUFFER15_ARB 0x8834 | |
794 | #endif | |
795 | ||
796 | #ifndef GL_ARB_depth_clamp | |
797 | #define GL_ARB_depth_clamp | |
798 | #define GL_DEPTH_CLAMP 0x864F | |
799 | #endif | |
800 | ||
801 | #ifndef GL_ARB_seamless_cube_map | |
802 | #define GL_ARB_seamless_cube_map | |
803 | #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F | |
804 | #endif | |
805 | ||
806 | // GL_ARB_vertex_array_object | |
807 | extern void (APIENTRY * qglBindVertexArrayARB)(GLuint array); | |
808 | extern void (APIENTRY * qglDeleteVertexArraysARB)(GLsizei n, const GLuint *arrays); | |
809 | extern void (APIENTRY * qglGenVertexArraysARB)(GLsizei n, GLuint *arrays); | |
810 | extern GLboolean (APIENTRY * qglIsVertexArrayARB)(GLuint array); | |
811 | #ifndef GL_ARB_vertex_array_object | |
812 | #define GL_ARB_vertex_array_object | |
813 | #define GL_VERTEX_ARRAY_BINDING_ARB 0x85B5 | |
814 | #endif | |
815 | ||
816 | #if defined(WIN32) | |
817 | // WGL_ARB_create_context | |
818 | #ifndef WGL_ARB_create_context | |
819 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
820 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
821 | #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 | |
822 | #define WGL_CONTEXT_FLAGS_ARB 0x2094 | |
823 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 | |
824 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 | |
825 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 | |
826 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 | |
827 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 | |
828 | #define ERROR_INVALID_VERSION_ARB 0x2095 | |
829 | #define ERROR_INVALID_PROFILE_ARB 0x2096 | |
830 | #endif | |
831 | ||
832 | extern HGLRC(APIENTRY * qwglCreateContextAttribsARB) (HDC hdC, HGLRC hShareContext, const int *attribList); | |
833 | #endif | |
834 | ||
835 | #if 0 //defined(__linux__) | |
836 | // GLX_ARB_create_context | |
837 | #ifndef GLX_ARB_create_context | |
838 | #define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 | |
839 | #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 | |
840 | #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
841 | #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
842 | #define GLX_CONTEXT_FLAGS_ARB 0x2094 | |
843 | #endif | |
844 | ||
845 | extern GLXContext (APIENTRY * qglXCreateContextAttribsARB) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); | |
846 | #endif | |
847 | ||
848 | #endif // __QGL_H__ | |
849 |
1092 | 1092 | render_count = surface->numVerts; |
1093 | 1093 | } |
1094 | 1094 | |
1095 | RB_CheckOverflow( render_count, surface->numTriangles ); | |
1096 | ||
1097 | 1095 | //DBG_SHOWTIME |
1098 | 1096 | |
1099 | 1097 | // |
1100 | 1098 | // setup triangle list |
1101 | 1099 | // |
1102 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1100 | RB_CHECKOVERFLOW( render_count, surface->numTriangles * 3 ); | |
1103 | 1101 | |
1104 | 1102 | //DBG_SHOWTIME |
1105 | 1103 | |
1689 | 1687 | oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + |
1690 | 1688 | backEnd.currentEntity->e.oldframe * frameSize ); |
1691 | 1689 | |
1692 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1690 | RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); | |
1693 | 1691 | |
1694 | 1692 | triangles = (int *) ((byte *)surface + surface->ofsTriangles); |
1695 | 1693 | indexes = surface->numTriangles * 3; |
224 | 224 | |
225 | 225 | f32.f = in; |
226 | 226 | |
227 | f16.pack.exponent = CLAMP(f32.pack.exponent - 112, 0, 31); | |
227 | f16.pack.exponent = CLAMP((int)(f32.pack.exponent) - 112, 0, 31); | |
228 | 228 | f16.pack.fraction = f32.pack.fraction >> 13; |
229 | 229 | f16.pack.sign = f32.pack.sign; |
230 | 230 |
46 | 46 | // an error occured |
47 | 47 | switch (code) |
48 | 48 | { |
49 | case GL_FRAMEBUFFER_COMPLETE_EXT: | |
50 | break; | |
51 | ||
52 | 49 | case GL_FRAMEBUFFER_UNSUPPORTED_EXT: |
53 | 50 | ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Unsupported framebuffer format\n", fbo->name); |
54 | 51 | break; |
99 | 99 | |
100 | 100 | #ifdef BUILD_FREETYPE |
101 | 101 | void R_GetGlyphInfo( FT_GlyphSlot glyph, int *left, int *right, int *width, int *top, int *bottom, int *height, int *pitch ) { |
102 | ||
103 | 102 | *left = _FLOOR( glyph->metrics.horiBearingX ); |
104 | 103 | *right = _CEIL( glyph->metrics.horiBearingX + glyph->metrics.width ); |
105 | 104 | *width = _TRUNC( *right - *left ); |
112 | 111 | |
113 | 112 | |
114 | 113 | FT_Bitmap *R_RenderGlyph( FT_GlyphSlot glyph, glyphInfo_t* glyphOut ) { |
115 | ||
116 | 114 | FT_Bitmap *bit2; |
117 | 115 | int left, right, width, top, bottom, height, pitch, size; |
118 | 116 | |
167 | 165 | |
168 | 166 | // swap rgb to bgr |
169 | 167 | c = 18 + width * height * 4; |
170 | for (i=18 ; i<c ; i+=4) | |
168 | for ( i = 18 ; i < c ; i += 4 ) | |
171 | 169 | { |
172 | buffer[i] = data[i-18+2]; // blue | |
173 | buffer[i+1] = data[i-18+1]; // green | |
174 | buffer[i+2] = data[i-18+0]; // red | |
175 | buffer[i+3] = data[i-18+3]; // alpha | |
170 | buffer[i] = data[i - 18 + 2]; // blue | |
171 | buffer[i + 1] = data[i - 18 + 1]; // green | |
172 | buffer[i + 2] = data[i - 18 + 0]; // red | |
173 | buffer[i + 3] = data[i - 18 + 3]; // alpha | |
176 | 174 | } |
177 | 175 | |
178 | 176 | // flip upside down |
194 | 192 | //fwrite (buffer, 1, c, f); |
195 | 193 | //fclose (f); |
196 | 194 | |
197 | ri.Free (buffer); | |
195 | ri.Free( buffer ); | |
198 | 196 | } |
199 | 197 | |
200 | 198 | static glyphInfo_t *RE_ConstructGlyphInfo( unsigned char *imageOut, int *xOut, int *yOut, int *maxHeight, FT_Face face, const unsigned char c, qboolean calcHeight ) { |
246 | 244 | if (*yOut + *maxHeight + 1 >= 255) { |
247 | 245 | *yOut = -1; |
248 | 246 | *xOut = -1; |
249 | ri.Free(bitmap->buffer); | |
250 | ri.Free(bitmap); | |
247 | ri.Free( bitmap->buffer ); | |
248 | ri.Free( bitmap ); | |
251 | 249 | return &glyph; |
252 | 250 | } |
253 | 251 | |
278 | 276 | |
279 | 277 | src += glyph.pitch; |
280 | 278 | dst += 256; |
281 | ||
282 | 279 | } |
283 | 280 | } else { |
284 | 281 | for ( i = 0; i < glyph.height; i++ ) { |
285 | memcpy( dst, src, glyph.pitch ); | |
282 | Com_Memcpy( dst, src, glyph.pitch ); | |
286 | 283 | src += glyph.pitch; |
287 | 284 | dst += 256; |
288 | 285 | } |
309 | 306 | #endif |
310 | 307 | |
311 | 308 | static int fdOffset; |
312 | static byte *fdFile; | |
309 | static byte *fdFile; | |
313 | 310 | |
314 | 311 | int readInt( void ) { |
315 | 312 | int i = fdFile[fdOffset] + ( fdFile[fdOffset + 1] << 8 ) + ( fdFile[fdOffset + 2] << 16 ) + ( fdFile[fdOffset + 3] << 24 ); |
318 | 315 | } |
319 | 316 | |
320 | 317 | typedef union { |
321 | byte fred[4]; | |
322 | float ffred; | |
318 | byte fred[4]; | |
319 | float ffred; | |
323 | 320 | } poor; |
324 | 321 | |
325 | 322 | float readFloat( void ) { |
375 | 372 | Com_sprintf( name, sizeof( name ), "fonts/fontImage_%i.dat",pointSize ); |
376 | 373 | for ( i = 0; i < registeredFontCount; i++ ) { |
377 | 374 | if ( Q_stricmp( name, registeredFont[i].name ) == 0 ) { |
378 | memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
375 | Com_Memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
379 | 376 | return; |
380 | 377 | } |
381 | 378 | } |
402 | 399 | fdOffset += sizeof(font->glyphs[i].shaderName); |
403 | 400 | } |
404 | 401 | font->glyphScale = readFloat(); |
405 | memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
406 | ||
407 | // memcpy(font, faceData, sizeof(fontInfo_t)); | |
402 | Com_Memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
403 | ||
404 | // Com_Memcpy(font, faceData, sizeof(fontInfo_t)); | |
408 | 405 | Q_strncpyz( font->name, name, sizeof( font->name ) ); |
409 | 406 | for ( i = GLYPH_START; i <= GLYPH_END; i++ ) { |
410 | 407 | font->glyphs[i].glyph = RE_RegisterShaderNoMip( font->glyphs[i].shaderName ); |
411 | 408 | } |
412 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
409 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
413 | 410 | ri.FS_FreeFile(faceData); |
414 | 411 | return; |
415 | 412 | } |
507 | 504 | } |
508 | 505 | |
509 | 506 | //Com_sprintf (name, sizeof(name), "fonts/fontImage_%i_%i", imageNumber++, pointSize); |
510 | image = R_CreateImage(name, imageBuff, 256, 256, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 ); | |
507 | image = R_CreateImage( name, imageBuff, 256, 256, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 ); | |
511 | 508 | h = RE_RegisterShaderFromImage( name, LIGHTMAP_2D, image, qfalse ); |
512 | 509 | for ( j = lastStart; j < i; j++ ) { |
513 | 510 | font->glyphs[j].glyph = h; |
521 | 518 | if ( i == GLYPH_END + 1 ) |
522 | 519 | i++; |
523 | 520 | } else { |
524 | memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
521 | Com_Memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
525 | 522 | i++; |
526 | 523 | } |
527 | 524 | } |
534 | 531 | |
535 | 532 | registeredFont[registeredFontCount].glyphScale = glyphScale; |
536 | 533 | font->glyphScale = glyphScale; |
537 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
534 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
538 | 535 | |
539 | 536 | if ( r_saveFontData->integer ) { |
540 | 537 | ri.FS_WriteFile( va( "fonts/fontImage_%i.dat", pointSize ), font, sizeof( fontInfo_t ) ); |
548 | 545 | |
549 | 546 | |
550 | 547 | |
551 | void R_InitFreeType(void) { | |
548 | void R_InitFreeType( void ) { | |
552 | 549 | #ifdef BUILD_FREETYPE |
553 | 550 | if ( FT_Init_FreeType( &ftLibrary ) ) { |
554 | 551 | ri.Printf(PRINT_WARNING, "R_InitFreeType: Unable to initialize FreeType.\n"); |
558 | 555 | } |
559 | 556 | |
560 | 557 | |
561 | void R_DoneFreeType(void) { | |
558 | void R_DoneFreeType( void ) { | |
562 | 559 | #ifdef BUILD_FREETYPE |
563 | 560 | if ( ftLibrary ) { |
564 | 561 | FT_Done_FreeType( ftLibrary ); |
145 | 145 | { "u_PrimaryLightRadius", GLSL_FLOAT }, |
146 | 146 | |
147 | 147 | { "u_CubeMapInfo", GLSL_VEC4 }, |
148 | ||
149 | { "u_FireRiseDir", GLSL_VEC3 }, | |
150 | { "u_ZFadeLowest", GLSL_FLOAT }, | |
151 | { "u_ZFadeHighest", GLSL_FLOAT }, | |
148 | 152 | }; |
149 | 153 | |
150 | 154 | |
301 | 305 | "#define alphaGen_t\n" |
302 | 306 | "#define AGEN_LIGHTING_SPECULAR %i\n" |
303 | 307 | "#define AGEN_PORTAL %i\n" |
308 | "#define AGEN_NORMALZFADE %i\n" | |
304 | 309 | "#endif\n", |
305 | 310 | AGEN_LIGHTING_SPECULAR, |
306 | AGEN_PORTAL)); | |
311 | AGEN_PORTAL, | |
312 | AGEN_NORMALZFADE)); | |
307 | 313 | |
308 | 314 | Q_strcat(dest, size, |
309 | 315 | va("#ifndef texenv_t\n" |
1527 | 1533 | { |
1528 | 1534 | case AGEN_LIGHTING_SPECULAR: |
1529 | 1535 | case AGEN_PORTAL: |
1536 | case AGEN_NORMALZFADE: | |
1530 | 1537 | shaderAttribs |= GENERICDEF_USE_RGBAGEN; |
1531 | 1538 | break; |
1532 | 1539 | default: |
2887 | 2887 | { |
2888 | 2888 | for( x = 0; x < MAX_DLIGHTS; x++) |
2889 | 2889 | { |
2890 | tr.shadowCubemaps[x] = R_CreateImage(va("*shadowcubemap%i", x), (byte *)data, DEFAULT_SIZE, DEFAULT_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE | IMGFLAG_CUBEMAP, 0); | |
2890 | tr.shadowCubemaps[x] = R_CreateImage(va("*shadowcubemap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE | IMGFLAG_CUBEMAP, 0); | |
2891 | 2891 | } |
2892 | 2892 | } |
2893 | 2893 | |
3382 | 3382 | skin->numSurfaces = 0; |
3383 | 3383 | skin->numModels = 0; //----(SA) added |
3384 | 3384 | skin->numSurfaces = 1; |
3385 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( skin->surfaces[0] ), h_low ); | |
3385 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
3386 | 3386 | skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue ); |
3387 | 3387 | return hSkin; |
3388 | 3388 | } |
3495 | 3495 | skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low ); |
3496 | 3496 | Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) ); |
3497 | 3497 | skin->numSurfaces = 1; |
3498 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces ), h_low ); | |
3498 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
3499 | 3499 | skin->surfaces[0]->shader = tr.defaultShader; |
3500 | 3500 | } |
3501 | 3501 |
170 | 170 | frac[i] = v - pos[i]; |
171 | 171 | if ( pos[i] < 0 ) { |
172 | 172 | pos[i] = 0; |
173 | } else if ( pos[i] >= world->lightGridBounds[i] - 1 ) { | |
173 | } else if ( pos[i] > world->lightGridBounds[i] - 1 ) { | |
174 | 174 | pos[i] = world->lightGridBounds[i] - 1; |
175 | 175 | } |
176 | 176 | } |
194 | 194 | byte *data; |
195 | 195 | int lat, lng; |
196 | 196 | vec3_t normal; |
197 | qboolean ignore; | |
198 | 197 | factor = 1.0; |
199 | 198 | data = gridData; |
200 | ignore = qfalse; | |
201 | 199 | for ( j = 0 ; j < 3 ; j++ ) { |
202 | 200 | if ( i & ( 1 << j ) ) { |
203 | if ((pos[j] + 1) >= world->lightGridBounds[j] - 1) | |
204 | { | |
205 | ignore = qtrue; // ignore values outside lightgrid | |
201 | if ( pos[j] + 1 > world->lightGridBounds[j] - 1 ) { | |
202 | break; // ignore values outside lightgrid | |
206 | 203 | } |
207 | 204 | factor *= frac[j]; |
208 | 205 | data += gridStep[j]; |
211 | 208 | } |
212 | 209 | } |
213 | 210 | |
214 | if ( ignore ) | |
211 | if ( j != 3 ) | |
215 | 212 | continue; |
216 | 213 | |
217 | 214 | if (world->hdrLightGrid) |
777 | 777 | UNIFORM_PRIMARYLIGHTRADIUS, |
778 | 778 | |
779 | 779 | UNIFORM_CUBEMAPINFO, |
780 | ||
781 | UNIFORM_FIRERISEDIR, | |
782 | UNIFORM_ZFADELOWEST, | |
783 | UNIFORM_ZFADEHIGHEST, | |
780 | 784 | |
781 | 785 | UNIFORM_COUNT |
782 | 786 | } uniform_t; |
1932 | 1932 | fog_t *fog; |
1933 | 1933 | |
1934 | 1934 | if ( tr.refdef.rdflags & RDF_NOWORLDMODEL ) { |
1935 | return 0; | |
1936 | } | |
1937 | ||
1938 | if ( ent->e.renderfx & RF_CROSSHAIR ) { | |
1935 | 1939 | return 0; |
1936 | 1940 | } |
1937 | 1941 |
417 | 417 | { |
418 | 418 | GLSL_SetUniformFloat5(sp, UNIFORM_DEFORMPARAMS, deformParams); |
419 | 419 | GLSL_SetUniformFloat(sp, UNIFORM_TIME, tess.shaderTime); |
420 | ||
421 | if (tess.shader->deforms[0].deformationWave.frequency < 0) | |
422 | { | |
423 | vec3_t worldUp; | |
424 | ||
425 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
426 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
427 | } | |
428 | ||
429 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
430 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
431 | } else { | |
432 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
433 | } | |
434 | ||
435 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
436 | } | |
420 | 437 | } |
421 | 438 | |
422 | 439 | vector[0] = dl->color[0]; |
601 | 618 | vertColor[3] = 0.0f; |
602 | 619 | break; |
603 | 620 | case AGEN_NORMALZFADE: |
621 | baseColor[3] = pStage->constantColor[3] / 255.0f; | |
622 | if (backEnd.currentEntity && backEnd.currentEntity->e.hModel) | |
623 | { | |
624 | baseColor[3] *= ((unsigned char *)backEnd.currentEntity->e.shaderRGBA)[3] / 255.0f; | |
625 | } | |
626 | vertColor[3] = 0.0f; | |
627 | break; | |
604 | 628 | case AGEN_VERTEX: |
605 | 629 | baseColor[3] = 0.0f; |
606 | 630 | vertColor[3] = 1.0f; |
796 | 820 | |
797 | 821 | GLSL_SetUniformFloat(sp, UNIFORM_VERTEXLERP, glState.vertexAttribsInterpolation); |
798 | 822 | |
823 | if ((deformGen != DGEN_NONE && tess.shader->deforms[0].deformationWave.frequency < 0 ) | |
824 | || pStage->alphaGen == AGEN_NORMALZFADE) | |
825 | { | |
826 | vec3_t worldUp; | |
827 | ||
828 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
829 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
830 | } | |
831 | ||
832 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
833 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
834 | } else { | |
835 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
836 | } | |
837 | ||
838 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
839 | } | |
840 | ||
799 | 841 | GLSL_SetUniformInt(sp, UNIFORM_DEFORMGEN, deformGen); |
800 | 842 | if (deformGen != DGEN_NONE) |
801 | 843 | { |
828 | 870 | if (pStage->alphaGen == AGEN_PORTAL) |
829 | 871 | { |
830 | 872 | GLSL_SetUniformFloat(sp, UNIFORM_PORTALRANGE, tess.shader->portalRange); |
873 | } | |
874 | else if (pStage->alphaGen == AGEN_NORMALZFADE) | |
875 | { | |
876 | float lowest, highest; | |
877 | //qboolean zombieEffect = qfalse; | |
878 | ||
879 | lowest = pStage->zFadeBounds[0]; | |
880 | if ( lowest == -1000 ) { // use entity alpha | |
881 | lowest = backEnd.currentEntity->e.shaderTime; | |
882 | //zombieEffect = qtrue; | |
883 | } | |
884 | highest = pStage->zFadeBounds[1]; | |
885 | if ( highest == -1000 ) { // use entity alpha | |
886 | highest = backEnd.currentEntity->e.shaderTime; | |
887 | //zombieEffect = qtrue; | |
888 | } | |
889 | ||
890 | // TODO: Handle normalzfade zombie effect | |
891 | ||
892 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADELOWEST, lowest); | |
893 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADEHIGHEST, highest); | |
831 | 894 | } |
832 | 895 | |
833 | 896 | GLSL_SetUniformInt(sp, UNIFORM_COLORGEN, pStage->rgbGen); |
1086 | 1149 | { |
1087 | 1150 | GLSL_SetUniformFloat5(sp, UNIFORM_DEFORMPARAMS, deformParams); |
1088 | 1151 | GLSL_SetUniformFloat(sp, UNIFORM_TIME, tess.shaderTime); |
1152 | ||
1153 | if (tess.shader->deforms[0].deformationWave.frequency < 0) | |
1154 | { | |
1155 | vec3_t worldUp; | |
1156 | ||
1157 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
1158 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
1159 | } | |
1160 | ||
1161 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
1162 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
1163 | } else { | |
1164 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
1165 | } | |
1166 | ||
1167 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
1168 | } | |
1089 | 1169 | } |
1090 | 1170 | |
1091 | 1171 | if (wolfFog) |
1272 | 1352 | GLSL_SetUniformVec3(sp, UNIFORM_LOCALVIEWORIGIN, backEnd.or.viewOrigin); |
1273 | 1353 | |
1274 | 1354 | GLSL_SetUniformFloat(sp, UNIFORM_VERTEXLERP, glState.vertexAttribsInterpolation); |
1355 | ||
1356 | if ((deformGen != DGEN_NONE && tess.shader->deforms[0].deformationWave.frequency < 0 ) | |
1357 | || pStage->alphaGen == AGEN_NORMALZFADE) | |
1358 | { | |
1359 | vec3_t worldUp; | |
1360 | ||
1361 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
1362 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
1363 | } | |
1364 | ||
1365 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
1366 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
1367 | } else { | |
1368 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
1369 | } | |
1370 | ||
1371 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
1372 | } | |
1275 | 1373 | |
1276 | 1374 | GLSL_SetUniformInt(sp, UNIFORM_DEFORMGEN, deformGen); |
1277 | 1375 | if (deformGen != DGEN_NONE) |
1343 | 1441 | if (pStage->alphaGen == AGEN_PORTAL) |
1344 | 1442 | { |
1345 | 1443 | GLSL_SetUniformFloat(sp, UNIFORM_PORTALRANGE, tess.shader->portalRange); |
1444 | } | |
1445 | else if (pStage->alphaGen == AGEN_NORMALZFADE) | |
1446 | { | |
1447 | float lowest, highest; | |
1448 | //qboolean zombieEffect = qfalse; | |
1449 | ||
1450 | lowest = pStage->zFadeBounds[0]; | |
1451 | if ( lowest == -1000 ) { // use entity alpha | |
1452 | lowest = backEnd.currentEntity->e.shaderTime; | |
1453 | //zombieEffect = qtrue; | |
1454 | } | |
1455 | highest = pStage->zFadeBounds[1]; | |
1456 | if ( highest == -1000 ) { // use entity alpha | |
1457 | highest = backEnd.currentEntity->e.shaderTime; | |
1458 | //zombieEffect = qtrue; | |
1459 | } | |
1460 | ||
1461 | // TODO: Handle normalzfade zombie effect | |
1462 | ||
1463 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADELOWEST, lowest); | |
1464 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADEHIGHEST, highest); | |
1346 | 1465 | } |
1347 | 1466 | |
1348 | 1467 | GLSL_SetUniformInt(sp, UNIFORM_COLORGEN, pStage->rgbGen); |
1557 | 1676 | { |
1558 | 1677 | GLSL_SetUniformFloat5(sp, UNIFORM_DEFORMPARAMS, deformParams); |
1559 | 1678 | GLSL_SetUniformFloat(sp, UNIFORM_TIME, tess.shaderTime); |
1679 | ||
1680 | if (tess.shader->deforms[0].deformationWave.frequency < 0) | |
1681 | { | |
1682 | vec3_t worldUp; | |
1683 | ||
1684 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
1685 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
1686 | } | |
1687 | ||
1688 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
1689 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
1690 | } else { | |
1691 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
1692 | } | |
1693 | ||
1694 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
1695 | } | |
1560 | 1696 | } |
1561 | 1697 | |
1562 | 1698 | VectorCopy(backEnd.viewParms.or.origin, vector); |
1801 | 1801 | return qfalse; |
1802 | 1802 | } |
1803 | 1803 | |
1804 | if ( r_greyscale->integer ) | |
1805 | { | |
1806 | float luminance; | |
1807 | ||
1808 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1809 | VectorSet( shader.fogParms.color, luminance, luminance, luminance ); | |
1810 | } | |
1811 | else if ( r_greyscale->value ) | |
1812 | { | |
1813 | float luminance; | |
1814 | ||
1815 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1816 | shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value ); | |
1817 | shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value ); | |
1818 | shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value ); | |
1819 | } | |
1820 | ||
1804 | 1821 | token = COM_ParseExt( text, qfalse ); |
1805 | 1822 | if ( !token[0] ) { |
1806 | 1823 | ri.Printf( PRINT_WARNING, "WARNING: missing parm for 'fogParms' keyword in shader '%s'\n", shader.name ); |
2362 | 2379 | { |
2363 | 2380 | case AGEN_LIGHTING_SPECULAR: |
2364 | 2381 | case AGEN_PORTAL: |
2382 | case AGEN_NORMALZFADE: | |
2365 | 2383 | skip = qtrue; |
2366 | 2384 | break; |
2367 | 2385 | default: |
453 | 453 | int clip; |
454 | 454 | model_t *pModel; |
455 | 455 | int i; |
456 | int fognum; | |
456 | 457 | |
457 | 458 | pModel = R_GetModelByHandle( ent->e.hModel ); |
458 | 459 | |
466 | 467 | R_SetupEntityLighting( &tr.refdef, ent ); |
467 | 468 | R_DlightBmodel( bmodel ); |
468 | 469 | |
470 | //----(SA) modified | |
471 | // determine if in fog | |
472 | fognum = R_BmodelFogNum( ent, bmodel ); | |
473 | ||
469 | 474 | for ( i = 0 ; i < bmodel->numSurfaces ; i++ ) { |
470 | 475 | int surf = bmodel->firstSurface + i; |
471 | 476 | |
472 | 477 | if (tr.world->surfacesViewCount[surf] != tr.viewCount) |
473 | 478 | { |
474 | 479 | tr.world->surfacesViewCount[surf] = tr.viewCount; |
480 | tr.world->surfaces[surf].fogIndex = fognum; | |
475 | 481 | R_AddWorldSurface( tr.world->surfaces + surf, tr.currentEntity->needDlights, 0 ); |
476 | 482 | } |
477 | 483 | } |
484 | //----(SA) end | |
478 | 485 | } |
479 | 486 | |
480 | 487 | /* |
1093 | 1093 | render_count = surface->numVerts; |
1094 | 1094 | } |
1095 | 1095 | |
1096 | RB_CheckOverflow( render_count, surface->numTriangles ); | |
1097 | ||
1098 | 1096 | //DBG_SHOWTIME |
1099 | 1097 | |
1100 | 1098 | // |
1101 | 1099 | // setup triangle list |
1102 | 1100 | // |
1103 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1101 | RB_CHECKOVERFLOW( render_count, surface->numTriangles * 3 ); | |
1104 | 1102 | |
1105 | 1103 | //DBG_SHOWTIME |
1106 | 1104 | |
1687 | 1685 | oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + |
1688 | 1686 | backEnd.currentEntity->e.oldframe * frameSize ); |
1689 | 1687 | |
1690 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1688 | RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); | |
1691 | 1689 | |
1692 | 1690 | triangles = (int *) ((byte *)surface + surface->ofsTriangles); |
1693 | 1691 | indexes = surface->numTriangles * 3; |
99 | 99 | |
100 | 100 | #ifdef BUILD_FREETYPE |
101 | 101 | void R_GetGlyphInfo( FT_GlyphSlot glyph, int *left, int *right, int *width, int *top, int *bottom, int *height, int *pitch ) { |
102 | ||
103 | 102 | *left = _FLOOR( glyph->metrics.horiBearingX ); |
104 | 103 | *right = _CEIL( glyph->metrics.horiBearingX + glyph->metrics.width ); |
105 | 104 | *width = _TRUNC( *right - *left ); |
112 | 111 | |
113 | 112 | |
114 | 113 | FT_Bitmap *R_RenderGlyph( FT_GlyphSlot glyph, glyphInfo_t* glyphOut ) { |
115 | ||
116 | 114 | FT_Bitmap *bit2; |
117 | 115 | int left, right, width, top, bottom, height, pitch, size; |
118 | 116 | |
167 | 165 | |
168 | 166 | // swap rgb to bgr |
169 | 167 | c = 18 + width * height * 4; |
170 | for (i=18 ; i<c ; i+=4) | |
168 | for ( i = 18 ; i < c ; i += 4 ) | |
171 | 169 | { |
172 | buffer[i] = data[i-18+2]; // blue | |
173 | buffer[i+1] = data[i-18+1]; // green | |
174 | buffer[i+2] = data[i-18+0]; // red | |
175 | buffer[i+3] = data[i-18+3]; // alpha | |
170 | buffer[i] = data[i - 18 + 2]; // blue | |
171 | buffer[i + 1] = data[i - 18 + 1]; // green | |
172 | buffer[i + 2] = data[i - 18 + 0]; // red | |
173 | buffer[i + 3] = data[i - 18 + 3]; // alpha | |
176 | 174 | } |
177 | 175 | |
178 | 176 | // flip upside down |
194 | 192 | //fwrite (buffer, 1, c, f); |
195 | 193 | //fclose (f); |
196 | 194 | |
197 | ri.Free (buffer); | |
195 | ri.Free( buffer ); | |
198 | 196 | } |
199 | 197 | |
200 | 198 | static glyphInfo_t *RE_ConstructGlyphInfo( unsigned char *imageOut, int *xOut, int *yOut, int *maxHeight, FT_Face face, const unsigned char c, qboolean calcHeight ) { |
246 | 244 | if (*yOut + *maxHeight + 1 >= 255) { |
247 | 245 | *yOut = -1; |
248 | 246 | *xOut = -1; |
249 | ri.Free(bitmap->buffer); | |
250 | ri.Free(bitmap); | |
247 | ri.Free( bitmap->buffer ); | |
248 | ri.Free( bitmap ); | |
251 | 249 | return &glyph; |
252 | 250 | } |
253 | 251 | |
278 | 276 | |
279 | 277 | src += glyph.pitch; |
280 | 278 | dst += 256; |
281 | ||
282 | 279 | } |
283 | 280 | } else { |
284 | 281 | for ( i = 0; i < glyph.height; i++ ) { |
285 | memcpy( dst, src, glyph.pitch ); | |
282 | Com_Memcpy( dst, src, glyph.pitch ); | |
286 | 283 | src += glyph.pitch; |
287 | 284 | dst += 256; |
288 | 285 | } |
309 | 306 | #endif |
310 | 307 | |
311 | 308 | static int fdOffset; |
312 | static byte *fdFile; | |
309 | static byte *fdFile; | |
313 | 310 | |
314 | 311 | int readInt( void ) { |
315 | 312 | int i = fdFile[fdOffset] + ( fdFile[fdOffset + 1] << 8 ) + ( fdFile[fdOffset + 2] << 16 ) + ( fdFile[fdOffset + 3] << 24 ); |
318 | 315 | } |
319 | 316 | |
320 | 317 | typedef union { |
321 | byte fred[4]; | |
322 | float ffred; | |
318 | byte fred[4]; | |
319 | float ffred; | |
323 | 320 | } poor; |
324 | 321 | |
325 | 322 | float readFloat( void ) { |
375 | 372 | Com_sprintf( name, sizeof( name ), "fonts/fontImage_%i.dat",pointSize ); |
376 | 373 | for ( i = 0; i < registeredFontCount; i++ ) { |
377 | 374 | if ( Q_stricmp( name, registeredFont[i].name ) == 0 ) { |
378 | memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
375 | Com_Memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
379 | 376 | return; |
380 | 377 | } |
381 | 378 | } |
402 | 399 | fdOffset += sizeof(font->glyphs[i].shaderName); |
403 | 400 | } |
404 | 401 | font->glyphScale = readFloat(); |
405 | memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
406 | ||
407 | // memcpy(font, faceData, sizeof(fontInfo_t)); | |
402 | Com_Memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
403 | ||
404 | // Com_Memcpy(font, faceData, sizeof(fontInfo_t)); | |
408 | 405 | Q_strncpyz( font->name, name, sizeof( font->name ) ); |
409 | 406 | for ( i = GLYPH_START; i <= GLYPH_END; i++ ) { |
410 | 407 | font->glyphs[i].glyph = RE_RegisterShaderNoMip( font->glyphs[i].shaderName ); |
411 | 408 | } |
412 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
409 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
413 | 410 | ri.FS_FreeFile(faceData); |
414 | 411 | return; |
415 | 412 | } |
507 | 504 | } |
508 | 505 | |
509 | 506 | //Com_sprintf (name, sizeof(name), "fonts/fontImage_%i_%i", imageNumber++, pointSize); |
510 | image = R_CreateImage( name, imageBuff, 256, 256, qfalse, qfalse, GL_CLAMP_TO_EDGE ); | |
507 | image = R_CreateImage( name, imageBuff, 256, 256, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 ); | |
511 | 508 | h = RE_RegisterShaderFromImage( name, LIGHTMAP_2D, image, qfalse ); |
512 | 509 | for ( j = lastStart; j < i; j++ ) { |
513 | 510 | font->glyphs[j].glyph = h; |
521 | 518 | if ( i == GLYPH_END + 1 ) |
522 | 519 | i++; |
523 | 520 | } else { |
524 | memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
521 | Com_Memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
525 | 522 | i++; |
526 | 523 | } |
527 | 524 | } |
534 | 531 | |
535 | 532 | registeredFont[registeredFontCount].glyphScale = glyphScale; |
536 | 533 | font->glyphScale = glyphScale; |
537 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
534 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
538 | 535 | |
539 | 536 | if ( r_saveFontData->integer ) { |
540 | 537 | ri.FS_WriteFile( va( "fonts/fontImage_%i.dat", pointSize ), font, sizeof( fontInfo_t ) ); |
548 | 545 | |
549 | 546 | |
550 | 547 | |
551 | void R_InitFreeType(void) { | |
548 | void R_InitFreeType( void ) { | |
552 | 549 | #ifdef BUILD_FREETYPE |
553 | 550 | if ( FT_Init_FreeType( &ftLibrary ) ) { |
554 | 551 | ri.Printf(PRINT_WARNING, "R_InitFreeType: Unable to initialize FreeType.\n"); |
558 | 555 | } |
559 | 556 | |
560 | 557 | |
561 | void R_DoneFreeType(void) { | |
558 | void R_DoneFreeType( void ) { | |
562 | 559 | #ifdef BUILD_FREETYPE |
563 | 560 | if ( ftLibrary ) { |
564 | 561 | FT_Done_FreeType( ftLibrary ); |
1932 | 1932 | skin->numSurfaces = 0; |
1933 | 1933 | skin->numModels = 0; //----(SA) added |
1934 | 1934 | skin->numSurfaces = 1; |
1935 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( skin->surfaces[0] ), h_low ); | |
1935 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
1936 | 1936 | skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue ); |
1937 | 1937 | return hSkin; |
1938 | 1938 | } |
2045 | 2045 | skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low ); |
2046 | 2046 | Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) ); |
2047 | 2047 | skin->numSurfaces = 1; |
2048 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces ), h_low ); | |
2048 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
2049 | 2049 | skin->surfaces[0]->shader = tr.defaultShader; |
2050 | 2050 | } |
2051 | 2051 |
165 | 165 | frac[i] = v - pos[i]; |
166 | 166 | if ( pos[i] < 0 ) { |
167 | 167 | pos[i] = 0; |
168 | } else if ( pos[i] >= tr.world->lightGridBounds[i] - 1 ) { | |
168 | } else if ( pos[i] > tr.world->lightGridBounds[i] - 1 ) { | |
169 | 169 | pos[i] = tr.world->lightGridBounds[i] - 1; |
170 | 170 | } |
171 | 171 | } |
194 | 194 | data = gridData; |
195 | 195 | for ( j = 0 ; j < 3 ; j++ ) { |
196 | 196 | if ( i & ( 1 << j ) ) { |
197 | if ( pos[j] + 1 > tr.world->lightGridBounds[j] - 1 ) { | |
198 | break; // ignore values outside lightgrid | |
199 | } | |
197 | 200 | factor *= frac[j]; |
198 | 201 | data += gridStep[j]; |
199 | 202 | } else { |
201 | 204 | } |
202 | 205 | } |
203 | 206 | |
207 | if ( j != 3 ) { | |
208 | continue; | |
209 | } | |
204 | 210 | if ( !( data[0] + data[1] + data[2] ) ) { |
205 | 211 | continue; // ignore samples in walls |
206 | 212 | } |
1291 | 1291 | fog_t *fog; |
1292 | 1292 | |
1293 | 1293 | if ( tr.refdef.rdflags & RDF_NOWORLDMODEL ) { |
1294 | return 0; | |
1295 | } | |
1296 | ||
1297 | if ( ent->e.renderfx & RF_CROSSHAIR ) { | |
1294 | 1298 | return 0; |
1295 | 1299 | } |
1296 | 1300 |
1523 | 1523 | else if ( !Q_stricmp( token, "fogParms" ) ) { |
1524 | 1524 | if ( !ParseVector( text, 3, shader.fogParms.color ) ) { |
1525 | 1525 | return qfalse; |
1526 | } | |
1527 | ||
1528 | if ( r_greyscale->integer ) | |
1529 | { | |
1530 | float luminance; | |
1531 | ||
1532 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1533 | VectorSet( shader.fogParms.color, luminance, luminance, luminance ); | |
1534 | } | |
1535 | else if ( r_greyscale->value ) | |
1536 | { | |
1537 | float luminance; | |
1538 | ||
1539 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1540 | shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value ); | |
1541 | shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value ); | |
1542 | shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value ); | |
1526 | 1543 | } |
1527 | 1544 | |
1528 | 1545 | token = COM_ParseExt( text, qfalse ); |
156 | 156 | { |
157 | 157 | int i, j; |
158 | 158 | char buf[ MAX_STRING_CHARS ] = { 0 }; |
159 | SDL_Rect modes[ 128 ]; | |
159 | int numSDLModes; | |
160 | SDL_Rect *modes; | |
160 | 161 | int numModes = 0; |
161 | 162 | |
163 | SDL_DisplayMode windowMode; | |
162 | 164 | int display = SDL_GetWindowDisplayIndex( SDL_window ); |
163 | SDL_DisplayMode windowMode; | |
164 | ||
165 | if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 ) | |
165 | numSDLModes = SDL_GetNumDisplayModes( display ); | |
166 | ||
167 | if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || numSDLModes <= 0 ) | |
166 | 168 | { |
167 | 169 | ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no resolutions detected\n" ); |
168 | 170 | return; |
169 | 171 | } |
170 | 172 | |
171 | for( i = 0; i < SDL_GetNumDisplayModes( display ); i++ ) | |
173 | modes = SDL_calloc( (size_t)numSDLModes, sizeof( SDL_Rect ) ); | |
174 | if ( !modes ) | |
175 | { | |
176 | ri.Error( ERR_FATAL, "Out of memory" ); | |
177 | } | |
178 | ||
179 | for( i = 0; i < numSDLModes; i++ ) | |
172 | 180 | { |
173 | 181 | SDL_DisplayMode mode; |
174 | 182 | |
178 | 186 | if( !mode.w || !mode.h ) |
179 | 187 | { |
180 | 188 | ri.Printf( PRINT_ALL, "Display supports any resolution\n" ); |
189 | SDL_free( modes ); | |
181 | 190 | return; |
182 | 191 | } |
183 | 192 | |
219 | 228 | ri.Printf( PRINT_ALL, "Available modes: '%s'\n", buf ); |
220 | 229 | ri.Cvar_Set( "r_availableModes", buf ); |
221 | 230 | } |
231 | SDL_free( modes ); | |
222 | 232 | } |
223 | 233 | |
224 | 234 | /* |
832 | 832 | Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qtrue, 0, NULL ); |
833 | 833 | Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qfalse, 0, NULL ); |
834 | 834 | } |
835 | else | |
835 | else if( e.wheel.y < 0 ) | |
836 | 836 | { |
837 | 837 | Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL ); |
838 | 838 | Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL ); |
812 | 812 | signal( SIGHUP, Sys_SigHandler ); |
813 | 813 | signal( SIGQUIT, Sys_SigHandler ); |
814 | 814 | signal( SIGTRAP, Sys_SigHandler ); |
815 | signal( SIGIOT, Sys_SigHandler ); | |
815 | signal( SIGABRT, Sys_SigHandler ); | |
816 | 816 | signal( SIGBUS, Sys_SigHandler ); |
817 | 817 | |
818 | 818 | Sys_SetFloatEnv(); |
469 | 469 | intptr_t findhandle; |
470 | 470 | int flag; |
471 | 471 | int i; |
472 | int extLen; | |
472 | 473 | |
473 | 474 | if (filter) { |
474 | 475 | |
502 | 503 | flag = _A_SUBDIR; |
503 | 504 | } |
504 | 505 | |
506 | extLen = strlen( extension ); | |
507 | ||
505 | 508 | Com_sprintf( search, sizeof(search), "%s\\*%s", directory, extension ); |
506 | 509 | |
507 | 510 | // search |
515 | 518 | |
516 | 519 | do { |
517 | 520 | if ( (!wantsubs && flag ^ ( findinfo.attrib & _A_SUBDIR )) || (wantsubs && findinfo.attrib & _A_SUBDIR) ) { |
521 | if (*extension) { | |
522 | if ( strlen( findinfo.name ) < extLen || | |
523 | Q_stricmp( | |
524 | findinfo.name + strlen( findinfo.name ) - extLen, | |
525 | extension ) ) { | |
526 | continue; // didn't match | |
527 | } | |
528 | } | |
518 | 529 | if ( nfiles == MAX_FOUND_FILES - 1 ) { |
519 | 530 | break; |
520 | 531 | } |
57 | 57 | |
58 | 58 | unset X86_64_SDK |
59 | 59 | unset X86_64_CFLAGS |
60 | unset X86_64_LDFLAGS | |
61 | 60 | unset X86_SDK |
62 | 61 | unset X86_CFLAGS |
63 | unset X86_LDFLAGS | |
64 | 62 | unset PPC_64_SDK |
65 | 63 | unset PPC_CFLAGS |
66 | unset PPC_LDFLAGS | |
67 | 64 | |
68 | 65 | if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then |
69 | 66 | X86_64_SDK=/Developer/SDKs/MacOSX10.5.sdk |
70 | X86_64_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
71 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
72 | X86_64_LDFLAGS=" -mmacosx-version-min=10.5" | |
67 | X86_64_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
73 | 68 | |
74 | 69 | X86_SDK=/Developer/SDKs/MacOSX10.5.sdk |
75 | X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
76 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
77 | X86_LDFLAGS=" -mmacosx-version-min=10.5" | |
70 | X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
78 | 71 | |
79 | 72 | PPC_SDK=/Developer/SDKs/MacOSX10.5.sdk |
80 | PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
81 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
82 | PPC_LDFLAGS=" -mmacosx-version-min=10.5" | |
73 | PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
83 | 74 | fi |
84 | 75 | |
85 | 76 | if [ -z $X86_64_SDK ] || [ -z $X86_SDK ] || [ -z $PPC_SDK ]; then |
116 | 107 | if [ -d build/release-release-x86_64 ]; then |
117 | 108 | rm -r build/release-darwin-x86_64 |
118 | 109 | fi |
119 | (ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS LDFLAGS=$X86_64_LDFLAGS make -j$NCPU) || exit 1; | |
110 | (ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS make -j$NCPU) || exit 1; | |
120 | 111 | |
121 | 112 | echo;echo |
122 | 113 | |
124 | 115 | if [ -d build/release-darwin-x86 ]; then |
125 | 116 | rm -r build/release-darwin-x86 |
126 | 117 | fi |
127 | (ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1; | |
118 | (ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS make -j$NCPU) || exit 1; | |
128 | 119 | |
129 | 120 | echo;echo |
130 | 121 | |
132 | 123 | if [ -d build/release-darwin-ppc ]; then |
133 | 124 | rm -r build/release-darwin-ppc |
134 | 125 | fi |
135 | (ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS LDFLAGS=$PPC_LDFLAGS make -j$NCPU) || exit 1; | |
126 | (ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS make -j$NCPU) || exit 1; | |
136 | 127 | |
137 | 128 | echo;echo |
138 | 129 |
71 | 71 | |
72 | 72 | unset ARCH_SDK |
73 | 73 | unset ARCH_CFLAGS |
74 | unset ARCH_LDFLAGS | |
75 | 74 | |
76 | 75 | if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then |
77 | 76 | ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk |
78 | ARCH_CFLAGS="-arch ${ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
79 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
80 | ARCH_LDFLAGS=" -mmacosx-version-min=10.5" | |
77 | ARCH_CFLAGS="-arch ${ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
81 | 78 | fi |
82 | 79 | |
83 | 80 | |
96 | 93 | if [ -d build/release-darwin-${BUILDARCH} ]; then |
97 | 94 | rm -r build/release-darwin-${BUILDARCH} |
98 | 95 | fi |
99 | (CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1; | |
96 | (CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1; | |
100 | 97 | |
101 | 98 | echo "Creating .app bundle $DESTDIR/$APPBUNDLE" |
102 | 99 | if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then |
60 | 60 | # "8" is the Darwin major kernel version. |
61 | 61 | TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'` |
62 | 62 | |
63 | # we want to use the oldest available SDK (10.6) for max compatiblity. | |
63 | unset ARCH_CFLAGS | |
64 | 64 | |
65 | unset ARCH_CFLAGS | |
66 | unset ARCH_LDFLAGS | |
67 | ||
68 | ARCH_CFLAGS="-arch ${ARCH} -DMAC_OS_X_VERSION_MIN_REQUIRED=1060" | |
69 | ARCH_LDFLAGS=" -mmacosx-version-min=10.6" | |
65 | ARCH_CFLAGS="-arch ${ARCH}" | |
70 | 66 | |
71 | 67 | if [ ! -d $DESTDIR ]; then |
72 | 68 | mkdir -p $DESTDIR |
80 | 76 | if [ -d build/release-darwin-${BUILDARCH} ]; then |
81 | 77 | rm -r build/release-darwin-${BUILDARCH} |
82 | 78 | fi |
83 | (CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1; | |
79 | (CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1; | |
84 | 80 | |
85 | 81 | echo "Creating .app bundle $DESTDIR/$APPBUNDLE" |
86 | 82 | if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then |
60 | 60 | # "8" is the Darwin major kernel version. |
61 | 61 | TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'` |
62 | 62 | |
63 | # we want to use the oldest available SDK (10.6) for max compatiblity. | |
63 | unset ARCH_CFLAGS | |
64 | 64 | |
65 | unset ARCH_CFLAGS | |
66 | unset ARCH_LDFLAGS | |
67 | ||
68 | ARCH_CFLAGS="-arch ${ARCH} -DMAC_OS_X_VERSION_MIN_REQUIRED=1060" | |
69 | ARCH_LDFLAGS=" -mmacosx-version-min=10.6" | |
65 | ARCH_CFLAGS="-arch ${ARCH}" | |
70 | 66 | |
71 | 67 | if [ ! -d $DESTDIR ]; then |
72 | 68 | mkdir -p $DESTDIR |
80 | 76 | if [ -d build/release-darwin-${BUILDARCH} ]; then |
81 | 77 | rm -r build/release-darwin-${BUILDARCH} |
82 | 78 | fi |
83 | (CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1; | |
79 | (CC=${CC} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1; | |
84 | 80 | |
85 | 81 | echo "Creating .app bundle $DESTDIR/$APPBUNDLE" |
86 | 82 | if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then |
51 | 51 | 4.) mingw64-x86_64-gcc-g++ (For 64bit, same as above) |
52 | 52 | 5.) make |
53 | 53 | 6.) bison |
54 | 7.) subversion | |
54 | 7.) git-core | |
55 | 55 | |
56 | 56 | When you search for your packages you'll see category listings. These packages would all be under the 'Devel' category. |
57 | 57 | |
68 | 68 | After the install has completed you should have a 'Cygwin Terminal' icon on your Desktop. This is the bash shell for Cygwin, so go ahead and run it. |
69 | 69 | |
70 | 70 | At the command prompt type: |
71 | svn co http://iortcw.googlecode.com/svn/trunk iortcw | |
71 | git clone https://github.com/iortcw/iortcw.git iortcw | |
72 | 72 | |
73 | 73 | This will pull the iortcw trunk source. |
74 | 74 | |
78 | 78 | or |
79 | 79 | cd iortcw/SP (Single-Player) |
80 | 80 | |
81 | ./cross-make-mingw.sh (to build 32bit binaries) | |
81 | ARCH=x86 make (to build 32bit binaries) | |
82 | 82 | or |
83 | ./cross-make-mingw64.sh (for 64bit binaries) | |
83 | ARCH=x86_64 make (for 64bit binaries) | |
84 | 84 | |
85 | 85 | Wait for build to complete. |
86 | 86 |
60 | 60 | endif |
61 | 61 | export PLATFORM |
62 | 62 | |
63 | ifeq ($(PLATFORM),mingw32) | |
64 | MINGW=1 | |
65 | endif | |
66 | ifeq ($(PLATFORM),mingw64) | |
67 | MINGW=1 | |
68 | endif | |
69 | ||
63 | 70 | ifeq ($(COMPILE_ARCH),i386) |
64 | 71 | COMPILE_ARCH=x86 |
65 | 72 | endif |
97 | 104 | # For historical compatibility reasons on non-windows |
98 | 105 | # platform output files use i386 instead of x86 |
99 | 106 | ifeq ($(ARCH),x86) |
100 | ifneq ($(PLATFORM),mingw32) | |
107 | ifndef MINGW | |
101 | 108 | FILE_ARCH=i386 |
102 | 109 | endif |
103 | 110 | endif |
123 | 130 | endif |
124 | 131 | |
125 | 132 | ifndef CLIENTBIN |
126 | ifeq ($(PLATFORM),mingw32) | |
133 | ifdef MINGW | |
127 | 134 | CLIENTBIN=ioWolfSP |
128 | 135 | else |
129 | 136 | CLIENTBIN=iowolfsp |
131 | 138 | endif |
132 | 139 | |
133 | 140 | ifndef SERVERBIN |
134 | ifeq ($(PLATFORM),mingw32) | |
141 | ifdef MINGW | |
135 | 142 | SERVERBIN=ioWolfSPDED |
136 | 143 | else |
137 | 144 | SERVERBIN=iowolfspded |
183 | 190 | endif |
184 | 191 | |
185 | 192 | ifndef USE_CURL_DLOPEN |
186 | ifeq ($(PLATFORM),mingw32) | |
193 | ifdef MINGW | |
187 | 194 | USE_CURL_DLOPEN=0 |
188 | 195 | else |
189 | 196 | USE_CURL_DLOPEN=1 |
232 | 239 | |
233 | 240 | ifndef USE_INTERNAL_JPEG |
234 | 241 | USE_INTERNAL_JPEG=$(USE_INTERNAL_LIBS) |
242 | endif | |
243 | ||
244 | ifndef USE_INTERNAL_FREETYPE | |
245 | USE_INTERNAL_FREETYPE=$(USE_INTERNAL_LIBS) | |
235 | 246 | endif |
236 | 247 | |
237 | 248 | ifndef USE_LOCAL_HEADERS |
282 | 293 | OPUSDIR=$(MOUNT_DIR)/opus-1.1 |
283 | 294 | OPUSFILEDIR=$(MOUNT_DIR)/opusfile-0.6 |
284 | 295 | ZDIR=$(MOUNT_DIR)/zlib |
296 | FTDIR=$(MOUNT_DIR)/freetype-2.5.5 | |
285 | 297 | SPLDIR=$(MOUNT_DIR)/splines |
286 | 298 | Q3ASMDIR=$(MOUNT_DIR)/tools/asm |
287 | 299 | LBURGDIR=$(MOUNT_DIR)/tools/lcc/lburg |
304 | 316 | OPENAL_LIBS ?= $(shell pkg-config --silence-errors --libs openal) |
305 | 317 | SDL_CFLAGS ?= $(shell pkg-config --silence-errors --cflags sdl2|sed 's/-Dmain=SDL_main//') |
306 | 318 | SDL_LIBS ?= $(shell pkg-config --silence-errors --libs sdl2) |
307 | FREETYPE_CFLAGS ?= $(shell pkg-config --silence-errors --cflags freetype2) | |
308 | 319 | else |
309 | 320 | # assume they're in the system default paths (no -I or -L needed) |
310 | 321 | CURL_LIBS ?= -lcurl |
342 | 353 | EXTRA_FILES= |
343 | 354 | CLIENT_EXTRA_FILES= |
344 | 355 | |
345 | ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu")) | |
356 | ifneq (,$(findstring "$(PLATFORM)", "linux" "gnu_kfreebsd" "kfreebsd-gnu" "gnu")) | |
346 | 357 | |
347 | 358 | ifeq ($(ARCH),x86_64) |
348 | 359 | LIB=lib64 |
352 | 363 | else |
353 | 364 | ifeq ($(ARCH),s390x) |
354 | 365 | LIB=lib64 |
366 | else | |
367 | ifeq ($(ARCH),aarch64) | |
368 | LIB=lib64 | |
369 | endif | |
355 | 370 | endif |
356 | 371 | endif |
357 | 372 | endif |
360 | 375 | -pipe -DUSE_ICON |
361 | 376 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
362 | 377 | |
363 | OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer | |
378 | OPTIMIZEVM = -O3 | |
364 | 379 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
365 | 380 | |
366 | 381 | ifeq ($(ARCH),x86_64) |
367 | OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops | |
368 | # clang 3.5 doesn't support this | |
369 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
370 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
371 | endif | |
382 | OPTIMIZEVM = -O3 | |
372 | 383 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
373 | 384 | HAVE_VM_COMPILED = true |
374 | 385 | else |
375 | 386 | ifeq ($(ARCH),x86) |
376 | OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer -funroll-loops | |
377 | # clang 3.5 doesn't support this | |
378 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
379 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
380 | endif | |
387 | OPTIMIZEVM = -O3 -march=i586 | |
381 | 388 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
382 | 389 | HAVE_VM_COMPILED=true |
383 | 390 | else |
515 | 522 | |
516 | 523 | ifeq ($(USE_OPENAL),1) |
517 | 524 | ifneq ($(USE_OPENAL_DLOPEN),1) |
518 | CLIENT_LIBS += -framework OpenAL | |
525 | ifneq ($(USE_INTERNAL_LIBS),1) | |
526 | CLIENT_CFLAGS += $(OPENAL_CFLAGS) | |
527 | CLIENT_LIBS += $(THREAD_LIBS) $(OPENAL_LIBS) | |
528 | else | |
529 | CLIENT_LIBS += -framework OpenAL | |
530 | endif | |
519 | 531 | endif |
520 | 532 | endif |
521 | 533 | |
530 | 542 | |
531 | 543 | ifeq ($(USE_LOCAL_HEADERS),1) |
532 | 544 | BASE_CFLAGS += -I$(SDLHDIR)/include |
545 | else | |
546 | BASE_CFLAGS += $(SDL_CFLAGS) | |
533 | 547 | endif |
534 | 548 | |
535 | 549 | # We copy sdlmain before ranlib'ing it so that subversion doesn't think |
536 | 550 | # the file has been modified by each build. |
537 | LIBSDLMAIN=$(B)/libSDL2main.a | |
538 | LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDL2main.a | |
539 | CLIENT_LIBS += -framework IOKit \ | |
540 | $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
541 | RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
542 | CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib $(LIBSDIR)/macosx/libopenal.dylib | |
551 | ifeq ($(USE_INTERNAL_LIBS),1) | |
552 | LIBSDLMAIN=$(B)/libSDL2main.a | |
553 | LIBSDLMAINSRC=$(LIBSDIR)/macosx/libSDL2main.a | |
554 | CLIENT_LIBS += -framework IOKit $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
555 | RENDERER_LIBS += -framework OpenGL $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib | |
556 | else | |
557 | CLIENT_LIBS += -framework IOKit $(SDL_LIBS) | |
558 | RENDERER_LIBS += -framework OpenGL $(SDL_LIBS) | |
559 | endif | |
560 | ||
561 | ifeq ($(USE_INTERNAL_LIBS),1) | |
562 | CLIENT_EXTRA_FILES += $(LIBSDIR)/macosx/libSDL2-2.0.0.dylib $(LIBSDIR)/macosx/libopenal.dylib | |
563 | endif | |
543 | 564 | |
544 | 565 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
545 | 566 | |
556 | 577 | # SETUP AND BUILD -- MINGW32 |
557 | 578 | ############################################################################# |
558 | 579 | |
559 | ifeq ($(PLATFORM),mingw32) | |
580 | ifdef MINGW | |
560 | 581 | |
561 | 582 | ifeq ($(CROSS_COMPILING),1) |
562 | 583 | # If CC is already set to something generic, we probably want to use |
573 | 594 | MINGW_PREFIXES=amd64-mingw32msvc x86_64-w64-mingw32 |
574 | 595 | endif |
575 | 596 | ifeq ($(ARCH),x86) |
576 | MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32 | |
597 | MINGW_PREFIXES=i586-mingw32msvc i686-w64-mingw32 i686-pc-mingw32 | |
577 | 598 | endif |
578 | 599 | |
579 | 600 | ifndef CC |
626 | 647 | endif |
627 | 648 | |
628 | 649 | ifeq ($(ARCH),x86_64) |
629 | OPTIMIZEVM = -O3 -fno-omit-frame-pointer -funroll-loops | |
630 | # clang 3.5 doesn't support this | |
631 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
632 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
633 | endif | |
650 | OPTIMIZEVM = -O3 | |
634 | 651 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
635 | 652 | HAVE_VM_COMPILED = true |
636 | 653 | FILE_ARCH=x64 |
637 | 654 | endif |
638 | 655 | ifeq ($(ARCH),x86) |
639 | OPTIMIZEVM = -O3 -march=i586 -fno-omit-frame-pointer -funroll-loops | |
640 | # clang 3.5 doesn't support this | |
641 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
642 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
643 | endif | |
656 | OPTIMIZEVM = -O3 -march=i586 | |
644 | 657 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
645 | 658 | HAVE_VM_COMPILED = true |
646 | 659 | endif |
669 | 682 | RENDERER_LIBS = -lgdi32 -lole32 -lopengl32 |
670 | 683 | |
671 | 684 | ifeq ($(USE_FREETYPE),1) |
672 | FREETYPE_CFLAGS = -Ifreetype2 | |
685 | ifneq ($(USE_INTERNAL_FREETYPE),1) | |
686 | FREETYPE_CFLAGS = -Ifreetype2 | |
687 | endif | |
673 | 688 | endif |
674 | 689 | |
675 | 690 | ifeq ($(USE_CURL),1) |
723 | 738 | SDLDLL=SDL2.dll |
724 | 739 | endif |
725 | 740 | |
726 | else # ifeq mingw32 | |
741 | else # ifdef MINGW | |
727 | 742 | |
728 | 743 | ############################################################################# |
729 | 744 | # SETUP AND BUILD -- FREEBSD |
738 | 753 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
739 | 754 | HAVE_VM_COMPILED = true |
740 | 755 | |
741 | OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer | |
756 | OPTIMIZEVM = -O3 | |
742 | 757 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
743 | 758 | |
744 | 759 | SHLIBEXT=so |
791 | 806 | -pipe -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON |
792 | 807 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
793 | 808 | |
794 | OPTIMIZEVM = -O3 -funroll-loops -fomit-frame-pointer | |
809 | OPTIMIZEVM = -O3 | |
795 | 810 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
796 | 811 | |
797 | 812 | ifeq ($(ARCH),x86_64) |
798 | OPTIMIZEVM = -O3 -fomit-frame-pointer -funroll-loops | |
799 | # clang 3.5 doesn't support this | |
800 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
801 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
802 | endif | |
813 | OPTIMIZEVM = -O3 | |
803 | 814 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
804 | 815 | HAVE_VM_COMPILED = true |
805 | 816 | else |
806 | 817 | ifeq ($(ARCH),x86) |
807 | OPTIMIZEVM = -O3 -march=i586 -fomit-frame-pointer -funroll-loops | |
808 | # clang 3.5 doesn't support this | |
809 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
810 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
811 | endif | |
818 | OPTIMIZEVM = -O3 -march=i586 | |
812 | 819 | OPTIMIZE = $(OPTIMIZEVM) -ffast-math |
813 | 820 | HAVE_VM_COMPILED=true |
814 | 821 | else |
936 | 943 | -pipe -DUSE_ICON |
937 | 944 | CLIENT_CFLAGS += $(SDL_CFLAGS) |
938 | 945 | |
939 | OPTIMIZEVM = -O3 -funroll-loops | |
946 | OPTIMIZEVM = -O3 | |
940 | 947 | |
941 | 948 | ifeq ($(ARCH),sparc) |
942 | 949 | OPTIMIZEVM += -O3 -mtune=ultrasparc3 -mv8plus -mno-faster-structs |
943 | # clang 3.5 doesn't support this | |
944 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
945 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
946 | endif | |
947 | 950 | HAVE_VM_COMPILED=true |
948 | 951 | else |
949 | 952 | ifeq ($(ARCH),x86) |
950 | OPTIMIZEVM += -march=i586 -fomit-frame-pointer | |
951 | # clang 3.5 doesn't support this | |
952 | ifneq ("$(CC)", $(findstring "$(CC)", "clang" "clang++")) | |
953 | OPTIMIZEVM += -falign-functions=2 -fstrength-reduce | |
954 | endif | |
953 | OPTIMIZEVM += -march=i586 | |
955 | 954 | HAVE_VM_COMPILED=true |
956 | 955 | BASE_CFLAGS += -m32 |
957 | 956 | CLIENT_CFLAGS += -I/usr/X11/include/NVIDIA |
987 | 986 | |
988 | 987 | endif #Linux |
989 | 988 | endif #darwin |
990 | endif #mingw32 | |
989 | endif #MINGW | |
991 | 990 | endif #FreeBSD |
992 | 991 | endif #OpenBSD |
993 | 992 | endif #NetBSD |
1037 | 1036 | |
1038 | 1037 | ifneq ($(BUILD_GAME_SO),0) |
1039 | 1038 | ifneq ($(BUILD_BASEGAME),0) |
1040 | ifeq ($(PLATFORM),mingw32) | |
1039 | ifdef MINGW | |
1041 | 1040 | TARGETS += \ |
1042 | 1041 | $(B)/$(BASEGAME)/cgame_sp_$(SHLIBNAME) \ |
1043 | 1042 | $(B)/$(BASEGAME)/qagame_sp_$(SHLIBNAME) \ |
1144 | 1143 | BASE_CFLAGS += -DUSE_INTERNAL_JPEG |
1145 | 1144 | BASE_CFLAGS += -I$(JPDIR) |
1146 | 1145 | else |
1147 | # libjpeg doesn't have pkg-config yet, but let users override with | |
1148 | # "make JPEG_CFLAGS=-I/opt/jpeg/include JPEG_LIBS='-L/opt/jpeg/lib -ljpeg'" | |
1149 | # if they need to | |
1150 | JPEG_CFLAGS ?= | |
1151 | JPEG_LIBS ?= -ljpeg | |
1146 | # IJG libjpeg doesn't have pkg-config, but libjpeg-turbo uses libjpeg.pc; | |
1147 | # we fall back to hard-coded answers if libjpeg.pc is unavailable | |
1148 | JPEG_CFLAGS ?= $(shell pkg-config --silence-errors --cflags libjpeg || true) | |
1149 | JPEG_LIBS ?= $(shell pkg-config --silence-errors --libs libjpeg || echo -ljpeg) | |
1152 | 1150 | BASE_CFLAGS += $(JPEG_CFLAGS) |
1153 | 1151 | RENDERER_LIBS += $(JPEG_LIBS) |
1154 | 1152 | endif |
1155 | 1153 | |
1156 | 1154 | ifeq ($(USE_FREETYPE),1) |
1157 | FREETYPE_CFLAGS ?= $(shell pkg-config --silence-errors --cflags freetype2 || true) | |
1158 | FREETYPE_LIBS ?= $(shell pkg-config --silence-errors --libs freetype2 || echo -lfreetype) | |
1159 | ||
1155 | ifeq ($(USE_INTERNAL_FREETYPE),1) | |
1156 | FREETYPE_CFLAGS += -I$(FTDIR)/include -DFT2_BUILD_LIBRARY | |
1157 | else | |
1158 | FREETYPE_CFLAGS ?= $(shell pkg-config --silence-errors --cflags freetype2 || true) | |
1159 | FREETYPE_LIBS ?= $(shell pkg-config --silence-errors --libs freetype2 || echo -lfreetype) | |
1160 | endif | |
1160 | 1161 | BASE_CFLAGS += -DBUILD_FREETYPE $(FREETYPE_CFLAGS) |
1161 | 1162 | RENDERER_LIBS += $(FREETYPE_LIBS) |
1162 | 1163 | endif |
1353 | 1354 | @echo " COMPILE_ARCH: $(COMPILE_ARCH)" |
1354 | 1355 | @echo " CC: $(CC)" |
1355 | 1356 | @echo " CXX: $(CXX)" |
1356 | ifeq ($(PLATFORM),mingw32) | |
1357 | ifdef MINGW | |
1357 | 1358 | @echo " WINDRES: $(WINDRES)" |
1358 | 1359 | endif |
1359 | 1360 | @echo "" |
1692 | 1693 | $(B)/client/con_log.o \ |
1693 | 1694 | $(B)/client/sys_main.o |
1694 | 1695 | |
1695 | ifeq ($(PLATFORM),mingw32) | |
1696 | ifdef MINGW | |
1696 | 1697 | Q3OBJ += \ |
1697 | 1698 | $(B)/client/con_passive.o |
1698 | 1699 | else |
1713 | 1714 | $(B)/rend2/tr_font.o \ |
1714 | 1715 | $(B)/rend2/tr_glsl.o \ |
1715 | 1716 | $(B)/rend2/tr_image.o \ |
1717 | $(B)/rend2/tr_image_bmp.o \ | |
1718 | $(B)/rend2/tr_image_jpg.o \ | |
1719 | $(B)/rend2/tr_image_pcx.o \ | |
1716 | 1720 | $(B)/rend2/tr_image_png.o \ |
1717 | $(B)/rend2/tr_image_jpg.o \ | |
1718 | $(B)/rend2/tr_image_bmp.o \ | |
1719 | 1721 | $(B)/rend2/tr_image_tga.o \ |
1720 | $(B)/rend2/tr_image_pcx.o \ | |
1721 | 1722 | $(B)/rend2/tr_init.o \ |
1722 | 1723 | $(B)/rend2/tr_light.o \ |
1723 | 1724 | $(B)/rend2/tr_main.o \ |
1780 | 1781 | $(B)/renderer/tr_flares.o \ |
1781 | 1782 | $(B)/renderer/tr_font.o \ |
1782 | 1783 | $(B)/renderer/tr_image.o \ |
1784 | $(B)/renderer/tr_image_bmp.o \ | |
1785 | $(B)/renderer/tr_image_jpg.o \ | |
1786 | $(B)/renderer/tr_image_pcx.o \ | |
1783 | 1787 | $(B)/renderer/tr_image_png.o \ |
1784 | $(B)/renderer/tr_image_jpg.o \ | |
1785 | $(B)/renderer/tr_image_bmp.o \ | |
1786 | 1788 | $(B)/renderer/tr_image_tga.o \ |
1787 | $(B)/renderer/tr_image_pcx.o \ | |
1788 | 1789 | $(B)/renderer/tr_init.o \ |
1789 | 1790 | $(B)/renderer/tr_light.o \ |
1790 | 1791 | $(B)/renderer/tr_main.o \ |
1871 | 1872 | $(B)/renderer/jquant1.o \ |
1872 | 1873 | $(B)/renderer/jquant2.o \ |
1873 | 1874 | $(B)/renderer/jutils.o |
1875 | endif | |
1876 | ||
1877 | ifeq ($(USE_FREETYPE),1) | |
1878 | ifneq ($(USE_INTERNAL_FREETYPE),0) | |
1879 | FTOBJ += \ | |
1880 | $(B)/renderer/ftsystem.o \ | |
1881 | $(B)/renderer/ftdebug.o \ | |
1882 | $(B)/renderer/ftinit.o \ | |
1883 | $(B)/renderer/ftbase.o \ | |
1884 | $(B)/renderer/ftbbox.o \ | |
1885 | $(B)/renderer/ftbdf.o \ | |
1886 | $(B)/renderer/ftbitmap.o \ | |
1887 | $(B)/renderer/ftcid.o \ | |
1888 | $(B)/renderer/ftfstype.o \ | |
1889 | $(B)/renderer/ftgasp.o \ | |
1890 | $(B)/renderer/ftglyph.o \ | |
1891 | $(B)/renderer/ftgxval.o \ | |
1892 | $(B)/renderer/ftlcdfil.o \ | |
1893 | $(B)/renderer/ftmm.o \ | |
1894 | $(B)/renderer/ftotval.o \ | |
1895 | $(B)/renderer/ftpatent.o \ | |
1896 | $(B)/renderer/ftpfr.o \ | |
1897 | $(B)/renderer/ftstroke.o \ | |
1898 | $(B)/renderer/ftsynth.o \ | |
1899 | $(B)/renderer/fttype1.o \ | |
1900 | $(B)/renderer/ftwinfnt.o \ | |
1901 | $(B)/renderer/ftxf86.o \ | |
1902 | $(B)/renderer/truetype.o \ | |
1903 | $(B)/renderer/type1.o \ | |
1904 | $(B)/renderer/cff.o \ | |
1905 | $(B)/renderer/type1cid.o \ | |
1906 | $(B)/renderer/pfr.o \ | |
1907 | $(B)/renderer/type42.o \ | |
1908 | $(B)/renderer/winfnt.o \ | |
1909 | $(B)/renderer/pcf.o \ | |
1910 | $(B)/renderer/bdf.o \ | |
1911 | $(B)/renderer/sfnt.o \ | |
1912 | $(B)/renderer/autofit.o \ | |
1913 | $(B)/renderer/pshinter.o \ | |
1914 | $(B)/renderer/raster.o \ | |
1915 | $(B)/renderer/smooth.o \ | |
1916 | $(B)/renderer/ftcache.o \ | |
1917 | $(B)/renderer/ftgzip.o \ | |
1918 | $(B)/renderer/ftlzw.o \ | |
1919 | $(B)/renderer/ftbzip2.o \ | |
1920 | $(B)/renderer/psaux.o \ | |
1921 | $(B)/renderer/psnames.o | |
1922 | endif | |
1874 | 1923 | endif |
1875 | 1924 | |
1876 | 1925 | ifeq ($(ARCH),x86) |
2033 | 2082 | $(B)/client/internal.o \ |
2034 | 2083 | $(B)/client/opusfile.o \ |
2035 | 2084 | $(B)/client/stream.o |
2036 | ifeq ($(PLATFORM),mingw32) | |
2085 | ifdef MINGW | |
2037 | 2086 | Q3OBJ += \ |
2038 | 2087 | $(B)/client/wincerts.o |
2039 | 2088 | endif |
2098 | 2147 | endif |
2099 | 2148 | endif |
2100 | 2149 | |
2101 | ifeq ($(PLATFORM),mingw32) | |
2150 | ifdef MINGW | |
2102 | 2151 | Q3OBJ += \ |
2103 | 2152 | $(B)/client/win_resource.o \ |
2104 | 2153 | $(B)/client/sys_win32.o |
2124 | 2173 | -o $@ $(Q3OBJ) \ |
2125 | 2174 | $(LIBSDLMAIN) $(CLIENT_LIBS) $(LIBS) |
2126 | 2175 | |
2127 | $(B)/renderer_sp_opengl1_$(SHLIBNAME): $(Q3ROBJ) $(JPGOBJ) | |
2176 | $(B)/renderer_sp_opengl1_$(SHLIBNAME): $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) | |
2128 | 2177 | $(echo_cmd) "LD $@" |
2129 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3ROBJ) $(JPGOBJ) \ | |
2178 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) \ | |
2130 | 2179 | $(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS) |
2131 | 2180 | |
2132 | $(B)/renderer_sp_rend2_$(SHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) | |
2181 | $(B)/renderer_sp_rend2_$(SHLIBNAME): $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) | |
2133 | 2182 | $(echo_cmd) "LD $@" |
2134 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) \ | |
2183 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) \ | |
2135 | 2184 | $(THREAD_LIBS) $(LIBSDLMAIN) $(RENDERER_LIBS) $(LIBS) |
2136 | 2185 | else |
2137 | $(B)/$(CLIENTBIN)$(FULLBINEXT): $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) $(LIBSDLMAIN) | |
2186 | $(B)/$(CLIENTBIN)$(FULLBINEXT): $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) $(LIBSDLMAIN) | |
2138 | 2187 | $(echo_cmd) "LD $@" |
2139 | 2188 | $(Q)$(CXX) $(CLIENT_CFLAGS) $(CFLAGS) $(CLIENT_LDFLAGS) $(LDFLAGS) \ |
2140 | -o $@ $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) \ | |
2189 | -o $@ $(Q3OBJ) $(Q3ROBJ) $(JPGOBJ) $(FTOBJ) \ | |
2141 | 2190 | $(LIBSDLMAIN) $(CLIENT_LIBS) $(RENDERER_LIBS) $(LIBS) |
2142 | 2191 | |
2143 | $(B)/$(CLIENTBIN)_rend2$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(LIBSDLMAIN) | |
2192 | $(B)/$(CLIENTBIN)_rend2$(FULLBINEXT): $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) $(LIBSDLMAIN) | |
2144 | 2193 | $(echo_cmd) "LD $@" |
2145 | 2194 | $(Q)$(CXX) $(CLIENT_CFLAGS) $(CFLAGS) $(CLIENT_LDFLAGS) $(LDFLAGS) \ |
2146 | -o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) \ | |
2195 | -o $@ $(Q3OBJ) $(Q3R2OBJ) $(Q3R2STRINGOBJ) $(JPGOBJ) $(FTOBJ) \ | |
2147 | 2196 | $(LIBSDLMAIN) $(CLIENT_LIBS) $(RENDERER_LIBS) $(LIBS) |
2148 | 2197 | endif |
2149 | 2198 | |
2267 | 2316 | endif |
2268 | 2317 | endif |
2269 | 2318 | |
2270 | ifeq ($(PLATFORM),mingw32) | |
2319 | ifdef MINGW | |
2271 | 2320 | Q3DOBJ += \ |
2272 | 2321 | $(B)/ded/win_resource.o \ |
2273 | 2322 | $(B)/ded/sys_win32.o \ |
2330 | 2379 | Q3CGOBJ = $(Q3CGOBJ_) $(B)/$(BASEGAME)/cgame/cg_syscalls.o |
2331 | 2380 | Q3CGVMOBJ = $(Q3CGOBJ_:%.o=%.asm) |
2332 | 2381 | |
2333 | ifeq ($(PLATFORM),mingw32) | |
2382 | ifdef MINGW | |
2334 | 2383 | $(B)/$(BASEGAME)/cgame_sp_$(SHLIBNAME): $(Q3CGOBJ) |
2335 | 2384 | $(echo_cmd) "LD $@" |
2336 | 2385 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3CGOBJ) |
2405 | 2454 | Q3GOBJ = $(Q3GOBJ_) $(B)/$(BASEGAME)/game/g_syscalls.o |
2406 | 2455 | Q3GVMOBJ = $(Q3GOBJ_:%.o=%.asm) |
2407 | 2456 | |
2408 | ifeq ($(PLATFORM),mingw32) | |
2457 | ifdef MINGW | |
2409 | 2458 | $(B)/$(BASEGAME)/qagame_sp_$(SHLIBNAME): $(Q3GOBJ) |
2410 | 2459 | $(echo_cmd) "LD $@" |
2411 | 2460 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3GOBJ) |
2439 | 2488 | Q3UIOBJ = $(Q3UIOBJ_) $(B)/$(BASEGAME)/ui/ui_syscalls.o |
2440 | 2489 | Q3UIVMOBJ = $(Q3UIOBJ_:%.o=%.asm) |
2441 | 2490 | |
2442 | ifeq ($(PLATFORM),mingw32) | |
2491 | ifdef MINGW | |
2443 | 2492 | $(B)/$(BASEGAME)/ui_sp_$(SHLIBNAME): $(Q3UIOBJ) |
2444 | 2493 | $(echo_cmd) "LD $@" |
2445 | 2494 | $(Q)$(CC) $(CFLAGS) $(SHLIBLDFLAGS) -o $@ $(Q3UIOBJ) |
2536 | 2585 | $(B)/rend2/%.o: $(R2DIR)/%.c |
2537 | 2586 | $(DO_REF_CC) |
2538 | 2587 | |
2588 | $(B)/renderer/%.o: $(FTDIR)/src/autofit/%.c | |
2589 | $(DO_REF_CC) | |
2590 | ||
2591 | $(B)/renderer/%.o: $(FTDIR)/src/base/%.c | |
2592 | $(DO_REF_CC) | |
2593 | ||
2594 | $(B)/renderer/%.o: $(FTDIR)/src/bdf/%.c | |
2595 | $(DO_REF_CC) | |
2596 | ||
2597 | $(B)/renderer/%.o: $(FTDIR)/src/bzip2/%.c | |
2598 | $(DO_REF_CC) | |
2599 | ||
2600 | $(B)/renderer/%.o: $(FTDIR)/src/cache/%.c | |
2601 | $(DO_REF_CC) | |
2602 | ||
2603 | $(B)/renderer/%.o: $(FTDIR)/src/cff/%.c | |
2604 | $(DO_REF_CC) | |
2605 | ||
2606 | $(B)/renderer/%.o: $(FTDIR)/src/cid/%.c | |
2607 | $(DO_REF_CC) | |
2608 | ||
2609 | $(B)/renderer/%.o: $(FTDIR)/src/gxvalid/%.c | |
2610 | $(DO_REF_CC) | |
2611 | ||
2612 | $(B)/renderer/%.o: $(FTDIR)/src/gzip/%.c | |
2613 | $(DO_REF_CC) | |
2614 | ||
2615 | $(B)/renderer/%.o: $(FTDIR)/src/lzw/%.c | |
2616 | $(DO_REF_CC) | |
2617 | ||
2618 | $(B)/renderer/%.o: $(FTDIR)/src/otvalid/%.c | |
2619 | $(DO_REF_CC) | |
2620 | ||
2621 | $(B)/renderer/%.o: $(FTDIR)/src/pcf/%.c | |
2622 | $(DO_REF_CC) | |
2623 | ||
2624 | $(B)/renderer/%.o: $(FTDIR)/src/pfr/%.c | |
2625 | $(DO_REF_CC) | |
2626 | ||
2627 | $(B)/renderer/%.o: $(FTDIR)/src/psaux/%.c | |
2628 | $(DO_REF_CC) | |
2629 | ||
2630 | $(B)/renderer/%.o: $(FTDIR)/src/pshinter/%.c | |
2631 | $(DO_REF_CC) | |
2632 | ||
2633 | $(B)/renderer/%.o: $(FTDIR)/src/psnames/%.c | |
2634 | $(DO_REF_CC) | |
2635 | ||
2636 | $(B)/renderer/%.o: $(FTDIR)/src/raster/%.c | |
2637 | $(DO_REF_CC) | |
2638 | ||
2639 | $(B)/renderer/%.o: $(FTDIR)/src/sfnt/%.c | |
2640 | $(DO_REF_CC) | |
2641 | ||
2642 | $(B)/renderer/%.o: $(FTDIR)/src/smooth/%.c | |
2643 | $(DO_REF_CC) | |
2644 | ||
2645 | $(B)/renderer/%.o: $(FTDIR)/src/tools/%.c | |
2646 | $(DO_REF_CC) | |
2647 | ||
2648 | $(B)/renderer/%.o: $(FTDIR)/src/truetype/%.c | |
2649 | $(DO_REF_CC) | |
2650 | ||
2651 | $(B)/renderer/%.o: $(FTDIR)/src/type1/%.c | |
2652 | $(DO_REF_CC) | |
2653 | ||
2654 | $(B)/renderer/%.o: $(FTDIR)/src/type42/%.c | |
2655 | $(DO_REF_CC) | |
2656 | ||
2657 | $(B)/renderer/%.o: $(FTDIR)/src/winfonts/%.c | |
2658 | $(DO_REF_CC) | |
2539 | 2659 | |
2540 | 2660 | $(B)/ded/%.o: $(ASMDIR)/%.s |
2541 | 2661 | $(DO_AS) |
2621 | 2741 | # MISC |
2622 | 2742 | ############################################################################# |
2623 | 2743 | |
2624 | OBJ = $(Q3OBJ) $(Q3ROBJ) $(Q3R2OBJ) $(Q3DOBJ) $(JPGOBJ) \ | |
2744 | OBJ = $(Q3OBJ) $(Q3ROBJ) $(Q3R2OBJ) $(Q3DOBJ) $(JPGOBJ) $(FTOBJ) \ | |
2625 | 2745 | $(Q3GOBJ) $(Q3CGOBJ) $(Q3UIOBJ) \ |
2626 | 2746 | $(Q3GVMOBJ) $(Q3CGVMOBJ) $(Q3UIVMOBJ) |
2627 | 2747 | TOOLSOBJ = $(LBURGOBJ) $(Q3CPPOBJ) $(Q3RCCOBJ) $(Q3LCCOBJ) $(Q3ASMOBJ) |
0 | To run iortcw on the Raspberry Pi requires SDL2. | |
0 | To run iortcw on the Raspberry Pi requires SDL2 and at least 128M for GPU memory. | |
1 | ||
2 | (Under Raspbian, you can set the GPU memory using the raspi-config tool under Advanced Options->Memory Split) | |
1 | 3 | |
2 | 4 | SDL2 will need to be built in a particular way to have hardware accelerated |
3 | 5 | graphics. |
18 | 20 | |
19 | 21 | ./configure --disable-video-x11 --disable-video-opengl |
20 | 22 | |
23 | Note: On the newer Raspberry Pi 2 (due to a change in the toolchain naming) use: | |
24 | ||
25 | ./configure --host=armv7l-raspberry-linux-gnueabihf --disable-video-x11 --disable-video-opengl | |
26 | ||
21 | 27 | After that has completed, type: |
22 | 28 | make |
23 | 29 |
34 | 34 | ALIGN 16 |
35 | 35 | ssemask DWORD 0FFFFFFFFh, 0FFFFFFFFh, 0FFFFFFFFh, 00000000h |
36 | 36 | ssecw DWORD 00001F80h |
37 | ||
38 | IFNDEF idx64 | |
39 | fpucw WORD 037Fh | |
40 | ENDIF | |
41 | 37 | |
42 | 38 | .code |
43 | 39 |
897 | 897 | return y; |
898 | 898 | } |
899 | 899 | |
900 | if ( !cgs.clientinfo[clientNum].infoValid ) { | |
901 | cg.attackerTime = 0; | |
902 | return y; | |
903 | } | |
904 | ||
900 | 905 | t = cg.time - cg.attackerTime; |
901 | 906 | if ( t > ATTACKER_HEAD_TIME ) { |
902 | 907 | cg.attackerTime = 0; |
2317 | 2322 | trap_R_DrawStretchPic( x + cg.refdef.x + 0.5 * ( cg.refdef.width - w ), |
2318 | 2323 | y + cg.refdef.y + 0.5 * ( cg.refdef.height - h ), |
2319 | 2324 | w, h, 0, 0, 1, 1, hShader ); |
2325 | ||
2326 | trap_R_SetColor( NULL ); | |
2320 | 2327 | } |
2321 | 2328 | |
2322 | 2329 | /* |
545 | 545 | int CG_WaterLevel(centity_t *cent) { |
546 | 546 | vec3_t point; |
547 | 547 | int contents, sample1, sample2, anim, waterlevel; |
548 | ||
548 | int viewheight; | |
549 | ||
550 | anim = cent->currentState.legsAnim & ~ANIM_TOGGLEBIT; | |
551 | ||
552 | if (anim == LEGS_WALKCR || anim == LEGS_IDLECR) { | |
553 | viewheight = CROUCH_VIEWHEIGHT; | |
554 | } else { | |
555 | viewheight = DEFAULT_VIEWHEIGHT; | |
556 | } | |
557 | ||
558 | // | |
549 | 559 | // get waterlevel, accounting for ducking |
560 | // | |
550 | 561 | waterlevel = 0; |
551 | VectorCopy(cent->lerpOrigin, point); | |
552 | point[2] += MINS_Z + 1; | |
553 | anim = cent->currentState.legsAnim & ~ANIM_TOGGLEBIT; | |
554 | ||
555 | if (anim == LEGS_WALKCR || anim == LEGS_IDLECR) { | |
556 | point[2] += CROUCH_VIEWHEIGHT; | |
557 | } else { | |
558 | point[2] += DEFAULT_VIEWHEIGHT; | |
559 | } | |
560 | ||
562 | ||
563 | point[0] = cent->lerpOrigin[0]; | |
564 | point[1] = cent->lerpOrigin[1]; | |
565 | point[2] = cent->lerpOrigin[2] + MINS_Z + 1; | |
561 | 566 | contents = CG_PointContents(point, -1); |
562 | 567 | |
563 | 568 | if (contents & MASK_WATER) { |
564 | sample2 = point[2] - MINS_Z; | |
569 | sample2 = viewheight - MINS_Z; | |
565 | 570 | sample1 = sample2 / 2; |
566 | 571 | waterlevel = 1; |
567 | 572 | point[2] = cent->lerpOrigin[2] + MINS_Z + sample1; |
701 | 706 | } |
702 | 707 | |
703 | 708 | // play a gurp sound instead of a normal pain sound |
704 | if (CG_WaterLevel(cent) >= 1) { | |
709 | if (CG_WaterLevel(cent) == 3) { | |
705 | 710 | if (rand()&1) { |
706 | 711 | trap_S_StartSound(NULL, cent->currentState.number, CHAN_VOICE, CG_CustomSound(cent->currentState.number, "sound/player/gurp1.wav")); |
707 | 712 | } else { |
2363 | 2368 | case EV_DEATH3: |
2364 | 2369 | DEBUGNAME( "EV_DEATHx" ); |
2365 | 2370 | |
2366 | if (CG_WaterLevel(cent) >= 1) { | |
2371 | if (CG_WaterLevel(cent) == 3) { | |
2367 | 2372 | trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, "sound/player/gurp1.wav")); |
2368 | 2373 | } else { |
2369 | 2374 | trap_S_StartSound(NULL, es->number, CHAN_VOICE, CG_CustomSound(es->number, va("*death%i.wav", event - EV_DEATH1 + 1))); |
1677 | 1677 | extern vmCvar_t cg_ignore; |
1678 | 1678 | extern vmCvar_t cg_simpleItems; |
1679 | 1679 | extern vmCvar_t cg_fov; |
1680 | extern vmCvar_t cg_fixedAspect; | |
1680 | 1681 | extern vmCvar_t cg_zoomFov; |
1681 | 1682 | extern vmCvar_t cg_zoomDefaultBinoc; |
1682 | 1683 | extern vmCvar_t cg_zoomDefaultSniper; |
163 | 163 | vmCvar_t cg_ignore; |
164 | 164 | vmCvar_t cg_simpleItems; |
165 | 165 | vmCvar_t cg_fov; |
166 | vmCvar_t cg_fixedAspect; | |
166 | 167 | vmCvar_t cg_zoomFov; |
167 | 168 | vmCvar_t cg_zoomStepBinoc; |
168 | 169 | vmCvar_t cg_zoomStepSniper; |
294 | 295 | { &cg_zoomStepSnooper, "cg_zoomStepSnooper", "5", CVAR_ARCHIVE }, |
295 | 296 | { &cg_zoomStepFG, "cg_zoomStepFG", "10", CVAR_ARCHIVE }, //----(SA) added |
296 | 297 | { &cg_fov, "cg_fov", "90", CVAR_ARCHIVE }, // NOTE: there is already a dmflag (DF_FIXED_FOV) to allow server control of this cheat |
298 | { &cg_fixedAspect, "cg_fixedAspect", "0", CVAR_ARCHIVE }, // Essentially the same as setting DF_FIXED_FOV for widescreen aspects | |
297 | 299 | { &cg_viewsize, "cg_viewsize", "100", CVAR_ARCHIVE }, |
298 | 300 | { &cg_letterbox, "cg_letterbox", "0", CVAR_TEMP }, //----(SA) added |
299 | 301 | { &cg_shadows, "cg_shadows", "1", CVAR_ARCHIVE }, |
435 | 435 | cgs.teamVoteNo[num - CS_TEAMVOTE_NO] = atoi( str ); |
436 | 436 | cgs.teamVoteModified[num - CS_TEAMVOTE_NO] = qtrue; |
437 | 437 | } else if ( num >= CS_TEAMVOTE_STRING && num <= CS_TEAMVOTE_STRING + 1 ) { |
438 | Q_strncpyz( cgs.teamVoteString[num - CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString ) ); | |
438 | Q_strncpyz( cgs.teamVoteString[num - CS_TEAMVOTE_STRING], str, sizeof( cgs.teamVoteString[0] ) ); | |
439 | 439 | trap_S_StartLocalSound( cgs.media.voteNow, CHAN_ANNOUNCER ); |
440 | 440 | #endif |
441 | 441 | } else if ( num == CS_INTERMISSION ) { |
750 | 750 | #ifdef MISSIONPACK |
751 | 751 | if ( cg_singlePlayerActive.integer ) { |
752 | 752 | trap_Cvar_Set( "ui_matchStartTime", va( "%i", cg.time ) ); |
753 | if ( cg_recordSPDemo.integer && cg_recordSPDemoName.string && *cg_recordSPDemoName.string ) { | |
753 | if ( cg_recordSPDemo.integer && *cg_recordSPDemoName.string ) { | |
754 | 754 | trap_SendConsoleCommand( va( "set g_synchronousclients 1 ; record %s \n", cg_recordSPDemoName.string ) ); |
755 | 755 | } |
756 | 756 | } |
774 | 774 | */ |
775 | 775 | #define WAVE_AMPLITUDE 1 |
776 | 776 | #define WAVE_FREQUENCY 0.4 |
777 | #define STANDARD_ASPECT_RATIO ( (float)640 / (float)480 ) | |
777 | 778 | |
778 | 779 | static int CG_CalcFov( void ) { |
779 | 780 | static float lastfov = 90; // for transitions back from zoomed in modes |
803 | 804 | fov_x = 90; |
804 | 805 | } else { |
805 | 806 | // user selectable |
806 | if ( cgs.dmflags & DF_FIXED_FOV ) { | |
807 | if ( ( cgs.dmflags & DF_FIXED_FOV ) || cg_fixedAspect.value ) { | |
807 | 808 | // dmflag to prevent wide fov for all clients |
808 | 809 | fov_x = 90; |
809 | 810 | } else { |
866 | 867 | fov_x = 55; |
867 | 868 | } |
868 | 869 | |
870 | if ( cg_fixedAspect.value ) { | |
871 | float aspectRatio = (float)cg.refdef.width / (float)cg.refdef.height; | |
872 | ||
873 | if ( aspectRatio > STANDARD_ASPECT_RATIO ) | |
874 | fov_x = RAD2DEG( 2 * atan2( ( aspectRatio / STANDARD_ASPECT_RATIO ) * tan( DEG2RAD( fov_x ) * 0.5 ), 1 ) ); | |
875 | fov_x = min( fov_x, 160 ); | |
876 | } | |
877 | ||
869 | 878 | x = cg.refdef.width / tan( fov_x / 360 * M_PI ); |
870 | 879 | fov_y = atan2( cg.refdef.height, x ); |
871 | 880 | fov_y = fov_y * 360 / M_PI; |
1049 | 1058 | VectorCopy( angles, cg.refdefViewAngles ); |
1050 | 1059 | AnglesToAxis( cg.refdefViewAngles, cg.refdef.viewaxis ); |
1051 | 1060 | |
1061 | if ( cg_fixedAspect.value ) { | |
1062 | float aspectRatio = (float)cg.refdef.width / (float)cg.refdef.height; | |
1063 | ||
1064 | if ( aspectRatio > STANDARD_ASPECT_RATIO ) | |
1065 | fov = RAD2DEG( 2 * atan2( ( aspectRatio / STANDARD_ASPECT_RATIO ) * tan( DEG2RAD( fov ) * 0.5 ), 1 ) ); | |
1066 | fov = min( fov, 160 ); | |
1067 | } | |
1068 | ||
1052 | 1069 | x = cg.refdef.width / tan( fov / 360 * M_PI ); |
1053 | 1070 | cg.refdef.fov_y = atan2( cg.refdef.height, x ); |
1054 | 1071 | cg.refdef.fov_y = cg.refdef.fov_y * 360 / M_PI; |
1298 | 1315 | fov_x = 90; |
1299 | 1316 | } else { |
1300 | 1317 | // user selectable |
1301 | if ( cgs.dmflags & DF_FIXED_FOV ) { | |
1318 | if ( ( cgs.dmflags & DF_FIXED_FOV ) || cg_fixedAspect.value ) { | |
1302 | 1319 | // dmflag to prevent wide fov for all clients |
1303 | 1320 | fov_x = 90; |
1304 | 1321 | } else { |
1353 | 1370 | fov_x = 55; |
1354 | 1371 | } |
1355 | 1372 | |
1373 | if ( cg_fixedAspect.value ) { | |
1374 | float aspectRatio = (float)cg.refdef.width / (float)cg.refdef.height; | |
1375 | ||
1376 | if ( aspectRatio > STANDARD_ASPECT_RATIO ) | |
1377 | fov_x = RAD2DEG( 2 * atan2( ( aspectRatio / STANDARD_ASPECT_RATIO ) * tan( DEG2RAD( fov_x ) * 0.5 ), 1 ) ); | |
1378 | fov_x = min( fov_x, 160 ); | |
1379 | } | |
1380 | ||
1356 | 1381 | x = cg.refdef.width / tan( fov_x / 360 * M_PI ); |
1357 | 1382 | fov_y = atan2( cg.refdef.height, x ); |
1358 | 1383 | fov_y = fov_y * 360 / M_PI; |
2996 | 2996 | |
2997 | 2997 | |
2998 | 2998 | // drop gun lower at higher fov |
2999 | if ( cg_fov.integer > 90 ) { | |
2999 | if ( cg_fov.integer > 90 && !cg_fixedAspect.value ) { | |
3000 | 3000 | fovOffset = -0.2 * ( cg_fov.integer - 90 ); |
3001 | 3001 | } else { |
3002 | 3002 | fovOffset = 0; |
119 | 119 | buffer[ bufIndex + 1 ] = (byte)( ( x >> 8 ) & 0xFF ); |
120 | 120 | bufIndex += 2; |
121 | 121 | } |
122 | ||
123 | /* | |
124 | =============== | |
125 | WRITE_1BYTES | |
126 | =============== | |
127 | */ | |
128 | #if 0 | |
129 | static ID_INLINE void WRITE_1BYTES( int x ) { | |
130 | buffer[ bufIndex ] = x; | |
131 | bufIndex += 1; | |
132 | } | |
133 | #endif | |
134 | 122 | |
135 | 123 | /* |
136 | 124 | =============== |
111 | 111 | qboolean looping, holdAtEnd, dirty, alterGameState, silent, shader, letterBox, sound; |
112 | 112 | fileHandle_t iFile; |
113 | 113 | e_status status; |
114 | unsigned int startTime; | |
115 | unsigned int lastTime; | |
114 | int startTime; | |
115 | int lastTime; | |
116 | 116 | long tfps; |
117 | 117 | long RoQPlayed; |
118 | 118 | long ROQSize; |
165 | 165 | } serverStatus_t; |
166 | 166 | |
167 | 167 | serverStatus_t cl_serverStatusList[MAX_SERVERSTATUSREQUESTS]; |
168 | int serverStatusCount; | |
169 | 168 | |
170 | 169 | #if 0 // MrE defined __USEA3D && defined __A3D_GEOM |
171 | 170 | void hA3Dg_ExportRenderGeom( refexport_t *incoming_re ); |
2335 | 2334 | ================= |
2336 | 2335 | */ |
2337 | 2336 | void CL_CheckForResend( void ) { |
2338 | int port, i; | |
2337 | int port; | |
2339 | 2338 | char info[MAX_INFO_STRING]; |
2340 | char data[MAX_INFO_STRING]; | |
2339 | char data[MAX_INFO_STRING + 10]; | |
2341 | 2340 | |
2342 | 2341 | // don't send anything if playing back a demo |
2343 | 2342 | if ( clc.demoplaying ) { |
2390 | 2389 | Info_SetValueForKey( info, "qport", va( "%i", port ) ); |
2391 | 2390 | Info_SetValueForKey( info, "challenge", va( "%i", clc.challenge ) ); |
2392 | 2391 | |
2393 | strcpy(data, "connect "); | |
2394 | // TTimo adding " " around the userinfo string to avoid truncated userinfo on the server | |
2395 | // (Com_TokenizeString tokenizes around spaces) | |
2396 | data[8] = '"'; | |
2397 | ||
2398 | for(i=0;i<strlen(info);i++) { | |
2399 | data[9+i] = info[i]; // + (clc.challenge)&0x3; | |
2400 | } | |
2401 | data[9+i] = '"'; | |
2402 | data[10+i] = 0; | |
2403 | ||
2404 | // NOTE TTimo don't forget to set the right data length! | |
2405 | NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) &data[0], i+10 ); | |
2392 | Com_sprintf( data, sizeof(data), "connect \"%s\"", info ); | |
2393 | NET_OutOfBandData( NS_CLIENT, clc.serverAddress, (byte *) data, strlen ( data ) ); | |
2406 | 2394 | // the most current userinfo has been sent, so watch for any |
2407 | 2395 | // newer changes to userinfo variables |
2408 | 2396 | cvar_modifiedFlags &= ~CVAR_USERINFO; |
4154 | 4142 | oldestTime = cl_serverStatusList[i].startTime; |
4155 | 4143 | } |
4156 | 4144 | } |
4157 | if ( oldest != -1 ) { | |
4158 | return &cl_serverStatusList[oldest]; | |
4159 | } | |
4160 | serverStatusCount++; | |
4161 | return &cl_serverStatusList[serverStatusCount & ( MAX_SERVERSTATUSREQUESTS - 1 )]; | |
4145 | return &cl_serverStatusList[oldest]; | |
4162 | 4146 | } |
4163 | 4147 | |
4164 | 4148 | /* |
1359 | 1359 | BotAI_Trace( &trace, start, NULL, NULL, end, passent, contents_mask ); |
1360 | 1360 | //if water was hit |
1361 | 1361 | waterfactor = 1.0; |
1362 | //note: trace.contents is always 0, see BotAI_Trace | |
1362 | 1363 | if ( trace.contents & ( CONTENTS_LAVA | CONTENTS_SLIME | CONTENTS_WATER ) ) { |
1363 | 1364 | //if the water surface is translucent |
1364 | 1365 | if ( 1 ) { |
51 | 51 | extern int Q_strncmp ( const char * s1 , const char * s2 , int n ) ; |
52 | 52 | extern int Q_stricmpn ( const char * s1 , const char * s2 , int n ) ; |
53 | 53 | extern void Q_strncpyz ( char * dest , const char * src , int destsize ) ; |
54 | #ifdef _MSC_VER | |
54 | 55 | extern int Q_vsnprintf ( char * str , size_t size , const char * format , va_list ap ) ; |
56 | #endif | |
55 | 57 | extern qboolean Q_isintegral ( float f ) ; |
56 | 58 | extern qboolean Q_isanumber ( const char * s ) ; |
57 | 59 | extern int Q_isforfilename ( int c ) ; |
51 | 51 | {"Q_strncmp", (byte *)Q_strncmp}, |
52 | 52 | {"Q_stricmpn", (byte *)Q_stricmpn}, |
53 | 53 | {"Q_strncpyz", (byte *)Q_strncpyz}, |
54 | #ifdef _MSC_VER | |
54 | 55 | {"Q_vsnprintf", (byte *)Q_vsnprintf}, |
56 | #endif | |
55 | 57 | {"Q_isintegral", (byte *)Q_isintegral}, |
56 | 58 | {"Q_isanumber", (byte *)Q_isanumber}, |
57 | 59 | {"Q_isforfilename", (byte *)Q_isforfilename}, |
883 | 883 | } |
884 | 884 | |
885 | 885 | if ( i == facet->numBorders ) { |
886 | if ( facet->numBorders > 4 + 6 + 16 ) { | |
886 | if ( facet->numBorders >= 4 + 6 + 16 ) { | |
887 | 887 | Com_Printf( "ERROR: too many bevels\n" ); |
888 | continue; | |
888 | 889 | } |
889 | 890 | facet->borderPlanes[facet->numBorders] = CM_FindPlane2( plane, &flipped ); |
890 | 891 | facet->borderNoAdjust[facet->numBorders] = 0; |
953 | 954 | } |
954 | 955 | |
955 | 956 | if ( i == facet->numBorders ) { |
956 | if ( facet->numBorders > 4 + 6 + 16 ) { | |
957 | if ( facet->numBorders >= 4 + 6 + 16 ) { | |
957 | 958 | Com_Printf( "ERROR: too many bevels\n" ); |
959 | continue; | |
958 | 960 | } |
959 | 961 | facet->borderPlanes[facet->numBorders] = CM_FindPlane2( plane, &flipped ); |
960 | 962 | |
993 | 995 | |
994 | 996 | #ifndef BSPC |
995 | 997 | //add opposite plane |
998 | if ( facet->numBorders >= 4 + 6 + 16 ) { | |
999 | Com_Printf( "ERROR: too many bevels\n" ); | |
1000 | return; | |
1001 | } | |
996 | 1002 | facet->borderPlanes[facet->numBorders] = facet->surfacePlane; |
997 | 1003 | facet->borderNoAdjust[facet->numBorders] = 0; |
998 | 1004 | facet->borderInward[facet->numBorders] = qtrue; |
3178 | 3178 | |
3179 | 3179 | Com_Printf( "Com_RandomBytes: using weak randomization\n" ); |
3180 | 3180 | for( i = 0; i < len; i++ ) |
3181 | string[i] = (unsigned char)( rand() % 255 ); | |
3181 | string[i] = (unsigned char)( rand() % 256 ); | |
3182 | 3182 | } |
3183 | 3183 | |
3184 | 3184 |
543 | 543 | |
544 | 544 | // Skip creation of the root directory as it will always be there |
545 | 545 | ofs = strchr( path, PATH_SEP ); |
546 | ofs++; | |
546 | if ( ofs != NULL ) { | |
547 | ofs++; | |
548 | } | |
547 | 549 | |
548 | 550 | for (; ofs != NULL && *ofs ; ofs++) { |
549 | 551 | if (*ofs == PATH_SEP) { |
168 | 168 | |
169 | 169 | //================================================================= LINUX === |
170 | 170 | |
171 | #if defined(__linux__) || defined(__FreeBSD_kernel__) | |
171 | #if defined(__linux__) || defined(__FreeBSD_kernel__) || defined(__GNU__) | |
172 | 172 | |
173 | 173 | #include <endian.h> |
174 | 174 | |
175 | 175 | #if defined(__linux__) |
176 | 176 | #define OS_STRING "linux" |
177 | #else | |
177 | #elif defined(__FreeBSD_kernel__) | |
178 | 178 | #define OS_STRING "kFreeBSD" |
179 | #else | |
180 | #define OS_STRING "GNU" | |
179 | 181 | #endif |
180 | 182 | |
181 | 183 | #define ID_INLINE inline |
204 | 206 | #define ARCH_STRING "sparc" |
205 | 207 | #elif defined __arm__ |
206 | 208 | #define ARCH_STRING "arm" |
209 | #elif defined __aarch64__ | |
210 | #define ARCH_STRING "aarch64" | |
207 | 211 | #elif defined __cris__ |
208 | 212 | #define ARCH_STRING "cris" |
209 | 213 | #elif defined __hppa__ |
1480 | 1480 | *o = 0; |
1481 | 1481 | |
1482 | 1482 | if ( !strcmp( key, pkey ) ) { |
1483 | strcpy( start, s ); // remove this part | |
1483 | memmove(start, s, strlen(s) + 1); // remove this part | |
1484 | 1484 | return; |
1485 | 1485 | } |
1486 | 1486 |
0 | 0 | /* unzip.c -- IO for uncompress .zip files using zlib |
1 | ||
2 | Modified for Quake III Arena to use the Z_Malloc() memory pool; | |
3 | this means a system copy of minizip is not a suitable replacement. | |
4 | ||
5 | Based on minizip: | |
6 | ||
1 | 7 | Version 1.01e, February 12th, 2005 |
2 | 8 | |
3 | 9 | Copyright (C) 1998-2005 Gilles Vollant |
712 | 718 | |
713 | 719 | if (lSeek!=0) |
714 | 720 | { |
715 | if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0) | |
716 | err=UNZ_ERRNO; | |
721 | if (ZSEEK(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)!=0) | |
722 | err=UNZ_ERRNO; | |
717 | 723 | } |
718 | 724 | if ((file_info.size_file_comment>0) && (commentBufferSize>0)) |
719 | 725 | if (ZREAD(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) |
1139 | 1145 | pfile_in_zip_read_info->stream.avail_in = 0; |
1140 | 1146 | |
1141 | 1147 | if (inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS) == Z_OK) |
1142 | pfile_in_zip_read_info->stream_initialised=1; | |
1148 | pfile_in_zip_read_info->stream_initialised=1; | |
1143 | 1149 | else |
1144 | 1150 | { |
1145 | 1151 | TRYFREE(pfile_in_zip_read_info); |
202 | 202 | |
203 | 203 | |
204 | 204 | #define MASK_REG(modrm, mask) \ |
205 | EmitString("81"); \ | |
206 | EmitString((modrm)); \ | |
207 | Emit4((mask)) | |
205 | do { \ | |
206 | EmitString("81"); \ | |
207 | EmitString((modrm)); \ | |
208 | Emit4((mask)); \ | |
209 | } while(0) | |
208 | 210 | |
209 | 211 | // add bl, bytes |
210 | 212 | #define STACK_PUSH(bytes) \ |
211 | EmitString("80 C3"); \ | |
212 | Emit1(bytes) | |
213 | do { \ | |
214 | EmitString("80 C3"); \ | |
215 | Emit1(bytes); \ | |
216 | } while(0) | |
213 | 217 | |
214 | 218 | // sub bl, bytes |
215 | 219 | #define STACK_POP(bytes) \ |
216 | EmitString("80 EB"); \ | |
217 | Emit1(bytes) | |
220 | do { \ | |
221 | EmitString("80 EB"); \ | |
222 | Emit1(bytes); \ | |
223 | } while(0) | |
218 | 224 | |
219 | 225 | static void EmitCommand(ELastCommand command) |
220 | 226 | { |
411 | 417 | |
412 | 418 | if(vm_syscallNum < 0) |
413 | 419 | { |
414 | int *data; | |
420 | int *data, *ret; | |
415 | 421 | #if idx64 |
416 | 422 | int index; |
417 | 423 | intptr_t args[MAX_VMSYSCALL_ARGS]; |
418 | 424 | #endif |
419 | 425 | |
420 | 426 | data = (int *) (savedVM->dataBase + vm_programStack + 4); |
427 | ret = &vm_opStackBase[vm_opStackOfs + 1]; | |
421 | 428 | |
422 | 429 | #if idx64 |
423 | 430 | args[0] = ~vm_syscallNum; |
424 | 431 | for(index = 1; index < ARRAY_LEN(args); index++) |
425 | 432 | args[index] = data[index]; |
426 | 433 | |
427 | vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall(args); | |
434 | *ret = savedVM->systemCall(args); | |
428 | 435 | #else |
429 | 436 | data[0] = ~vm_syscallNum; |
430 | vm_opStackBase[vm_opStackOfs + 1] = savedVM->systemCall((intptr_t *) data); | |
437 | *ret = savedVM->systemCall((intptr_t *) data); | |
431 | 438 | #endif |
432 | 439 | } |
433 | 440 | else |
41 | 41 | uniform mat4 u_ModelViewProjectionMatrix; |
42 | 42 | uniform vec4 u_BaseColor; |
43 | 43 | uniform vec4 u_VertColor; |
44 | ||
45 | #if defined(USE_DEFORM_VERTEXES) || defined(USE_RGBAGEN) | |
46 | uniform vec3 u_FireRiseDir; | |
47 | #endif | |
44 | 48 | |
45 | 49 | #if defined(USE_RGBAGEN) |
46 | 50 | uniform int u_ColorGen; |
49 | 53 | uniform vec3 u_DirectedLight; |
50 | 54 | uniform vec3 u_ModelLightDir; |
51 | 55 | uniform float u_PortalRange; |
56 | uniform float u_ZFadeLowest; | |
57 | uniform float u_ZFadeHighest; | |
52 | 58 | #endif |
53 | 59 | |
54 | 60 | #if defined(USE_VERTEX_ANIMATION) |
67 | 73 | float frequency = u_DeformParams[3]; |
68 | 74 | float spread = u_DeformParams[4]; |
69 | 75 | |
76 | // a negative frequency is for Z deformation based on normal | |
77 | float zDeformScale = 0; | |
78 | if (frequency < 0) | |
79 | { | |
80 | zDeformScale = 1; | |
81 | frequency *= -1; | |
82 | ||
83 | if (frequency > 999) | |
84 | { | |
85 | frequency -= 999; | |
86 | zDeformScale = -1; | |
87 | } | |
88 | } | |
89 | ||
70 | 90 | if (u_DeformGen == DGEN_BULGE) |
71 | 91 | { |
72 | 92 | phase *= st.x; |
102 | 122 | else // if (u_DeformGen == DGEN_BULGE) |
103 | 123 | { |
104 | 124 | func = sin(value); |
125 | } | |
126 | ||
127 | if (zDeformScale != 0) | |
128 | { | |
129 | vec3 dir = u_FireRiseDir * (0.4 + 0.6 * u_FireRiseDir.z); | |
130 | float nDot = dot(dir, normal); | |
131 | float scale = base + func * amplitude; | |
132 | ||
133 | if (nDot * scale > 0) | |
134 | { | |
135 | return pos + dir * nDot * scale * zDeformScale; | |
136 | } | |
137 | ||
138 | return pos; | |
105 | 139 | } |
106 | 140 | |
107 | 141 | return pos + normal * (base + func * amplitude); |
176 | 210 | else if (u_AlphaGen == AGEN_PORTAL) |
177 | 211 | { |
178 | 212 | color.a = clamp(length(viewer) / u_PortalRange, 0.0, 1.0); |
213 | } | |
214 | else if (u_AlphaGen == AGEN_NORMALZFADE) | |
215 | { | |
216 | float nDot = dot(normal, u_FireRiseDir); | |
217 | float halfRange = (u_ZFadeHighest - u_ZFadeLowest) / 2.0; | |
218 | ||
219 | if (nDot < u_ZFadeHighest) { | |
220 | if (nDot > u_ZFadeLowest) { | |
221 | float frac; | |
222 | if (nDot < u_ZFadeLowest + halfRange) { | |
223 | frac = ( nDot - u_ZFadeLowest ) / halfRange; | |
224 | } else { | |
225 | frac = 1.0 - ( nDot - u_ZFadeLowest - halfRange ) / halfRange; | |
226 | } | |
227 | color.a *= clamp(frac, 0.0, 1.0); | |
228 | } else { | |
229 | color.a = 0; | |
230 | } | |
231 | } else { | |
232 | color.a = 0; | |
233 | } | |
179 | 234 | } |
180 | 235 | |
181 | 236 | return color; |
30 | 30 | #else |
31 | 31 | # include <SDL_opengl.h> |
32 | 32 | #endif |
33 | ||
34 | extern void ( APIENTRY * qglActiveTextureARB )( GLenum texture ); | |
35 | extern void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture ); | |
36 | extern void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t ); | |
37 | ||
38 | extern void ( APIENTRY * qglLockArraysEXT )( GLint, GLint ); | |
39 | extern void ( APIENTRY * qglUnlockArraysEXT )( void ); | |
33 | 40 | |
34 | 41 | //=========================================================================== |
35 | 42 | |
77 | 84 | typedef void ( APIENTRY * PFNGLPNTRIANGLESFATIPROC )( GLenum pname, GLfloat param ); |
78 | 85 | #endif |
79 | 86 | |
87 | //----(SA) added | |
88 | extern void ( APIENTRY * qglPNTrianglesiATI )( GLenum pname, GLint param ); | |
89 | extern void ( APIENTRY * qglPNTrianglesfATI )( GLenum pname, GLfloat param ); | |
90 | //----(SA) end | |
91 | ||
80 | 92 | // for NV fog distance |
81 | 93 | #ifndef GL_NV_fog_distance |
82 | 94 | #define GL_FOG_DISTANCE_MODE_NV 0x855A |
101 | 113 | #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF |
102 | 114 | #endif |
103 | 115 | |
116 | ||
104 | 117 | // extensions will be function pointers on all platforms |
105 | ||
106 | extern void ( APIENTRY * qglMultiTexCoord2fARB )( GLenum texture, GLfloat s, GLfloat t ); | |
107 | extern void ( APIENTRY * qglActiveTextureARB )( GLenum texture ); | |
108 | extern void ( APIENTRY * qglClientActiveTextureARB )( GLenum texture ); | |
109 | ||
110 | extern void ( APIENTRY * qglLockArraysEXT )( GLint, GLint ); | |
111 | extern void ( APIENTRY * qglUnlockArraysEXT )( void ); | |
112 | ||
113 | //----(SA) added | |
114 | extern void ( APIENTRY * qglPNTrianglesiATI )( GLenum pname, GLint param ); | |
115 | extern void ( APIENTRY * qglPNTrianglesfATI )( GLenum pname, GLfloat param ); | |
116 | //----(SA) end | |
117 | ||
118 | // GL_EXT_draw_range_elements | |
119 | extern void (APIENTRY * qglDrawRangeElementsEXT) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); | |
120 | ||
121 | // rend2 | |
122 | ||
123 | // GL_EXT_multi_draw_arrays | |
124 | extern void (APIENTRY * qglMultiDrawArraysEXT) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); | |
125 | extern void (APIENTRY * qglMultiDrawElementsEXT) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); | |
126 | ||
127 | // GL_ARB_shading_language_100 | |
128 | #ifndef GL_ARB_shading_language_100 | |
129 | #define GL_ARB_shading_language_100 | |
130 | #define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C | |
131 | #endif | |
132 | ||
133 | // GL_ARB_vertex_program | |
134 | extern void (APIENTRY * qglVertexAttrib4fARB) (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); | |
135 | extern void (APIENTRY * qglVertexAttrib4fvARB) (GLuint, const GLfloat *); | |
136 | extern void (APIENTRY * qglVertexAttribPointerARB) (GLuint index, GLint size, GLenum type, GLboolean normalized, | |
137 | GLsizei stride, const GLvoid * pointer); | |
138 | extern void (APIENTRY * qglEnableVertexAttribArrayARB) (GLuint index); | |
139 | extern void (APIENTRY * qglDisableVertexAttribArrayARB) (GLuint index); | |
140 | ||
141 | // GL_ARB_vertex_buffer_object | |
142 | extern void (APIENTRY * qglBindBufferARB) (GLenum target, GLuint buffer); | |
143 | extern void (APIENTRY * qglDeleteBuffersARB) (GLsizei n, const GLuint * buffers); | |
144 | extern void (APIENTRY * qglGenBuffersARB) (GLsizei n, GLuint * buffers); | |
145 | extern GLboolean(APIENTRY * qglIsBufferARB) (GLuint buffer); | |
146 | extern void (APIENTRY * qglBufferDataARB) (GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); | |
147 | extern void (APIENTRY * qglBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); | |
148 | extern void (APIENTRY * qglGetBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); | |
149 | extern void (APIENTRY * qglGetBufferParameterivARB) (GLenum target, GLenum pname, GLint * params); | |
150 | extern void (APIENTRY * qglGetBufferPointervARB) (GLenum target, GLenum pname, GLvoid * *params); | |
151 | ||
152 | // GL_ARB_shader_objects | |
153 | extern void (APIENTRY * qglDeleteObjectARB) (GLhandleARB obj); | |
154 | extern GLhandleARB(APIENTRY * qglGetHandleARB) (GLenum pname); | |
155 | extern void (APIENTRY * qglDetachObjectARB) (GLhandleARB containerObj, GLhandleARB attachedObj); | |
156 | extern GLhandleARB(APIENTRY * qglCreateShaderObjectARB) (GLenum shaderType); | |
157 | extern void (APIENTRY * qglShaderSourceARB) (GLhandleARB shaderObj, GLsizei count, const GLcharARB * *string, | |
158 | const GLint * length); | |
159 | extern void (APIENTRY * qglCompileShaderARB) (GLhandleARB shaderObj); | |
160 | extern GLhandleARB(APIENTRY * qglCreateProgramObjectARB) (void); | |
161 | extern void (APIENTRY * qglAttachObjectARB) (GLhandleARB containerObj, GLhandleARB obj); | |
162 | extern void (APIENTRY * qglLinkProgramARB) (GLhandleARB programObj); | |
163 | extern void (APIENTRY * qglUseProgramObjectARB) (GLhandleARB programObj); | |
164 | extern void (APIENTRY * qglValidateProgramARB) (GLhandleARB programObj); | |
165 | extern void (APIENTRY * qglUniform1fARB) (GLint location, GLfloat v0); | |
166 | extern void (APIENTRY * qglUniform2fARB) (GLint location, GLfloat v0, GLfloat v1); | |
167 | extern void (APIENTRY * qglUniform3fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); | |
168 | extern void (APIENTRY * qglUniform4fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); | |
169 | extern void (APIENTRY * qglUniform1iARB) (GLint location, GLint v0); | |
170 | extern void (APIENTRY * qglUniform2iARB) (GLint location, GLint v0, GLint v1); | |
171 | extern void (APIENTRY * qglUniform3iARB) (GLint location, GLint v0, GLint v1, GLint v2); | |
172 | extern void (APIENTRY * qglUniform4iARB) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); | |
173 | extern void (APIENTRY * qglUniform1fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
174 | extern void (APIENTRY * qglUniform2fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
175 | extern void (APIENTRY * qglUniform3fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
176 | extern void (APIENTRY * qglUniform4fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
177 | extern void (APIENTRY * qglUniform2ivARB) (GLint location, GLsizei count, const GLint * value); | |
178 | extern void (APIENTRY * qglUniform3ivARB) (GLint location, GLsizei count, const GLint * value); | |
179 | extern void (APIENTRY * qglUniform4ivARB) (GLint location, GLsizei count, const GLint * value); | |
180 | extern void (APIENTRY * qglUniformMatrix2fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
181 | extern void (APIENTRY * qglUniformMatrix3fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
182 | extern void (APIENTRY * qglUniformMatrix4fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
183 | extern void (APIENTRY * qglGetObjectParameterfvARB) (GLhandleARB obj, GLenum pname, GLfloat * params); | |
184 | extern void (APIENTRY * qglGetObjectParameterivARB) (GLhandleARB obj, GLenum pname, GLint * params); | |
185 | extern void (APIENTRY * qglGetInfoLogARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); | |
186 | extern void (APIENTRY * qglGetAttachedObjectsARB) (GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, | |
187 | GLhandleARB * obj); | |
188 | extern GLint(APIENTRY * qglGetUniformLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
189 | extern void (APIENTRY * qglGetActiveUniformARB) (GLhandleARB programObj, GLuint index, GLsizei maxIndex, GLsizei * length, | |
190 | GLint * size, GLenum * type, GLcharARB * name); | |
191 | extern void (APIENTRY * qglGetUniformfvARB) (GLhandleARB programObj, GLint location, GLfloat * params); | |
192 | extern void (APIENTRY * qglGetUniformivARB) (GLhandleARB programObj, GLint location, GLint * params); | |
193 | extern void (APIENTRY * qglGetShaderSourceARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); | |
194 | ||
195 | // GL_ARB_vertex_shader | |
196 | extern void (APIENTRY * qglBindAttribLocationARB) (GLhandleARB programObj, GLuint index, const GLcharARB * name); | |
197 | extern void (APIENTRY * qglGetActiveAttribARB) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, | |
198 | GLint * size, GLenum * type, GLcharARB * name); | |
199 | extern GLint(APIENTRY * qglGetAttribLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
200 | ||
201 | // GL_ARB_texture_compression | |
202 | extern void (APIENTRY * qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
203 | GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); | |
204 | extern void (APIENTRY * qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
205 | GLint border, GLsizei imageSize, const GLvoid *data); | |
206 | extern void (APIENTRY * qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, | |
207 | GLsizei imageSize, const GLvoid *data); | |
208 | extern void (APIENTRY * qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | |
209 | GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); | |
210 | extern void (APIENTRY * qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, | |
211 | GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); | |
212 | extern void (APIENTRY * qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, | |
213 | GLsizei imageSize, const GLvoid *data); | |
214 | extern void (APIENTRY * qglGetCompressedTexImageARB)(GLenum target, GLint lod, | |
215 | GLvoid *img); | |
216 | ||
217 | // GL_NVX_gpu_memory_info | |
218 | #ifndef GL_NVX_gpu_memory_info | |
219 | #define GL_NVX_gpu_memory_info | |
220 | #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 | |
221 | #define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 | |
222 | #define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 | |
223 | #define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A | |
224 | #define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B | |
225 | #endif | |
226 | ||
227 | // GL_ATI_meminfo | |
228 | #ifndef GL_ATI_meminfo | |
229 | #define GL_ATI_meminfo | |
230 | #define GL_VBO_FREE_MEMORY_ATI 0x87FB | |
231 | #define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC | |
232 | #define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD | |
233 | #endif | |
234 | ||
235 | // GL_ARB_texture_float | |
236 | #ifndef GL_ARB_texture_float | |
237 | #define GL_ARB_texture_float | |
238 | #define GL_TEXTURE_RED_TYPE_ARB 0x8C10 | |
239 | #define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 | |
240 | #define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 | |
241 | #define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 | |
242 | #define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 | |
243 | #define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 | |
244 | #define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 | |
245 | #define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 | |
246 | #define GL_RGBA32F_ARB 0x8814 | |
247 | #define GL_RGB32F_ARB 0x8815 | |
248 | #define GL_ALPHA32F_ARB 0x8816 | |
249 | #define GL_INTENSITY32F_ARB 0x8817 | |
250 | #define GL_LUMINANCE32F_ARB 0x8818 | |
251 | #define GL_LUMINANCE_ALPHA32F_ARB 0x8819 | |
252 | #define GL_RGBA16F_ARB 0x881A | |
253 | #define GL_RGB16F_ARB 0x881B | |
254 | #define GL_ALPHA16F_ARB 0x881C | |
255 | #define GL_INTENSITY16F_ARB 0x881D | |
256 | #define GL_LUMINANCE16F_ARB 0x881E | |
257 | #define GL_LUMINANCE_ALPHA16F_ARB 0x881F | |
258 | #endif | |
259 | ||
260 | #ifndef GL_ARB_half_float_pixel | |
261 | #define GL_ARB_half_float_pixel | |
262 | #define GL_HALF_FLOAT_ARB 0x140B | |
263 | #endif | |
264 | ||
265 | // GL_EXT_framebuffer_object | |
266 | extern GLboolean (APIENTRY * qglIsRenderbufferEXT)(GLuint renderbuffer); | |
267 | extern void (APIENTRY * qglBindRenderbufferEXT)(GLenum target, GLuint renderbuffer); | |
268 | extern void (APIENTRY * qglDeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers); | |
269 | extern void (APIENTRY * qglGenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers); | |
270 | extern void (APIENTRY * qglRenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); | |
271 | extern void (APIENTRY * qglGetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params); | |
272 | extern GLboolean (APIENTRY * qglIsFramebufferEXT)(GLuint framebuffer); | |
273 | extern void (APIENTRY * qglBindFramebufferEXT)(GLenum target, GLuint framebuffer); | |
274 | extern void (APIENTRY * qglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers); | |
275 | extern void (APIENTRY * qglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers); | |
276 | extern GLenum (APIENTRY * qglCheckFramebufferStatusEXT)(GLenum target); | |
277 | extern void (APIENTRY * qglFramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
278 | GLint level); | |
279 | extern void (APIENTRY * qglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
280 | GLint level); | |
281 | extern void (APIENTRY * qglFramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
282 | GLint level, GLint zoffset); | |
283 | extern void (APIENTRY * qglFramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, | |
284 | GLuint renderbuffer); | |
285 | extern void (APIENTRY * qglGetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params); | |
286 | extern void (APIENTRY * qglGenerateMipmapEXT)(GLenum target); | |
287 | ||
288 | #ifndef GL_EXT_framebuffer_object | |
289 | #define GL_EXT_framebuffer_object | |
290 | #define GL_FRAMEBUFFER_EXT 0x8D40 | |
291 | #define GL_RENDERBUFFER_EXT 0x8D41 | |
292 | #define GL_STENCIL_INDEX1_EXT 0x8D46 | |
293 | #define GL_STENCIL_INDEX4_EXT 0x8D47 | |
294 | #define GL_STENCIL_INDEX8_EXT 0x8D48 | |
295 | #define GL_STENCIL_INDEX16_EXT 0x8D49 | |
296 | #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 | |
297 | #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 | |
298 | #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 | |
299 | #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 | |
300 | #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 | |
301 | #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 | |
302 | #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 | |
303 | #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 | |
304 | #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 | |
305 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 | |
306 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 | |
307 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 | |
308 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 | |
309 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 | |
310 | #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 | |
311 | #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 | |
312 | #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 | |
313 | #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 | |
314 | #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 | |
315 | #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 | |
316 | #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 | |
317 | #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 | |
318 | #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 | |
319 | #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 | |
320 | #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA | |
321 | #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB | |
322 | #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC | |
323 | #define GL_COLOR_ATTACHMENT13_EXT 0x8CED | |
324 | #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE | |
325 | #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF | |
326 | #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 | |
327 | #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 | |
328 | #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 | |
329 | #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 | |
330 | #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 | |
331 | #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 | |
332 | #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA | |
333 | #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB | |
334 | #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC | |
335 | #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD | |
336 | #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
337 | #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 | |
338 | #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF | |
339 | #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 | |
340 | #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 | |
341 | #endif | |
342 | ||
343 | // GL_EXT_packed_depth_stencil | |
344 | #ifndef GL_EXT_packed_depth_stencil | |
345 | #define GL_EXT_packed_depth_stencil | |
346 | #define GL_DEPTH_STENCIL_EXT 0x84F9 | |
347 | #define GL_UNSIGNED_INT_24_8_EXT 0x84FA | |
348 | #define GL_DEPTH24_STENCIL8_EXT 0x88F0 | |
349 | #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 | |
350 | #endif | |
351 | ||
352 | // GL_ARB_occlusion_query | |
353 | extern void (APIENTRY * qglGenQueriesARB)(GLsizei n, GLuint *ids); | |
354 | extern void (APIENTRY * qglDeleteQueriesARB)(GLsizei n, const GLuint *ids); | |
355 | extern GLboolean (APIENTRY * qglIsQueryARB)(GLuint id); | |
356 | extern void (APIENTRY * qglBeginQueryARB)(GLenum target, GLuint id); | |
357 | extern void (APIENTRY * qglEndQueryARB)(GLenum target); | |
358 | extern void (APIENTRY * qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params); | |
359 | extern void (APIENTRY * qglGetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params); | |
360 | extern void (APIENTRY * qglGetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params); | |
361 | ||
362 | #ifndef GL_ARB_occlusion_query | |
363 | #define GL_ARB_occlusion_query | |
364 | #define GL_SAMPLES_PASSED_ARB 0x8914 | |
365 | #define GL_QUERY_COUNTER_BITS_ARB 0x8864 | |
366 | #define GL_CURRENT_QUERY_ARB 0x8865 | |
367 | #define GL_QUERY_RESULT_ARB 0x8866 | |
368 | #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 | |
369 | #endif | |
370 | ||
371 | // GL_EXT_framebuffer_blit | |
372 | extern void (APIENTRY * qglBlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | |
373 | GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | |
374 | GLbitfield mask, GLenum filter); | |
375 | ||
376 | #ifndef GL_EXT_framebuffer_blit | |
377 | #define GL_EXT_framebuffer_blit | |
378 | #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 | |
379 | #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 | |
380 | #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
381 | #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA | |
382 | #endif | |
383 | ||
384 | // GL_EXT_framebuffer_multisample | |
385 | extern void (APIENTRY * qglRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, | |
386 | GLenum internalformat, GLsizei width, GLsizei height); | |
387 | ||
388 | #ifndef GL_EXT_framebuffer_multisample | |
389 | #define GL_EXT_framebuffer_multisample | |
390 | #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB | |
391 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 | |
392 | #define GL_MAX_SAMPLES_EXT 0x8D57 | |
393 | #endif | |
394 | ||
395 | #ifndef GL_EXT_texture_sRGB | |
396 | #define GL_EXT_texture_sRGB | |
397 | #define GL_SRGB_EXT 0x8C40 | |
398 | #define GL_SRGB8_EXT 0x8C41 | |
399 | #define GL_SRGB_ALPHA_EXT 0x8C42 | |
400 | #define GL_SRGB8_ALPHA8_EXT 0x8C43 | |
401 | #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 | |
402 | #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 | |
403 | #define GL_SLUMINANCE_EXT 0x8C46 | |
404 | #define GL_SLUMINANCE8_EXT 0x8C47 | |
405 | #define GL_COMPRESSED_SRGB_EXT 0x8C48 | |
406 | #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 | |
407 | #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A | |
408 | #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B | |
409 | #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C | |
410 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D | |
411 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E | |
412 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F | |
413 | #endif | |
414 | ||
415 | #ifndef GL_EXT_framebuffer_sRGB | |
416 | #define GL_EXT_framebuffer_sRGB | |
417 | #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 | |
418 | #endif | |
419 | ||
420 | #ifndef GL_EXT_texture_compression_latc | |
421 | #define GL_EXT_texture_compression_latc | |
422 | #define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 | |
423 | #define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 | |
424 | #define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 | |
425 | #define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 | |
426 | #endif | |
427 | ||
428 | #ifndef GL_ARB_texture_compression_bptc | |
429 | #define GL_ARB_texture_compression_bptc | |
430 | #define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C | |
431 | #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D | |
432 | #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E | |
433 | #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F | |
434 | #endif | |
435 | ||
436 | // GL_ARB_draw_buffers | |
437 | extern void (APIENTRY * qglDrawBuffersARB)(GLsizei n, const GLenum *bufs); | |
438 | #ifndef GL_ARB_draw_buffers | |
439 | #define GL_ARB_draw_buffers | |
440 | #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 | |
441 | #define GL_DRAW_BUFFER0_ARB 0x8825 | |
442 | #define GL_DRAW_BUFFER1_ARB 0x8826 | |
443 | #define GL_DRAW_BUFFER2_ARB 0x8827 | |
444 | #define GL_DRAW_BUFFER3_ARB 0x8828 | |
445 | #define GL_DRAW_BUFFER4_ARB 0x8829 | |
446 | #define GL_DRAW_BUFFER5_ARB 0x882A | |
447 | #define GL_DRAW_BUFFER6_ARB 0x882B | |
448 | #define GL_DRAW_BUFFER7_ARB 0x882C | |
449 | #define GL_DRAW_BUFFER8_ARB 0x882D | |
450 | #define GL_DRAW_BUFFER9_ARB 0x882E | |
451 | #define GL_DRAW_BUFFER10_ARB 0x882F | |
452 | #define GL_DRAW_BUFFER11_ARB 0x8830 | |
453 | #define GL_DRAW_BUFFER12_ARB 0x8831 | |
454 | #define GL_DRAW_BUFFER13_ARB 0x8832 | |
455 | #define GL_DRAW_BUFFER14_ARB 0x8833 | |
456 | #define GL_DRAW_BUFFER15_ARB 0x8834 | |
457 | #endif | |
458 | ||
459 | #ifndef GL_ARB_depth_clamp | |
460 | #define GL_ARB_depth_clamp | |
461 | #define GL_DEPTH_CLAMP 0x864F | |
462 | #endif | |
463 | ||
464 | #ifndef GL_ARB_seamless_cube_map | |
465 | #define GL_ARB_seamless_cube_map | |
466 | #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F | |
467 | #endif | |
468 | ||
469 | // GL_ARB_vertex_array_object | |
470 | extern void (APIENTRY * qglBindVertexArrayARB)(GLuint array); | |
471 | extern void (APIENTRY * qglDeleteVertexArraysARB)(GLsizei n, const GLuint *arrays); | |
472 | extern void (APIENTRY * qglGenVertexArraysARB)(GLsizei n, GLuint *arrays); | |
473 | extern GLboolean (APIENTRY * qglIsVertexArrayARB)(GLuint array); | |
474 | #ifndef GL_ARB_vertex_array_object | |
475 | #define GL_ARB_vertex_array_object | |
476 | #define GL_VERTEX_ARRAY_BINDING_ARB 0x85B5 | |
477 | #endif | |
478 | ||
479 | #if defined(WIN32) | |
480 | // WGL_ARB_create_context | |
481 | #ifndef WGL_ARB_create_context | |
482 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
483 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
484 | #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 | |
485 | #define WGL_CONTEXT_FLAGS_ARB 0x2094 | |
486 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 | |
487 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 | |
488 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 | |
489 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 | |
490 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 | |
491 | #define ERROR_INVALID_VERSION_ARB 0x2095 | |
492 | #define ERROR_INVALID_PROFILE_ARB 0x2096 | |
493 | #endif | |
494 | ||
495 | extern HGLRC(APIENTRY * qwglCreateContextAttribsARB) (HDC hdC, HGLRC hShareContext, const int *attribList); | |
496 | #endif | |
497 | ||
498 | #if 0 //defined(__linux__) | |
499 | // GLX_ARB_create_context | |
500 | #ifndef GLX_ARB_create_context | |
501 | #define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 | |
502 | #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 | |
503 | #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
504 | #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
505 | #define GLX_CONTEXT_FLAGS_ARB 0x2094 | |
506 | #endif | |
507 | ||
508 | extern GLXContext (APIENTRY * qglXCreateContextAttribsARB) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); | |
509 | #endif | |
510 | ||
511 | 118 | //=========================================================================== |
512 | 119 | |
513 | 120 | #define qglAccum glAccum |
845 | 452 | #define qglVertexPointer glVertexPointer |
846 | 453 | #define qglViewport glViewport |
847 | 454 | |
848 | #endif | |
455 | // GL_EXT_draw_range_elements | |
456 | extern void (APIENTRY * qglDrawRangeElementsEXT) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); | |
457 | ||
458 | // GL_EXT_multi_draw_arrays | |
459 | extern void (APIENTRY * qglMultiDrawArraysEXT) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); | |
460 | extern void (APIENTRY * qglMultiDrawElementsEXT) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); | |
461 | ||
462 | // rend2 | |
463 | ||
464 | // GL_ARB_shading_language_100 | |
465 | #ifndef GL_ARB_shading_language_100 | |
466 | #define GL_ARB_shading_language_100 | |
467 | #define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C | |
468 | #endif | |
469 | ||
470 | // GL_ARB_vertex_program | |
471 | extern void (APIENTRY * qglVertexAttrib4fARB) (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); | |
472 | extern void (APIENTRY * qglVertexAttrib4fvARB) (GLuint, const GLfloat *); | |
473 | extern void (APIENTRY * qglVertexAttribPointerARB) (GLuint index, GLint size, GLenum type, GLboolean normalized, | |
474 | GLsizei stride, const GLvoid * pointer); | |
475 | extern void (APIENTRY * qglEnableVertexAttribArrayARB) (GLuint index); | |
476 | extern void (APIENTRY * qglDisableVertexAttribArrayARB) (GLuint index); | |
477 | ||
478 | // GL_ARB_vertex_buffer_object | |
479 | extern void (APIENTRY * qglBindBufferARB) (GLenum target, GLuint buffer); | |
480 | extern void (APIENTRY * qglDeleteBuffersARB) (GLsizei n, const GLuint * buffers); | |
481 | extern void (APIENTRY * qglGenBuffersARB) (GLsizei n, GLuint * buffers); | |
482 | extern GLboolean(APIENTRY * qglIsBufferARB) (GLuint buffer); | |
483 | extern void (APIENTRY * qglBufferDataARB) (GLenum target, GLsizeiptrARB size, const GLvoid * data, GLenum usage); | |
484 | extern void (APIENTRY * qglBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid * data); | |
485 | extern void (APIENTRY * qglGetBufferSubDataARB) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid * data); | |
486 | extern void (APIENTRY * qglGetBufferParameterivARB) (GLenum target, GLenum pname, GLint * params); | |
487 | extern void (APIENTRY * qglGetBufferPointervARB) (GLenum target, GLenum pname, GLvoid * *params); | |
488 | ||
489 | // GL_ARB_shader_objects | |
490 | extern void (APIENTRY * qglDeleteObjectARB) (GLhandleARB obj); | |
491 | extern GLhandleARB(APIENTRY * qglGetHandleARB) (GLenum pname); | |
492 | extern void (APIENTRY * qglDetachObjectARB) (GLhandleARB containerObj, GLhandleARB attachedObj); | |
493 | extern GLhandleARB(APIENTRY * qglCreateShaderObjectARB) (GLenum shaderType); | |
494 | extern void (APIENTRY * qglShaderSourceARB) (GLhandleARB shaderObj, GLsizei count, const GLcharARB * *string, | |
495 | const GLint * length); | |
496 | extern void (APIENTRY * qglCompileShaderARB) (GLhandleARB shaderObj); | |
497 | extern GLhandleARB(APIENTRY * qglCreateProgramObjectARB) (void); | |
498 | extern void (APIENTRY * qglAttachObjectARB) (GLhandleARB containerObj, GLhandleARB obj); | |
499 | extern void (APIENTRY * qglLinkProgramARB) (GLhandleARB programObj); | |
500 | extern void (APIENTRY * qglUseProgramObjectARB) (GLhandleARB programObj); | |
501 | extern void (APIENTRY * qglValidateProgramARB) (GLhandleARB programObj); | |
502 | extern void (APIENTRY * qglUniform1fARB) (GLint location, GLfloat v0); | |
503 | extern void (APIENTRY * qglUniform2fARB) (GLint location, GLfloat v0, GLfloat v1); | |
504 | extern void (APIENTRY * qglUniform3fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); | |
505 | extern void (APIENTRY * qglUniform4fARB) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); | |
506 | extern void (APIENTRY * qglUniform1iARB) (GLint location, GLint v0); | |
507 | extern void (APIENTRY * qglUniform2iARB) (GLint location, GLint v0, GLint v1); | |
508 | extern void (APIENTRY * qglUniform3iARB) (GLint location, GLint v0, GLint v1, GLint v2); | |
509 | extern void (APIENTRY * qglUniform4iARB) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); | |
510 | extern void (APIENTRY * qglUniform1fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
511 | extern void (APIENTRY * qglUniform2fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
512 | extern void (APIENTRY * qglUniform3fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
513 | extern void (APIENTRY * qglUniform4fvARB) (GLint location, GLsizei count, const GLfloat * value); | |
514 | extern void (APIENTRY * qglUniform2ivARB) (GLint location, GLsizei count, const GLint * value); | |
515 | extern void (APIENTRY * qglUniform3ivARB) (GLint location, GLsizei count, const GLint * value); | |
516 | extern void (APIENTRY * qglUniform4ivARB) (GLint location, GLsizei count, const GLint * value); | |
517 | extern void (APIENTRY * qglUniformMatrix2fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
518 | extern void (APIENTRY * qglUniformMatrix3fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
519 | extern void (APIENTRY * qglUniformMatrix4fvARB) (GLint location, GLsizei count, GLboolean transpose, const GLfloat * value); | |
520 | extern void (APIENTRY * qglGetObjectParameterfvARB) (GLhandleARB obj, GLenum pname, GLfloat * params); | |
521 | extern void (APIENTRY * qglGetObjectParameterivARB) (GLhandleARB obj, GLenum pname, GLint * params); | |
522 | extern void (APIENTRY * qglGetInfoLogARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog); | |
523 | extern void (APIENTRY * qglGetAttachedObjectsARB) (GLhandleARB containerObj, GLsizei maxCount, GLsizei * count, | |
524 | GLhandleARB * obj); | |
525 | extern GLint(APIENTRY * qglGetUniformLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
526 | extern void (APIENTRY * qglGetActiveUniformARB) (GLhandleARB programObj, GLuint index, GLsizei maxIndex, GLsizei * length, | |
527 | GLint * size, GLenum * type, GLcharARB * name); | |
528 | extern void (APIENTRY * qglGetUniformfvARB) (GLhandleARB programObj, GLint location, GLfloat * params); | |
529 | extern void (APIENTRY * qglGetUniformivARB) (GLhandleARB programObj, GLint location, GLint * params); | |
530 | extern void (APIENTRY * qglGetShaderSourceARB) (GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * source); | |
531 | ||
532 | // GL_ARB_vertex_shader | |
533 | extern void (APIENTRY * qglBindAttribLocationARB) (GLhandleARB programObj, GLuint index, const GLcharARB * name); | |
534 | extern void (APIENTRY * qglGetActiveAttribARB) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei * length, | |
535 | GLint * size, GLenum * type, GLcharARB * name); | |
536 | extern GLint(APIENTRY * qglGetAttribLocationARB) (GLhandleARB programObj, const GLcharARB * name); | |
537 | ||
538 | // GL_ARB_texture_compression | |
539 | extern void (APIENTRY * qglCompressedTexImage3DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
540 | GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); | |
541 | extern void (APIENTRY * qglCompressedTexImage2DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, | |
542 | GLint border, GLsizei imageSize, const GLvoid *data); | |
543 | extern void (APIENTRY * qglCompressedTexImage1DARB)(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, | |
544 | GLsizei imageSize, const GLvoid *data); | |
545 | extern void (APIENTRY * qglCompressedTexSubImage3DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, | |
546 | GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); | |
547 | extern void (APIENTRY * qglCompressedTexSubImage2DARB)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, | |
548 | GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); | |
549 | extern void (APIENTRY * qglCompressedTexSubImage1DARB)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, | |
550 | GLsizei imageSize, const GLvoid *data); | |
551 | extern void (APIENTRY * qglGetCompressedTexImageARB)(GLenum target, GLint lod, | |
552 | GLvoid *img); | |
553 | ||
554 | // GL_NVX_gpu_memory_info | |
555 | #ifndef GL_NVX_gpu_memory_info | |
556 | #define GL_NVX_gpu_memory_info | |
557 | #define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 | |
558 | #define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 | |
559 | #define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 | |
560 | #define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A | |
561 | #define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B | |
562 | #endif | |
563 | ||
564 | // GL_ATI_meminfo | |
565 | #ifndef GL_ATI_meminfo | |
566 | #define GL_ATI_meminfo | |
567 | #define GL_VBO_FREE_MEMORY_ATI 0x87FB | |
568 | #define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC | |
569 | #define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD | |
570 | #endif | |
571 | ||
572 | // GL_ARB_texture_float | |
573 | #ifndef GL_ARB_texture_float | |
574 | #define GL_ARB_texture_float | |
575 | #define GL_TEXTURE_RED_TYPE_ARB 0x8C10 | |
576 | #define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 | |
577 | #define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 | |
578 | #define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 | |
579 | #define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 | |
580 | #define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 | |
581 | #define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 | |
582 | #define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 | |
583 | #define GL_RGBA32F_ARB 0x8814 | |
584 | #define GL_RGB32F_ARB 0x8815 | |
585 | #define GL_ALPHA32F_ARB 0x8816 | |
586 | #define GL_INTENSITY32F_ARB 0x8817 | |
587 | #define GL_LUMINANCE32F_ARB 0x8818 | |
588 | #define GL_LUMINANCE_ALPHA32F_ARB 0x8819 | |
589 | #define GL_RGBA16F_ARB 0x881A | |
590 | #define GL_RGB16F_ARB 0x881B | |
591 | #define GL_ALPHA16F_ARB 0x881C | |
592 | #define GL_INTENSITY16F_ARB 0x881D | |
593 | #define GL_LUMINANCE16F_ARB 0x881E | |
594 | #define GL_LUMINANCE_ALPHA16F_ARB 0x881F | |
595 | #endif | |
596 | ||
597 | #ifndef GL_ARB_half_float_pixel | |
598 | #define GL_ARB_half_float_pixel | |
599 | #define GL_HALF_FLOAT_ARB 0x140B | |
600 | #endif | |
601 | ||
602 | // GL_EXT_framebuffer_object | |
603 | extern GLboolean (APIENTRY * qglIsRenderbufferEXT)(GLuint renderbuffer); | |
604 | extern void (APIENTRY * qglBindRenderbufferEXT)(GLenum target, GLuint renderbuffer); | |
605 | extern void (APIENTRY * qglDeleteRenderbuffersEXT)(GLsizei n, const GLuint *renderbuffers); | |
606 | extern void (APIENTRY * qglGenRenderbuffersEXT)(GLsizei n, GLuint *renderbuffers); | |
607 | extern void (APIENTRY * qglRenderbufferStorageEXT)(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); | |
608 | extern void (APIENTRY * qglGetRenderbufferParameterivEXT)(GLenum target, GLenum pname, GLint *params); | |
609 | extern GLboolean (APIENTRY * qglIsFramebufferEXT)(GLuint framebuffer); | |
610 | extern void (APIENTRY * qglBindFramebufferEXT)(GLenum target, GLuint framebuffer); | |
611 | extern void (APIENTRY * qglDeleteFramebuffersEXT)(GLsizei n, const GLuint *framebuffers); | |
612 | extern void (APIENTRY * qglGenFramebuffersEXT)(GLsizei n, GLuint *framebuffers); | |
613 | extern GLenum (APIENTRY * qglCheckFramebufferStatusEXT)(GLenum target); | |
614 | extern void (APIENTRY * qglFramebufferTexture1DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
615 | GLint level); | |
616 | extern void (APIENTRY * qglFramebufferTexture2DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
617 | GLint level); | |
618 | extern void (APIENTRY * qglFramebufferTexture3DEXT)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, | |
619 | GLint level, GLint zoffset); | |
620 | extern void (APIENTRY * qglFramebufferRenderbufferEXT)(GLenum target, GLenum attachment, GLenum renderbuffertarget, | |
621 | GLuint renderbuffer); | |
622 | extern void (APIENTRY * qglGetFramebufferAttachmentParameterivEXT)(GLenum target, GLenum attachment, GLenum pname, GLint *params); | |
623 | extern void (APIENTRY * qglGenerateMipmapEXT)(GLenum target); | |
624 | ||
625 | #ifndef GL_EXT_framebuffer_object | |
626 | #define GL_EXT_framebuffer_object | |
627 | #define GL_FRAMEBUFFER_EXT 0x8D40 | |
628 | #define GL_RENDERBUFFER_EXT 0x8D41 | |
629 | #define GL_STENCIL_INDEX1_EXT 0x8D46 | |
630 | #define GL_STENCIL_INDEX4_EXT 0x8D47 | |
631 | #define GL_STENCIL_INDEX8_EXT 0x8D48 | |
632 | #define GL_STENCIL_INDEX16_EXT 0x8D49 | |
633 | #define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 | |
634 | #define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 | |
635 | #define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 | |
636 | #define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 | |
637 | #define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 | |
638 | #define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 | |
639 | #define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 | |
640 | #define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 | |
641 | #define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 | |
642 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 | |
643 | #define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 | |
644 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 | |
645 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 | |
646 | #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 | |
647 | #define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 | |
648 | #define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 | |
649 | #define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 | |
650 | #define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 | |
651 | #define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 | |
652 | #define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 | |
653 | #define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 | |
654 | #define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 | |
655 | #define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 | |
656 | #define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 | |
657 | #define GL_COLOR_ATTACHMENT10_EXT 0x8CEA | |
658 | #define GL_COLOR_ATTACHMENT11_EXT 0x8CEB | |
659 | #define GL_COLOR_ATTACHMENT12_EXT 0x8CEC | |
660 | #define GL_COLOR_ATTACHMENT13_EXT 0x8CED | |
661 | #define GL_COLOR_ATTACHMENT14_EXT 0x8CEE | |
662 | #define GL_COLOR_ATTACHMENT15_EXT 0x8CEF | |
663 | #define GL_DEPTH_ATTACHMENT_EXT 0x8D00 | |
664 | #define GL_STENCIL_ATTACHMENT_EXT 0x8D20 | |
665 | #define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 | |
666 | #define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 | |
667 | #define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 | |
668 | #define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 | |
669 | #define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA | |
670 | #define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB | |
671 | #define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC | |
672 | #define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD | |
673 | #define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
674 | #define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 | |
675 | #define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF | |
676 | #define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 | |
677 | #define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 | |
678 | #endif | |
679 | ||
680 | // GL_EXT_packed_depth_stencil | |
681 | #ifndef GL_EXT_packed_depth_stencil | |
682 | #define GL_EXT_packed_depth_stencil | |
683 | #define GL_DEPTH_STENCIL_EXT 0x84F9 | |
684 | #define GL_UNSIGNED_INT_24_8_EXT 0x84FA | |
685 | #define GL_DEPTH24_STENCIL8_EXT 0x88F0 | |
686 | #define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 | |
687 | #endif | |
688 | ||
689 | // GL_ARB_occlusion_query | |
690 | extern void (APIENTRY * qglGenQueriesARB)(GLsizei n, GLuint *ids); | |
691 | extern void (APIENTRY * qglDeleteQueriesARB)(GLsizei n, const GLuint *ids); | |
692 | extern GLboolean (APIENTRY * qglIsQueryARB)(GLuint id); | |
693 | extern void (APIENTRY * qglBeginQueryARB)(GLenum target, GLuint id); | |
694 | extern void (APIENTRY * qglEndQueryARB)(GLenum target); | |
695 | extern void (APIENTRY * qglGetQueryivARB)(GLenum target, GLenum pname, GLint *params); | |
696 | extern void (APIENTRY * qglGetQueryObjectivARB)(GLuint id, GLenum pname, GLint *params); | |
697 | extern void (APIENTRY * qglGetQueryObjectuivARB)(GLuint id, GLenum pname, GLuint *params); | |
698 | ||
699 | #ifndef GL_ARB_occlusion_query | |
700 | #define GL_ARB_occlusion_query | |
701 | #define GL_SAMPLES_PASSED_ARB 0x8914 | |
702 | #define GL_QUERY_COUNTER_BITS_ARB 0x8864 | |
703 | #define GL_CURRENT_QUERY_ARB 0x8865 | |
704 | #define GL_QUERY_RESULT_ARB 0x8866 | |
705 | #define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 | |
706 | #endif | |
707 | ||
708 | // GL_EXT_framebuffer_blit | |
709 | extern void (APIENTRY * qglBlitFramebufferEXT)(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, | |
710 | GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, | |
711 | GLbitfield mask, GLenum filter); | |
712 | ||
713 | #ifndef GL_EXT_framebuffer_blit | |
714 | #define GL_EXT_framebuffer_blit | |
715 | #define GL_READ_FRAMEBUFFER_EXT 0x8CA8 | |
716 | #define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 | |
717 | #define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 | |
718 | #define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA | |
719 | #endif | |
720 | ||
721 | // GL_EXT_framebuffer_multisample | |
722 | extern void (APIENTRY * qglRenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, | |
723 | GLenum internalformat, GLsizei width, GLsizei height); | |
724 | ||
725 | #ifndef GL_EXT_framebuffer_multisample | |
726 | #define GL_EXT_framebuffer_multisample | |
727 | #define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB | |
728 | #define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 | |
729 | #define GL_MAX_SAMPLES_EXT 0x8D57 | |
730 | #endif | |
731 | ||
732 | #ifndef GL_EXT_texture_sRGB | |
733 | #define GL_EXT_texture_sRGB | |
734 | #define GL_SRGB_EXT 0x8C40 | |
735 | #define GL_SRGB8_EXT 0x8C41 | |
736 | #define GL_SRGB_ALPHA_EXT 0x8C42 | |
737 | #define GL_SRGB8_ALPHA8_EXT 0x8C43 | |
738 | #define GL_SLUMINANCE_ALPHA_EXT 0x8C44 | |
739 | #define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 | |
740 | #define GL_SLUMINANCE_EXT 0x8C46 | |
741 | #define GL_SLUMINANCE8_EXT 0x8C47 | |
742 | #define GL_COMPRESSED_SRGB_EXT 0x8C48 | |
743 | #define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 | |
744 | #define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A | |
745 | #define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B | |
746 | #define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C | |
747 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D | |
748 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E | |
749 | #define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F | |
750 | #endif | |
751 | ||
752 | #ifndef GL_EXT_framebuffer_sRGB | |
753 | #define GL_EXT_framebuffer_sRGB | |
754 | #define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 | |
755 | #endif | |
756 | ||
757 | #ifndef GL_EXT_texture_compression_latc | |
758 | #define GL_EXT_texture_compression_latc | |
759 | #define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 | |
760 | #define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 | |
761 | #define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 | |
762 | #define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 | |
763 | #endif | |
764 | ||
765 | #ifndef GL_ARB_texture_compression_bptc | |
766 | #define GL_ARB_texture_compression_bptc | |
767 | #define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C | |
768 | #define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D | |
769 | #define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E | |
770 | #define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F | |
771 | #endif | |
772 | ||
773 | // GL_ARB_draw_buffers | |
774 | extern void (APIENTRY * qglDrawBuffersARB)(GLsizei n, const GLenum *bufs); | |
775 | #ifndef GL_ARB_draw_buffers | |
776 | #define GL_ARB_draw_buffers | |
777 | #define GL_MAX_DRAW_BUFFERS_ARB 0x8824 | |
778 | #define GL_DRAW_BUFFER0_ARB 0x8825 | |
779 | #define GL_DRAW_BUFFER1_ARB 0x8826 | |
780 | #define GL_DRAW_BUFFER2_ARB 0x8827 | |
781 | #define GL_DRAW_BUFFER3_ARB 0x8828 | |
782 | #define GL_DRAW_BUFFER4_ARB 0x8829 | |
783 | #define GL_DRAW_BUFFER5_ARB 0x882A | |
784 | #define GL_DRAW_BUFFER6_ARB 0x882B | |
785 | #define GL_DRAW_BUFFER7_ARB 0x882C | |
786 | #define GL_DRAW_BUFFER8_ARB 0x882D | |
787 | #define GL_DRAW_BUFFER9_ARB 0x882E | |
788 | #define GL_DRAW_BUFFER10_ARB 0x882F | |
789 | #define GL_DRAW_BUFFER11_ARB 0x8830 | |
790 | #define GL_DRAW_BUFFER12_ARB 0x8831 | |
791 | #define GL_DRAW_BUFFER13_ARB 0x8832 | |
792 | #define GL_DRAW_BUFFER14_ARB 0x8833 | |
793 | #define GL_DRAW_BUFFER15_ARB 0x8834 | |
794 | #endif | |
795 | ||
796 | #ifndef GL_ARB_depth_clamp | |
797 | #define GL_ARB_depth_clamp | |
798 | #define GL_DEPTH_CLAMP 0x864F | |
799 | #endif | |
800 | ||
801 | #ifndef GL_ARB_seamless_cube_map | |
802 | #define GL_ARB_seamless_cube_map | |
803 | #define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F | |
804 | #endif | |
805 | ||
806 | // GL_ARB_vertex_array_object | |
807 | extern void (APIENTRY * qglBindVertexArrayARB)(GLuint array); | |
808 | extern void (APIENTRY * qglDeleteVertexArraysARB)(GLsizei n, const GLuint *arrays); | |
809 | extern void (APIENTRY * qglGenVertexArraysARB)(GLsizei n, GLuint *arrays); | |
810 | extern GLboolean (APIENTRY * qglIsVertexArrayARB)(GLuint array); | |
811 | #ifndef GL_ARB_vertex_array_object | |
812 | #define GL_ARB_vertex_array_object | |
813 | #define GL_VERTEX_ARRAY_BINDING_ARB 0x85B5 | |
814 | #endif | |
815 | ||
816 | #if defined(WIN32) | |
817 | // WGL_ARB_create_context | |
818 | #ifndef WGL_ARB_create_context | |
819 | #define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
820 | #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
821 | #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 | |
822 | #define WGL_CONTEXT_FLAGS_ARB 0x2094 | |
823 | #define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 | |
824 | #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 | |
825 | #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 | |
826 | #define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 | |
827 | #define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 | |
828 | #define ERROR_INVALID_VERSION_ARB 0x2095 | |
829 | #define ERROR_INVALID_PROFILE_ARB 0x2096 | |
830 | #endif | |
831 | ||
832 | extern HGLRC(APIENTRY * qwglCreateContextAttribsARB) (HDC hdC, HGLRC hShareContext, const int *attribList); | |
833 | #endif | |
834 | ||
835 | #if 0 //defined(__linux__) | |
836 | // GLX_ARB_create_context | |
837 | #ifndef GLX_ARB_create_context | |
838 | #define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001 | |
839 | #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002 | |
840 | #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 | |
841 | #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 | |
842 | #define GLX_CONTEXT_FLAGS_ARB 0x2094 | |
843 | #endif | |
844 | ||
845 | extern GLXContext (APIENTRY * qglXCreateContextAttribsARB) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); | |
846 | #endif | |
847 | ||
848 | #endif // __QGL_H__ |
1104 | 1104 | render_count = surface->numVerts; |
1105 | 1105 | } |
1106 | 1106 | |
1107 | RB_CheckOverflow( render_count, surface->numTriangles ); | |
1108 | ||
1109 | 1107 | //DBG_SHOWTIME |
1110 | 1108 | |
1111 | 1109 | // |
1112 | 1110 | // setup triangle list |
1113 | 1111 | // |
1114 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1112 | RB_CHECKOVERFLOW( render_count, surface->numTriangles * 3 ); | |
1115 | 1113 | |
1116 | 1114 | //DBG_SHOWTIME |
1117 | 1115 | |
1681 | 1679 | oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + |
1682 | 1680 | backEnd.currentEntity->e.oldframe * frameSize ); |
1683 | 1681 | |
1684 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1682 | RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); | |
1685 | 1683 | |
1686 | 1684 | triangles = (int *) ((byte *)surface + surface->ofsTriangles); |
1687 | 1685 | indexes = surface->numTriangles * 3; |
224 | 224 | |
225 | 225 | f32.f = in; |
226 | 226 | |
227 | f16.pack.exponent = CLAMP(f32.pack.exponent - 112, 0, 31); | |
227 | f16.pack.exponent = CLAMP((int)(f32.pack.exponent) - 112, 0, 31); | |
228 | 228 | f16.pack.fraction = f32.pack.fraction >> 13; |
229 | 229 | f16.pack.sign = f32.pack.sign; |
230 | 230 |
46 | 46 | // an error occured |
47 | 47 | switch (code) |
48 | 48 | { |
49 | case GL_FRAMEBUFFER_COMPLETE_EXT: | |
50 | break; | |
51 | ||
52 | 49 | case GL_FRAMEBUFFER_UNSUPPORTED_EXT: |
53 | 50 | ri.Printf(PRINT_WARNING, "R_CheckFBO: (%s) Unsupported framebuffer format\n", fbo->name); |
54 | 51 | break; |
99 | 99 | |
100 | 100 | #ifdef BUILD_FREETYPE |
101 | 101 | void R_GetGlyphInfo( FT_GlyphSlot glyph, int *left, int *right, int *width, int *top, int *bottom, int *height, int *pitch ) { |
102 | ||
103 | 102 | *left = _FLOOR( glyph->metrics.horiBearingX ); |
104 | 103 | *right = _CEIL( glyph->metrics.horiBearingX + glyph->metrics.width ); |
105 | 104 | *width = _TRUNC( *right - *left ); |
112 | 111 | |
113 | 112 | |
114 | 113 | FT_Bitmap *R_RenderGlyph( FT_GlyphSlot glyph, glyphInfo_t* glyphOut ) { |
115 | ||
116 | 114 | FT_Bitmap *bit2; |
117 | 115 | int left, right, width, top, bottom, height, pitch, size; |
118 | 116 | |
250 | 248 | ri.Free( bitmap ); |
251 | 249 | return &glyph; |
252 | 250 | } |
253 | ||
254 | 251 | |
255 | 252 | src = bitmap->buffer; |
256 | 253 | dst = imageOut + ( *yOut * 256 ) + *xOut; |
279 | 276 | |
280 | 277 | src += glyph.pitch; |
281 | 278 | dst += 256; |
282 | ||
283 | 279 | } |
284 | 280 | } else { |
285 | 281 | for ( i = 0; i < glyph.height; i++ ) { |
286 | memcpy( dst, src, glyph.pitch ); | |
282 | Com_Memcpy( dst, src, glyph.pitch ); | |
287 | 283 | src += glyph.pitch; |
288 | 284 | dst += 256; |
289 | 285 | } |
310 | 306 | #endif |
311 | 307 | |
312 | 308 | static int fdOffset; |
313 | static byte *fdFile; | |
309 | static byte *fdFile; | |
314 | 310 | |
315 | 311 | int readInt( void ) { |
316 | 312 | int i = fdFile[fdOffset] + ( fdFile[fdOffset + 1] << 8 ) + ( fdFile[fdOffset + 2] << 16 ) + ( fdFile[fdOffset + 3] << 24 ); |
319 | 315 | } |
320 | 316 | |
321 | 317 | typedef union { |
322 | byte fred[4]; | |
323 | float ffred; | |
318 | byte fred[4]; | |
319 | float ffred; | |
324 | 320 | } poor; |
325 | 321 | |
326 | 322 | float readFloat( void ) { |
376 | 372 | Com_sprintf( name, sizeof( name ), "fonts/fontImage_%i.dat",pointSize ); |
377 | 373 | for ( i = 0; i < registeredFontCount; i++ ) { |
378 | 374 | if ( Q_stricmp( name, registeredFont[i].name ) == 0 ) { |
379 | memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
375 | Com_Memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
380 | 376 | return; |
381 | 377 | } |
382 | 378 | } |
403 | 399 | fdOffset += sizeof(font->glyphs[i].shaderName); |
404 | 400 | } |
405 | 401 | font->glyphScale = readFloat(); |
406 | memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
407 | ||
408 | // memcpy(font, faceData, sizeof(fontInfo_t)); | |
402 | Com_Memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
403 | ||
404 | // Com_Memcpy(font, faceData, sizeof(fontInfo_t)); | |
409 | 405 | Q_strncpyz( font->name, name, sizeof( font->name ) ); |
410 | 406 | for ( i = GLYPH_START; i <= GLYPH_END; i++ ) { |
411 | 407 | font->glyphs[i].glyph = RE_RegisterShaderNoMip( font->glyphs[i].shaderName ); |
412 | 408 | } |
413 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
409 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
414 | 410 | ri.FS_FreeFile(faceData); |
415 | 411 | return; |
416 | 412 | } |
456 | 452 | maxHeight = 0; |
457 | 453 | |
458 | 454 | for ( i = GLYPH_START; i <= GLYPH_END; i++ ) { |
459 | glyph = RE_ConstructGlyphInfo( out, &xOut, &yOut, &maxHeight, face, (unsigned char)i, qtrue ); | |
455 | RE_ConstructGlyphInfo( out, &xOut, &yOut, &maxHeight, face, (unsigned char)i, qtrue ); | |
460 | 456 | } |
461 | 457 | |
462 | 458 | xOut = 0; |
508 | 504 | } |
509 | 505 | |
510 | 506 | //Com_sprintf (name, sizeof(name), "fonts/fontImage_%i_%i", imageNumber++, pointSize); |
511 | image = R_CreateImage(name, imageBuff, 256, 256, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 ); | |
507 | image = R_CreateImage( name, imageBuff, 256, 256, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 ); | |
512 | 508 | h = RE_RegisterShaderFromImage( name, LIGHTMAP_2D, image, qfalse ); |
513 | 509 | for ( j = lastStart; j < i; j++ ) { |
514 | 510 | font->glyphs[j].glyph = h; |
522 | 518 | if ( i == GLYPH_END + 1 ) |
523 | 519 | i++; |
524 | 520 | } else { |
525 | memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
521 | Com_Memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
526 | 522 | i++; |
527 | 523 | } |
528 | 524 | } |
535 | 531 | |
536 | 532 | registeredFont[registeredFontCount].glyphScale = glyphScale; |
537 | 533 | font->glyphScale = glyphScale; |
538 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
534 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
539 | 535 | |
540 | 536 | if ( r_saveFontData->integer ) { |
541 | 537 | ri.FS_WriteFile( va( "fonts/fontImage_%i.dat", pointSize ), font, sizeof( fontInfo_t ) ); |
145 | 145 | { "u_PrimaryLightRadius", GLSL_FLOAT }, |
146 | 146 | |
147 | 147 | { "u_CubeMapInfo", GLSL_VEC4 }, |
148 | ||
149 | { "u_FireRiseDir", GLSL_VEC3 }, | |
150 | { "u_ZFadeLowest", GLSL_FLOAT }, | |
151 | { "u_ZFadeHighest", GLSL_FLOAT }, | |
148 | 152 | }; |
149 | 153 | |
150 | 154 | |
301 | 305 | "#define alphaGen_t\n" |
302 | 306 | "#define AGEN_LIGHTING_SPECULAR %i\n" |
303 | 307 | "#define AGEN_PORTAL %i\n" |
308 | "#define AGEN_NORMALZFADE %i\n" | |
304 | 309 | "#endif\n", |
305 | 310 | AGEN_LIGHTING_SPECULAR, |
306 | AGEN_PORTAL)); | |
311 | AGEN_PORTAL, | |
312 | AGEN_NORMALZFADE)); | |
307 | 313 | |
308 | 314 | Q_strcat(dest, size, |
309 | 315 | va("#ifndef texenv_t\n" |
1527 | 1533 | { |
1528 | 1534 | case AGEN_LIGHTING_SPECULAR: |
1529 | 1535 | case AGEN_PORTAL: |
1536 | case AGEN_NORMALZFADE: | |
1530 | 1537 | shaderAttribs |= GENERICDEF_USE_RGBAGEN; |
1531 | 1538 | break; |
1532 | 1539 | default: |
2904 | 2904 | { |
2905 | 2905 | for( x = 0; x < MAX_DLIGHTS; x++) |
2906 | 2906 | { |
2907 | tr.shadowCubemaps[x] = R_CreateImage(va("*shadowcubemap%i", x), (byte *)data, DEFAULT_SIZE, DEFAULT_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE | IMGFLAG_CUBEMAP, 0); | |
2907 | tr.shadowCubemaps[x] = R_CreateImage(va("*shadowcubemap%i", x), NULL, PSHADOW_MAP_SIZE, PSHADOW_MAP_SIZE, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE | IMGFLAG_CUBEMAP, 0); | |
2908 | 2908 | } |
2909 | 2909 | } |
2910 | 2910 | |
3399 | 3399 | skin->numSurfaces = 0; |
3400 | 3400 | skin->numModels = 0; //----(SA) added |
3401 | 3401 | skin->numSurfaces = 1; |
3402 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( skin->surfaces[0] ), h_low ); | |
3402 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
3403 | 3403 | skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue ); |
3404 | 3404 | return hSkin; |
3405 | 3405 | } |
3512 | 3512 | skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low ); |
3513 | 3513 | Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) ); |
3514 | 3514 | skin->numSurfaces = 1; |
3515 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces ), h_low ); | |
3515 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
3516 | 3516 | skin->surfaces[0]->shader = tr.defaultShader; |
3517 | 3517 | } |
3518 | 3518 |
170 | 170 | frac[i] = v - pos[i]; |
171 | 171 | if ( pos[i] < 0 ) { |
172 | 172 | pos[i] = 0; |
173 | } else if ( pos[i] >= world->lightGridBounds[i] - 1 ) { | |
173 | } else if ( pos[i] > world->lightGridBounds[i] - 1 ) { | |
174 | 174 | pos[i] = world->lightGridBounds[i] - 1; |
175 | 175 | } |
176 | 176 | } |
194 | 194 | byte *data; |
195 | 195 | int lat, lng; |
196 | 196 | vec3_t normal; |
197 | qboolean ignore; | |
198 | 197 | |
199 | 198 | factor = 1.0; |
200 | 199 | data = gridData; |
201 | ignore = qfalse; | |
202 | 200 | for ( j = 0 ; j < 3 ; j++ ) { |
203 | 201 | if ( i & ( 1 << j ) ) { |
204 | if ((pos[j] + 1) >= world->lightGridBounds[j] - 1) | |
205 | { | |
206 | ignore = qtrue; // ignore values outside lightgrid | |
202 | if ( pos[j] + 1 > world->lightGridBounds[j] - 1 ) { | |
203 | break; // ignore values outside lightgrid | |
207 | 204 | } |
208 | 205 | factor *= frac[j]; |
209 | 206 | data += gridStep[j]; |
212 | 209 | } |
213 | 210 | } |
214 | 211 | |
215 | if ( ignore ) | |
212 | if ( j != 3 ) | |
216 | 213 | continue; |
217 | 214 | |
218 | 215 | if (world->hdrLightGrid) |
782 | 782 | UNIFORM_PRIMARYLIGHTRADIUS, |
783 | 783 | |
784 | 784 | UNIFORM_CUBEMAPINFO, |
785 | ||
786 | UNIFORM_FIRERISEDIR, | |
787 | UNIFORM_ZFADELOWEST, | |
788 | UNIFORM_ZFADEHIGHEST, | |
785 | 789 | |
786 | 790 | UNIFORM_COUNT |
787 | 791 | } uniform_t; |
1972 | 1972 | fog_t *fog; |
1973 | 1973 | |
1974 | 1974 | if ( tr.refdef.rdflags & RDF_NOWORLDMODEL ) { |
1975 | return 0; | |
1976 | } | |
1977 | ||
1978 | if ( ent->e.renderfx & RF_CROSSHAIR ) { | |
1975 | 1979 | return 0; |
1976 | 1980 | } |
1977 | 1981 |
411 | 411 | { |
412 | 412 | GLSL_SetUniformFloat5(sp, UNIFORM_DEFORMPARAMS, deformParams); |
413 | 413 | GLSL_SetUniformFloat(sp, UNIFORM_TIME, tess.shaderTime); |
414 | ||
415 | if (tess.shader->deforms[0].deformationWave.frequency < 0) | |
416 | { | |
417 | vec3_t worldUp; | |
418 | ||
419 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
420 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
421 | } | |
422 | ||
423 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
424 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
425 | } else { | |
426 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
427 | } | |
428 | ||
429 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
430 | } | |
414 | 431 | } |
415 | 432 | |
416 | 433 | vector[0] = dl->color[0]; |
595 | 612 | vertColor[3] = 0.0f; |
596 | 613 | break; |
597 | 614 | case AGEN_NORMALZFADE: |
615 | baseColor[3] = pStage->constantColor[3] / 255.0f; | |
616 | if (backEnd.currentEntity && backEnd.currentEntity->e.hModel) | |
617 | { | |
618 | baseColor[3] *= ((unsigned char *)backEnd.currentEntity->e.shaderRGBA)[3] / 255.0f; | |
619 | } | |
620 | vertColor[3] = 0.0f; | |
621 | break; | |
598 | 622 | case AGEN_VERTEX: |
599 | 623 | baseColor[3] = 0.0f; |
600 | 624 | vertColor[3] = 1.0f; |
790 | 814 | |
791 | 815 | GLSL_SetUniformFloat(sp, UNIFORM_VERTEXLERP, glState.vertexAttribsInterpolation); |
792 | 816 | |
817 | if ((deformGen != DGEN_NONE && tess.shader->deforms[0].deformationWave.frequency < 0 ) | |
818 | || pStage->alphaGen == AGEN_NORMALZFADE) | |
819 | { | |
820 | vec3_t worldUp; | |
821 | ||
822 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
823 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
824 | } | |
825 | ||
826 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
827 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
828 | } else { | |
829 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
830 | } | |
831 | ||
832 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
833 | } | |
834 | ||
793 | 835 | GLSL_SetUniformInt(sp, UNIFORM_DEFORMGEN, deformGen); |
794 | 836 | if (deformGen != DGEN_NONE) |
795 | 837 | { |
822 | 864 | if (pStage->alphaGen == AGEN_PORTAL) |
823 | 865 | { |
824 | 866 | GLSL_SetUniformFloat(sp, UNIFORM_PORTALRANGE, tess.shader->portalRange); |
867 | } | |
868 | else if (pStage->alphaGen == AGEN_NORMALZFADE) | |
869 | { | |
870 | float lowest, highest; | |
871 | //qboolean zombieEffect = qfalse; | |
872 | ||
873 | lowest = pStage->zFadeBounds[0]; | |
874 | if ( lowest == -1000 ) { // use entity alpha | |
875 | lowest = backEnd.currentEntity->e.shaderTime; | |
876 | //zombieEffect = qtrue; | |
877 | } | |
878 | highest = pStage->zFadeBounds[1]; | |
879 | if ( highest == -1000 ) { // use entity alpha | |
880 | highest = backEnd.currentEntity->e.shaderTime; | |
881 | //zombieEffect = qtrue; | |
882 | } | |
883 | ||
884 | // TODO: Handle normalzfade zombie effect | |
885 | ||
886 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADELOWEST, lowest); | |
887 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADEHIGHEST, highest); | |
825 | 888 | } |
826 | 889 | |
827 | 890 | GLSL_SetUniformInt(sp, UNIFORM_COLORGEN, pStage->rgbGen); |
1080 | 1143 | { |
1081 | 1144 | GLSL_SetUniformFloat5(sp, UNIFORM_DEFORMPARAMS, deformParams); |
1082 | 1145 | GLSL_SetUniformFloat(sp, UNIFORM_TIME, tess.shaderTime); |
1146 | ||
1147 | if (tess.shader->deforms[0].deformationWave.frequency < 0) | |
1148 | { | |
1149 | vec3_t worldUp; | |
1150 | ||
1151 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
1152 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
1153 | } | |
1154 | ||
1155 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
1156 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
1157 | } else { | |
1158 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
1159 | } | |
1160 | ||
1161 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
1162 | } | |
1083 | 1163 | } |
1084 | 1164 | |
1085 | 1165 | if (wolfFog) |
1266 | 1346 | GLSL_SetUniformVec3(sp, UNIFORM_LOCALVIEWORIGIN, backEnd.or.viewOrigin); |
1267 | 1347 | |
1268 | 1348 | GLSL_SetUniformFloat(sp, UNIFORM_VERTEXLERP, glState.vertexAttribsInterpolation); |
1349 | ||
1350 | if ((deformGen != DGEN_NONE && tess.shader->deforms[0].deformationWave.frequency < 0 ) | |
1351 | || pStage->alphaGen == AGEN_NORMALZFADE) | |
1352 | { | |
1353 | vec3_t worldUp; | |
1354 | ||
1355 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
1356 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
1357 | } | |
1358 | ||
1359 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
1360 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
1361 | } else { | |
1362 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
1363 | } | |
1364 | ||
1365 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
1366 | } | |
1269 | 1367 | |
1270 | 1368 | GLSL_SetUniformInt(sp, UNIFORM_DEFORMGEN, deformGen); |
1271 | 1369 | if (deformGen != DGEN_NONE) |
1337 | 1435 | if (pStage->alphaGen == AGEN_PORTAL) |
1338 | 1436 | { |
1339 | 1437 | GLSL_SetUniformFloat(sp, UNIFORM_PORTALRANGE, tess.shader->portalRange); |
1438 | } | |
1439 | else if (pStage->alphaGen == AGEN_NORMALZFADE) | |
1440 | { | |
1441 | float lowest, highest; | |
1442 | //qboolean zombieEffect = qfalse; | |
1443 | ||
1444 | lowest = pStage->zFadeBounds[0]; | |
1445 | if ( lowest == -1000 ) { // use entity alpha | |
1446 | lowest = backEnd.currentEntity->e.shaderTime; | |
1447 | //zombieEffect = qtrue; | |
1448 | } | |
1449 | highest = pStage->zFadeBounds[1]; | |
1450 | if ( highest == -1000 ) { // use entity alpha | |
1451 | highest = backEnd.currentEntity->e.shaderTime; | |
1452 | //zombieEffect = qtrue; | |
1453 | } | |
1454 | ||
1455 | // TODO: Handle normalzfade zombie effect | |
1456 | ||
1457 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADELOWEST, lowest); | |
1458 | GLSL_SetUniformFloat(sp, UNIFORM_ZFADEHIGHEST, highest); | |
1340 | 1459 | } |
1341 | 1460 | |
1342 | 1461 | GLSL_SetUniformInt(sp, UNIFORM_COLORGEN, pStage->rgbGen); |
1552 | 1671 | { |
1553 | 1672 | GLSL_SetUniformFloat5(sp, UNIFORM_DEFORMPARAMS, deformParams); |
1554 | 1673 | GLSL_SetUniformFloat(sp, UNIFORM_TIME, tess.shaderTime); |
1674 | ||
1675 | if (tess.shader->deforms[0].deformationWave.frequency < 0) | |
1676 | { | |
1677 | vec3_t worldUp; | |
1678 | ||
1679 | if ( VectorCompare( backEnd.currentEntity->e.fireRiseDir, vec3_origin ) ) { | |
1680 | VectorSet( backEnd.currentEntity->e.fireRiseDir, 0, 0, 1 ); | |
1681 | } | |
1682 | ||
1683 | if ( backEnd.currentEntity->e.hModel ) { // world surfaces dont have an axis | |
1684 | VectorRotate( backEnd.currentEntity->e.fireRiseDir, backEnd.currentEntity->e.axis, worldUp ); | |
1685 | } else { | |
1686 | VectorCopy( backEnd.currentEntity->e.fireRiseDir, worldUp ); | |
1687 | } | |
1688 | ||
1689 | GLSL_SetUniformVec3(sp, UNIFORM_FIRERISEDIR, worldUp); | |
1690 | } | |
1555 | 1691 | } |
1556 | 1692 | |
1557 | 1693 | VectorCopy(backEnd.viewParms.or.origin, vector); |
1811 | 1811 | return qfalse; |
1812 | 1812 | } |
1813 | 1813 | |
1814 | if ( r_greyscale->integer ) | |
1815 | { | |
1816 | float luminance; | |
1817 | ||
1818 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1819 | VectorSet( shader.fogParms.color, luminance, luminance, luminance ); | |
1820 | } | |
1821 | else if ( r_greyscale->value ) | |
1822 | { | |
1823 | float luminance; | |
1824 | ||
1825 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1826 | shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value ); | |
1827 | shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value ); | |
1828 | shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value ); | |
1829 | } | |
1830 | ||
1814 | 1831 | token = COM_ParseExt( text, qfalse ); |
1815 | 1832 | if ( !token[0] ) { |
1816 | 1833 | ri.Printf( PRINT_WARNING, "WARNING: missing parm for 'fogParms' keyword in shader '%s'\n", shader.name ); |
2383 | 2400 | { |
2384 | 2401 | case AGEN_LIGHTING_SPECULAR: |
2385 | 2402 | case AGEN_PORTAL: |
2403 | case AGEN_NORMALZFADE: | |
2386 | 2404 | skip = qtrue; |
2387 | 2405 | break; |
2388 | 2406 | default: |
454 | 454 | int clip; |
455 | 455 | model_t *pModel; |
456 | 456 | int i; |
457 | int fognum; | |
457 | 458 | |
458 | 459 | pModel = R_GetModelByHandle( ent->e.hModel ); |
459 | 460 | |
467 | 468 | R_SetupEntityLighting( &tr.refdef, ent ); |
468 | 469 | R_DlightBmodel( bmodel ); |
469 | 470 | |
471 | //----(SA) modified | |
472 | // determine if in fog | |
473 | fognum = R_BmodelFogNum( ent, bmodel ); | |
474 | ||
470 | 475 | for ( i = 0 ; i < bmodel->numSurfaces ; i++ ) { |
471 | 476 | int surf = bmodel->firstSurface + i; |
472 | 477 | |
473 | 478 | if (tr.world->surfacesViewCount[surf] != tr.viewCount) |
474 | 479 | { |
475 | 480 | tr.world->surfacesViewCount[surf] = tr.viewCount; |
481 | tr.world->surfaces[surf].fogIndex = fognum; | |
476 | 482 | R_AddWorldSurface( tr.world->surfaces + surf, tr.currentEntity->needDlights, 0 ); |
477 | 483 | } |
478 | 484 | } |
485 | //----(SA) end | |
479 | 486 | } |
480 | 487 | |
481 | 488 | /* |
1105 | 1105 | render_count = surface->numVerts; |
1106 | 1106 | } |
1107 | 1107 | |
1108 | RB_CheckOverflow( render_count, surface->numTriangles ); | |
1109 | ||
1110 | 1108 | //DBG_SHOWTIME |
1111 | 1109 | |
1112 | 1110 | // |
1113 | 1111 | // setup triangle list |
1114 | 1112 | // |
1115 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1113 | RB_CHECKOVERFLOW( render_count, surface->numTriangles * 3 ); | |
1116 | 1114 | |
1117 | 1115 | //DBG_SHOWTIME |
1118 | 1116 | |
1677 | 1675 | oldFrame = (mdrFrame_t *)((byte *)header + header->ofsFrames + |
1678 | 1676 | backEnd.currentEntity->e.oldframe * frameSize ); |
1679 | 1677 | |
1680 | RB_CheckOverflow( surface->numVerts, surface->numTriangles * 3 ); | |
1678 | RB_CHECKOVERFLOW( surface->numVerts, surface->numTriangles * 3 ); | |
1681 | 1679 | |
1682 | 1680 | triangles = (int *) ((byte *)surface + surface->ofsTriangles); |
1683 | 1681 | indexes = surface->numTriangles * 3; |
99 | 99 | |
100 | 100 | #ifdef BUILD_FREETYPE |
101 | 101 | void R_GetGlyphInfo( FT_GlyphSlot glyph, int *left, int *right, int *width, int *top, int *bottom, int *height, int *pitch ) { |
102 | ||
103 | 102 | *left = _FLOOR( glyph->metrics.horiBearingX ); |
104 | 103 | *right = _CEIL( glyph->metrics.horiBearingX + glyph->metrics.width ); |
105 | 104 | *width = _TRUNC( *right - *left ); |
112 | 111 | |
113 | 112 | |
114 | 113 | FT_Bitmap *R_RenderGlyph( FT_GlyphSlot glyph, glyphInfo_t* glyphOut ) { |
115 | ||
116 | 114 | FT_Bitmap *bit2; |
117 | 115 | int left, right, width, top, bottom, height, pitch, size; |
118 | 116 | |
250 | 248 | ri.Free( bitmap ); |
251 | 249 | return &glyph; |
252 | 250 | } |
253 | ||
254 | 251 | |
255 | 252 | src = bitmap->buffer; |
256 | 253 | dst = imageOut + ( *yOut * 256 ) + *xOut; |
279 | 276 | |
280 | 277 | src += glyph.pitch; |
281 | 278 | dst += 256; |
282 | ||
283 | 279 | } |
284 | 280 | } else { |
285 | 281 | for ( i = 0; i < glyph.height; i++ ) { |
286 | memcpy( dst, src, glyph.pitch ); | |
282 | Com_Memcpy( dst, src, glyph.pitch ); | |
287 | 283 | src += glyph.pitch; |
288 | 284 | dst += 256; |
289 | 285 | } |
310 | 306 | #endif |
311 | 307 | |
312 | 308 | static int fdOffset; |
313 | static byte *fdFile; | |
309 | static byte *fdFile; | |
314 | 310 | |
315 | 311 | int readInt( void ) { |
316 | 312 | int i = fdFile[fdOffset] + ( fdFile[fdOffset + 1] << 8 ) + ( fdFile[fdOffset + 2] << 16 ) + ( fdFile[fdOffset + 3] << 24 ); |
319 | 315 | } |
320 | 316 | |
321 | 317 | typedef union { |
322 | byte fred[4]; | |
323 | float ffred; | |
318 | byte fred[4]; | |
319 | float ffred; | |
324 | 320 | } poor; |
325 | 321 | |
326 | 322 | float readFloat( void ) { |
376 | 372 | Com_sprintf( name, sizeof( name ), "fonts/fontImage_%i.dat",pointSize ); |
377 | 373 | for ( i = 0; i < registeredFontCount; i++ ) { |
378 | 374 | if ( Q_stricmp( name, registeredFont[i].name ) == 0 ) { |
379 | memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
375 | Com_Memcpy( font, ®isteredFont[i], sizeof( fontInfo_t ) ); | |
380 | 376 | return; |
381 | 377 | } |
382 | 378 | } |
403 | 399 | fdOffset += sizeof(font->glyphs[i].shaderName); |
404 | 400 | } |
405 | 401 | font->glyphScale = readFloat(); |
406 | memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
407 | ||
408 | // memcpy(font, faceData, sizeof(fontInfo_t)); | |
402 | Com_Memcpy( font->name, &fdFile[fdOffset], MAX_QPATH ); | |
403 | ||
404 | // Com_Memcpy(font, faceData, sizeof(fontInfo_t)); | |
409 | 405 | Q_strncpyz( font->name, name, sizeof( font->name ) ); |
410 | 406 | for ( i = GLYPH_START; i <= GLYPH_END; i++ ) { |
411 | 407 | font->glyphs[i].glyph = RE_RegisterShaderNoMip( font->glyphs[i].shaderName ); |
412 | 408 | } |
413 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
409 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
414 | 410 | ri.FS_FreeFile(faceData); |
415 | 411 | return; |
416 | 412 | } |
456 | 452 | maxHeight = 0; |
457 | 453 | |
458 | 454 | for ( i = GLYPH_START; i <= GLYPH_END; i++ ) { |
459 | glyph = RE_ConstructGlyphInfo( out, &xOut, &yOut, &maxHeight, face, (unsigned char)i, qtrue ); | |
455 | RE_ConstructGlyphInfo( out, &xOut, &yOut, &maxHeight, face, (unsigned char)i, qtrue ); | |
460 | 456 | } |
461 | 457 | |
462 | 458 | xOut = 0; |
508 | 504 | } |
509 | 505 | |
510 | 506 | //Com_sprintf (name, sizeof(name), "fonts/fontImage_%i_%i", imageNumber++, pointSize); |
511 | image = R_CreateImage( name, imageBuff, 256, 256, qfalse, qfalse, GL_CLAMP_TO_EDGE ); | |
507 | image = R_CreateImage( name, imageBuff, 256, 256, IMGTYPE_COLORALPHA, IMGFLAG_CLAMPTOEDGE, 0 ); | |
512 | 508 | h = RE_RegisterShaderFromImage( name, LIGHTMAP_2D, image, qfalse ); |
513 | 509 | for ( j = lastStart; j < i; j++ ) { |
514 | 510 | font->glyphs[j].glyph = h; |
522 | 518 | if ( i == GLYPH_END + 1 ) |
523 | 519 | i++; |
524 | 520 | } else { |
525 | memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
521 | Com_Memcpy( &font->glyphs[i], glyph, sizeof( glyphInfo_t ) ); | |
526 | 522 | i++; |
527 | 523 | } |
528 | 524 | } |
535 | 531 | |
536 | 532 | registeredFont[registeredFontCount].glyphScale = glyphScale; |
537 | 533 | font->glyphScale = glyphScale; |
538 | memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
534 | Com_Memcpy( ®isteredFont[registeredFontCount++], font, sizeof( fontInfo_t ) ); | |
539 | 535 | |
540 | 536 | if ( r_saveFontData->integer ) { |
541 | 537 | ri.FS_WriteFile( va( "fonts/fontImage_%i.dat", pointSize ), font, sizeof( fontInfo_t ) ); |
2003 | 2003 | skin->numSurfaces = 0; |
2004 | 2004 | skin->numModels = 0; //----(SA) added |
2005 | 2005 | skin->numSurfaces = 1; |
2006 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( skin->surfaces[0] ), h_low ); | |
2006 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
2007 | 2007 | skin->surfaces[0]->shader = R_FindShader( name, LIGHTMAP_NONE, qtrue ); |
2008 | 2008 | return hSkin; |
2009 | 2009 | } |
2116 | 2116 | skin = tr.skins[0] = ri.Hunk_Alloc( sizeof( skin_t ), h_low ); |
2117 | 2117 | Q_strncpyz( skin->name, "<default skin>", sizeof( skin->name ) ); |
2118 | 2118 | skin->numSurfaces = 1; |
2119 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces ), h_low ); | |
2119 | skin->surfaces[0] = ri.Hunk_Alloc( sizeof( *skin->surfaces[0] ), h_low ); | |
2120 | 2120 | skin->surfaces[0]->shader = tr.defaultShader; |
2121 | 2121 | } |
2122 | 2122 |
165 | 165 | frac[i] = v - pos[i]; |
166 | 166 | if ( pos[i] < 0 ) { |
167 | 167 | pos[i] = 0; |
168 | } else if ( pos[i] >= tr.world->lightGridBounds[i] - 1 ) { | |
168 | } else if ( pos[i] > tr.world->lightGridBounds[i] - 1 ) { | |
169 | 169 | pos[i] = tr.world->lightGridBounds[i] - 1; |
170 | 170 | } |
171 | 171 | } |
194 | 194 | data = gridData; |
195 | 195 | for ( j = 0 ; j < 3 ; j++ ) { |
196 | 196 | if ( i & ( 1 << j ) ) { |
197 | if ( pos[j] + 1 > tr.world->lightGridBounds[j] - 1 ) { | |
198 | break; // ignore values outside lightgrid | |
199 | } | |
197 | 200 | factor *= frac[j]; |
198 | 201 | data += gridStep[j]; |
199 | 202 | } else { |
201 | 204 | } |
202 | 205 | } |
203 | 206 | |
207 | if ( j != 3 ) { | |
208 | continue; | |
209 | } | |
204 | 210 | if ( !( data[0] + data[1] + data[2] ) ) { |
205 | 211 | continue; // ignore samples in walls |
206 | 212 | } |
1342 | 1342 | fog_t *fog; |
1343 | 1343 | |
1344 | 1344 | if ( tr.refdef.rdflags & RDF_NOWORLDMODEL ) { |
1345 | return 0; | |
1346 | } | |
1347 | ||
1348 | if ( ent->e.renderfx & RF_CROSSHAIR ) { | |
1345 | 1349 | return 0; |
1346 | 1350 | } |
1347 | 1351 |
1528 | 1528 | else if ( !Q_stricmp( token, "fogParms" ) ) { |
1529 | 1529 | if ( !ParseVector( text, 3, shader.fogParms.color ) ) { |
1530 | 1530 | return qfalse; |
1531 | } | |
1532 | ||
1533 | if ( r_greyscale->integer ) | |
1534 | { | |
1535 | float luminance; | |
1536 | ||
1537 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1538 | VectorSet( shader.fogParms.color, luminance, luminance, luminance ); | |
1539 | } | |
1540 | else if ( r_greyscale->value ) | |
1541 | { | |
1542 | float luminance; | |
1543 | ||
1544 | luminance = LUMA( shader.fogParms.color[0], shader.fogParms.color[1], shader.fogParms.color[2] ); | |
1545 | shader.fogParms.color[0] = LERP( shader.fogParms.color[0], luminance, r_greyscale->value ); | |
1546 | shader.fogParms.color[1] = LERP( shader.fogParms.color[1], luminance, r_greyscale->value ); | |
1547 | shader.fogParms.color[2] = LERP( shader.fogParms.color[2], luminance, r_greyscale->value ); | |
1531 | 1548 | } |
1532 | 1549 | |
1533 | 1550 | token = COM_ParseExt( text, qfalse ); |
156 | 156 | { |
157 | 157 | int i, j; |
158 | 158 | char buf[ MAX_STRING_CHARS ] = { 0 }; |
159 | SDL_Rect modes[ 128 ]; | |
159 | int numSDLModes; | |
160 | SDL_Rect *modes; | |
160 | 161 | int numModes = 0; |
161 | 162 | |
163 | SDL_DisplayMode windowMode; | |
162 | 164 | int display = SDL_GetWindowDisplayIndex( SDL_window ); |
163 | SDL_DisplayMode windowMode; | |
164 | ||
165 | if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 ) | |
165 | numSDLModes = SDL_GetNumDisplayModes( display ); | |
166 | ||
167 | if( SDL_GetWindowDisplayMode( SDL_window, &windowMode ) < 0 || numSDLModes <= 0 ) | |
166 | 168 | { |
167 | 169 | ri.Printf( PRINT_WARNING, "Couldn't get window display mode, no resolutions detected\n" ); |
168 | 170 | return; |
169 | 171 | } |
170 | 172 | |
171 | for( i = 0; i < SDL_GetNumDisplayModes( display ); i++ ) | |
173 | modes = SDL_calloc( (size_t)numSDLModes, sizeof( SDL_Rect ) ); | |
174 | if ( !modes ) | |
175 | { | |
176 | ri.Error( ERR_FATAL, "Out of memory" ); | |
177 | } | |
178 | ||
179 | for( i = 0; i < numSDLModes; i++ ) | |
172 | 180 | { |
173 | 181 | SDL_DisplayMode mode; |
174 | 182 | |
178 | 186 | if( !mode.w || !mode.h ) |
179 | 187 | { |
180 | 188 | ri.Printf( PRINT_ALL, "Display supports any resolution\n" ); |
189 | SDL_free( modes ); | |
181 | 190 | return; |
182 | 191 | } |
183 | 192 | |
219 | 228 | ri.Printf( PRINT_ALL, "Available modes: '%s'\n", buf ); |
220 | 229 | ri.Cvar_Set( "r_availableModes", buf ); |
221 | 230 | } |
231 | SDL_free( modes ); | |
222 | 232 | } |
223 | 233 | |
224 | 234 | /* |
3 | 3 | unsigned int width; |
4 | 4 | unsigned int height; |
5 | 5 | unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */ |
6 | unsigned char pixel_data[128 * 128 * 4 + 1]; | |
6 | unsigned char pixel_data[128 * 128 * 4]; | |
7 | 7 | } CLIENT_WINDOW_ICON = { |
8 | 8 | 128, 128, 4, |
9 | 9 | "3\0\0\3773\0\0\3773\0\0\3773\0\0\3773\0\0\3773\0\0\3773\0\0\3773\0\0\377" |
832 | 832 | Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qtrue, 0, NULL ); |
833 | 833 | Com_QueueEvent( 0, SE_KEY, K_MWHEELUP, qfalse, 0, NULL ); |
834 | 834 | } |
835 | else | |
835 | else if( e.wheel.y < 0 ) | |
836 | 836 | { |
837 | 837 | Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qtrue, 0, NULL ); |
838 | 838 | Com_QueueEvent( 0, SE_KEY, K_MWHEELDOWN, qfalse, 0, NULL ); |
812 | 812 | signal( SIGHUP, Sys_SigHandler ); |
813 | 813 | signal( SIGQUIT, Sys_SigHandler ); |
814 | 814 | signal( SIGTRAP, Sys_SigHandler ); |
815 | signal( SIGIOT, Sys_SigHandler ); | |
815 | signal( SIGABRT, Sys_SigHandler ); | |
816 | 816 | signal( SIGBUS, Sys_SigHandler ); |
817 | 817 | |
818 | 818 | Sys_SetFloatEnv(); |
410 | 410 | intptr_t findhandle; |
411 | 411 | int flag; |
412 | 412 | int i; |
413 | int extLen; | |
413 | 414 | |
414 | 415 | if (filter) { |
415 | 416 | |
443 | 444 | flag = _A_SUBDIR; |
444 | 445 | } |
445 | 446 | |
447 | extLen = strlen( extension ); | |
448 | ||
446 | 449 | Com_sprintf( search, sizeof(search), "%s\\*%s", directory, extension ); |
447 | 450 | |
448 | 451 | // search |
456 | 459 | |
457 | 460 | do { |
458 | 461 | if ( (!wantsubs && flag ^ ( findinfo.attrib & _A_SUBDIR )) || (wantsubs && findinfo.attrib & _A_SUBDIR) ) { |
462 | if (*extension) { | |
463 | if ( strlen( findinfo.name ) < extLen || | |
464 | Q_stricmp( | |
465 | findinfo.name + strlen( findinfo.name ) - extLen, | |
466 | extension ) ) { | |
467 | continue; // didn't match | |
468 | } | |
469 | } | |
459 | 470 | if ( nfiles == MAX_FOUND_FILES - 1 ) { |
460 | 471 | break; |
461 | 472 | } |
51 | 51 | |
52 | 52 | unset X86_64_SDK |
53 | 53 | unset X86_64_CFLAGS |
54 | unset X86_64_LDFLAGS | |
55 | 54 | unset X86_SDK |
56 | 55 | unset X86_CFLAGS |
57 | unset X86_LDFLAGS | |
58 | 56 | unset PPC_64_SDK |
59 | 57 | unset PPC_CFLAGS |
60 | unset PPC_LDFLAGS | |
61 | 58 | |
62 | 59 | if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then |
63 | 60 | X86_64_SDK=/Developer/SDKs/MacOSX10.5.sdk |
64 | X86_64_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
65 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
66 | X86_64_LDFLAGS=" -mmacosx-version-min=10.5" | |
61 | X86_64_CFLAGS="-arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
67 | 62 | |
68 | 63 | X86_SDK=/Developer/SDKs/MacOSX10.5.sdk |
69 | X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
70 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
71 | X86_LDFLAGS=" -mmacosx-version-min=10.5" | |
64 | X86_CFLAGS="-arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
72 | 65 | |
73 | 66 | PPC_SDK=/Developer/SDKs/MacOSX10.5.sdk |
74 | PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
75 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
76 | PPC_LDFLAGS=" -mmacosx-version-min=10.5" | |
67 | PPC_CFLAGS="-arch ppc -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
77 | 68 | fi |
78 | 69 | |
79 | 70 | if [ -z $X86_64_SDK ] || [ -z $X86_SDK ] || [ -z $PPC_SDK ]; then |
110 | 101 | if [ -d build/release-release-x86_64 ]; then |
111 | 102 | rm -r build/release-darwin-x86_64 |
112 | 103 | fi |
113 | (ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS LDFLAGS=$X86_64_LDFLAGS make -j$NCPU) || exit 1; | |
104 | (ARCH=x86_64 CC=gcc-4.0 CFLAGS=$X86_64_CFLAGS make -j$NCPU) || exit 1; | |
114 | 105 | |
115 | 106 | echo;echo |
116 | 107 | |
118 | 109 | if [ -d build/release-darwin-x86 ]; then |
119 | 110 | rm -r build/release-darwin-x86 |
120 | 111 | fi |
121 | (ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS LDFLAGS=$X86_LDFLAGS make -j$NCPU) || exit 1; | |
112 | (ARCH=x86 CC=gcc-4.0 CFLAGS=$X86_CFLAGS make -j$NCPU) || exit 1; | |
122 | 113 | |
123 | 114 | echo;echo |
124 | 115 | |
126 | 117 | if [ -d build/release-darwin-ppc ]; then |
127 | 118 | rm -r build/release-darwin-ppc |
128 | 119 | fi |
129 | (ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS LDFLAGS=$PPC_LDFLAGS make -j$NCPU) || exit 1; | |
120 | (ARCH=ppc CC=gcc-4.0 CFLAGS=$PPC_CFLAGS make -j$NCPU) || exit 1; | |
130 | 121 | |
131 | 122 | echo;echo |
132 | 123 |
68 | 68 | |
69 | 69 | unset ARCH_SDK |
70 | 70 | unset ARCH_CFLAGS |
71 | unset ARCH_LDFLAGS | |
72 | 71 | |
73 | 72 | if [ -d /Developer/SDKs/MacOSX10.5.sdk ]; then |
74 | 73 | ARCH_SDK=/Developer/SDKs/MacOSX10.5.sdk |
75 | ARCH_CFLAGS="-arch ${ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk \ | |
76 | -DMAC_OS_X_VERSION_MIN_REQUIRED=1050" | |
77 | ARCH_LDFLAGS=" -mmacosx-version-min=10.5" | |
74 | ARCH_CFLAGS="-arch ${ARCH} -isysroot /Developer/SDKs/MacOSX10.5.sdk" | |
78 | 75 | fi |
79 | 76 | |
80 | 77 | |
93 | 90 | if [ -d build/release-darwin-${BUILDARCH} ]; then |
94 | 91 | rm -r build/release-darwin-${BUILDARCH} |
95 | 92 | fi |
96 | (CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1; | |
93 | (CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1; | |
97 | 94 | |
98 | 95 | echo "Creating .app bundle $DESTDIR/$APPBUNDLE" |
99 | 96 | if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then |
57 | 57 | # "8" is the Darwin major kernel version. |
58 | 58 | TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'` |
59 | 59 | |
60 | # we want to use the oldest available SDK (10.6) for max compatiblity. | |
60 | unset ARCH_CFLAGS | |
61 | 61 | |
62 | unset ARCH_CFLAGS | |
63 | unset ARCH_LDFLAGS | |
64 | ||
65 | ARCH_CFLAGS="-arch ${ARCH} -DMAC_OS_X_VERSION_MIN_REQUIRED=1060" | |
66 | ARCH_LDFLAGS=" -mmacosx-version-min=10.6" | |
62 | ARCH_CFLAGS="-arch ${ARCH}" | |
67 | 63 | |
68 | 64 | if [ ! -d $DESTDIR ]; then |
69 | 65 | mkdir -p $DESTDIR |
77 | 73 | if [ -d build/release-darwin-${BUILDARCH} ]; then |
78 | 74 | rm -r build/release-darwin-${BUILDARCH} |
79 | 75 | fi |
80 | (CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1; | |
76 | (CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1; | |
81 | 77 | |
82 | 78 | echo "Creating .app bundle $DESTDIR/$APPBUNDLE" |
83 | 79 | if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then |
57 | 57 | # "8" is the Darwin major kernel version. |
58 | 58 | TIGERHOST=`uname -r |perl -w -p -e 's/\A(\d+)\..*\Z/$1/; $_ = (($_ >= 8) ? "1" : "0");'` |
59 | 59 | |
60 | # we want to use the oldest available SDK (10.6) for max compatiblity. | |
60 | unset ARCH_CFLAGS | |
61 | 61 | |
62 | unset ARCH_CFLAGS | |
63 | unset ARCH_LDFLAGS | |
64 | ||
65 | ARCH_CFLAGS="-arch ${ARCH} -DMAC_OS_X_VERSION_MIN_REQUIRED=1060" | |
66 | ARCH_LDFLAGS=" -mmacosx-version-min=10.6" | |
62 | ARCH_CFLAGS="-arch ${ARCH}" | |
67 | 63 | |
68 | 64 | if [ ! -d $DESTDIR ]; then |
69 | 65 | mkdir -p $DESTDIR |
77 | 73 | if [ -d build/release-darwin-${BUILDARCH} ]; then |
78 | 74 | rm -r build/release-darwin-${BUILDARCH} |
79 | 75 | fi |
80 | (CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS LDFLAGS=$ARCH_LDFLAGS make -j$NCPU) || exit 1; | |
76 | (CC=${CC} CXX=${CXX} ARCH=${BUILDARCH} CFLAGS=$ARCH_CFLAGS make -j$NCPU) || exit 1; | |
81 | 77 | |
82 | 78 | echo "Creating .app bundle $DESTDIR/$APPBUNDLE" |
83 | 79 | if [ ! -d $DESTDIR/$APPBUNDLE/Contents/MacOS/$BASEDIR ]; then |