|
食品车:
$ g' D2 t' I9 [; B6 A4 U! D7 j尾翼: p# F, E- \0 C+ A
" F5 y1 S2 h, a, `代码:
1 z, u3 D- E# i/ @. K8 P/ ECWndAutoFood::CWndAutoFood()
) r) @) @; u3 G, D{5 ^; @( N3 _ d: w
m_pItemElem = NULL;
" ~. V1 }( ~/ J' W m_pTexture = NULL;
u0 @# L: ]0 Z& I* F; V: ` bStart = FALSE;- N! R! H5 b4 Y8 X( ~; r
}9 B- R* H4 ]6 h7 U
8 k. k3 B6 M- R, r% ^1 _' R+ u+ WCWndAutoFood::~CWndAutoFood()
! B7 E; _3 F, ]1 G. \. Y{* C3 s7 g6 U- c4 T& \
AfxMessageBox( "AutoFood ist gestorben " );) @* i9 z# _$ z" ?) W
}
( ?: p) p$ \, O* VBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
( u% ]1 r7 A" }{9 u0 n4 P A: h5 @3 ?4 P' L
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
$ z2 c1 k5 a$ I, D- d6 J}& u; {& r+ c+ N$ k) K, l
9 Z0 M% q) ^3 I* ]9 WBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )6 ~6 ?+ d1 e; z% {9 H
{
0 ]3 A# Y: r, W. o1 W LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );$ W( a: Z. T0 ^7 R
CRect rect = pWndCtrl->rect;
0 i0 c0 Y) K; l' y* N if( rect && rect.PtInRect( point ) )) J" l* D0 _: @8 A* h" T- p! L
{8 j, n0 V( l& ^2 Q4 w5 f( k9 M
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );) R! a* K; N0 Q$ q4 O- L- S1 r
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )8 q5 Z8 u! z# z! @, E$ q' N
{
* n' ?' }: W: V5 f9 u n if( m_pItemElem )( {2 r% O4 C9 u5 f
{, y# M0 p3 H, x1 d
m_pItemElem = NULL;
, q, D! c! q6 H. l }
6 @2 m5 q+ \8 q1 J! L. w2 `7 L m_pItemElem = pItemElem;
# y3 u! c0 n& {. w m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );, {* D. C3 }( G7 a; v6 o
}else{
- r8 ^& }9 B" ? T& Z SetForbid( TRUE );
/ M# o0 b1 c7 Q9 @ }
1 r2 S" Y; `( `1 T/ l }else{: ]3 j: X. D, J1 c8 o& p Z
SetForbid( TRUE );. u& @% v3 s* g% l1 a2 X3 w
}' I" v2 \+ \- M" h: z7 G) H
return TRUE;/ j* x. |# }8 X m5 R, n# ]
}7 W# x% A3 j( D u# \+ }
* G: P( W, n% m# h9 IBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )) E: M+ v1 T) q0 J/ P' n
{% a/ H( e8 W7 X% P
switch( nID )4 ]5 m2 U7 y7 u6 V& ?! v* D
{: A: @. E" ~' p, p, }
case WIDC_BUTTON3:
* W( y: \( Y! P, _) W% C {8 X% Y+ X' h9 J2 W' t4 K/ p1 U2 y4 K
bStart = TRUE;
# U# V+ [0 @( ?! i) ` break;1 Q! @# {0 g7 [# ]+ E% g
}" \/ Q B" f6 P
case WIDC_BUTTON4:1 U0 q: n) ?" F: l
{
- M( j6 G$ j+ U3 G; P% ]3 v bStart = FALSE;
/ c3 z1 m, |" f, A break; q( e% P& z/ `
}, b0 M' B7 [4 }& D) _5 i9 D
}
8 t8 @" J% D0 u% b) N4 D return CWndNeuz::OnChildNotify( message, nID, pLResult );
# A) i5 o5 d9 M9 q) z4 i$ X}
/ c4 c! t1 H# q* }void CWndAutoFood::OnDraw( C2DRender* p2DRender )( d X2 H* |/ u) q$ `, W
{7 b2 R) ^4 ~. @& Y, E% g
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
# E0 ]% N/ o) w0 H! I3 D1 ?3 `8 l if( bStart || !m_pItemElem )
( x: U" @3 z7 ^+ d- Q4 N( A {* u9 c1 b" C( k# p
pBtn->EnableWindow( FALSE );, M! j% E0 W+ h* W2 b
}else6 ?& P. S8 b4 A
pBtn->EnableWindow( TRUE );
3 P! |; O& ?6 W0 n if( m_pTexture )
- E, Z9 E$ O, v4 J$ K( o {" O' H- i( B' G$ y6 P, R' i) m0 z
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );, `3 l; I) D4 M- |- ?! }: w
if( wndCtrl && wndCtrl->rect )
4 n# `. Z+ e; ~8 P" i/ `. h {
+ ?; ]( L. ~. ?8 x m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
7 {9 F- R3 j8 S }
( l: s+ y% }& f( T1 M }
" F) h8 _: C$ E' y} [0 d$ G: n& g+ O5 J. X4 c
& D. f! E' [% \! ] R# @
BOOL CWndAutoFood:rocess(), H. @; a, T, _/ b
{
4 s, b2 ]* [2 O1 }1 L8 { if( bStart )0 C* b5 m1 G4 ^$ o, B1 w# G9 v
{
6 W% M! j6 I8 M' U" L. t if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
Y' Z% ? \: }! m {
* m3 a) k$ [- j% ^& T5 {: D if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )) ~& b" y" M) r
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
, W `% S9 ^! q }else{
h; P' L, c% Q2 g# V bStart = FALSE;
. t& }4 h+ [/ Q6 F9 ~ m_pItemElem = NULL;$ S) ]% K+ J3 y* U2 r: E
}
; h1 Z R4 f0 X. @" E }
' A% P8 V h2 G0 e0 R return TRUE;
) N' o( Y/ R; f' Q6 h: ]}
" h( a D7 m# a2 D; g! g/ M3 z i4 S6 ] u" R9 ?2 e
登录视频废话:
. @3 E# V h& A) d x尾翼:+ w9 ]5 [$ }! x6 F+ A6 G1 ?( l
* t; V. t o) a: T$ Z
代码:
* m# ?! I6 h6 X" F5 R' |3 \0 H8 n x# B4 n6 o
void CWorld::SetLight( BOOL bLight )
2 U; `- T1 S1 t* Zdurch
' ~" q3 F0 `: i5 a r, kCode:
+ _2 p( e' r2 ~6 D. jvoid CWorld::SetLight( BOOL bLight )
2 ]: ~" s) ^6 ^5 @% r{- \) ^/ f' r/ F8 `7 y7 ~
//ACE("SetLight %d \n", bLight);
4 E1 `* u0 _5 y0 _ / f% Y6 C/ [1 J9 H5 K
#ifndef __WORLDSERVER
' r# v5 W2 c6 K DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
$ ?" N1 f; P. A CLight* pLight = NULL;6 L: \0 q2 H6 j3 r. w
) u3 M; Z$ f* I
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );4 b4 U1 w# h, k' v! X
7 x4 a/ I6 d. Z& \3 X" N
pLight = GetLight( "direction" );
) y1 E; y7 b/ V' R1 v, x$ I/ p) q# a! f' b) I
#if __VER >= 15 // __BS_CHANGING_ENVIR
& h( v6 k' ?* I+ g9 _( w- k/ c if( g_pPlayer ){( i* P3 o9 z* b: p t& N5 Y' @
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
/ p$ L4 D0 B/ a! ?' y if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
) K3 j+ r* r& K# x {# z( c- k2 H7 _$ T( S3 v' G9 I
if( pLight )
( |& J ^, @& k7 ]- C# z {
/ R, S J4 h, W- s$ M% F( d pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
8 t; i2 _# c/ d p2 A pLight->Ambient.g = pInfo->_fAmbient[ 1 ];7 A+ Y0 M8 X2 `$ D9 y a1 v) k. [
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];& S6 J: d7 V A( u/ W3 W, d+ }
2 |4 A4 t8 t% W
pLight->Specular.r = 2.0f;# g8 w! J) f* F; w N
pLight->Specular.g = 2.0f;
2 a4 \' s, o7 j5 ]2 } o, z' ~ pLight->Specular.b = 2.0f;
- A9 Z& y6 [' g1 ?2 n$ c( } 9 a0 z6 B8 V% P( {6 |: {% x
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];6 s1 q6 q% G8 B$ a4 h6 A
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];* l- Y6 d. A; h8 |' n) W! x
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];6 N- L, I B: k* R# F2 u8 ~( K
* V! x" i4 ~: l- B
HookUpdateLight( pLight );
% J- {: I9 b; K7 ?4 a4 \1 q* V! G6 a) p) A
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );& Q ?7 N+ w* }' O+ F
# E* L( g& @* @( p5 @$ W( F pLight->Diffuse.r *= 1.2f;
2 u5 e# }( ~- V. R pLight->Diffuse.g *= 1.2f;4 l" B: N5 h1 |0 q+ ^
pLight->Diffuse.b *= 1.2f;
( D2 y$ k" W7 M* K& U3 w
; }! ]: k U9 j9 ` pLight->Ambient.r *= 0.8f;
# o6 g" K* @! |3 ?, z pLight->Ambient.g *= 0.8f;
$ f# }/ M9 w( ~# U- z pLight->Ambient.b *= 0.8f;
0 w' K" N! R6 n4 t n7 W - l' W- B" v" z+ @/ S+ F
memcpy( &m_light, pLight, sizeof( m_light ) );
; p2 e: H8 `' O# x3 A. N- G1 R7 S
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
4 ~7 M1 ~7 K' t8 r' R' [ D3DXVec3Normalize(&(vecSun),&(vecSun));( ]# G: ^; E7 Q( Q$ a
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
6 T4 N) f% H/ {' Q' ^ pLight->Appear( m_pd3dDevice, TRUE );
* e' T3 `1 J g2 d& D0 i ( S- V8 [. k# q' B7 w8 V; n& Z% b
DWORD dwR, dwG, dwB;
7 A& t) {. R0 l" E: x dwR = (DWORD)( pLight->Ambient.r * 255 );
9 m5 {( g N" @7 {$ l: K dwG = (DWORD)( pLight->Ambient.g * 255 );
; d5 s3 D' D5 a5 o5 m dwB = (DWORD)( pLight->Ambient.b * 255 );
4 S$ ~+ E/ d; [9 m; w1 x dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
" }* X7 Y7 L( s0 V4 l: a0 H }: n) p$ J8 s6 {7 Y, z1 C% z
}
+ E5 Q" h, ]5 D8 k } C V; p$ X( x( t
else
# ?" d" f9 m8 V0 b4 O#endif
; H$ f* v# U* D4 Q+ Q# c! S
O* }* ?5 P' Y5 o( V9 ^+ E if( m_bIsIndoor )
; f; v' a: i9 {' e {
" U2 g/ f/ v* t0 e( @ if( pLight )$ \0 ]9 b+ |* |! ~
{
9 @. V, z. @( v9 N+ O5 ~& u1 U8 W // à??μ oˉè* + W$ [% _6 \' E% G- |
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;' x0 D. f5 M! W: V1 M0 \
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;5 `! X; `' C7 ]7 v
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;6 I3 P" o9 t2 n. Y0 S
& H( j: D, k' b) F
// oˉè* ??à?
. o! {3 H2 S' J9 }. j% C V pLight->Specular.r = 1.0f;/ k+ z7 d2 ?5 Y" M
pLight->Specular.g = 1.0f;
" J* T, p/ H# q& k pLight->Specular.b = 1.0f;
/ m4 t$ p0 {8 k$ v: ]- c4 D // àü?? oˉè* $ W- a" j5 V9 \8 C1 I
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
6 g- c1 {: `" V: g5 I, K" V pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;. @4 v2 X" W) X! e
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
4 D! T% u; Z) K6 @
/ z5 i9 D q; g2 Z. | if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.5 l% Z$ ] J9 b
{
1 }1 Y* i9 t2 c$ H; r9 l" h. F pLight->Diffuse.r *= 0.6f;! S/ k7 I% _2 N
pLight->Diffuse.g *= 0.6f;
7 P& }& y) Y" S/ A C7 [6 J pLight->Diffuse.b *= 0.6f;1 V5 z' N. |3 p* U
pLight->Ambient.r *= 0.7f;
! `& w% K1 z6 w pLight->Ambient.g *= 0.7f;
% H: b/ [- M! D- x2 i0 ` pLight->Ambient.b *= 0.7f;8 ~6 P9 g' h7 y3 j f
}! w+ S2 X7 b* d% {- g' D% h
+ z1 c, c% { W1 x$ G
#if __VER >= 15 // __BS_CHANGING_ENVIR
% e3 G* y; u3 U0 S; _- q if( g_pPlayer )8 j, g0 M y. c% w t
HookUpdateLight( pLight );
* @4 n8 m3 X, ]# c, d; Z, F#endif
; c. i3 A2 |% O$ u- ] memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );6 A j7 Y& I5 o. [! N7 { b# g) ~
, k; L; p' s0 l3 j& Z
pLight->Diffuse.r += 0.1f;- b2 [) B* F. _% v5 f+ Z+ y. n* Q
pLight->Diffuse.g += 0.1f;& S4 V' @2 y" K& X/ v* Y
pLight->Diffuse.b += 0.1f;
3 j7 j, W- t8 R // oˉè* ??à?
1 z7 E- l9 ^8 k: f. V9 | pLight->Specular.r = 2.0f;; e- x5 c1 r: [$ f" a& e& D
pLight->Specular.g = 2.0f;
B6 l2 U: z7 Y' L0 f+ I7 p5 u pLight->Specular.b = 2.0f;
8 F3 G7 n# n) O8 v // á?oˉ
( N5 C6 v- d/ X& z6 n: H pLight->Ambient.r *= 0.9f;
8 p5 y" T6 N# j% m3 e8 S' h pLight->Ambient.g *= 0.9f;4 R! H0 s. y) k9 P* K% I6 d
pLight->Ambient.b *= 0.9f;) f- F M) E) m# j& w- S! V
3 X) q* {' D( N D
memcpy( &m_light, pLight, sizeof( m_light ) );
) F# H% l) M8 u 9 Y0 P% D2 ]. f# x2 v
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
+ Q; [6 I$ }4 `% P5 r+ E pLight->Appear( m_pd3dDevice, TRUE );/ t9 \# f$ P: X" f0 Z8 V
; H! r7 {. i/ \9 ]9 B
DWORD dwR, dwG, dwB;* {' d6 {6 V7 h/ v& t2 F7 q
dwR = (DWORD)( pLight->Ambient.r * 255 );
/ b7 P* _1 Y: j$ B$ h# \: K- X+ i( ] dwG = (DWORD)( pLight->Ambient.g * 255 );
* O/ d8 Z% i( w: G" m dwB = (DWORD)( pLight->Ambient.b * 255 );2 V$ t) Y+ n! `5 {8 U2 b1 e- N! N
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
& y+ O' k/ V. l0 [; F4 \& _ j }. |* x, B2 ^0 D* q2 |
}- F" q# @6 l& |4 S9 S+ `" E1 V
else: Y6 s, a2 m6 b7 p: V
{
2 }' O* h, Q: x r) l$ P/ M2 ?6 F if( pLight )
}6 U: [' w2 I0 V. p {
$ P( f$ Y6 H E; h! W3 m, g 7 |( g) _7 J9 S# V7 w- J1 C7 R7 q
int nHour = 8, nMin = 0;$ h1 u1 r- q& d7 B
#ifdef __CLIENT
R& y/ V* V) {6 {; E1 C8 L // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. ) P- Y6 [* ?, V' A7 E
nHour = g_GameTimer.m_nHour;% }9 c4 r. Y' j& ]! a* x( i D
nMin = g_GameTimer.m_nMin ;' F& P# B. H9 e$ w' k* E5 G
#else
1 }7 C8 J5 ~9 _+ ^5 d // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
4 b. C8 x/ R% B if( m_nLightType == 1 )9 }) S( H; U& S2 ^7 Z9 R3 n1 {1 n( ~6 E
nHour = m_nLightHour;
, Q( R# b1 v, h$ ` #endif# p5 R' C- a0 [! A' N6 ~+ _. ?
nHour--;! V5 s) A% e5 A/ v& s& `. i1 p
if( nHour < 0 ) nHour = 0;
& s$ @% X; J- a( S9 O if( nHour > 23 ) nHour = 23;2 f9 E5 R5 s( m" n( D
; w" E9 d( ]6 \' k* }$ T
//if( m_bFixedHour )8 h, Z6 e' r5 N8 C9 f
// nHour = m_nFixedHour, nMin = 0;" X7 G4 ^: _; W
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
0 P# M3 I: Q5 u' b LIGHTCOLOR lightColor = m_k24Light[ nHour ];. @3 c# T! e" B) L. q8 t
. b; T) z8 _+ ]6 I, s' T* h
//m_lightColor = lightColorPrv;
- \. B- x( s* ^1 ` lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
& k* x& r1 U9 A5 G; C$ }9 h8 Q" | lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;4 f5 M. q$ \' [
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
# n; R6 w! ]1 |' K0 v5 t9 ^ lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
9 F: i; e0 C% g lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
# M( F% R# |- v1 n6 ]( }# ^ lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;; O' d/ {- G$ e# Q% {$ x1 @" G9 _. b
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol); E0 M- M3 c# p# h
) P; e- q# E F- W! |! [/ `
// à??μ oˉè* - I( L7 P' @1 i2 x* D" m* _; T
pLight->Diffuse.r = lightColorPrv.r1;. h! R8 c0 ^6 w5 K% b
pLight->Diffuse.g = lightColorPrv.g1;
; G3 D% ^8 K& x pLight->Diffuse.b = lightColorPrv.b1;' i. i E3 e2 R$ T
// oˉè* ??à? 6 O, @, F+ Z$ R. `. m3 D
pLight->Specular.r = 1.0f;1 t; ~ b9 J" b) P
pLight->Specular.g = 1.0f;
8 O$ W: b v" H- c0 z0 a6 i pLight->Specular.b = 1.0f;$ N" H2 d2 Q$ O9 R9 k
// àü?? oˉè*
! ]8 C" i$ B$ E. c9 } pLight->Ambient.r = lightColorPrv.r2;* K$ V- a5 N! l# c
pLight->Ambient.g = lightColorPrv.g2;8 |- D( o, b I! J
pLight->Ambient.b = lightColorPrv.b2;
: t9 e9 y( R0 Z+ Q6 C4 `- J& X. r6 Q9 _& F" I- F
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
% n4 r/ i; t( w; l7 u/ s9 y {/ H$ ?6 x1 ~4 o9 b6 n4 B
pLight->Diffuse.r *= 0.6f;
" R. L) ^: M- d( T5 g1 i5 X pLight->Diffuse.g *= 0.6f;
/ `# k# i- Q! N8 t pLight->Diffuse.b *= 0.6f;
2 _( [- ?1 e7 [ pLight->Ambient.r *= 0.7f;
$ e% l0 l; }( F' A( F pLight->Ambient.g *= 0.7f;
+ a" p; k/ w6 B$ a- X1 r5 n pLight->Ambient.b *= 0.7f;
2 P2 i) q a" m) g7 v9 }" L }
2 }! n7 i: i1 ^" b" G4 P8 ~
' B" y& r9 U) f8 M1 c A( w# }#if __VER >= 15 // __BS_CHANGING_ENVIR
3 \) s9 ~. M! S$ j( S& r if( g_pPlayer )
/ n1 g W( n" m HookUpdateLight( pLight ); ! f8 Y* z: z; O- d
#endif4 W w( k* g5 j4 H* ~
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
0 F3 [5 M1 Q& N* ]
; g/ t. N, n4 E#ifdef __YENV
& ~- Y1 p) ~9 U9 ? pLight->Diffuse.r *= 1.1f;
+ H9 k J/ ]# i, G; @6 {$ J4 { pLight->Diffuse.g *= 1.1f;
' C! V1 c$ s9 ?3 l/ n pLight->Diffuse.b *= 1.1f;& T$ h$ ?9 [' ?% Q1 O
// oˉè* ??à? 7 j; d; O' S# V
pLight->Specular.r = 2.0f;: F8 E" D0 S, b7 P- c
pLight->Specular.g = 2.0f;
9 j* k3 J, f: T pLight->Specular.b = 2.0f;
( J1 X# b% W. W // á?oˉ
/ n5 X4 {4 {( x( P pLight->Ambient.r *= 1.0f;; H$ T- n2 y& T# Q+ ^$ ]
pLight->Ambient.g *= 1.0f;
3 {0 {7 f' b0 }6 f/ v9 \, L2 B+ @ pLight->Ambient.b *= 1.0f;
# q# P7 p* T. [4 Q( N#else //__YENV9 Q7 ]& v- T6 R. W4 B9 b# ~0 J, R
pLight->Diffuse.r *= 1.1f;
7 b( H3 ^9 o. f$ F) r) d pLight->Diffuse.g *= 1.1f;
: ~) k* f( {8 l" ]. d pLight->Diffuse.b *= 1.1f;; @% |4 Z. \* S. l T$ d2 l
// oˉè* ??à? # h% P! }" A$ f1 c+ U4 h- a2 h
pLight->Specular.r = 2.0f;
" ~8 s( k9 U* N7 V: m; D# i. C; X pLight->Specular.g = 2.0f;3 |6 w% o) ?. w8 X4 i
pLight->Specular.b = 2.0f;/ J8 S& Z9 {5 {; Z7 P4 p2 Q
// á?oˉ ; ]" {5 I" ]( _) J7 C
pLight->Ambient.r *= 0.9f;
3 q: f: o: |8 f# \* k9 o pLight->Ambient.g *= 0.9f;0 W8 y! E# g* V1 z' ?8 X* W
pLight->Ambient.b *= 0.9f;! e( f- ]4 a* I3 F
#endif //__YENV
; G; c3 | [( Q4 @8 P7 D; G & ^- T' @$ e5 s% f
memcpy( &m_light, pLight, sizeof( m_light ) );
( l5 x v t' n : F, f: Q* B H8 B( s6 |5 D
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);% `. X, q& j2 F6 D) [0 }
D3DXMATRIX matTemp;4 g! X$ L$ x8 N$ e# P$ Q6 K
static const float CONS_VAL = 3.1415926f / 180.f;
) z! O( z6 U# M. n1 d# d7 w) f' w
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);" i/ p! o5 t2 E2 E% E/ y- x
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
1 ?! T" n+ I; H5 j1 E8 h9 o4 j1 j pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
1 ?1 o0 c `+ B y7 A pLight->Appear( m_pd3dDevice, TRUE );7 K+ a) b1 }- Y' w6 r
; @; v: V: x% z7 @0 A# F
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
4 I3 E [# t; D9 ] // D3DXVec3Normalize(&(vecSun),&(vecSun));1 ^& M: V0 W6 E+ {* f9 X$ `, u
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
+ X: h* z& h. C5 g8 O8 L$ D- ]8 c5 Q6 o( p8 D/ [9 k$ U4 \
DWORD dwR, dwG, dwB;: @+ w7 G! c/ b, t& J
dwR = (DWORD)( pLight->Ambient.r * 255 );
, u' s$ U9 B6 n: G dwG = (DWORD)( pLight->Ambient.g * 255 );
) Z4 l, p% U' }" K- k dwB = (DWORD)( pLight->Ambient.b * 255 );
% a# p: Z" R1 Z- e* z( K& r dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
! A, W4 W! a( N+ a. M" | }# c6 y8 `8 ^2 S
}; m { F+ M! X# }1 J# o6 n1 ^
' c0 I9 ~: M, E m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );& S: I6 r+ W$ d: C4 B9 a; `" V: Z; q
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) );
) Z5 f" @. ^: b$ x) I: S; u ::SetLight( bLight );
& Z4 I+ b. B: S& y
+ u: f8 o" k# f, D // ±ao? ?D?í???ó á¤à? " }) n( D( C! `4 D3 X, }
m_pd3dDevice->SetMaterial( &m_baseMaterial );
! Z5 R7 ]! ?& ^# A
2 d& h* c P* }8 R- B/ b. O4 {#endif // not WORLDSERVER
; j7 v* D! {$ E3 S' o; \}, u" ]+ g* o! u% D# ?
并更换 A- g: n, P8 o+ T, C+ Z
Code:. z: z- ^0 t5 O9 S2 m: b
__FLYFF_INITPAGE_EXT2 T2 v4 _# p/ }5 h5 r1 B
定义
5 y0 M5 _- A3 G$ C; r
+ B8 q m" j r. `, }% Y/ T$ \4 y# I, g3 j+ Y0 b: i- E2 E
6 H# x' O* x( r3 m4 ~5 X
( A/ L: k+ j8 L3 C
现在终于删除我的狗屁加速...1 k2 o6 r. ]/ o5 c" d+ W6 Y
+ t0 R4 M% [7 \* s8 w( M
( @- e* ]; V# m$ y) }4 q. Y. E s5 I; ^4 h
|
|