1
0
forked from 0ad/0ad
Commit Graph

58 Commits

Author SHA1 Message Date
3fff9df4a0 Return CTerrain and CUnitManager references from CWorld instead of pointers
Accepted By: @vladislavbelov
Comments By: @Stan
Differential Revision: https://code.wildfiregames.com/D4739
This was SVN commit r27861.
2023-09-26 20:10:40 +00:00
bb
157c6af18e Make the space in 0 A.D. non-breaking throughout the codebase.
Avoid cases of filenames
Update years in terms and other legal(ish) documents
Don't update years in license headers, since change is not meaningful

Will add linter rule in seperate commit

Happy recompiling everyone!

Original Patch By: Nescio
Comment By: Gallaecio
Differential Revision: D2620
This was SVN commit r27786.
2023-07-27 20:54:46 +00:00
249f7cad55 Fixes cinematic camera distortion on some angles.
Differential Revision: https://code.wildfiregames.com/D4567
This was SVN commit r26690.
2022-03-20 21:59:49 +00:00
87b5c233c5 Splits CRenderer part about scene to CSceneRenderer.
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D4412
This was SVN commit r26165.
2022-01-04 13:29:01 +00:00
4fba543488 Unifies providing SkyManager and WaterManager like other managers, refs b889826a3d.
This was SVN commit r26158.
2022-01-03 10:49:12 +00:00
9696df3c28 Removes unused ogl/ogl_tex includes.
This was SVN commit r26121.
2021-12-27 10:11:26 +00:00
6b493aa52c Fixes big screenshots, implements CCamera::GetViewQuad properly for custom projections.
Differential Revision: https://code.wildfiregames.com/D4165
This was SVN commit r25794.
2021-06-13 17:42:37 +00:00
44f8d2c6f5 Fixes a bounding box projection to an incorrect camera causes the red water bug.
Tested By: Langbart
Differential Revision: https://code.wildfiregames.com/D3905
This was SVN commit r25440.
2021-05-15 13:33:36 +00:00
2fcab79e15 Moves terrain independent code for viewport bounds calculations to camera.
This was SVN commit r25355.
2021-05-01 16:59:42 +00:00
924c6ce34e Rework 7ee94f23df
Following comments by @vladislavbelov.

Differential Revision: https://code.wildfiregames.com/D3860
This was SVN commit r25278.
2021-04-16 16:01:30 +00:00
389a5a4379 Removes low-level GL calls from graphics and geometrics primitives and adds DebugRenderer.
Tested By: Freagarach
Differential Revision: https://code.wildfiregames.com/D3857
This was SVN commit r25269.
2021-04-15 18:07:01 +00:00
7ee94f23df Use type_identity to simplify Clamp usage.
Differential Revision: https://code.wildfiregames.com/D3859
This was SVN commit r25266.
2021-04-15 13:01:24 +00:00
4f83f1a0e9 Cleanups Frustum and removes access to members.
This was SVN commit r25158.
2021-03-29 17:15:29 +00:00
c4d5729c73 Adds basic tests for BuildCameraRay and uses viewport instead of renderer for width and height.
This was SVN commit r25085.
2021-03-19 17:39:34 +00:00
92f94e25c6 Adds ortho projection type and its test.
This was SVN commit r25073.
2021-03-17 23:03:35 +00:00
75d9c6293b Adds projection type to CCamera to control usages of projection dependent properties.
Commented By: elexis
Differential Revision: https://code.wildfiregames.com/D2351
This was SVN commit r23036.
2019-10-03 18:51:40 +00:00
050f1dc8df Removes usages of duplication of Clamp function in graphics. Refs D1763.
This was SVN commit r22925.
2019-09-18 08:34:36 +00:00
659bf68cc7 Cleanup Camera and CGameView, removes a not needed method and refactors classes.
Commented By: Stan
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D2195
This was SVN commit r22755.
2019-08-22 20:49:58 +00:00
50f70b7be3 Refactors Camera aspect ratio and calculation of plane points.
Reviewed By: elexis
Commented By: wraitii
Differential Revision: https://code.wildfiregames.com/D2020
This was SVN commit r22547.
2019-07-24 23:08:02 +00:00
8babfe2330 Refactors camera projections - makes projection functions of camera more clear.
Reviewed By: elexis
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D2012
This was SVN commit r22404.
2019-06-26 22:54:05 +00:00
276050bcad Cleanup Camera code for projections.
Reviewd By: wraitii
Tested By: Stan
Differential Revision: https://code.wildfiregames.com/D1514
This was SVN commit r22033.
2019-01-05 22:40:56 +00:00
38d09ce35c Adds a perspective matrix, refracts a matrix projection setup to prepare for an isometric view.
Reviewed By: wraitii
Differential Revision: https://code.wildfiregames.com/D971
This was SVN commit r20377.
2017-10-29 23:41:59 +00:00
25b1837603 Pass CVector3D as const reference in a few places.
Reviewed By: Sandarac
Differential Revision: https://code.wildfiregames.com/D424
This was SVN commit r19534.
2017-05-08 04:04:45 +00:00
b1b96a89d6 Fix culling for shadows and reflections.
Previously we had a single culling frustum based on the main camera, and
any object outside the frustum would never get rendered, even if it
should actually contribute to shadows or reflections/refractions. This
caused ugly pop-in effects in the shadows and reflections while
scrolling.

Extend the renderer to support multiple cull groups, each with a
separate frustum and with separate lists of submitted objects, so that
shadows and reflections will render the correctly culled sets of
objects.

Update the shadow map generation to compute the (hopefully) correct
bounds and matrices for this new scheme.

Include terrain patches in the shadow bounds, so hills can cast shadows
correctly.

Remove the code that tried to render objects slightly outside the camera
frustum in order to reduce the pop-in effect, since that was a
workaround for the lack of a proper fix.

Remove the model/patch filtering code, which was used to cull objects
that were in the normal camera frustum but should be excluded from
reflections/refractions, since that's redundant now too.

Inline DistanceToPlane to save a few hundred usecs per frame inside
CCmpUnitRenderer::RenderSubmit.

Fixes #504, #579.

This was SVN commit r15445.
2014-06-25 01:11:10 +00:00
fe3315376c Add BoundingSphere, SOverlaySphere.
BoundingSphere is similar to a bounding box, but more spherical.

SOverlaySphere is useful for visualising BoundingSphere (it's quite
inefficient and should only be used for debug functionality).

Normalise the camera frustum clipping planes, so that IsSphereVisible
gives the correct result.

This was SVN commit r15261.
2014-06-01 18:05:46 +00:00
b7888aea52 Add support for specular materials.
Let materials specify shader uniform values.
Use interned strings for shader uniform/attribute names.
Remove confusing float* cast operator on CVector4D.
Simplify and clean up CVector4D.
Remove non-supported 'old' lighting model.

This was SVN commit r11453.
2012-04-08 15:55:06 +00:00
4bf59b9a7d More GLES compatibility, mainly around terrain rendering.
This was SVN commit r11059.
2012-02-13 14:02:14 +00:00
ce67dfd333 Rename CELL_SIZE to TERRAIN_TILE_SIZE, to free up the term "cell" for other concepts.
This was SVN commit r10902.
2012-01-12 12:51:10 +00:00
vts
85186c98b2 Better selection boxes. Closes #914, #295, #810.
This was SVN commit r10593.
2011-11-25 06:36:13 +00:00
31bcb5c803 Fixes buggy selection behavior due to incorrect camera plane calculation.
This was SVN commit r10558.
2011-11-19 05:05:59 +00:00
2726f6ed88 Changes GetFocus to return points above water.
Fixes camera following of boats.

This was SVN commit r9988.
2011-08-10 22:45:55 +00:00
b08e142193 Graphics optimisations and features from eihrul.
Add shadow filtering (PCF) option.
Fix ugly shadow saturation in old lighting mode.
Fix fancy water shader.
Fix camera matrix computation.
Support scissoring of camera frustum.
Optimise vertex skinning.
Inline various matrix functions.
Support filtering of the list of submitted models before a rendering
pass, for more precise culling.
Optimise water renderer (fixes #721, based on patch by ortalo).
Use scissoring when generating reflection/refraction textures.
Skip reflection/refraction texture generation when no water is visible.
Render alpha-blended objects differently (fixes #434).
Reduce shadow swimming effects.

This was SVN commit r9814.
2011-07-12 23:48:05 +00:00
012c47057a Optimise some matrix operations, based on patch from ortalo.
Fixes #750.

This was SVN commit r9141.
2011-04-01 18:33:47 +00:00
63bd39d4a5 Fix perspective calculation in CCamera::GetScreenCoordinates.
Fixes #99.

This was SVN commit r8870.
2011-01-28 21:51:59 +00:00
6c7b82130c # Redesigned the camera control system.
Add shift+wheel (and Q/E, and ctrl+arrows, and ctrl+WASD) to rotate the
camera.
Restrict the rotation and zoom to narrow ranges. (Constraints can be
disabled in the dev overlay).
Smooth the movement and rotation.
Fix some stupid whitespace.
Fix some const correctness.

This was SVN commit r7930.
2010-08-13 13:26:29 +00:00
8286218cad Delete lots of obsolete unused script-interface code.
Delete unused code from various other places.

This was SVN commit r7839.
2010-08-01 20:56:34 +00:00
96a73bb580 Discourage units from walking outside the map.
Improve pathfinder performance by avoiding unnecessary grid
recalculations.

This was SVN commit r7806.
2010-07-25 14:11:21 +00:00
0f611042b1 # Support alt+enter to toggle fullscreen mode. Make game window resizable.
Refactor the video mode setting logic to cope better with dynamic
changes.

This was SVN commit r7606.
2010-06-03 19:07:59 +00:00
1743645fd3 Simplify the overly-complex CppDoc-breaking file headers
This was SVN commit r6832.
2009-04-18 17:51:05 +00:00
c9fa7f13d9 Add GPL header
This was SVN commit r6830.
2009-04-18 17:00:33 +00:00
c0ed950657 had to remove uint and ulong from lib/types.h due to conflict with other library.
this snowballed into a massive search+destroy of the hodgepodge of
mostly equivalent types we had in use (int, uint, unsigned, unsigned
int, i32, u32, ulong, uintN).

it is more efficient to use 64-bit types in 64-bit mode, so the
preferred default is size_t (for anything remotely resembling a size or
index). tile coordinates are ssize_t to allow more efficient conversion
to/from floating point. flags are int because we almost never need more
than 15 distinct bits, bit test/set is not slower and int is fastest to
type. finally, some data that is pretty much directly passed to OpenGL
is now typed accordingly.

after several hours, the code now requires fewer casts and less
guesswork.

other changes:
- unit and player IDs now have an "invalid id" constant in the
respective class to avoid casting and -1
- fix some endian/64-bit bugs in the map (un)packing. added a
convenience function to write/read a size_t.
- ia32: change CPUID interface to allow passing in ecx (required for
cache topology detection, which I need at work). remove some unneeded
functions from asm, replace with intrinsics where possible.

This was SVN commit r5942.
2008-05-11 18:48:32 +00:00
b755ddefda remove all author/modified by tags.
make include guards consistent.

This was SVN commit r5040.
2007-05-07 16:33:24 +00:00
aa6ca7d1e8 Modified world intersection so that you can also intersect with the water plane, which is useful for making ships move around as expected when you rightclick a spot on the water.
This was SVN commit r4319.
2006-09-10 20:38:39 +00:00
5f7855f7f0 Simplification of #Include paths: relative names are used only for included files in the same directory as the including file; everything else uses the full path relative to source/.
This was SVN commit r3930.
2006-06-02 02:10:27 +00:00
03a08e00a5 # Fixed infinite loop.
Also fixed sectorDivs so it's always initialised, since the complaints
were annoying.
Camera: Added a const.
Super cavalry: Added required(?) aura attributes.

This was SVN commit r3906.
2006-05-29 03:28:54 +00:00
3d26549032 Fixed file properties - removed svn:executable and svn:keywords (left over from CVS conversion?) from all files; set svn:eol-style=native for *.cpp, *.h (and fixed files with inconsistent line endings)
This was SVN commit r3802.
2006-04-23 23:14:18 +00:00
f45c44ca09 Rotated various things (terrain texture UVs, default light and camera angles) by 45 degrees.
Map XML: Store camera position. Stopped using DTDs (because they make it
too hard to change the XML structure without breaking all the old XML
files).
Game.h: Include fewer files, to make compilation sometimes faster.
World: Changed some things to not be singletons, since they were
(ab)used as CWorld members.

This was SVN commit r3670.
2006-03-21 20:55:45 +00:00
f25de48559 - Seperate ViewCamera (eye position) and CullCamera (model culling, shadow
calculations) internally. Use ?gameView.lockCullCamera = true in the
console
  to move around while the CullCamera stays in place
- add CCamera::Render to visualize a camera's frustum
- use ?renderer.debugFrustum = true in the console to visualize the
frustum
  of the CullCamera

This was SVN commit r3405.
2006-01-22 19:12:30 +00:00
547293ee49 Atlas: Vaguely usable object placement code. Bug fixes.
This was SVN commit r3186.
2005-12-02 21:08:10 +00:00
52a8793450 Atlas: Bits of tool-related code.
Game: Large screenshots (with ctrl+alt+F2).

This was SVN commit r2994.
2005-10-24 01:53:03 +00:00