|
食品车:
/ n. h4 k$ A) d. F% X. t! _ P% B尾翼:
1 L9 E! ]) }+ |- t5 I2 Q0 k# n) c$ {) i3 ]$ M7 B0 x: p# K7 _5 L6 R1 k
代码:
3 k, f z& W0 w; O3 w2 s) i) YCWndAutoFood::CWndAutoFood()
7 H% ?, K5 j7 K' `{# K( t" n: d+ ]9 D/ u/ N; a$ E9 Y
m_pItemElem = NULL;
8 M, O) Q" T3 h& O m_pTexture = NULL;
* ?" e2 H2 ]4 q& @% C bStart = FALSE;
8 w; E. W0 L4 w}
" q$ ~3 R) p/ i% _- F0 t. P3 C& X6 K: O& J0 ], C6 o
CWndAutoFood::~CWndAutoFood()
7 I1 e4 G+ u0 d/ D, S1 [ D{3 h! C% c) O/ a, q# r
AfxMessageBox( "AutoFood ist gestorben " );* ]0 Y4 A1 d S& k: B2 U0 O
}
6 I1 Y, ` k0 { y2 _BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )4 }4 U1 q! h+ s ^+ {4 \+ a; y% a
{
) i) F# d9 X' `+ m; p/ M9 {+ s return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
4 Y6 Y' v' L' e5 P1 o( j; V% _}+ y% |% s7 n; |0 ^$ P
+ Z3 g" ?8 `9 M! Q# s
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )6 K- E' a# t. b- \5 g: L
{$ B, K( l1 S' ^ m5 t) g8 X
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
0 c- M# c! f+ M CRect rect = pWndCtrl->rect;
! F- t& v; \& v. y) L if( rect && rect.PtInRect( point ) )
/ i `9 Y8 c2 I/ U {
6 K7 _" i( Q" _+ v, m1 `) a5 Y/ r/ ^ CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
/ t' T. X* @" t) @! l* ] if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
3 T9 m) ~1 k3 e) E' U) Y) R {
! o3 O P" V% d" o if( m_pItemElem )
- S5 R. Z6 {$ ~5 `( B5 q6 t {4 F1 z5 A/ ?7 i, W* a" L8 M
m_pItemElem = NULL;4 |) X& G9 j8 S
}. J) B l5 }$ E9 M) `" r* R; ]
m_pItemElem = pItemElem;) n1 R: e7 e! u' j
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
5 s3 h ^; _; U5 C& Z }else{% |, [- ]8 b7 j' e s. B
SetForbid( TRUE );$ ?/ r8 ~2 f6 S3 u! Q
}% n7 Z/ s) p6 B8 G
}else{
0 r' s! x# Y3 P2 Q. C5 q SetForbid( TRUE );
( {4 g* L0 {' e6 M. z }( ~- _( h. n$ Z2 b |2 L/ o
return TRUE;/ M D g/ X7 v M! R
}1 O. ?' q* |6 ?6 W( ^) H
8 w2 Z: t, y9 m! H E; `BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
3 i& P( V9 I: W' M4 u- {' m{, I! t5 _& Z) x: \+ z4 y3 A1 C8 T
switch( nID )+ q5 l s' P7 v+ Z7 H
{
* D# ~# P5 b9 j+ r8 s case WIDC_BUTTON3:
8 n5 u: I+ _/ V! _, G; ]9 y" V7 w {
8 ], n+ I/ O5 E. ?+ [; X bStart = TRUE;
6 n9 v9 y, v( T# K) Q+ k3 p break;# q6 Z: F9 v! R
}
# x8 k& o6 \8 [" Z/ R- c# f case WIDC_BUTTON4:0 q7 X! L: v; q: I& g2 B' E! g
{
8 X/ @ e7 r+ X bStart = FALSE;
# A" `& k+ c6 s! Q; O8 ] break;
3 V7 U2 w* U& `3 t8 V8 } }
5 U; A- f$ n/ S# E5 P# @ }
: E$ V& y" h; A return CWndNeuz::OnChildNotify( message, nID, pLResult );/ T: `2 z. b( m6 p
} - a b' t2 M9 |4 M9 }1 d
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
3 w/ `0 N; z" r7 e{
" T+ D# W: l$ F% J: Q! o; q8 {5 P: D$ I CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
* |( G/ t8 c* j+ S& y y if( bStart || !m_pItemElem )
; M* f/ i3 u/ M1 d {* G' U3 G# u/ I2 y) C
pBtn->EnableWindow( FALSE );
7 _2 Q# a* o% \, s }else
2 X; t7 A2 Z+ W% Z; w pBtn->EnableWindow( TRUE );
, I" ]" j- U# U2 J" e4 L+ @ if( m_pTexture )
6 x4 b8 G' S' h4 d3 O { O( o+ z# i* C8 @" I
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );+ k5 d# x2 ^9 q9 P) C9 b& n; \3 B
if( wndCtrl && wndCtrl->rect )
: X3 n; Z/ [9 D5 p) J( b } {0 D. S, ?) W h
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );! C" B: I1 N# E' Z1 ^/ Q, H. S
}" Z# U0 ~: o& v5 H; e W6 s- f& g
}/ s( t# @: K6 U7 \9 N( G
}
0 v3 t8 \ ?0 i, F$ G) N: D' X5 i+ n2 r
BOOL CWndAutoFood:rocess()) U4 C1 m0 ~" t
{$ ]7 q+ ~+ w8 w; l( b6 c7 |
if( bStart )% ^# S% i' T7 `0 O& x
{
3 S) H8 G0 A Y8 w0 \1 r$ K+ d if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )$ F; y) \/ }7 r
{
9 }6 J0 K1 y7 O3 V$ f if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )0 R, V. p+ P5 q8 u- R8 a3 u0 q) A+ {
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );4 N1 p" p' h1 k8 g" U: Q4 }
}else{* Z. a5 ]9 P& X7 d4 B* x- S/ A
bStart = FALSE;1 a) H& r- x; W& H8 h
m_pItemElem = NULL;4 v* v5 ~, n2 X" X
}( z1 x! O; P; n9 v
}
$ i( q# X# M. n) ~( p. p) m* _ return TRUE;
8 q8 C' z6 W$ e H6 r}
9 g# i6 {0 O, O) i
+ J& ?6 ]2 _5 d; ]登录视频废话:
( x3 u9 R ~( n8 S! b6 w尾翼:
( y, `5 t7 q. e1 d: J! D! }/ s! x$ [5 e; Y0 O2 l% M% X( |
代码:2 A2 s! y s* T3 k" Q0 e. h
0 j( c4 v% z4 C3 N! h" {* I
void CWorld::SetLight( BOOL bLight )
* \) B, s U4 E; k: t& ~0 l) Fdurch
' ]# G; N' c3 F: H3 D$ p w+ m3 sCode:4 p4 n* W9 b% R
void CWorld::SetLight( BOOL bLight )
5 }. `- l# y+ t7 ^. u{- V3 @" y4 ^- N
//ACE("SetLight %d \n", bLight);
+ G. {" F, ]- Q6 S( e; m ( b% Q( X7 n3 H9 g
#ifndef __WORLDSERVER ) }+ f& g" v. F" ^* P
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);& ~0 ]4 |6 x2 }0 k( q3 O) X. D' p
CLight* pLight = NULL;
+ G k! g9 o) t% I! U6 P6 N( {
0 K* B e2 A) \# N; S0 l- ?+ v D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
2 I; ]0 x" g3 J0 G+ J: D
* U1 |1 W6 Y v0 f pLight = GetLight( "direction" ); z6 d( T; I# d9 P& e5 O4 H. _
5 h# H6 O" F9 g" E#if __VER >= 15 // __BS_CHANGING_ENVIR
9 i" y' m4 q' X% {( K, | e3 h if( g_pPlayer ){
; B2 m5 g9 X1 e3 n" X, q/ J ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
" @4 f: p' D7 r0 v if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!+ i' a: q4 _+ |, }" [
{6 S* I9 Z5 W3 K" O
if( pLight )
' c6 E! Q9 M/ j7 @) s, }- @, k) H {1 G6 U* ]0 M9 r3 k1 d' ~7 C* @
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];* M6 O9 [( v% J9 ^ W2 H
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];# F/ ~# W- x$ v O. v
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
- v0 w2 n, U8 I6 b) U! b0 l% ~2 `% q3 E3 Y/ l- M r3 q
pLight->Specular.r = 2.0f;! d3 _" W; t: w b2 a
pLight->Specular.g = 2.0f;; G# g8 s( i) P4 M- \% ]( V
pLight->Specular.b = 2.0f;
: Z0 f5 J5 W5 B( R& k7 s+ @
- V8 l; L8 ?& a: T" {4 Y6 U pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];+ S6 X9 H" r) B# ^: x6 q
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
$ C& ]' D6 L5 x7 |3 P/ p' a pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
/ E9 g' F/ q% P. }9 T m
) Z1 ~1 I# c1 E# J$ _/ J; ?9 |1 [ HookUpdateLight( pLight );
6 Y3 U# Q$ m7 M {
n0 N5 u! o2 w memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );. f* D6 a5 u! I A; X m4 f
: w3 j+ m% j8 c$ ^ pLight->Diffuse.r *= 1.2f;# g m# U" q' g& I" Q. ^
pLight->Diffuse.g *= 1.2f;# t- @# N- Q' f. y$ V. g, q) p9 x7 i( }
pLight->Diffuse.b *= 1.2f;- i2 i0 x8 P- w* [7 o
3 E9 \8 N% X4 l; ]8 [6 l/ Q pLight->Ambient.r *= 0.8f;
3 Q1 {# }9 Z! W6 z/ |% W# I, k# p pLight->Ambient.g *= 0.8f;+ ^8 I/ }8 N! |6 J& ~8 @4 [
pLight->Ambient.b *= 0.8f;
& M& H0 Y& {( o' s6 t0 g 6 d6 Y, ?! N; {3 c# Q$ J& s5 j
memcpy( &m_light, pLight, sizeof( m_light ) );( Y/ G4 Q5 E: h; R. W" ^$ ?" @
# U+ C D+ i& { `8 r D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f); ]- F0 S8 m: u) W3 w: c
D3DXVec3Normalize(&(vecSun),&(vecSun));
2 |! U' I: [* G D pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
; {7 i$ {7 v$ r+ m; `# H6 M pLight->Appear( m_pd3dDevice, TRUE );* i3 {2 h! I8 n9 T- Q
1 b% ^. e! R9 _1 a: b6 T3 W
DWORD dwR, dwG, dwB;5 @ j/ [' `) D) H' Q& V
dwR = (DWORD)( pLight->Ambient.r * 255 );# F' o! {$ Y: Y: `' s+ r$ O+ l( I
dwG = (DWORD)( pLight->Ambient.g * 255 );. B/ D! R9 q& I! [! F
dwB = (DWORD)( pLight->Ambient.b * 255 );
+ O( Y+ a+ c9 Q( A: l } dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );5 ^9 d! z" C- n2 a
}7 ?# v0 d+ e( i( A) _9 V g3 T
}
) j' B8 F; [0 U4 m }8 J. f" v! k- J+ |
else. ?$ F$ X1 g8 s
#endif
/ r+ o5 @- j2 D* y( ~
8 y" }, @4 o' G: h if( m_bIsIndoor )( y, }$ |2 i% ]# B" `3 b7 o& @' z8 I
{# `6 w4 H: M1 ~; p, F
if( pLight )
5 k# g: q! Z. x) L {
+ W# C) v% A7 Q% H2 X // à??μ oˉè* ) m% G: a" H+ t) X, r
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
0 P8 ^6 I# N6 {/ l5 N6 b pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;1 ]. B9 Z, W, V% {! A1 c/ a8 C# C
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
. L5 x; x# _2 q/ ]' j. X
/ ?6 D4 f$ @& h! z8 N // oˉè* ??à? % i7 n' j. d+ h
pLight->Specular.r = 1.0f;8 J, g& C- I) n0 P
pLight->Specular.g = 1.0f;/ ~" ?$ {- P5 {" a0 Z* @1 ]
pLight->Specular.b = 1.0f;
! H$ m$ k$ o) E) h // àü?? oˉè*
( P) p& E5 h4 t( k3 Q% g7 y% U pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
, t( g. r/ x' J" n pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
7 Q+ J. R9 A, E4 x! L" b' [ pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
: i* [6 t* {" U2 d2 w7 P5 v% ^1 ^9 W( t
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
1 U; Q2 P. O3 t3 _; F7 r8 j2 y {
( c9 A) o- ?3 _2 s0 Y! w pLight->Diffuse.r *= 0.6f;
! z8 Q2 Z9 h" a pLight->Diffuse.g *= 0.6f;
4 v9 r* {- W- X5 B0 q6 O3 S5 e+ I pLight->Diffuse.b *= 0.6f;# H1 |- A" r2 N# i# s- W. f; c
pLight->Ambient.r *= 0.7f;
# @/ m( K2 f5 W- y: ] pLight->Ambient.g *= 0.7f;
& r3 s. a( X0 E. I5 E8 l pLight->Ambient.b *= 0.7f;
0 i5 H W5 L7 p+ I! q3 z" N }; n# p8 q5 J5 ^; o- o5 V
& j& G$ F# W* U7 U5 U3 X9 E4 T
#if __VER >= 15 // __BS_CHANGING_ENVIR
. S8 Z, M& ?1 R1 A3 J if( g_pPlayer )
" u& l$ L$ z3 E' Y* z HookUpdateLight( pLight );7 P- n9 I5 c) W, H3 O
#endif
2 Z- ^, _- ?7 B4 c' G4 j memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
- M. g* ~3 ?( E; s3 l) k3 o
5 V! [3 Y2 D* v( ~$ i pLight->Diffuse.r += 0.1f;# Y- r* g; T/ S9 ]- n7 w
pLight->Diffuse.g += 0.1f;
2 J& ?% R4 q! ]4 t( [( q pLight->Diffuse.b += 0.1f;
$ I; e3 U! b6 w# @ // oˉè* ??à? 7 ?' X2 T# G( c/ g5 M) E, ?
pLight->Specular.r = 2.0f;! h$ Z+ U) I# g( B
pLight->Specular.g = 2.0f;
0 d9 E$ b |' }- I4 d% q pLight->Specular.b = 2.0f;) P8 f1 S) |3 b- h9 D# X
// á?oˉ
7 t# J' G: \( m. t. a7 v pLight->Ambient.r *= 0.9f;, E0 w Q: ]; o# Q+ f1 F7 v" [" `
pLight->Ambient.g *= 0.9f;8 b/ }, d t$ y5 D# V
pLight->Ambient.b *= 0.9f;+ ]' |, T2 E, F
$ t4 D$ F y: V memcpy( &m_light, pLight, sizeof( m_light ) );9 T K+ F, `4 V6 J- c, r W
E2 @4 b F; k. Y pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z ); N4 M3 P0 p6 _/ U/ z
pLight->Appear( m_pd3dDevice, TRUE );
1 w; g' l: f' x" D + j; f- m9 O$ s# S
DWORD dwR, dwG, dwB;
3 B, _6 R4 L$ s) p* G0 l6 \+ b dwR = (DWORD)( pLight->Ambient.r * 255 );" ]/ l9 c/ b( O! j* [, B
dwG = (DWORD)( pLight->Ambient.g * 255 );$ S) }: s1 Z/ M+ ]4 f
dwB = (DWORD)( pLight->Ambient.b * 255 );
* L$ k& ^: W6 H; | dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );6 B* s' }7 w: {
}6 v+ H) P- p1 _0 s
}
. D. N. O! ]* ~! V2 x' P- H4 X% `: h else
: p# k* G0 _3 }' P/ B. q {8 { K5 M2 x- g; E
if( pLight )
: i, v8 O# o+ u9 J. X {& r( w3 b7 }! P2 c+ S3 ]
+ l2 C( H7 n% Y, m- d- c int nHour = 8, nMin = 0;9 B& e: O% [- x- X' k. g$ o K
#ifdef __CLIENT5 H4 }9 O) k) N) @
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
1 u0 C5 \7 `. j* ?$ F. E0 A nHour = g_GameTimer.m_nHour;
# @' V5 L( m3 {2 ?! _7 C* K nMin = g_GameTimer.m_nMin ;
, x5 o7 z6 r- V V+ \/ y #else i! C0 E+ P% e+ ^4 C
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
& x7 d1 Q* v+ C% ~$ f if( m_nLightType == 1 )
8 T. |2 G- R8 N) Y0 U2 `; c0 ^& B nHour = m_nLightHour;% S7 U& A5 u7 H+ s
#endif
- q3 r& f" d+ [. h/ V. v nHour--;, g8 x% z$ N- \& W
if( nHour < 0 ) nHour = 0;0 q! ^8 Z& l) A9 @, W+ Q
if( nHour > 23 ) nHour = 23;
+ D6 o0 T- T8 y' i$ ^# U0 g Y% S* e& G9 z4 u' A7 I
//if( m_bFixedHour ), z1 _* I! A/ O( ~# G
// nHour = m_nFixedHour, nMin = 0;* i8 i9 N7 ?) S$ ^0 }0 v
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
% [) n- S3 H! j( K+ O# f) F LIGHTCOLOR lightColor = m_k24Light[ nHour ];
1 N; B1 h7 P# `, j8 h: U
6 h8 z- _0 d; p& G //m_lightColor = lightColorPrv;5 U- g5 e/ t9 c; e0 Z$ y5 A
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
4 L c4 n5 {. j lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;9 a, O# j8 V! i# r$ C
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;( |/ a! ]+ u+ J {/ d! u7 q
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60; {+ b& Y' a' c$ H
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
) _; Z- w1 J2 T/ h lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
& j, G0 v: w1 d // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
! k( w: q8 w j R" m
7 `/ u. \4 w1 K- `- _" W2 V/ } // à??μ oˉè*
; P$ ~: s0 d0 S4 v pLight->Diffuse.r = lightColorPrv.r1;/ s" @# M: A( P1 u, ]
pLight->Diffuse.g = lightColorPrv.g1;
- `- ]' n8 R% N( I5 T% a, H K" r pLight->Diffuse.b = lightColorPrv.b1;4 K" }4 W5 N: r7 t% r9 n
// oˉè* ??à? * ~9 Z; I) H7 _# ]' I) k2 S- B
pLight->Specular.r = 1.0f;( p0 Z J9 J- i0 S" t- M" \
pLight->Specular.g = 1.0f;& d7 e" f/ ]9 T: [
pLight->Specular.b = 1.0f;
0 K+ L( b6 f! Y // àü?? oˉè* 4 |# x7 m5 P4 ]
pLight->Ambient.r = lightColorPrv.r2;' ]/ G$ ^( q, {) Q! s1 O0 d
pLight->Ambient.g = lightColorPrv.g2;
4 {, g- A. A& H3 {. h1 t pLight->Ambient.b = lightColorPrv.b2;9 D, y, R' m3 G& d2 |+ c z
9 l3 p3 F' I' l& d( ] if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
) q7 @+ @! L7 p9 c$ I2 e" { {1 R) M& T t2 w' h6 G' j1 d
pLight->Diffuse.r *= 0.6f;% R5 V3 A3 j+ U. r' U
pLight->Diffuse.g *= 0.6f;
[5 _: d K! j- Z pLight->Diffuse.b *= 0.6f;6 j8 F+ W- s2 s" C" r+ J Z2 p
pLight->Ambient.r *= 0.7f;& d0 f# n2 W e( ^
pLight->Ambient.g *= 0.7f;
5 O1 M9 c* v5 n pLight->Ambient.b *= 0.7f;( I `7 e, Z: ~& I- w
}4 y2 I- \' j. ]; \" D
! ~8 t+ X9 l$ M: W% {#if __VER >= 15 // __BS_CHANGING_ENVIR2 _4 w. x u1 A. a/ v
if( g_pPlayer )
1 b' u7 G' o5 p) D* X HookUpdateLight( pLight ); 2 E* h0 O& F* Z9 W! @ _# K$ F, U2 e' L% G
#endif. T- R' Z: t+ D" ~% w) K
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
: s( P I' d4 a0 i; Z Z3 q+ w$ m; }+ |# D1 b
#ifdef __YENV
8 r9 w/ j2 e0 [* |+ e5 h& e5 x pLight->Diffuse.r *= 1.1f;
. J' l8 o" e& E" ~9 i W pLight->Diffuse.g *= 1.1f;8 g" Q+ e7 j% W# i2 Q& P# b
pLight->Diffuse.b *= 1.1f;9 I7 m# @8 S+ U# a1 K% w' c! l
// oˉè* ??à? ' B8 x; U1 ?/ D7 r1 u4 w3 [$ W; ]
pLight->Specular.r = 2.0f;
/ [+ a z- ], b7 i pLight->Specular.g = 2.0f;5 P) }: e9 a% [
pLight->Specular.b = 2.0f;
# ^; s% n0 S1 _- U2 t: S. }+ u- Z l // á?oˉ 7 h2 ^. V0 s5 G4 o. d
pLight->Ambient.r *= 1.0f;
% ?- v; M( c4 v1 h pLight->Ambient.g *= 1.0f;7 w/ f9 M) b% x$ L/ q2 M2 V
pLight->Ambient.b *= 1.0f;
; H. R o3 h5 N- \+ l/ o- |#else //__YENV. j9 S1 a. X0 \
pLight->Diffuse.r *= 1.1f;
* u1 M8 w( l% E: y pLight->Diffuse.g *= 1.1f;
$ p6 A" o2 t/ V# X/ q; `! R( H& h4 n# K pLight->Diffuse.b *= 1.1f;% w2 s$ j, S- A0 z% N" T
// oˉè* ??à?
" h o% G! |5 k pLight->Specular.r = 2.0f;
" S( x: A0 \5 X5 j r5 m pLight->Specular.g = 2.0f;7 {) F/ C1 `/ @- k$ D; j, L6 S
pLight->Specular.b = 2.0f;
4 O0 V4 W. t$ `0 x: F" b# { // á?oˉ 9 r& g8 _. l& ?. P+ G4 E+ G6 _
pLight->Ambient.r *= 0.9f;2 B& L0 [4 F) S9 P( q' Y
pLight->Ambient.g *= 0.9f;
, L. N5 S+ U! A pLight->Ambient.b *= 0.9f;" i' N& Z R$ n& L# f& J0 x% C
#endif //__YENV
! n b1 T+ m8 V1 U0 K! b; S5 _/ r / @. A2 F6 X4 ~3 j q S! o
memcpy( &m_light, pLight, sizeof( m_light ) );
8 t! j" ~; c! V. l6 e8 l. \
0 M# x( M% N4 B* B D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);' M, u* C( s5 u I% A: {
D3DXMATRIX matTemp; O+ U5 w% A0 e6 s: |
static const float CONS_VAL = 3.1415926f / 180.f;
8 f0 t( P$ a* i; q$ n' G, [% l) Q5 y1 g
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
8 G4 @8 I2 l [2 ?0 t$ v3 p4 e D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);) r, Y- ~ y C3 a8 K
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); 9 T) k0 `, Z I, v2 D. v
pLight->Appear( m_pd3dDevice, TRUE );
) {+ j- d) f! @/ q: r. |0 b, ^2 b9 L7 _: C
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
, W, S2 E1 S9 C+ g // D3DXVec3Normalize(&(vecSun),&(vecSun));3 V z0 ]4 r6 ] m2 u
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); & M) F! J& W5 o4 ~( b9 d
( L8 X. k) J; f+ `- z0 j
DWORD dwR, dwG, dwB;
" T& Y1 _# N! `4 N dwR = (DWORD)( pLight->Ambient.r * 255 );+ Z8 Q& g+ w* Q1 A0 v
dwG = (DWORD)( pLight->Ambient.g * 255 );
/ }7 k" m, l4 q7 D5 `3 }0 \6 E7 H6 V dwB = (DWORD)( pLight->Ambient.b * 255 );# \& Q# d- D6 K. b: w" i- u
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
. r6 I. Y- I, s) e! j/ ?" w; p* h }
4 }6 e2 |! S: D, x7 ~ }) j# I( u' T! H: f7 f+ b) m
" D* Q2 ~6 }2 W) z% Y/ t m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );& o' `: I' M; i; d5 ] a( W
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) );
! p" N; O+ b8 d1 F ::SetLight( bLight );% S) u8 I0 e. V P8 x( h! I1 k
# f9 f, k& H! V: A/ c2 q
// ±ao? ?D?í???ó á¤à? : ^ E0 n' Y: B; I; W9 {; O
m_pd3dDevice->SetMaterial( &m_baseMaterial );/ Q2 h3 e0 J; |- n1 U- N. u
. U, [8 J: S, G' ~7 k9 C/ B. B#endif // not WORLDSERVER8 M/ q3 f4 |, U, j" h0 |, |# M
}% W8 u, T' B) f( a9 ~8 A% l: `
并更换; L9 ]) C& r. F! C
Code:
/ l! G2 O: S9 x5 c. ^6 i8 D- ~( h! b; W__FLYFF_INITPAGE_EXT7 i9 k6 \* X% u7 |
定义* h- { {! o9 R5 i R, k7 H1 z
5 u3 B/ E+ ~4 P% I1 k
1 { I, ^( Y2 i1 z: t/ Z* P* J8 p# z1 D( U6 q7 N- x4 K: m8 s
8 o! G* V$ k7 G) |, Z4 [现在终于删除我的狗屁加速...
4 z2 R& e9 U# u( _* r' P! _8 ^0 K; z& Z! \
6 B% p; V1 @% G7 }- a/ B" K9 \# d! \9 @7 D" a
|
|