|
|
食品车:
! t0 C. ? R. @+ F$ t6 p! o0 B s尾翼:
6 c: f3 w; T, h2 e8 P+ u" C3 v
/ O6 ] |" u; {# s- U$ l- L代码:
: \* p1 Q2 t* `CWndAutoFood::CWndAutoFood()
0 }3 r& L& t `, F, m{
0 w X% k2 R" S2 k# ^ m_pItemElem = NULL;% ~5 O5 N) B3 ?% M& {, \
m_pTexture = NULL;
, n! I& q# [/ X bStart = FALSE;
" ~6 `. T3 E' b- B}8 _# g( @, Y5 m5 u9 \* \7 U/ _# }
% v, p1 d4 x& l0 @5 m' e5 ~) ^+ H
CWndAutoFood::~CWndAutoFood()
& M) l7 ]5 A: b2 T& ]" `8 [, f8 S{ d. J; b) N$ _4 f& Q0 U3 K
AfxMessageBox( "AutoFood ist gestorben " );
5 \2 d. c( I& E$ e# i9 I2 f% x}
7 W' C1 Q L5 w/ n4 rBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )7 y5 C2 \/ F8 U, G, E
{
: B/ l, y: A4 B) L return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );# M8 {5 u( g. l. @" d) G
}6 x3 d0 O$ W( U" P: O# W. D% Q
# r; a# p. r. ]* gBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
( @4 e2 E" R# \6 A; h2 B{
9 M: L3 Q u% t, K& K LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );8 Q0 Q/ b" c4 p/ ^
CRect rect = pWndCtrl->rect;
" w3 \) P9 e( {7 J+ d1 _. V if( rect && rect.PtInRect( point ) )( v& A7 D5 ~# h B
{: V) @7 U% v! s8 V# O$ j/ e
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );) A, S4 `; @6 T
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )) M+ g# a% J( J( s! z- M* o! r9 q
{
; o$ w, f- ]; S' n& t if( m_pItemElem ); f3 [6 H# \$ k$ O& i# ^+ o
{
( v* t* }% y+ M c m_pItemElem = NULL;
( S8 A0 ?' W2 e) \) o9 h6 Q' J9 b }% v0 L1 D! ]& G* F$ g: W* S! t# R2 g
m_pItemElem = pItemElem;3 Z9 s6 H: _4 ~/ _% C
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
7 x2 ]/ R+ }3 C( Q1 g; a$ B/ v }else{
1 v" V. h5 O' D+ U SetForbid( TRUE );! W n& v( h) x/ i n
}
; N5 k; F1 U% s; E }else{
8 I$ n# V0 N0 s+ V, f! o7 w SetForbid( TRUE );/ o7 B& J' S* `" J, [8 J# C
}
: }$ B8 E' ^- D8 ~, ^5 y return TRUE;
$ ?, P! A( m1 h' a( f: H& B1 p}* i8 R2 {) {/ A- C% c
( s5 |4 e* v) z8 N( }
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
0 C4 n; {7 Y2 G7 _% ?' S{0 K7 ?- m, W3 l7 o3 g" ~4 r4 Y- Q* Y
switch( nID )
6 P }' o- i; |8 ~/ w* D. w {) b \0 j3 e) D( W
case WIDC_BUTTON3:
6 w( E8 T% E/ \$ [2 u {8 N& g% k4 D3 a l# O, \: t4 z6 G
bStart = TRUE;
$ e! p7 W5 f+ q1 W8 N2 M break;
2 E# [& p; M m3 z }
) a1 o1 t V# o3 { case WIDC_BUTTON4:/ s. H1 D6 }1 h) Q, J
{
5 s2 m" j# ~ B, j7 X( A* y6 \ bStart = FALSE;9 ?( H$ m$ \2 x2 ]9 O! l- z% _6 U
break;
6 M' J9 |, Y% o }
! C$ L/ l3 M1 q( Q }" \2 d2 g8 `3 p, j. `
return CWndNeuz::OnChildNotify( message, nID, pLResult );
# w) q" u' E# Q1 S- b- |& [4 ]} " A8 W) _* `% ]
void CWndAutoFood::OnDraw( C2DRender* p2DRender ). S/ X) J, o+ E# @; _0 W8 y$ S
{
l& q/ R( w1 O CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
. z0 g: g8 q8 t, ~ if( bStart || !m_pItemElem )2 Y$ w% \/ X7 H3 l/ f! Y
{
+ K" Q) W1 c, W2 R pBtn->EnableWindow( FALSE );
4 A+ c; }7 h+ X# z: h }else
6 [6 ~: O& t- m- J, a( t pBtn->EnableWindow( TRUE );. m" K: `7 U' k6 K9 Y3 \
if( m_pTexture ) q7 k" W- A* a2 a! I* [8 I; ]0 J
{
_2 r" i/ d$ A& R LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
, o* o7 [3 K+ Y" O, y$ ~ if( wndCtrl && wndCtrl->rect )
& r6 L/ M4 O9 J Q {
+ d# S' J1 L" L& {# h' o! K m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
" d4 g6 a3 m. m0 y) R# A" l8 N4 S. \ }
) R& L$ _3 Q1 W# s7 j }
5 M T; Z/ ~- R# x, J}5 }+ i8 f' d8 G4 p) [% l+ M
" Y6 x( ]2 _; y1 Q# [, sBOOL CWndAutoFood: rocess()* u# q5 R! ?& u# p0 U
{
3 T/ E' a: ^) P. U7 s if( bStart )7 k8 W7 {1 B( d# _" G
{. \. y) b) z/ y, @
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )- q, B0 f& B- v7 Y
{
/ U) g- U. H! a8 I if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
, M9 M' O4 ^: @ g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );& ~( n0 [, E6 \0 ?& d3 {1 t
}else{: V4 O/ P+ ]$ F' [( a
bStart = FALSE;
, R& Z0 \' F1 D b& W3 V, z m_pItemElem = NULL;
4 H( p8 J4 ^# x9 S' G }8 h/ `3 E7 F4 S/ }9 H. ^# B- G' u
}
7 P S7 P2 v4 @' m$ v$ ]; k return TRUE;4 T: S' d6 E8 i( E
}/ M U5 q) T0 k7 a; o' l
/ u: w. p0 ]0 F: o, Z. u3 R. _1 u登录视频废话:
( j( S* V% O. P" U尾翼:
" Y. x( `7 M. q6 |6 p8 |3 ^; S3 t7 _( k
代码:' K. H! P' v' B; v" v8 x T
: ], L$ o, F8 W! }: Gvoid CWorld::SetLight( BOOL bLight )
9 v- G M! ?" g5 Z- Kdurch+ x% g) ?" ]# K, C `! U8 A; o
Code:
! R% m) ]1 F5 X: Evoid CWorld::SetLight( BOOL bLight )
5 m% }% k! P4 `& Z9 g) [- D{
/ P6 ^1 h; v1 b2 y& t, d //ACE("SetLight %d \n", bLight);1 J S8 n7 [0 |3 h6 b
7 d7 O8 E% U7 H/ \2 \#ifndef __WORLDSERVER
d/ W% ^, K1 V9 g% Y DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
$ M" H$ T/ O @' n1 [ CLight* pLight = NULL;# b, B* _7 Z. u, ?1 a
; K" J0 o( b2 A
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );& }8 c5 V4 j/ B, A/ ?0 f
+ G/ o( T8 X% T9 ]! F pLight = GetLight( "direction" );
; q K0 h, n/ \$ r+ f- ?0 q m; X; G& J/ u
#if __VER >= 15 // __BS_CHANGING_ENVIR! [! c) c! ?) k7 r7 @; E
if( g_pPlayer ){1 W9 K, f( u; m- g
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
+ I+ {' W4 f8 G# I$ y+ y( s- J" H if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!. S+ y0 S; P& Z; M$ q. d% C3 e' G% [
{$ H$ Z1 l+ N# f, |9 ?+ U
if( pLight )
4 g6 x! u; j! A0 F8 y {
# t" Z. k& C+ a! C7 e3 Z+ s) ] pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
1 z. o5 B/ G* y' D- t, m pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
/ c* F1 S7 f0 a7 X pLight->Ambient.b = pInfo->_fAmbient[ 2 ];$ V3 T, R, R8 v; a* d
' E4 O' }- z1 P4 }. s pLight->Specular.r = 2.0f;5 t0 q1 ~% f: a+ g6 s0 I$ F
pLight->Specular.g = 2.0f;
7 D6 J7 z, L; v8 Z, t, x pLight->Specular.b = 2.0f;
& `, N# h: S) ~" D9 t/ N3 u
) A8 ^7 [; V: u6 x6 T+ R pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
* q v V9 Z6 J5 }# | pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];) n$ l2 X2 t. Y' t6 v$ b# Z
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
8 g5 m+ j& s6 Q 1 c( N+ l, w0 B
HookUpdateLight( pLight );
, \$ ?" o, @$ g- @( t* i- f/ T/ P9 E! v7 x8 w; `- o
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );( ^4 T- y1 ?4 u* m& g6 ^8 v
- ~) }- o5 R: f( X& M N
pLight->Diffuse.r *= 1.2f;
4 n6 F: p; h' q) k9 w/ g) b0 G5 j pLight->Diffuse.g *= 1.2f;, @1 h/ X: g4 E" ?( _5 U% ?
pLight->Diffuse.b *= 1.2f;
+ R8 y0 c! k- d' X8 z# G" _3 O$ I* n6 | i4 j+ X, x3 \
pLight->Ambient.r *= 0.8f;7 N9 S7 H7 ^8 F6 _3 \
pLight->Ambient.g *= 0.8f;; C8 v( r k7 N
pLight->Ambient.b *= 0.8f;/ _: P! {0 S, p- p0 A
- r& E) F9 f2 M \, Y1 c memcpy( &m_light, pLight, sizeof( m_light ) );
2 L$ g& V( h4 {- r' c; l( X% ^
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);0 n1 A" V0 b- k
D3DXVec3Normalize(&(vecSun),&(vecSun));
+ P8 F0 \; n3 z. B. x+ k# v pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 8 {! \! a7 \' P5 H- S9 `& K4 @
pLight->Appear( m_pd3dDevice, TRUE );
2 L7 N% W& p* j0 L) {1 D' o V [
* ~( o8 c$ F7 K DWORD dwR, dwG, dwB;
1 _5 `$ B9 ~# k: w( h( P dwR = (DWORD)( pLight->Ambient.r * 255 );2 x0 h' b/ g# \2 z4 b% \7 T% b
dwG = (DWORD)( pLight->Ambient.g * 255 );
( }5 Q8 k1 U m, v0 y4 v. A" c dwB = (DWORD)( pLight->Ambient.b * 255 );
) t' X6 L& S& G# o; c dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
' g3 Q+ K! Z1 X m' N5 i }
s- W) x7 x. O6 O8 q } {. T! |( ?) ?6 V9 ]2 l
}
+ m- n4 I) i5 W% S else9 _2 T: S/ a1 W# o* ^; \% {
#endif % f5 [: ?, T. c9 a# Q H- w
+ _( z" _9 ^4 [# {% i* _& r
if( m_bIsIndoor )
3 W2 j. O _( U/ }2 M0 F {
6 T- X# P+ I% a! G5 p! m if( pLight )
' A+ Q) V4 s9 ]" c( e3 {$ i7 ~ { ) I% j% y+ J3 y. ~' G9 Y! H# _
// à??μ oˉè* ; ]4 U. C/ P; E' ?% g* @' \
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
. P* E$ u- P2 j3 \! w6 H pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
5 I' |& m$ z4 `+ s; R pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
& w, o; f( P- }2 t$ k3 V* n( J% T, x+ h
// oˉè* ??à? # b- \ w/ w* h: {# @
pLight->Specular.r = 1.0f;
% y) i% [, G5 W) l3 e) z pLight->Specular.g = 1.0f;" R" U n* t4 z. L) o$ s& y3 N
pLight->Specular.b = 1.0f;4 M: i c) D. N, w
// àü?? oˉè* * d- _7 k1 F' g& Z
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
4 W3 O" d3 t) z' P$ O pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
* s, A4 a, _3 \* y pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
3 s4 M4 v5 Q& J9 O. x
1 s/ M; [6 o4 g4 ^$ t" \ if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
3 I) z# T9 G& L; L2 }8 r" O {
# T: d+ C" `* I pLight->Diffuse.r *= 0.6f;: q! V, E8 L, a, ~
pLight->Diffuse.g *= 0.6f;1 `- b% c6 \, L0 j0 A
pLight->Diffuse.b *= 0.6f;
. u8 d$ s- x4 a9 \) r; } pLight->Ambient.r *= 0.7f;
1 _) b, B* r5 i1 R* ]1 { A pLight->Ambient.g *= 0.7f;
; j. o5 u% |9 j2 |% H pLight->Ambient.b *= 0.7f;' Y' v2 X+ [ k7 w0 _& }3 e5 V
}
. U; [) F" I/ I6 a' n. I7 |/ M9 o: [4 X( \9 F
#if __VER >= 15 // __BS_CHANGING_ENVIR
( Q5 n, e1 Z1 j. I" t! b: G# O if( g_pPlayer )
+ }) r: g8 }0 `# v+ t! ~) o; P HookUpdateLight( pLight );# h# O9 Y+ v# ~* ]2 \
#endif! Z( V u' R. e7 o
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );1 { v- v# k1 B) S. T
+ c) Z) |4 U3 F o7 i# s1 h, Z pLight->Diffuse.r += 0.1f;$ g; A9 s' j8 s* X4 |4 [1 W8 d
pLight->Diffuse.g += 0.1f;
4 h, I$ Z6 Q: G. D, b! f6 |; J pLight->Diffuse.b += 0.1f;7 t+ {1 ]9 s7 x8 w8 J( O
// oˉè* ??à?
1 P5 A6 Y2 W0 C2 E* h$ O- W$ J6 [7 l pLight->Specular.r = 2.0f;
* A% ^8 R4 o0 ?/ i& Y) H pLight->Specular.g = 2.0f;! p1 h, W! R% y- ]
pLight->Specular.b = 2.0f; }/ d0 T2 B$ Q1 R' L9 e
// á?oˉ
9 R5 k4 u. R7 A& A pLight->Ambient.r *= 0.9f;
2 t% _5 c' j0 j- f7 | pLight->Ambient.g *= 0.9f;# \0 G9 \5 }: U: Q+ U
pLight->Ambient.b *= 0.9f;/ m+ E1 H2 @* \
* I8 r$ q/ C; ]- B9 O memcpy( &m_light, pLight, sizeof( m_light ) );
1 R3 E; q* b" I( g ) M" ~" ]# S2 n5 [
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );+ K" e' z$ J3 H. G% e
pLight->Appear( m_pd3dDevice, TRUE );' a' |$ J. m' o8 w
3 n" ~; g* z0 [/ C7 L DWORD dwR, dwG, dwB;# g( @0 D" e# z& n! L I& d
dwR = (DWORD)( pLight->Ambient.r * 255 );
: Z) g- y( U/ I1 ~6 P dwG = (DWORD)( pLight->Ambient.g * 255 );( l# ^* s) z0 T5 h
dwB = (DWORD)( pLight->Ambient.b * 255 );
" f& n" N$ `: U6 g) N, h% X% j dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );3 z. q5 V1 Z p0 s
}& [4 W5 k, C9 ^0 U$ k
}- {, u' l" k5 S$ o' R
else
$ P, ~; G' r$ P# Q" o5 l7 e {( [$ g0 M% w6 U
if( pLight )
6 v1 D) I( S" N6 B {& X9 w% k# Z7 Y- q: S9 ?
) ~6 H. V9 F1 {1 T/ c- @) c
int nHour = 8, nMin = 0;
- O+ V }9 j5 M2 E( h' h& { #ifdef __CLIENT
5 q- s# h+ j/ ]. l9 a; H // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
2 I$ v2 f5 j8 u0 a! B nHour = g_GameTimer.m_nHour;/ {" |$ `# g# j2 V3 T
nMin = g_GameTimer.m_nMin ;
: e8 ]; d+ ?$ M0 `5 Q #else
; K7 R3 _: Z* o7 f0 d: h // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.# F' d9 M8 F6 B0 }& |2 g
if( m_nLightType == 1 )5 G8 e6 h/ O' m1 E2 V( D
nHour = m_nLightHour;
7 Y+ f. y. u0 ?$ `8 }% j3 n #endif, N$ N* u7 R2 k4 A+ x- P3 ]
nHour--;) ^5 J( Q5 `1 C
if( nHour < 0 ) nHour = 0;
" q1 F- @% Y( X1 S# |$ P& } if( nHour > 23 ) nHour = 23;6 s: F1 D/ w6 G) Z1 z
/ E2 u$ o- M' X
//if( m_bFixedHour )0 h0 _2 A# V, n1 n- b/ b$ X o
// nHour = m_nFixedHour, nMin = 0;
3 b$ o% L$ ?9 z0 h LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];& c: V. R& e+ T8 o- k
LIGHTCOLOR lightColor = m_k24Light[ nHour ];, V1 j9 O6 B; G
; R7 Q5 }( w9 C1 R/ N' C7 T& [ ` //m_lightColor = lightColorPrv;
6 Z$ p9 i( q( z1 [ lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
|0 N5 @ x5 ]) a0 p" k6 l lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
$ h7 C3 T7 x- G0 S lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;. E0 z3 X7 A: ]' o
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;3 x( j) B l, r) E1 W
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;+ I8 Z0 d$ A3 g% i' _9 I
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
' C' i* Q1 @9 ^3 j; {; p // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
% P5 _2 G( p. X. r& f a1 G* _; i1 ^2 V2 y- l& J3 s5 p4 A0 s. m4 R
// à??μ oˉè*
( F- F9 w" o0 T6 j) t( x pLight->Diffuse.r = lightColorPrv.r1;6 n1 @" u+ [( N
pLight->Diffuse.g = lightColorPrv.g1;
3 [9 c* x" i4 a& t3 r8 y/ X pLight->Diffuse.b = lightColorPrv.b1;
. ?9 G8 ?0 O0 k% V0 j // oˉè* ??à? i# J' z+ _( O! H6 n4 T1 J! ?3 o
pLight->Specular.r = 1.0f;
r2 R/ r# j4 ? pLight->Specular.g = 1.0f;
/ v5 ~' [/ k# r, }, i pLight->Specular.b = 1.0f;
- R8 ~/ |" z8 s // àü?? oˉè*
1 J6 X: T* |8 l5 j3 c pLight->Ambient.r = lightColorPrv.r2;
& ?6 M5 t2 R' D( M+ E) C* L2 e pLight->Ambient.g = lightColorPrv.g2;+ T5 n A( |( e" ^: ^) J. D+ m9 f; w
pLight->Ambient.b = lightColorPrv.b2;
! E9 z. B) S( y4 }
' {6 ]$ n$ J: _( Q; N4 T- Y if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??." [# b# I( H$ }5 D1 a) S ?
{
& R" {6 G8 \+ t/ I. S& m pLight->Diffuse.r *= 0.6f;
7 x$ P( b- K( K0 @% c) y pLight->Diffuse.g *= 0.6f;( |0 m9 N- M+ l' [8 u
pLight->Diffuse.b *= 0.6f;6 C" j: I* b1 Y/ I: b* R; F b3 u
pLight->Ambient.r *= 0.7f;
4 R. c4 R1 P/ f6 o' @: ~* [( G pLight->Ambient.g *= 0.7f;
. G3 s' y, U& l pLight->Ambient.b *= 0.7f;: H6 G/ r7 b# B! o
}. ~' w0 A# |& K2 N
" i% G- R7 U& G. J- N
#if __VER >= 15 // __BS_CHANGING_ENVIR
1 a3 N$ A# W% ~2 {$ M# M if( g_pPlayer )
# o2 x, _0 {2 e: I- j HookUpdateLight( pLight ); % H3 Q6 W) e& R4 p& R; T
#endif
- d1 T0 O5 [8 l+ K memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
8 I/ {5 G& I2 P0 ~7 \- q4 c
9 R5 {7 O5 G P& u) I: u: r7 f#ifdef __YENV
6 d% V+ O5 e v9 g% Z pLight->Diffuse.r *= 1.1f;8 B( ?( k& p+ a- H* s, B! f2 e
pLight->Diffuse.g *= 1.1f;+ v$ J" P: o F z ^
pLight->Diffuse.b *= 1.1f;; y: A0 t* E( k& A) |/ G
// oˉè* ??à? 1 H: ~) M& V" a# l- w
pLight->Specular.r = 2.0f;
9 g1 k' F* D, k9 B0 a pLight->Specular.g = 2.0f;1 d3 P1 U, k2 j& m
pLight->Specular.b = 2.0f;
; F+ q- s8 v0 E# N& N // á?oˉ % ?5 G6 n8 {; S0 r( s6 e- u
pLight->Ambient.r *= 1.0f;" z0 W- X/ J6 E4 x/ {! {' ~# G5 P
pLight->Ambient.g *= 1.0f;
4 F! w% O6 ?: M6 b1 o pLight->Ambient.b *= 1.0f;, H0 @* r2 c/ y
#else //__YENV
7 B& W* P1 l) Z: Y1 Q pLight->Diffuse.r *= 1.1f;
. `( k+ _) _( x+ d/ K. F, r pLight->Diffuse.g *= 1.1f;
; b7 ^1 d2 u$ `+ H5 r% b* Q7 |1 { pLight->Diffuse.b *= 1.1f;
( p* c$ S0 j5 x7 L+ |1 \ // oˉè* ??à? $ B, g) d7 j& ^: h' Y/ J
pLight->Specular.r = 2.0f;6 `6 ^) g) p# V% V, k4 _" G
pLight->Specular.g = 2.0f;/ \) Y% i" r2 ?
pLight->Specular.b = 2.0f;
8 V3 e7 P- I& v. |9 t8 N& H4 F // á?oˉ ( o+ b" |0 I; S3 U. j- T5 W
pLight->Ambient.r *= 0.9f;
! Y$ {: d5 D4 k: a pLight->Ambient.g *= 0.9f;
2 [/ L7 J% G. E5 B o* w& q pLight->Ambient.b *= 0.9f;
( U0 j1 G) a5 {' \, ?7 C! K, D#endif //__YENV
& V4 Z3 M* X. T! W6 h 9 w* u' O3 Y" p, c+ F( L% G0 C% ?- x
memcpy( &m_light, pLight, sizeof( m_light ) );+ o: _! M3 Z% w9 E4 y' l! c
6 M3 s, R& ^! b; q$ s% {& D. j
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
+ l! H1 g7 o4 j# N D3DXMATRIX matTemp;3 n' f# H6 U& F+ ]5 _% J
static const float CONS_VAL = 3.1415926f / 180.f;/ R/ V5 u4 p- H- ?5 \! k. H' B
! Y: m# ?% \2 q" n% @2 r
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);/ Q! B: N, ]0 m* E) J( u, L
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
% H3 g6 `8 P, Z% S pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
$ h" P( k5 {- C, z pLight->Appear( m_pd3dDevice, TRUE );7 M* M% j. s& h
( F: u7 S0 K( @/ E
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);$ K x* x! q2 x- Z; A4 H
// D3DXVec3Normalize(&(vecSun),&(vecSun));
8 u: O* e" ^" r9 V, R% e7 E, v // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
3 v8 N8 E8 e7 y! c0 F& H0 \( Y: Y3 A' c7 V/ ?0 a4 Q) v
DWORD dwR, dwG, dwB;
$ m/ U9 n M, F7 ^/ b; _- J dwR = (DWORD)( pLight->Ambient.r * 255 ); ~' z8 r# e/ w
dwG = (DWORD)( pLight->Ambient.g * 255 );* K8 u+ k1 H% @; k
dwB = (DWORD)( pLight->Ambient.b * 255 );
2 j6 E- y; Z; g dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
# h: R3 Y- a1 ~4 |0 c }- a8 W8 ^" k6 \+ G) x
}
7 d. I4 l, [+ C2 Z1 r6 ~* A
" n2 `+ B \! e4 u9 J" ^& c m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
( }" U- C: F2 N+ r2 \5 n 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) );
: K/ _6 Y! I' T1 q ::SetLight( bLight );+ X _$ G* Z; `4 Z
( a/ j; e/ @- O6 t
// ±ao? ?D?í???ó á¤à? ( N" X% H, s5 `" Y8 O
m_pd3dDevice->SetMaterial( &m_baseMaterial );
, t# M' s2 g" Z( m ! G! I1 \& o0 a2 c/ C+ W) q
#endif // not WORLDSERVER
4 N% r* H9 q& H0 _, }* D}$ b: a# g7 n" L! `) C- j$ {0 e" V
并更换
$ u9 B1 }" l6 v/ G9 gCode:
; U% X: V7 t: _5 {8 U/ T__FLYFF_INITPAGE_EXT j6 L& Z/ i% G# C
定义9 Q( N( u3 k7 {. h6 X
* g% c- L5 r" d. l$ Q+ I5 w. g5 K
2 F% l- H7 R3 t5 ^! l1 |. z0 P4 E- y: E
+ V; C3 K, ^- r) I; u. a9 z0 G
现在终于删除我的狗屁加速...* i, X) Z$ R2 m2 O
`5 k0 t* N1 W2 p' ^6 a. ~6 Y# T) r$ F& ?0 F$ `# N
$ X4 I, C# }1 t- Y |
|