Commit graph

219 commits

Author SHA1 Message Date
Andrei Alexeyev
e4f49310ff
Fix textures being internally Y-flipped (#142)
* WIP: upload textures with the bottom-left-origin convention, as OpenGL expects

* unflip: fix spellcard_walloftext, text_hud

* unflip: fix reimu's and marisa's bombs

* unflip: fix stagetext

* unflip: fix graph.frag.glsl

* fix sprite_circleclipped_indicator
2018-08-28 11:25:54 +03:00
Andrei Alexeyev
4e9ec77c91
My take on the Marisa bombs. Also blur shaders, minor fixes, etc. 2018-08-27 10:08:14 +03:00
Andrei Alexeyev
56f066ca3e
Add optional FXAA for the 3D views; fix nasty rendering bug 2018-08-17 01:32:58 +03:00
Andrei Alexeyev
3615b95f13
Add Reimu Hakurei as a playable character (#106)
* Reimu (#101)

* add the reimu

* Add Reimu story

* account for various blunders

* add reimu dialog picture

* Reimu: WIP yin-yang orbs

* reimu: fix up indents

* Reimu: swap the shotmode names to match the kanji order in her Japanese name

* Reimu: compatibility with the latest system

* WIP ReimuA crap

* ReimuA homing trails

* more ReimuA stuff

* more ReimuA adjustments + enhanced DPS stats

* Reimu: stubs for new player animation sequences

* Reimu: occupy the 0th character slot

* Reimu: tweak needle sprite

* Reimu: buff movement speed to better match Touhou

* Reimu: fixup for the recent projectile changes

* ReimuA: make homing shots a bit smaller; give them custom effect on collision

* Reimu: add intermediate frames; move some loose sprites to the atlas

* Reimu: fix compile errors

* replace DBL_MAX by INFINITY

* Don’t draw reimu orbs twice

fixes #127

* add new reimu dialog pic

* ReimuA adjustments (mostly homing); it's still OP

* wip ReimuB gaps

* still not sure where i'm going with these gaps

* meh

* Reimu: premultiplied alpha fixups after rebase

* reimuB shot pattern with basic power scaling (not balanced at all)

* reimuB: some lame-ass particle effects

* ReimuB bomb effect prototype

* reimuA bomb prototype

* fix reimu shots for the new damage system

* Reimu: use the new player_is_bomb_active() function, add placeholder BG for ReimuB

* some reimuB bomb projectiles

* ReimuB bomb bg and some framebuffer utils required to support it.

Might reuse this at least in part for ReimuA unless we come up with
something better.

* hack to fix ReimuB bomb fade; refactoring needed

* reimuA damaging bombs

* fix ub

* prevent nan when reimuA bombs without enemies present

* add a bomb_bg to reimuA

* ...

* various fantasy seal tweaks

* Reimu: placeholder bomb sounds; slight fantasy seal buff

* fix null pointer dereference

* Reimu "balance" adjustments; minor fixes

* putting bandaids over gunshot wounds

* Add aoe damage and bullet cancel to ReimuB's bomb

* more exorcism porn

* make reimu bomb bg runes better visible on dark backgrounds

* More ReimuA shot changes
2018-08-11 22:13:48 +03:00
Andrei Alexeyev
a562ccb87f
fix ubsan bitching about the obj loader 2018-08-01 21:09:18 +03:00
Andrei Alexeyev
b9262d80ab
fix various issues discovered by scan-build 2018-07-31 11:50:04 +03:00
Andrei Alexeyev
be65fcda51
remove some defunct hacks 2018-07-28 14:02:48 +03:00
Andrei Alexeyev
7ebd1acbd2
NOMINMAX is a thing that exists 2018-07-28 13:53:12 +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
c57d1130aa
support mipmaps and anisotropy (not used until we have premultiplied alpha) 2018-07-11 14:55:08 +03:00
Andrei Alexeyev
083e9c950f
refuse to compile with -ffast-math 2018-07-04 11:55:33 +03:00
Andrei Alexeyev
3aaa621ee6
enforce proper use of clamp() 2018-07-04 11:48:42 +03:00
Andrei Alexeyev
b16f402040
Refactor framebuffer-related stuff (#130)
* Renderer: rename render targets to framebuffers

* Refactor framebuffer pair helper and some of the video API

* Remove hardcoded dimensions from draw_framebuffer_tex

* Make viewport a per-framebuffer property rather than a global one

* Handle config updates via the events system. React to viewport fg/bg quality change requests.
2018-07-04 11:36:16 +03:00
Andrei Alexeyev
ccf6c02f57
what the actual fuck? 2018-06-30 01:40:41 +03:00
Andrei Alexeyev
208360d944
fight with broken headers 2018-06-30 01:21:02 +03:00
Andrei Alexeyev
322edd0dce
Text rendering rewrite and optimizations; some refactoring (#129)
* wip font rendering stuff; hashtable monstrosity is temporary

* various text rendering fixes/improvements

* HashTables™ 3.0

* Add some comments to aid navigating the hashtable macro maze

* overhaul text rendering API; add default and example shaders

* text: implement text_render for spellcard effect; misc fixes

* README: update dependencies

Bye SDL_ttf, hello freetype2.

* text_draw: fix resolution/scale-dependent bugs

* make text_draw fallback to the current shader, fix hud and stagetext

* repair the bgm loading

* fix spell practice mode

* fix walloftext

forgot one site of text_draw earlier

* fix wrapped text rendering

* fix and simplify the hud text shader

* dynamic glyph cache

* implement font size change on window resize/quality setting change/etc.

* rename text shaders for consistency

* preloads for fonts and text shaders

* make the stagetext shader look somewhat better

* text_render: attempt to normalize height

* small improvement for stagetext
2018-06-30 00:36:51 +03:00
Andrei Alexeyev
5a83aa177e
Improve filename timestamps (screenshots, replays)
* Get rid of timezone information.
    * If possible, add milliseconds precision. This is useful when
    taking several screenshots in quick succession.
2018-05-28 12:03:14 +03:00
Andrei Alexeyev
09946ebff9
Threading improvements (#125)
* Add a general purpose multi-threaded task manager (worker pool) for background tasks

Reimplemented screenshots off-loading using the new task manager.

* Largerly rewrite resource loading internals

They use the new task manager API now and should be generally more
robust.

* Made the game playable without threads again

* wait for resource async load task instead of intermediate state change

* remove dead code

* taskmgr: if creating a worker thread fails, try to make sure the others terminate
2018-05-25 09:01:07 +03:00
Andrei Alexeyev
2932247249
attempt to refactor the util disaster into several smaller disasters 2018-05-15 03:27:25 +03:00