|
|
食品车:' `: n4 ], e( Z! M# E
尾翼:
) {3 U! [: u0 a1 ]' R, }3 U1 r7 a% }$ E8 z$ Y
代码:
% x. d$ h/ X; z, n. `; n9 [CWndAutoFood::CWndAutoFood()# ?& H% d. ^6 m: F% G6 U4 z3 R
{1 N: T: j/ {$ S% I' r% h# p
m_pItemElem = NULL;
, L8 A8 ?- m) a0 W m_pTexture = NULL;0 x5 j4 z" c, y
bStart = FALSE;
5 T% a' S" H* U. P; G+ _9 _+ q} k0 l" R1 U9 }; k6 }* D7 ?( ]
3 n8 z6 w* x; W0 k& }0 a. B1 p
CWndAutoFood::~CWndAutoFood()( L( |% O2 M, P0 L u
{
2 K0 S4 O0 K$ B* N; s AfxMessageBox( "AutoFood ist gestorben " );5 ~& V% J* \1 z$ g0 v5 I& p1 ~$ u
}) S0 b9 i+ r* f3 z
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
( o7 e% n2 i- i6 `{# B, Y0 b+ |' v' U
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );6 Z1 \* Q. g1 U+ \
}
6 o' b k6 \5 C8 f, r
! t7 ]; |: U: s" x: X$ ^9 k" RBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )7 Y8 F# X; h) ?3 ~
{) `! |# y5 _4 G/ O! |* ?
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );7 F* P9 _: Q: V% s' F7 P0 E
CRect rect = pWndCtrl->rect;# z4 f) W, J+ o5 L; W: L6 W
if( rect && rect.PtInRect( point ) )7 M8 b) R8 H1 s
{1 w1 @6 _& j3 j( ]7 `" b/ R
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
- t1 B4 ~7 |$ o* Z8 B8 L! a if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )' x9 Y1 m7 `, a$ v& y
{, O) ~) o5 w; h& w' m
if( m_pItemElem )+ Q4 O; g0 Y" ^2 M g
{7 Z& H0 b1 e1 X/ h
m_pItemElem = NULL;$ o4 l; s7 t2 n+ X3 B5 H1 t
}) Y9 Q% p8 ]4 `9 y% l/ m) D8 V
m_pItemElem = pItemElem;) u: r: Z$ C& F+ x: P# e
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );# Q6 N) h9 }9 M
}else{/ E: ]& S8 G8 d7 Y! R
SetForbid( TRUE );
% Q+ E+ V3 I- f6 k }8 e& q& w9 x( x2 N
}else{
' V$ {$ ?; I6 B* H7 b SetForbid( TRUE );
" c7 [2 w c5 c r }6 K) a! {' j4 o1 _
return TRUE;8 S9 ]" j# N; G0 r% q; l+ ~( n! [
}
! \5 d* y, Y2 X/ ?; [4 X9 o- M* d. k* p
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
3 X ^# l7 E( ~1 Q2 I) Y{& j( E: W' a1 J1 Z/ K
switch( nID ); n! q& J1 Y! a R! W' s
{
2 R& {- f) }' i. G6 [5 k4 | case WIDC_BUTTON3:
1 U7 h3 }# `# L: ?; C {
! y+ H9 @9 c. n" ~" g bStart = TRUE;, S0 @) d+ y5 [; h3 C/ N6 S
break;3 a* K7 J9 c- y. b
}4 u( q+ n: y0 R. E# @
case WIDC_BUTTON4:
7 z% |7 @' V9 w3 e6 { {
; @' R v! `* ^* C bStart = FALSE;$ { s2 `2 F3 }! P
break;& Y$ t' Z5 j6 h' [, L* d. T
}
0 |7 c. q5 d P/ @! {+ [! R2 k }
4 l6 X6 d" E% P6 A4 b' \& q return CWndNeuz::OnChildNotify( message, nID, pLResult );3 N! P8 C6 r) h$ F
}
& ^8 S8 @% Q1 u0 O! H; R3 ~$ Rvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )) i& }( ^8 `7 f) J& R9 \1 L
{, G S" E$ v# M+ s1 u
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
; Q; N# m3 W% a' \" l0 `3 m if( bStart || !m_pItemElem )& F* D1 h, ]% [
{
! t/ m+ @. c" h pBtn->EnableWindow( FALSE );
& V, Y; x6 }2 D7 `# Y }else
- a$ ^, |) ?9 g' @5 z8 R9 I& G pBtn->EnableWindow( TRUE );- b+ c6 Z; G4 v9 k% v; i
if( m_pTexture )
% v/ |$ _ o5 h {
0 x6 F9 M) x. V! |5 \/ f LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );9 J# O, c$ J+ T* t
if( wndCtrl && wndCtrl->rect )
+ f. C, Z7 y5 E' j: K! o9 ? {
! X; k5 {: W. q/ N1 o+ t m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );9 O) J5 K) D" u0 J N! U8 W
}( }0 c5 _4 C" Y" C1 Q2 k; x/ N
}" P% q: ^' b6 g) A- K$ v' M
}
# z! B/ f" Q M! u: E" W! t' V9 F- S! r; X# d4 v+ P
BOOL CWndAutoFood: rocess()9 v9 ~: B2 Y( Q5 l
{6 Z9 q: ]8 D: @ U6 y# C1 f4 e
if( bStart )5 w) N$ r9 X) S( P' f. |' ?
{& Y3 m" _* l9 ]2 r, u7 G
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
4 Q% g% ~6 F/ h+ U/ c {& P) s, w1 L4 g0 @
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
& F9 [ Z) t E! l9 H. S g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );5 `. l% m* y, q+ E- c1 |# H8 h
}else{
" g8 N1 J, W( }5 f, @6 {) Z bStart = FALSE;4 \/ S$ @9 P8 t2 [6 P4 h
m_pItemElem = NULL;
3 X4 W+ y/ D9 t7 P5 A8 g: h! }1 F7 u }9 }2 U9 k" V. j9 C; o! N
}3 c* t, ]# h) ^# ?$ o L
return TRUE;+ p2 h& e* R- }; `, e' e( y4 H$ P
}
. ?2 s% P) {% ~! R7 o" Z8 J
5 l4 v" q2 E7 `, L1 b登录视频废话:
4 \: O. u: G% X Q) _尾翼:
1 K5 u7 T/ s: O; k+ D
7 H$ Z9 l+ l1 D% ^2 t代码:/ m* v! ~+ r/ U
" |. E6 [. S4 ^2 I2 m" Tvoid CWorld::SetLight( BOOL bLight ): l3 e& _, v: t2 M# r
durch9 ?, B9 Q- [ F8 i- l' ?+ i# j
Code:& ] ?" l: ]9 L8 O0 Z( \
void CWorld::SetLight( BOOL bLight )
" t( P9 N0 ~% C5 T{ s( C8 ]* }4 Y& f; R
//ACE("SetLight %d \n", bLight);
/ O% X& p+ v/ H
+ E8 ?9 u4 k5 a- d& {% @6 E#ifndef __WORLDSERVER " ?; |% k) L4 X. ]4 R
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
/ S( S; m, j& \ CLight* pLight = NULL;
0 q' @; q/ I' P4 h! v/ O6 p
4 y) }$ p- w! U5 p9 P$ s7 d3 B D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
1 E+ T7 i0 X* o7 R! f5 ^) h
" K( j7 B* N w pLight = GetLight( "direction" );7 D0 ?7 |$ R8 d- x: Z3 ~. W
, w0 ]9 t3 `% }( _- x7 F9 X9 c
#if __VER >= 15 // __BS_CHANGING_ENVIR7 f; ]8 k+ X/ o- }4 e
if( g_pPlayer ){
& V2 z/ S) U6 L0 n+ ]* u ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );6 u' x( U+ w3 U: k) D
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!1 s. D0 P! W8 Z7 b( `
{
% Y, j0 A7 r- H. O if( pLight )
& F4 m w% J$ W N- o {
& l( G/ M/ ` Y% M pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
7 o; K) B0 J' h pLight->Ambient.g = pInfo->_fAmbient[ 1 ];' p$ L* L6 s& d
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];3 y! U4 ?1 O7 z. t6 Z5 G
9 y; ]/ r" E( Z5 `5 u1 o3 ]$ J: ^ pLight->Specular.r = 2.0f;5 G& n; v4 Y. A, ~# f% w
pLight->Specular.g = 2.0f;4 O& v9 ~3 j( q- V6 t
pLight->Specular.b = 2.0f;1 v7 @* ]- \- B2 y3 b
% L& c; N T. V pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];4 l. }8 D0 `' p3 a) {, ~
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
+ L9 g Q3 p% b6 y pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
1 D, c- z! [# b2 H2 J+ e 3 v |" r- @/ q- }- L% `
HookUpdateLight( pLight );
c+ d$ }: H% C' Q$ [; r. p6 I8 A& ]* M$ W( C
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
/ X( j3 P: b: l$ {0 q ( _3 @8 q% K# ]
pLight->Diffuse.r *= 1.2f;) {" U; H/ F, Y+ C4 l
pLight->Diffuse.g *= 1.2f;
$ L# a% \( E9 }+ Y5 _; I1 J pLight->Diffuse.b *= 1.2f;! g0 {; E( [6 S L5 u* {& ~* E
, ]+ q+ I5 A0 C! \/ ?( w7 t pLight->Ambient.r *= 0.8f;, m' B( S Y9 w! @
pLight->Ambient.g *= 0.8f;
9 p2 H6 U4 [: B! t3 L0 H pLight->Ambient.b *= 0.8f;9 i- B0 M% C# b3 s- n* p: D9 `
7 l4 O1 i+ |& @+ g, l3 L! | memcpy( &m_light, pLight, sizeof( m_light ) );# t- v- B& f( o
# A3 |, A" L8 h8 `1 d2 v P( V
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
5 k5 V' P, E1 b( H8 Q D3DXVec3Normalize(&(vecSun),&(vecSun));+ \& W# `* D& ]; X. ~0 m
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); + ?- o/ [: j" o
pLight->Appear( m_pd3dDevice, TRUE );
# f3 L6 M" {9 S) T% {
7 {6 G& T7 I3 V+ ` DWORD dwR, dwG, dwB;& m; i% A! U3 `# i( G
dwR = (DWORD)( pLight->Ambient.r * 255 );
8 G$ J) n+ ^/ J9 ` \; o dwG = (DWORD)( pLight->Ambient.g * 255 );
( x; v1 c U& I dwB = (DWORD)( pLight->Ambient.b * 255 );
( E, a9 g; Q: i- l- c, b dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );# M( d6 |* D- O* Y ^
}
* r1 O$ T' I$ R7 h* a9 ] }; f# o+ K. `* ^9 t% V% i
}! i: _2 c/ `' o; Q& m' e1 j
else
w: {8 h) C- D( {#endif
- i4 W- l3 l5 C
' \8 B+ B! x( Y0 v$ p if( m_bIsIndoor ). O: z* c4 I) R
{6 f' ?$ x9 t4 D* _' ^. m* _
if( pLight ) U6 [2 R9 J0 h
{ : B1 ~$ q) J" Y) g
// à??μ oˉè*
6 V4 O' u1 `* i9 L# l pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;% H/ w( b0 O! P7 _ Q) p
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
& C3 {/ V/ j9 L5 v3 A% k9 w% k pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
% }6 q' s* O4 }8 Y9 J% _( ?/ q/ a1 X# R
// oˉè* ??à?
: @" g; n, G2 G* `) e& X pLight->Specular.r = 1.0f;# R9 g, `0 W6 s# L
pLight->Specular.g = 1.0f;$ e+ d9 P4 H0 U7 F
pLight->Specular.b = 1.0f;* k) K% L/ m9 Z5 B8 ^
// àü?? oˉè* , s8 C' I- P. s! E8 ]) d- I
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;0 G' N* G; a W- C- B
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;9 d, G" C+ J2 w! `( L/ _
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
% L x6 N7 \. Q+ R* W( K
! V, P& f7 n6 y0 _# J2 w% V if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
' }7 p8 t$ ?4 f; ~ {& _0 k" ^. V$ y2 w, w/ o- D% q; a
pLight->Diffuse.r *= 0.6f;
h9 {: X4 h: @% b% B3 G pLight->Diffuse.g *= 0.6f;' Z9 b6 Q! r4 V
pLight->Diffuse.b *= 0.6f;
* J! U& S" p- g; A% j' E pLight->Ambient.r *= 0.7f;: g% d% |3 X! Y0 z" s0 }6 Z
pLight->Ambient.g *= 0.7f;5 o# o3 L4 T+ J* @" x
pLight->Ambient.b *= 0.7f;
7 q& W& }) b3 J- @+ W }8 [3 [7 K) S9 p& R/ K
# q: o7 `" U6 X0 _) E#if __VER >= 15 // __BS_CHANGING_ENVIR
_( F% S) r* \& u if( g_pPlayer )
8 [; S" c4 ^2 C @* R3 e* g HookUpdateLight( pLight ); i- A$ |4 q) t2 M
#endif5 P9 O- w0 Z% o1 Z
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) ); M6 \5 w& m' Y0 D% o$ P% D" }
2 Q# z) s" w" i6 e: N( I; q
pLight->Diffuse.r += 0.1f;9 t2 {; m5 P+ u+ d& o
pLight->Diffuse.g += 0.1f;, U0 @: Q' V, ^
pLight->Diffuse.b += 0.1f;- C; k% j% }0 o! w3 @: J# a2 y- m- e, U
// oˉè* ??à?
' e( y8 f0 [. n% V4 |0 {3 n pLight->Specular.r = 2.0f;
* `/ g# T( F* b pLight->Specular.g = 2.0f;
& J+ u3 u5 t, f r pLight->Specular.b = 2.0f;7 D: P; h! Y2 H
// á?oˉ
* Z; s0 t, ]0 x$ k3 R pLight->Ambient.r *= 0.9f;
' W: G/ p2 o9 T+ {6 [7 p- Y3 }1 Q pLight->Ambient.g *= 0.9f;
: ]& D" N, x- L- v pLight->Ambient.b *= 0.9f;+ C; A& d4 c- R% E/ V
- j2 A! R$ t9 Y0 s& c# D
memcpy( &m_light, pLight, sizeof( m_light ) );5 n: ~) _; y( @2 w# B4 f
' y8 r- |2 x9 k) a0 F pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );7 _1 X. q$ [7 b
pLight->Appear( m_pd3dDevice, TRUE );
0 Y& v, `6 j* d* |; I% n
6 x( _3 b j( s9 v4 U1 K DWORD dwR, dwG, dwB;
- H% z1 R. P3 p; I) w, A2 ] dwR = (DWORD)( pLight->Ambient.r * 255 );: U1 s* t5 ?3 x0 w( B" g
dwG = (DWORD)( pLight->Ambient.g * 255 );: E& d" C- q4 i+ @! f- C4 @) K
dwB = (DWORD)( pLight->Ambient.b * 255 );
- R2 Y3 f6 ~# \; k dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );' B9 J7 |7 u( P" @9 n
}8 V+ u% L& Q) K( u7 \5 z5 L
}
5 l! B) T) `; V ` else1 h+ V& P( `- F1 b& J
{ z" D$ q) F2 M* _. P: P
if( pLight )
; b1 h( S6 t. I {# F9 D/ y6 [2 K" J
! c. P- R& L" f y int nHour = 8, nMin = 0;
( E' S& o* Y! w/ L4 \/ N. E #ifdef __CLIENT
6 M& R. n+ ~ o; } // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. . R1 F0 ]" E& v3 x& M
nHour = g_GameTimer.m_nHour;" d6 Q4 g% B. @* m: b
nMin = g_GameTimer.m_nMin ;
% \) f# P9 e6 P; w% T2 x2 ]. w #else
* J% R D/ x2 o" f% d: J // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.5 ]+ T) ^/ W0 V
if( m_nLightType == 1 ) r- Y5 x) I- g* P+ {
nHour = m_nLightHour;
" d3 X, t+ b8 Z% U- w3 Z- i( ~' @ #endif
5 N* v3 y; a5 \5 q nHour--;
4 I! H% d/ q/ C6 w" X- p% e if( nHour < 0 ) nHour = 0;6 i$ d/ \3 b- L* p3 r' L4 e
if( nHour > 23 ) nHour = 23;
) m" {) s+ x5 I1 d# m$ |1 ]& h E5 k* C+ \ I4 s! p6 @ E8 j
//if( m_bFixedHour ). B. ^5 ]. h3 l& z9 P
// nHour = m_nFixedHour, nMin = 0;
; s! [ N/ o( W! K; f; A6 P LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];2 p3 C) U. H- F& L7 P& o
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
$ q- `) B5 o6 Q" m8 \. j( _3 x& W# _& x6 f# }! L, T
//m_lightColor = lightColorPrv;! J) C+ w+ y' d- N# X
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
/ t f- T4 N. y3 R% h& A) } lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
3 G9 E# Z0 s$ q lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
- ~- N3 N4 d% _1 O lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;, t1 S/ Q5 u' ~: u, g
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;- A# d9 \! F; ~, W1 O+ \
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
9 B8 Q& J- `7 O4 ^! \! M // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
8 X# e$ y- [" Q' e- g/ |& \9 h6 j6 i2 l2 ^; h* l. X2 o( h
// à??μ oˉè* % S. v! X' }1 I6 ?1 O( h. F, g
pLight->Diffuse.r = lightColorPrv.r1;, B8 C3 W0 O! X. l: G: S
pLight->Diffuse.g = lightColorPrv.g1;
/ O. M$ i5 l8 S5 C# |4 N( [1 C pLight->Diffuse.b = lightColorPrv.b1;
8 u# p* F2 k0 Q2 r) C8 Q2 o! D // oˉè* ??à? ' w6 H% S: t4 A+ ]
pLight->Specular.r = 1.0f;
7 ]: Q% H* b h7 b, Y pLight->Specular.g = 1.0f;
* K5 l1 \! _3 q5 T% ^, d pLight->Specular.b = 1.0f;/ |5 ]# w0 }0 ?, w
// àü?? oˉè* 5 p9 U7 G4 E* T% m9 \$ O7 [# N
pLight->Ambient.r = lightColorPrv.r2;/ e8 y9 M% W+ S) V. W$ _% i! f8 O
pLight->Ambient.g = lightColorPrv.g2;9 f. ]6 t. a Y1 g2 K& f
pLight->Ambient.b = lightColorPrv.b2;
9 o! ~7 |, Z" H: X$ g/ j
2 R- s: M: v/ B if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.) ]& V' F' k6 V7 O. n6 e0 ]
{
8 k/ [ D0 \8 K9 K. z! N( k pLight->Diffuse.r *= 0.6f; k* l. Z, w3 a1 S5 F
pLight->Diffuse.g *= 0.6f;% E+ [) x) @9 g$ a- v( Q
pLight->Diffuse.b *= 0.6f;
& B. w+ J" ]8 v5 \6 u pLight->Ambient.r *= 0.7f;" ?8 u/ ]5 G. }* i: W. Y
pLight->Ambient.g *= 0.7f;
( }( C/ u0 A7 T# I- x7 }. L pLight->Ambient.b *= 0.7f;
5 N2 C( X, ?! [0 y. C9 h# e2 I }
3 E! R, C0 {' W/ S
5 k+ }+ y8 Q/ ?) E#if __VER >= 15 // __BS_CHANGING_ENVIR
$ @7 s. D# `- Y if( g_pPlayer ): q9 S8 e+ G! L2 s9 l
HookUpdateLight( pLight );
# t( ^) G$ \* t$ \7 C#endif- s# n$ o# l) X2 G
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );" Z, }( F3 E. c0 q/ K3 W% ]$ m
2 X; h: g$ b- W: T, s#ifdef __YENV4 ?( f* @0 O7 p- x4 T; ]& {
pLight->Diffuse.r *= 1.1f;, u; @' d* n6 I Y/ F# a6 g C
pLight->Diffuse.g *= 1.1f;/ g! t# r2 Y+ r! F
pLight->Diffuse.b *= 1.1f;& x2 R' y% {$ v* l4 D
// oˉè* ??à? 4 K2 J; P, b; X+ T! z1 g/ _
pLight->Specular.r = 2.0f;+ O' Z: H; j6 p+ }3 N" Q$ C0 C
pLight->Specular.g = 2.0f;7 T) O* s( d2 F# _
pLight->Specular.b = 2.0f;
7 f& k5 X" { B. \% a/ J // á?oˉ
7 W& M! p+ r/ I2 R: J" V+ G pLight->Ambient.r *= 1.0f;
# R/ k1 G' R; z/ B5 o pLight->Ambient.g *= 1.0f;9 p5 q' b, f. d9 a
pLight->Ambient.b *= 1.0f;6 v8 M& N% N( s' D& ?9 g/ A
#else //__YENV N! @2 v( e1 x& d: w# f
pLight->Diffuse.r *= 1.1f;0 W8 V7 s# X8 g6 ?" h- Q
pLight->Diffuse.g *= 1.1f;, [: C: P: j2 |# P0 a7 I
pLight->Diffuse.b *= 1.1f;
; t5 g9 G2 X9 m) C" Z& ?* u3 N // oˉè* ??à? . w2 C4 G- J8 I9 ?6 N4 M0 }8 {# r2 I+ v
pLight->Specular.r = 2.0f;
4 y* {( v% a* R8 C: \ m pLight->Specular.g = 2.0f;
% B$ d7 V6 ^8 w2 P pLight->Specular.b = 2.0f;
& C% E; W( k$ o6 ?2 r5 }6 M1 x6 d // á?oˉ 6 I/ k# R3 L" R- W. U
pLight->Ambient.r *= 0.9f;' T' o0 J6 E3 z6 ^' R; Z( T
pLight->Ambient.g *= 0.9f;$ ^ G4 B1 }! Z+ A
pLight->Ambient.b *= 0.9f;
* t O9 N6 C# A+ d. x5 S#endif //__YENV 8 R) | o- T2 p) I) P
3 F8 I( d/ U+ b6 E6 q& ]% k
memcpy( &m_light, pLight, sizeof( m_light ) );% [2 q6 M, ~- k: U+ a \- F
% _$ Q4 c* Q: z" M( {2 _ D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);+ v9 o' q! R! D4 d9 _
D3DXMATRIX matTemp;) x. {0 i6 Y: v- i
static const float CONS_VAL = 3.1415926f / 180.f;, s8 [0 r4 y5 y% L( @" y
: [1 G% B$ e W$ A: q D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);- l5 H2 [. w- n1 N8 M) w- E7 \
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);+ b: T/ U) x" M7 O+ S9 \0 m
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
+ w! d# N' e5 Q! y! z pLight->Appear( m_pd3dDevice, TRUE );
9 T5 _ @% i. F# `; t9 |& i6 U
4 w2 N8 Q j: |4 D+ @& { // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
) y. @; g: u% B$ P A5 k# E // D3DXVec3Normalize(&(vecSun),&(vecSun));: k( }$ ?0 Q% D( z& r0 a8 H7 t2 a8 d
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); $ @7 E9 M8 l6 l+ x# A/ ?; f# P( l0 I% [
8 w4 I1 J- W$ A0 a! f. P DWORD dwR, dwG, dwB;) e6 `6 {) P. j1 z! e$ S' v
dwR = (DWORD)( pLight->Ambient.r * 255 );
9 Y( z% U' I' d/ Q. _9 r) T dwG = (DWORD)( pLight->Ambient.g * 255 );. M* j' h/ i v* H, _
dwB = (DWORD)( pLight->Ambient.b * 255 );
- d1 [$ Y/ D! c4 G [; a4 l7 n dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
$ F- }$ `( Z2 v+ e3 e4 A }
6 [3 x+ _6 ~1 P% {, c$ ?5 L8 b }
- u' L8 _7 J3 p5 }3 f( ?4 ?, i" f3 ]
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
O j. X1 L0 W/ x. R- p( [ 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) );
: w; l; J: s& v( D ::SetLight( bLight );+ P& p; z- I. ?+ B2 j2 A
5 @1 {) w0 ]; y. b# n$ M" j // ±ao? ?D?í???ó á¤à?
; ^8 {* f( m3 p m_pd3dDevice->SetMaterial( &m_baseMaterial );0 F. |* A# E- A; V$ ?9 o8 H( [8 t+ c
: Y8 A; \1 r5 T6 L$ G
#endif // not WORLDSERVER
/ \" j+ i# w3 G# r1 k- a}( X7 F% l. |7 A5 t2 T, @! n( f
并更换
# ]& v) {. k$ o$ OCode:
' z. O! [. _$ a( e7 u% h__FLYFF_INITPAGE_EXT
2 J1 }# O! j6 d5 ^) _4 Y9 b5 A, y定义6 }# R$ j" j, ^" z/ [" o- G; D
0 o' E! Y! Y$ \& ~3 H1 _+ R: o+ L
8 v: B; M4 r9 y' @0 D7 @
" I$ h5 _( I) H8 K& j5 P现在终于删除我的狗屁加速...
2 b N8 L7 k0 l- @4 C& u; ]6 k: U# ^5 i8 o8 k; j# p
" O" ]" F9 m4 u9 G
& j" ]. T. r/ t. K |
|