├── .clang-format
├── .github
└── ISSUE_TEMPLATE.md
├── .gitignore
├── .gitmodules
├── 3rdparty
└── Android.mk
├── Android.mk
├── LICENSE
├── README.md
├── android
├── .gitignore
├── AndroidManifest.xml
├── build
├── build.xml
├── clean
├── jni
│ ├── Android.mk
│ ├── Application.mk
│ ├── bs_config.mk
│ └── cs-client
├── makepak.py
├── project.properties
├── res
│ ├── drawable-hdpi
│ │ └── ic_launcher.png
│ ├── drawable-mdpi
│ │ └── ic_launcher.png
│ ├── drawable-xhdpi
│ │ └── ic_launcher.png
│ ├── drawable-xxhdpi
│ │ └── ic_launcher.png
│ ├── layout
│ │ └── activity_launcher.xml
│ ├── values-es
│ │ └── strings.xml
│ ├── values-fa
│ │ └── strings.xml
│ ├── values-pt-rBR
│ │ └── strings.xml
│ ├── values-ru
│ │ └── strings.xml
│ ├── values-tr
│ │ └── strings.xml
│ ├── values-zh
│ │ └── strings.xml
│ └── values
│ │ ├── dimens.xml
│ │ └── strings.xml
├── src
│ └── in
│ │ └── celest
│ │ └── xash3d
│ │ └── cs16client
│ │ ├── InstallReceiver.java
│ │ └── LauncherActivity.java
└── update
├── cl_dll
├── Android.mk
├── CMakeLists.txt
├── Makefile
├── Makefile.mingw
├── cdll_int.cpp
├── cl_dll.dsp
├── com_weapons.cpp
├── cs_wpn
│ ├── com_weapons.cpp
│ ├── cs_baseentity.cpp
│ └── cs_weapons.cpp
├── demo.cpp
├── draw_util.cpp
├── entity.cpp
├── ev_common.cpp
├── ev_hldm.cpp
├── events
│ ├── ev_cs16.cpp
│ ├── event_ak47.cpp
│ ├── event_aug.cpp
│ ├── event_awp.cpp
│ ├── event_createexplo.cpp
│ ├── event_createsmoke.cpp
│ ├── event_deagle.cpp
│ ├── event_decal_reset.cpp
│ ├── event_elite_left.cpp
│ ├── event_elite_right.cpp
│ ├── event_famas.cpp
│ ├── event_fiveseven.cpp
│ ├── event_g3sg1.cpp
│ ├── event_galil.cpp
│ ├── event_glock18.cpp
│ ├── event_knife.cpp
│ ├── event_m249.cpp
│ ├── event_m3.cpp
│ ├── event_m4a1.cpp
│ ├── event_mac10.cpp
│ ├── event_mp5n.cpp
│ ├── event_p228.cpp
│ ├── event_p90.cpp
│ ├── event_scout.cpp
│ ├── event_sg550.cpp
│ ├── event_sg552.cpp
│ ├── event_tmp.cpp
│ ├── event_ump45.cpp
│ ├── event_usp.cpp
│ ├── event_vehicle.cpp
│ ├── event_xm1014.cpp
│ └── hl_events.cpp
├── hud
│ ├── MOTD.cpp
│ ├── ammo.cpp
│ ├── ammo_secondary.cpp
│ ├── ammohistory.cpp
│ ├── battery.cpp
│ ├── death.cpp
│ ├── flashlight.cpp
│ ├── geiger.cpp
│ ├── health.cpp
│ ├── hud.cpp
│ ├── hud_msg.cpp
│ ├── hud_redraw.cpp
│ ├── hud_spectator.cpp
│ ├── hud_update.cpp
│ ├── menu.cpp
│ ├── message.cpp
│ ├── money.cpp
│ ├── nvg.cpp
│ ├── radar.cpp
│ ├── radio.cpp
│ ├── saytext.cpp
│ ├── scoreboard.cpp
│ ├── sniperscope.cpp
│ ├── spectator_gui.cpp
│ ├── status_icons.cpp
│ ├── statusbar.cpp
│ ├── text_message.cpp
│ ├── timer.cpp
│ └── train.cpp
├── in_camera.cpp
├── include
│ ├── camera.h
│ ├── cl_dll.h
│ ├── cl_util.h
│ ├── com_weapons.h
│ ├── csprite.h
│ ├── demo.h
│ ├── draw_util.h
│ ├── ev_hldm.h
│ ├── events.h
│ ├── eventscripts.h
│ ├── hud
│ │ ├── ammo.h
│ │ ├── ammohistory.h
│ │ ├── health.h
│ │ ├── hud.h
│ │ ├── hud_iface.h
│ │ ├── hud_spectator.h
│ │ └── radar.h
│ ├── in_defs.h
│ ├── input.h
│ ├── kbutton.h
│ ├── math
│ │ ├── neon_mathfun.h
│ │ └── sse_mathfun.h
│ ├── overview.h
│ ├── parsemsg.h
│ ├── rain.h
│ ├── studio
│ │ ├── GameStudioModelRenderer.h
│ │ ├── StudioModelRenderer.h
│ │ └── studio_util.h
│ ├── tf_defs.h
│ ├── unicode_strtools.h
│ ├── util_vector.h
│ ├── vgui_parser.h
│ ├── view.h
│ └── wrect.h
├── input.cpp
├── input_sdl.cpp
├── input_xash3d.cpp
├── inputw32.cpp
├── rain.cpp
├── readme.txt
├── studio
│ ├── GameStudioModelRenderer.cpp
│ ├── StudioModelRenderer.cpp
│ └── studio_util.cpp
├── tri.cpp
├── unicode_strtools.cpp
├── util.cpp
├── vgui_parser.cpp
└── view.cpp
├── common
├── beamdef.h
├── cl_entity.h
├── com_model.h
├── con_nprint.h
├── const.h
├── crc.h
├── cvardef.h
├── demo_api.h
├── director_cmds.h
├── dlight.h
├── dll_state.h
├── engine_launcher_api.h
├── entity_state.h
├── entity_types.h
├── event_api.h
├── event_args.h
├── event_flags.h
├── exefuncs.h
├── gameinfo.h
├── hltv.h
├── in_buttons.h
├── interface.cpp
├── interface.h
├── ivoicetweak.h
├── kbutton.h
├── lightstyle.h
├── mathlib.h
├── net_api.h
├── netadr.h
├── nowin.h
├── particledef.h
├── pmtrace.h
├── port.h
├── qfont.h
├── r_efx.h
├── r_studioint.h
├── ref_params.h
├── render_api.h
├── screenfade.h
├── studio_event.h
├── triangleapi.h
├── usercmd.h
├── weaponinfo.h
└── wrect.h
├── dlls
├── activity.h
├── basemonster.h
├── cbase.h
├── cdll_dll.h
├── effects.h
├── enginecallback.h
├── exportdef.h
├── extdll.h
├── gamerules.h
├── hintmessage.h
├── monsterevent.h
├── monsters.h
├── nodes.h
├── player.h
├── saverestore.h
├── schedule.h
├── skill.h
├── soundent.h
├── stdafx.h
├── util.h
├── vector.h
├── weapons.h
└── wpn_shared
│ ├── wpn_ak47.cpp
│ ├── wpn_aug.cpp
│ ├── wpn_awp.cpp
│ ├── wpn_c4.cpp
│ ├── wpn_deagle.cpp
│ ├── wpn_elite.cpp
│ ├── wpn_famas.cpp
│ ├── wpn_fiveseven.cpp
│ ├── wpn_flashbang.cpp
│ ├── wpn_g3sg1.cpp
│ ├── wpn_galil.cpp
│ ├── wpn_glock18.cpp
│ ├── wpn_hegrenade.cpp
│ ├── wpn_knife.cpp
│ ├── wpn_m249.cpp
│ ├── wpn_m3.cpp
│ ├── wpn_m4a1.cpp
│ ├── wpn_mac10.cpp
│ ├── wpn_mp5navy.cpp
│ ├── wpn_p228.cpp
│ ├── wpn_p90.cpp
│ ├── wpn_scout.cpp
│ ├── wpn_sg550.cpp
│ ├── wpn_sg552.cpp
│ ├── wpn_smokegrenade.cpp
│ ├── wpn_tmp.cpp
│ ├── wpn_ump45.cpp
│ ├── wpn_usp.cpp
│ └── wpn_xm1014.cpp
├── engine
├── Sequence.h
├── anorms.h
├── archtypes.h
├── cdll_int.h
├── custom.h
├── customentity.h
├── edict.h
├── eiface.h
├── keydefs.h
├── menu_int.h
├── mobility_int.h
├── progdefs.h
├── progs.h
├── shake.h
└── studio.h
├── game_shared
├── bitvec.h
├── voice_banmgr.cpp
├── voice_banmgr.h
├── voice_common.h
├── voice_gamemgr.cpp
├── voice_gamemgr.h
├── voice_status.cpp
└── voice_status.h
├── mainui
├── Android.mk
├── CMakeLists.txt
├── basemenu.cpp
├── basemenu.h
├── enginecallback.h
├── extdll.h
├── legacy
│ ├── menu_playdemo.cpp
│ ├── menu_playrec.cpp
│ └── menu_recdemo.cpp
├── menu_advcontrols.cpp
├── menu_audio.cpp
├── menu_btns.cpp
├── menu_btnsbmp_table.h
├── menu_configuration.cpp
├── menu_controls.cpp
├── menu_creategame.cpp
├── menu_credits.cpp
├── menu_filedialog.cpp
├── menu_gameoptions.cpp
├── menu_gamepad.cpp
├── menu_internetgames.cpp
├── menu_langame.cpp
├── menu_main.cpp
├── menu_multiplayer.cpp
├── menu_playersetup.cpp
├── menu_strings.cpp
├── menu_strings.h
├── menu_touch.cpp
├── menu_touchbuttons.cpp
├── menu_touchedit.cpp
├── menu_touchoptions.cpp
├── menu_vidoptions.cpp
├── menufont.h
├── udll_int.cpp
├── ui_title_anim.cpp
├── ui_title_anim.h
├── utils.cpp
└── utils.h
├── network
└── delta.lst
├── pm_shared
├── pm_debug.cpp
├── pm_debug.h
├── pm_defs.h
├── pm_info.h
├── pm_materials.h
├── pm_math.cpp
├── pm_math.h
├── pm_movevars.h
├── pm_shared.cpp
└── pm_shared.h
├── projects
├── client.sln
├── client.vcxproj
├── client.vcxproj.filters
├── mainui.sln
├── mainui.vcxproj
├── mainui.vcxproj.filters
├── server.sln
├── server.vcxproj
└── server.vcxproj.filters
└── public
└── tier1
├── UtlMemory.h
└── UtlVector.h
/.clang-format:
--------------------------------------------------------------------------------
1 | #BasedOnStyle: WebKit
2 | IndentWidth: 4
3 | TabWidth: 4
4 | UseTab: ForIndentation
5 |
6 | BreakBeforeBraces: Allman
7 |
8 | AlignAfterOpenBracket: true
9 | AlignConsecutiveAssignments: true
10 | AlignOperands: true
11 |
12 | AllowShortBlocksOnASingleLine: false
13 | AllowShortCaseLabelsOnASingleLine: false
14 | AllowShortFunctionsOnASingleLine: Inline
15 | AllowShortIfStatementsOnASingleLine: false
16 | AllowShortLoopsOnASingleLine: false
17 |
18 | NamespaceIndentation: Inner
19 |
20 | SpaceAfterCStyleCast: false
21 | SpaceBeforeParens: true
22 | SpaceInEmptyParentheses: true
23 | SpacesInAngles: true
24 | SpacesInParentheses: true
25 | SpacesBeforeTrailingComments: 1
26 |
27 | IndentCaseLabels: false
28 | IndentWrappedFunctionNames: true
29 |
30 | PointerAlignment: Right
31 |
32 | ColumnLimit: 0
33 | BinPackArguments: false
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | Hi, dear "cs16-client" player. :)
2 |
3 | Since developers are too busy, we don't have too much time to work with each bug of each user.
4 |
5 | So before you will press *Submit* button, make sure you have checked all the paragraphs below:
6 | - [ ] I installed latest versions of cs16-client and Xash3D port. (look here: https://github.com/FWGS/cs16-client/releases/latest and https://github.com/FWGS/xash3d-android-project/releases/latest)
7 | - [ ] I installed fresh game data from my Steam account.
8 | - [ ] I looked through the Issues section of this repository.
9 | - [ ] I looked through the Issues section of https://github.com/FWGS/xash3d repository.
10 | - [ ] I looked through the Issues section of https://github.com/FWGS/xash3d-android-project repository.
11 |
12 | You are still here? Great! This means that you have a new bug. But this is not the end. For our mutual understanding, we require some data from you:
13 | - [ ] Short description of your problem.
14 | - [ ] Information about your device: RAM size, CPU, GPU and OS.
15 | - [ ] engine.log. You can find that in your "xash" folder. If there is not log, re-run game with "-log" command line parameter.
16 | - [ ] adb logcat. Isn't necessary, but it will be very nice, if you can post this. You can ask Google for "How to get the "logcat" data", if you don't know what is it.
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Compiled Object files
2 | *.slo
3 | *.lo
4 | *.o
5 | *.obj
6 |
7 | # Precompiled Headers
8 | *.gch
9 | *.pch
10 |
11 | # Compiled Dynamic libraries
12 | *.so
13 | *.dylib
14 | *.dll
15 |
16 | # Fortran module files
17 | *.mod
18 |
19 | # Compiled Static libraries
20 | *.lai
21 | *.la
22 | *.a
23 | *.lib
24 |
25 | # Executables
26 | *.exe
27 | *.out
28 | *.app
29 |
30 | *.user
31 | *.sdf
32 | *.opendb
33 | *.pdb
34 | *.iobj
35 | *.lastbuildstate
36 | *.tlog
37 | *.log
38 | *.suo
39 | *.ipch
40 | *.ipdb
41 | *.exp
42 | *.idb
43 | *.ilk
44 | *.autosave
45 |
46 | android/pak/
47 | android/assets/extras.pak
48 | *-build
49 | *admob-id.xml
50 | cl_dll/build
51 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "yapb"]
2 | path = 3rdparty/yapb
3 | url = https://github.com/jeefo/yapb
4 |
5 | [submodule "android/extras_src/extras"]
6 | path = 3rdparty/extras
7 | url = https://bitbucket.org/SergioPoverony/cs16client-vgui-menus
8 | [submodule "3rdparty/regamelite"]
9 | path = 3rdparty/regamelite
10 | url = https://github.com/SDLash3D/regamelite.git
11 |
--------------------------------------------------------------------------------
/3rdparty/Android.mk:
--------------------------------------------------------------------------------
1 | include $(call all-subdir-makefiles)
2 |
--------------------------------------------------------------------------------
/Android.mk:
--------------------------------------------------------------------------------
1 | include $(call all-subdir-makefiles)
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CS16Client
2 | ## Counter-Strike 1.6 client.dll rewrite project.
3 |
4 | * Based on HLSDK 2.3.
5 | * Works without VGUI.
6 | * Runs on your phone.
7 | * Helpful for modders.
8 |
9 | [Latest stable release](https://github.com/SDLash3D/cs16-client/releases/latest)
10 |
11 | ## How to run
12 |
13 | **Install**:
14 |
15 | 1) Install the APK from [GitHub Releases](https://github.com/SDLash3D/cs16-client/releases/latest).
16 | * If you have **multi-core** device, choose APK with `omp` postfix.
17 | * If you have **single-core** device or you have **problems** with OMP version, choose APK with `noomp` postfix.
18 |
19 | 2) Install the latest [Xash3D Android](https://github.com/SDLash3D/xash3d-android-project/releases/latest).
20 |
21 | 3) Copy `cstrike` and `valve` folders from your **Steam CS1.6** installation to `xash` folder on SDCard.
22 |
23 | 4) Run CS16Client and enjoy!
24 |
25 | ## Contributing
26 |
27 | There is many things must be done. For example:
28 |
29 | * Translations!
30 | * Better and user-friendly Java Launcher design.
31 | * Better weapon prediction system, animation fixes.
32 | * Fixing crashes.
33 | * Ports to another platforms.
34 | * CZero support.
35 |
36 | ### Issues
37 |
38 | **Issues temporarily disabled due to spam. Sorry about that.**
39 |
40 | #### CS1.6 incompability
41 | 1) Explain what's wrong with cs16-client.
42 |
43 | 2) Attach a screenshot from Steam version of CS1.6. Please, please, don't send issues about modificated servers!
44 |
45 | #### Crashes or bugs
46 | 1) Explain what's wrong with cs16-client
47 |
48 | 2) Attach a screenshot with cs16-client. Attach an engine.log. (if engine.log isn't written, rerun engine with `-log` parameter)
49 |
50 | If you are experiencing bug on Android, attach an ADB log.
51 |
52 | ### Code guide
53 |
54 | For some reason, originally client is more "C with classes" than "C++". Someday it will be refactored, but now I recommend to use "C++" if it looks more convenient.
55 |
56 | For example, if you need to work with vectors, use `Vector` class, instead of `float[3]`. They are data-compatible, but `Vector` is more convenient for C++ code.
57 |
58 | For code-style guide: Use `.clang-format`, Luke!
59 |
--------------------------------------------------------------------------------
/android/.gitignore:
--------------------------------------------------------------------------------
1 | # Built application files
2 | *.apk
3 | *.ap_
4 | *.bin
5 |
6 | # Files for the Dalvik VM
7 | *.dex
8 |
9 | # Java class files
10 | *.class
11 |
12 | # Generated files
13 | bin/
14 | gen/
15 |
16 | # Gradle files
17 | .gradle/
18 | build/
19 | /*/build/
20 |
21 | # Native files
22 | obj/
23 | libs/
24 |
25 | # Local configuration file (sdk path, etc)
26 | local.properties
27 |
28 | # Proguard folder generated by Eclipse
29 | proguard/
30 |
31 | # Log Files
32 | *.log
33 |
34 | *.swp
35 | *.save
36 | *.kate-swp
37 |
--------------------------------------------------------------------------------
/android/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
10 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
27 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/android/build:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [[ "$1" = "--help" ]]; then
4 | echo "Usage: ./build.sh "
5 | exit 0
6 | fi
7 |
8 | if [[ "$#" -ne "2" ]]; then
9 | echo "Illegal number of parameters, see ./build.sh --help"
10 | exit 0
11 | fi
12 |
13 | if [[ "$1" = "release" ]]; then
14 | VERBOSE="0"
15 | RELEASE="0"
16 | else
17 | RELEASE="1 APP_CFLAGS=\"-gdwarf-3\""
18 | VERBOSE="1"
19 | fi
20 |
21 | if [[ "$2" = "omp" ]]; then
22 | OMP="1"
23 | NAME_POSTFIX="omp"
24 | else
25 | OMP="0"
26 | NAME_POSTFIX="noomp"
27 | fi
28 |
29 | echo "*****************************************"
30 | echo "* OMP: $OMP "
31 | echo "* RELEASETYPE: $RELEASE "
32 | echo "*****************************************"
33 |
34 | set -x
35 |
36 | # Regenerate PAK file
37 | mkdir -p pak/
38 | mkdir -p assets/
39 | cp -r ../3rdparty/extras/* pak/
40 | python2 makepak.py pak/ assets/extras.pak
41 |
42 | # Build
43 | ndk-build -j8 NDK_TOOLCHAIN_VERSION=4.8 _CS16CLIENT_ENABLE_OPENMP=$OMP NDK_DEBUG=$RELEASE V=$VERBOSE
44 | ant $1
45 |
46 | if [[ "$1" = "release" ]]; then
47 | jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../../myks.keystore bin/cs16-client-$1-unsigned.apk xashdroid -tsa https://timestamp.geotrust.com/tsa
48 | $HOME/.android/android-sdk-linux/build-tools/23.0.3/zipalign 4 bin/cs16-client-$1-unsigned.apk bin/cs16-client.apk
49 | fi
50 | mv bin/cs16-client.apk cs16-client-$1-$NAME_POSTFIX.apk
51 |
52 |
--------------------------------------------------------------------------------
/android/clean:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo " ------- CLEANING ------- "
4 |
5 | rm -rf obj/ libs/armeabi-v7a libs/armeabi libs/x86 bin/ gen/ assets/ pak/
6 |
--------------------------------------------------------------------------------
/android/jni/Android.mk:
--------------------------------------------------------------------------------
1 | override TARGET_arm_release_CFLAGS :=
2 | override TARGET_thumb_release_CFLAGS :=
3 | override TARGET_arm_debug_CFLAGS :=
4 | override TARGET_thumb_debug_CFLAGS :=
5 | override TARGET_CFLAGS :=
6 | include $(call all-subdir-makefiles)
7 |
--------------------------------------------------------------------------------
/android/jni/Application.mk:
--------------------------------------------------------------------------------
1 | CFLAGS_OPT := -O3 -fomit-frame-pointer -funsafe-math-optimizations -ftree-vectorize -fgraphite-identity -floop-interchange -floop-block -funsafe-loop-optimizations -finline-limit=1024
2 | CFLAGS_OPT_ARM := -mthumb -mfpu=neon -mcpu=cortex-a9 -pipe -mvectorize-with-neon-quad -DVECTORIZE_SINCOS
3 | CFLAGS_OPT_ARMv5 :=-march=armv6 -mfpu=vfp -marm -pipe
4 | CFLAGS_OPT_X86 := -mtune=atom -march=atom -mssse3 -mfpmath=sse -funroll-loops -pipe -DVECTORIZE_SINCOS
5 | CFLAGS_HARDFP := -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -mfloat-abi=hard -DLOAD_HARDFP -DSOFTFP_LINK
6 | APPLICATIONMK_PATH = $(call my-dir)
7 |
8 | XASH3D_CONFIG := $(APPLICATIONMK_PATH)/bs_config.mk
9 |
10 | APP_ABI := x86 armeabi-v7a-hard armeabi
11 | APP_MODULES := menu client server yapb
12 | APP_PLATFORM := android-9
13 | APP_STL := gnustl_static
14 |
--------------------------------------------------------------------------------
/android/jni/bs_config.mk:
--------------------------------------------------------------------------------
1 | #LOCAL_LDFLAGS += -fopenmp
2 | #LOCAL_CFLAGS += -ftree-parallelize-loops=4 -fopenmp
3 |
4 | ifeq ($(_CS16CLIENT_ENABLE_OPENMP), 1)
5 | LOCAL_LDFLAGS += -fopenmp
6 | LOCAL_CFLAGS += -ftree-parallelize-loops=4 -fopenmp
7 | endif
8 |
9 | LOCAL_CFLAGS += $(CFLAGS_OPT)
10 | ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
11 | LOCAL_CFLAGS += $(CFLAGS_OPT_ARM) $(CFLAGS_HARDFP)
12 | endif
13 | ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
14 | LOCAL_CFLAGS += $(CFLAGS_OPT_ARM) -mfloat-abi=softfp
15 | endif
16 | ifeq ($(TARGET_ARCH_ABI),armeabi)
17 | LOCAL_CFLAGS += $(CFLAGS_OPT_ARMv5)
18 | endif
19 | ifeq ($(TARGET_ARCH_ABI),x86)
20 | LOCAL_CFLAGS += $(CFLAGS_OPT_X86)
21 | endif
22 |
23 | ifeq ($(NDK_DEBUG),1)
24 | LOCAL_CFLAGS += -ggdb -DDEBUG
25 | else
26 | LOCAL_CFLAGS += -DNDEBUG
27 | endif
28 |
--------------------------------------------------------------------------------
/android/jni/cs-client:
--------------------------------------------------------------------------------
1 | ../../
--------------------------------------------------------------------------------
/android/makepak.py:
--------------------------------------------------------------------------------
1 | import sys
2 | import struct
3 | import os
4 |
5 | #dummy class for stuffing the file headers into
6 | class FileEntry:
7 | pass
8 |
9 | #arguments are source directory, then target filename e.g. "pak1.pak"
10 | rootdir = sys.argv[1]
11 | pakfilename = sys.argv[2]
12 |
13 | pakfile = open(pakfilename,"wb")
14 |
15 | #write a dummy header to start with
16 | pakfile.write(struct.Struct("<4s2l").pack(b"PACK",0,0))
17 |
18 | #walk the directory recursively, add the files and record the file entries
19 | offset = 12
20 | i = 0
21 | fileentries = []
22 | for root, subFolders, files in os.walk(rootdir):
23 | for file in files:
24 | entry = FileEntry()
25 | impfilename = os.path.join(root,file)
26 | entry.filename = os.path.relpath(impfilename,rootdir).replace("\\","/")
27 | if(entry.filename.startswith(".git")):continue
28 | # print "pak: "+entry.filename
29 | with open(impfilename, "rb") as importfile:
30 | pakfile.write(importfile.read())
31 | entry.offset = offset
32 | entry.length = importfile.tell()
33 | offset = offset + entry.length
34 | fileentries.append(entry)
35 | i += 1
36 | tablesize = 0
37 |
38 | #after all the file data, write the list of entries
39 | for entry in fileentries:
40 | pakfile.write(struct.Struct("<56s").pack(entry.filename.encode("ascii")))
41 | pakfile.write(struct.Struct("
2 |
3 |
4 | CS16Client
5 | CS16Client Launcher
6 | ¡Iniciar cs16-client!
7 | Parámetros de línea de comandos:
8 | ¡No tocar si no sabes por qué necesitas esto!
9 | Nada fue encontrado. Revisa tu APK o elige otro servidor
10 | Algo salió mal...
11 | Esta característica no está implementada todavía
12 | ¡No implementado!
13 | Habilitar bots ZBot
14 | Habilitar bots YaPB
15 | -console -game cstrike -bots, etc
16 | Definir ruta para directorio del juego:
17 | Dejar vacío para utilizar las preferencias de Xash3D Android.
18 |
19 |
20 |
--------------------------------------------------------------------------------
/android/res/values-fa/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CS16Client
4 | CS16-Client اجرا کننده
5 | !CS16-client اجرای
6 | Command line arguments:
7 | !اگر نمی دانید چرا به این نیاز دارید دست کاری نکنید
8 | خود را چک کنید یا سرور دیگری را انتخاب کنیدAPK .موردی یافت نشد
9 | ...اشکالی رخ داد
10 | ...این ویژگی هنوز پشتیبانی نمی شود
11 | !پشتیبانی نمیشود
12 | ZBot فعال کردن بات های
13 | YaPB فعال کردن بات های
14 | -console -game cstrike -bots, etc
15 | :مسیرمحل بازی
16 | .استفاده شود Xash3D Android خالی بگذارید تا از تنظیمات
17 |
18 |
--------------------------------------------------------------------------------
/android/res/values-pt-rBR/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CS16Client
4 | Lançador CS16Client
5 | Iniciar CS 1.6!
6 | Parâmetros:
7 | Não encoste se não sabe para que serve
8 | Opss... Não encontramos nada. Verifique seu APK ou escolha outro servidor
9 | Algo deu errado...
10 | Este recurso ainda não foi implementado
11 | Não implementado!
12 | Habilitar bots ZBot
13 | Habilitar bots YaPB
14 | -console -game cstrike -bots, etc
15 | Definir diretório do jogo:
16 | Deixe em branco para usar as preferências do Xash3D Android.
17 |
18 |
19 |
--------------------------------------------------------------------------------
/android/res/values-ru/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Лаунчер CS16Client
4 | Запустить CS16Client!
5 | Аргументы командной строки:
6 | Не трогайте, если не знаете нужно ли оно вам!
7 | Ничего не найдено. Проверьте вашу установку.
8 | Что-то пошло не так...
9 | Эта функция ещё не реализована
10 | Ещё не реализовано!
11 | Не готово! Багрепорты не будут приниматься, если эта функция включена.
12 | Включить ZBot боты
13 | Выключить ZBot боты
14 | Включить YaPB боты
15 | Выключить YaPB боты
16 | Включить поддержку Condition Zero
17 | Выключить поддержку Condition Zero
18 | -console -game cstrike -bots, etc
19 | Движок не найден
20 | Для того, чтобы продолжить вам необходимо установить Xash3D на ваше устройство
21 | Установить
22 | Отмена
23 | Напоминание при первом запуске
24 | Добро пожаловать в CS16Client! Хочу лишний раз напомнить, что для игры вам необходимы папки "cstrike" и "valve с оригинальной Steam установки Counter-Strike 1.6. Приятной игры!
25 | Хорошо!
26 |
27 |
--------------------------------------------------------------------------------
/android/res/values-tr/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CS16Client
5 | CS16Client Başlatıcısı
6 | CS16-client\'i Başlat!
7 | Komut satırı argümanları:
8 | Buna niye ihtiyacınız olduğunu bilmeden dokunmayın!
9 | Hiçbir şey bulunamadı. APK\'yi kontrol edin veya başka sunucu seçin.
10 | Bir şeyler yolunda gitmedi...
11 | Bu özellik henüz tamamlanmadı.
12 | Tamamlanmadı!
13 | ZBot botlarını aktif et
14 | YaPB botlarını aktif et
15 | -console -game cstrike -bots
16 | Yolu oyun dizinine ayarlayın:
17 | Xash3D Android tercihlerini kullanmak için boş bırakın.
18 |
19 |
24 |
25 |
--------------------------------------------------------------------------------
/android/res/values-zh/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CS16Client
4 | CS16客户端启动器
5 | 启动 CS16Client!
6 | 命令行参数:
7 | 如果不清楚不要随意修改!
8 | 什么都没有找到…请检查您的APK或选择另一台服务器
9 | 出现了一些问题……
10 | 此功能尚未实现
11 | 未实现!
12 | 使用 ZBot 机器人
13 | 使用 YaPB 机器人
14 | -console -game cstrike -bots, etc
15 | 设置游戏路径:
16 | 如果留空则使用Xash3D的目录
17 |
18 |
--------------------------------------------------------------------------------
/android/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 16dp
4 | 16dp
5 |
6 |
--------------------------------------------------------------------------------
/android/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CS16Client
4 | -console -game cstrike -bots, etc
5 | CS16Client Launcher
6 | Launch cs16-client!
7 | Command line arguments:
8 | Don\'t touch if you don\'t know why you need this!
9 | Nothing was found. Check your installation
10 | Something got wrong...
11 | This feature is not implemented yet
12 | Not implemented!
13 | This is not ready! Bugreports are not accepted when this feature is on.
14 | ZBot Enabled
15 | ZBot Disabled
16 | YaPB Enabled
17 | YaPB Disabled
18 | Condition Zero Enabled
19 | Condition Zero Disabled
20 | No engine found
21 | To continue, you must install Xash3D engine on your device
22 | Install
23 | Cancel
24 | First run reminder
25 | Welcome to CS16Client! I just want to remind you that to play this game you must copy original Counter-Strike 1.6 files(only "cstrike" and "valve" folders) from your Steam installation of the game to your device. Good luck, have fun!
26 | OK!
27 |
28 |
29 |
--------------------------------------------------------------------------------
/android/src/in/celest/xash3d/cs16client/InstallReceiver.java:
--------------------------------------------------------------------------------
1 | package in.celest.xash3d.cs16client;
2 | import android.content.BroadcastReceiver;
3 | import android.content.Context;
4 | import android.content.Intent;
5 | import android.util.Log;
6 | import android.content.SharedPreferences;
7 | import java.io.FileOutputStream;
8 | import java.io.File;
9 | import java.io.InputStream;
10 | import java.lang.reflect.Method;
11 |
12 | public class InstallReceiver extends BroadcastReceiver
13 | {
14 | private static final String TAG = "CS16CLIENT_LAUNCHER";
15 | static SharedPreferences mPref;
16 | @Override
17 | public void onReceive( Context context, Intent arg1 )
18 | {
19 | Log.d( TAG, "Install received, extracting PAK" );
20 | extractPAK( context, true );
21 | }
22 |
23 | private static int chmod(String path, int mode) {
24 | int ret = -1;
25 | try
26 | {
27 | ret = Runtime.getRuntime().exec("chmod " + Integer.toOctalString(mode) + " " + path).waitFor();
28 | Log.d(TAG, "chmod " + Integer.toOctalString(mode) + " " + path + ": " + ret );
29 | }
30 | catch(Exception e)
31 | {
32 | ret = -1;
33 | Log.d(TAG, "chmod: Runtime not worked: " + e.toString() );
34 | }
35 | try
36 | {
37 | Class fileUtils = Class.forName("android.os.FileUtils");
38 | Method setPermissions = fileUtils.getMethod("setPermissions",
39 | String.class, int.class, int.class, int.class);
40 | ret = (Integer) setPermissions.invoke(null, path,
41 | mode, -1, -1);
42 | }
43 | catch(Exception e)
44 | {
45 | ret = -1;
46 | Log.d(TAG, "chmod: FileUtils not worked: " + e.toString() );
47 | }
48 | return ret;
49 | }
50 |
51 | private static void extractFile(Context context, String path)
52 | {
53 | try
54 | {
55 | InputStream is = null;
56 | FileOutputStream os = null;
57 | is = context.getAssets().open(path);
58 | File out = new File(context.getFilesDir().getPath()+'/'+path);
59 | out.getParentFile().mkdirs();
60 | chmod( out.getParent(), 0777 );
61 | os = new FileOutputStream(out);
62 | byte[] buffer = new byte[1024];
63 | int length;
64 | while ((length = is.read(buffer)) > 0)
65 | {
66 | os.write(buffer, 0, length);
67 | }
68 | os.close();
69 | is.close();
70 | chmod( context.getFilesDir().getPath()+'/'+path, 0777 );
71 | }
72 | catch( Exception e )
73 | {
74 | Log.e( TAG, "Failed to extract file:" + e.toString() );
75 | e.printStackTrace();
76 | }
77 | }
78 |
79 | private static synchronized void extractPAK(Context context, Boolean force)
80 | {
81 | InputStream is = null;
82 | FileOutputStream os = null;
83 | try
84 | {
85 | if( mPref == null )
86 | mPref = context.getSharedPreferences("mod", 0);
87 | synchronized( mPref )
88 | {
89 | if( mPref.getInt( "pakversion", 0 ) == LauncherActivity.PAK_VERSION && !force )
90 | return;
91 | extractFile(context, "extras.pak");
92 | SharedPreferences.Editor editor = mPref.edit();
93 | editor.putInt( "pakversion", LauncherActivity.PAK_VERSION );
94 | editor.commit();
95 | }
96 | }
97 | catch( Exception e )
98 | {
99 | Log.e( TAG, "Failed to extract PAK:" + e.toString() );
100 | }
101 | }
102 | }
103 |
--------------------------------------------------------------------------------
/android/update:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | echo " ------- UPDATING SUBMODULES ------- "
4 | git submodule foreach git pull origin master
5 |
--------------------------------------------------------------------------------
/cl_dll/Makefile:
--------------------------------------------------------------------------------
1 | CC= gcc -m32
2 | CXX = g++ -m32
3 | SRCS+=../dlls/crossbow.cpp
4 | SRCS+=../dlls/crowbar.cpp
5 | SRCS+=../dlls/egon.cpp
6 | SRCS+=./ev_hldm.cpp
7 | SRCS+=../dlls/gauss.cpp
8 | SRCS+=../dlls/handgrenade.cpp
9 | SRCS+=./hl/hl_baseentity.cpp
10 | SRCS+=./hl/hl_events.cpp
11 | SRCS+=./hl/hl_objects.cpp
12 | SRCS+=./hl/hl_weapons.cpp
13 | SRCS+=../dlls/wpn_shared/hl_wpn_glock.cpp
14 | SRCS+=../dlls/hornetgun.cpp
15 | SRCS+=../common/interface.cpp
16 | SRCS+=../dlls/mp5.cpp
17 | SRCS+=../dlls/python.cpp
18 | SRCS+=../dlls/rpg.cpp
19 | SRCS+=../dlls/satchel.cpp
20 | SRCS+=../dlls/shotgun.cpp
21 | SRCS+=../dlls/squeakgrenade.cpp
22 | SRCS+=../dlls/tripmine.cpp
23 | #SRCS+=../game_shared/voice_banmgr.cpp
24 | #SRCS+=../game_shared/voice_status.cpp
25 | SRCS+=./ammo.cpp
26 | SRCS+=./ammo_secondary.cpp
27 | SRCS+=./ammohistory.cpp
28 | SRCS+=./battery.cpp
29 | SRCS+=./cdll_int.cpp
30 | SRCS+=./com_weapons.cpp
31 | SRCS+=./death.cpp
32 | SRCS+=./demo.cpp
33 | SRCS+=./entity.cpp
34 | SRCS+=./ev_common.cpp
35 | SRCS+=./events.cpp
36 | SRCS+=./flashlight.cpp
37 | SRCS+=./GameStudioModelRenderer.cpp
38 | SRCS+=./geiger.cpp
39 | SRCS+=./health.cpp
40 | SRCS+=./hud.cpp
41 | SRCS+=./hud_msg.cpp
42 | SRCS+=./hud_redraw.cpp
43 | #SRCS+=./hud_servers.cpp
44 | SRCS+=./hud_spectator.cpp
45 | SRCS+=./hud_update.cpp
46 | SRCS+=./in_camera.cpp
47 | SRCS+=./input.cpp
48 | #SRCS+=./inputw32.cpp
49 | SRCS+=./menu.cpp
50 | SRCS+=./message.cpp
51 | SRCS+=./overview.cpp
52 | SRCS+=./parsemsg.cpp
53 | SRCS_C+=../pm_shared/pm_debug.c
54 | SRCS_C+=../pm_shared/pm_math.c
55 | SRCS_C+=../pm_shared/pm_shared.c
56 | SRCS+=./saytext.cpp
57 | SRCS+=./status_icons.cpp
58 | SRCS+=./statusbar.cpp
59 | SRCS+=./studio_util.cpp
60 | SRCS+=./StudioModelRenderer.cpp
61 | SRCS+=./text_message.cpp
62 | SRCS+=./train.cpp
63 | SRCS+=./tri.cpp
64 | SRCS+=./util.cpp
65 | SRCS+=./view.cpp
66 | SRCS+=./input_xash3d.cpp
67 | SRCS+=./scoreboard.cpp
68 | SRCS+=./MOTD.cpp
69 | INCLUDES = -I../common -I. -I../game_shared -I../pm_shared -I../engine -I../dlls
70 | DEFINES = -Wno-write-strings -DLINUX -D_LINUX -Dstricmp=strcasecmp -D_strnicmp=strncasecmp -Dstrnicmp=strncasecmp -DCLIENT_WEAPONS -DCLIENT_DLL -fpermissive -w
71 | CFLAGS = -Og -ggdb
72 | OBJS = $(SRCS:.cpp=.o) $(SRCS_C:.c=.o)
73 | %.o : %.c
74 | $(CC) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@
75 |
76 | %.o : %.cpp
77 | $(CXX) $(CFLAGS) $(INCLUDES) $(DEFINES) -fPIC -c $< -o $@
78 | client.so : $(OBJS)
79 | $(CXX) $(OBJS) -o client.so -shared -Wl,--no-undefined -fPIC -lm -ldl
80 |
81 | clean:
82 | $(RM) $(OBJS)
83 |
--------------------------------------------------------------------------------
/cl_dll/cs_wpn/cs_baseentity.cpp:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 |
16 | /*
17 | ==========================
18 | This file contains "stubs" of class member implementations so that we can predict certain
19 | weapons client side. From time to time you might find that you need to implement part of the
20 | these functions. If so, cut it from here, paste it in hl_weapons.cpp or somewhere else and
21 | add in the functionality you need.
22 | ==========================
23 | */
24 | #include "port.h"
25 | #include "extdll.h"
26 | #include "util.h"
27 | #include "cbase.h"
28 | #include "player.h"
29 | #include "weapons.h"
30 | #include "nodes.h"
31 | #include "soundent.h"
32 | #include "skill.h"
33 |
34 | // Globals used by game logic
35 | const Vector g_vecZero = Vector( 0, 0, 0 );
36 | int gmsgWeapPickup = 0;
37 | enginefuncs_t g_engfuncs;
38 | globalvars_t *gpGlobals;
39 | ItemInfo CBasePlayerItem::ItemInfoArray[MAX_WEAPONS];
40 |
41 |
--------------------------------------------------------------------------------
/cl_dll/demo.cpp:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #include "hud.h"
16 | #include "cl_util.h"
17 | #include "demo.h"
18 | #include "demo_api.h"
19 | #include
20 |
21 | int g_demosniper = 0;
22 | int g_demosniperdamage = 0;
23 | float g_demosniperorg[3];
24 | float g_demosniperangles[3];
25 | float g_demozoom;
26 |
27 | // FIXME: There should be buffer helper functions to avoid all of the *(int *)& crap.
28 |
29 | /*
30 | =====================
31 | Demo_WriteBuffer
32 |
33 | Write some data to the demo stream
34 | =====================
35 | */
36 | void Demo_WriteBuffer( int type, int size, unsigned char *buffer )
37 | {
38 | int pos = 0;
39 | unsigned char buf[ 32 * 1024 ];
40 | *( int * )&buf[pos] = type;
41 | pos+=sizeof( int );
42 |
43 | memcpy( &buf[pos], buffer, size );
44 |
45 | // Write full buffer out
46 | gEngfuncs.pDemoAPI->WriteBuffer( size + sizeof( int ), buf );
47 | }
48 |
49 | /*
50 | =====================
51 | Demo_ReadBuffer
52 |
53 | Engine wants us to parse some data from the demo stream
54 | =====================
55 | */
56 | void DLLEXPORT Demo_ReadBuffer( int size, unsigned char *buffer )
57 | {
58 | int type;
59 | int i = 0;
60 |
61 | type = *( int * )buffer;
62 | i += sizeof( int );
63 | switch ( type )
64 | {
65 | case TYPE_SNIPERDOT:
66 | g_demosniper = *(int * )&buffer[ i ];
67 | i += sizeof( int );
68 |
69 | if ( g_demosniper )
70 | {
71 | g_demosniperdamage = *( int * )&buffer[ i ];
72 | i += sizeof( int );
73 |
74 | g_demosniperangles[ 0 ] = *(float *)&buffer[i];
75 | i += sizeof( float );
76 | g_demosniperangles[ 1 ] = *(float *)&buffer[i];
77 | i += sizeof( float );
78 | g_demosniperangles[ 2 ] = *(float *)&buffer[i];
79 | i += sizeof( float );
80 | g_demosniperorg[ 0 ] = *(float *)&buffer[i];
81 | i += sizeof( float );
82 | g_demosniperorg[ 1 ] = *(float *)&buffer[i];
83 | i += sizeof( float );
84 | g_demosniperorg[ 2 ] = *(float *)&buffer[i];
85 | i += sizeof( float );
86 | }
87 | break;
88 | case TYPE_ZOOM:
89 | g_demozoom = *(float * )&buffer[ i ];
90 | i += sizeof( float );
91 | break;
92 | default:
93 | gEngfuncs.Con_DPrintf( "Unknown demo buffer type, skipping.\n" );
94 | break;
95 | }
96 | }
97 |
--------------------------------------------------------------------------------
/cl_dll/ev_common.cpp:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | // shared event functions
16 | #include "hud.h"
17 | #include "cl_util.h"
18 | #include "const.h"
19 | #include "entity_state.h"
20 | #include "cl_entity.h"
21 |
22 | #include "r_efx.h"
23 |
24 | #include "eventscripts.h"
25 | #include "event_api.h"
26 | #include "pm_shared.h"
27 |
28 | /*
29 | =================
30 | EV_GetGunPosition
31 |
32 | Figure out the height of the gun
33 | =================
34 | */
35 | void EV_GetGunPosition( event_args_t *args, float *pos, float *origin )
36 | {
37 | int idx;
38 | Vector view_ofs(0, 0, 0);
39 |
40 | idx = args->entindex;
41 |
42 | view_ofs[2] = DEFAULT_VIEWHEIGHT;
43 |
44 | if ( EV_IsPlayer( idx ) )
45 | {
46 | // in spec mode use entity viewheigh, not own
47 | if ( EV_IsLocal( idx ) && !IS_FIRSTPERSON_SPEC )
48 | {
49 | // Grab predicted result for local player
50 | gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs );
51 | }
52 | else if ( args->ducking == 1 )
53 | {
54 | view_ofs[2] = VEC_DUCK_VIEW;
55 | }
56 | }
57 |
58 | VectorAdd( origin, view_ofs, pos );
59 | }
60 |
61 | /*
62 | =================
63 | EV_GetDefaultShellInfo
64 |
65 | Determine where to eject shells from
66 | =================
67 | */
68 | void EV_GetDefaultShellInfo( event_args_t *args, float *origin, float *velocity, float *ShellVelocity, float *ShellOrigin, float *forward, float *right, float *up, float forwardScale, float upScale, float rightScale, bool bReverseDirection )
69 | {
70 | int idx = args->entindex;
71 |
72 | vec3_t view_ofs = { 0, 0, DEFAULT_VIEWHEIGHT };
73 | if ( EV_IsPlayer( idx ) )
74 | {
75 | if ( EV_IsLocal( idx ) )
76 | {
77 | gEngfuncs.pEventAPI->EV_LocalPlayerViewheight( view_ofs );
78 | }
79 | else if ( args->ducking == 1 )
80 | {
81 | view_ofs[2] = VEC_DUCK_VIEW;
82 | }
83 | }
84 |
85 | float fR = gEngfuncs.pfnRandomFloat( 50, 70 );
86 | float fU = gEngfuncs.pfnRandomFloat( 75, 175 );
87 | float fF = gEngfuncs.pfnRandomFloat( 25, 250 );
88 | float fDirection = rightScale > 0.0f ? -1.0f : 1.0f;
89 |
90 | for ( int i = 0; i < 3; i++ )
91 | {
92 | if( bReverseDirection )
93 | {
94 | ShellVelocity[i] = velocity[i] * 0.5f - right[i] * fR * fDirection + up[i] * fU + forward[i] * fF;
95 | }
96 | else
97 | {
98 | ShellVelocity[i] = velocity[i] * 0.5f + right[i] * fR * fDirection + up[i] * fU + forward[i] * fF;
99 | }
100 | ShellOrigin[i] = velocity[i] * 0.1f + origin[i] + view_ofs[i] +
101 | upScale * up[i] + forwardScale * forward[i] + rightScale * right[i];
102 | }
103 | }
104 |
--------------------------------------------------------------------------------
/cl_dll/events/event_aug.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 | enum aug_e
30 | {
31 | AUG_IDLE = 0,
32 | AUG_RELOAD,
33 | AUG_DRAW,
34 | AUG_SHOOT1,
35 | AUG_SHOOT2,
36 | AUG_SHOOT3
37 | };
38 |
39 | static const char *SOUNDS_NAME = "weapons/aug-1.wav";
40 |
41 | void EV_FireAUG( struct event_args_s *args )
42 | {
43 | vec3_t ShellVelocity, ShellOrigin;
44 | vec3_t vecSrc, vecAiming;
45 |
46 | int idx = args->entindex;
47 | Vector origin( args->origin );
48 | Vector angles(
49 | args->iparam1 / 100.0f + args->angles[0],
50 | args->iparam2 / 100.0f + args->angles[1],
51 | args->angles[2] );
52 | Vector velocity( args->velocity );
53 | Vector forward, right, up;
54 | AngleVectors( angles, forward, right, up );
55 |
56 | if ( EV_IsLocal( idx ) )
57 | {
58 | ++g_iShotsFired;
59 | EV_MuzzleFlash();
60 | gEngfuncs.pEventAPI->EV_WeaponAnimation(Com_RandomLong(AUG_SHOOT1, AUG_SHOOT3), 2);
61 | if( !gHUD.cl_righthand->value )
62 | {
63 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 17.0, -8.0, -14.0, 0);
64 | }
65 | else
66 | {
67 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 17.0, -8.0, 14.0, 0);
68 | }
69 | }
70 | else
71 | {
72 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -12.0, 4.0, 0);
73 | }
74 |
75 | EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], g_iRShell, TE_BOUNCE_SHELL);
76 |
77 | PLAY_EVENT_SOUND( SOUNDS_NAME );
78 |
79 | EV_GetGunPosition( args, vecSrc, origin );
80 | VectorCopy( forward, vecAiming );
81 | Vector vSpread;
82 |
83 | vSpread.x = args->fparam1;
84 | vSpread.y = args->fparam2;
85 | EV_HLDM_FireBullets( idx,
86 | forward, right, up,
87 | 1, vecSrc, vecAiming,
88 | vSpread, 8192.0, BULLET_PLAYER_556MM,
89 | 2 );
90 | }
91 |
--------------------------------------------------------------------------------
/cl_dll/events/event_awp.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum awp_e
31 | {
32 | AWP_IDLE = 0,
33 | AWP_SHOOT1,
34 | AWP_SHOOT2,
35 | AWP_SHOOT3,
36 | AWP_RELOAD,
37 | AWP_DRAW
38 | };
39 |
40 | static const char *SOUNDS_NAME = "weapons/awp1.wav";
41 |
42 | void EV_FireAWP( event_args_t *args )
43 | {
44 | vec3_t vecSrc, vecAiming;
45 |
46 | int idx = args->entindex;
47 | Vector origin( args->origin );
48 | Vector angles(
49 | args->iparam1 / 100.0f + args->angles[0],
50 | args->iparam2 / 100.0f + args->angles[1],
51 | args->angles[2]
52 | );
53 | Vector forward, right, up;
54 |
55 | AngleVectors( angles, forward, right, up );
56 |
57 | if ( EV_IsLocal( idx ) )
58 | {
59 | ++g_iShotsFired;
60 | EV_MuzzleFlash();
61 | gEngfuncs.pEventAPI->EV_WeaponAnimation( Com_RandomLong(AWP_SHOOT1, AWP_SHOOT3), 2 );
62 | }
63 |
64 | PLAY_EVENT_SOUND( SOUNDS_NAME );
65 |
66 | EV_GetGunPosition( args, vecSrc, origin );
67 | VectorCopy( forward, vecAiming );
68 | Vector vSpread;
69 |
70 | vSpread.x = args->fparam1;
71 | vSpread.y = args->fparam2;
72 | EV_HLDM_FireBullets( idx,
73 | forward, right, up,
74 | 1, vecSrc, vecAiming,
75 | vSpread, 8192.0, BULLET_PLAYER_338MAG,
76 | 3 );
77 | }
78 |
--------------------------------------------------------------------------------
/cl_dll/events/event_createexplo.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | void EV_CreateExplo(event_args_s *args)
31 | {
32 | gEngfuncs.Con_DPrintf("^3 CREATE EXPLO EXPLO EXPLO EXPLO!!!111");
33 | }
34 |
--------------------------------------------------------------------------------
/cl_dll/events/event_decal_reset.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | #include
31 |
32 | float g_flRoundTime = 0.0f;
33 |
34 | void EV_DecalReset(event_args_s *args)
35 | {
36 | int decalnum = (int)(gEngfuncs.pfnGetCvarFloat("r_decals"));
37 |
38 | for( int i = 0; i < decalnum; i++ )
39 | gEngfuncs.pEfxAPI->R_DecalRemoveAll(i);
40 |
41 | g_flRoundTime = gEngfuncs.GetClientTime();
42 | }
43 |
--------------------------------------------------------------------------------
/cl_dll/events/event_elite_right.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | // Hi! :+)
29 |
--------------------------------------------------------------------------------
/cl_dll/events/event_g3sg1.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum g3sg1_e
31 | {
32 | G3SG1_IDLE,
33 | G3SG1_SHOOT,
34 | G3SG1_SHOOT2,
35 | G3SG1_RELOAD,
36 | G3SG1_DRAW
37 | };
38 |
39 | static const char *SOUNDS_NAME = "weapons/g3sg1-1.wav";
40 |
41 | void EV_FireG3SG1(event_args_s *args)
42 | {
43 | vec3_t ShellVelocity, ShellOrigin;
44 | vec3_t vecSrc, vecAiming;
45 |
46 | int idx = args->entindex;
47 | Vector origin( args->origin );
48 | Vector angles(
49 | args->iparam1 / 100.0f + args->angles[0],
50 | args->iparam2 / 100.0f + args->angles[1],
51 | args->angles[2]
52 | );
53 | Vector velocity( args->velocity );
54 | Vector forward, right, up;
55 | AngleVectors( angles, forward, right, up );
56 |
57 | if ( EV_IsLocal( args->entindex ) )
58 | {
59 | ++g_iShotsFired;
60 | gEngfuncs.pEventAPI->EV_WeaponAnimation(Com_RandomLong(G3SG1_SHOOT, G3SG1_SHOOT2), 2);
61 | EV_MuzzleFlash();
62 | if( !gHUD.cl_righthand->value )
63 | {
64 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -8.0, -10.0, 0);
65 | }
66 | else
67 | {
68 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 17.0, -8.0, 10.0, 0);
69 | }
70 | }
71 | else
72 | {
73 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -12.0, 4.0, 0);
74 | }
75 |
76 |
77 | EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], g_iRShell, TE_BOUNCE_SHELL);
78 |
79 | PLAY_EVENT_SOUND( SOUNDS_NAME );
80 |
81 | EV_GetGunPosition( args, vecSrc, origin );
82 | VectorCopy( forward, vecAiming );
83 | Vector vSpread;
84 |
85 | vSpread.x = args->fparam1;
86 | vSpread.y = args->fparam2;
87 | EV_HLDM_FireBullets( idx,
88 | forward, right, up,
89 | 1, vecSrc, vecAiming,
90 | vSpread, 8192.0, BULLET_PLAYER_762MM,
91 | 2 );
92 | }
93 |
--------------------------------------------------------------------------------
/cl_dll/events/event_knife.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum knife_e
31 | {
32 | KNIFE_IDLE1 = 0,
33 | KNIFE_SLASH1,
34 | KNIFE_SLASH2,
35 | KNIFE_DRAW,
36 | KNIFE_STAB,
37 | KNIFE_STAB_MISS,
38 | KNIFE_MIDSLASH1,
39 | KNIFE_MIDSLASH2
40 | };
41 |
42 | static const char *SOUNDS_NAME = "weapons/knife_miss1.wav";
43 |
44 | void EV_Knife( struct event_args_s *args )
45 | {
46 | int idx = args->entindex;
47 | Vector origin( args->origin );
48 |
49 | if( EV_IsLocal( idx ))
50 | gEngfuncs.pEventAPI->EV_WeaponAnimation( args->iparam1, 2 );
51 |
52 | //Play Swing sound
53 | PLAY_EVENT_SOUND( SOUNDS_NAME );
54 | }
55 |
--------------------------------------------------------------------------------
/cl_dll/events/event_m3.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum m3_e
31 | {
32 | M3_IDLE1 = 0,
33 | M3_SHOOT1,
34 | M3_SHOOT2,
35 | M3_INSERT,
36 | M3_AFTER_RELOAD,
37 | M3_START_RELOAD,
38 | M3_DRAW
39 | };
40 |
41 | static const char *SOUNDS_NAME = "weapons/m3-1.wav";
42 |
43 | void EV_FireM3( event_args_t *args )
44 | {
45 | vec3_t vecSrc, vecAiming;
46 | int idx = args->entindex;
47 | Vector origin( args->origin );
48 | Vector angles(
49 | args->iparam1 / 100.0f + args->angles[0],
50 | args->iparam2 / 100.0f + args->angles[1],
51 | args->angles[2]
52 | );
53 | Vector forward, right, up;
54 |
55 | AngleVectors( angles, forward, right, up );
56 |
57 | if ( EV_IsLocal( idx ) )
58 | {
59 | ++g_iShotsFired;
60 | EV_MuzzleFlash();
61 | gEngfuncs.pEventAPI->EV_WeaponAnimation(Com_RandomLong(M3_SHOOT1, M3_SHOOT2), 2);
62 | }
63 |
64 | PLAY_EVENT_SOUND( SOUNDS_NAME );
65 |
66 | EV_GetGunPosition( args, vecSrc, origin );
67 | VectorCopy( forward, vecAiming );
68 | Vector vSpread;
69 |
70 | vSpread.x = 0.0725;
71 | vSpread.y = 0.0725;
72 | EV_HLDM_FireBullets( idx,
73 | forward, right, up,
74 | 9, vecSrc, vecAiming,
75 | vSpread, 8192.0, BULLET_PLAYER_BUCKSHOT,
76 | 1 );
77 | }
78 |
--------------------------------------------------------------------------------
/cl_dll/events/event_mac10.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum mac10_e
31 | {
32 | MAC10_IDLE1,
33 | MAC10_RELOAD,
34 | MAC10_DRAW,
35 | MAC10_SHOOT1,
36 | MAC10_SHOOT2,
37 | MAC10_SHOOT3
38 | };
39 |
40 | static const char *SOUNDS_NAME = "weapons/mac10-1.wav";
41 |
42 | void EV_FireMAC10(event_args_s *args)
43 | {
44 | vec3_t ShellVelocity, ShellOrigin;
45 | vec3_t vecSrc, vecAiming;
46 | int idx = args->entindex;
47 | Vector origin( args->origin );
48 | Vector angles(
49 | args->iparam1 / 100.0f + args->angles[0],
50 | args->iparam2 / 100.0f + args->angles[1],
51 | args->angles[2]
52 | );
53 | Vector velocity( args->velocity );
54 | Vector forward, right, up;
55 |
56 | AngleVectors( angles, forward, right, up );
57 |
58 | if ( EV_IsLocal( args->entindex ) )
59 | {
60 | ++g_iShotsFired;
61 | gEngfuncs.pEventAPI->EV_WeaponAnimation(Com_RandomLong(MAC10_SHOOT1, MAC10_SHOOT3), 2);
62 | EV_MuzzleFlash();
63 | if( !gHUD.cl_righthand->value )
64 | {
65 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 32.0, -9.0, -11.0, 0);
66 | }
67 | else
68 | {
69 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 32.0, -9.0, 11.0, 0);
70 | }
71 | }
72 | else
73 | {
74 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -12.0, 4.0, 0);
75 | }
76 |
77 |
78 | EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], g_iRShell, TE_BOUNCE_SHELL);
79 |
80 | PLAY_EVENT_SOUND( SOUNDS_NAME );
81 |
82 | EV_GetGunPosition( args, vecSrc, origin );
83 | VectorCopy( forward, vecAiming );
84 | Vector vSpread;
85 |
86 | vSpread.x = args->fparam1;
87 | vSpread.y = args->fparam2;
88 | EV_HLDM_FireBullets( idx,
89 | forward, right, up,
90 | 1, vecSrc, vecAiming,
91 | vSpread, 8192.0, BULLET_PLAYER_45ACP,
92 | 2 );
93 | }
94 |
--------------------------------------------------------------------------------
/cl_dll/events/event_p90.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 | enum p90_e
30 | {
31 | P90_IDLE1,
32 | P90_RELOAD,
33 | P90_DRAW,
34 | P90_SHOOT1,
35 | P90_SHOOT2,
36 | P90_SHOOT3
37 | };
38 |
39 | static const char *SOUNDS_NAME = "weapons/p90-1.wav";
40 |
41 | void EV_FireP90(event_args_s *args)
42 | {
43 | vec3_t ShellVelocity, ShellOrigin;
44 | vec3_t vecSrc, vecAiming;
45 | int idx = args->entindex;
46 | Vector origin( args->origin );
47 | Vector angles(
48 | args->iparam1 / 100.0f + args->angles[0],
49 | args->iparam2 / 100.0f + args->angles[1],
50 | args->angles[2]
51 | );
52 | Vector velocity( args->velocity );
53 | Vector forward, right, up;
54 |
55 | AngleVectors( angles, forward, right, up );
56 |
57 | if ( EV_IsLocal( args->entindex ) )
58 | {
59 | ++g_iShotsFired;
60 | gEngfuncs.pEventAPI->EV_WeaponAnimation(Com_RandomLong(P90_SHOOT1, P90_SHOOT3), 2);
61 | EV_MuzzleFlash();
62 | if( !gHUD.cl_righthand->value )
63 | {
64 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 35.0, -16.0, -22.0, 0);
65 | }
66 | else
67 | {
68 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 35.0, -16.0, 22.0, 0);
69 | }
70 | }
71 | else
72 | {
73 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -12.0, 4.0, 0);
74 | }
75 |
76 | EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], g_iRShell, TE_BOUNCE_SHELL);
77 |
78 | PLAY_EVENT_SOUND( SOUNDS_NAME );
79 |
80 | EV_GetGunPosition( args, vecSrc, origin );
81 | VectorCopy( forward, vecAiming );
82 | Vector vSpread;
83 |
84 | vSpread.x = args->fparam1;
85 | vSpread.y = args->fparam2;
86 | EV_HLDM_FireBullets( idx,
87 | forward, right, up,
88 | 1, vecSrc, vecAiming,
89 | vSpread, 8192.0, BULLET_PLAYER_57MM,
90 | 2 );
91 | }
92 |
--------------------------------------------------------------------------------
/cl_dll/events/event_scout.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum scout_e
31 | {
32 | SCOUT_IDLE,
33 | SCOUT_SHOOT,
34 | SCOUT_SHOOT2,
35 | SCOUT_RELOAD,
36 | SCOUT_DRAW
37 | };
38 |
39 | static const char *SOUNDS_NAME = "weapons/scout_fire-1.wav";
40 |
41 | void EV_FireScout(event_args_s *args)
42 | {
43 | vec3_t vecSrc, vecAiming;
44 |
45 | int idx = args->entindex;
46 | Vector origin( args->origin );
47 | Vector angles(
48 | args->iparam1 / 100.0f + args->angles[0],
49 | args->iparam2 / 100.0f + args->angles[1],
50 | args->angles[2]
51 | );
52 | Vector forward, right, up;
53 |
54 | AngleVectors( angles, forward, right, up );
55 |
56 | if ( EV_IsLocal( idx ) )
57 | {
58 | ++g_iShotsFired;
59 | EV_MuzzleFlash();
60 | gEngfuncs.pEventAPI->EV_WeaponAnimation( Com_RandomLong(SCOUT_SHOOT, SCOUT_SHOOT2), 2 );
61 | }
62 |
63 | PLAY_EVENT_SOUND( SOUNDS_NAME );
64 |
65 | EV_GetGunPosition( args, vecSrc, origin );
66 | VectorCopy( forward, vecAiming );
67 | Vector vSpread;
68 |
69 | vSpread.x = args->fparam1 / 1000.0f;
70 | vSpread.y = args->fparam2 / 1000.0f;
71 | EV_HLDM_FireBullets( idx,
72 | forward, right, up,
73 | 1, vecSrc, vecAiming,
74 | vSpread, 8192.0, BULLET_PLAYER_762MM,
75 | 2 );
76 | }
77 |
--------------------------------------------------------------------------------
/cl_dll/events/event_sg550.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum sg550_e
31 | {
32 | SG550_IDLE,
33 | SG550_SHOOT,
34 | SG550_SHOOT2,
35 | SG550_RELOAD,
36 | SG550_DRAW
37 | };
38 |
39 | static const char *SOUNDS_NAME = "weapons/sg550-1.wav";
40 |
41 | void EV_FireSG550(event_args_s *args)
42 | {
43 | vec3_t ShellVelocity;
44 | vec3_t ShellOrigin;
45 | vec3_t vecSrc, vecAiming;
46 | int idx = args->entindex;
47 | Vector origin( args->origin );
48 | Vector angles(
49 | args->iparam1 / 100.0f + args->angles[0],
50 | args->iparam2 / 100.0f + args->angles[1],
51 | args->angles[2]
52 | );
53 | Vector velocity( args->velocity );
54 | Vector forward, right, up;
55 |
56 | AngleVectors( angles, forward, right, up );
57 |
58 | if ( EV_IsLocal( idx ) )
59 | {
60 | ++g_iShotsFired;
61 | EV_MuzzleFlash();
62 | gEngfuncs.pEventAPI->EV_WeaponAnimation( Com_RandomLong(SG550_SHOOT, SG550_SHOOT2), 2 );
63 | if( !gHUD.cl_righthand->value )
64 | {
65 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -8.0, -10.0, 0);
66 | }
67 | else
68 | {
69 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 17.0, -8.0, 10.0, 0);
70 | }
71 | }
72 | else
73 | {
74 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -12.0, 4.0, 0);
75 | }
76 |
77 | EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], g_iRShell, TE_BOUNCE_SHELL);
78 |
79 | PLAY_EVENT_SOUND( SOUNDS_NAME );
80 |
81 |
82 | EV_GetGunPosition( args, vecSrc, origin );
83 | VectorCopy( forward, vecAiming );
84 | Vector vSpread;
85 |
86 | vSpread.x = args->fparam1;
87 | vSpread.y = args->fparam2;
88 | EV_HLDM_FireBullets( idx,
89 | forward, right, up,
90 | 1, vecSrc, vecAiming,
91 | vSpread, 8192.0, BULLET_PLAYER_556MM,
92 | 2 );
93 | }
94 |
--------------------------------------------------------------------------------
/cl_dll/events/event_ump45.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #include "events.h"
29 |
30 | enum ump45_e
31 | {
32 | UMP45_IDLE1,
33 | UMP45_RELOAD,
34 | UMP45_DRAW,
35 | UMP45_SHOOT1,
36 | UMP45_SHOOT2,
37 | UMP45_SHOOT3
38 | };
39 |
40 | static const char *SOUNDS_NAME = "weapons/ump45-1.wav";
41 |
42 | void EV_FireUMP45(event_args_s *args)
43 | {
44 | vec3_t ShellVelocity;
45 | vec3_t ShellOrigin;
46 | vec3_t vecSrc, vecAiming;
47 | int idx = args->entindex;
48 | Vector origin( args->origin );
49 | Vector angles(
50 | args->iparam1 / 100.0f + args->angles[0],
51 | args->iparam2 / 100.0f + args->angles[1],
52 | args->angles[2]
53 | );
54 | Vector velocity( args->velocity );
55 | Vector forward, right, up;
56 |
57 | AngleVectors( angles, forward, right, up );
58 |
59 | if ( EV_IsLocal( idx ) )
60 | {
61 | ++g_iShotsFired;
62 | EV_MuzzleFlash();
63 | gEngfuncs.pEventAPI->EV_WeaponAnimation(Com_RandomLong(UMP45_SHOOT1, UMP45_SHOOT3), 2);
64 | if( !gHUD.cl_righthand->value )
65 | {
66 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 34.0, -10.0, -11.0, 0);
67 | }
68 | else
69 | {
70 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 34.0, -10.0, 11.0, 0);
71 | }
72 | }
73 | else
74 | {
75 | EV_GetDefaultShellInfo( args, origin, velocity, ShellVelocity, ShellOrigin, forward, right, up, 20.0, -12.0, 4.0, 0);
76 | }
77 |
78 | EV_EjectBrass(ShellOrigin, ShellVelocity, angles[ YAW ], g_iPShell, TE_BOUNCE_SHELL);
79 | PLAY_EVENT_SOUND( SOUNDS_NAME );
80 | EV_GetGunPosition( args, vecSrc, origin );
81 | VectorCopy( forward, vecAiming );
82 | Vector vSpread;
83 |
84 | vSpread.x = args->fparam1;
85 | vSpread.y = args->fparam2;
86 | EV_HLDM_FireBullets( idx,
87 | forward, right, up,
88 | 1, vecSrc, vecAiming,
89 | vSpread, 8192.0, BULLET_PLAYER_45ACP,
90 | 2 );
91 | }
92 |
--------------------------------------------------------------------------------
/cl_dll/events/hl_events.cpp:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #include "events.h"
16 |
17 | int g_iRShell, g_iPShell, g_iBlackSmoke, g_iShotgunShell;
18 |
19 | /*
20 | ======================
21 | Game_HookEvents
22 |
23 | Associate script file name with callback functions. Callback's must be extern "C" so
24 | the engine doesn't get confused about name mangling stuff. Note that the format is
25 | always the same. Of course, a clever mod team could actually embed parameters, behavior
26 | into the actual .sc files and create a .sc file parser and hook their functionality through
27 | that.. i.e., a scripting system.
28 |
29 | That was what we were going to do, but we ran out of time...oh well.
30 | ======================
31 | */
32 | void Game_HookEvents( void )
33 | {
34 | HOOK_EVENT( ak47, FireAK47 );
35 | HOOK_EVENT( aug, FireAUG );
36 | HOOK_EVENT( awp, FireAWP );
37 | HOOK_EVENT( createexplo, CreateExplo );
38 | HOOK_EVENT( createsmoke, CreateSmoke );
39 | HOOK_EVENT( deagle, FireDEAGLE );
40 | HOOK_EVENT( decal_reset, DecalReset );
41 | HOOK_EVENT( elite_left, FireEliteLeft );
42 | HOOK_EVENT( elite_right, FireEliteRight );
43 | HOOK_EVENT( famas, FireFAMAS );
44 | HOOK_EVENT( fiveseven, Fire57 );
45 | HOOK_EVENT( g3sg1, FireG3SG1 );
46 | HOOK_EVENT( galil, FireGALIL );
47 | HOOK_EVENT( glock18, Fireglock18 );
48 | HOOK_EVENT( knife, Knife );
49 | HOOK_EVENT( m249, FireM249 );
50 | HOOK_EVENT( m3, FireM3 );
51 | HOOK_EVENT( m4a1, FireM4A1 );
52 | HOOK_EVENT( mac10, FireMAC10 );
53 | HOOK_EVENT( mp5n, FireMP5 );
54 | HOOK_EVENT( p228, FireP228 );
55 | HOOK_EVENT( p90, FireP90 );
56 | HOOK_EVENT( scout, FireScout );
57 | HOOK_EVENT( sg550, FireSG550 );
58 | HOOK_EVENT( sg552, FireSG552 );
59 | HOOK_EVENT( tmp, FireTMP );
60 | HOOK_EVENT( ump45, FireUMP45 );
61 | HOOK_EVENT( usp, FireUSP );
62 | HOOK_EVENT( vehicle, Vehicle );
63 | HOOK_EVENT( xm1014, FireXM1014 );
64 | }
65 |
--------------------------------------------------------------------------------
/cl_dll/hud/hud_update.cpp:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | //
16 | // hud_update.cpp
17 | //
18 |
19 | #include
20 | #include "hud.h"
21 | #include "cl_util.h"
22 | #include
23 | #include
24 |
25 | int CL_ButtonBits( int );
26 | void CL_ResetButtonBits( int bits );
27 |
28 | extern float v_idlescale;
29 | extern void HUD_SetCmdBits( int bits );
30 |
31 | int CHud::UpdateClientData(client_data_t *cdata, float time)
32 | {
33 | m_vecOrigin = cdata->origin;
34 | m_vecAngles = cdata->viewangles;
35 |
36 | m_iKeyBits = CL_ButtonBits( 0 );
37 | m_iWeaponBits = cdata->iWeaponBits;
38 |
39 | Think();
40 |
41 | cdata->fov = m_iFOV;
42 |
43 | v_idlescale = m_iConcussionEffect;
44 |
45 | CL_ResetButtonBits( m_iKeyBits );
46 |
47 | // return 1 if in anything in the client_data struct has been changed, 0 otherwise
48 | return 1;
49 | }
50 |
51 |
52 |
--------------------------------------------------------------------------------
/cl_dll/hud/train.cpp:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | //
16 | // Train.cpp
17 | //
18 | // implementation of CHudAmmo class
19 | //
20 |
21 | #include "hud.h"
22 | #include "cl_util.h"
23 | #include
24 | #include
25 | #include "parsemsg.h"
26 | #include "draw_util.h"
27 |
28 | DECLARE_MESSAGE(m_Train, Train )
29 |
30 |
31 | int CHudTrain::Init(void)
32 | {
33 | HOOK_MESSAGE( Train );
34 |
35 | m_iPos = 0;
36 | m_iFlags = 0;
37 | gHUD.AddHudElem(this);
38 |
39 | return 1;
40 | }
41 |
42 | int CHudTrain::VidInit(void)
43 | {
44 | m_hSprite = 0;
45 |
46 | return 1;
47 | }
48 |
49 | int CHudTrain::Draw(float fTime)
50 | {
51 | if ( !m_hSprite )
52 | m_hSprite = LoadSprite("sprites/%d_train.spr");
53 |
54 | if (m_iPos)
55 | {
56 | int r, g, b, x, y;
57 |
58 | DrawUtils::UnpackRGB(r,g,b, RGB_YELLOWISH);
59 | SPR_Set(m_hSprite, r, g, b );
60 |
61 | // This should show up to the right and part way up the armor number
62 | y = ScreenHeight - SPR_Height(m_hSprite,0) - gHUD.m_iFontHeight;
63 | x = ScreenWidth/3 + SPR_Width(m_hSprite,0)/4;
64 |
65 | SPR_DrawAdditive( m_iPos - 1, x, y, NULL);
66 |
67 | }
68 |
69 | return 1;
70 | }
71 |
72 |
73 | int CHudTrain::MsgFunc_Train(const char *pszName, int iSize, void *pbuf)
74 | {
75 | BufferReader reader( pszName, pbuf, iSize );
76 |
77 | // update Train data
78 | m_iPos = reader.ReadByte();
79 |
80 | if (m_iPos)
81 | m_iFlags |= HUD_DRAW;
82 | else
83 | m_iFlags &= ~HUD_DRAW;
84 |
85 | return 1;
86 | }
87 |
--------------------------------------------------------------------------------
/cl_dll/include/camera.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | // Camera.h -- defines and such for a 3rd person camera
9 | // NOTE: must include quakedef.h first
10 | #pragma once
11 | #ifndef _CAMERA_H_
12 | #define _CAMEA_H_
13 |
14 | // pitch, yaw, dist
15 | extern vec3_t cam_ofs;
16 | // Using third person camera
17 | extern int cam_thirdperson;
18 |
19 | void CAM_Init( void );
20 | void CAM_ClearStates( void );
21 | void CAM_StartMouseMove(void);
22 | void CAM_EndMouseMove(void);
23 |
24 | #endif // _CAMERA_H_
25 |
--------------------------------------------------------------------------------
/cl_dll/include/com_weapons.h:
--------------------------------------------------------------------------------
1 | //========= Copyright пїЅ 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | // com_weapons.h
9 | // Shared weapons common function prototypes
10 | #if !defined( COM_WEAPONSH )
11 | #define COM_WEAPONSH
12 |
13 |
14 | #include "hud_iface.h"
15 |
16 | #define PLAYER_CAN_SHOOT (1 << 0)
17 | #define PLAYER_FREEZE_TIME_OVER ( 1 << 1 )
18 | #define PLAYER_IN_BOMB_ZONE (1 << 2)
19 | #define PLAYER_HOLDING_SHIELD (1 << 3)
20 |
21 | #define CROSSHAIR_
22 | #define ACCURACY_AIR (1 << 0) // accuracy depends on FL_ONGROUND
23 | #define ACCURACY_SPEED (1 << 1)
24 | #define ACCURACY_DUCK (1 << 2) // more accurate when ducking
25 | #define ACCURACY_MULTIPLY_BY_14 (1 << 3) // accuracy multiply to 1.4
26 | #define ACCURACY_MULTIPLY_BY_14_2 (1 << 4) // accuracy multiply to 1.4
27 |
28 | #ifndef WPNSTATE_USP_SILENCED
29 | #define WPNSTATE_USP_SILENCED (1<<0)
30 | #define WPNSTATE_GLOCK18_BURST_MODE (1<<1)
31 | #define WPNSTATE_M4A1_SILENCED (1<<2)
32 | #define WPNSTATE_ELITE_LEFT (1<<3)
33 | #define WPNSTATE_FAMAS_BURST_MODE (1<<4)
34 | #define WPNSTATE_SHIELD_DRAWN (1<<5)
35 | #endif
36 |
37 |
38 | extern "C"
39 | {
40 | void _DLLEXPORT HUD_PostRunCmd( struct local_state_s *from, struct local_state_s *to, struct usercmd_s *cmd, int runfuncs, double time, unsigned int random_seed );
41 | }
42 |
43 | void COM_Log( char *pszFile, char *fmt, ...);
44 | bool CL_IsDead();
45 |
46 | float UTIL_SharedRandomFloat( unsigned int seed, float low, float high );
47 | int UTIL_SharedRandomLong( unsigned int seed, int low, int high );
48 |
49 | int HUD_GetWeaponAnim( void );
50 | void HUD_SendWeaponAnim(int iAnim, int iWeaponId, int iBody, int iForce = 0 );
51 | int HUD_GetWeapon( void );
52 | void HUD_PlaySound( char *sound, float volume );
53 | void HUD_PlaybackEvent( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
54 | //void HUD_SetMaxSpeed( const struct edict_s *ed, float speed );
55 | int GetWeaponAccuracyFlags( int weaponid );
56 |
57 | extern cvar_t *cl_lw;
58 |
59 | extern int g_runfuncs;
60 | extern vec3_t v_angles;
61 | extern float g_lastFOV;
62 | extern int g_iWeaponFlags;
63 | extern bool g_bInBombZone;
64 | extern int g_iFreezeTimeOver;
65 | extern bool g_bHoldingShield;
66 | extern bool g_bHoldingKnife;
67 | extern int g_iPlayerFlags;
68 | extern float g_flPlayerSpeed;
69 | extern Vector g_vPlayerVelocity;
70 | extern struct local_state_s *g_curstate;
71 | extern struct local_state_s *g_finalstate;
72 | extern int g_iShotsFired;
73 |
74 | #endif
75 |
--------------------------------------------------------------------------------
/cl_dll/include/csprite.h:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | *
4 | * This program is free software; you can redistribute it and/or modify it
5 | * under the terms of the GNU General Public License as published by the
6 | * Free Software Foundation; either version 2 of the License, or (at
7 | * your option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 | * General Public License for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License
15 | * along with this program; if not, write to the Free Software Foundation,
16 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 | *
18 | * In addition, as a special exception, the author gives permission to
19 | * link the code of this program with the Half-Life Game Engine ("HL
20 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
21 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
22 | * respects for all of the code used other than the HL Engine and MODs
23 | * from Valve. If you modify this file, you may extend this exception
24 | * to your version of the file, but you are not obligated to do so. If
25 | * you do not wish to do so, delete this exception statement from your
26 | * version.
27 | *
28 | */
29 |
30 | #pragma once
31 | #ifndef CSPRITE_H
32 | #define CSPRITE_H
33 |
34 | // defined in util.cpp
35 | HSPRITE HUD_GetSprite( int index );
36 | wrect_t HUD_GetSpriteRect( int index );
37 | int HUD_GetSpriteIndexByName( const char *sz );
38 |
39 | class CClientSprite {
40 | public:
41 | inline CClientSprite(const char *sprName)
42 | {
43 | SetSpriteByName(sprName);
44 | }
45 | inline CClientSprite()
46 | {
47 | spr = 0;
48 | rect.bottom = rect.left = rect.right = rect.top = 0;
49 | }
50 |
51 | inline void SetSpriteByName( const char *sprName )
52 | {
53 | index = HUD_GetSpriteIndexByName(sprName);
54 | spr = HUD_GetSprite(index);
55 | rect = HUD_GetSpriteRect(index);
56 | }
57 |
58 | int index;
59 | HSPRITE spr;
60 | wrect_t rect;
61 | };
62 |
63 | #endif
64 |
--------------------------------------------------------------------------------
/cl_dll/include/demo.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #if !defined( DEMOH )
9 | #define DEMOH
10 |
11 | // Types of demo messages we can write/parse
12 | enum
13 | {
14 | TYPE_SNIPERDOT = 0,
15 | TYPE_ZOOM
16 | };
17 |
18 | void Demo_WriteBuffer( int type, int size, unsigned char *buffer );
19 |
20 | extern int g_demosniper;
21 | extern int g_demosniperdamage;
22 | extern float g_demosniperorg[3];
23 | extern float g_demosniperangles[3];
24 | extern float g_demozoom;
25 |
26 | #endif
--------------------------------------------------------------------------------
/cl_dll/include/ev_hldm.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #if !defined ( EV_HLDMH )
9 | #define EV_HLDMH
10 |
11 | // bullet types
12 | typedef enum
13 | {
14 | BULLET_NONE = 0,
15 | BULLET_PLAYER_9MM,
16 | BULLET_PLAYER_MP5,
17 | BULLET_PLAYER_357,
18 | BULLET_PLAYER_BUCKSHOT,
19 | BULLET_PLAYER_CROWBAR,
20 |
21 | BULLET_MONSTER_9MM,
22 | BULLET_MONSTER_MP5,
23 | BULLET_MONSTER_12MM,
24 |
25 | BULLET_PLAYER_45ACP,
26 | BULLET_PLAYER_338MAG,
27 | BULLET_PLAYER_762MM,
28 | BULLET_PLAYER_556MM,
29 | BULLET_PLAYER_50AE,
30 | BULLET_PLAYER_57MM,
31 | BULLET_PLAYER_357SIG
32 | }
33 | Bullet;
34 |
35 | enum
36 | {
37 | SMOKE_WALLPUFF = 0,
38 | SMOKE_RIFLE,
39 | SMOKE_PISTOL,
40 | SMOKE_BLACK
41 | };
42 |
43 | void EV_HLDM_GunshotDecalTrace(pmtrace_t *pTrace, char *decalName , char chTextureType);
44 | void EV_HLDM_DecalGunshot(pmtrace_t *pTrace, int iBulletType, float scale, int r, int g, int b, bool bCreateSparks, char cTextureType, bool isSky);
45 | void EV_HLDM_FireBullets(int idx,
46 | float *forward, float *right, float *up,
47 | int cShots,
48 | float *vecSrc, float *vecDirShooting, float *vecSpread,
49 | float flDistance, int iBulletType, int iPenetration);
50 | void EV_CS16Client_KillEveryRound( struct tempent_s *te, float frametime, float currenttime );
51 | void EV_CS16Client_CreateSmoke(int type, Vector origin, Vector dir, int speed, float scale, int r, int g, int b , bool wind, Vector velocity = Vector(0, 0, 0), int framerate = 35 );
52 | #endif // EV_HLDMH
53 |
--------------------------------------------------------------------------------
/cl_dll/include/hud/ammo.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #pragma once
16 | #ifndef __AMMO_H__
17 | #define __AMMO_H__
18 |
19 | #define MAX_WEAPON_NAME 128
20 |
21 |
22 | #define WEAPON_FLAGS_SELECTONEMPTY 1
23 |
24 | #define WEAPON_IS_ONTARGET 0x40
25 |
26 | struct WEAPON
27 | {
28 | char szName[MAX_WEAPON_NAME];
29 | int iAmmoType;
30 | int iAmmo2Type;
31 | int iMax1;
32 | int iMax2;
33 | int iSlot;
34 | int iSlotPos;
35 | int iFlags;
36 | int iId;
37 | int iClip;
38 |
39 | int iCount; // # of itesm in plist
40 |
41 | HSPRITE hActive;
42 | wrect_t rcActive;
43 | HSPRITE hInactive;
44 | wrect_t rcInactive;
45 | HSPRITE hAmmo;
46 | wrect_t rcAmmo;
47 | HSPRITE hAmmo2;
48 | wrect_t rcAmmo2;
49 | HSPRITE hCrosshair;
50 | wrect_t rcCrosshair;
51 | HSPRITE hAutoaim;
52 | wrect_t rcAutoaim;
53 | HSPRITE hZoomedCrosshair;
54 | wrect_t rcZoomedCrosshair;
55 | HSPRITE hZoomedAutoaim;
56 | wrect_t rcZoomedAutoaim;
57 | };
58 |
59 | typedef int AMMO;
60 |
61 |
62 | #endif
--------------------------------------------------------------------------------
/cl_dll/include/hud/hud_iface.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #if !defined( HUD_IFACEH )
9 | #define HUD_IFACEH
10 |
11 | #include "exportdef.h"
12 |
13 | typedef int (*pfnUserMsgHook)(const char *pszName, int iSize, void *pbuf);
14 | #include "wrect.h"
15 | #include "../engine/cdll_int.h"
16 | extern cl_enginefunc_t gEngfuncs;
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/cl_dll/include/hud/radar.h:
--------------------------------------------------------------------------------
1 | /*
2 | radar.h
3 | Copyright (C) 2015 a1batross
4 | */
5 | #pragma once
6 | #ifndef RADAR_H
7 | #define RADAR_H
8 |
9 | class CClientSprite;
10 |
11 | class CHudRadar: public CHudBase
12 | {
13 | public:
14 | virtual int Init();
15 | virtual int VidInit();
16 | virtual int Draw( float flTime );
17 | virtual void Reset();
18 | virtual void Shutdown();
19 |
20 | int MsgFunc_Radar(const char *pszName, int iSize, void *pbuf);
21 |
22 | void UserCmd_ShowRadar();
23 | void UserCmd_HideRadar();
24 | CClientSprite m_hRadar;
25 | CClientSprite m_hRadarOpaque;
26 |
27 | int MsgFunc_BombDrop(const char *pszName, int iSize, void *pbuf);
28 | int MsgFunc_BombPickup(const char *pszName, int iSize, void *pbuf);
29 | int MsgFunc_HostagePos(const char *pszName, int iSize, void *pbuf);
30 | int MsgFunc_HostageK(const char *pszName, int iSize, void *pbuf);
31 | private:
32 |
33 | cvar_t *cl_radartype;
34 |
35 | int InitBuiltinTextures();
36 | void DrawPlayerLocation();
37 | void DrawRadarDot(int x, int y, int r, int g, int b, int a);
38 | void DrawCross(int x, int y, int r, int g, int b, int a );
39 |
40 | // Call DrawT, DrawFlippedT or DrawRadarDot considering z value
41 | inline void DrawZAxis( Vector pos, int r, int g, int b, int a );
42 |
43 | void DrawT( int x, int y, int r, int g, int b, int a );
44 | void DrawFlippedT( int x, int y, int r, int g, int b, int a );
45 | bool HostageFlashTime( float flTime, struct hostage_info_t *pplayer );
46 | bool FlashTime( float flTime, struct extra_player_info_t *pplayer );
47 | Vector WorldToRadar(const Vector vPlayerOrigin, const Vector vObjectOrigin, const Vector vAngles );
48 | inline void DrawColoredTexture( int x, int y, int size, byte r, byte g, byte b, byte a, int texHandle );
49 |
50 | bool bUseRenderAPI, bTexturesInitialized;
51 | int hDot, hCross, hT, hFlippedT;
52 | int iMaxRadius;
53 | };
54 |
55 | #endif // RADAR_H
56 |
--------------------------------------------------------------------------------
/cl_dll/include/in_defs.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #if !defined( IN_DEFSH )
9 | #define IN_DEFSH
10 |
11 | // up / down
12 | #define PITCH 0
13 | // left / right
14 | #define YAW 1
15 | // fall over
16 | #define ROLL 2
17 |
18 | #ifdef _WIN32
19 | #include
20 | #include
21 | #else
22 | #ifndef PORT_H
23 | typedef struct point_s{
24 | int x;
25 | int y;
26 | } POINT;
27 | #endif
28 | #define GetCursorPos(x)
29 | #define SetCursorPos(x,y)
30 | #endif
31 |
32 | #endif
33 |
--------------------------------------------------------------------------------
/cl_dll/include/input.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #ifndef INPUT_H
3 | #define INPUT_H
4 |
5 | extern kbutton_t in_strafe;
6 | extern kbutton_t in_mlook;
7 | extern kbutton_t in_speed;
8 | extern kbutton_t in_jlook;
9 | extern kbutton_t in_forward;
10 | extern kbutton_t in_back;
11 | extern kbutton_t in_moveleft;
12 | extern kbutton_t in_moveright;
13 |
14 | extern cvar_t *m_pitch;
15 | extern cvar_t *m_yaw;
16 | extern cvar_t *m_forward;
17 | extern cvar_t *m_side;
18 |
19 | extern cvar_t *lookstrafe;
20 | extern cvar_t *lookspring;
21 | extern cvar_t *cl_pitchdown;
22 | extern cvar_t *cl_pitchup;
23 | extern cvar_t *cl_yawspeed;
24 | extern cvar_t *cl_sidespeed;
25 | extern cvar_t *cl_forwardspeed;
26 | extern cvar_t *cl_pitchspeed;
27 | extern cvar_t *cl_movespeedkey;
28 |
29 | #endif // INPUT_H
30 |
--------------------------------------------------------------------------------
/cl_dll/include/kbutton.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #if !defined( KBUTTONH )
9 | #define KBUTTONH
10 |
11 | typedef struct kbutton_s
12 | {
13 | int down[2]; // key nums holding it down
14 | int state; // low bit is down state
15 | } kbutton_t;
16 |
17 | #endif // !KBUTTONH
--------------------------------------------------------------------------------
/cl_dll/include/overview.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #ifndef OVERVIEW_H
9 | #define OVERVIEW_H
10 |
11 |
12 | //-----------------------------------------------------------------------------
13 | // Purpose: Handles the drawing of the top-down map and all the things on it
14 | //-----------------------------------------------------------------------------
15 | class CHudOverview : public CHudBase
16 | {
17 | public:
18 | int Init();
19 | int VidInit();
20 |
21 | int Draw(float flTime);
22 | void InitHUDData( void );
23 |
24 | private:
25 | HSPRITE m_hsprPlayer;
26 | HSPRITE m_hsprViewcone;
27 | };
28 |
29 |
30 | #endif // OVERVIEW_H
31 |
--------------------------------------------------------------------------------
/cl_dll/include/rain.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2004, Shambler Team. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Shambler Team. All other use, distribution, or modification is prohibited
12 | * without written permission from Shambler Team.
13 | *
14 | ****/
15 | /*
16 | ====== rain.h ========================================================
17 | */
18 | #pragma once
19 | #ifndef __RAIN_H__
20 | #define __RAIN_H__
21 |
22 | void ProcessRain( void );
23 | void ProcessFXObjects( void );
24 | void ResetRain( void );
25 | void InitRain( void );
26 | void DrawRain( void );
27 | void DrawFXObjects( void );
28 |
29 | #endif
30 |
--------------------------------------------------------------------------------
/cl_dll/include/studio/GameStudioModelRenderer.h:
--------------------------------------------------------------------------------
1 |
2 | /***
3 | *
4 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
5 | *
6 | * This product contains software technology licensed from Id
7 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
8 | * All Rights Reserved.
9 | *
10 | * Use, distribution, and modification of this source code and/or resulting
11 | * object code is restricted to non-commercial enhancements to products from
12 | * Valve LLC. All other use, distribution, or modification is prohibited
13 | * without written permission from Valve LLC.
14 | *
15 | ****/
16 |
17 | // Big thanks to Chicken Fortress developers
18 | // for this code.
19 |
20 | #pragma once
21 | #if !defined (GAMESTUDIOMODELRENDERER_H)
22 | #define GAMESTUDIOMODELRENDERER_H
23 |
24 | enum BoneIndex
25 | {
26 | BONE_HEAD,
27 | BONE_PELVIS,
28 | BONE_SPINE1,
29 | BONE_SPINE2,
30 | BONE_SPINE3,
31 | BONE_MAX,
32 | };
33 |
34 | struct client_anim_state_t
35 | {
36 | vec3_t origin;
37 | vec3_t angles;
38 |
39 | vec3_t realangles;
40 |
41 | float animtime;
42 | float frame;
43 | int sequence;
44 | int gaitsequence;
45 | float framerate;
46 |
47 | int m_fSequenceLoops;
48 | int m_fSequenceFinished;
49 |
50 | byte controller[4];
51 | byte blending[2];
52 |
53 | latchedvars_t lv;
54 | };
55 |
56 | class CGameStudioModelRenderer : public CStudioModelRenderer
57 | {
58 | public:
59 | CGameStudioModelRenderer(void);
60 |
61 | public:
62 | virtual void StudioSetupBones(void);
63 | virtual void StudioEstimateGait(entity_state_t *pplayer);
64 | virtual void StudioProcessGait(entity_state_t *pplayer);
65 | virtual int StudioDrawPlayer(int flags, entity_state_t *pplayer);
66 | virtual int _StudioDrawPlayer(int flags, entity_state_t *pplayer);
67 | virtual void StudioFxTransform(cl_entity_t *ent, float transform[3][4]);
68 | virtual void StudioPlayerBlend(mstudioseqdesc_t *pseqdesc, int *pBlend, float *pPitch);
69 | virtual void CalculateYawBlend(entity_state_t *pplayer);
70 | virtual void CalculatePitchBlend(entity_state_t *pplayer);
71 |
72 | private:
73 | void SavePlayerState(entity_state_t *pplayer);
74 | void SetupClientAnimation(entity_state_t *pplayer);
75 | void RestorePlayerState(entity_state_t *pplayer);
76 | mstudioanim_t* LookupAnimation(mstudioseqdesc_t *pseqdesc, int index);
77 |
78 | private:
79 | int m_nPlayerGaitSequences[MAX_CLIENTS];
80 | bool m_bLocal;
81 | };
82 |
83 | extern CGameStudioModelRenderer g_StudioRenderer;
84 |
85 | #endif
86 |
--------------------------------------------------------------------------------
/cl_dll/include/studio/studio_util.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #if !defined( STUDIO_UTIL_H )
9 | #define STUDIO_UTIL_H
10 |
11 |
12 | #ifndef M_PI
13 | #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
14 | #endif
15 |
16 | #ifndef PITCH
17 | // MOVEMENT INFO
18 | // up / down
19 | #define PITCH 0
20 | // left / right
21 | #define YAW 1
22 | // fall over
23 | #define ROLL 2
24 | #endif
25 |
26 | #define FDotProduct( a, b ) (fabs((a[0])*(b[0])) + fabs((a[1])*(b[1])) + fabs((a[2])*(b[2])))
27 |
28 | void AngleMatrix (const float *angles, float (*matrix)[4] );
29 | int VectorCompare (const float *v1, const float *v2);
30 | void CrossProduct (const float *v1, const float *v2, float *cross);
31 | void VectorTransform (const float *in1, float in2[3][4], float *out);
32 | void ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]);
33 | void MatrixCopy( float in[3][4], float out[3][4] );
34 | void QuaternionMatrix( vec4_t quaternion, float (*matrix)[4] );
35 | void QuaternionSlerp( vec4_t p, vec4_t q, float t, vec4_t qt );
36 | void AngleQuaternion( float *angles, vec4_t quaternion );
37 |
38 | #endif // STUDIO_UTIL_H
--------------------------------------------------------------------------------
/cl_dll/include/vgui_parser.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 | #pragma once
29 | #ifndef VGUI_PARSER_H
30 | #define VGUI_PARSER_H
31 |
32 | #define MAX_TOLOCALIZE_STRING_SIZE 256
33 | #define MAX_LOCALIZEDSTRING_SIZE 2048
34 |
35 | void Localize_Init( );
36 | void Localize_Free( );
37 |
38 | const char* Localize( const char* string );
39 | void StripEndNewlineFromString( char *str );
40 | #endif
41 |
--------------------------------------------------------------------------------
/cl_dll/include/view.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 | #pragma once
8 | #if !defined ( VIEWH )
9 | #define VIEWH
10 |
11 | void V_StartPitchDrift( void );
12 | void V_StopPitchDrift( void );
13 |
14 | #endif // !VIEWH
--------------------------------------------------------------------------------
/cl_dll/include/wrect.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #pragma once
9 | #if !defined( WRECTH )
10 | #define WRECTH
11 |
12 | typedef struct rect_s
13 | {
14 | int left, right, top, bottom;
15 | } wrect_t;
16 |
17 | #endif
--------------------------------------------------------------------------------
/cl_dll/tri.cpp:
--------------------------------------------------------------------------------
1 | //========= Copyright ? 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | // Triangle rendering, if any
9 | #include "hud.h"
10 | #include "cl_util.h"
11 |
12 | // Triangle rendering apis are in gEngfuncs.pTriAPI
13 | #include "const.h"
14 | #include "entity_state.h"
15 | #include "cl_entity.h"
16 | #include "triangleapi.h"
17 | #include "rain.h"
18 |
19 | /*
20 | =================
21 | HUD_DrawNormalTriangles
22 |
23 | Non-transparent triangles-- add them here
24 | =================
25 | */
26 | void DLLEXPORT HUD_DrawNormalTriangles( void )
27 | {
28 | gHUD.m_Spectator.DrawOverview();
29 | }
30 |
31 | /*
32 | =================
33 | HUD_DrawTransparentTriangles
34 |
35 | Render any triangles with transparent rendermode needs here
36 | =================
37 | */
38 | void DLLEXPORT HUD_DrawTransparentTriangles( void )
39 | {
40 | ProcessFXObjects();
41 | ProcessRain();
42 | DrawRain();
43 | DrawFXObjects();
44 | }
45 |
--------------------------------------------------------------------------------
/common/beamdef.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined ( BEAMDEFH )
16 | #define BEAMDEFH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | #define FBEAM_STARTENTITY 0x00000001
24 | #define FBEAM_ENDENTITY 0x00000002
25 | #define FBEAM_FADEIN 0x00000004
26 | #define FBEAM_FADEOUT 0x00000008
27 | #define FBEAM_SINENOISE 0x00000010
28 | #define FBEAM_SOLID 0x00000020
29 | #define FBEAM_SHADEIN 0x00000040
30 | #define FBEAM_SHADEOUT 0x00000080
31 | #define FBEAM_STARTVISIBLE 0x10000000 // Has this client actually seen this beam's start entity yet?
32 | #define FBEAM_ENDVISIBLE 0x20000000 // Has this client actually seen this beam's end entity yet?
33 | #define FBEAM_ISACTIVE 0x40000000
34 | #define FBEAM_FOREVER 0x80000000
35 |
36 | typedef struct beam_s BEAM;
37 | struct beam_s
38 | {
39 | BEAM *next;
40 | int type;
41 | int flags;
42 | vec3_t source;
43 | vec3_t target;
44 | vec3_t delta;
45 | float t; // 0 .. 1 over lifetime of beam
46 | float freq;
47 | float die;
48 | float width;
49 | float amplitude;
50 | float r, g, b;
51 | float brightness;
52 | float speed;
53 | float frameRate;
54 | float frame;
55 | int segments;
56 | int startEntity;
57 | int endEntity;
58 | int modelIndex;
59 | int frameCount;
60 | struct model_s *pFollowModel;
61 | struct particle_s *particles;
62 | };
63 |
64 | #endif
65 |
--------------------------------------------------------------------------------
/common/con_nprint.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( CON_NPRINTH )
16 | #define CON_NPRINTH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef struct con_nprint_s
24 | {
25 | int index; // Row #
26 | float time_to_live; // # of seconds before it disappears
27 | float color[ 3 ]; // RGB colors ( 0.0 -> 1.0 scale )
28 | } con_nprint_t;
29 |
30 | void Con_NPrintf( int idx, char *fmt, ... );
31 | void Con_NXPrintf( struct con_nprint_s *info, char *fmt, ... );
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/common/crc.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | /* crc.h */
16 | #ifndef CRC_H
17 | #define CRC_H
18 | #ifdef _WIN32
19 | #ifndef __MINGW32__
20 | #pragma once
21 | #endif /* not __MINGW32__ */
22 | #endif
23 |
24 | // MD5 Hash
25 | typedef struct
26 | {
27 | unsigned int buf[4];
28 | unsigned int bits[2];
29 | unsigned char in[64];
30 | } MD5Context_t;
31 |
32 |
33 | typedef unsigned long CRC32_t;
34 | void CRC32_Init(CRC32_t *pulCRC);
35 | CRC32_t CRC32_Final(CRC32_t pulCRC);
36 | void CRC32_ProcessBuffer(CRC32_t *pulCRC, void *p, int len);
37 | void CRC32_ProcessByte(CRC32_t *pulCRC, unsigned char ch);
38 | int CRC_File(CRC32_t *crcvalue, char *pszFileName);
39 |
40 | unsigned char COM_BlockSequenceCRCByte (unsigned char *base, int length, int sequence);
41 |
42 | void MD5Init(MD5Context_t *context);
43 | void MD5Update(MD5Context_t *context, unsigned char const *buf,
44 | unsigned int len);
45 | void MD5Final(unsigned char digest[16], MD5Context_t *context);
46 | void Transform(unsigned int buf[4], unsigned int const in[16]);
47 |
48 | int MD5_Hash_File(unsigned char digest[16], char *pszFileName, int bUsefopen, int bSeed, unsigned int seed[4]);
49 | char *MD5_Print(unsigned char hash[16]);
50 | int MD5_Hash_CachedFile(unsigned char digest[16], unsigned char *pCache, int nFileSize, int bSeed, unsigned int seed[4]);
51 |
52 | int CRC_MapFile(CRC32_t *crcvalue, char *pszFileName);
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/common/cvardef.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef CVARDEF_H
16 | #define CVARDEF_H
17 |
18 | #define FCVAR_ARCHIVE (1<<0) // set to cause it to be saved to vars.rc
19 | #define FCVAR_USERINFO (1<<1) // changes the client's info string
20 | #define FCVAR_SERVER (1<<2) // notifies players when changed
21 | #define FCVAR_EXTDLL (1<<3) // defined by external DLL
22 | #define FCVAR_CLIENTDLL (1<<4) // defined by the client dll
23 | #define FCVAR_PROTECTED (1<<5) // It's a server cvar, but we don't send the data since it's a password, etc. Sends 1 if it's not bland/zero, 0 otherwise as value
24 | #define FCVAR_SPONLY (1<<6) // This cvar cannot be changed by clients connected to a multiplayer server.
25 | #define FCVAR_PRINTABLEONLY (1<<7) // This cvar's string cannot contain unprintable characters ( e.g., used for player name etc ).
26 | #define FCVAR_UNLOGGED (1<<8) // If this is a FCVAR_SERVER, don't log changes to the log file / console if we are creating a log
27 |
28 | typedef struct cvar_s
29 | {
30 | const char *name;
31 | const char *string;
32 | int flags;
33 | float value;
34 | struct cvar_s *next;
35 | } cvar_t;
36 |
37 |
38 | typedef int qboolean;
39 |
40 | // WARNING: Private structure from Xash3D Engine. Use with caution
41 | typedef struct convar_s
42 | {
43 | // this part shared with cvar_t
44 | char *name;
45 | char *string;
46 | int flags;
47 | float value;
48 | struct convar_s *next;
49 |
50 | // this part unique for convar_t
51 | int integer; // atoi( string )
52 | qboolean modified; // set each time the cvar is changed
53 | char *reset_string; // cvar_restart will reset to this value
54 | char *latched_string; // for CVAR_LATCH vars
55 | char *description; // variable descrition info
56 | } convar_t;
57 | #endif
58 |
--------------------------------------------------------------------------------
/common/demo_api.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined ( DEMO_APIH )
16 | #define DEMO_APIH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef struct demo_api_s
24 | {
25 | int ( *IsRecording ) ( void );
26 | int ( *IsPlayingback ) ( void );
27 | int ( *IsTimeDemo ) ( void );
28 | void ( *WriteBuffer ) ( int size, unsigned char *buffer );
29 | } demo_api_t;
30 |
31 | extern demo_api_t demoapi;
32 |
33 | #endif
34 |
--------------------------------------------------------------------------------
/common/director_cmds.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | // director_cmds.h
9 | // sub commands for svc_director
10 |
11 | #define DRC_ACTIVE 0 // tells client that he's an spectator and will get director command
12 | #define DRC_STATUS 1 // send status infos about proxy
13 | #define DRC_CAMERA 2 // set the actual director camera position
14 | #define DRC_EVENT 3 // informs the dircetor about ann important game event
15 |
16 |
17 | #define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
18 | #define DRC_FLAG_SIDE (1<<4)
19 | #define DRC_FLAG_DRAMATIC (1<<5)
20 |
21 |
22 |
23 | // commands of the director API function CallDirectorProc(...)
24 |
25 | #define DRCAPI_NOP 0 // no operation
26 | #define DRCAPI_ACTIVE 1 // de/acivates director mode in engine
27 | #define DRCAPI_STATUS 2 // request proxy information
28 | #define DRCAPI_SETCAM 3 // set camera n to given position and angle
29 | #define DRCAPI_GETCAM 4 // request camera n position and angle
30 | #define DRCAPI_DIRPLAY 5 // set director time and play with normal speed
31 | #define DRCAPI_DIRFREEZE 6 // freeze directo at this time
32 | #define DRCAPI_SETVIEWMODE 7 // overview or 4 cameras
33 | #define DRCAPI_SETOVERVIEWPARAMS 8 // sets parameter for overview mode
34 | #define DRCAPI_SETFOCUS 9 // set the camera which has the input focus
35 | #define DRCAPI_GETTARGETS 10 // queries engine for player list
36 | #define DRCAPI_SETVIEWPOINTS 11 // gives engine all waypoints
37 |
38 |
39 |
--------------------------------------------------------------------------------
/common/dlight.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined ( DLIGHTH )
16 | #define DLIGHTH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef struct dlight_s
24 | {
25 | vec3_t origin;
26 | float radius;
27 | color24 color;
28 | float die; // stop lighting after this time
29 | float decay; // drop this each second
30 | float minlight; // don't add when contributing less
31 | int key;
32 | qboolean dark; // subtracts light instead of adding
33 | } dlight_t;
34 |
35 | #endif
36 |
--------------------------------------------------------------------------------
/common/dll_state.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | //DLL State Flags
9 |
10 | #define DLL_INACTIVE 0 // no dll
11 | #define DLL_ACTIVE 1 // dll is running
12 | #define DLL_PAUSED 2 // dll is paused
13 | #define DLL_CLOSE 3 // closing down dll
14 | #define DLL_TRANS 4 // Level Transition
15 |
16 | // DLL Pause reasons
17 |
18 | #define DLL_NORMAL 0 // User hit Esc or something.
19 | #define DLL_QUIT 4 // Quit now
20 | #define DLL_RESTART 6 // Switch to launcher for linux, does a quit but returns 1
21 |
22 | // DLL Substate info ( not relevant )
23 | #define ENG_NORMAL (1<<0)
24 |
--------------------------------------------------------------------------------
/common/entity_types.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | // entity_types.h
16 | #if !defined( ENTITY_TYPESH )
17 | #define ENTITY_TYPESH
18 |
19 | #define ET_NORMAL 0
20 | #define ET_PLAYER 1
21 | #define ET_TEMPENTITY 2
22 | #define ET_BEAM 3
23 | // BMODEL or SPRITE that was split across BSP nodes
24 | #define ET_FRAGMENTED 4
25 |
26 | #endif // !ENTITY_TYPESH
27 |
--------------------------------------------------------------------------------
/common/event_api.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined ( EVENT_APIH )
16 | #define EVENT_APIH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | #define EVENT_API_VERSION 1
24 |
25 | typedef struct event_api_s
26 | {
27 | int version;
28 | void ( *EV_PlaySound ) ( int ent, float *origin, int channel, const char *sample, float volume, float attenuation, int fFlags, int pitch );
29 | void ( *EV_StopSound ) ( int ent, int channel, const char *sample );
30 | int ( *EV_FindModelIndex )( const char *pmodel );
31 | int ( *EV_IsLocal ) ( int playernum );
32 | int ( *EV_LocalPlayerDucking ) ( void );
33 | void ( *EV_LocalPlayerViewheight ) ( float * );
34 | void ( *EV_LocalPlayerBounds ) ( int hull, float *mins, float *maxs );
35 | int ( *EV_IndexFromTrace) ( struct pmtrace_s *pTrace );
36 | struct physent_s *( *EV_GetPhysent ) ( int idx );
37 | void ( *EV_SetUpPlayerPrediction ) ( int dopred, int bIncludeLocalClient );
38 | void ( *EV_PushPMStates ) ( void );
39 | void ( *EV_PopPMStates ) ( void );
40 | void ( *EV_SetSolidPlayers ) (int playernum);
41 | void ( *EV_SetTraceHull ) ( int hull );
42 | void ( *EV_PlayerTrace ) ( float *start, float *end, int traceFlags, int ignore_pe, struct pmtrace_s *tr );
43 | void ( *EV_WeaponAnimation ) ( int sequence, int body );
44 | unsigned short ( *EV_PrecacheEvent ) ( int type, const char* psz );
45 | void ( *EV_PlaybackEvent ) ( int flags, const struct edict_s *pInvoker, unsigned short eventindex, float delay, float *origin, float *angles, float fparam1, float fparam2, int iparam1, int iparam2, int bparam1, int bparam2 );
46 | const char *( *EV_TraceTexture ) ( int ground, float *vstart, float *vend );
47 | void ( *EV_StopAllSounds ) ( int entnum, int entchannel );
48 | void ( *EV_KillEvents ) ( int entnum, const char *eventname );
49 | } event_api_t;
50 |
51 | extern event_api_t eventapi;
52 |
53 | #endif
54 |
--------------------------------------------------------------------------------
/common/event_args.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( EVENT_ARGSH )
16 | #define EVENT_ARGSH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | // Event was invoked with stated origin
24 | #define FEVENT_ORIGIN ( 1<<0 )
25 |
26 | // Event was invoked with stated angles
27 | #define FEVENT_ANGLES ( 1<<1 )
28 |
29 | typedef struct event_args_s
30 | {
31 | int flags;
32 |
33 | // Transmitted
34 | int entindex;
35 |
36 | float origin[3];
37 | float angles[3];
38 | float velocity[3];
39 |
40 | int ducking;
41 |
42 | float fparam1;
43 | float fparam2;
44 |
45 | int iparam1;
46 | int iparam2;
47 |
48 | int bparam1;
49 | int bparam2;
50 | } event_args_t;
51 |
52 | #endif
53 |
--------------------------------------------------------------------------------
/common/event_flags.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( EVENT_FLAGSH )
16 | #define EVENT_FLAGSH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | // Skip local host for event send.
24 | #define FEV_NOTHOST (1<<0)
25 |
26 | // Send the event reliably. You must specify the origin and angles and use
27 | // PLAYBACK_EVENT_FULL for this to work correctly on the server for anything
28 | // that depends on the event origin/angles. I.e., the origin/angles are not
29 | // taken from the invoking edict for reliable events.
30 | #define FEV_RELIABLE (1<<1)
31 |
32 | // Don't restrict to PAS/PVS, send this event to _everybody_ on the server ( useful for stopping CHAN_STATIC
33 | // sounds started by client event when client is not in PVS anymore ( hwguy in TFC e.g. ).
34 | #define FEV_GLOBAL (1<<2)
35 |
36 | // If this client already has one of these events in its queue, just update the event instead of sending it as a duplicate
37 | //
38 | #define FEV_UPDATE (1<<3)
39 |
40 | // Only send to entity specified as the invoker
41 | #define FEV_HOSTONLY (1<<4)
42 |
43 | // Only send if the event was created on the server.
44 | #define FEV_SERVER (1<<5)
45 |
46 | // Only issue event client side ( from shared code )
47 | #define FEV_CLIENT (1<<6)
48 |
49 | #endif
50 |
--------------------------------------------------------------------------------
/common/exefuncs.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | // exefuncs.h
9 | #ifndef EXEFUNCS_H
10 | #define EXEFUNCS_H
11 |
12 | // Engine hands this to DLLs for functionality callbacks
13 | typedef struct exefuncs_s
14 | {
15 | int fMMX;
16 | int iCPUMhz;
17 | void (*unused1)(void);
18 | void (*unused2)(void);
19 | void (*unused3)(void);
20 | void (*unused4)(void);
21 | void (*VID_ForceLockState)(int lk);
22 | int (*VID_ForceUnlockedAndReturnState)(void);
23 | void (*unused5)(void);
24 | void (*unused6)(void);
25 | void (*unused7)(void);
26 | void (*unused8)(void);
27 | void (*unused9)(void);
28 | void (*unused10)(void);
29 | void (*unused11)(void);
30 | void (*unused12)(void);
31 | void (*unused13)(void);
32 | void (*unused14)(void);
33 | void (*unused15)(void);
34 | void (*ErrorMessage)(int nLevel, const char *pszErrorMessage);
35 | void (*unused16)(void);
36 | void (*Sys_Printf)(char *fmt, ...);
37 | void (*unused17)(void);
38 | void (*unused18)(void);
39 | void (*unused19)(void);
40 | void (*unused20)(void);
41 | void (*unused21)(void);
42 | void (*unused22)(void);
43 | void (*unused23)(void);
44 | void (*unused24)(void);
45 | void (*unused25)(void);
46 | void (*unused26)(void);
47 | void (*unused27)(void);
48 | } exefuncs_t;
49 |
50 | #endif
51 |
--------------------------------------------------------------------------------
/common/gameinfo.h:
--------------------------------------------------------------------------------
1 | /*
2 | gameinfo.h - current game info
3 | Copyright (C) 2010 Uncle Mike
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #ifndef GAMEINFO_H
17 | #define GAMEINFO_H
18 |
19 | #define GFL_NOMODELS (1<<0)
20 |
21 | /*
22 | ========================================================================
23 |
24 | GAMEINFO stuff
25 |
26 | internal shared gameinfo structure (readonly for engine parts)
27 | ========================================================================
28 | */
29 | typedef struct
30 | {
31 | // filesystem info
32 | char gamefolder[64]; // used for change game '-game x'
33 | char startmap[64]; // map to start singleplayer game
34 | char trainmap[64]; // map to start hazard course (if specified)
35 | char title[64]; // Game Main Title
36 | char version[14]; // game version (optional)
37 | short flags; // game flags
38 |
39 | // about mod info
40 | char game_url[256]; // link to a developer's site
41 | char update_url[256]; // link to updates page
42 | char type[64]; // single, toolkit, multiplayer etc
43 | char date[64];
44 | char size[64]; // displayed mod size
45 |
46 | int gamemode;
47 | } GAMEINFO;
48 |
49 | #endif//GAMEINFO_H
--------------------------------------------------------------------------------
/common/hltv.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | // hltv.h
9 | // all shared consts between server, clients and proxy
10 |
11 | #ifndef HLTV_H
12 | #define HLTV_H
13 |
14 | #define TYPE_CLIENT 0 // client is a normal HL client (default)
15 | #define TYPE_PROXY 1 // client is another proxy
16 | #define TYPE_COMMENTATOR 3 // client is a commentator
17 | #define TYPE_DEMO 4 // client is a demo file
18 | // sub commands of svc_hltv:
19 | #define HLTV_ACTIVE 0 // tells client that he's an spectator and will get director commands
20 | #define HLTV_STATUS 1 // send status infos about proxy
21 | #define HLTV_LISTEN 2 // tell client to listen to a multicast stream
22 |
23 | // sub commands of svc_director:
24 | #define DRC_CMD_NONE 0 // NULL director command
25 | #define DRC_CMD_START 1 // start director mode
26 | #define DRC_CMD_EVENT 2 // informs about director command
27 | #define DRC_CMD_MODE 3 // switches camera modes
28 | #define DRC_CMD_CAMERA 4 // sets camera registers
29 | #define DRC_CMD_TIMESCALE 5 // sets time scale
30 | #define DRC_CMD_MESSAGE 6 // send HUD centerprint
31 | #define DRC_CMD_SOUND 7 // plays a particular sound
32 | #define DRC_CMD_STATUS 8 // status info about broadcast
33 | #define DRC_CMD_BANNER 9 // banner file name for HLTV gui
34 | #define DRC_CMD_FADE 10 // send screen fade command
35 | #define DRC_CMD_SHAKE 11 // send screen shake command
36 | #define DRC_CMD_STUFFTEXT 12 // like the normal svc_stufftext but as director command
37 |
38 | #define DRC_CMD_LAST 12
39 |
40 |
41 |
42 | // HLTV_EVENT event flags
43 | #define DRC_FLAG_PRIO_MASK 0x0F // priorities between 0 and 15 (15 most important)
44 | #define DRC_FLAG_SIDE (1<<4) //
45 | #define DRC_FLAG_DRAMATIC (1<<5) // is a dramatic scene
46 | #define DRC_FLAG_SLOWMOTION (1<<6) // would look good in SloMo
47 | #define DRC_FLAG_FACEPLAYER (1<<7) // player is doning something (reload/defuse bomb etc)
48 | #define DRC_FLAG_INTRO (1<<8) // is a introduction scene
49 | #define DRC_FLAG_FINAL (1<<9) // is a final scene
50 | #define DRC_FLAG_NO_RANDOM (1<<10) // don't randomize event data
51 |
52 |
53 | #define MAX_DIRECTOR_CMD_PARAMETERS 4
54 | #define MAX_DIRECTOR_CMD_STRING 128
55 |
56 |
57 | #endif // HLTV_H
58 |
--------------------------------------------------------------------------------
/common/in_buttons.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef IN_BUTTONS_H
16 | #define IN_BUTTONS_H
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 |
24 | #ifndef CONST_H
25 | #define IN_ATTACK (1 << 0)
26 | #define IN_JUMP (1 << 1)
27 | #define IN_DUCK (1 << 2)
28 | #define IN_FORWARD (1 << 3)
29 | #define IN_BACK (1 << 4)
30 | #define IN_USE (1 << 5)
31 | #define IN_CANCEL (1 << 6)
32 | #define IN_LEFT (1 << 7)
33 | #define IN_RIGHT (1 << 8)
34 | #define IN_MOVELEFT (1 << 9)
35 | #define IN_MOVERIGHT (1 << 10)
36 | #define IN_ATTACK2 (1 << 11)
37 | #define IN_RUN (1 << 12)
38 | #define IN_RELOAD (1 << 13)
39 | #define IN_ALT1 (1 << 14)
40 | #define IN_SCORE (1 << 15) // Used by client.dll for when scoreboard is held down
41 | #endif
42 |
43 | #endif // IN_BUTTONS_H
44 |
--------------------------------------------------------------------------------
/common/ivoicetweak.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #ifndef IVOICETWEAK_H
9 | #define IVOICETWEAK_H
10 | #ifdef _WIN32
11 | #ifndef __MINGW32__
12 | #pragma once
13 | #endif /* not __MINGW32__ */
14 | #endif
15 |
16 | // These provide access to the voice controls.
17 | typedef enum
18 | {
19 | MicrophoneVolume=0, // values 0-1.
20 | OtherSpeakerScale // values 0-1. Scales how loud other players are.
21 | } VoiceTweakControl;
22 |
23 |
24 | typedef struct IVoiceTweak_s
25 | {
26 | // These turn voice tweak mode on and off. While in voice tweak mode, the user's voice is echoed back
27 | // without sending to the server.
28 | int (*StartVoiceTweakMode)(); // Returns 0 on error.
29 | void (*EndVoiceTweakMode)();
30 |
31 | // Get/set control values.
32 | void (*SetControlFloat)(VoiceTweakControl iControl, float value);
33 | float (*GetControlFloat)(VoiceTweakControl iControl);
34 | } IVoiceTweak;
35 |
36 |
37 | #endif // IVOICETWEAK_H
38 |
--------------------------------------------------------------------------------
/common/kbutton.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #pragma once
9 | #if !defined( KBUTTONH )
10 | #define KBUTTONH
11 |
12 | typedef struct kbutton_s
13 | {
14 | int down[2]; // key nums holding it down
15 | int state; // low bit is down state
16 | } kbutton_t;
17 |
18 | #endif // !KBUTTONH
19 |
--------------------------------------------------------------------------------
/common/lightstyle.h:
--------------------------------------------------------------------------------
1 | /*
2 | lightstyle.h - lighstyle description
3 | Copyright (C) 2011 Uncle Mike
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #ifndef LIGHTSTYLE_H
17 | #define LIGHTSTYLE_H
18 |
19 | typedef struct
20 | {
21 | char pattern[256];
22 | float map[256];
23 | int length;
24 | float value;
25 | qboolean interp; // allow to interpolate this lightstyle
26 | float time; // local time warranties that new style begins from the start, not mid or end of the sequence
27 | } lightstyle_t;
28 |
29 | #endif//LIGHTSTYLE_H
--------------------------------------------------------------------------------
/common/netadr.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | // netadr.h
16 | #ifndef NETADR_H
17 | #define NETADR_H
18 | #ifdef _WIN32
19 | #ifndef __MINGW32__
20 | #pragma once
21 | #endif /* not __MINGW32__ */
22 | #endif
23 |
24 | typedef enum
25 | {
26 | NA_UNUSED,
27 | NA_LOOPBACK,
28 | NA_BROADCAST,
29 | NA_IP,
30 | NA_IPX,
31 | NA_BROADCAST_IPX
32 | } netadrtype_t;
33 |
34 | typedef struct netadr_s
35 | {
36 | netadrtype_t type;
37 | unsigned char ip[4];
38 | unsigned char ipx[10];
39 | unsigned short port;
40 | } netadr_t;
41 |
42 | #endif // NETADR_H
43 |
--------------------------------------------------------------------------------
/common/nowin.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #ifndef INC_NOWIN_H
9 | #define INC_NOWIN_H
10 | #ifndef _WIN32
11 |
12 | #include
13 |
14 | #endif //!_WIN32
15 | #endif //INC_NOWIN_H
16 |
--------------------------------------------------------------------------------
/common/particledef.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( PARTICLEDEFH )
16 | #define PARTICLEDEFH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef enum {
24 | pt_static,
25 | pt_grav,
26 | pt_slowgrav,
27 | pt_fire,
28 | pt_explode,
29 | pt_explode2,
30 | pt_blob,
31 | pt_blob2,
32 | pt_vox_slowgrav,
33 | pt_vox_grav,
34 | pt_clientcustom // Must have callback function specified
35 | } ptype_t;
36 |
37 | // !!! if this is changed, it must be changed in d_ifacea.h too !!!
38 | typedef struct particle_s
39 | {
40 | // driver-usable fields
41 | vec3_t org;
42 | short color;
43 | short packedColor;
44 | // drivers never touch the following fields
45 | struct particle_s *next;
46 | vec3_t vel;
47 | float ramp;
48 | float die;
49 | ptype_t type;
50 | void (*deathfunc)( struct particle_s *particle );
51 |
52 | // for pt_clientcusttom, we'll call this function each frame
53 | void (*callback)( struct particle_s *particle, float frametime );
54 |
55 | // For deathfunc, etc.
56 | unsigned char context;
57 | } particle_t;
58 |
59 | #endif
60 |
--------------------------------------------------------------------------------
/common/pmtrace.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( PMTRACEH )
16 | #define PMTRACEH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef struct
24 | {
25 | vec3_t normal;
26 | float dist;
27 | } pmplane_t;
28 |
29 | typedef struct pmtrace_s pmtrace_t;
30 |
31 | struct pmtrace_s
32 | {
33 | qboolean allsolid; // if true, plane is not valid
34 | qboolean startsolid; // if true, the initial point was in a solid area
35 | qboolean inopen, inwater; // End point is in empty space or in water
36 | float fraction; // time completed, 1.0 = didn't hit anything
37 | vec3_t endpos; // final position
38 | pmplane_t plane; // surface normal at impact
39 | int ent; // entity at impact
40 | vec3_t deltavelocity; // Change in player's velocity caused by impact.
41 | // Only run on server.
42 | int hitgroup;
43 | };
44 |
45 | #endif
46 |
--------------------------------------------------------------------------------
/common/qfont.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( QFONTH )
16 | #define QFONTH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | // Font stuff
24 |
25 | #define NUM_GLYPHS 256
26 |
27 | typedef struct
28 | {
29 | short startoffset;
30 | short charwidth;
31 | } charinfo;
32 |
33 | typedef struct qfont_s
34 | {
35 | int width, height;
36 | int rowcount;
37 | int rowheight;
38 | charinfo fontinfo[ NUM_GLYPHS ];
39 | byte data[4];
40 | } qfont_t;
41 |
42 | #endif // qfont.h
43 |
--------------------------------------------------------------------------------
/common/ref_params.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 |
16 | #ifndef REF_PARAMS_H
17 | #define REF_PARAMS_H
18 |
19 | typedef struct ref_params_s
20 | {
21 | // output
22 | vec3_t vieworg;
23 | vec3_t viewangles;
24 |
25 | vec3_t forward;
26 | vec3_t right;
27 | vec3_t up;
28 |
29 | // Client frametime;
30 | float frametime;
31 | // Client time
32 | float time;
33 |
34 | // Misc
35 | int intermission;
36 | int paused;
37 | int spectator;
38 | int onground;
39 | int waterlevel;
40 |
41 | vec3_t simvel;
42 | vec3_t simorg;
43 |
44 | vec3_t viewheight;
45 | float idealpitch;
46 |
47 | vec3_t cl_viewangles;
48 | int health;
49 | vec3_t crosshairangle;
50 | float viewsize;
51 |
52 | vec3_t punchangle;
53 | int maxclients;
54 | int viewentity;
55 | int playernum;
56 | int max_entities;
57 | int demoplayback;
58 | int hardware;
59 | int smoothing;
60 |
61 | // Last issued usercmd
62 | struct usercmd_s *cmd;
63 |
64 | // Movevars
65 | struct movevars_s *movevars;
66 |
67 | int viewport[4]; // the viewport coordinates x, y, width, height
68 | int nextView; // the renderer calls ClientDLL_CalcRefdef() and Renderview
69 | // so long in cycles until this value is 0 (multiple views)
70 | int onlyClientDraw; // if !=0 nothing is drawn by the engine except clientDraw functions
71 | // Xash3D extension
72 | float fov_x, fov_y; // actual fov can be overriden on nextView
73 | } ref_params_t;
74 |
75 | // same as ref_params but for overview mode
76 | typedef struct ref_overview_s
77 | {
78 | vec3_t origin;
79 | qboolean rotated;
80 |
81 | float xLeft;
82 | float xRight;
83 | float xTop;
84 | float xBottom;
85 | float zFar;
86 | float zNear;
87 | float flZoom;
88 | } ref_overview_t;
89 |
90 | #endif//REF_PARAMS_H
--------------------------------------------------------------------------------
/common/screenfade.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #if !defined( SCREENFADEH )
9 | #define SCREENFADEH
10 | #ifdef _WIN32
11 | #ifndef __MINGW32__
12 | #pragma once
13 | #endif /* not __MINGW32__ */
14 | #endif
15 |
16 | typedef struct screenfade_s
17 | {
18 | float fadeSpeed; // How fast to fade (tics / second) (+ fade in, - fade out)
19 | float fadeEnd; // When the fading hits maximum
20 | float fadeTotalEnd; // Total End Time of the fade (used for FFADE_OUT)
21 | float fadeReset; // When to reset to not fading (for fadeout and hold)
22 | byte fader, fadeg, fadeb, fadealpha; // Fade color
23 | int fadeFlags; // Fading flags
24 | } screenfade_t;
25 |
26 | #endif // !SCREENFADEH
27 |
--------------------------------------------------------------------------------
/common/studio_event.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( STUDIO_EVENTH )
16 | #define STUDIO_EVENTH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef struct mstudioevent_s
24 | {
25 | int frame;
26 | int event;
27 | int type;
28 | char options[64];
29 | } mstudioevent_t;
30 |
31 | #endif // STUDIO_EVENTH
32 |
--------------------------------------------------------------------------------
/common/triangleapi.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined( TRIANGLEAPIH )
16 | #define TRIANGLEAPIH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef enum
24 | {
25 | TRI_FRONT = 0,
26 | TRI_NONE = 1,
27 | } TRICULLSTYLE;
28 |
29 | #define TRI_API_VERSION 1
30 |
31 | #define TRI_TRIANGLES 0
32 | #define TRI_TRIANGLE_FAN 1
33 | #define TRI_QUADS 2
34 | #define TRI_POLYGON 3
35 | #define TRI_LINES 4
36 | #define TRI_TRIANGLE_STRIP 5
37 | #define TRI_QUAD_STRIP 6
38 | #define TRI_POINTS 7 // Xash3D added
39 |
40 | typedef struct triangleapi_s
41 | {
42 | int version;
43 |
44 | void ( *RenderMode )( int mode );
45 | void ( *Begin )( int primitiveCode );
46 | void ( *End ) ( void );
47 |
48 | void ( *Color4f ) ( float r, float g, float b, float a );
49 | void ( *Color4ub ) ( unsigned char r, unsigned char g, unsigned char b, unsigned char a );
50 | void ( *TexCoord2f ) ( float u, float v );
51 | void ( *Vertex3fv ) ( float *worldPnt );
52 | void ( *Vertex3f ) ( float x, float y, float z );
53 | void ( *Brightness ) ( float brightness );
54 | void ( *CullFace ) ( TRICULLSTYLE style );
55 | int ( *SpriteTexture ) ( struct model_s *pSpriteModel, int frame );
56 | int ( *WorldToScreen ) ( float *world, float *screen ); // Returns 1 if it's z clipped
57 | void ( *Fog ) ( float flFogColor[3], float flStart, float flEnd, int bOn ); //Works just like GL_FOG, flFogColor is r/g/b.
58 | void ( *ScreenToWorld ) ( float *screen, float *world );
59 | void (*GetMatrix)( const int pname, float *matrix );
60 | int (*BoxInPVS)( float *mins, float *maxs );
61 | void (*LightAtPoint)( float *pos, float *value );
62 | void (*Color4fRendermode)( float r, float g, float b, float a, int rendermode );
63 | void (*FogParams)( float flDensity, int iFogSkybox );
64 |
65 |
66 | } triangleapi_t;
67 |
68 | #endif // !TRIANGLEAPIH
69 |
--------------------------------------------------------------------------------
/common/usercmd.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef USERCMD_H
16 | #define USERCMD_H
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | typedef struct usercmd_s
24 | {
25 | short lerp_msec; // Interpolation time on client
26 | byte msec; // Duration in ms of command
27 | vec3_t viewangles; // Command view angles.
28 |
29 | // intended velocities
30 | float forwardmove; // Forward velocity.
31 | float sidemove; // Sideways velocity.
32 | float upmove; // Upward velocity.
33 | byte lightlevel; // Light level at spot where we are standing.
34 | unsigned short buttons; // Attack buttons
35 | byte impulse; // Impulse command issued.
36 | byte weaponselect; // Current weapon id
37 |
38 | // Experimental player impact stuff.
39 | int impact_index;
40 | vec3_t impact_position;
41 | } usercmd_t;
42 |
43 | #endif // USERCMD_H
44 |
--------------------------------------------------------------------------------
/common/weaponinfo.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #if !defined ( WEAPONINFOH )
16 | #define WEAPONINFOH
17 | #ifdef _WIN32
18 | #ifndef __MINGW32__
19 | #pragma once
20 | #endif /* not __MINGW32__ */
21 | #endif
22 |
23 | // Info about weapons player might have in his/her possession
24 | typedef struct weapon_data_s
25 | {
26 | int m_iId;
27 | int m_iClip;
28 |
29 | float m_flNextPrimaryAttack;
30 | float m_flNextSecondaryAttack;
31 | float m_flTimeWeaponIdle;
32 |
33 | int m_fInReload;
34 | int m_fInSpecialReload;
35 | float m_flNextReload;
36 | float m_flPumpTime;
37 | float m_fReloadTime;
38 |
39 | float m_fAimedDamage;
40 | float m_fNextAimBonus;
41 | int m_fInZoom;
42 | int m_iWeaponState;
43 |
44 | int iuser1;
45 | int iuser2;
46 | int iuser3;
47 | int iuser4;
48 | float fuser1;
49 | float fuser2;
50 | float fuser3;
51 | float fuser4;
52 | } weapon_data_t;
53 |
54 | #endif
55 |
--------------------------------------------------------------------------------
/common/wrect.h:
--------------------------------------------------------------------------------
1 | /*
2 | wrect.h - rectangle definition
3 | Copyright (C) 2010 Uncle Mike
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #ifndef WRECT_H
17 | #define WRECT_H
18 |
19 | typedef struct wrect_s
20 | {
21 | int left, right, top, bottom;
22 | } wrect_t;
23 |
24 | #endif//WRECT_H
--------------------------------------------------------------------------------
/dlls/activity.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef ACTIVITY_H
16 | #define ACTIVITY_H
17 |
18 | typedef enum
19 | {
20 | ACT_RESET,
21 | ACT_IDLE,
22 | ACT_GUARD,
23 | ACT_WALK,
24 | ACT_RUN,
25 | ACT_FLY,
26 | ACT_SWIM,
27 | ACT_HOP,
28 | ACT_LEAP,
29 | ACT_FALL,
30 | ACT_LAND,
31 | ACT_STRAFE_LEFT,
32 | ACT_STRAFE_RIGHT,
33 | ACT_ROLL_LEFT,
34 | ACT_ROLL_RIGHT,
35 | ACT_TURN_LEFT,
36 | ACT_TURN_RIGHT,
37 | ACT_CROUCH,
38 | ACT_CROUCHIDLE,
39 | ACT_STAND,
40 | ACT_USE,
41 | ACT_SIGNAL1,
42 | ACT_SIGNAL2,
43 | ACT_SIGNAL3,
44 | ACT_TWITCH,
45 | ACT_COWER,
46 | ACT_SMALL_FLINCH,
47 | ACT_BIG_FLINCH,
48 | ACT_RANGE_ATTACK1,
49 | ACT_RANGE_ATTACK2,
50 | ACT_MELEE_ATTACK1,
51 | ACT_MELEE_ATTACK2,
52 | ACT_RELOAD,
53 | ACT_ARM,
54 | ACT_DISARM,
55 | ACT_EAT,
56 | ACT_DIESIMPLE,
57 | ACT_DIEBACKWARD,
58 | ACT_DIEFORWARD,
59 | ACT_DIEVIOLENT,
60 | ACT_BARNACLE_HIT,
61 | ACT_BARNACLE_PULL,
62 | ACT_BARNACLE_CHOMP,
63 | ACT_BARNACLE_CHEW,
64 | ACT_SLEEP,
65 | ACT_INSPECT_FLOOR,
66 | ACT_INSPECT_WALL,
67 | ACT_IDLE_ANGRY,
68 | ACT_WALK_HURT,
69 | ACT_RUN_HURT,
70 | ACT_HOVER,
71 | ACT_GLIDE,
72 | ACT_FLY_LEFT,
73 | ACT_FLY_RIGHT,
74 | ACT_DETECT_SCENT,
75 | ACT_SNIFF,
76 | ACT_BITE,
77 | ACT_THREAT_DISPLAY,
78 | ACT_FEAR_DISPLAY,
79 | ACT_EXCITED,
80 | ACT_SPECIAL_ATTACK1,
81 | ACT_SPECIAL_ATTACK2,
82 | ACT_COMBAT_IDLE,
83 | ACT_WALK_SCARED,
84 | ACT_RUN_SCARED,
85 | ACT_VICTORY_DANCE,
86 | ACT_DIE_HEADSHOT,
87 | ACT_DIE_CHESTSHOT,
88 | ACT_DIE_GUTSHOT,
89 | ACT_DIE_BACKSHOT,
90 | ACT_FLINCH_HEAD,
91 | ACT_FLINCH_CHEST,
92 | ACT_FLINCH_STOMACH,
93 | ACT_FLINCH_LEFTARM,
94 | ACT_FLINCH_RIGHTARM,
95 | ACT_FLINCH_LEFTLEG,
96 | ACT_FLINCH_RIGHTLEG,
97 | ACT_FLINCH,
98 | ACT_LARGE_FLINCH,
99 | ACT_HOLDBOMB,
100 | ACT_IDLE_FIDGET,
101 | ACT_IDLE_SCARED,
102 | ACT_IDLE_SCARED_FIDGET,
103 | ACT_FOLLOW_IDLE,
104 | ACT_FOLLOW_IDLE_FIDGET,
105 | ACT_FOLLOW_IDLE_SCARED,
106 | ACT_FOLLOW_IDLE_SCARED_FIDGET,
107 | ACT_CROUCH_IDLE,
108 | ACT_CROUCH_IDLE_FIDGET,
109 | ACT_CROUCH_IDLE_SCARED,
110 | ACT_CROUCH_IDLE_SCARED_FIDGET,
111 | ACT_CROUCH_WALK,
112 | ACT_CROUCH_WALK_SCARED,
113 | ACT_CROUCH_DIE,
114 | ACT_WALK_BACK,
115 | ACT_IDLE_SNEAKY,
116 | ACT_IDLE_SNEAKY_FIDGET,
117 | ACT_WALK_SNEAKY,
118 | ACT_WAVE,
119 | ACT_YES,
120 | ACT_NO
121 | }
122 | Activity;
123 |
124 | typedef struct
125 | {
126 | int type;
127 | char *name;
128 | }
129 | activity_map_t;
130 |
131 | extern activity_map_t activity_map[];
132 | #endif
--------------------------------------------------------------------------------
/dlls/cdll_dll.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef CDLL_DLL_H
16 | #define CDLL_DLL_H
17 |
18 | #define MAX_WEAPONS 32
19 | #define MAX_WEAPON_SLOTS 5
20 | #define MAX_ITEM_TYPES 6
21 | #define MAX_ITEMS 4
22 |
23 | #define HIDEHUD_WEAPONS (1<<0)
24 | #define HIDEHUD_FLASHLIGHT (1<<1)
25 | #define HIDEHUD_ALL (1<<2)
26 | #define HIDEHUD_HEALTH (1<<3)
27 | #define HIDEHUD_TIMER (1<<4)
28 | #define HIDEHUD_MONEY (1<<5)
29 | #define HIDEHUD_CROSSHAIR (1<<6)
30 |
31 | #define MAX_AMMO_TYPES 32
32 | #define MAX_AMMO_SLOTS 32
33 |
34 | #define HUD_PRINTNOTIFY 1
35 | #define HUD_PRINTCONSOLE 2
36 | #define HUD_PRINTTALK 3
37 | #define HUD_PRINTCENTER 4
38 | #define HUD_PRINTRADIO 5
39 |
40 |
41 | #define SCORE_STATUS_DEAD (1<<0)
42 | #define SCORE_STATUS_BOMB (1<<1)
43 | #define SCORE_STATUS_VIP (1<<2)
44 |
45 | #define STATUSICON_HIDE 0
46 | #define STATUSICON_SHOW 1
47 | #define STATUSICON_FLASH 2
48 |
49 | #define TEAM_UNASSIGNED 0
50 | #define TEAM_TERRORIST 1
51 | #define TEAM_CT 2
52 | #define TEAM_SPECTATOR 3
53 |
54 | #define CLASS_UNASSIGNED 0
55 | #define CLASS_URBAN 1
56 | #define CLASS_TERROR 2
57 | #define CLASS_LEET 3
58 | #define CLASS_ARCTIC 4
59 | #define CLASS_GSG9 5
60 | #define CLASS_GIGN 6
61 | #define CLASS_SAS 7
62 | #define CLASS_GUERILLA 8
63 | #define CLASS_VIP 9
64 | #define CLASS_MILITIA 10
65 | #define CLASS_SPETSNAZ 11
66 |
67 | #define MENU_KEY_1 (1<<0)
68 | #define MENU_KEY_2 (1<<1)
69 | #define MENU_KEY_3 (1<<2)
70 | #define MENU_KEY_4 (1<<3)
71 | #define MENU_KEY_5 (1<<4)
72 | #define MENU_KEY_6 (1<<5)
73 | #define MENU_KEY_7 (1<<6)
74 | #define MENU_KEY_8 (1<<7)
75 | #define MENU_KEY_9 (1<<8)
76 | #define MENU_KEY_0 (1<<9)
77 |
78 | #define MENU_TEAM 2
79 | #define MENU_MAPBRIEFING 4
80 | #define MENU_CLASS_T 26
81 | #define MENU_CLASS_CT 27
82 | #define MENU_BUY 28
83 | #define MENU_BUY_PISTOL 29
84 | #define MENU_BUY_SHOTGUN 30
85 | #define MENU_BUY_RIFLE 31
86 | #define MENU_BUY_SUBMACHINEGUN 32
87 | #define MENU_BUY_MACHINEGUN 33
88 | #define MENU_BUY_ITEM 34
89 | // -- cs16client extension start -- //
90 | #define MENU_RADIOA 35
91 | #define MENU_RADIOB 36
92 | #define MENU_RADIOC 37
93 | #define MENU_RADIOSELECTOR 38
94 | #define MENU_NUMERICAL_MENU -1
95 | // -- cs16client extension end -- //
96 |
97 |
98 | #define IUSER3_CANSHOOT (1<<0)
99 | #define IUSER3_FREEZETIMEOVER (1<<1)
100 | #define IUSER3_INBOMBZONE (1<<2)
101 | #define IUSER3_HOLDINGSHIELD (1<<3)
102 |
103 | #define ITEMSTATE_HASNIGHTVISION (1<<0)
104 | #define ITEMSTATE_HASDEFUSER (1<<1)
105 |
106 | #define PLAYER_DEAD (1<<0)
107 | #define PLAYER_HAS_C4 (1<<1)
108 | #define PLAYER_VIP (1<<2)
109 |
110 | #define WEAPON_SUIT 31
111 | #endif
112 |
--------------------------------------------------------------------------------
/dlls/exportdef.h:
--------------------------------------------------------------------------------
1 | #ifndef EXPORTDEF_H
2 | #define EXPORTDEF_H
3 | #if defined _WIN32 || defined __CYGWIN__
4 | #ifdef __GNUC__
5 | #define EXPORT __attribute__ ((dllexport))
6 | #else
7 | #define EXPORT __declspec(dllexport) // Note: actually gcc seems to also supports this syntax.
8 | #endif
9 | #else
10 | #if __GNUC__ >= 4
11 | #define EXPORT __attribute__ ((visibility ("default")))
12 | #else
13 | #define EXPORT
14 | #endif
15 | #endif
16 | #define DLLEXPORT EXPORT
17 | #define _DLLEXPORT EXPORT
18 | #endif // EXPORTDEF_H
19 |
--------------------------------------------------------------------------------
/dlls/extdll.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2001, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef EXTDLL_H
16 | #define EXTDLL_H
17 |
18 | //
19 | // Global header file for extension DLLs
20 | //
21 |
22 | // Allow "DEBUG" in addition to default "_DEBUG"
23 | #ifdef _DEBUG
24 | #define DEBUG 1
25 | #endif
26 |
27 | #ifdef MSC_VER
28 | // Silence certain warnings
29 | #pragma warning(disable : 4244) // int or float down-conversion
30 | #pragma warning(disable : 4305) // int or float data truncation
31 | #pragma warning(disable : 4201) // nameless struct/union
32 | #pragma warning(disable : 4514) // unreferenced inline function removed
33 | #pragma warning(disable : 4100) // unreferenced formal parameter
34 | #endif
35 |
36 | #include "archtypes.h" // DAL
37 |
38 | // Prevent tons of unused windows definitions
39 | #ifdef _WIN32
40 | #define WIN32_LEAN_AND_MEAN
41 | #define NOWINRES
42 | #define NOSERVICE
43 | #define NOMCX
44 | #define NOIME
45 | #include "windows.h"
46 | #else // _WIN32
47 | typedef unsigned char BYTE;
48 | typedef int BOOL;
49 | #define MAX_PATH PATH_MAX
50 | #include
51 | #include
52 | #include // memset
53 |
54 | #define _vsnprintf(a,b,c,d) vsnprintf(a,b,c,d)
55 | #endif //_WIN32
56 |
57 | // Misc C-runtime library headers
58 | #include "stdio.h"
59 | #include "stdlib.h"
60 | #include "math.h"
61 |
62 | #ifndef min
63 | #define min(a,b) (((a) < (b)) ? (a) : (b))
64 | #endif
65 | #ifndef max
66 | #define max(a,b) (((a) > (b)) ? (a) : (b))
67 | #endif
68 |
69 | // Header file containing definition of globalvars_t and entvars_t
70 | //typedef unsigned int func_t; //
71 | //typedef unsigned int string_t; // from engine's pr_comp.h;
72 | typedef float vec_t; // needed before including progdefs.h
73 |
74 | // Vector class
75 | #include "vector.h"
76 |
77 | // Defining it as a (bogus) struct helps enforce type-checking
78 | #define vec3_t Vector
79 |
80 | // Shared engine/DLL constants
81 | #include "const.h"
82 | #include "progdefs.h"
83 | #include "edict.h"
84 |
85 | // Shared header describing protocol between engine and DLLs
86 | #include "eiface.h"
87 |
88 | // Shared header between the client DLL and the game DLLs
89 | #include "cdll_dll.h"
90 | #endif //EXTDLL_H
91 |
--------------------------------------------------------------------------------
/dlls/hintmessage.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 |
16 | #include
17 |
18 | class CHintMessage
19 | {
20 | public:
21 | CHintMessage(const char *hintString, bool isHint, CUtlVector *args, float duration);
22 | ~CHintMessage(void);
23 |
24 | public:
25 | float GetDuration(void) const { return m_duration; }
26 | void Send(CBaseEntity *client);
27 | bool IsEquivalent(const char *hintString, CUtlVector *args) const;
28 |
29 | private:
30 | const char *m_hintString;
31 | CUtlVector m_args;
32 | float m_duration;
33 | bool m_isHint;
34 | };
35 |
36 | class CHintMessageQueue
37 | {
38 | public:
39 | void Reset(void);
40 | void Update(CBaseEntity *player);
41 | bool AddMessage(const char *message, float duration, bool isHint, CUtlVector *args);
42 | bool IsEmpty(void) { return m_messages.Count() == 0; }
43 |
44 | private:
45 | float m_tmMessageEnd;
46 | CUtlVector m_messages;
47 | };
48 |
--------------------------------------------------------------------------------
/dlls/monsterevent.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef MONSTEREVENT_H
16 | #define MONSTEREVENT_H
17 |
18 | typedef struct
19 | {
20 | int event;
21 | char *options;
22 | }
23 | MonsterEvent_t;
24 |
25 | #define EVENT_SPECIFIC 0
26 | #define EVENT_SCRIPTED 1000
27 | #define EVENT_SHARED 2000
28 | #define EVENT_CLIENT 5000
29 |
30 | #define MONSTER_EVENT_BODYDROP_LIGHT 2001
31 | #define MONSTER_EVENT_BODYDROP_HEAVY 2002
32 | #define MONSTER_EVENT_SWISHSOUND 2010
33 |
34 | #endif
--------------------------------------------------------------------------------
/dlls/nodes.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef NODES_H
16 | #define NODES_H
17 |
18 | #define bits_NODE_GROUP_REALM 1
19 |
20 | class CLink
21 | {
22 | public:
23 | entvars_t *m_pLinkEnt;
24 | };
25 |
26 | class CGraph
27 | {
28 | public:
29 | BOOL m_fGraphPresent;
30 | BOOL m_fGraphPointersSet;
31 | int m_cLinks;
32 | CLink *m_pLinkPool;
33 |
34 | public:
35 | void InitGraph(void);
36 | int AllocNodes(void);
37 | int CheckNODFile(char *szMapName);
38 | int FLoadGraph(char *szMapName);
39 | int FSetGraphPointers(void);
40 | void ShowNodeConnections(int iNode);
41 | int FindNearestNode(const Vector &vecOrigin, CBaseEntity *pEntity);
42 | int FindNearestNode(const Vector &vecOrigin, int afNodeTypes);
43 | };
44 |
45 | extern CGraph WorldGraph;
46 | #endif
--------------------------------------------------------------------------------
/dlls/schedule.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef SCHEDULE_H
16 | #define SCHEDULE_H
17 |
18 | #define bits_COND_SEE_HATE (1<<1)
19 | #define bits_COND_SEE_FEAR (1<<2)
20 | #define bits_COND_SEE_DISLIKE (1<<3)
21 | #define bits_COND_SEE_ENEMY (1<<4)
22 | #define bits_COND_LIGHT_DAMAGE (1<<8)
23 | #define bits_COND_HEAVY_DAMAGE (1<<9)
24 | #define bits_COND_SEE_CLIENT (1<<21)
25 | #define bits_COND_SEE_NEMESIS (1<<22)
26 |
27 | #endif
--------------------------------------------------------------------------------
/dlls/skill.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 |
16 | struct skilldata_t
17 | {
18 | int iSkillLevel;
19 | float agruntHealth;
20 | float agruntDmgPunch;
21 | float apacheHealth;
22 | float barneyHealth;
23 | float bigmommaHealthFactor;
24 | float bigmommaDmgSlash;
25 | float bigmommaDmgBlast;
26 | float bigmommaRadiusBlast;
27 | float bullsquidHealth;
28 | float bullsquidDmgBite;
29 | float bullsquidDmgWhip;
30 | float bullsquidDmgSpit;
31 | float gargantuaHealth;
32 | float gargantuaDmgSlash;
33 | float gargantuaDmgFire;
34 | float gargantuaDmgStomp;
35 | float hassassinHealth;
36 | float headcrabHealth;
37 | float headcrabDmgBite;
38 | float hgruntHealth;
39 | float hgruntDmgKick;
40 | float hgruntShotgunPellets;
41 | float hgruntGrenadeSpeed;
42 | float houndeyeHealth;
43 | float houndeyeDmgBlast;
44 | float slaveHealth;
45 | float slaveDmgClaw;
46 | float slaveDmgClawrake;
47 | float slaveDmgZap;
48 | float ichthyosaurHealth;
49 | float ichthyosaurDmgShake;
50 | float leechHealth;
51 | float leechDmgBite;
52 | float controllerHealth;
53 | float controllerDmgZap;
54 | float controllerSpeedBall;
55 | float controllerDmgBall;
56 | float nihilanthHealth;
57 | float nihilanthZap;
58 | float scientistHealth;
59 | float snarkHealth;
60 | float snarkDmgBite;
61 | float snarkDmgPop;
62 | float zombieHealth;
63 | float zombieDmgOneSlash;
64 | float zombieDmgBothSlash;
65 | float turretHealth;
66 | float miniturretHealth;
67 | float sentryHealth;
68 | float plrDmgCrowbar;
69 | float plrDmg9MM;
70 | float plrDmg357;
71 | float plrDmgMP5;
72 | float plrDmgM203Grenade;
73 | float plrDmgBuckshot;
74 | float plrDmgCrossbowClient;
75 | float plrDmgCrossbowMonster;
76 | float plrDmgRPG;
77 | float plrDmgGauss;
78 | float plrDmgEgonNarrow;
79 | float plrDmgEgonWide;
80 | float plrDmgHornet;
81 | float plrDmgHandGrenade;
82 | float plrDmgSatchel;
83 | float plrDmgTripmine;
84 | float monDmg9MM;
85 | float monDmgMP5;
86 | float monDmg12MM;
87 | float monDmgHornet;
88 | float suitchargerCapacity;
89 | float batteryCapacity;
90 | float healthchargerCapacity;
91 | float healthkitCapacity;
92 | float scientistHeal;
93 | float monHead;
94 | float monChest;
95 | float monStomach;
96 | float monLeg;
97 | float monArm;
98 | float plrHead;
99 | float plrChest;
100 | float plrStomach;
101 | float plrLeg;
102 | float plrArm;
103 | };
104 |
105 | extern DLL_GLOBAL skilldata_t gSkillData;
106 | float GetSkillCvar(char *pName);
107 | extern DLL_GLOBAL int g_iSkillLevel;
108 |
109 | #define SKILL_EASY 1
110 | #define SKILL_MEDIUM 2
111 | #define SKILL_HARD 3
--------------------------------------------------------------------------------
/dlls/soundent.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 |
16 | #define MAX_WORLD_SOUNDS 64
17 |
18 | #define bits_SOUND_NONE 0
19 | #define bits_SOUND_COMBAT (1<<0)
20 | #define bits_SOUND_WORLD (1<<1)
21 | #define bits_SOUND_PLAYER (1<< 2)
22 | #define bits_SOUND_CARCASS (1<< 3)
23 | #define bits_SOUND_MEAT (1<< 4)
24 | #define bits_SOUND_DANGER (1<< 5)
25 | #define bits_SOUND_GARBAGE (1<< 6)
26 |
27 | #define bits_ALL_SOUNDS 0xFFFFFFFF
28 |
29 | #define SOUNDLIST_EMPTY -1
30 |
31 | #define SOUNDLISTTYPE_FREE 1
32 | #define SOUNDLISTTYPE_ACTIVE 2
33 |
34 | #define SOUND_NEVER_EXPIRE -1
35 |
36 | class CSound
37 | {
38 | public:
39 | void Clear(void);
40 | void Reset(void);
41 |
42 | public:
43 | Vector m_vecOrigin;
44 | int m_iType;
45 | int m_iVolume;
46 | float m_flExpireTime;
47 | int m_iNext;
48 | int m_iNextAudible;
49 |
50 | public:
51 | BOOL FIsSound(void);
52 | BOOL FIsScent(void);
53 | };
54 |
55 | class CSoundEnt : public CBaseEntity
56 | {
57 | public:
58 | void Precache(void);
59 | void Spawn(void);
60 | void Think(void);
61 | void Initialize(void);
62 | int ObjectCaps(void) { return FCAP_DONT_SAVE; }
63 |
64 | public:
65 | static void InsertSound(int iType, const Vector &vecOrigin, int iVolume, float flDuration);
66 | static void FreeSound(int iSound, int iPrevious);
67 | static int ActiveList(void);
68 | static int FreeList(void);
69 | static CSound *SoundPointerForIndex(int iIndex);
70 | static int ClientSoundIndex(edict_t *pClient);
71 |
72 | public:
73 | BOOL IsEmpty(void) { return m_iActiveSound == SOUNDLIST_EMPTY; }
74 | int ISoundsInList(int iListType);
75 | int IAllocSound(void);
76 |
77 | public:
78 | int m_iFreeSound;
79 | int m_iActiveSound;
80 | int m_cLastActiveSounds;
81 | BOOL m_fShowReport;
82 |
83 | private:
84 | CSound m_SoundPool[MAX_WORLD_SOUNDS];
85 | };
--------------------------------------------------------------------------------
/dlls/stdafx.h:
--------------------------------------------------------------------------------
1 | #ifndef stdafx_h__
2 | #define stdafx_h__
3 |
4 | #include "port.h"
5 | #include "extdll.h"
6 | #include "util.h"
7 |
8 | #endif // stdafx_h__
9 |
--------------------------------------------------------------------------------
/engine/archtypes.h:
--------------------------------------------------------------------------------
1 | //
2 | // Word size dependent definitions
3 | // DAL 1/03
4 | //
5 | #ifndef ARCHTYPES_H
6 | #define ARCHTYPES_H
7 |
8 | #ifdef __x86_64__
9 | #define X64BITS
10 | #endif
11 |
12 | #if defined( _WIN32 ) && (! defined( __MINGW32__ ))
13 |
14 | typedef __int16 int16;
15 | typedef unsigned __int16 uint16;
16 | typedef __int32 int32;
17 | typedef unsigned __int32 uint32;
18 | typedef __int64 int64;
19 | typedef unsigned __int64 uint64;
20 | typedef __int32 intp; // intp is an integer that can accommodate a pointer
21 | typedef unsigned __int32 uintp; // (ie, sizeof(intp) >= sizeof(int) && sizeof(intp) >= sizeof(void *)
22 |
23 | #else /* _WIN32 */
24 |
25 | typedef short int16;
26 | typedef unsigned short uint16;
27 | typedef int int32;
28 | typedef unsigned int uint32;
29 | typedef long long int64;
30 | typedef unsigned long long uint64;
31 | #ifdef X64BITS
32 | typedef long long intp;
33 | typedef unsigned long long uintp;
34 | #else
35 | typedef int intp;
36 | typedef unsigned int uintp;
37 | #endif
38 |
39 | #endif /* else _WIN32 */
40 |
41 | #endif /* ARCHTYPES_H */
42 |
--------------------------------------------------------------------------------
/engine/customentity.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef CUSTOMENTITY_H
16 | #define CUSTOMENTITY_H
17 |
18 | // Custom Entities
19 |
20 | // Start/End Entity is encoded as 12 bits of entity index, and 4 bits of attachment (4:12)
21 | #define BEAMENT_ENTITY(x) ((x)&0xFFF)
22 | #define BEAMENT_ATTACHMENT(x) (((x)>>12)&0xF)
23 |
24 | // Beam types, encoded as a byte
25 | enum
26 | {
27 | BEAM_POINTS = 0,
28 | BEAM_ENTPOINT,
29 | BEAM_ENTS,
30 | BEAM_HOSE,
31 | };
32 |
33 | #define BEAM_FSINE 0x10
34 | #define BEAM_FSOLID 0x20
35 | #define BEAM_FSHADEIN 0x40
36 | #define BEAM_FSHADEOUT 0x80
37 |
38 | #endif //CUSTOMENTITY_H
39 |
--------------------------------------------------------------------------------
/engine/edict.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #if !defined EDICT_H
9 | #define EDICT_H
10 | #ifdef _WIN32
11 | #ifndef __MINGW32__
12 | #pragma once
13 | #endif /* not __MINGW32__ */
14 | #endif
15 | #define MAX_ENT_LEAFS 48
16 |
17 | #include "progdefs.h"
18 |
19 | struct edict_s
20 | {
21 | qboolean free;
22 | int serialnumber;
23 | link_t area; // linked to a division node or leaf
24 |
25 | int headnode; // -1 to use normal leaf check
26 | int num_leafs;
27 | short leafnums[MAX_ENT_LEAFS];
28 |
29 | float freetime; // sv.time when the object was freed
30 |
31 | void* pvPrivateData; // Alloced and freed by engine, used by DLLs
32 |
33 | entvars_t v; // C exported fields from progs
34 |
35 | // other fields from progs come immediately after
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/engine/keydefs.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | // keydefs.h
9 | #ifndef KEYDEFS_H
10 | #define KEYDEFS_H
11 | #ifdef _WIN32
12 | #ifndef __MINGW32__
13 | #pragma once
14 | #endif /* not __MINGW32__ */
15 | #endif
16 |
17 | //
18 | // these are the key numbers that should be passed to Key_Event
19 | //
20 | #define K_TAB 9
21 | #define K_ENTER 13
22 | #define K_ESCAPE 27
23 | #define K_SPACE 32
24 |
25 | // normal keys should be passed as lowercased ascii
26 |
27 | #define K_BACKSPACE 127
28 | #define K_UPARROW 128
29 | #define K_DOWNARROW 129
30 | #define K_LEFTARROW 130
31 | #define K_RIGHTARROW 131
32 |
33 | #define K_ALT 132
34 | #define K_CTRL 133
35 | #define K_SHIFT 134
36 | #define K_F1 135
37 | #define K_F2 136
38 | #define K_F3 137
39 | #define K_F4 138
40 | #define K_F5 139
41 | #define K_F6 140
42 | #define K_F7 141
43 | #define K_F8 142
44 | #define K_F9 143
45 | #define K_F10 144
46 | #define K_F11 145
47 | #define K_F12 146
48 | #define K_INS 147
49 | #define K_DEL 148
50 | #define K_PGDN 149
51 | #define K_PGUP 150
52 | #define K_HOME 151
53 | #define K_END 152
54 |
55 | #define K_KP_HOME 160
56 | #define K_KP_UPARROW 161
57 | #define K_KP_PGUP 162
58 | #define K_KP_LEFTARROW 163
59 | #define K_KP_5 164
60 | #define K_KP_RIGHTARROW 165
61 | #define K_KP_END 166
62 | #define K_KP_DOWNARROW 167
63 | #define K_KP_PGDN 168
64 | #define K_KP_ENTER 169
65 | #define K_KP_INS 170
66 | #define K_KP_DEL 171
67 | #define K_KP_SLASH 172
68 | #define K_KP_MINUS 173
69 | #define K_KP_PLUS 174
70 | #define K_CAPSLOCK 175
71 |
72 |
73 | //
74 | // joystick buttons
75 | //
76 | #define K_JOY1 203
77 | #define K_JOY2 204
78 | #define K_JOY3 205
79 | #define K_JOY4 206
80 |
81 | //
82 | // aux keys are for multi-buttoned joysticks to generate so they can use
83 | // the normal binding process
84 | //
85 | #define K_AUX1 207
86 | #define K_AUX2 208
87 | #define K_AUX3 209
88 | #define K_AUX4 210
89 | #define K_AUX5 211
90 | #define K_AUX6 212
91 | #define K_AUX7 213
92 | #define K_AUX8 214
93 | #define K_AUX9 215
94 | #define K_AUX10 216
95 | #define K_AUX11 217
96 | #define K_AUX12 218
97 | #define K_AUX13 219
98 | #define K_AUX14 220
99 | #define K_AUX15 221
100 | #define K_AUX16 222
101 | #define K_AUX17 223
102 | #define K_AUX18 224
103 | #define K_AUX19 225
104 | #define K_AUX20 226
105 | #define K_AUX21 227
106 | #define K_AUX22 228
107 | #define K_AUX23 229
108 | #define K_AUX24 230
109 | #define K_AUX25 231
110 | #define K_AUX26 232
111 | #define K_AUX27 233
112 | #define K_AUX28 234
113 | #define K_AUX29 235
114 | #define K_AUX30 236
115 | #define K_AUX31 237
116 | #define K_AUX32 238
117 | #define K_MWHEELDOWN 239
118 | #define K_MWHEELUP 240
119 |
120 | #define K_PAUSE 255
121 |
122 | //
123 | // mouse buttons generate virtual keys
124 | //
125 | #define K_MOUSE1 241
126 | #define K_MOUSE2 242
127 | #define K_MOUSE3 243
128 | #define K_MOUSE4 244
129 | #define K_MOUSE5 245
130 |
131 | #endif // KEYDEFS_H
132 |
--------------------------------------------------------------------------------
/engine/mobility_int.h:
--------------------------------------------------------------------------------
1 | /*
2 | mobility_int.h - interface between engine and client for mobile platforms
3 | Copyright (C) 2015 a1batross
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #pragma once
17 | #ifndef MOBILITY_INT_H
18 | #define MOBILITY_INT_H
19 | #ifdef __cplusplus
20 | extern "C" {
21 | #endif
22 |
23 | #define MOBILITY_API_VERSION 2
24 | #define MOBILITY_CLIENT_EXPORT "HUD_MobilityInterface"
25 |
26 | #define VIBRATE_NORMAL (1U << 0) // just vibrate for given "life"
27 |
28 | #define TOUCH_FL_HIDE (1U << 0)
29 | #define TOUCH_FL_NOEDIT (1U << 1)
30 | #define TOUCH_FL_CLIENT (1U << 2)
31 | #define TOUCH_FL_MP (1U << 3)
32 | #define TOUCH_FL_SP (1U << 4)
33 | #define TOUCH_FL_DEF_SHOW (1U << 5)
34 | #define TOUCH_FL_DEF_HIDE (1U << 6)
35 | #define TOUCH_FL_DRAW_ADDITIVE (1U << 7)
36 | #define TOUCH_FL_STROKE (1U << 8)
37 | #define TOUCH_FL_PRECISION (1U << 9)
38 |
39 | typedef struct mobile_engfuncs_s
40 | {
41 | // indicates version of API. Should be equal to MOBILITY_API_VERSION
42 | // version changes when existing functions are changes
43 | int version;
44 |
45 | // vibration control
46 | // life -- time to vibrate in ms
47 | void (*pfnVibrate)( float life, char flags );
48 |
49 | // enable text input
50 | void (*pfnEnableTextInput)( int enable );
51 |
52 | // add temporaty button, edit will be disabled
53 | void (*pfnTouchAddClientButton)( const char *name, const char *texture, const char *command, float x1, float y1, float x2, float y2, unsigned char *color, int round, float aspect, int flags );
54 |
55 | // add button to defaults list. Will be loaded on config generation
56 | void (*pfnTouchAddDefaultButton)( const char *name, const char *texturefile, const char *command, float x1, float y1, float x2, float y2, unsigned char *color, int round, float aspect, int flags );
57 |
58 | // hide/show buttons by pattern
59 | void (*pfnTouchHideButtons)( const char *name, unsigned char hide );
60 |
61 | // remove button with given name
62 | void (*pfnTouchRemoveButton)( const char *name );
63 |
64 | // when enabled, only client buttons shown
65 | void (*pfnTouchSetClientOnly)( unsigned char state );
66 |
67 | // Clean defaults list
68 | void (*pfnTouchResetDefaultButtons)();
69 |
70 | // Draw scaled font for client
71 | int (*pfnDrawScaledCharacter)( int x, int y, int number, int r, int g, int b, float scale );
72 |
73 | // To be continued...
74 | } mobile_engfuncs_t;
75 |
76 | // function exported from client
77 | // returns 0 on no error otherwise error
78 | typedef int (*pfnMobilityInterface)( mobile_engfuncs_t *gMobileEngfuncs );
79 |
80 | #ifdef __cplusplus
81 | }
82 | #endif
83 | #endif
84 |
--------------------------------------------------------------------------------
/engine/progs.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef PROGS_H
16 | #define PROGS_H
17 |
18 | #include "progdefs.h"
19 |
20 | // 16 simultaneous events, max
21 | #define MAX_EVENT_QUEUE 64
22 |
23 | #define DEFAULT_EVENT_RESENDS 1
24 |
25 | #include "event_flags.h"
26 |
27 | typedef struct event_info_s event_info_t;
28 |
29 | #include "event_args.h"
30 |
31 | struct event_info_s
32 | {
33 | unsigned short index; // 0 implies not in use
34 |
35 | short packet_index; // Use data from state info for entity in delta_packet . -1 implies separate info based on event
36 | // parameter signature
37 | short entity_index; // The edict this event is associated with
38 |
39 | float fire_time; // if non-zero, the time when the event should be fired ( fixed up on the client )
40 |
41 | event_args_t args;
42 |
43 | // CLIENT ONLY
44 | int flags; // Reliable or not, etc.
45 |
46 | };
47 |
48 | typedef struct event_state_s event_state_t;
49 |
50 | struct event_state_s
51 | {
52 | struct event_info_s ei[ MAX_EVENT_QUEUE ];
53 | };
54 |
55 | #if !defined( ENTITY_STATEH )
56 | #include "entity_state.h"
57 | #endif
58 |
59 | #if !defined( EDICT_H )
60 | #include "edict.h"
61 | #endif
62 |
63 | #define STRUCT_FROM_LINK(l,t,m) ((t *)((byte *)l - (int)&(((t *)0)->m)))
64 | #define EDICT_FROM_AREA(l) STRUCT_FROM_LINK(l,edict_t,area)
65 |
66 | //============================================================================
67 |
68 | extern char *pr_strings;
69 | extern globalvars_t gGlobalVariables;
70 |
71 | //============================================================================
72 |
73 | edict_t *ED_Alloc (void);
74 | void ED_Free (edict_t *ed);
75 | void ED_LoadFromFile (char *data);
76 |
77 | edict_t *EDICT_NUM(int n);
78 | int NUM_FOR_EDICT(const edict_t *e);
79 |
80 | #define PROG_TO_EDICT(e) ((edict_t *)((byte *)sv.edicts + e))
81 |
82 | #endif // PROGS_H
83 |
--------------------------------------------------------------------------------
/engine/shake.h:
--------------------------------------------------------------------------------
1 | /***
2 | *
3 | * Copyright (c) 1996-2002, Valve LLC. All rights reserved.
4 | *
5 | * This product contains software technology licensed from Id
6 | * Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
7 | * All Rights Reserved.
8 | *
9 | * Use, distribution, and modification of this source code and/or resulting
10 | * object code is restricted to non-commercial enhancements to products from
11 | * Valve LLC. All other use, distribution, or modification is prohibited
12 | * without written permission from Valve LLC.
13 | *
14 | ****/
15 | #ifndef SHAKE_H
16 | #define SHAKE_H
17 |
18 | // Screen / View effects
19 |
20 | // screen shake
21 | extern int gmsgShake;
22 |
23 | // This structure is sent over the net to describe a screen shake event
24 | typedef struct
25 | {
26 | unsigned short amplitude; // FIXED 4.12 amount of shake
27 | unsigned short duration; // FIXED 4.12 seconds duration
28 | unsigned short frequency; // FIXED 8.8 noise frequency (low frequency is a jerk,high frequency is a rumble)
29 | } ScreenShake;
30 |
31 | extern void V_ApplyShake( float *origin, float *angles, float factor );
32 | extern void V_CalcShake( void );
33 | extern int V_ScreenShake( const char *pszName, int iSize, void *pbuf );
34 | extern int V_ScreenFade( const char *pszName, int iSize, void *pbuf );
35 |
36 |
37 | // Fade in/out
38 | extern int gmsgFade;
39 |
40 | #define FFADE_IN 0x0000 // Just here so we don't pass 0 into the function
41 | #define FFADE_OUT 0x0001 // Fade out (not in)
42 | #define FFADE_MODULATE 0x0002 // Modulate (don't blend)
43 | #define FFADE_STAYOUT 0x0004 // ignores the duration, stays faded out until new ScreenFade message received
44 |
45 | // This structure is sent over the net to describe a screen fade event
46 | typedef struct
47 | {
48 | unsigned short duration; // FIXED 4.12 seconds duration
49 | unsigned short holdTime; // FIXED 4.12 seconds duration until reset (fade & hold)
50 | short fadeFlags; // flags
51 | byte r, g, b, a; // fade to color ( max alpha )
52 | } ScreenFade;
53 |
54 | #endif // SHAKE_H
55 |
56 |
--------------------------------------------------------------------------------
/game_shared/voice_banmgr.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #ifndef VOICE_BANMGR_H
9 | #define VOICE_BANMGR_H
10 | #ifdef _WIN32
11 | #ifndef __MINGW32__
12 | #pragma once
13 | #endif /* not __MINGW32__ */
14 | #endif
15 |
16 |
17 | // This class manages the (persistent) list of squelched players.
18 | class CVoiceBanMgr
19 | {
20 | public:
21 |
22 | CVoiceBanMgr();
23 | ~CVoiceBanMgr();
24 |
25 | // Init loads the list of squelched players from disk.
26 | bool Init(char const *pGameDir);
27 | void Term();
28 |
29 | // Saves the state into voice_squelch.dt.
30 | void SaveState(char const *pGameDir);
31 |
32 | bool GetPlayerBan(char const playerID[16]);
33 | void SetPlayerBan(char const playerID[16], bool bSquelch);
34 |
35 | // Call your callback for each banned player.
36 | void ForEachBannedPlayer(void (*callback)(char id[16]));
37 |
38 |
39 | protected:
40 |
41 | class BannedPlayer
42 | {
43 | public:
44 | char m_PlayerID[16];
45 | BannedPlayer *m_pPrev, *m_pNext;
46 | };
47 |
48 | void Clear();
49 | BannedPlayer* InternalFindPlayerSquelch(char const playerID[16]);
50 | BannedPlayer* AddBannedPlayer(char const playerID[16]);
51 |
52 |
53 | protected:
54 |
55 | BannedPlayer m_PlayerHash[256];
56 | };
57 |
58 |
59 | #endif // VOICE_BANMGR_H
60 |
--------------------------------------------------------------------------------
/game_shared/voice_common.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #ifndef VOICE_COMMON_H
9 | #define VOICE_COMMON_H
10 | #ifdef _WIN32
11 | #ifndef __MINGW32__
12 | #pragma once
13 | #endif /* not __MINGW32__ */
14 | #endif
15 |
16 |
17 | #include "bitvec.h"
18 |
19 |
20 | #define VOICE_MAX_PLAYERS 32 // (todo: this should just be set to MAX_CLIENTS).
21 | #define VOICE_MAX_PLAYERS_DW ((VOICE_MAX_PLAYERS / 32) + !!(VOICE_MAX_PLAYERS & 31))
22 |
23 | typedef CBitVec CPlayerBitVec;
24 |
25 |
26 | #endif // VOICE_COMMON_H
27 |
--------------------------------------------------------------------------------
/game_shared/voice_gamemgr.h:
--------------------------------------------------------------------------------
1 | //========= Copyright © 1996-2002, Valve LLC, All rights reserved. ============
2 | //
3 | // Purpose:
4 | //
5 | // $NoKeywords: $
6 | //=============================================================================
7 |
8 | #ifndef VOICE_GAMEMGR_H
9 | #define VOICE_GAMEMGR_H
10 | #ifdef _WIN32
11 | #ifndef __MINGW32__
12 | #pragma once
13 | #endif /* not __MINGW32__ */
14 | #endif
15 |
16 |
17 | #include "voice_common.h"
18 |
19 |
20 | class CGameRules;
21 | class CBasePlayer;
22 |
23 |
24 | class IVoiceGameMgrHelper
25 | {
26 | public:
27 | virtual ~IVoiceGameMgrHelper() {}
28 |
29 | // Called each frame to determine which players are allowed to hear each other. This overrides
30 | // whatever squelch settings players have.
31 | virtual bool CanPlayerHearPlayer(CBasePlayer *pListener, CBasePlayer *pTalker) = 0;
32 | };
33 |
34 |
35 | // CVoiceGameMgr manages which clients can hear which other clients.
36 | class CVoiceGameMgr
37 | {
38 | public:
39 | CVoiceGameMgr();
40 | virtual ~CVoiceGameMgr();
41 |
42 | bool Init(
43 | IVoiceGameMgrHelper *m_pHelper,
44 | int maxClients
45 | );
46 |
47 | void SetHelper(IVoiceGameMgrHelper *pHelper);
48 |
49 | // Updates which players can hear which other players.
50 | // If gameplay mode is DM, then only players within the PVS can hear each other.
51 | // If gameplay mode is teamplay, then only players on the same team can hear each other.
52 | // Player masks are always applied.
53 | void Update(double frametime);
54 |
55 | // Called when a new client connects (unsquelches its entity for everyone).
56 | void ClientConnected(struct edict_s *pEdict);
57 |
58 | // Called on ClientCommand. Checks for the squelch and unsquelch commands.
59 | // Returns true if it handled the command.
60 | bool ClientCommand(CBasePlayer *pPlayer, const char *cmd);
61 |
62 | // Called to determine if the Receiver has muted (blocked) the Sender
63 | // Returns true if the receiver has blocked the sender
64 | bool PlayerHasBlockedPlayer(CBasePlayer *pReceiver, CBasePlayer *pSender);
65 |
66 |
67 | private:
68 |
69 | // Force it to update the client masks.
70 | void UpdateMasks();
71 |
72 |
73 | private:
74 | int m_msgPlayerVoiceMask;
75 | int m_msgRequestState;
76 |
77 | IVoiceGameMgrHelper *m_pHelper;
78 | int m_nMaxPlayers;
79 | double m_UpdateInterval; // How long since the last update.
80 | };
81 |
82 |
83 | #endif // VOICE_GAMEMGR_H
84 |
--------------------------------------------------------------------------------
/mainui/Android.mk:
--------------------------------------------------------------------------------
1 |
2 | #Xash3d mainui port for android
3 | #Copyright (c) nicknekit
4 |
5 | LOCAL_PATH := $(call my-dir)
6 |
7 | include $(CLEAR_VARS)
8 |
9 | include $(XASH3D_CONFIG)
10 |
11 | ifeq ($(TARGET_ARCH_ABI),armeabi-v7a-hard)
12 | LOCAL_MODULE_FILENAME = libmenu_hardfp
13 | endif
14 |
15 |
16 |
17 | LOCAL_MODULE := menu
18 |
19 | APP_PLATFORM := android-12
20 |
21 | LOCAL_C_INCLUDES := $(SDL_PATH)/include \
22 | $(LOCAL_PATH)/. \
23 | $(LOCAL_PATH)/../common \
24 | $(LOCAL_PATH)/../pm_shared \
25 | $(LOCAL_PATH)/../engine \
26 | $(LOCAL_PATH)/../engine/common \
27 | $(LOCAL_PATH)/../utils/vgui/include \
28 | $(HLSDK_PATH)/cl_dll/
29 |
30 | LOCAL_SRC_FILES := basemenu.cpp \
31 | menu_advcontrols.cpp \
32 | menu_audio.cpp \
33 | menu_btns.cpp \
34 | menu_configuration.cpp \
35 | menu_controls.cpp \
36 | menu_creategame.cpp \
37 | menu_credits.cpp \
38 | menu_filedialog.cpp \
39 | menu_gameoptions.cpp \
40 | menu_gamepad.cpp \
41 | menu_internetgames.cpp \
42 | menu_langame.cpp \
43 | menu_main.cpp \
44 | menu_multiplayer.cpp \
45 | menu_playersetup.cpp \
46 | menu_strings.cpp \
47 | menu_vidoptions.cpp \
48 | menu_touchoptions.cpp \
49 | menu_touch.cpp \
50 | menu_touchedit.cpp \
51 | menu_touchbuttons.cpp \
52 | udll_int.cpp \
53 | ui_title_anim.cpp \
54 | utils.cpp \
55 | legacy/menu_playrec.cpp \
56 | legacy/menu_playdemo.cpp \
57 | legacy/menu_recdemo.cpp
58 |
59 | #ifeq ($(XASH_SDL),1)
60 | #LOCAL_SHARED_LIBRARIES += SDL2
61 | #endif
62 | include $(BUILD_SHARED_LIBRARY)
63 |
--------------------------------------------------------------------------------
/mainui/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | #
2 | # Copyright (c) 2015 Pavlo Lavrenenko
3 | #
4 | # Permission is hereby granted, free of charge, to any person obtaining a copy
5 | # of this software and associated documentation files (the "Software"), to deal
6 | # in the Software without restriction, including without limitation the rights
7 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | # copies of the Software, and to permit persons to whom the Software is
9 | # furnished to do so, subject to the following conditions:
10 | #
11 | # The above copyright notice and this permission notice shall be included in all
12 | # copies or substantial portions of the Software.
13 | #
14 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | # SOFTWARE.
21 | #
22 |
23 | cmake_minimum_required(VERSION 2.6.0)
24 | project (MAINUI)
25 |
26 | # set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
27 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -m32")
28 | set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")
29 | set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3")
30 | set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Os")
31 | set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3")
32 | set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32")
33 |
34 | if(PANDORA)
35 | add_definitions(-DPANDORA)
36 | endif()
37 |
38 | set (MAINUI_LIBRARY xashmenu)
39 |
40 | file (GLOB MAINUI_SOURCES *.cpp legacy/*.cpp)
41 | include_directories (../common ../engine ../pm_shared ../mainui)
42 | add_library (${MAINUI_LIBRARY} SHARED ${MAINUI_SOURCES})
43 |
44 | set_target_properties (${MAINUI_SHARED} PROPERTIES
45 | VERSION ${XASH3D_VERSION} SOVERSION ${XASH3D_VERSION}
46 | POSITION_INDEPENDENT_CODE 1)
47 |
48 | install( TARGETS ${MAINUI_LIBRARY} DESTINATION ${LIB_INSTALL_DIR}/xash3d
49 | PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
50 |
51 |
--------------------------------------------------------------------------------
/mainui/extdll.h:
--------------------------------------------------------------------------------
1 | /*
2 | extdll.h - must be included into the all ui files
3 | Copyright (C) 2010 Uncle Mike
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #ifndef EXTDLL_H
17 | #define EXTDLL_H
18 |
19 | // Misc C-runtime library headers
20 | #include
21 | #include
22 | #include
23 | #include
24 | #include
25 | #include
26 |
27 | #define bound( min, num, max ) ((num) >= (min) ? ((num) < (max) ? (num) : (max)) : (min))
28 | #define min( a, b ) (((a) < (b)) ? (a) : (b))
29 |
30 | #ifndef FALSE
31 | #define FALSE 0
32 | #endif
33 |
34 | #ifndef TRUE
35 | #define TRUE (!FALSE)
36 | #endif
37 |
38 | #ifndef _WIN32
39 | #define stricmp strcasecmp
40 | #define strnicmp strncasecmp
41 | #else
42 | #define strnicmp _strnicmp
43 | #define stricmp _stricmp
44 | #define snprintf _snprintf
45 | #endif
46 |
47 | typedef int (*cmpfunc)( const void *a, const void *b );
48 | typedef int BOOL;
49 | typedef unsigned char byte;
50 |
51 | #include "menu_int.h"
52 |
53 | #endif//EXTDLL_H
54 |
--------------------------------------------------------------------------------
/mainui/menu_btnsbmp_table.h:
--------------------------------------------------------------------------------
1 | /*
2 | menu_btnsbmp_table.h - btns_main layout
3 | Copyright (C) 2011 CrazyRussian
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #ifndef MENU_BTNSBMP_TABLE_H
17 | #define MENU_BTNSBMP_TABLE_H
18 |
19 | enum
20 | {
21 | PC_NEW_GAME = 0,
22 | PC_RESUME_GAME,
23 | PC_HAZARD_COURSE,
24 | PC_CONFIG,
25 | PC_LOAD_GAME,
26 | PC_SAVE_LOAD_GAME,
27 | PC_VIEW_README,
28 | PC_QUIT,
29 | PC_MULTIPLAYER,
30 | PC_EASY,
31 | PC_MEDIUM,
32 | PC_DIFFICULT,
33 | PC_SAVE_GAME,
34 | PC_LOAD_GAME2,
35 | PC_CANCEL,
36 | PC_GAME_OPTIONS,
37 | PC_VIDEO,
38 | PC_AUDIO,
39 | PC_CONTROLS,
40 | PC_DONE,
41 | PC_QUICKSTART,
42 | PC_USE_DEFAULTS,
43 | PC_OK,
44 | PC_VID_OPT,
45 | PC_VID_MODES,
46 | PC_ADV_CONTROLS,
47 | PC_ORDER_HL,
48 | PC_DELETE,
49 | PC_INET_GAME,
50 | PC_CHAT_ROOMS,
51 | PC_LAN_GAME,
52 | PC_CUSTOMIZE,
53 | PC_SKIP,
54 | PC_EXIT,
55 | PC_CONNECT,
56 | PC_REFRESH,
57 | PC_FILTER,
58 | PC_FILTER2,
59 | PC_CREATE,
60 | PC_CREATE_GAME,
61 | PC_CHAT_ROOMS2,
62 | PC_LIST_ROOMS,
63 | PC_SEARCH,
64 | PC_SERVERS,
65 | PC_JOIN,
66 | PC_FIND,
67 | PC_CREATE_ROOM,
68 | PC_JOIN_GAME,
69 | PC_SEARCH_GAMES,
70 | PC_FIND_GAME,
71 | PC_START_GAME,
72 | PC_VIEW_GAME_INFO,
73 | PC_UPDATE,
74 | PC_ADD_SERVER,
75 | PC_DISCONNECT,
76 | PC_CONSOLE,
77 | PC_CONTENT_CONTROL,
78 | PC_UPDATE2,
79 | PC_VISIT_WON,
80 | PC_PREVIEWS,
81 | PC_ADV_OPT,
82 | PC_3DINFO_SITE,
83 | PC_CUSTOM_GAME,
84 | PC_ACTIVATE,
85 | PC_INSTALL,
86 | PC_VISIT_WEB_SITE,
87 | PC_REFRESH_LIST,
88 | PC_DEACTIVATE,
89 | PC_ADV_OPT2,
90 | PC_SPECTATE_GAME,
91 | PC_SPECTATE_GAMES,
92 | PC_BUTTONCOUNT // must be last
93 | };
94 |
95 | #define BUTTON_NOFOCUS 0
96 | #define BUTTON_FOCUS 1
97 | #define BUTTON_PRESSED 2
98 |
99 | extern const char *MenuButtons[PC_BUTTONCOUNT];
100 |
101 | inline int PicButtonWidth( int pic_id )
102 | {
103 | if( pic_id < 0 || pic_id > PC_BUTTONCOUNT )
104 | return 0;
105 |
106 | return strlen( MenuButtons[pic_id] );
107 | }
108 |
109 | #endif//MENU_BTNSBMP_TABLE_H
110 |
--------------------------------------------------------------------------------
/mainui/menu_strings.h:
--------------------------------------------------------------------------------
1 | /*
2 | menu_strings.h - custom menu strings
3 | Copyright (C) 2011 Uncle Mike
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #define HINT_DISPLAYMODE 132
17 | #define HINT_REVERSE_MOUSE 171
18 | #define HINT_MOUSE_SENSE 184
19 | #define HINT_RESUME_GAME 188
20 | #define HINT_NEWGAME 189
21 | #define HINT_HAZARD_COURSE 190
22 | #define HINT_LOADGAME 191
23 | #define HINT_SAVELOADGAME 192
24 | #define HINT_CONFIGURATION 193
25 | #define HINT_QUIT_BUTTON 196
26 | #define HINT_MULTIPLAYER 198
27 | #define HINT_SKILL_EASY 200
28 | #define HINT_SKILL_NORMAL 201
29 | #define HINT_SKILL_HARD 202
30 | #define HINT_RESTART_HZ 234
31 | #define HINT_QUIT_ACTIVE 235
32 | #define HINT_QUIT 236
33 | #define HINT_RESTART_GAME 240
34 | #define HINT_PREVIEWS_TEXT 400
35 | #define HINT_PREVIEWS_CMD 402 // this buton will execute program or open HTML-window
36 | #define HINT_CUSTOM_GAME 530
37 | #define HINT_MAXSTRINGS 551 // 550 strings allowed
38 |
39 | extern const char *MenuStrings[HINT_MAXSTRINGS];
40 |
--------------------------------------------------------------------------------
/mainui/menu_touchedit.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | Copyright (C) 1997-2001 Id Software, Inc.
3 |
4 | This program is free software; you can redistribute it and/or
5 | modify it under the terms of the GNU General Public License
6 | as published by the Free Software Foundation; either version 2
7 | of the License, or (at your option) any later version.
8 |
9 | This program is distributed in the hope that it will be useful,
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 |
13 | See the GNU General Public License for more details.
14 |
15 | You should have received a copy of the GNU General Public License
16 | along with this program; if not, write to the Free Software
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 |
19 | */
20 |
21 | /*
22 | * This is empty menu that allows engine to draw touch editor
23 | */
24 |
25 | #include "extdll.h"
26 | #include "basemenu.h"
27 | #include "utils.h"
28 | #include "keydefs.h"
29 |
30 | typedef struct
31 | {
32 | int active;
33 |
34 | menuFramework_s menu;
35 | } uiTouchEdit_t;
36 |
37 | static uiTouchEdit_t uiTouchEdit;
38 |
39 |
40 | /*
41 | =================
42 | UI_TouchEdit_DrawFunc
43 | =================
44 | */
45 | static void UI_TouchEdit_DrawFunc( void )
46 | {
47 | if( !CVAR_GET_FLOAT("touch_in_menu") )
48 | {
49 | UI_PopMenu();
50 | UI_TouchButtons_GetButtonList();
51 | }
52 | }
53 |
54 | /*
55 | =================
56 | UI_TouchEdit_KeyFunc
57 | =================
58 | */
59 | static const char *UI_TouchEdit_KeyFunc( int key, int down )
60 | {
61 | if( down && key == K_ESCAPE )
62 | {
63 | CVAR_SET_STRING("touch_in_menu", "0");
64 | CLIENT_COMMAND(0, "touch_disableedit");
65 | UI_PopMenu();
66 | return uiSoundOut;
67 | }
68 | return uiSoundNull;
69 | }
70 |
71 | /*
72 | =================
73 | UI_TouchEdit_Init
74 | =================
75 | */
76 | static void UI_TouchEdit_Init( void )
77 | {
78 | uiTouchEdit.menu.drawFunc = UI_TouchEdit_DrawFunc;
79 | uiTouchEdit.menu.keyFunc = UI_TouchEdit_KeyFunc;
80 | CVAR_SET_STRING("touch_in_menu", "1");
81 | CLIENT_COMMAND(0, "touch_enableedit");
82 | }
83 |
84 | /*
85 | =================
86 | UI_TouchEdit_Precache
87 | =================
88 | */
89 | void UI_TouchEdit_Precache( void )
90 | {
91 |
92 | }
93 |
94 | /*
95 | =================
96 | UI_TouchEdit_Menu
97 | =================
98 | */
99 | void UI_TouchEdit_Menu( void )
100 | {
101 | UI_TouchEdit_Precache();
102 | UI_TouchEdit_Init();
103 |
104 | UI_PushMenu( &uiTouchEdit.menu );
105 | }
106 |
--------------------------------------------------------------------------------
/mainui/udll_int.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | dll_int.cpp - dll entry point
3 | Copyright (C) 2010 Uncle Mike
4 |
5 | This program is free software: you can redistribute it and/or modify
6 | it under the terms of the GNU General Public License as published by
7 | the Free Software Foundation, either version 3 of the License, or
8 | (at your option) any later version.
9 |
10 | This program is distributed in the hope that it will be useful,
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 | GNU General Public License for more details.
14 | */
15 |
16 | #include "extdll.h"
17 | #include "basemenu.h"
18 | #include "utils.h"
19 |
20 | ui_enginefuncs_t g_engfuncs;
21 | ui_textfuncs_t g_textfuncs;
22 | ui_globalvars_t *gpGlobals;
23 | CMenu gMenu;
24 |
25 | static UI_FUNCTIONS gFunctionTable =
26 | {
27 | UI_VidInit,
28 | UI_Init,
29 | UI_Shutdown,
30 | UI_UpdateMenu,
31 | UI_KeyEvent,
32 | UI_MouseMove,
33 | UI_SetActiveMenu,
34 | UI_AddServerToList,
35 | UI_GetCursorPos,
36 | UI_SetCursorPos,
37 | UI_ShowCursor,
38 | UI_CharEvent,
39 | UI_MouseInRect,
40 | UI_IsVisible,
41 | UI_CreditsActive,
42 | UI_FinalCredits
43 | };
44 |
45 | #ifdef _WIN32
46 | #define EXPORT __declspec(dllexport)
47 | #else
48 | #define EXPORT
49 | #endif
50 |
51 | //=======================================================================
52 | // GetApi
53 | //=======================================================================
54 | extern "C" EXPORT int GetMenuAPI(UI_FUNCTIONS *pFunctionTable, ui_enginefuncs_t* pEngfuncsFromEngine, ui_globalvars_t *pGlobals)
55 | {
56 | if( !pFunctionTable || !pEngfuncsFromEngine )
57 | {
58 | return FALSE;
59 | }
60 |
61 | // copy HUD_FUNCTIONS table to engine, copy engfuncs table from engine
62 | memcpy( pFunctionTable, &gFunctionTable, sizeof( UI_FUNCTIONS ));
63 | memcpy( &g_engfuncs, pEngfuncsFromEngine, sizeof( ui_enginefuncs_t ));
64 | memset( &g_textfuncs, 0, sizeof( ui_textfuncs_t ));
65 |
66 | gpGlobals = pGlobals;
67 |
68 | return TRUE;
69 | }
70 |
71 | extern "C" EXPORT int GiveTextAPI( ui_textfuncs_t* pTextfuncsFromEngine )
72 | {
73 | if( !pTextfuncsFromEngine )
74 | {
75 | return FALSE;
76 | }
77 |
78 | // copy HUD_FUNCTIONS table to engine, copy engfuncs table from engine
79 | memcpy( &g_textfuncs, pTextfuncsFromEngine, sizeof( ui_textfuncs_t ));
80 |
81 | return TRUE;
82 | }
83 |
84 | extern "C" EXPORT void AddTouchButtonToList( const char *name, const char *texture, const char *command, unsigned char *color, int flags )
85 | {
86 | UI_TouchButtons_AddButtonToList( name, texture, command, color, flags );
87 | }
88 |
89 |
--------------------------------------------------------------------------------
/mainui/ui_title_anim.h:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thomaseichhorn/cs16-client/faaab9154820e4b0f9ceee8d92d4ca891d9ada8c/mainui/ui_title_anim.h
--------------------------------------------------------------------------------
/pm_shared/pm_debug.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 |
29 | #ifndef PM_DEBUG_H
30 | #define PM_DEBUG_H
31 | #ifdef _WIN32
32 | #pragma once
33 | #endif
34 |
35 | void PM_ShowClipBox();
36 | void PM_ParticleLine(vec3_t start, vec3_t end, int pcolor, float life, float vert);
37 | void PM_DrawRectangle(vec3_t tl, vec3_t bl, vec3_t tr, vec3_t br, int pcolor, float life);
38 | void PM_DrawPhysEntBBox(int num, int pcolor, float life);
39 | void PM_DrawBBox(vec3_t mins, vec3_t maxs, vec3_t origin, int pcolor, float life);
40 | void PM_ViewEntity();
41 |
42 | #endif // PM_DEBUG_H
43 |
--------------------------------------------------------------------------------
/pm_shared/pm_info.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 |
29 | #ifndef PM_INFO_H
30 | #define PM_INFO_H
31 | #ifdef _WIN32
32 | #pragma once
33 | #endif
34 |
35 | #define MAX_PHYSINFO_STRING 256
36 |
37 | #endif // PM_INFO_H
38 |
--------------------------------------------------------------------------------
/pm_shared/pm_materials.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 |
29 | #ifndef PM_MATERIALS_H
30 | #define PM_MATERIALS_H
31 | #ifdef _WIN32
32 | #pragma once
33 | #endif
34 |
35 | #define CTEXTURESMAX 1024 // max number of textures loaded
36 | #define CBTEXTURENAMEMAX 17 // only load first n chars of name
37 |
38 | #define CHAR_TEX_CONCRETE 'C' // texture types
39 | #define CHAR_TEX_METAL 'M'
40 | #define CHAR_TEX_DIRT 'D'
41 | #define CHAR_TEX_VENT 'V'
42 | #define CHAR_TEX_GRATE 'G'
43 | #define CHAR_TEX_TILE 'T'
44 | #define CHAR_TEX_SLOSH 'S'
45 | #define CHAR_TEX_WOOD 'W'
46 | #define CHAR_TEX_COMPUTER 'P'
47 | #define CHAR_TEX_GRASS 'X'
48 | #define CHAR_TEX_GLASS 'Y'
49 | #define CHAR_TEX_FLESH 'F'
50 | #define CHAR_TEX_SNOW 'N'
51 |
52 | #endif // PM_MATERIALS_H
53 |
--------------------------------------------------------------------------------
/pm_shared/pm_math.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 |
29 | #ifndef PM_MATH_H
30 | #define PM_MATH_H
31 | #ifdef _WIN32
32 | #pragma once
33 | #endif
34 |
35 | #define PITCH 0 // up/down
36 | #define YAW 1 // left/right
37 | #define ROLL 2 // fall over
38 |
39 | extern vec3_t vec3_origin;
40 | extern int nanmask;
41 |
42 | #define IS_NAN(x) ((*reinterpret_cast(&(x)) & nanmask) == nanmask)
43 |
44 | float anglemod(float a);
45 | void AngleVectors(const vec_t *angles, vec_t *forward, vec_t *right, vec_t *up);
46 | void AngleVectorsTranspose(const vec_t *angles, vec_t *forward, vec_t *right, vec_t *up);
47 | void AngleMatrix(const vec_t *angles, float (*matrix)[4]);
48 | void AngleIMatrix(const vec_t *angles, float (*matrix)[4]);
49 | void NormalizeAngles(float *angles);
50 | void InterpolateAngles(float *start, float *end, float *output, float frac);
51 | float AngleBetweenVectors(const vec_t *v1, const vec_t *v2);
52 | void VectorTransform(const vec_t *in1, float (*in2)[4], vec_t *out);
53 | int VectorCompare(const vec_t *v1, const vec_t *v2);
54 | void VectorMA(const vec_t *veca, float scale, const vec_t *vecb, vec_t *vecc);
55 |
56 | float _DotProduct(const vec_t *v1, const vec_t *v2);
57 | void _VectorSubtract(vec_t *veca, vec_t *vecb, vec_t *out);
58 | void _VectorAdd(vec_t *veca, vec_t *vecb, vec_t *out);
59 | void _VectorCopy(vec_t *in, vec_t *out);
60 | void _CrossProduct(const vec_t *v1, const vec_t *v2, vec_t *cross);
61 |
62 | float Length(const vec_t *v);
63 | float Distance(const vec_t *v1, const vec_t *v2);
64 | float VectorNormalize(vec_t *v);
65 |
66 | void VectorInverse(vec_t *v);
67 | void VectorScale(const vec_t *in, vec_t scale, vec_t *out);
68 | int Q_log2(int val);
69 | void VectorMatrix(vec_t *forward, vec_t *right, vec_t *up);
70 | void VectorAngles(const vec_t *forward, vec_t *angles);
71 |
72 | #endif // PM_MATH_H
73 |
--------------------------------------------------------------------------------
/pm_shared/pm_movevars.h:
--------------------------------------------------------------------------------
1 | /*
2 | *
3 | * This program is free software; you can redistribute it and/or modify it
4 | * under the terms of the GNU General Public License as published by the
5 | * Free Software Foundation; either version 2 of the License, or (at
6 | * your option) any later version.
7 | *
8 | * This program is distributed in the hope that it will be useful, but
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 | * General Public License for more details.
12 | *
13 | * You should have received a copy of the GNU General Public License
14 | * along with this program; if not, write to the Free Software Foundation,
15 | * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 | *
17 | * In addition, as a special exception, the author gives permission to
18 | * link the code of this program with the Half-Life Game Engine ("HL
19 | * Engine") and Modified Game Libraries ("MODs") developed by Valve,
20 | * L.L.C ("Valve"). You must obey the GNU General Public License in all
21 | * respects for all of the code used other than the HL Engine and MODs
22 | * from Valve. If you modify this file, you may extend this exception
23 | * to your version of the file, but you are not obligated to do so. If
24 | * you do not wish to do so, delete this exception statement from your
25 | * version.
26 | *
27 | */
28 |
29 | #ifndef PM_MOVEVARS_H
30 | #define PM_MOVEVARS_H
31 | #ifdef _WIN32
32 | #pragma once
33 | #endif
34 |
35 | typedef struct movevars_s
36 | {
37 | float gravity; // Gravity for map
38 | float stopspeed; // Deceleration when not moving
39 | float maxspeed; // Max allowed speed
40 | float spectatormaxspeed;
41 | float accelerate; // Acceleration factor
42 | float airaccelerate; // Same for when in open air
43 | float wateraccelerate; // Same for when in water
44 | float friction;
45 | float edgefriction; // Extra friction near dropofs
46 | float waterfriction; // Less in water
47 | float entgravity; // 1.0
48 | float bounce; // Wall bounce value. 1.0
49 | float stepsize; // sv_stepsize;
50 | float maxvelocity; // maximum server velocity.
51 | float zmax; // Max z-buffer range (for GL)
52 | float waveHeight; // Water wave height (for GL)
53 | qboolean footsteps; // Play footstep sounds
54 | char skyName[32]; // Name of the sky map
55 | float rollangle;
56 | float rollspeed;
57 | float skycolor_r; // Sky color
58 | float skycolor_g;
59 | float skycolor_b;
60 | float skyvec_x; // Sky vector
61 | float skyvec_y;
62 | float skyvec_z;
63 |
64 | } movevars_t;
65 |
66 | #endif // PM_MOVEVARS_H
67 |
--------------------------------------------------------------------------------
/projects/client.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "client", "client.vcxproj", "{DC1DD765-CFEB-47DA-A2EA-9F1E20A24272}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x86 = Debug|x86
11 | Release|x86 = Release|x86
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {DC1DD765-CFEB-47DA-A2EA-9F1E20A24272}.Debug|x86.ActiveCfg = Debug|Win32
15 | {DC1DD765-CFEB-47DA-A2EA-9F1E20A24272}.Debug|x86.Build.0 = Debug|Win32
16 | {DC1DD765-CFEB-47DA-A2EA-9F1E20A24272}.Release|x86.ActiveCfg = Release|Win32
17 | {DC1DD765-CFEB-47DA-A2EA-9F1E20A24272}.Release|x86.Build.0 = Release|Win32
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/projects/mainui.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mainui", "mainui.vcxproj", "{90F48F37-D9F8-4F36-B04F-1FC8CC834424}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x86 = Debug|x86
11 | Release|x86 = Release|x86
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {90F48F37-D9F8-4F36-B04F-1FC8CC834424}.Debug|x86.ActiveCfg = Debug|Win32
15 | {90F48F37-D9F8-4F36-B04F-1FC8CC834424}.Debug|x86.Build.0 = Debug|Win32
16 | {90F48F37-D9F8-4F36-B04F-1FC8CC834424}.Release|x86.ActiveCfg = Release|Win32
17 | {90F48F37-D9F8-4F36-B04F-1FC8CC834424}.Release|x86.Build.0 = Release|Win32
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------
/projects/server.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 14
4 | VisualStudioVersion = 14.0.24720.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "server", "server.vcxproj", "{69DDADC0-97F4-419E-86EB-C91781A0D2E0}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|x86 = Debug|x86
11 | Release|x86 = Release|x86
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {69DDADC0-97F4-419E-86EB-C91781A0D2E0}.Debug|x86.ActiveCfg = Debug|Win32
15 | {69DDADC0-97F4-419E-86EB-C91781A0D2E0}.Debug|x86.Build.0 = Debug|Win32
16 | {69DDADC0-97F4-419E-86EB-C91781A0D2E0}.Release|x86.ActiveCfg = Release|Win32
17 | {69DDADC0-97F4-419E-86EB-C91781A0D2E0}.Release|x86.Build.0 = Release|Win32
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | EndGlobal
23 |
--------------------------------------------------------------------------------