|
食品车:
/ y0 x9 b0 n3 z2 T6 Z尾翼:: ~; t) R$ ^2 X! s
! a8 n8 [1 w7 i0 F' Z
代码:
: n7 I7 a9 j5 E8 oCWndAutoFood::CWndAutoFood()# l% h9 n9 ^: l& A9 q" E
{
3 s; t, E+ L; O8 L9 a m_pItemElem = NULL;% A( A; H$ L" X
m_pTexture = NULL;( o7 Y" h) W! y/ f+ d
bStart = FALSE;
5 {/ B& F8 |! ?. m$ b9 M}
2 G2 Q: g# [: e! V6 g9 c4 S; B7 q) L+ x6 X3 B! e
CWndAutoFood::~CWndAutoFood()
) K0 F, [' D: H5 n t) B' n0 F{
# q+ P0 W7 D7 L9 q x" z( ] AfxMessageBox( "AutoFood ist gestorben " );
# G6 w' P z4 v( o e) U}
( w2 l& H" t& f! IBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )1 Q$ Z. l# K% r) L" k! D% I
{
) Z2 ?- {. e+ b9 } k return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );1 Z4 {, C6 s- a* Q
}- O( ?, L! m5 N; F
8 E% w o' Z6 J; x0 H! H9 Q8 D+ M
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point ) R# w @4 M: j* I
{) b9 K. w( @% h/ S$ T! ~- R( j( X
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );; c6 l3 h0 |: L8 L& S% f: O, M
CRect rect = pWndCtrl->rect;
: ]% M4 ?" p2 R; S) p; F' i if( rect && rect.PtInRect( point ) )
3 y( s" e+ a# \! J- J' b$ S {( h. m4 c" T% v; A0 h2 `
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );4 ^7 d, h a+ o1 I
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD ), |" B- r' p/ l$ E3 r9 r3 p
{
6 G+ `; R2 L: D! h' `+ j if( m_pItemElem )& @( f7 E9 S: H8 ]$ N/ K# ?; y
{% y- }1 ~; f: |, \% o
m_pItemElem = NULL;
9 @4 g5 T! Y! ~& @ H }4 u, P$ E+ Z- L' K0 P( Y# O
m_pItemElem = pItemElem;9 o: X" v: g3 [2 P; Y0 ]# t' \
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );7 R# U6 L# ^4 X; G
}else{
+ K. X$ Y8 g( x2 L" B SetForbid( TRUE );. Q) O8 V7 _3 Z, o+ S' m: D
}! ]8 T2 R3 @, f) `& N
}else{# C. P; _2 w( R- u1 {- L1 E
SetForbid( TRUE );
6 g5 o7 H$ Q/ j ] }5 p) c8 X% A/ \# s, ^9 v4 F
return TRUE;
9 r8 {* S7 F0 D) E5 c. w}
2 E( t1 O3 f- D
; l7 o, F1 {: Z7 S+ y/ QBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
8 |. c5 f3 j, j{
( z% j* [) D3 L4 r# k8 N. i switch( nID )
7 G6 N" R2 Z% H% c& z" b { ]; `+ ?# s" ]/ e/ b" W- O# A
case WIDC_BUTTON3:
; |" p4 c+ _( b2 k8 o& d( v# \% Y {
* ~ O! r8 L8 D$ r$ e3 S bStart = TRUE;2 G' i$ ]! Q6 |1 s' a5 |: x: }
break;
# w f' p* S- a$ m' m }) f9 E9 }: J& r* r c: B# ?
case WIDC_BUTTON4:
* c4 r6 n* X4 [2 g {
, s( H# d$ B [, u% X6 w) m bStart = FALSE;
+ S- b& g, q0 P {4 o+ A' V2 [/ I1 d break;
( [+ s8 ~! e" p7 @% `& J2 N0 g }( d" z1 ]* o, T) ?
}
4 q0 K7 H, }. O9 T- O return CWndNeuz::OnChildNotify( message, nID, pLResult );- m! _. T& u1 H) x" v
} - h% ] k3 [4 n) v: K+ \
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
: R* e/ M" m" x) e' P: K' h! d{1 G* ?! `5 d2 u+ ~: t4 F: }2 f# V5 @
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );" Q/ V1 x. P8 c# g
if( bStart || !m_pItemElem )
$ j8 t, H. P/ k {" g+ L( |4 |; F/ Q
pBtn->EnableWindow( FALSE );' v% n7 u3 V4 E5 G3 l3 a* O
}else# n+ N8 ` X( Y _! d8 T# \7 W) |/ X
pBtn->EnableWindow( TRUE );
: m3 y7 R) U2 ?2 L: h if( m_pTexture )
- ~, b: Q: U! v* a7 f {6 R0 A3 s8 S% x2 U9 E4 [
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
! d+ l! j# Z/ G2 y if( wndCtrl && wndCtrl->rect ). x" Z0 g) l2 ?$ U0 V
{( T- P/ Y& i; H
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );8 x0 [; G. ^- P* m
}
. x w9 c+ \% g2 | }: H9 G6 y: {7 _6 P
}# n9 n+ X% l+ q0 l# o ^
6 ? U$ \8 n% {" yBOOL CWndAutoFood:rocess() R5 P0 i- T- J
{
* Q* l- |8 x5 r% N if( bStart )
6 q s3 _# N7 F( d# C' o- Q {
9 }% Y- L) l9 J! h% f if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 ) k" B! g3 V8 S/ n
{
3 c3 s' { K$ m' a0 u8 ?, z3 [$ j if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )) U4 F; R' K8 F2 O
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts ); O/ s$ U! B7 @) P' y
}else{
6 G: ~+ v1 E' B; h6 j bStart = FALSE;
# Q; K% p" o7 x' }1 j0 v m_pItemElem = NULL;
: |0 U* _) ?9 h& M7 m+ _/ i }) c4 l4 a1 |" A( @3 _
}
. s/ H% D4 \; i% N return TRUE;5 G4 w B; \# [' K; u
}- b4 q2 B" J$ J+ {1 | j
* _) `. C) {/ O* g: I) k登录视频废话:
5 K+ R" N1 x0 ]7 A; Y9 f9 _: f尾翼:
. u4 \) W7 ]6 g& h+ j7 e8 a, m0 b3 V1 |. G" A) l/ w
代码:
1 m2 t( m8 G! w! V7 @ v( ?& n3 J0 k; |
void CWorld::SetLight( BOOL bLight )& a# H- R! L8 w3 c
durch" Z6 d' o' c; x! ]
Code:' R- u1 [( ], d) Q8 C
void CWorld::SetLight( BOOL bLight )5 g* p' R2 Y# R# D O w; E
{
1 v; t& C: W. K //ACE("SetLight %d \n", bLight);& u& j. V( d8 }3 I% v c" |2 F
5 [& y/ M$ o% V* L: o/ N& D8 ?% p$ {/ f#ifndef __WORLDSERVER 6 B9 _( @$ J1 r5 J3 u
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
/ U& L$ ?* o+ R3 F2 ^ CLight* pLight = NULL;
! K) C+ ]- f1 d L; ?7 E$ D
( O( S6 V* H8 S2 `3 f. C, s D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
! K1 j6 t4 Z* H8 p; t% M ^. D/ i2 w2 U7 |9 i Q
pLight = GetLight( "direction" );5 ^8 A! |3 R8 s* E; A; l+ _7 M
\6 D4 O- n6 R- E- F, j#if __VER >= 15 // __BS_CHANGING_ENVIR
* F% O1 D; V C) B, u! e8 T if( g_pPlayer ){! t4 {2 z* A, y( u
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );6 M! {; }* f [5 h9 e5 m3 A8 v8 q' p3 p
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!8 W Z7 O1 J! x3 ]" n; z. X" C5 ]: q
{
% D7 R u! z p4 U if( pLight )
& t" I# l- Q# x, A5 E- l {: c5 l- i% U- O
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
4 P) w0 k8 w8 W' ^# T/ `& l5 M pLight->Ambient.g = pInfo->_fAmbient[ 1 ];0 e l w( ^$ F! R0 m3 ~ G
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];5 O; v) l& t' k
7 Q* S d0 f9 k( B6 a# S3 x! M) w pLight->Specular.r = 2.0f;
+ a8 X _6 }) a# o6 H pLight->Specular.g = 2.0f;
5 w( }) `7 n8 d' F8 _ pLight->Specular.b = 2.0f;
0 j" f4 n; ?2 @* t5 F * ~- }2 }; m- V2 a( w$ j
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
! }* K8 k7 f6 Q% l pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];, @. x( J+ H( P0 D' u
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];& ~# W1 t/ U+ |& A$ T @
; B: z! [5 L3 R2 |1 t3 D0 b
HookUpdateLight( pLight );
( p5 F' {1 l9 c( O) c5 n. J# q
' a8 i2 E$ Z( b memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
) p- G8 t1 j7 L$ A 8 b9 Y* @9 w Q1 G/ O& [
pLight->Diffuse.r *= 1.2f;+ j( f( Z4 w3 Y9 C2 \( p3 F, M% V
pLight->Diffuse.g *= 1.2f;
1 ^ O0 w; }9 u% y/ d pLight->Diffuse.b *= 1.2f;" E* y$ y- R. }% S
4 D- `# X" o7 N/ o+ i) a# G
pLight->Ambient.r *= 0.8f;
9 Q8 s+ ?1 I! S9 k0 d/ H, T pLight->Ambient.g *= 0.8f;/ S' B( T+ s% ]& Q$ l8 w
pLight->Ambient.b *= 0.8f;
( Q' D& r, l1 f6 } - b7 j7 j8 I5 o; n( V! o( u
memcpy( &m_light, pLight, sizeof( m_light ) );1 \( a2 y7 m& d1 y& }: V
2 `( B2 B4 U3 e6 ?( h/ Z
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
@ i4 m/ `6 f$ \ D3DXVec3Normalize(&(vecSun),&(vecSun));& e7 C- Y# a5 x- T
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 4 s: A3 i0 g5 |# A
pLight->Appear( m_pd3dDevice, TRUE );
& r: B* I# _4 @9 B. @1 |! Q # X/ V: O. c6 w
DWORD dwR, dwG, dwB;- `; x7 J4 [) h) S6 r3 j& a! z
dwR = (DWORD)( pLight->Ambient.r * 255 );/ o; H1 K5 y2 f6 p/ ?9 x: w
dwG = (DWORD)( pLight->Ambient.g * 255 );
: E/ e5 [( ^, R9 q; M3 h dwB = (DWORD)( pLight->Ambient.b * 255 );, X+ |- U6 P! l' }7 `6 C
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
! s) p2 Z" E5 v* X& d5 j }& g9 t* V" Z9 X3 B- {
}
7 p" w3 L; I: o2 I9 v2 v; H( g }
) |- f# o0 W' g1 @ else
$ j6 j3 A) k+ Z* I3 p#endif
/ K/ i8 ^& P2 T6 k; X4 w+ @: c
8 e# X" N' [! Z: `" M if( m_bIsIndoor )
$ |- P' n7 x v3 ^; f7 [9 N {
4 L9 M0 O* R; t5 l if( pLight ) x" V2 @' l) H; W/ N
{
7 w+ P! P5 I5 V; s8 S5 @ // à??μ oˉè*
4 P5 `; q' Z) O7 q pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
/ B! A9 ^* s7 q* l pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
9 E& o. N3 Z/ Z+ b: e1 V pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
+ D0 o# A0 p* H) f$ `' ]1 M% M; O" T# z. R) ~5 h
// oˉè* ??à?
% i. f$ U! H8 b* e pLight->Specular.r = 1.0f;' G: x; Q* T! q% M8 D+ g. ]% C& n9 e
pLight->Specular.g = 1.0f;$ S; p) m' ]% W5 l* p" j# t
pLight->Specular.b = 1.0f;
' |2 E6 f6 c9 c& ?* z // àü?? oˉè*
8 i2 n5 B' i) L, f% j) [ pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
* C3 D2 d& K+ ^* X3 x" p pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;0 z* Z( w, F6 C4 ^
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
' z& F/ W0 ?: ?7 C- q8 w
) z7 k- M3 m% e5 N4 N: d, p& u if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.4 A" v1 u# g- k T* D2 O" }
{( B' |" o! `; F3 d
pLight->Diffuse.r *= 0.6f;6 `! y; Z2 _& A
pLight->Diffuse.g *= 0.6f;! w- @" h' }4 w, p! k X
pLight->Diffuse.b *= 0.6f;
- D0 ^* d0 I9 D. N7 u3 s pLight->Ambient.r *= 0.7f;
) Y6 E; `2 _4 @- y pLight->Ambient.g *= 0.7f;
: V" t( u& A; e. y7 p% |: q pLight->Ambient.b *= 0.7f;6 G% T& l" U6 u6 h/ `
}" {9 y2 }. H9 \% @: b; x; T8 z
: @% ]; |5 E$ a- r* |#if __VER >= 15 // __BS_CHANGING_ENVIR
0 Z! q. T/ Y: k8 `7 v+ {0 A if( g_pPlayer )
' {/ [5 b- k" L6 Q w HookUpdateLight( pLight );7 D6 v3 q" _) c6 E% I& g6 D' C5 G3 f
#endif
. d9 _! `5 n4 b% V$ E memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );& g9 V2 s( |4 a" D& M# o
& ?( e. o T; F# F2 D
pLight->Diffuse.r += 0.1f;1 Q2 U5 v) Z' C" t/ N
pLight->Diffuse.g += 0.1f;9 I5 e6 `0 Q3 n1 f& R
pLight->Diffuse.b += 0.1f;/ }7 \# d& u3 |0 G7 L
// oˉè* ??à? . C0 b$ d/ j. G- u
pLight->Specular.r = 2.0f;
( W" M' f9 y- M% s; t8 e pLight->Specular.g = 2.0f;
: T. q+ I& x, u7 G7 {9 ~* G pLight->Specular.b = 2.0f;) f! @/ s% K! g* M, Z( ?4 B
// á?oˉ
1 t8 s K$ z" u( u( Y1 V! c: o pLight->Ambient.r *= 0.9f;
, _$ X3 @ i) K4 }5 \ pLight->Ambient.g *= 0.9f;
- o* {2 U6 k( Z) N1 [) ] pLight->Ambient.b *= 0.9f;) D2 w1 l6 Z* I. b% |5 y
) B9 c5 L4 M6 d, H6 w
memcpy( &m_light, pLight, sizeof( m_light ) );
& c& w% J( N0 ]
" I4 ^ J# s# P$ N4 M: n pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );$ Q; x) d6 n1 A/ ]/ ~; E
pLight->Appear( m_pd3dDevice, TRUE );
) e% Q# ~: l, t# V! F. h( y 2 [- g9 t8 N( y6 G
DWORD dwR, dwG, dwB;
- r9 b2 z/ r0 Q' l9 n7 v dwR = (DWORD)( pLight->Ambient.r * 255 );
* k \# Z+ N: X- `; c dwG = (DWORD)( pLight->Ambient.g * 255 );
% h: s# ?$ x7 |/ U5 c3 e dwB = (DWORD)( pLight->Ambient.b * 255 );$ f* S" I" {$ G+ Y( \# m. `
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );1 a5 D. p& r) S% c! q! i
}
. u- |9 G/ N1 N }
% ]% `. T% C7 H5 v, I' n3 S else
& k8 M* A3 U1 N {2 {2 n1 O2 Y6 K3 j
if( pLight ) r6 G a7 ?7 o
{# V( N E5 Y, F# p
0 ?$ I& Y" o4 H9 y8 e5 M% N
int nHour = 8, nMin = 0;
" N) u7 X+ ~( ]) K* c/ f% ^ #ifdef __CLIENT
: B0 D3 G/ Z& C& H' q/ g; A // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. ) z9 K+ Q0 P0 F
nHour = g_GameTimer.m_nHour;* P# Y5 n: S0 L& b7 k
nMin = g_GameTimer.m_nMin ;
, c! n4 Q4 W% }2 | #else; `3 ~" p: F" J- A
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.' F- v: L' s3 e1 W. ^* I+ H
if( m_nLightType == 1 )
$ b& ]/ M: h* l nHour = m_nLightHour;4 g0 y# _+ b1 ]! D" ~, n# E
#endif: x5 T$ z) U! j) I
nHour--;
1 c9 e0 w" I% ]8 K, d$ d if( nHour < 0 ) nHour = 0;0 T0 r) P' d9 I; O; T9 ^
if( nHour > 23 ) nHour = 23;
$ h8 n$ _7 q; H7 T6 l2 k. W% C! j0 K$ s3 ?& o' @
//if( m_bFixedHour )
9 T& _# a6 b. C2 d // nHour = m_nFixedHour, nMin = 0;
5 {$ Z; I2 G2 O" F+ ? LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];& H6 h' b3 N5 O* t6 z9 U @2 Q' {: T
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
2 h" s6 }. S' k j: e& H6 @
2 j: l, H) z! u I' `' h A //m_lightColor = lightColorPrv;$ o' H( [! q% ~3 _" t8 L0 i: a
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
- ]! U3 b7 ^4 E+ K7 |5 t6 j1 H lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;+ F; w: v2 f+ r3 j) Q. o, H- |- ^
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;! T/ Z1 H" E& Y* c0 K
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;8 {1 P4 G P) Y9 F% [5 H
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;6 d/ p6 m1 G5 S2 s0 [& g0 m
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;" I8 Q- c. a1 t& p$ \+ ]3 r
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
3 |+ ?* M7 X6 [7 Q5 b5 H
; z# g+ u9 K1 t' x1 U$ h( q // à??μ oˉè*
2 k8 {# w4 D6 x5 o) k5 Q& o3 g* D! v pLight->Diffuse.r = lightColorPrv.r1;5 Y' c$ ]6 w+ i: D& A, r. {. f% \1 k
pLight->Diffuse.g = lightColorPrv.g1;
3 @/ ^5 o! {0 x6 r! }+ j pLight->Diffuse.b = lightColorPrv.b1;! S/ A) ~1 A" `# }
// oˉè* ??à? $ k6 Z( ]& W' E$ f
pLight->Specular.r = 1.0f;) e K6 \0 i; r4 W$ D
pLight->Specular.g = 1.0f; S' K/ x r0 ~& x i
pLight->Specular.b = 1.0f;
: B& b5 [& y" {6 M$ ]. Q$ _( ^ // àü?? oˉè* $ e- Z9 ?2 u6 o+ {# g+ b
pLight->Ambient.r = lightColorPrv.r2;; [$ w. i% g$ E
pLight->Ambient.g = lightColorPrv.g2;
" o; w' ~9 F( M6 b# r pLight->Ambient.b = lightColorPrv.b2;: l; _! d. S. o1 ?
/ y- n5 x4 V: _ q if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
5 d" {" c. j `$ D+ G J4 j a {$ w: h# D5 \, x# K
pLight->Diffuse.r *= 0.6f;
i9 ?2 S( A* F X) N7 \7 K" M pLight->Diffuse.g *= 0.6f;
# `: x) y5 O% L3 ^ pLight->Diffuse.b *= 0.6f;
) w, |& z/ q6 Z7 x7 [! E) Q pLight->Ambient.r *= 0.7f;
. \0 G; ^$ M' G; ^7 u5 B pLight->Ambient.g *= 0.7f;
8 y2 A+ c" B, \; d pLight->Ambient.b *= 0.7f;
0 v8 i3 r* {0 U8 A0 s, R8 g }
# Z5 D3 V& `5 V" U# g * ~1 D: q9 t% @5 |: c
#if __VER >= 15 // __BS_CHANGING_ENVIR7 L4 ?: `$ \# J$ W+ R1 \/ _! o
if( g_pPlayer )* U7 j" { D3 D+ W& h. D$ w
HookUpdateLight( pLight ); 7 V+ ~+ s* K0 L
#endif% x0 }7 }* v+ A2 P7 C
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
6 Q4 y$ B3 B1 ~. C2 C6 T! V( p1 O/ s: g& L) h" U- y
#ifdef __YENV! f' f0 M* B& o; i
pLight->Diffuse.r *= 1.1f;
9 y& f2 y8 ~" Y. E: I pLight->Diffuse.g *= 1.1f;
2 W. [4 p3 K( Q$ L/ } pLight->Diffuse.b *= 1.1f;
9 T( ?6 V9 H) R( k W l // oˉè* ??à?
3 Z( B: g, b- _ pLight->Specular.r = 2.0f;& ]/ J, I. H0 V3 G+ [4 O
pLight->Specular.g = 2.0f;( ]: D: m1 W# f/ I2 G; M* f) q
pLight->Specular.b = 2.0f;
; m+ F: C2 ?: [. b9 A) B // á?oˉ 5 M& |; j" D1 n! o# J
pLight->Ambient.r *= 1.0f;& ?+ M8 ?+ s+ Q" n5 N
pLight->Ambient.g *= 1.0f;; z7 l9 D* f0 ?, f1 {; p
pLight->Ambient.b *= 1.0f;
2 e' y# M- W/ S#else //__YENV
6 O7 L& j: I. j, V5 Z- d pLight->Diffuse.r *= 1.1f;
e0 T& v o* L pLight->Diffuse.g *= 1.1f;
# `$ d4 }( k1 X0 U/ g8 c. Q( J2 m pLight->Diffuse.b *= 1.1f;
; s& L- a+ M# l; K! \ // oˉè* ??à? 2 w5 o1 H ^: r' s- G0 K
pLight->Specular.r = 2.0f;
2 s$ F! B# f! m pLight->Specular.g = 2.0f;
2 _4 I8 g5 D I5 O% u pLight->Specular.b = 2.0f;& o7 s3 G% \7 C7 a4 @
// á?oˉ
" R4 \4 u- p0 g* Y/ T- J pLight->Ambient.r *= 0.9f;
: @ J1 {+ J4 f8 } pLight->Ambient.g *= 0.9f;* T+ E2 I, H L2 u( x$ Q
pLight->Ambient.b *= 0.9f;+ w, L0 |0 H; @# z
#endif //__YENV
1 t& m- q- L2 s( k2 I9 u
/ M3 o3 }! L, u5 l. `" ?% ? memcpy( &m_light, pLight, sizeof( m_light ) );
7 ^ S: c1 H" ^3 { 3 z) I: u2 E5 |/ h2 k
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);1 v6 G# A# q) J
D3DXMATRIX matTemp;* m$ I) a" f' ?
static const float CONS_VAL = 3.1415926f / 180.f;& E0 i* x) T, s# n% K; h0 H2 K
% l3 D) q/ J" Y1 M2 Q# T
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
% _2 j2 i8 E4 _2 X D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);9 W( s4 {4 c8 q7 |7 k! N
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); 2 C) N$ T4 I. d
pLight->Appear( m_pd3dDevice, TRUE );
- @" N6 |; K2 |7 B9 v9 ^9 D" B9 d2 Y
; M# k( U: e$ M7 j // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
/ E2 d' t$ g1 C1 ?, O // D3DXVec3Normalize(&(vecSun),&(vecSun));
% t% J0 f% Y5 D; P8 T // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
1 S5 ~* i( W$ K5 B, V. g9 p& c6 U) \' T& z% W8 |) l
DWORD dwR, dwG, dwB;
' _, n( I3 o! e7 F8 I dwR = (DWORD)( pLight->Ambient.r * 255 );
; k# y5 r# }$ g. d' K dwG = (DWORD)( pLight->Ambient.g * 255 );5 [; M3 q1 l5 S. \+ ]2 C
dwB = (DWORD)( pLight->Ambient.b * 255 );
, f( q' F: n' s4 m( x2 h dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
0 B: n0 Q. B$ W- E' f8 s/ x }- [! I: h8 Y9 ^* B e" k
}
0 ^% U9 O9 \) M3 ~: S+ b* K3 _) u& W3 r- D" M, f/ W! O/ f
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );% f1 f4 c5 ], L2 c( a, i$ z0 _
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) );
4 F5 e5 T7 ?( c ::SetLight( bLight );
0 k0 A/ R* ?- w7 v" D
, R G, T6 \1 t, _( S // ±ao? ?D?í???ó á¤à? " k, U4 c# _) Q; E3 z
m_pd3dDevice->SetMaterial( &m_baseMaterial );- B4 H7 W' d* V' N
. `+ C/ V3 `( z8 p; o
#endif // not WORLDSERVER1 Z$ y) T* D! f, N: h
}, u7 |0 |; q5 B- ^
并更换, x1 x0 e! E, i4 x+ w9 F: s
Code:
' ~* w! h% f' ^4 W__FLYFF_INITPAGE_EXT
3 }9 |* s4 T6 v; W定义
, x; E0 E$ W9 {! F8 b4 R* r4 K& ?
" \: ^7 f8 J, P0 R% D& W
! h" P' ~$ z* ~' U4 f0 a; @+ W1 R$ F( t b
, B8 Q# V+ j, \: Y8 u1 M现在终于删除我的狗屁加速...
) P6 [$ j9 G; H4 e( j7 X* I7 h% B. |7 n) b4 j* d: \& Y
8 L& W# i/ m! A/ a" S/ X
. \) S" W1 x1 O8 f$ ~4 d; K
|
|