|
|
食品车:* q& x+ K" a9 b+ C2 {) G2 `
尾翼:% c+ q2 P8 K4 y1 ^
; t0 K1 R% J' G5 _
代码:3 x6 R( W: t; j; l
CWndAutoFood::CWndAutoFood()% K8 B7 r/ `4 _
{7 L7 ` J& n: b S
m_pItemElem = NULL;
/ Y! w. e6 ` I2 V* N7 F4 ]: t8 s m_pTexture = NULL;
( s- R+ n, O9 S( i% L bStart = FALSE;
( o: l& q. J- X9 p0 ]}6 t* `7 G& k; M, }( G# ]7 `
* d. Y1 n8 Q% J- w% p+ JCWndAutoFood::~CWndAutoFood()
5 P! L7 R2 O# Q: B; Z% b& [3 o{& z1 o' \& K4 d4 `8 @% L
AfxMessageBox( "AutoFood ist gestorben " );
7 s, a" @" |2 J8 l c0 Q}7 I# h5 |! J" z, G8 ]6 B; i% }2 S7 c
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
& F. M5 M X. E: T- L. j{0 x- c" i0 e9 ]8 C
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
w) P# b* b; l. B0 A3 P}
& U( e I0 i( e: w6 M" t, @& Z( m T% w2 n3 v" C7 T8 G5 p
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )0 m( x5 C' E3 T
{
, V8 c6 T" O6 s4 Q, @- e LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );1 P- p8 A" d4 E& w3 O. b
CRect rect = pWndCtrl->rect;. S6 G: W2 m5 x5 d2 U0 _
if( rect && rect.PtInRect( point ) ), N, ^( j/ ~7 o2 F* X
{
7 b5 ]# q# }+ }3 w- m$ E, ` CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );' t9 x/ Y) t9 g3 k L' B
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
- g3 c7 W% ~) p$ @ {! S9 z0 @( d w& t! i5 T( h) K
if( m_pItemElem )& s9 E( I/ y/ e/ Q# ^
{
4 \+ U# g8 u; p' H7 Q. ~: t m_pItemElem = NULL;5 [/ A0 w3 h" o; ^ q
}
9 l; Y; Z+ r {1 b8 i7 Q! ~ m_pItemElem = pItemElem;: n# S6 V# w1 K9 r9 t
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );- _/ i: M0 g/ H1 r: x# P; l# E: Q
}else{
9 V- {5 m4 D" Y% ~, e; q SetForbid( TRUE );
- `9 g* P4 m( m }# O) }+ w& u3 r, `* }* I2 D# d
}else{
- G- X$ w% }7 s2 o# y+ z @ SetForbid( TRUE );
6 Z m6 }1 D, U* A5 m }/ A7 U7 T' ^1 t4 j" e
return TRUE;
3 _+ t4 b `1 j, H U, R}4 X! j6 g. B6 o, M! P# p
; v7 w2 d: [* l0 \. O5 Q/ B9 iBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
" V& V* x) r' e. Q4 }3 X/ r{
* W* l9 b& p6 ^6 n9 e$ R switch( nID )" I {" U% g4 C
{
1 n f; G4 i8 D% {) g* i) w2 R* Y case WIDC_BUTTON3:
$ [0 E+ C& }" Z+ F4 U {" J- K* t4 U- _9 R: q2 A( _! M
bStart = TRUE;
( R9 N( c; O0 S3 o% K break;+ R/ X, J: E0 H- q e3 B3 T' M
}
1 M$ p6 v! X' B5 J case WIDC_BUTTON4:8 [" W9 H' O! \% ^0 _: }5 w
{5 b) x8 {# p; {" e5 R& o( a
bStart = FALSE;( ? n( {8 e6 _8 n `% k
break;
; c& i/ S$ [9 j, H; N& I }4 m! O9 g# q2 u6 n4 W
}
" ~8 T( _* R2 R( W$ a5 n5 {+ m return CWndNeuz::OnChildNotify( message, nID, pLResult );
1 `: K" n6 b8 T. m1 Z" R" x}
$ N; ?1 ~ q; |" qvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )# Z u. k% l/ N: k, {4 J
{3 h, O1 i3 h2 j* h4 F
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
K3 Q) _! M, H; u* K4 ~% B# { if( bStart || !m_pItemElem )$ A) R( }! l1 D
{4 a: B. S! @6 g3 x5 D$ k0 i
pBtn->EnableWindow( FALSE );
5 [& `) c- I. @+ U" W3 G }else' ^6 p# X! h5 S( b9 b7 {0 h( _
pBtn->EnableWindow( TRUE );4 r9 \, {9 W" ?! p1 x. Y
if( m_pTexture )
" T8 ]5 X8 R6 K8 S, A+ X" C {
! J+ h; u$ L# i1 B$ L LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
: w. f4 W- s) n# J* @; ~( Y if( wndCtrl && wndCtrl->rect )
1 R9 |& J0 i( g8 w9 X/ q! r {
3 T c4 [! N$ ? C m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );8 s5 S8 P9 ~, M7 W
}
6 ^; |! r$ `/ u! R }
7 E3 B* B; Y4 O% D}
; |! W/ O7 m+ X; d; ]
0 y8 g1 |0 }; B' e4 ?9 XBOOL CWndAutoFood: rocess(): u0 M; d4 I) K6 @! n$ F
{
, W: V+ Y7 W7 }) J% d if( bStart )) ~8 h! c+ W9 V' u! a' l
{ K4 ^9 H( q. y p; ?! {" ]5 Q4 \
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )! B" \7 l" ]* x' e; b# d2 @
{/ U! n& U% r- d z, X
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )3 B" q5 @, `. [* r) ~6 [3 S1 d; d
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );1 G5 c \! |0 A }! n# N" }
}else{
+ A5 X( f7 y+ {" H( n bStart = FALSE;$ N$ c; W9 G7 o9 G
m_pItemElem = NULL;
* {. `* ^7 }: ?. c4 T | }
/ d2 q; O4 \( J0 z }
# @& A# W" ?% E( [$ J* z) f6 g( z! K return TRUE;& g ~' B. m/ }0 ` f
}
1 S$ @: z$ B* _$ F d& Q) S @+ j- s6 y8 y: F2 @$ F
登录视频废话:7 O, K E7 _+ [ v$ B6 ^ A2 [
尾翼:1 v' y/ q4 p) t7 r) l5 ^1 [$ e1 u1 j
3 Z1 T( N E: k0 u3 y" u代码:
$ O- m2 v" E- A" S+ @+ b3 U h
/ T/ J% e& A: U4 b. r+ E# M% Zvoid CWorld::SetLight( BOOL bLight ); w. \" x& J3 w! w$ G
durch
J' i- B) t. ?0 X. q1 V _Code:
/ ]% w) B5 f+ s9 S0 y1 evoid CWorld::SetLight( BOOL bLight )
1 }; G* e# D3 A8 S/ Z. M{1 G# v6 [# j0 |; v9 J9 J! g! [9 y
//ACE("SetLight %d \n", bLight);
9 \; J3 d! C4 o/ }: P4 H - q8 J! c' n3 D2 i" X! m$ S- q4 u' m
#ifndef __WORLDSERVER ) x; w, s2 c% N- h$ T
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);; x* y& _& H# M H D
CLight* pLight = NULL;
5 R& j( |! r2 P6 g4 V# ~4 { C( e4 O# V" s0 E8 ?2 i0 t* u/ K/ J5 w
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
9 d1 w. O, V3 s1 S. j0 |
d" ?+ h0 `( r- @2 p6 j pLight = GetLight( "direction" );) E6 |4 @8 Q; `
]/ Y9 F7 e2 R5 ?
#if __VER >= 15 // __BS_CHANGING_ENVIR
, b0 ]$ s/ H' C5 h' ^' G& L if( g_pPlayer ){
* V; |/ {- n% J, }& i7 T3 \' i) A ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
3 @: s; J2 q- x+ o0 ] if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
; X# W# q3 _4 {+ q {% v. y* D6 o8 Y2 t
if( pLight )% ]6 J6 }/ J1 D
{& h+ R& s" k( a% R
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];" [. i) x9 M8 a1 E9 |6 z/ i
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];( c9 t0 S; L, E9 _
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];+ `! P& m, ~3 Z+ \7 e
: v4 t# P0 n6 L( n6 g( y( ^2 L0 o
pLight->Specular.r = 2.0f;1 E" h4 d* a3 L& Q0 G) \- ?! d4 A" V
pLight->Specular.g = 2.0f;
( h+ u1 [1 _. m+ D j, U5 w pLight->Specular.b = 2.0f;
% z `3 l# X$ B! W1 f' n( C
6 h6 _0 @* z3 v9 ?2 v pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ]; o* L( K) p9 I; _' U
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
* S- N9 v, P) |6 t. k3 s pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
5 F' W% y$ z4 ]" m8 @
' a$ U5 ^+ v/ E HookUpdateLight( pLight );
1 T! y2 n( K: ]% C6 M1 d T( T5 E8 N
2 C2 q9 R) `, d( e9 }$ }7 E memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );5 K; c+ [1 W" G$ U
! d5 S6 {. U) z0 i+ v# w+ n pLight->Diffuse.r *= 1.2f;2 }2 A# H8 T, E4 c8 |' A
pLight->Diffuse.g *= 1.2f;
9 `! y1 P1 {' q8 |4 i& y pLight->Diffuse.b *= 1.2f;
- K v0 p: l" K
, ^7 m" C& ~# ] pLight->Ambient.r *= 0.8f;% ~. n4 P& o, i& t1 u& I
pLight->Ambient.g *= 0.8f;. q; p4 V) Z2 W, Y
pLight->Ambient.b *= 0.8f;
2 B# J: P5 \" Y, S
) u/ b3 E# u. @0 @; K memcpy( &m_light, pLight, sizeof( m_light ) );
3 R C' u6 {' {, Q) t0 R5 ^) v `% w" G$ _7 y
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);& a n! S" }7 P- c) r0 g$ t/ h
D3DXVec3Normalize(&(vecSun),&(vecSun));7 s) G0 K- w# i
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); , m) B' D% O, }/ f) P( T
pLight->Appear( m_pd3dDevice, TRUE );7 c: v. ~% |3 z: `
# A, N$ a5 z' S( `' X DWORD dwR, dwG, dwB;
; ]0 K [6 w7 _# C0 }" P' y( Z# c dwR = (DWORD)( pLight->Ambient.r * 255 );
+ Z% J; j* S5 ^/ ?- X+ n! |0 B dwG = (DWORD)( pLight->Ambient.g * 255 );1 D8 b0 {' ]9 I0 N" L/ i; R
dwB = (DWORD)( pLight->Ambient.b * 255 );
$ t/ W9 m, O2 e2 G- r( | dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );* `# z+ I! K5 |( O! _( ^4 q% S' y
}
" s1 K$ C) j0 F/ B p5 d6 S! V }4 d7 f6 A/ p. d+ q) \/ b+ N
}" C1 D: ?) Q- Q5 C
else
' x, |( [5 T1 l6 S" j, O#endif
1 s1 K$ n4 Q1 U9 g% E9 P4 S5 v! L2 z. C
if( m_bIsIndoor )
8 z! q( B* X) l' V2 y {
( u" W: U4 m. f- ~$ R1 ~4 y if( pLight )% V& j& b7 a; @
{
- o: W. C, i( p/ N0 b! Z. \' x2 P" x // à??μ oˉè* * H/ T7 `8 y, r8 m
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
$ v! y* s; Q9 B$ `% h, o5 _7 u pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
' Y C$ [3 P. O' e" R pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;% {% L8 G% ^$ h# e9 ~8 V4 U
4 q# k8 g5 b( D1 b$ o9 R6 c
// oˉè* ??à?
3 q" B0 O: e# a7 l, Q# d! ]- q3 F pLight->Specular.r = 1.0f;& Z7 y- |) z7 r7 q4 M+ N
pLight->Specular.g = 1.0f;6 x) T: Z2 [; }! u X
pLight->Specular.b = 1.0f;9 I3 d2 G* H' G1 u
// àü?? oˉè* 0 Y. [" W( t% K
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;9 w% X I) Q+ ?
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;& }+ C; O- w- w* ]
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
& q7 ~) ?0 s4 ^' m7 A
0 u5 J2 f6 x) x7 c: q4 v' W2 [ if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.3 [ w3 L( z0 l
{
* r: V. J0 R% g5 k- v# X pLight->Diffuse.r *= 0.6f;
5 s- ~; d' N; h! O: p4 f6 u pLight->Diffuse.g *= 0.6f;7 ?/ \) A- Y3 u# \" v$ }/ g/ D
pLight->Diffuse.b *= 0.6f;, Y _" u5 i* x5 O
pLight->Ambient.r *= 0.7f;. e% s% {7 r/ H# v0 y5 f, V; {
pLight->Ambient.g *= 0.7f;
- ]/ `) o: ]% e( E pLight->Ambient.b *= 0.7f;
1 O* l2 `6 R9 b7 h* ~+ j+ z }
+ ]5 W( N3 y3 }/ P7 y
. U) l' m" \2 X#if __VER >= 15 // __BS_CHANGING_ENVIR9 W/ E) v9 v/ ~- O! n7 n& Q, N+ }
if( g_pPlayer )
/ Z1 E2 i) s6 d2 G1 I" i% h HookUpdateLight( pLight );
2 a& n2 ]9 m4 S$ @0 F#endif+ P$ S2 e5 ?5 | }, d9 T# H
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
?" I+ i$ j4 b8 E$ r4 A; P9 H
: E8 q6 D7 N0 z# I pLight->Diffuse.r += 0.1f;; Z# w4 n2 l& D }* K# \
pLight->Diffuse.g += 0.1f;
7 I& X; A2 j8 I- I5 v pLight->Diffuse.b += 0.1f;
5 u* k5 r# A# s& ] // oˉè* ??à?
4 s3 J# T3 z8 z) ?5 W6 g pLight->Specular.r = 2.0f;& m2 Q Z# r4 x. l
pLight->Specular.g = 2.0f;
) Q5 I1 {3 b) g pLight->Specular.b = 2.0f;
0 _' Y' M ~3 N/ X1 z // á?oˉ
" g% b8 w+ q( a2 k( N, m pLight->Ambient.r *= 0.9f;
* r7 W& s' s8 h+ e& Z9 s" p pLight->Ambient.g *= 0.9f;
* q m* S; r n; w pLight->Ambient.b *= 0.9f;
, Y: e" n6 t- l1 U# r0 N: E8 Y( W0 _9 y
memcpy( &m_light, pLight, sizeof( m_light ) );
( {" e% u: x6 m! j2 M6 }# d" D+ Y
& z/ H0 g. y! q0 S) N4 ]+ }) \ pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
# q- P: ]. @6 z7 N1 f pLight->Appear( m_pd3dDevice, TRUE );5 p# S) K: t2 J4 n1 k
2 ]% O9 O7 P! @- |4 M( ^- Z& a
DWORD dwR, dwG, dwB;
$ C# F2 [: f0 c. L; S U dwR = (DWORD)( pLight->Ambient.r * 255 );
+ p/ H `/ Q, r dwG = (DWORD)( pLight->Ambient.g * 255 );
* U9 X8 D* o, w8 } dwB = (DWORD)( pLight->Ambient.b * 255 );
6 V7 u2 c/ u' e) M- h' [5 ~ dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
5 e |5 C, F) _: s) [8 w+ y5 N+ n }
( S1 G T4 ]/ x( X6 u! _: B }' c- ^7 D9 U) h0 e" R% R9 G
else
& P/ C v t7 c5 Y+ T {7 { w5 E% I+ f; i$ Z5 s
if( pLight )0 c1 d1 L7 J' ?, V
{
- H" P& X1 Z. f5 ~
: ?' U% i2 [5 ~" o int nHour = 8, nMin = 0;. d% f+ h7 K& ~. h2 j' `+ H. }' f% P
#ifdef __CLIENT
: v8 A' y! m/ Z8 M // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. % p- e, h! X3 X# d3 K+ v) h3 q
nHour = g_GameTimer.m_nHour;
; x3 f8 b4 i x3 D; L nMin = g_GameTimer.m_nMin ;
0 q P8 s$ L& g6 f0 \3 k7 T #else
! B2 Y; U" [6 P N% V* K/ D: z // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.5 c8 L/ K4 l" J8 u5 K
if( m_nLightType == 1 )
% g. T# Z3 K9 g4 y, [5 [: g nHour = m_nLightHour;1 S5 _( j, {/ B' E: |: W" F. F
#endif
: y) U- t' A$ ?- e$ @ nHour--;- j! {/ [ } r; R7 g8 Z* Y" q6 [
if( nHour < 0 ) nHour = 0;0 b( n3 U. r9 R+ ?/ X3 k
if( nHour > 23 ) nHour = 23;3 I) U% _) S5 n% k3 l7 Z" V3 @
5 t* w5 T! P3 D% v. X% k //if( m_bFixedHour )
! K5 c3 Y. y7 V // nHour = m_nFixedHour, nMin = 0;
9 }( y! z. ^! O P$ D& [1 R; H LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];5 |! b- c }% j* b: T: v
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
, x3 y; X! }6 T/ z, g& @+ Y& N- A# q* F
//m_lightColor = lightColorPrv;
. I; @5 e. f' }2 @( F lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;! o3 @8 M* y e: c3 E) c4 o
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
% R2 }( P. w/ J- b lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;. g& o; f( b/ N& k
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;6 K7 }$ _) k6 i p2 x
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
- x, r1 o" R0 b5 `, @' D2 w1 I3 \ lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
% h X3 u F( R( A7 c8 m# x // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
, b6 Q0 }: Q/ v9 n; \+ }8 b( m6 ?8 N! F) S
// à??μ oˉè*
2 `9 v1 I, v- }7 K0 ^: N pLight->Diffuse.r = lightColorPrv.r1;9 _$ t5 D. Z8 s/ c7 z
pLight->Diffuse.g = lightColorPrv.g1;
2 R# [" x9 g C5 ~& \+ F pLight->Diffuse.b = lightColorPrv.b1;
. b9 C% I) t9 l& V( }1 M // oˉè* ??à? 9 g/ M j& n: a6 j
pLight->Specular.r = 1.0f;
, `8 R& U( @; K0 Y: o' Z pLight->Specular.g = 1.0f;9 }% v2 t9 m" g7 q) k) N; f
pLight->Specular.b = 1.0f;* t7 i5 b& O4 F) M! M- |
// àü?? oˉè* / Q4 c. t6 n: i9 b: i4 g7 v& ^
pLight->Ambient.r = lightColorPrv.r2;
* l9 c, }) C# L" J. A. ? pLight->Ambient.g = lightColorPrv.g2;8 ]8 R# w5 o6 G0 F9 n Y
pLight->Ambient.b = lightColorPrv.b2;( n Q" q# Q6 u* l
0 n/ Z2 U( Q5 {" n
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.- v6 z# K; p! |
{7 |) @2 J2 G% `) c" z# }5 e. `
pLight->Diffuse.r *= 0.6f;
" s$ X) v; Q4 Z* e( C+ e1 } pLight->Diffuse.g *= 0.6f;
5 N k: u. z; c pLight->Diffuse.b *= 0.6f;
* |, O" k1 X [2 J8 V# _- s pLight->Ambient.r *= 0.7f;
5 a5 A+ P( Z/ ^7 G' T+ M1 R pLight->Ambient.g *= 0.7f;, Z: j% r/ p4 @0 Q! T- a3 e, K7 c$ O
pLight->Ambient.b *= 0.7f;8 g g, x- {% _4 ]; k- M5 F& ]1 m
}5 }. _- m1 K2 N1 Y5 B
' b2 }9 z+ Z! |$ C/ N: C" M#if __VER >= 15 // __BS_CHANGING_ENVIR6 O) Q1 {1 E* x- T
if( g_pPlayer )% p2 \* ]/ L. @, _( i8 q! d& K
HookUpdateLight( pLight );
- I5 p1 o8 J2 y& @0 |6 l#endif
2 V Y/ [" l2 x3 c% x memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 t/ L v' S9 k _' `. [2 U) j! ^' C7 K% v& E' Y& d
#ifdef __YENV4 d& |, U' I0 q* z) G g
pLight->Diffuse.r *= 1.1f;
7 `' a& N9 S8 l" p1 \ pLight->Diffuse.g *= 1.1f;3 @( R) w1 V9 n9 B2 ?9 k
pLight->Diffuse.b *= 1.1f;
" |( Y _2 E3 a- Y4 ~ // oˉè* ??à?
' U% y- T- b$ W3 K" y y: z pLight->Specular.r = 2.0f;2 @1 q2 I1 u( \" V
pLight->Specular.g = 2.0f;
- ?5 p2 t0 h. M" r) N pLight->Specular.b = 2.0f;9 c; u) U5 A7 A0 k3 X
// á?oˉ % x7 ^* W; c' \3 m5 u
pLight->Ambient.r *= 1.0f;4 |; Q) y& n& I% z/ G; z6 ^% N6 x
pLight->Ambient.g *= 1.0f;
% h* N: _. a6 L& m- W pLight->Ambient.b *= 1.0f;/ N& B' i4 O" f3 ?
#else //__YENV
2 L% y; Q7 M" i# j* G. |4 e pLight->Diffuse.r *= 1.1f;% s1 L" I7 |- F8 @& e. e0 Z6 q
pLight->Diffuse.g *= 1.1f;8 `4 E) Q9 p& f& c+ a( o
pLight->Diffuse.b *= 1.1f;( d/ C0 c! r, O& H4 p! p
// oˉè* ??à? 1 |2 t+ {6 X( G* K$ ~
pLight->Specular.r = 2.0f;
7 J/ T" f4 m! K `: b% \ pLight->Specular.g = 2.0f;' T+ G" L5 J* D+ D7 N
pLight->Specular.b = 2.0f;
- _- Q' k6 s3 E // á?oˉ
7 Y; | o- `. |: t6 h pLight->Ambient.r *= 0.9f;/ t* `# }! |% W& _0 }
pLight->Ambient.g *= 0.9f;
& Q# q$ @' Z0 z Y( ~5 T5 Y9 m pLight->Ambient.b *= 0.9f;
& V% U2 i" A2 _* n$ @+ e5 I#endif //__YENV % C0 R6 L( p- v% G
# ^' m$ x: }: s1 G+ P* R memcpy( &m_light, pLight, sizeof( m_light ) );
& b+ W, e! Y" B& {) o% F& u% R: \ % b' G$ F- ~+ U
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
5 l9 Z0 T/ {0 V* ]1 q$ u: W9 D D3DXMATRIX matTemp;
! X" M5 G* a( ^/ y, X; b static const float CONS_VAL = 3.1415926f / 180.f;
4 o; W* T" S" K; t4 }: O2 K
$ b2 _ H5 e N' y8 h D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
0 _2 J" v6 J- q5 O2 F9 ` D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);5 N( P# o/ w7 w0 Y- j0 W0 l
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); , @6 c! A+ o5 }3 I! @0 A# ^# \" w
pLight->Appear( m_pd3dDevice, TRUE );5 g* B* c" K9 N$ n
$ ]4 m4 f' O: o: W, l# g
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);! j. a# J3 e3 w8 x
// D3DXVec3Normalize(&(vecSun),&(vecSun)); |) `% e0 d U
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); : M& {% e$ e3 E
' s, X7 A1 r, t, w9 g" D DWORD dwR, dwG, dwB;9 A# c9 p7 z( u" y% W9 j' T5 N
dwR = (DWORD)( pLight->Ambient.r * 255 );
8 S+ A+ i: L5 C) O dwG = (DWORD)( pLight->Ambient.g * 255 );
8 r7 h; ^6 R# {2 S dwB = (DWORD)( pLight->Ambient.b * 255 );
0 c9 y( @. Q% G* W( U dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
( y9 b6 h3 T8 ]2 X2 X% K( [ }
* T' t! F* K0 b# P2 A+ z* ~ }# b) M+ Z( J, O: ^
# Z* ]1 u- R! S
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
8 r6 o9 i: \, k: l 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) );1 c7 O& q! G& a! w t
::SetLight( bLight );
! v* I1 P, F! A( L
& q( g/ W _5 H0 k& T, @ // ±ao? ?D?í???ó á¤à?
4 S/ A' Q$ `3 [; a m_pd3dDevice->SetMaterial( &m_baseMaterial );
`/ x5 r6 V; n- m5 u8 f) \ % G! q- h I3 A U/ q
#endif // not WORLDSERVER" M( ?. E' E( {% w" s1 b: i
}
- x x5 ~9 f! B$ H. Y0 i" s* U/ p并更换1 {+ @" _) Q5 Y
Code:- N8 s/ l) B- C5 F$ r
__FLYFF_INITPAGE_EXT
6 F6 g% e2 G* D l" i定义( ?0 W# K, y- y
! D- O' E7 k8 {4 u
3 H5 P# W9 m/ t4 ~
# S4 t, B1 u3 t
6 j$ P5 h( z+ y Y4 S/ [现在终于删除我的狗屁加速...
3 S, L: c8 t5 y( G: W. g
0 P4 g8 l- i7 o6 A
3 M. e) o& v1 R) E4 y) |: C1 Y, q1 }
|
|