|
|
食品车:
* K& ]; r2 j1 y( E" v7 B. C尾翼:
( f. ^/ C( e: ~& C0 [6 N. ^. H8 `
2 o: o* d- W ~4 Y代码:
" ^8 C6 {1 p! KCWndAutoFood::CWndAutoFood()
! K) B4 B% B. F. T3 D2 W& Q/ @" e{
9 m5 b' A5 Y- o) X! {- @4 ` m_pItemElem = NULL;, {5 M+ t& q* F6 N) T
m_pTexture = NULL;
2 T9 l/ u1 d4 ~, P! {8 l2 p& { bStart = FALSE;
$ o6 D J7 {& v/ \6 e, a3 \$ [- `}
& I5 Q- _; D0 N0 i$ [3 f3 ~0 f: a# B4 _) U
CWndAutoFood::~CWndAutoFood()6 h3 p" m/ S* x7 F5 S
{
4 d( R6 C4 e' N, D" |- t AfxMessageBox( "AutoFood ist gestorben " );
: E: D- H+ V! G6 O9 m$ x8 J}
0 p2 p" j- B O; h4 D; z( hBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )* \3 T7 e' [' G/ P) e. _$ |: F
{8 v+ N9 N; @. _; g" K( d0 U3 d
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
: J" V6 e$ z5 r2 \: H2 {9 G}
$ b( @. H/ N O; s
3 j+ i. S3 N! YBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )+ r. _$ o$ }; H: p6 y+ H. W
{
1 [$ X, |" f! M( r LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );. H( \ [. t4 j% |: o' z
CRect rect = pWndCtrl->rect;; d# [( L. P: {' o1 K0 i" Q( c
if( rect && rect.PtInRect( point ) )
5 X. e9 _: v# O' d, Q {# N. Z/ u4 \: B- H0 |6 n
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId ); S8 c3 S" B; t/ G2 w7 d: W
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )) Y4 l7 B. h! g$ S4 w; i. Y
{) [' j4 K5 h$ f+ D9 o
if( m_pItemElem )
* c. h1 K6 O( g: X% Y# g {1 E! F8 ] B& m9 g1 y- x
m_pItemElem = NULL;4 B; R: s# @8 G8 I a" g$ y
}5 k: |! w% y' `3 S; p
m_pItemElem = pItemElem;
% n6 J& a4 P2 z m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
5 R. X- C6 Q- ?% q; V# K! j, ?7 S; G }else{0 {3 d9 o* E5 V0 g9 u4 `9 C
SetForbid( TRUE ); ^) V: J) M4 A3 u E& @' \: s2 }
}0 m8 F. B$ `# k7 B! x3 k
}else{6 `$ f) f" j: A! m l+ r! w [
SetForbid( TRUE );
/ _5 r4 E, F# j3 B% g7 U }6 h4 h4 Y: J! D8 A7 D- ]7 z
return TRUE;
p2 d) e1 M3 L' Y" m}
, A) \' G. z( I; e, T" [5 r6 @9 H" K* n0 [0 @# @% L4 i
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult ); I! s% e' t% w8 ~& J4 ?* N9 G
{3 P# O. U4 B; O/ D7 l
switch( nID ), k& l+ V1 l' _$ _6 |0 _ r" R
{
+ G0 W2 ^ P$ v3 P+ l% I case WIDC_BUTTON3:
; U/ z4 a$ G! L$ | {8 r$ c( l4 _( |4 o
bStart = TRUE;
, ]$ J( c! z9 x4 H. [" c, U break;( v3 ~6 A! u, F' s& B# G' b
}
0 B4 @/ C9 R; `. q case WIDC_BUTTON4:
) j- ]- A( d5 K9 ~/ ?; y {
& i3 ]( K- W& C- [; E bStart = FALSE;
& _# R) O% P7 I break;
& h- o) D! I, ?! O: `, s% K }
* Q% f7 E7 R' }' A, p; U! T8 a$ h }2 R+ P' p& k( \5 }: c7 k& f
return CWndNeuz::OnChildNotify( message, nID, pLResult );) ?& K, l# F3 E/ ?2 Z$ R
}
& _, ]" N: k v9 ~: Zvoid CWndAutoFood::OnDraw( C2DRender* p2DRender ) _ Z3 ?1 g) d( m: ]5 f1 V
{
" C: _0 k1 [/ R) F) b9 t CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );/ z \9 m! ^4 C( a; i3 R
if( bStart || !m_pItemElem )7 |+ e: Y, r4 u: C+ t
{$ C/ z) [% |4 c0 G6 h/ z5 c, T
pBtn->EnableWindow( FALSE );5 s b5 Y+ |/ z' ?) T4 E- L2 f
}else2 u, ~/ F0 W1 ~4 w- G
pBtn->EnableWindow( TRUE );
8 d6 u: ^) v5 ~* Y4 L if( m_pTexture )
) b) x& H6 t3 b% E; }7 m+ O {
8 n5 N c1 c" w# I* {9 ~7 I LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );/ @: Z$ Y2 B2 v" ]; z& l
if( wndCtrl && wndCtrl->rect )
3 t+ j+ W }0 A! P, w7 _: ^ {5 R* [9 m& x2 g' P6 b- f
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );6 m1 E4 h4 s7 o$ R* h
}
. F, U4 c+ @% u. d }. S* |) {; I/ J5 e0 S( f, f' l A
}
% M* n$ T1 d8 R7 O: _, g$ X0 s) Z% V0 d0 c; |5 F3 ]
BOOL CWndAutoFood: rocess()- O' s* V8 A- I* R
{
q8 s3 j9 s& {( ]$ x if( bStart )
" _' s' ]- M6 x4 g$ {: f {
l, M( B: k& W" a5 ?5 } if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
6 X" f6 X8 F' Z; }% T% d {
L! U5 g4 q- o& {5 l+ }. B# Y if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )$ {! r, R9 H& X! | z
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );* j. d% X0 h0 |9 {# y. Q
}else{) s( Q/ L( w- u% y. W9 T5 h+ a
bStart = FALSE;: X/ R( ~7 c8 e" U; N
m_pItemElem = NULL;8 m+ n* _6 _3 `5 Y
}- [9 h. M9 d9 |
}* o9 k! l4 ]% [" C0 P& c1 G
return TRUE;
Q' t5 G) c# v8 q& a+ u}$ N, E# p1 y8 Q, P- F2 i. n @- z
0 w# A8 f+ R* C# d% ^8 q
登录视频废话:* d- s- A8 v* K
尾翼:
. L2 Y4 H% S. B& k% _$ \# i2 e! h0 j/ y+ c1 o& h4 P
代码:
6 P& M8 c* ^# d
0 F Y% t4 E( }' ^void CWorld::SetLight( BOOL bLight )' v+ g! ?% B6 l, p
durch$ A1 d' {3 ]8 Y8 \1 h
Code:7 Z3 H. G" E, O9 C8 m! i& D; T' ^
void CWorld::SetLight( BOOL bLight )4 Z" u$ Y% j9 u4 K7 {# C7 a
{
1 g8 v3 D4 ^- @$ d //ACE("SetLight %d \n", bLight);" H: F+ i% K$ @
2 |; ?, r* Q7 {3 \2 y#ifndef __WORLDSERVER
; Q' J. n; l+ B4 ~ DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
% k* @/ m( a: A E CLight* pLight = NULL;
: w5 T% e- [2 h) C1 j. N% S. z& E4 |: E8 W; X- ?+ \
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
7 a: B$ j4 \5 [$ A
- q3 X) v# H- P1 d4 g% W3 ^/ Y H9 g pLight = GetLight( "direction" );: x1 d) E) ]9 Z- ^
% q3 b4 j; i& l4 c- `8 V/ A* o* }0 m
#if __VER >= 15 // __BS_CHANGING_ENVIR, o# k. ?( B2 C6 w8 }$ _
if( g_pPlayer ){
& L) ]6 ~8 u5 S/ r% S& R ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );# ]2 ^* E+ [! m! A. q3 u, W' Z6 j7 @+ Q
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
& }$ \1 x: W7 V: |. @. l) p {
$ E8 p" c } R if( pLight )) y. G( t% v4 H
{
1 O v/ f" x& f, G' K! q pLight->Ambient.r = pInfo->_fAmbient[ 0 ];) [" }) b# d; j& ^" X g( V9 b9 G2 X
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];1 i4 w; x* }! P# o1 A: ?
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
7 u* p s2 }: a9 j B% n& v7 H7 Q
+ @# `: O1 p" N5 D' \( | pLight->Specular.r = 2.0f;6 E0 B @. M! ~. U. A8 y2 s0 r
pLight->Specular.g = 2.0f;- i& b3 l2 _! A5 s- T
pLight->Specular.b = 2.0f;
) g. }" f9 Y/ T, M* N. m6 l0 ?: H & _! ~$ d- `2 `1 J! \; m
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];, O) X) m% F# k9 v% f- f
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];6 O0 r& q, ~2 r+ T8 ]+ |
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
]) c; G; y& {( x0 m6 R3 [ ' R5 V5 B2 Q5 |5 T0 m+ w! M0 |9 }+ D
HookUpdateLight( pLight );
8 S( U% ^) o$ M/ B2 |. H
& D9 O4 D! J7 R4 w* v memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
, `( Z1 \. [# Q' V& @2 `
x& I4 \: ?3 m/ q pLight->Diffuse.r *= 1.2f;# R0 w# K) r- A7 A" \) P
pLight->Diffuse.g *= 1.2f;
1 l+ |, g9 K- d9 J8 n pLight->Diffuse.b *= 1.2f;
4 ~) E7 H! `/ n2 ~% I
- z* \, S( W. l& Y pLight->Ambient.r *= 0.8f;
, I" u9 Y# a- m# P3 Q/ Q pLight->Ambient.g *= 0.8f;
8 F* o9 U9 z( o$ ]% Z) t* y pLight->Ambient.b *= 0.8f;" G; {- t" @2 v
. Y( `! a. j, M) W7 E& { memcpy( &m_light, pLight, sizeof( m_light ) );
2 J! A# R6 E8 L! y
- m: I7 Z6 ?5 q D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
1 \. O0 \$ A* {0 F D3DXVec3Normalize(&(vecSun),&(vecSun));6 F& R# P2 I6 G7 z
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 8 B" q% p% a: z4 a
pLight->Appear( m_pd3dDevice, TRUE );) w/ ~) B: k! l4 E9 p% R# d
; d* t4 U+ G- u; _
DWORD dwR, dwG, dwB;) _* v; C0 q2 q
dwR = (DWORD)( pLight->Ambient.r * 255 );
4 H& L; T; i$ F; X# T( }6 o5 R. _ dwG = (DWORD)( pLight->Ambient.g * 255 );; ?2 w& A6 @% d5 L/ _6 ~9 O" p1 E
dwB = (DWORD)( pLight->Ambient.b * 255 );
/ c. o! E1 n; ^4 R6 }. J dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );% d ]( t: v! D& e0 x0 C7 M
}
6 C; U- t5 B( q1 ?/ W }
" u( f- X. Z& ~3 V }
# M5 O8 s8 c5 F) o$ U# L! }. _ else1 `# C; x" o; E5 ^
#endif
0 I9 R3 l% l0 R) e$ n0 w8 U& Y7 s, F5 b; Q1 _" D/ R( B, x7 P0 E
if( m_bIsIndoor ). X, O7 E' B, T6 D
{
2 U N( F& F( I% Q5 S) d) G if( pLight )
0 l: b" H/ J' L9 c {
% `4 f% s( B5 J% Q2 K- n( k% Y C // à??μ oˉè*
8 L, e0 V' q3 a/ k1 z! l pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;" ~/ e" v# j* P" [
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;9 q; e- \, I) [' m
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;. f# ^3 v( Y- C$ z9 h0 O6 ?6 A+ {
" p' |% \- }1 n& t // oˉè* ??à?
. k- `+ }6 i" x+ K4 h7 s8 ]* h/ R pLight->Specular.r = 1.0f;
* H, k1 J2 F: y1 B4 S: M pLight->Specular.g = 1.0f;
( s" N; ~5 N: F7 f. N3 B) m pLight->Specular.b = 1.0f;
5 \# j7 E0 |( C% s& D // àü?? oˉè*
* l; `$ G( r/ i* S, x/ ?" I& w( } pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
, V! w2 y& I9 l4 m, A pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
+ p/ B! T; `7 F$ X5 C; C+ P& f pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;5 Y% b6 b* V1 C9 |/ Z% u
1 ^; j2 C& K0 Y; B# w: ]1 C
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
+ D: D# J4 H6 R+ m; f {2 @! s6 l- P8 v& N% B" r+ @1 v" @
pLight->Diffuse.r *= 0.6f;, }" P# k( t+ h
pLight->Diffuse.g *= 0.6f;; C4 i+ W" o7 v/ ~
pLight->Diffuse.b *= 0.6f;
9 X2 a7 Q6 V j* e pLight->Ambient.r *= 0.7f;* c4 W$ W% U/ `7 C& {
pLight->Ambient.g *= 0.7f;
. R+ j* s8 f9 o& S9 ~; R# } pLight->Ambient.b *= 0.7f;+ v# q: s: l* J4 B+ h: z1 z
}
. U( c; P1 r0 F3 N! n9 ?8 b) p/ i7 ?
) e/ I; s/ h! j9 n* Q#if __VER >= 15 // __BS_CHANGING_ENVIR/ B8 Z% h2 Q& `7 s: g
if( g_pPlayer )
8 L3 O( Z* e; q/ L HookUpdateLight( pLight );
) Y @% E) j, A! P, y) S#endif, i! S3 p! E b+ f6 {
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );. |- d- a' O x1 Q+ e
) b1 Y. r1 ? p5 l9 H8 h pLight->Diffuse.r += 0.1f;
: y& @) l0 E' k pLight->Diffuse.g += 0.1f;1 ?+ m. v$ k" q) @, e5 E
pLight->Diffuse.b += 0.1f;
' w: U D+ r4 w& C8 C // oˉè* ??à?
; Y: G- R. }& {1 G3 u8 I pLight->Specular.r = 2.0f;
( Y. L8 E S) E pLight->Specular.g = 2.0f;" u' v& Z# k* \# W, Y( g3 }
pLight->Specular.b = 2.0f;0 C( P) ~) j; Z5 a) a
// á?oˉ
0 E7 q5 ~) P, b9 p: B5 ` pLight->Ambient.r *= 0.9f;% @! A) [" I% i& `7 Y
pLight->Ambient.g *= 0.9f;" ?2 E2 y8 X+ W3 ?2 P
pLight->Ambient.b *= 0.9f;+ ~' Q- @2 U* y# n4 k+ Y& g
6 |9 B1 v+ _! u4 R r
memcpy( &m_light, pLight, sizeof( m_light ) );) r! f- U2 u" Z9 c4 i
9 K1 w+ U- F6 R0 y! j! z8 A pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );! b/ R% v, Z# U3 a% `
pLight->Appear( m_pd3dDevice, TRUE );
K, R$ T+ ]& w& { ) n% P! q8 p; A. F/ W5 T5 W
DWORD dwR, dwG, dwB;1 z6 I1 Y- U; Q
dwR = (DWORD)( pLight->Ambient.r * 255 );6 J4 v" U; l q
dwG = (DWORD)( pLight->Ambient.g * 255 );. @2 n. G) @) N, M3 E1 N/ F5 q# ]& W
dwB = (DWORD)( pLight->Ambient.b * 255 );
& p2 S' W9 T. r2 E dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
' r1 z: J- t) y, R3 O( w }
( P+ Q; }8 }6 @ }
2 J' m: x, S# u. k- I/ A* c else( n/ S+ o- I7 @( p; i
{
; V2 @1 d4 `- }% C0 d9 u% B if( pLight )6 F; }4 z- X$ W7 V' O1 S) A" X
{/ [( M% F C" F0 R: R. G# [1 V
/ ?- n% m% E+ Y int nHour = 8, nMin = 0;5 n8 \. `* c$ W5 T
#ifdef __CLIENT: E- v7 o8 \& `! p/ W3 @
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
* N' K$ f/ [, P) E9 t nHour = g_GameTimer.m_nHour;
8 Q* V7 p! g% x! A+ A: O nMin = g_GameTimer.m_nMin ;" l G' V+ S% ^, S* N
#else
! p" @# G9 N7 v7 M: u( _& _3 W // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
, p! }* i( T9 z6 Z) F& q5 A if( m_nLightType == 1 )8 P$ D7 w1 t" l4 o
nHour = m_nLightHour;) T7 }' L" U/ l% H
#endif
, ~4 e8 N# [4 B1 w/ s( E4 A8 s nHour--;$ r# K0 D, ]+ w' u1 U
if( nHour < 0 ) nHour = 0;2 q/ R4 [2 P5 `2 W0 G0 N
if( nHour > 23 ) nHour = 23;
# j& t: w& R3 S4 j' ^
$ M5 N3 q) E' m& K0 ^0 j w9 P //if( m_bFixedHour )
4 i' f% u* v0 b- w) B$ y1 M% j% P! r // nHour = m_nFixedHour, nMin = 0;( V* S* ?4 `4 X& J( D4 j
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];% ]% X8 t6 q5 L& h; g- g- e' F
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
4 a) Z7 L0 R$ a, T! B* Q: E3 _2 p& T2 X; t0 q _) s
//m_lightColor = lightColorPrv;
/ a) Q, h; B+ ~( o lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
5 g9 ^1 E2 M9 b1 X; V# ?$ U lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;0 S, C) A+ v& U6 k5 y8 l+ G3 x# A
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;5 y/ O L$ p+ ?+ _
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;4 r8 W1 N; R7 Q
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
) Y& L, k, g: N, ` lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
" r$ _1 W1 f% G& o // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)$ b! y# [* z B7 O
0 R5 F, D# d' T5 z) [ // à??μ oˉè* + \ K' j' M- M( H- l
pLight->Diffuse.r = lightColorPrv.r1;% {" Z8 y+ P' q) R
pLight->Diffuse.g = lightColorPrv.g1;' C+ h* ^- [' M
pLight->Diffuse.b = lightColorPrv.b1;7 ?7 x6 L6 Z- h& z$ ~" k: f
// oˉè* ??à?
. Z! S: `- N5 c: S% j) N pLight->Specular.r = 1.0f;& e; G/ n+ ?$ p$ o. `/ |' x7 o
pLight->Specular.g = 1.0f;
+ X& ?; p7 o2 F- E5 F" i7 W pLight->Specular.b = 1.0f;
7 U6 R7 U6 \4 q5 @; ~ // àü?? oˉè*
# }0 W$ W" v9 O# \9 h8 X7 A pLight->Ambient.r = lightColorPrv.r2;# A0 W# n: v7 ]
pLight->Ambient.g = lightColorPrv.g2;% {8 D& m, v" J' v
pLight->Ambient.b = lightColorPrv.b2;
5 S, H: }( X, _9 T& F
- M# H: @7 c) z4 l$ n- G if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
- e- H; i$ j1 c# H+ U/ V {
/ ?/ |6 U! q6 [ w pLight->Diffuse.r *= 0.6f;
5 [' |9 G! [" ^3 u+ m pLight->Diffuse.g *= 0.6f;, ^+ v% @" C# ~; T
pLight->Diffuse.b *= 0.6f;0 s, Q4 ~0 L& L7 |; X/ f" v N
pLight->Ambient.r *= 0.7f;$ d; K' v. q" C" H
pLight->Ambient.g *= 0.7f;5 | H$ D3 z3 p: j( |7 J
pLight->Ambient.b *= 0.7f;
+ y$ Z3 o% @( }5 b7 b4 V }
: W# M2 L6 c& I& }2 w3 R ( l: {/ f4 K& {: l/ Z& L
#if __VER >= 15 // __BS_CHANGING_ENVIR$ y& y: `! P* u8 X* d
if( g_pPlayer )! N& [. O& o$ ?, W3 d; }( c( n
HookUpdateLight( pLight );
* a$ S* F! v/ P6 N# N+ R3 S! H9 ^#endif
; u5 H6 F+ S3 o% b; ~ memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
4 x! \+ \; N% l2 w6 _6 F: v1 C4 ~9 P6 \2 ?& K
#ifdef __YENV% I9 l" K1 ^$ i5 ?' T/ k2 _ k* B
pLight->Diffuse.r *= 1.1f;$ _; |( c: n4 T+ ]8 P
pLight->Diffuse.g *= 1.1f;
2 r1 T6 x! X0 G2 y. q9 \, z+ C pLight->Diffuse.b *= 1.1f;
: o* L0 U# O w& E // oˉè* ??à? 3 c0 N$ a1 m, \; p2 g0 V
pLight->Specular.r = 2.0f;4 z" M& Y+ N! m, S& G, W
pLight->Specular.g = 2.0f;" n+ @; A, h, @3 X( Y9 |' u3 h
pLight->Specular.b = 2.0f;
7 }( Z. b# q3 t5 }7 Q0 c // á?oˉ
6 E) T1 R8 ^% s pLight->Ambient.r *= 1.0f;
/ _' F d: \, m+ B) T3 e pLight->Ambient.g *= 1.0f;( y1 y* b0 \ \) m; ~4 o5 |# @
pLight->Ambient.b *= 1.0f;
" \7 h' q5 O% w$ a+ c A2 M#else //__YENV
" u0 \4 E( c J8 ? pLight->Diffuse.r *= 1.1f;6 l" S1 i# H% I6 c" ^0 O ]
pLight->Diffuse.g *= 1.1f;, W7 K, E2 Y% v8 c
pLight->Diffuse.b *= 1.1f;
" S g* ~! o# Z- G8 v // oˉè* ??à? % T; s& H5 M' b8 c, z- n1 P% a
pLight->Specular.r = 2.0f;
: ^2 i: x+ Z6 v pLight->Specular.g = 2.0f;
; E/ `9 o" Y" R) b! G# ]. E pLight->Specular.b = 2.0f; A3 U9 S r9 z& {+ E1 U }
// á?oˉ & e" [1 ~' O' f
pLight->Ambient.r *= 0.9f;
5 ]- {1 f8 i1 M) w% ?; h& } pLight->Ambient.g *= 0.9f;7 i( x. P- m. u/ ]1 s$ g$ v
pLight->Ambient.b *= 0.9f;1 h/ B& r* f5 D0 ^
#endif //__YENV : n8 W+ Y) ]8 G7 C1 E0 ~( P: r
0 V2 x9 F* ]% m# a h& Q7 j0 j
memcpy( &m_light, pLight, sizeof( m_light ) );' r) B, h# S7 o9 N
4 E" [3 \& I. ] D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
% K j% T3 I% G: Y D3DXMATRIX matTemp;1 A, E: F! o: @* K0 w
static const float CONS_VAL = 3.1415926f / 180.f;
" F8 ^' d; r6 ^" g# a7 o L- A! ~1 c- y6 W8 i2 `( j" F
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);+ q3 w F& b2 z
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);- e/ i R% ~% x. P1 X
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); 4 E! E0 [) |5 E- W6 Z! w) @4 Y
pLight->Appear( m_pd3dDevice, TRUE );3 Z3 K9 _3 w, I) x6 t
# a' W. s, J7 ~; v2 w5 a" H // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
; \/ y/ ?2 u9 p% a: a // D3DXVec3Normalize(&(vecSun),&(vecSun));2 h. o) s% u3 N5 O
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
5 @+ I, c/ }. S: S3 B* c; \
5 N" Z$ z) q- G) Y6 o' H& I3 L DWORD dwR, dwG, dwB;5 X3 ]* m' a# }* q
dwR = (DWORD)( pLight->Ambient.r * 255 );% J, }1 C6 T' }2 w/ j4 h
dwG = (DWORD)( pLight->Ambient.g * 255 );; C9 z) B8 d6 c! F3 z% g& H- O
dwB = (DWORD)( pLight->Ambient.b * 255 );
+ Q- S! Y0 R: E) Z5 ~" p dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
5 k7 F- a" p7 o6 Q! m+ _ }. r5 _* h. x, B3 B" T
}- x- J2 N; C5 f
$ ?8 I. }: g$ V( C/ W& Y9 q
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
" M) k. d2 f# `# ^# G2 } 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) );
# ]0 b. e, O& U$ w ::SetLight( bLight );
# Y' h L. b* z1 c$ T3 j5 h! o8 I2 t0 @
// ±ao? ?D?í???ó á¤à?
) b2 `# l- C1 m* G% c$ S# l m_pd3dDevice->SetMaterial( &m_baseMaterial );$ x' l2 N- s. B N
9 n5 K4 p, ]/ E0 B# g1 p
#endif // not WORLDSERVER
4 S, h# I/ j$ x* d, {. r& ^$ h' E}
5 ^8 F, E. H- o3 r并更换( b, }+ U. u+ ]( Z0 t$ B8 }
Code:* ^/ M! m0 n. D; k+ M
__FLYFF_INITPAGE_EXT
" ?8 a1 ?& u' z; w& u0 {9 e定义
) x% V3 i1 z- n( x% ?8 _& w3 `1 K9 x3 o; g7 o
' D$ m* S7 v; i% E1 P5 K+ j' N" p+ O! t2 m* t2 f& e) U+ k1 A5 S
: Y: w/ l/ v0 e% [ J7 p+ ^
现在终于删除我的狗屁加速...$ t( {$ h5 l2 Z3 q9 R9 e" ?
; V( u# C# j0 @; a4 p/ ~
8 t5 u5 k* R5 S* @0 r( M8 B
2 X/ I) f2 E* ]( y D R7 u |
|