vkQuake icon indicating copy to clipboard operation
vkQuake copied to clipboard

Add Model Scale Support

Open JosiahJack opened this issue 2 years ago • 10 comments

Add support for models to use scale field. Used to scale up or down misc_model decorations such as statues or trees to add variety and emphasis.

This is purely scaling the model drawing. Scales the bounds to prevent the entity becoming invisible when not looking at its origin.

Test Files scaletest.zip

Tiny test mod containing a test map maps/test_scale.bsp and a v1.06 progs.dat with only .float scale; added to defs.qc Disregard the fact that this is an enemy model; I'm merely using a func_illusionary to display it and chose a standard id1 model.

Expected results below. The doubled one in the middle is scale 1.0 (not set). The unscaled one at the far left is scale set too small. image

JosiahJack avatar Jul 27 '22 01:07 JosiahJack

sv_main.c: the changes seem to be redundant with lines 794-797 (just above). The 39 in line 1899 should be raised to 40.

temx avatar Jul 31 '22 09:07 temx

Please squash this and run clang-format.

Novum avatar Aug 01 '22 18:08 Novum

Please squash this and run clang-format.

Done. If you don't mind my asking, why squash it now when it can be squashed at merge?

JosiahJack avatar Aug 01 '22 21:08 JosiahJack

If you don't mind my asking, why squash it now when it can be squashed at merge?

Because otherwise it's rude, and severely hinders other ways of testing PR patches E.g. downloading the patch https://github.com/Novum/vkQuake/pull/539.patch and attempting to apply it to your local tree would fail.

Not everything is about github gui.

sezero avatar Aug 01 '22 21:08 sezero

It's also easier to keep track of what was actually changed

@sezero Does this look okay to you? Any red flags functionality wise?

Novum avatar Aug 02 '22 01:08 Novum

Josiah submitted a similar patch to qs too, but I don't have anything to test it with so I requested reviews from @ericwa or @andrei-drexler

sezero avatar Aug 02 '22 02:08 sezero

...but I don't have anything to test it with...

Ah, good point. Added test files and expected results to the top post.

JosiahJack avatar Aug 02 '22 03:08 JosiahJack

Haven't tested this vkquake version of the patch, but the test map/progs you gave above rendered broken for qs -- see https://github.com/sezero/quakespasm/pull/32#issuecomment-1202006404

sezero avatar Aug 02 '22 04:08 sezero

...the test map/progs you gave above rendered broken...

I accidentally included the wrong progs.dat by mistake (in addition to missing a discrepancy over in standard QS, unrelated here). The zip has been updated in the top post to use the progs.dat I've been using during testing. Sorry for the hassle.

JosiahJack avatar Aug 02 '22 21:08 JosiahJack

Add scaling to R_AddEfrags based on comment here.

Also fixed r_showtris 1 to draw with scale applied.

Sorry for the bit of back and forth. I think this should finish this feature out.

JosiahJack avatar Aug 03 '22 19:08 JosiahJack

Closing this. Will port if it eventually lands in QuakeSpasm upstream.

Novum avatar Aug 13 '22 18:08 Novum