Commit graph

59 commits

Author SHA1 Message Date
Andrei Alexeyev
8d2ee76710
replace include guards with #pragma once 2021-08-31 23:34:46 +03:00
Andrei Alexeyev
1ae8811bc4
lasers: improve collision; move to lasers/
Moved quantization out of the draw code. The laser is now quantized once
per frame, and the segment data is used for both collisions and
rendering. Player motion is now accounted for as well, preventing
phasing through thin lasers. The overall result is more precise *and*
faster collision detection.
2021-08-25 11:58:08 +03:00
Andrei Alexeyev
4d1b4eb72a
lasers: new renderer based on signed distance fields (#317)
* lasers: new SDF-based renderer (WIP)

* lasers: tweak sdf_apply shader

* lasers: fix incorrect rendering at 'unlucky' resolutions

* lasers: optimize rendering of multiple lasers

Try to coalesce render passes as much as possible

* lasers: fix warning

* lasers: move rendering into a new file

* lasers: correct "time" coordinate mapping for texturing

* lasers: wrote a novel about laser rendering [skip ci]

* lasers: fux tpyo

* remove references to old laser shape shaders

* lasers: fix some rendering edge cases
2021-08-22 01:27:12 +03:00
Andrei Alexeyev
e16e2184a3
Refactor entity system (#214)
* Smarter generic entity macros

The list of "core" entities is now defined in one macro, and hardcoded
_Generic dispatch tables are eliminated

* Get rid of "custom" entities

All entities are now "first-class". The list of known entity types has
been moved to known_entities.h. The system no longer needs to know the
definition of all entity structs.

* Refactor guts of ENT_BOX/ENT_UNBOX

Made the functions inline, Box::ent is now a proper pointer type (but
please don't use it directly), ENT_UNBOX returns NULL if the box is
"empty" (references NULL entity)

* Merge TASK_BIND_UNBOXED with TASK_BIND

* s/YoumuMyon/YoumuAMyon for consistency
2020-04-17 10:18:53 +03:00
Andrei Alexeyev
b49e518a27
Various laser changes
* More lenient collision detection
* More rounded corners
* Add a task for laser charging (not used yet)
* Make snow halation lasers not use the logic rule
  - Logic rules to be removed in favor of tasks
2020-03-04 22:26:53 +02:00
Andrei Alexeyev
80b1026d08
Don't redefine standard complex macro; use a new cmplx typedef
This also introduces `float32`, `float64`, and `real` typedefs to be
used in place of `float` and `double` later. `real` is for game code and
other places where we don't particularly care about the precision and
format of the underlying type, and is currently defined to `double`.
`float32` and `float64` should replace `float` and `double` respectively
2019-11-22 05:38:48 +02:00
Andrei Alexeyev
5a23fb95fc
make upkeep script preserve existing copyrights 2019-08-03 20:44:22 +03:00
Andrei Alexeyev
3055901998
update my email 2019-07-03 21:00:56 +03:00
Andrei Alexeyev
8e227e353a
don't clear lasers that haven't been activated yet 2019-03-27 10:39:41 +02:00
Andrei Alexeyev
dc88572167
YoumuB bomb tweaks, some laser fixups 2019-03-26 17:58:38 +02:00
Andrei Alexeyev
8fc5abb78a
The Powersurge game mechanic and scoring system (#159) 2019-02-22 01:56:03 +02:00
Andrei Alexeyev
4159ea1249
'upkeep' target for maintenance tasks; back to include guards; happy new year! 2019-01-23 22:10:43 +02:00
Andrei Alexeyev
d4650d4b92
Allow projectile rules to delete other projectiles; add stage_clear_hazards enhancements 2018-08-05 20:58:50 +03:00
Andrei Alexeyev
8490576810
Premultiplied alpha (#133)
* WIP premultiplied alpha

* WIP color API rework (doesn't build yet; lots of things left to convert)

* convert everything remaining to new Color api except stage*_event.c files

* convert the stages to new Color api. builds & runs now; still many rendering errors

* fix the bullet shader for premultiplied alpha

* fix masterspark, graphs and stage 1 fog clouds

* fix marisa_b and most of spellcards

* Add deprecation warnings for BLEND_ADD and PFLAG_DRAWADD

* fix a segfault in stage 6

undo accidental earlier change

* fix text_hud.frag.glsl

* fix scuttle bg and remaining stage3 BLEND_ADDs

* fix marisa laser opacity

* hacky fix for myon

The old implementation relied on alpha being stored inside p->color. In
premul alpha this doesn’t work and functions like color_set_opacity
can’t solve this i think.

So I tried messing around with it until it looked somewhat similar.

* fix marisa_b stars

* remove color_set_opacity i overlooked

* more plrmode blending changes

* fixup additive blending in stage 1

* various premultiplied alpha fixups for bosses and enemies

* stage 2 premul alpha fixups

* stage 4 premul alpha fixups

* stage 5 premul alpha fixups

* stage 6 premul alpha fixups

* make lasers also use the PMA blend mode

* remove PFLAG_DRAWADD and PFLAG_DRAWSUB

* fix remaining PMA issues in menus

* lame extraspell bg workaround

* fix item alpha

* make marisaA lasers look somewhat like in master

* fix marisaA bomb background fadeout

* fixup various r_color4 calls

* fix myon

* remove dead code

* fix use of BLEND_ADD in player death effect

* fix myon shot trails (broken on master as well)

* fix myon shot fade-in

* extend the sprite shaders custom parameter to a vec4

* fix youmuB stuff and make it look somewhat better.

the code looks even worse though.
2018-07-23 20:07:59 +03:00
Andrei Alexeyev
83a8961df6
use "anchored" lists for most game objects
these have a pointer to the last element, thus appending is fast
2018-06-01 21:40:18 +03:00
Andrei Alexeyev
ef37b22d6d
Improve (totally rewrite) projectile collision detection and graze mechanics (#122)
* improve (totally rewrite) projectile collision detection and graze mechanics

* fix lineseg_circle_intersect as per lao's suggestion

* adjust hit"boxes"

* fix false hits on inductive resonanse (bad lerp)

* initialize projectile prevpos on spawn

* pp_basic_init_projectile: always override the projectile's sprite when setting the prototype
2018-05-13 16:08:58 +03:00
Andrei Alexeyev
8ef5ffd32c
Flexible draw order; entity "base class" for all game objects 2018-04-15 09:43:11 +03:00
Andrei Alexeyev
59cf8f6300
Rendering system rewrite, tons of refactoring, optimizations, and other cool stuff (#116) 2018-04-12 17:08:48 +03:00
Andrei Alexeyev
032a3852d7
fix my clearhazards fuckups 2018-01-06 20:23:38 +02:00
Andrei Alexeyev
fc8cda89d7
improve stage_clear_hazards api, add particle effect for cleared bullets 2018-01-06 11:24:46 +02:00
Andrei Alexeyev
485c9a8ed6
Happy New Year! 2018-01-04 19:14:31 +02:00
Andrei Alexeyev
de31a20497
objectpool: dynamic extents and other improvements 2017-12-24 05:00:19 +02:00
Andrei Alexeyev
29acd5f58a meson: intel intrinsics, various improvements 2017-12-21 03:58:54 +01:00
Andrei Alexeyev
2290d9c2ea
WIP de Broglie tweaks 2017-10-22 05:52:37 +03:00
Andrei Alexeyev
c5717cca5e
wave-particle duality changes
whatever, ship it
2017-10-20 21:53:21 +03:00
makise-homura
2b35177cb4 Removed excess and added missing newlines at end of files 2017-10-10 21:10:35 +03:00
laochailan
03a2426012
update to use #pragma once 2017-09-27 14:14:53 +02:00
laochailan
6bd74a4139 REMEMBER to never make macros duplicate random arguments 2017-09-24 16:45:49 +02:00
Andrei "Akari" Alexeyev
7c9e54a71d
update copyright and credits 2017-09-12 04:28:15 +03:00
Andrei "Akari" Alexeyev
ae4eb3746f
ricci changes, with basic diff. balancing 2017-09-11 06:44:16 +03:00
Andrei "Akari" Alexeyev
528323a92d WIP phosphaenus hemipterus redesign 2017-04-14 07:00:11 +03:00
Andrei "Akari" Alexeyev
784b04ea37 experimental laser clearing animation/mechanic, similar to how bullets die 2017-04-06 01:46:00 +03:00
Andrei "Akari" Alexeyev
86930cfdc0 Merge branch 'master' into extraspells 2017-03-11 03:49:09 +02:00
Andrei "Akari" Alexeyev
dacbf96427 moved util functions from global to where they make a bit more sense 2017-03-06 03:24:47 +02:00
Andrei "Akari" Alexeyev
24dd1c8c39 Merge branch 'master' into extraspells 2017-03-03 19:45:20 +02:00
Andrei "Akari" Alexeyev
41fa6d9d76 malloc-less colors 2017-03-03 19:31:04 +02:00
Andrei "Akari" Alexeyev
99419d44ac WIP extraspell for Iku
Review and tweaking needed. Does not support difficulties yet.
2017-02-25 00:08:23 +02:00
Andrei "Akari" Alexeyev
9a7a874783 Use the standard bool type instead of that stupid enum
Also removed all of the annoying trailing tabs/whitespaces
2017-02-11 05:56:47 +02:00
Andrei "Akari" Alexeyev
8566c65f4b Fixed clang warnings 2017-02-07 20:34:55 +02:00
Andrew "Akari" Alexeyew
779ff58684 Fixed all the () prototypes, changed to (void) 2012-08-10 23:08:51 +03:00
Andrew "Akari" Alexeyew
389cf17827 Merge remote-tracking branch 'upstream/stage5' into stage3
Conflicts:
	src/laser.c
	src/laser.h
2012-07-27 21:55:34 +03:00
laochailan
92a31df838 Merge branch 'new-laser' into stage5 2012-07-26 18:18:17 +02:00
laochailan
76b039d767 cleaned create_laserline 2012-07-26 18:17:56 +02:00
laochailan
b85cbc457f Merge branch 'master' into stage5 2012-07-26 18:15:49 +02:00
laochailan
017dfbd812 fixed behavior of static lasers 2012-07-26 18:14:33 +02:00
laochailan
01dba81673 Merge branch 'master' into stage5
Conflicts:
	src/laser.c
	src/laser.h
	src/stages/stage4_events.c
2012-07-26 17:06:38 +02:00
laochailan
f2c630a163 fixed directional laser creation 2012-07-26 10:53:46 +02:00
laochailan
0d469632fa Merged line lasers and curve lasers 2012-07-26 10:14:59 +02:00
Andrew "Akari" Alexeyew
f9af71799d another test 2012-07-24 15:47:52 +03:00
Andrew "Akari" Alexeyew
c7bfb874c1 TEST: sine pattern for mah lazorz 2012-07-24 15:38:35 +03:00