-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modules API #714
base: vulkan
Are you sure you want to change the base?
Modules API #714
Changes from all commits
fc1a553
1526bc8
d52d44e
7d7535c
239d7bc
e33185c
2f4aaec
c3d4d0f
4b60581
0a6b40e
c60d851
57fcd5a
59f7d26
2fe88ac
b989288
f6a0e75
99d3fc5
725b1a7
b88415d
9aa5ed2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,3 +158,120 @@ int TriWorldToScreen( const float *world, float *screen ) | |
return retval; | ||
} | ||
|
||
// NOTE(nilsoncore): Moved from `vk_beams.c`. | ||
// It uses global `g_camera` and comment suggests to use `R_SetupFrustum` -- a function inside `camera.c` -- so probably it is a good place. | ||
#define RP_NORMALPASS() true // FIXME ??? | ||
int CL_FxBlend( cl_entity_t *e ) // FIXME do R_SetupFrustum: , vec3_t vforward ) | ||
Comment on lines
+161
to
+164
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Перемещено из There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Камера для этой функции тоже не лучшее место. Если уж хочется перенести, то лучше в какой-нибудь r_common, или там r_misc, или что-нибудь похожее, что у нас там есть или может быть. |
||
{ | ||
int blend = 0; | ||
float offset, dist; | ||
vec3_t tmp; | ||
|
||
offset = ((int)e->index ) * 363.0f; // Use ent index to de-sync these fx | ||
|
||
switch( e->curstate.renderfx ) | ||
{ | ||
case kRenderFxPulseSlowWide: | ||
blend = e->curstate.renderamt + 0x40 * sin( gpGlobals->time * 2 + offset ); | ||
break; | ||
case kRenderFxPulseFastWide: | ||
blend = e->curstate.renderamt + 0x40 * sin( gpGlobals->time * 8 + offset ); | ||
break; | ||
case kRenderFxPulseSlow: | ||
blend = e->curstate.renderamt + 0x10 * sin( gpGlobals->time * 2 + offset ); | ||
break; | ||
case kRenderFxPulseFast: | ||
blend = e->curstate.renderamt + 0x10 * sin( gpGlobals->time * 8 + offset ); | ||
break; | ||
case kRenderFxFadeSlow: | ||
if( RP_NORMALPASS( )) | ||
{ | ||
if( e->curstate.renderamt > 0 ) | ||
e->curstate.renderamt -= 1; | ||
else e->curstate.renderamt = 0; | ||
} | ||
blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxFadeFast: | ||
if( RP_NORMALPASS( )) | ||
{ | ||
if( e->curstate.renderamt > 3 ) | ||
e->curstate.renderamt -= 4; | ||
else e->curstate.renderamt = 0; | ||
} | ||
blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxSolidSlow: | ||
if( RP_NORMALPASS( )) | ||
{ | ||
if( e->curstate.renderamt < 255 ) | ||
e->curstate.renderamt += 1; | ||
else e->curstate.renderamt = 255; | ||
} | ||
blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxSolidFast: | ||
if( RP_NORMALPASS( )) | ||
{ | ||
if( e->curstate.renderamt < 252 ) | ||
e->curstate.renderamt += 4; | ||
else e->curstate.renderamt = 255; | ||
} | ||
blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxStrobeSlow: | ||
blend = 20 * sin( gpGlobals->time * 4 + offset ); | ||
if( blend < 0 ) blend = 0; | ||
else blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxStrobeFast: | ||
blend = 20 * sin( gpGlobals->time * 16 + offset ); | ||
if( blend < 0 ) blend = 0; | ||
else blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxStrobeFaster: | ||
blend = 20 * sin( gpGlobals->time * 36 + offset ); | ||
if( blend < 0 ) blend = 0; | ||
else blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxFlickerSlow: | ||
blend = 20 * (sin( gpGlobals->time * 2 ) + sin( gpGlobals->time * 17 + offset )); | ||
if( blend < 0 ) blend = 0; | ||
else blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxFlickerFast: | ||
blend = 20 * (sin( gpGlobals->time * 16 ) + sin( gpGlobals->time * 23 + offset )); | ||
if( blend < 0 ) blend = 0; | ||
else blend = e->curstate.renderamt; | ||
break; | ||
case kRenderFxHologram: | ||
case kRenderFxDistort: | ||
VectorCopy( e->origin, tmp ); | ||
VectorSubtract( tmp, g_camera.vieworg, tmp ); | ||
dist = DotProduct( tmp, g_camera.vforward ); | ||
|
||
// turn off distance fade | ||
if( e->curstate.renderfx == kRenderFxDistort ) | ||
dist = 1; | ||
|
||
if( dist <= 0 ) | ||
{ | ||
blend = 0; | ||
} | ||
else | ||
{ | ||
e->curstate.renderamt = 180; | ||
if( dist <= 100 ) blend = e->curstate.renderamt; | ||
else blend = (int) ((1.0f - ( dist - 100 ) * ( 1.0f / 400.0f )) * e->curstate.renderamt ); | ||
blend += gEngine.COM_RandomLong( -32, 31 ); | ||
} | ||
break; | ||
default: | ||
blend = e->curstate.renderamt; | ||
break; | ||
} | ||
|
||
blend = bound( 0, blend, 255 ); | ||
|
||
return blend; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//~LIGHT3C 220 210 150 3000 | ||
~LIGHT3C 220 210 150 2000 | ||
//+0~LIGHT4A 200 190 130 11000 | ||
+0~LIGHT4A 200 190 130 5000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
+0~FIFTIES_LGT2 175 175 255 5000 | ||
+0~DRKMTLS2C 255 200 100 1000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
+0~FIFTIES_LGT2 175 175 255 5000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь и далее гитхабик желает замержить файлы старыми версиями. Скорее всего это из-за ребейза.
Ребейз очень грубый инструмент, он явно и неявно ломает кучу всего. Его не рекомендуется использовать за исключением особых случаев, и очень хорошо подумав о последствиях.
Скорее всего из-за него этот PR окажется невосстановим, и придётся для мержа открывать новый, потеряв/разделив часть переписки.