|
|
食品车:' G8 e: J. E4 G& W$ Q
尾翼:
5 |* \3 a9 Z! k6 e8 s) Y8 }! T$ G
5 |8 X. [6 A7 L' F代码:5 z- r* u+ ~: l! v* H/ Y C6 T, o
CWndAutoFood::CWndAutoFood()& w, B5 m0 J/ h7 j4 s
{
1 C/ A5 A J" C- C m_pItemElem = NULL;5 J! v4 z. E4 h4 B4 N G; h
m_pTexture = NULL;
) F' T7 j# S& M7 i, Q# x, V bStart = FALSE;
4 A1 i' Q" Y) g. e3 D: H+ c}
9 _: P) V$ `* \
& Z: ~; {% B# a: hCWndAutoFood::~CWndAutoFood()
. t. s! @% ?5 V& x. H# E{. D1 L4 V! n M8 V
AfxMessageBox( "AutoFood ist gestorben " );7 g" D b/ D% U3 b& A _ `: X
}# v# ?% q( M/ \& w
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
/ ~7 v7 {6 ~" d% Z' x3 R0 R+ @{
7 w4 P. @# t# X" J. O4 w return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );4 i. |. V8 _' ~. Q* J( v" S+ K8 b
}8 V' }- v9 h7 c/ p1 b) u
6 R. H" O( X9 z2 a- }1 hBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
0 B( _8 D1 b/ R) n) n' U7 [{
$ @! f1 I* ~# }: n' K( j7 O LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
8 j6 v. K/ f U# O+ h! S CRect rect = pWndCtrl->rect;1 ?4 S$ X. m% V7 L6 K# y7 T
if( rect && rect.PtInRect( point ) ), I6 ` k& G: }: _8 i2 R
{4 d: w' c% o/ l; b. c! \
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );, T4 L* `! }& O
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )6 D, ] L$ I: e5 A
{
$ X- k H7 u7 D3 \0 G( F if( m_pItemElem )* y: S$ Z8 D( m3 u" H
{# P/ T; n4 p2 D) ?5 Q
m_pItemElem = NULL;/ Y1 j, _. j/ e) v& `
}& k( M _1 h+ w, z$ h, u8 N) ]0 ]7 E
m_pItemElem = pItemElem;
; x6 E7 d6 d6 {0 }# o; h m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );! c6 y7 Q4 ?: u* |0 a) R
}else{% i" X- [/ O% w- ~
SetForbid( TRUE );9 z$ `$ N& s& i9 G1 J
}
/ m( P& b+ S( T& I }else{5 B( @5 _) r, t
SetForbid( TRUE );+ n4 B/ Y3 U7 b* F
}
- r3 N1 A& V5 w' i# O1 H7 d( k return TRUE;
- m: |* `* K" R6 E}
; _7 o; Y2 G& V. n' V+ l. x% k; P
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
9 b" Q. W7 X7 r0 n& d: @: k1 I{8 ]) K. a& l' d6 C: J5 Z" K8 [, H
switch( nID )! R" X; F. I# Q# ~, }0 Z4 S1 r
{
" \3 B( G X, {' p1 q' s- P case WIDC_BUTTON3:2 s0 V" R2 _, i# p" y& }0 N2 b9 y
{
% Q7 @4 Q" o2 [+ d: u- H' Q bStart = TRUE;# z$ n3 j3 _/ R+ T; U
break;" @& C. v5 H2 q2 h9 N% c' e( w
}
7 H u6 B1 @& U; W" t" p case WIDC_BUTTON4:
* O7 ]1 s/ r' f$ ? {
# o; @- T; v& Q/ j0 T8 H bStart = FALSE;
% j8 v% @8 k" n, ? break;3 a7 @7 U$ U4 c# M1 b
}; I7 a* L$ W3 Q/ \( C+ s0 `
}
1 F& X% x# V) A) y& U; V return CWndNeuz::OnChildNotify( message, nID, pLResult );
2 E v5 z. _1 p( t8 ^}
5 T5 C' b& T7 z4 ^4 E" _5 z# uvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )
0 p I' D5 g4 r! R$ L{: T1 ^8 o, a6 a7 e$ v
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );3 i6 M5 X2 w2 x0 M
if( bStart || !m_pItemElem )
o6 ^' D; P* Q. z0 l) l {
: o5 {6 a: C2 c1 R3 p pBtn->EnableWindow( FALSE );
* O3 U! G; C' `# R+ ]" M }else
0 K- |7 p2 B. x ^7 b pBtn->EnableWindow( TRUE );6 r. }2 x0 W. S" {
if( m_pTexture )
9 G. ^# H n5 H- s/ D {# J6 y: q" g8 K+ v/ d+ S7 m( K9 D
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
6 j: `9 M+ k6 t% {; E, c if( wndCtrl && wndCtrl->rect )6 h! N. F6 f% f- Z7 U
{# t3 L W" D5 c3 K# k* H+ R
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
( i V9 N- w5 w- M }/ w9 Q/ b9 V& g+ I0 B" H: `: Y: ~
}3 r5 a* F; ?( W) n0 y( i; A% Q$ d
}
& E4 _, ]4 B/ f, Z" r9 F3 t- c1 i
BOOL CWndAutoFood: rocess()
& H, P1 W- _# a, Z4 a{
; V& v! x* \" L5 v if( bStart )
7 O5 K. h, e2 [& K* u1 J6 W {
4 {! @/ C/ y' v9 D, q if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
" {' ~- j0 e9 g! j( q# [/ ]; L {! I6 Q9 \& Y9 Z
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
# A: T) z3 C) l8 j* \& ?3 u5 ` g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );2 s; y" O. j7 x# P4 q
}else{
$ l* ?, E* d7 T1 ? bStart = FALSE;
* ^6 ^) g7 m C0 \' T m_pItemElem = NULL;3 _! F" b2 I& W' o9 y2 s! E2 P* Q0 b0 C
}( d' }3 ~3 v2 l6 Y
}
* z( W8 E6 Y; D, w return TRUE;
' s9 C5 J# L. y: M. |}8 y( ?0 p' j0 g/ ?# G: y
+ d5 k+ w% C/ |. Y
登录视频废话:+ b7 X- E; o* w# h* d2 {8 Y$ _4 b7 m
尾翼:6 [! K& w7 f) E: ]
! X) i' z% z1 |- q1 w9 P( X7 I
代码:- }1 Z3 q* n/ G+ Y
9 \' o+ K: ?5 ]void CWorld::SetLight( BOOL bLight )/ |: c8 f# j4 l, E! ~% V+ y) u
durch1 S1 ?& [8 l0 [0 H" I; {* p
Code:" H& A$ i/ [% b' S) ~ r& m' ]
void CWorld::SetLight( BOOL bLight )) Y" Q6 q; a0 t" r# n# I) T3 ]5 p
{( h E6 F! `4 r' {
//ACE("SetLight %d \n", bLight);
0 q6 `9 O. j- i7 m; R
) h' k+ J5 i$ @$ }3 ?, l#ifndef __WORLDSERVER
. H4 _" _) O* L9 e1 R( w& s+ M DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);( R; E. k5 N2 D: F3 A
CLight* pLight = NULL;
1 V7 b6 |$ ^8 {- J. m# W8 u8 [8 K# m) o5 z6 b- y
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );% W$ M- G8 E l# H
+ u K/ I( G4 v# h; M5 S
pLight = GetLight( "direction" );2 h6 ^5 D( C) u$ L: v% S- p
6 v, Q6 U( a- R) u#if __VER >= 15 // __BS_CHANGING_ENVIR% j9 U3 O7 E4 T9 J$ u# ?
if( g_pPlayer ){: J" C! D9 J5 V. V
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );6 e; d4 s& q0 T: t' p! k
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!4 K- }) h; I5 o7 x/ } u- v, s
{
) h) _& x! y' S( H/ E if( pLight )
6 t | m7 q9 a3 J2 f {
$ Q+ F1 Q) J9 ] pLight->Ambient.r = pInfo->_fAmbient[ 0 ];: p$ K, @( J5 J' m1 a3 N
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
0 `# [% e# z+ Q: y. [! i' H pLight->Ambient.b = pInfo->_fAmbient[ 2 ];6 }/ S. q! T( s9 p, ]' K6 \% E
; P, T5 F4 i. s1 N1 ~. u6 y
pLight->Specular.r = 2.0f;6 v6 ~4 m6 ]$ {
pLight->Specular.g = 2.0f;
% ?5 `) i8 S2 Y; U, p+ r pLight->Specular.b = 2.0f;
6 k. u3 V. M0 W. K6 D+ e/ ~
8 t' a8 k- @9 X A7 a$ h8 P pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];6 h6 j1 ?* t0 e6 p
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];' e) z# l8 c1 {
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
' D- l" N8 x( S+ l
2 L- _+ U" x) V: h" M! A HookUpdateLight( pLight );
4 o$ N$ P- N4 k3 T$ g: x5 w. C: J! F3 f K' D5 K; G% H
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );9 w7 Y( n/ ]9 l D0 p
]4 u2 ~$ g; G# w" L. O
pLight->Diffuse.r *= 1.2f;
5 W% ]: ]! w2 T. v/ ?% g pLight->Diffuse.g *= 1.2f;( D0 ]& s# W$ a9 U7 N
pLight->Diffuse.b *= 1.2f;
" O0 j$ s$ U9 J, y l% i9 E! S
. c% a' a5 }9 _+ z pLight->Ambient.r *= 0.8f;) l9 J- T1 ^$ ?$ U! Q
pLight->Ambient.g *= 0.8f;; ^/ P0 o4 g9 }! B
pLight->Ambient.b *= 0.8f;9 ]' z) O; a( m: _( C o* l
$ [5 U2 t* {5 e( Q2 h9 x% e memcpy( &m_light, pLight, sizeof( m_light ) );
" G4 w1 z7 Y7 V
5 R. o1 r$ j1 L' O% Q2 i6 p* p D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);# t: Z/ N' {; a$ B( ?
D3DXVec3Normalize(&(vecSun),&(vecSun));
$ x: v2 H; q* w# V" C& u9 n pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
) t9 E' x9 T9 g) {( F pLight->Appear( m_pd3dDevice, TRUE );8 o. k" R7 d [/ N% V/ S) e! r- I5 F
4 a0 _: R& U- w* Q G2 [* k
DWORD dwR, dwG, dwB;5 d# P6 c0 a+ A2 C. W
dwR = (DWORD)( pLight->Ambient.r * 255 );
- i+ u' H, R- O8 X' O, D2 T8 ^' C dwG = (DWORD)( pLight->Ambient.g * 255 );% q6 X3 T3 w* e- t2 c' [
dwB = (DWORD)( pLight->Ambient.b * 255 );
8 E& y- s' S6 g2 d5 y8 S, h dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
- w9 l' T8 \9 M% `0 ^+ e; ~ }; A- n+ n; R+ Z- P* R5 F+ e9 q$ h
}2 t D# }+ J. @% Y* y. q7 ]& K
}
& P# k$ b/ E& \# B2 N5 Z else
6 u/ I8 h9 |+ \1 m1 h' ]#endif
+ q1 [& Q, O9 P; d) j
- ?0 g6 g! A3 m if( m_bIsIndoor )
i1 k% n- I# V/ u, _; D$ u, Z- f1 R {
. _: H+ W% X& f; l5 l if( pLight )+ P: S# B; J% L( u" a
{ ! ]' S+ J7 B. j1 T; ?2 M
// à??μ oˉè* 8 L' d4 B. @) E3 c9 ?7 f
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;0 M, b4 f# N" R1 Q1 r+ Q
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
1 a% ^" a7 L9 U: o pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;! c+ [ `% q% @& ~6 @
) T3 I/ y/ K8 b$ h* F: i8 @; ^, _: N, m' r
// oˉè* ??à?
! G. q4 B* Y6 v4 W) J pLight->Specular.r = 1.0f;
) U u+ B( I; P$ f pLight->Specular.g = 1.0f;3 q/ _8 h2 d& `5 u. H, z2 S
pLight->Specular.b = 1.0f;
: M- T9 Y; Q6 E7 I // àü?? oˉè* 4 Q7 W& g( R+ A7 [5 I
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
: y& S/ E* M! H5 B' h8 Q% b pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;4 y1 d& ]$ F% J6 s
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;: R" U+ d5 n8 s5 o
. P+ I8 G. v1 O8 ] n( d
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
: w- v% c% B* [, }" ]; V$ X {5 x: D o9 `3 p+ _! b8 ?
pLight->Diffuse.r *= 0.6f;
2 g% a$ Y0 p; V# y( @ pLight->Diffuse.g *= 0.6f;0 I! E/ R9 Q$ O! Z3 H2 M" I: G! Y
pLight->Diffuse.b *= 0.6f;7 s; t/ p8 x+ h ^: c* Y
pLight->Ambient.r *= 0.7f;, k% k9 `/ _1 M% r T8 T8 _
pLight->Ambient.g *= 0.7f;
: C- G6 t4 E& I) v pLight->Ambient.b *= 0.7f;5 ~. z: A% I- u$ x/ n
}3 ~9 | R/ d9 x
7 q4 G" S$ V1 U/ a#if __VER >= 15 // __BS_CHANGING_ENVIR& v! r/ C( W/ E0 M3 F, E
if( g_pPlayer )- J- f+ k0 M! t- Q5 }
HookUpdateLight( pLight );
* q a" N( ]' w ^; r2 r#endif% Q4 L9 }. ?; X) ], K7 ~2 R
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );# x& n) ]' f" F0 _( B, N9 T4 U
) f& z; L9 C: h" U4 m pLight->Diffuse.r += 0.1f;
& b* o% ]" m4 |6 A' b pLight->Diffuse.g += 0.1f;* q) k; H" I2 v2 ^! }
pLight->Diffuse.b += 0.1f;: ^1 u: h" W" E: G: v
// oˉè* ??à?
( G, w1 C$ c: j pLight->Specular.r = 2.0f;
9 K L* P6 s& ~6 t pLight->Specular.g = 2.0f;9 j. _3 J7 v) X
pLight->Specular.b = 2.0f;: m% ^: ^, [" b$ d$ v
// á?oˉ
' W6 ^) \) C b0 t( T pLight->Ambient.r *= 0.9f;. T9 A& ]( `% k8 `- H& [
pLight->Ambient.g *= 0.9f;
" D y" b& C! o J$ r pLight->Ambient.b *= 0.9f;
5 C2 E S$ w# [0 s1 B/ {! K! l" ]6 w
memcpy( &m_light, pLight, sizeof( m_light ) );7 ~: t4 \8 U) E$ Z$ d) @& V: ~
9 c, ]2 x9 Q# g" Z+ J
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
/ A% y/ U7 x, u; h: m3 c8 z pLight->Appear( m_pd3dDevice, TRUE ); I7 V# b" ]' w# o" ~# z9 l: R2 ^
0 w! c* e8 n# E: L! K: n$ H, ]
DWORD dwR, dwG, dwB;
& O. R- m# I* J. {! m" S* @ dwR = (DWORD)( pLight->Ambient.r * 255 );' S# c+ g' k' B, } U1 G" O
dwG = (DWORD)( pLight->Ambient.g * 255 );
0 l1 [4 A, S0 C* T( k9 _; ^ dwB = (DWORD)( pLight->Ambient.b * 255 );: k! Z0 r: Y- u5 V. S3 O. A
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
6 U4 x) B# [. S, W9 ?+ D3 N }4 \* m+ r$ Y3 c/ e4 R
}) J! F$ E% [ p; w3 M/ F3 i
else+ K; [- [5 d D' x# m! B i
{
$ u! o& j/ l ` if( pLight ), W$ f) C0 R. v& [: w0 u
{) N( |$ C& y( s R9 w9 d
1 A3 L( Z2 z! H6 D, |3 Q% M
int nHour = 8, nMin = 0;
5 U& |2 y! ?$ h: ^! \2 Z7 g9 { #ifdef __CLIENT
7 |! j# H) j7 @, I, C- e3 E // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. 1 d8 e* Q" O) d9 N3 S5 Q' C
nHour = g_GameTimer.m_nHour;
4 p, B- Y: ]7 k# i1 Z nMin = g_GameTimer.m_nMin ;0 H& H# w6 _5 E7 {$ l% q
#else
) X8 B9 n$ u- o. x1 m // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.1 ]) ]: n4 i0 Z1 ?" M
if( m_nLightType == 1 ) S- _3 w# c8 y: Q7 @ C P
nHour = m_nLightHour;% l' N$ a3 o2 Y
#endif
; }! ~' `* y- f1 N+ P. l nHour--;
% r) @. Z& ?2 z- p if( nHour < 0 ) nHour = 0;- g2 v8 Z( _' A
if( nHour > 23 ) nHour = 23;
4 y, `( v6 I5 p0 ~
; u8 w4 e( B) f2 ^8 b: ^ //if( m_bFixedHour )
* j6 P# B& X) Y& Q3 y) w# i0 T // nHour = m_nFixedHour, nMin = 0;% g& R6 b' ?+ F) _' z+ T$ q
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];2 k* k+ P3 o1 E( Y$ U
LIGHTCOLOR lightColor = m_k24Light[ nHour ];9 q1 B# U5 ]! E4 K# A/ s) v
1 H5 r. @; J, v
//m_lightColor = lightColorPrv;, Y, l5 o1 B" I9 k A4 I
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;: R- I# u, P0 a0 N$ H$ p6 \
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;! Y8 _! A, t% e
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
( h! | }/ g c1 } lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;/ w. a" s6 d9 T2 V
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;5 ?2 y( j5 V- \
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
; V) \& j: B- H* I. H6 U, ? // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)! h9 k+ y, I' i/ U) P& U
( I" L) ^( i- |8 w- {2 D& V
// à??μ oˉè*
, u& G' ]$ {: H* ]7 ^0 ? pLight->Diffuse.r = lightColorPrv.r1;6 L# X) l, O( i6 A
pLight->Diffuse.g = lightColorPrv.g1;" R3 ^( x1 x9 B; A
pLight->Diffuse.b = lightColorPrv.b1;
# ^2 B7 f% ~5 e5 [3 C // oˉè* ??à? * f/ g( u t) b& m9 o+ N
pLight->Specular.r = 1.0f;' f& P1 ~' z3 G1 o. @6 j5 c
pLight->Specular.g = 1.0f;
) P" \* {* X; Y( T$ H1 d pLight->Specular.b = 1.0f; x) S9 d+ [1 M T: d) J/ }( N
// àü?? oˉè*
7 y6 J- j; D7 X! W pLight->Ambient.r = lightColorPrv.r2;7 Y% y( p" Q# t# c' M8 f
pLight->Ambient.g = lightColorPrv.g2;1 b' @9 m# P) ?
pLight->Ambient.b = lightColorPrv.b2;) u# w. [3 f* N1 \
$ f9 i7 q: t6 W; M C: h% ~* _! ^ if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
) A& M5 g) r% O7 W {
# `. f- A8 P( h: P( z/ M4 v pLight->Diffuse.r *= 0.6f;
! q# c; l7 V0 v3 f% R6 t9 b+ H pLight->Diffuse.g *= 0.6f;
6 m/ s6 e. J% i; Q pLight->Diffuse.b *= 0.6f;
& o' P2 b4 l v9 Q2 C* N) R pLight->Ambient.r *= 0.7f;" K3 } K7 Z* |6 G4 D+ w* i9 P
pLight->Ambient.g *= 0.7f;
4 Z, z9 j3 ^/ V/ c. H q pLight->Ambient.b *= 0.7f;+ Z& P: n% b1 r! `0 m( M3 `
}
# p1 q: b) E- L6 y - o, c# _( _1 ]. Q. c
#if __VER >= 15 // __BS_CHANGING_ENVIR d6 P) Q8 u: |# p7 O Q6 H! T" I
if( g_pPlayer )+ w0 Z4 u, {' B# h; ]
HookUpdateLight( pLight ); 8 \( g( }! v" ]/ @4 y4 T
#endif" |& u$ V4 O. i, i
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
0 d: n5 T& X1 F% C t9 g* f3 O* p) w0 T- g: N
#ifdef __YENV
) Y; y7 L" U* W+ G4 F pLight->Diffuse.r *= 1.1f;
{( M, s3 i# ?1 e! o pLight->Diffuse.g *= 1.1f;2 @3 ~- {9 n0 a8 u; m8 D: ^
pLight->Diffuse.b *= 1.1f;7 o+ M" l9 Q4 j% [
// oˉè* ??à? 5 f$ d) Z0 d. F5 U
pLight->Specular.r = 2.0f;
$ [9 M/ b8 _ u5 r3 D9 s3 P3 Q" Q' M pLight->Specular.g = 2.0f;
5 q/ g+ B$ X1 m1 K. @9 t2 a! P) S+ N pLight->Specular.b = 2.0f;
' s6 F/ {2 @' L7 ^7 N // á?oˉ ! |' L) L$ a/ ^3 D6 X
pLight->Ambient.r *= 1.0f;
' s* x& L, |+ J/ i$ T1 B( [1 j pLight->Ambient.g *= 1.0f;
8 u/ O, t& \3 \- n4 o, q! [/ y pLight->Ambient.b *= 1.0f;) K& s! t, u& M2 [
#else //__YENV
( K* r, b2 A- x4 |$ U4 ? pLight->Diffuse.r *= 1.1f;
9 \! j! P: l6 i; ]; X pLight->Diffuse.g *= 1.1f;
+ ?, R' P3 q9 Q& B) o! d pLight->Diffuse.b *= 1.1f;
) k% F. K, x' C" o* L% q+ J9 M // oˉè* ??à? 6 W9 ^" F- l6 K3 ?! L! H# G
pLight->Specular.r = 2.0f;
1 x3 B- }0 O7 W pLight->Specular.g = 2.0f;8 v$ W( V. _1 T o8 p. Y& f7 W( c
pLight->Specular.b = 2.0f;
" E& [6 j0 i: {0 j: s // á?oˉ 9 P5 w! d4 t2 ], g* O% l* O
pLight->Ambient.r *= 0.9f;
- S/ j* Q* C# K0 ^0 |/ p pLight->Ambient.g *= 0.9f;0 |# ?1 g, q5 d5 p
pLight->Ambient.b *= 0.9f;
2 h) H: ? \! A# Z8 F4 h% x#endif //__YENV 9 |3 i: o' w$ D
$ q0 P- ^) }0 r1 q3 q. J9 Z5 |- ^" o/ ?5 F
memcpy( &m_light, pLight, sizeof( m_light ) );! Y2 o" w% Q4 u" B. N
, P/ w0 m; ^" E! q5 B
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
+ A+ |& a6 K' b+ Q D3DXMATRIX matTemp;
$ h9 b$ E" g+ r- x1 I5 _- ^ static const float CONS_VAL = 3.1415926f / 180.f;
1 y O8 T' a/ _$ i/ ?! _% ^5 {# s. C8 D$ r( e
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
& M+ ~8 S7 ]( n0 B) O D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);# ?; _7 z4 t o& {, Z
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); ' V! P+ B: C" ^; u h$ }6 b5 e
pLight->Appear( m_pd3dDevice, TRUE );
( S4 b! H1 E8 g5 n" g7 A: {( v( H! M! l2 _
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);* ]& s0 h# |) w4 [+ c, t+ C
// D3DXVec3Normalize(&(vecSun),&(vecSun));
: A% |2 c0 i7 x1 x0 O // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
9 ]% D2 o0 k# H. \' F! ]
8 {$ u) V5 X7 f) M7 H' T! g DWORD dwR, dwG, dwB;: Z2 S0 O7 b: T7 J/ O0 x! Q
dwR = (DWORD)( pLight->Ambient.r * 255 );4 X# R0 e# O2 L+ H" \; I7 s* ]
dwG = (DWORD)( pLight->Ambient.g * 255 );! ^, [2 ?& }$ {2 D7 N3 c
dwB = (DWORD)( pLight->Ambient.b * 255 );
; z2 W4 b' l2 A) Q& _1 }8 [ dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
& Z2 X3 C. `# x. d) V v }
" s9 x1 u0 n* `9 a! ^( u; x: d* a }
& _4 b4 P. F" c( D# v7 s& R3 X$ P: e6 S
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
9 [" S+ E+ n: g9 K' _8 u 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) );
( G4 [1 x+ S! t3 J+ U Q4 B% q3 |9 O ::SetLight( bLight );
; {6 J. H7 n) V% v9 r
4 b! P) L- e, X1 c // ±ao? ?D?í???ó á¤à? + \% m- Y+ t; Y7 G- [9 A$ |& ]
m_pd3dDevice->SetMaterial( &m_baseMaterial );
: O& j( }- D4 ? 3 j$ a! O: N0 ?! j# C( r" ^
#endif // not WORLDSERVER3 o1 d4 H2 a% [9 q" v
}
- J3 T: ]( H; U- Z N$ i5 {并更换
3 `! J! J4 u" I& eCode:' P8 M' V1 ^1 ~
__FLYFF_INITPAGE_EXT( d+ G- n0 N) J2 J! d$ G
定义* u: x- j9 S- K$ Z
1 Z# z9 p' O- g6 Y: V3 Z
! p& G+ D9 y0 j9 z4 r4 u8 D
u! M3 z' g5 ~% d9 ~, I* v! x- K$ A) R' @! s8 h% V, c! e
现在终于删除我的狗屁加速...& u) |9 w0 z/ U+ w& @
+ Z$ s3 a7 ^, N4 I" H0 j' ], j* M% ^
" ?: S8 s0 x7 b' i6 B' `+ p% I1 @ |
|