|
|
食品车:
7 ^0 J0 z* y3 Q# q; A尾翼:
# }8 F8 C! I. w. S# T$ [: g7 O1 Z" f% [/ c7 a: a( Q
代码:; e. o$ @4 G3 p6 }8 m, O
CWndAutoFood::CWndAutoFood()
$ s3 r4 I+ D7 p7 B$ o* u4 B' B# b4 u{
+ o( A- y3 ?! m! C5 _6 F m_pItemElem = NULL;& e7 a' a7 J3 ~1 z+ u3 ]) y1 R
m_pTexture = NULL;
7 \$ I5 q# _* A% L% r2 r$ y bStart = FALSE;
1 c4 g9 B/ A V7 X}
8 W1 e2 ]) R) b. p6 w" w' f! E) f8 t5 S2 ~8 U% T; @6 p
CWndAutoFood::~CWndAutoFood()
' l8 u7 D; z* D- o1 r{9 v5 A x0 R: { k7 q0 [
AfxMessageBox( "AutoFood ist gestorben " );
1 @5 ?% P/ g0 y$ f# P4 X}! t2 j; Y/ Y" s: i
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
/ C1 ?8 L0 a w) {/ x; B% t{
& }: t) \ P( F& g return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );8 K$ z$ i0 {; G- a. C0 G9 b
}
( }! I1 Q: N, }- s3 A5 T5 ~. ` [& s5 p0 U/ f9 ^- s7 i
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
. F% `* D5 k5 z4 {* O# B{ j ~1 S# k0 P/ t* B
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );% H2 F @$ y( }) r2 `& g0 H
CRect rect = pWndCtrl->rect;
: \3 W; Y1 q0 @: a if( rect && rect.PtInRect( point ) )4 Q9 e4 X# _% E8 q# M% ?3 \: ]& C& [
{
9 m7 R( X+ h0 S" U+ w" ] CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );* q- l& l9 I$ m
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )" }+ u5 P3 g2 K$ k5 X: ~8 d% w: D
{" R8 x3 M5 s4 U0 b( T' o/ r' D+ u
if( m_pItemElem )$ y2 N, m: G+ `! y* w
{2 |1 A1 J/ ?- i9 c
m_pItemElem = NULL;
u9 `2 d5 ~2 Q" o( ]1 }3 n" G" j }4 D/ y1 F/ c [4 P( e' p* T
m_pItemElem = pItemElem;! d8 p! Q% l' J. U
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
8 }' T/ G: Q' Z8 p# } }else{+ i7 |) t! U" q; X% ^& k/ n/ V
SetForbid( TRUE );- s1 O2 V$ N/ ?0 t
}/ z: g/ U# L3 r/ G
}else{. K: S9 ], n$ k
SetForbid( TRUE );
- F }. {' V0 K! d/ T B+ s+ |" C }
4 L! {! Z3 P0 d" B: p1 _ return TRUE;. W& s/ O5 ]8 n/ X
}- P p4 F$ |( t x; a
2 l3 L G4 M$ s9 DBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )7 c1 e# M5 V% |& U m2 G/ B
{
, |! {. E8 U" ?7 H0 i4 Z switch( nID )8 X9 g, F$ O: j) |8 D. s
{
1 M3 C1 k2 i; m8 g case WIDC_BUTTON3:2 z, a2 `( `0 t% l3 H1 _) A
{
! D" [: K. u, K% h9 h bStart = TRUE;' ]) ?* u( @) `% _2 u$ e
break;
. J7 A# W$ U2 K/ `6 l }
/ {# r1 M: ]( \, w+ c% D case WIDC_BUTTON4:9 p6 ^% ]' I% G7 X7 r1 B
{
8 k( u, D, R H$ K \ bStart = FALSE;
8 V* O- S" L* O3 @1 G break;
( ^- l2 g0 E. y+ [9 ? }
8 |; } Q$ k, d( T K- I }4 A; G7 {9 X% I) h9 p! J4 x# u; A
return CWndNeuz::OnChildNotify( message, nID, pLResult );
7 O& R2 x6 M3 U1 H# C5 E}
* \& ]+ V2 p. v) c- J( d+ Lvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )
3 v0 D I2 U- \. L{+ @& o4 G! p! R
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );% B- C6 ]2 |- K
if( bStart || !m_pItemElem )
% P7 B6 z( f5 x1 p {
& r6 g& C3 ~- o pBtn->EnableWindow( FALSE );- V6 l2 D& i4 | o; ~4 R' x G; c
}else
- ?3 \0 i& N( { b pBtn->EnableWindow( TRUE );
5 p: c9 l3 y I0 s if( m_pTexture )
4 R1 R- x- G( a3 u1 t8 R# f3 S {
# i4 F1 j+ L _ LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );" M) o7 y% x0 z- G5 u7 o
if( wndCtrl && wndCtrl->rect )
' Q% d: q' t% t' [* Q {
9 U2 j) n: X" l% b6 }7 z1 [1 | m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
+ ~6 S ]: e# f; V }4 q, s* l3 I, ]; U, e: {
}
8 F, ^9 }/ k2 P* d! O8 c& n) T( l}
+ [, H/ O z9 Y. ^' O# H0 A+ Z* J% E, A8 ~+ A5 F" A
BOOL CWndAutoFood: rocess()
$ _" Y/ G4 G& ^1 W- T5 `7 z) P+ j{
9 A' X7 g" G+ K S( b if( bStart )
+ V9 {- \$ Q# w: r: j {2 E- _ W; E2 i2 [ Y1 X) a
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )# ]2 e* l% ]7 J
{- |: J; ~! T j: M/ e2 K6 m/ T
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
8 l7 U% V: v) I, N, }* \. A- c! v g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );6 n9 R4 L: q- e: r: M6 B
}else{$ K$ L& y$ ]8 ]+ j# A: H; t/ h
bStart = FALSE;2 j) X1 b% \: m b3 m9 R+ d+ f
m_pItemElem = NULL;
; @" g, {( N Q8 E2 L. n" z9 q* P }3 e3 g. ?) I+ O) F7 `- d
}' W6 ^! X; E1 D4 M
return TRUE;* b0 u: i# v7 \; N; F
}% h: g; D, m9 S- u1 f
: l3 i; G9 a: Y: d登录视频废话:2 q! a( E% |7 H6 W
尾翼:
7 t( U: U* {! Y9 z4 Q" H% t+ u; l# Q9 o9 L+ k- E5 o
代码:- U% D$ ?+ I) y7 v4 V+ M J3 g. e
( f4 r! Y% v; _" W8 e0 Z; ]
void CWorld::SetLight( BOOL bLight )* F" c; u: \9 N8 s4 X; f. {: ?
durch6 g4 ~2 {: x$ }' s' |9 i
Code:
3 a6 z- h; V* c3 a q* F9 hvoid CWorld::SetLight( BOOL bLight )/ R1 z/ m! z" M
{2 |9 U5 }" W! w
//ACE("SetLight %d \n", bLight);5 Y8 g% t" p: C
' g1 N d% \' Z/ }6 k; m" ?( K5 D
#ifndef __WORLDSERVER
5 M( z! F/ O0 I4 U3 h# k DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);. E; B+ O" a+ B7 ]( g9 O3 _) ^
CLight* pLight = NULL;
1 V* @+ U8 H3 b" x9 N; T' X3 T. c' I# u8 a% M3 Y9 G* D: i
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
Z3 Z, T5 i+ J3 ^! [
g& S( Y \8 ? pLight = GetLight( "direction" );* t- b$ L7 X H( Y
/ s# ]. e( }5 p' S U8 m H
#if __VER >= 15 // __BS_CHANGING_ENVIR2 F/ L. Y4 t; \
if( g_pPlayer ){
$ b: `+ i1 l8 v4 f* O+ f( \ ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );; v6 s5 ^( F' A
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!6 x M3 k) a- m. }
{3 n$ y3 p6 x# d [' `! J
if( pLight )
* {5 [: o) H6 @! M% ^& B {) S8 J, r5 w$ s/ Y/ Z1 S
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];$ r6 Y8 O Z, B) ?/ R
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];6 j1 D( Z# K. [% k# |! o
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
9 \- |$ r* w! B1 \
% d, b" ?" X% M6 ` pLight->Specular.r = 2.0f;
9 Y9 n: w2 h( _* T pLight->Specular.g = 2.0f;1 r i+ e: @) u
pLight->Specular.b = 2.0f;
. @; `. i9 @- g* s1 ~3 P6 Z) C" Y" c
/ f+ T, N: Y! L- u3 l! r pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];- s$ y) Y; Z& h, }; M0 S" _4 i
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
% g Y1 t5 k! @ pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
$ k7 m2 }! T8 M
5 ]* e" w; h. S9 B0 v- M& h HookUpdateLight( pLight ); 1 [# G$ X @: J2 \# B" ]
, }8 j2 S i( H7 C0 V* i memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
, \9 H0 Q8 H6 D2 Q8 t
$ r2 h, G7 {/ D l: f4 L pLight->Diffuse.r *= 1.2f;" J4 h. Q5 k+ v6 a9 t. S6 J
pLight->Diffuse.g *= 1.2f;+ `* p" D" j @
pLight->Diffuse.b *= 1.2f;
% \7 ]% [9 m1 u. X1 }7 K7 w' K, M
8 k& O7 X. ^; y( R pLight->Ambient.r *= 0.8f;
8 t, W! t' _4 K7 u' o pLight->Ambient.g *= 0.8f;8 b/ @5 J4 g5 y8 \4 Z. P) b
pLight->Ambient.b *= 0.8f;
0 E+ l) t2 E. D4 L9 }/ U6 K
. R4 h7 P5 P5 i/ L memcpy( &m_light, pLight, sizeof( m_light ) );' S! W6 S& A4 T' y# E
, A+ }' Y, l7 d8 V% e$ r3 q7 C( ?6 k D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
; t* Z' T7 R: Q2 M D3DXVec3Normalize(&(vecSun),&(vecSun));
9 d. F% b9 o7 ~5 N5 d pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); : }- _* C+ m- D V1 J! P
pLight->Appear( m_pd3dDevice, TRUE );
* }, `; z& _; i4 k( m( e ' L$ W/ c W$ @7 Q' F
DWORD dwR, dwG, dwB;% u+ N$ L3 A$ j' y
dwR = (DWORD)( pLight->Ambient.r * 255 );
+ {8 _4 n D- ^. ~/ B dwG = (DWORD)( pLight->Ambient.g * 255 );
7 u4 W, w8 K4 f+ ]% R dwB = (DWORD)( pLight->Ambient.b * 255 );
) b8 K9 [; x8 B% L dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
1 k# V/ }+ i$ {; z: q R }
* @3 Z2 b" b7 X# q: x3 k }
" e; Q$ j5 {& D/ c; ~. B+ ^ }
$ q1 }7 E# ~# c% I else
7 Q6 S0 I5 f; U: ]8 E#endif
/ f2 w; x4 M# G/ r/ Q, D$ P, _- m9 p2 N* O2 c4 E: r
if( m_bIsIndoor )% R" t) d% n" v: P3 ~/ w
{: V1 V5 B( ?. e, h/ j" W+ Q
if( pLight )
, o1 g; m, I1 u3 o5 I {
( M$ R6 Q+ w2 w, [; v5 x // à??μ oˉè*
; B% k- @+ C0 h2 v+ W( S/ x1 s pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;4 z5 z6 P6 e- D" V% m# c
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;" S& [& [0 v P. a$ a2 O
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;" ?1 y0 O. w. C% {- a; ^: g
) p7 t+ }9 d, @2 N) H // oˉè* ??à? 6 ^# i5 ~2 L' W$ g4 U0 N `0 R
pLight->Specular.r = 1.0f;
D9 d) i* o+ Y. n pLight->Specular.g = 1.0f;
4 N$ q# j, k( J/ r7 e* Y) W j2 i pLight->Specular.b = 1.0f;
( g! C7 O6 J. x, I5 ^$ u" E // àü?? oˉè* T+ j q' x& i1 I( h$ X% @
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;) U p0 N9 e; `
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;! u* J0 `1 s( z# M' H) U" }/ ^
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;0 r- ^8 ~, J: a: a, z! H
& B3 i$ r8 \ d: r, `0 A* a
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.7 X& Z3 Q3 K3 C2 H; o8 K/ k
{7 b9 W! H" v; S
pLight->Diffuse.r *= 0.6f;
1 [# m) N1 N5 o: `: Q pLight->Diffuse.g *= 0.6f;$ Y& j6 X. u# r+ X; i3 O
pLight->Diffuse.b *= 0.6f;
8 ]* s+ M/ x( t: q( I pLight->Ambient.r *= 0.7f;
1 y0 e0 e( D7 _% Y- O3 r: s pLight->Ambient.g *= 0.7f;
+ e. T! h) W* l! A pLight->Ambient.b *= 0.7f;
' |. F; ?* V& W+ m3 d* b* @ }4 M% b0 ?4 U: Y( z. \+ Y0 B* h
& Y; H5 G2 X9 _6 }5 W4 s2 m; p
#if __VER >= 15 // __BS_CHANGING_ENVIR
0 R9 T3 V3 x0 F if( g_pPlayer )
; i# v3 }( v/ y/ [" L6 t2 N. _ HookUpdateLight( pLight );
; h+ T0 Y& h6 v: ~# q6 g; S#endif7 C4 ^+ F- I, ?. y: u) i4 y
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
. U+ R- o" R- N7 w9 C
8 I, C: `# ^& k3 J9 j4 { pLight->Diffuse.r += 0.1f;1 `2 t& Y. K. i1 I- u: ^& u
pLight->Diffuse.g += 0.1f;: D0 G, P$ ?( T0 ~6 T
pLight->Diffuse.b += 0.1f;6 V+ K0 ]9 |. U9 X
// oˉè* ??à?
1 w" U+ U+ O1 l5 f' b* x pLight->Specular.r = 2.0f;! V$ i0 O* N' H+ z/ J8 M9 B" }. s2 F. F
pLight->Specular.g = 2.0f;
& u: n! r7 X' ?, ^5 r pLight->Specular.b = 2.0f;
( m6 [: e, [9 h$ t' `9 ?& ~ ] // á?oˉ
3 F7 S- r1 g3 I9 _9 M$ A pLight->Ambient.r *= 0.9f;
' f3 ?; ~/ c$ s/ U( {1 c7 x2 v5 S pLight->Ambient.g *= 0.9f;
8 x% F) k7 H; v+ c+ k: z pLight->Ambient.b *= 0.9f;% \! {/ r% I' w/ @( [' g
: q* X% P Q; g5 [ memcpy( &m_light, pLight, sizeof( m_light ) );' q% D) j- z1 g# n$ W* @
0 n! I3 u, i( i# b* o
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );1 r( D; l4 Y: m4 K! {3 W
pLight->Appear( m_pd3dDevice, TRUE );! K s0 }2 T' b/ w" t" h
8 g1 P. n" d/ I4 r% c$ l/ X4 h
DWORD dwR, dwG, dwB;# q- t! y5 K1 m" b p/ e
dwR = (DWORD)( pLight->Ambient.r * 255 );
, C: E" t8 j' A8 W: Y dwG = (DWORD)( pLight->Ambient.g * 255 );* o: W% j, A& E5 ~
dwB = (DWORD)( pLight->Ambient.b * 255 );
" v# x6 W8 q! R# v) b+ K dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
. L( w; |4 i/ X$ V6 D6 u }8 n) @% {6 q" F. w- ?9 T
}
7 S- x, A: V/ I+ q5 K" b# [2 W# L else7 W& N! Q0 v* L5 k& [& a
{+ C- f. P; k& F( F$ p u
if( pLight )
9 E4 Y$ i' U8 E" k' E+ W/ {( B {) b% `, k: D: T* Z/ z, ]
& r: R7 S0 c& z; ~" }
int nHour = 8, nMin = 0;3 I/ [$ S& a; o2 w. L' E
#ifdef __CLIENT
$ R# F7 I- j4 B // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
9 C% x3 R4 y& ]9 x; e nHour = g_GameTimer.m_nHour;$ `! u) H8 L6 J- D1 C6 N9 L4 C
nMin = g_GameTimer.m_nMin ;% V6 U- r/ I8 ?4 o* F/ J% n7 v9 A
#else
2 n1 w: P% Z6 e // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
+ W, n' b6 o. g if( m_nLightType == 1 )% m% m: Y) |# l7 P+ E3 i) N$ x1 {( P
nHour = m_nLightHour;) H- B8 }& n4 S- I% m
#endif+ \5 z+ D7 m" R# A8 _% s# B
nHour--;
. [1 {* W9 ?- I* ?3 n1 `+ h if( nHour < 0 ) nHour = 0;
/ I5 V' N$ X2 ^8 H1 w) ` if( nHour > 23 ) nHour = 23;) F+ L5 |# Z' l
3 i1 e# j, I7 ~* y
//if( m_bFixedHour )- F9 S2 Y. C( L6 ^; \4 f9 @5 B
// nHour = m_nFixedHour, nMin = 0;% e2 \- H) N6 A& t. S# ~4 c0 F/ B4 f, |
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
; h7 U1 R- N' V. T LIGHTCOLOR lightColor = m_k24Light[ nHour ];
( j2 F; T8 a) I O1 l( _# K" G+ w
# ~) N! b/ ^- Q% N' ^, l //m_lightColor = lightColorPrv;
4 D$ ?6 g6 |6 i' G% w lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60; H/ N9 W" r$ M
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
3 I7 v, X/ B+ Q* Y" h1 V lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;9 C) b" p# l8 {7 d" @: j& r, C, K4 C
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;3 v# v' f7 r) r( F8 \0 s
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
5 I* L8 l: ~# r lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
$ U" z$ z( t0 ] ]0 Z // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
! t: W0 q3 w% P# E. x
. O. N$ S* h# X9 p, V* f! k // à??μ oˉè*
5 c0 S4 T, t3 y+ L! x+ Y pLight->Diffuse.r = lightColorPrv.r1;
" b3 ^, r( i- f5 U& a( c% U; ~ pLight->Diffuse.g = lightColorPrv.g1;
9 c* q6 p* d# s; j5 J2 [ U pLight->Diffuse.b = lightColorPrv.b1;' J& b$ Y4 G0 o: Q+ x& t
// oˉè* ??à?
. x- H$ I+ \6 J$ g- n- g& w pLight->Specular.r = 1.0f; ^: K; ]) x" P; x: s
pLight->Specular.g = 1.0f;8 B' ]. }% ^& L t" q4 ~3 b# s5 c/ o) [
pLight->Specular.b = 1.0f;: u- P5 U' ?5 h' A+ J
// àü?? oˉè*
# r1 i# B2 z: ] x, U pLight->Ambient.r = lightColorPrv.r2;* {, I# t( w6 M% D6 V" U) r# ?
pLight->Ambient.g = lightColorPrv.g2;' U# C h( m4 w0 r: k
pLight->Ambient.b = lightColorPrv.b2;9 J, P4 p. M" u2 r4 g" Z; x
/ G1 q8 l0 V$ \* h8 G {
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??., q A& D* C& x# T. W* f! C
{7 ~* t6 s( o7 z" Y: f" @
pLight->Diffuse.r *= 0.6f;5 I( E- Q2 a& I% ?/ i
pLight->Diffuse.g *= 0.6f;) z7 E; A9 o' g; y. y0 ^2 |/ f
pLight->Diffuse.b *= 0.6f;3 g" I2 \6 Q/ |6 c
pLight->Ambient.r *= 0.7f;& S) {+ {" W P3 c1 i e
pLight->Ambient.g *= 0.7f;
. S9 K4 p5 Q9 z pLight->Ambient.b *= 0.7f;, k* Y8 @2 }1 d# t. o
}* k9 g& j9 A) }4 H- L
. j) N* e- m: ~- `4 d" R
#if __VER >= 15 // __BS_CHANGING_ENVIR# h; ~# p, W# V# e
if( g_pPlayer ) X3 O3 f# V4 |& Z1 V
HookUpdateLight( pLight );
. e" d$ A" U* {- d7 D3 B6 e) r#endif
+ r# V2 J5 `9 P7 B Z. p$ C% e+ c memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );( _8 ?, p, _4 x
: e0 D; {: A# F. I# n3 Q5 E# Y- J
#ifdef __YENV, z6 A; v; [3 V) `- K
pLight->Diffuse.r *= 1.1f;3 f7 t8 F/ T+ b0 H; y1 A0 C) W
pLight->Diffuse.g *= 1.1f;! o; Q& W, P1 ~0 X. Z1 Q9 Q3 y
pLight->Diffuse.b *= 1.1f;
. F% L1 P- B+ X: K- V // oˉè* ??à?
\9 R* X- t) A9 t pLight->Specular.r = 2.0f;
3 S% ?% a( Q' |$ P pLight->Specular.g = 2.0f;
& j' a5 C" n' I6 V/ F7 \ pLight->Specular.b = 2.0f;
% d6 I8 L& `6 p# E) i# v // á?oˉ 6 P0 C ~# W5 X7 B: o( X
pLight->Ambient.r *= 1.0f;
2 _. K# C) j% u& R0 {: ] pLight->Ambient.g *= 1.0f;
; I- v% K: P0 @7 j+ G; K0 M pLight->Ambient.b *= 1.0f;
8 h! i9 u4 {0 h7 a& u#else //__YENV, D* J/ ]! d9 E% F
pLight->Diffuse.r *= 1.1f;
1 S8 z3 z5 u6 ~2 X% P6 R8 O& }' X pLight->Diffuse.g *= 1.1f;& ^% A1 G( S% G
pLight->Diffuse.b *= 1.1f;$ c* D; G, P: q+ L. j
// oˉè* ??à? 6 ?! n& C2 m/ @4 @
pLight->Specular.r = 2.0f;9 u* b8 L/ S) P) ^# \; j
pLight->Specular.g = 2.0f;
" v1 F$ j/ w, x8 I* { { pLight->Specular.b = 2.0f;
5 t; {" R3 C, |; B8 N: r // á?oˉ
; l6 o1 N5 U. U2 I# o0 |) B pLight->Ambient.r *= 0.9f;7 u1 |2 y( @- L: ]' }; n
pLight->Ambient.g *= 0.9f;
! C4 m( h0 _0 C1 B. B, {3 j4 \ pLight->Ambient.b *= 0.9f;5 g4 v* t/ N$ m+ R F8 Z
#endif //__YENV # q) g% W9 n' R) t9 K
( x. t. a, P: P& [8 X; X memcpy( &m_light, pLight, sizeof( m_light ) );/ e! P# O! T/ t+ g# ~3 J/ M
3 r4 J! s3 K, o" Q$ A* w D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);- E1 }2 o, L9 ]) \/ `
D3DXMATRIX matTemp;5 i4 a( K- l3 B; X0 {- J8 l: o
static const float CONS_VAL = 3.1415926f / 180.f;
2 ]' `: X$ Y9 Z' ?3 I% ]. t) J+ \; \# [ @
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
3 r8 `' V F' X9 E' f, Q) f D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);- L3 o" x) j- c9 w6 \2 V3 c- B
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); , z6 O6 q; G% ~! l8 |! k. m# C/ o
pLight->Appear( m_pd3dDevice, TRUE );8 p9 W0 r6 p5 T f
2 H) H3 f; G: u1 D; W7 t, j
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);! A3 v) J( P% K- y1 J
// D3DXVec3Normalize(&(vecSun),&(vecSun));4 B3 `! J, V7 k
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
6 `8 }1 ^1 j, g+ c# u4 m
8 d* U: Y% k7 @/ ` DWORD dwR, dwG, dwB;+ k2 ~' }+ t2 G5 M+ X, T
dwR = (DWORD)( pLight->Ambient.r * 255 );
) j; z3 q9 m/ M, ` dwG = (DWORD)( pLight->Ambient.g * 255 );
3 j5 M2 z2 E, W& z9 F3 l dwB = (DWORD)( pLight->Ambient.b * 255 ); n" o1 L6 j* U& b
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); ) o# f8 y- G6 H/ b e4 u. `% R1 V, B
}
5 X5 n7 v" z: O [ }
0 l9 N6 W9 G N6 P& j+ j/ Y3 u) B0 \6 J& v5 ^- P) \$ E
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
* y3 F. [5 y' d- V$ T2 ? m_pd3dDevice->SetRenderState( D3DRS_AMBIENT, dwAmbient );//D3DCOLOR_ARGB( 0,0,0,0) ); //m_dwAmbient );//D3DCOLOR_ARGB( 255,128,128,128) );//D3DCOLOR_ARGB( 255,50,50,70) );1 b8 m6 u5 N! ^. L3 v
::SetLight( bLight );
- Z/ M6 Y3 f+ v$ D5 s2 _6 Y# C3 R2 X3 U% C2 }
// ±ao? ?D?í???ó á¤à? ) n- [7 g z. P) q8 t( u$ q
m_pd3dDevice->SetMaterial( &m_baseMaterial );0 e v+ ^) m0 l5 u: b2 F
9 M0 g1 R/ r) J# r4 x" k
#endif // not WORLDSERVER
+ ~/ I/ ?' R& {/ x}
$ T9 z6 O: I, E3 t) [并更换
/ M8 j9 g+ C3 G3 {# p) D! HCode:
; A- x/ O4 x# U$ q$ U__FLYFF_INITPAGE_EXT
# M8 Q8 ]& a+ g1 j定义
! S$ W+ F7 @0 J! `. R( d; b1 z/ ]6 O5 n4 C3 P9 r0 ?
) Z8 ]' S5 S: E5 s( ?) ~% z5 P! z \( j! k& @% j" G
1 E# Q- h0 T- ]/ r; `4 u b' r现在终于删除我的狗屁加速...
5 { J. R9 j. @6 r1 ~ M
' T8 X" v8 Y# i) J% u Y, B u. T% t
4 w, h5 M0 m: r
|
|