Alibek Omarov
6 years ago
15 changed files with 660 additions and 90 deletions
@ -0,0 +1,58 @@ |
|||||||
|
## If you are reporting bugs |
||||||
|
|
||||||
|
1. Check you are using latest version. You can build latest Xash3D FWGS for yourself, look to README.md. |
||||||
|
2. Check open issues is your bug is already reported and closed issues if it reported and fixed. Don't send bug if it's already reported. |
||||||
|
3. Re-run engine with `-dev 2 -log` arguments, reproduce bug and post engine.log which can be found in your working directory. |
||||||
|
3. Describe steps to reproduce bug. |
||||||
|
4. Describe which OS and architecture you are using. |
||||||
|
6. Attach screenshot if it will help clarify the situation. |
||||||
|
|
||||||
|
## If you are contributing code |
||||||
|
|
||||||
|
### Which branch? |
||||||
|
|
||||||
|
* We recommend using `master` branch. |
||||||
|
|
||||||
|
### Third-party libraries |
||||||
|
|
||||||
|
* Philosophy of any Xash Project by Uncle Mike: don't be bloated. We follow it too. |
||||||
|
* There is allowed only these libraries, if there is a REAL reason to use library and library is crossplatform. It's will be nice, if you will leave a possibility to remove new dependency at build-time. |
||||||
|
* Adding new dependencies for Waf Build System is not welcomed. |
||||||
|
|
||||||
|
### Portability level |
||||||
|
|
||||||
|
* Xash3D have it's own crt library. It's recommended to use it. It most cases it's just a wrappers around standart C library. |
||||||
|
* If your feature need platform-specific code, move it to `engine/platform` and try to implement to every supported OS and every supported compiler or at least leave a stubs. |
||||||
|
* You must put it under appopriate macro. It's a rule: Xash3D FWGS must at least compile everywhere. |
||||||
|
|
||||||
|
| OS | Macro | |
||||||
|
| -- | ----- | |
||||||
|
| Linux | `defined(__linux__)` | |
||||||
|
| FreeBSD | `defined(__FreeBSD__)` | |
||||||
|
| NetBSD | `defined(__NetBSD__)` | |
||||||
|
| OpenBSD | `defined(__OpenBSD__)` | |
||||||
|
| OS X/iOS | `defined(__APPLE__)` and TargetConditionals macros | |
||||||
|
| Windows | `defined(_WIN32)` | |
||||||
|
| Android | `defined(__ANDROID__)` | |
||||||
|
| Emscripten | `defined(__EMSCRIPTEN__)` | |
||||||
|
|
||||||
|
### Code style |
||||||
|
|
||||||
|
* This project uses mixed Quake's and HLSDK's C/C++ code style convention. |
||||||
|
* In short: |
||||||
|
* Use spaces in parenthesis. |
||||||
|
* Only tabs for indentation. |
||||||
|
* Any brace must have it's own line. |
||||||
|
* Short blocks, if statements and loops on single line are allowed. |
||||||
|
* Avoid magic numbers. |
||||||
|
* While macros are powerful, it's better to avoid overusing them. |
||||||
|
* If you unsure, try to mimic code style from anywhere else of engine source code. |
||||||
|
* **ANY** commit message should start from declaring a tags, in format: |
||||||
|
|
||||||
|
`tag: added some bugs` |
||||||
|
|
||||||
|
`tag: subtag: fixed some features` |
||||||
|
|
||||||
|
Tags can be any: subsystem, simple feature name or even just a filename, without extension. |
||||||
|
Just keep them always same, it helps keep history clean and commit messages short. |
||||||
|
|
@ -0,0 +1,79 @@ |
|||||||
|
# Xash3D FWGS Engine |
||||||
|
[![Build Status](https://api.travis-ci.org/FWGS/xash3d-fwgs.svg?branch=master)](https://travis-ci.org/FWGS/xash3d-fwgs) [![Discord Server](https://img.shields.io/discord/355697768582610945.svg)](https://discord.gg/TbnHcVb) |
||||||
|
|
||||||
|
Xash3D FWGS is a fork of Xash3D Engine by Unkle Mike with extended features and crossplatform. |
||||||
|
|
||||||
|
``` |
||||||
|
Xash3D is a game engine, aimed to provide compatibility with Half-Life Engine, |
||||||
|
as well as to give game developers well known workflow and extend it. |
||||||
|
Read more about Xash3D on ModDB: https://www.moddb.com/engines/xash3d-engine |
||||||
|
``` |
||||||
|
|
||||||
|
Latest release build: https://github.com/FWGS/xash3d-fwgs/releases/latest |
||||||
|
|
||||||
|
Latest development build: https://github.com/FWGS/xash3d-deploy/tree/newengine-latest |
||||||
|
|
||||||
|
## Fork features |
||||||
|
* HLSDK 2.4 support. |
||||||
|
* Crossplatform: officially supported x86 and ARM on Windows/Linux/BSD/macOS/Android/iOS/Haiku. |
||||||
|
* Modern compilers support: say no more to MSVC6. |
||||||
|
* Better multiplayer support: multiple master servers, headless dedicated server. |
||||||
|
* Mobility API: allows better game integration on mobile devices(vibration, touch controls) |
||||||
|
* Different input methods: touch, gamepad and classic mouse & keyboard. |
||||||
|
* TrueType font rendering, as a part of mainui_cpp. |
||||||
|
* A set of small improvements, without broken compatibility. |
||||||
|
|
||||||
|
## Planned fork features |
||||||
|
* Virtual Reality support and game API(in development!) |
||||||
|
* Voice support |
||||||
|
* Multiple renderers support(OpenGL, GLES, Vulkan, software) |
||||||
|
|
||||||
|
## Contributing |
||||||
|
* Before sending an issue, check if someone already reported your issue. Make sure you're following "How To Ask Questions The Smart Way" guide by Eric Steven Raymond. Read more: http://www.catb.org/~esr/faqs/smart-questions.html |
||||||
|
* Before sending a PR, check if you followed our coding guide in CODING_STYLE.md file. |
||||||
|
|
||||||
|
## Build instructions |
||||||
|
We are using Waf build system. If you have some Waf-related questions, I recommend you to read https://waf.io/book/ |
||||||
|
|
||||||
|
If you're stuck somewhere and you need a clear example, read `.travis.yml` and `scripts/build*.sh`. |
||||||
|
|
||||||
|
### Prerequisites |
||||||
|
#### Windows(Visual Studio) |
||||||
|
* Install Visual Studio. |
||||||
|
* Install latest [Python](https://python.org) **OR** run `cinst python.install` if you have Chocolatey. |
||||||
|
* Install latest [Git](https://git-scm.com/download/win) **OR** run `cinst git.install` if you have Chocolatey. |
||||||
|
* Download [SDL2](https://libsdl.org/download-2.0.php) development package for Visual Studio. |
||||||
|
* Clone this repository: `git clone --recursive https://github.com/FWGS/xash3d-fwgs`. |
||||||
|
* Clone `vgui-dev` repository: `git clone https://github.com/FWGS/vgui-dev`. |
||||||
|
* Make sure you have at least 12GB of free space to store all build-time dependencies: ~10GB for Visual Studio, 300 MB for Git, 100 MB for Python and other. |
||||||
|
|
||||||
|
#### Linux |
||||||
|
NOTE: Make sure you're OK with targetting 32-bit. |
||||||
|
|
||||||
|
Even if Xash3D FWGS does support targetting 64-bit, you can't load games without recompiling them from source code! |
||||||
|
|
||||||
|
* **Gentoo**: TODO |
||||||
|
* **Debian**: TODO |
||||||
|
* **ArchLinux**: `<AUR Helper> -S xash3d-git` |
||||||
|
|
||||||
|
### Building |
||||||
|
#### Windows(Visual Studio) |
||||||
|
0) Open command line |
||||||
|
1) Navigate to `xash3d-fwgs` directory. |
||||||
|
2) Carefully examine which build options are available: `waf --help` |
||||||
|
3) Configure build: `waf configure --build-type=release --sdl2=c:/path/to/SDL2 --vgui=c:/path/to/vgui-dev --prefix=c:/path/to/any/output/directory` |
||||||
|
4) Compile: `waf build` |
||||||
|
5) Install: `waf install` |
||||||
|
|
||||||
|
#### Linux |
||||||
|
0) Examine which build options are available: `./waf --help` |
||||||
|
1) Configure build: `./waf configure --build-type=release --vgui=vgui-dev` |
||||||
|
2) Compile: `./waf build` |
||||||
|
3) Install(optional): `./waf install` |
||||||
|
|
||||||
|
## Running |
||||||
|
0) Copy libraries and main executable somewhere, if you're skipped installation stage. |
||||||
|
1) Copy game files to same directory |
||||||
|
2) Run `xash3d.exe`/`xash3d.sh`/`xash3d` depending on which platform you're using. |
||||||
|
|
||||||
|
For additional info, run Xash3D with `-help` command line key. |
@ -0,0 +1,95 @@ |
|||||||
|
/***
|
||||||
|
* |
||||||
|
* Copyright (c) 1996-2002, Valve LLC. All rights reserved. |
||||||
|
* |
||||||
|
* This product contains software technology licensed from Id |
||||||
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc. |
||||||
|
* All Rights Reserved. |
||||||
|
* |
||||||
|
* Use, distribution, and modification of this source code and/or resulting |
||||||
|
* object code is restricted to non-commercial enhancements to products from |
||||||
|
* Valve LLC. All other use, distribution, or modification is prohibited |
||||||
|
* without written permission from Valve LLC. |
||||||
|
* |
||||||
|
****/ |
||||||
|
// mathlib.h
|
||||||
|
|
||||||
|
#include <math.h> |
||||||
|
|
||||||
|
typedef float vec_t; |
||||||
|
typedef vec_t vec2_t[2]; |
||||||
|
typedef vec_t vec3_t[3]; |
||||||
|
typedef vec_t vec4_t[4]; // x,y,z,w
|
||||||
|
|
||||||
|
#ifndef M_PI |
||||||
|
#define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h
|
||||||
|
#endif |
||||||
|
|
||||||
|
struct mplane_s; |
||||||
|
|
||||||
|
extern vec3_t vec3_origin; |
||||||
|
extern int nanmask; |
||||||
|
|
||||||
|
#define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) |
||||||
|
|
||||||
|
#ifndef VECTOR_H |
||||||
|
#define DotProduct(x,y) ((x)[0]*(y)[0]+(x)[1]*(y)[1]+(x)[2]*(y)[2]) |
||||||
|
#endif |
||||||
|
|
||||||
|
#define VectorSubtract(a,b,c) {(c)[0]=(a)[0]-(b)[0];(c)[1]=(a)[1]-(b)[1];(c)[2]=(a)[2]-(b)[2];} |
||||||
|
#define VectorAdd(a,b,c) {(c)[0]=(a)[0]+(b)[0];(c)[1]=(a)[1]+(b)[1];(c)[2]=(a)[2]+(b)[2];} |
||||||
|
#define VectorCopy(a,b) {(b)[0]=(a)[0];(b)[1]=(a)[1];(b)[2]=(a)[2];} |
||||||
|
#define VectorClear(a) {(a)[0]=0.0;(a)[1]=0.0;(a)[2]=0.0;} |
||||||
|
|
||||||
|
void VectorMA (const vec3_t veca, float scale, const vec3_t vecb, vec3_t vecc); |
||||||
|
|
||||||
|
vec_t _DotProduct (vec3_t v1, vec3_t v2); |
||||||
|
void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out); |
||||||
|
void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out); |
||||||
|
void _VectorCopy (vec3_t in, vec3_t out); |
||||||
|
|
||||||
|
int VectorCompare (const vec3_t v1, const vec3_t v2); |
||||||
|
float Length (const vec3_t v); |
||||||
|
void CrossProduct (const vec3_t v1, const vec3_t v2, vec3_t cross); |
||||||
|
float VectorNormalize (vec3_t v); // returns vector length
|
||||||
|
void VectorInverse (vec3_t v); |
||||||
|
void VectorScale (const vec3_t in, vec_t scale, vec3_t out); |
||||||
|
|
||||||
|
void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]); |
||||||
|
void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]); |
||||||
|
|
||||||
|
void AngleVectors (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); |
||||||
|
void AngleVectorsTranspose (const vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); |
||||||
|
#define AngleIVectors AngleVectorsTranspose |
||||||
|
|
||||||
|
void AngleMatrix (const vec3_t angles, float (*matrix)[4] ); |
||||||
|
void AngleIMatrix (const vec3_t angles, float (*matrix)[4] ); |
||||||
|
void VectorTransform (const vec3_t in1, float in2[3][4], vec3_t out); |
||||||
|
|
||||||
|
void NormalizeAngles( vec3_t angles ); |
||||||
|
void InterpolateAngles( vec3_t start, vec3_t end, vec3_t output, float frac ); |
||||||
|
float AngleBetweenVectors( const vec3_t v1, const vec3_t v2 ); |
||||||
|
|
||||||
|
void VectorMatrix( vec3_t forward, vec3_t right, vec3_t up); |
||||||
|
void VectorAngles( const vec3_t forward, vec3_t angles ); |
||||||
|
|
||||||
|
int InvertMatrix( const float * m, float *out ); |
||||||
|
|
||||||
|
int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct mplane_s *plane); |
||||||
|
float anglemod(float a); |
||||||
|
|
||||||
|
#define BOX_ON_PLANE_SIDE(emins, emaxs, p) \ |
||||||
|
(((p)->type < 3)? \ |
||||||
|
( \ |
||||||
|
((p)->dist <= (emins)[(p)->type])? \ |
||||||
|
1 \ |
||||||
|
: \ |
||||||
|
( \ |
||||||
|
((p)->dist >= (emaxs)[(p)->type])?\ |
||||||
|
2 \ |
||||||
|
: \ |
||||||
|
3 \ |
||||||
|
) \ |
||||||
|
) \ |
||||||
|
: \ |
||||||
|
BoxOnPlaneSide( (emins), (emaxs), (p))) |
@ -1 +1 @@ |
|||||||
Subproject commit 33e6e585e875d91ae44b22d5425f1c38f2413741 |
Subproject commit 9acf8b75d9d167ac63efd6db8f35c42a2d325082 |
Loading…
Reference in new issue