|
|
食品车:
: n0 t7 {" S; f+ s尾翼:% j; E* k: d, n4 @7 p4 S
. {# C6 d2 @5 P3 f8 y) P$ t8 o
代码:6 m( H) t: q: ?
CWndAutoFood::CWndAutoFood()$ \! c% X. [' m4 }, f3 T/ D
{" `* z) E3 ~' m9 ^( {
m_pItemElem = NULL;3 _) x9 K1 D) I( u1 o! v( ?8 P3 R
m_pTexture = NULL;
; E6 m4 b) B' }7 |" J bStart = FALSE;1 O' f7 q0 U. U1 O1 X4 `0 v0 \
}7 ~4 r* k+ O" {5 u) k
A7 J. C; r/ T6 [
CWndAutoFood::~CWndAutoFood()
0 m6 p1 H+ R2 |: \{) [5 o0 U7 _; g: Q6 \
AfxMessageBox( "AutoFood ist gestorben " );
; H# e- \( {- P3 A3 ]- t; o" a2 J}
( p8 |9 o. R9 [7 h9 }BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
' e: F& m2 G( P7 J/ \5 N I; l{
2 t. [' F8 W0 ? return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
: d: X* ?% T4 h o- f6 _+ V# o}
7 N8 i. R: m/ q! \& `! R2 V
2 E* b$ a4 d: kBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
& b( D9 {, J7 ^" i: v8 [' w) D{
/ ~" y1 s- T4 \ LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
8 f: k% y* m, B9 v0 S6 [ CRect rect = pWndCtrl->rect;( F4 u$ B) Q5 M( ]0 |
if( rect && rect.PtInRect( point ) )% l1 J, m) G D
{
$ ^) s! W5 e6 f# q! F CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
) K" [9 T2 A% [4 c6 r if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )! @% ^- N/ q, L
{
H7 r8 l! C0 _( n+ ~0 a8 k, M if( m_pItemElem )
. u3 J6 N- V8 j# N% r' R% B1 |9 @ {/ b/ |1 O5 o# Z2 ~1 h
m_pItemElem = NULL;+ z* x' B: P! `5 E g
}3 w. _8 v; R0 _2 f' B
m_pItemElem = pItemElem;
& `2 o- M3 e, a7 c* B; l8 j m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
6 k) }* s4 P5 V2 q9 L/ g3 F: o7 M }else{
9 n( C0 c& _9 o6 }, u* n SetForbid( TRUE );! s7 f! @( U; I0 Y" {) ^4 e& `' v
}
& r; i# b/ x4 a6 E: A' D$ X) n }else{ y/ h7 r. E. C& p2 K$ v5 Z/ X5 ]
SetForbid( TRUE );/ F, _; e) L; H) q4 c2 q8 W
}- ]' y) [# F6 r1 c: ^
return TRUE;
& Z+ f$ c" f5 n9 z7 q4 c0 r}7 j) ]6 H) f, V
1 Y4 X1 p! K- K: u4 J) l
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )8 N) g( R/ a2 G! i
{# P& g. D5 L/ C5 I3 B7 Q) W& H
switch( nID )
. V: ?' t7 x% P {
6 B8 m& D) S* ^. i3 o5 i case WIDC_BUTTON3:
7 s" T4 w$ y( [' A$ V$ _' a" P {
. y! o# {$ C7 y5 ?8 ]1 X bStart = TRUE;5 q1 O& K' p" g+ v2 W* w
break;
' x" H' f# {+ j% T, q J }
6 u& F" x9 M6 F* m% @ case WIDC_BUTTON4:
0 Z5 [0 [- |/ l6 { {1 G E' f- Z; `9 D+ d R
bStart = FALSE;4 _ Z% s1 A: ]- Q- ?! z
break;
/ t: ~/ }8 }9 J- k2 Y }
5 S: } [! i4 J2 i }
% l) ` \3 ~* P" L+ v return CWndNeuz::OnChildNotify( message, nID, pLResult );
7 A( y! L. @. k1 l1 {% v' c) @" {# v}
7 \' t5 g: j7 b% dvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )
3 f. d6 m9 o8 h" D6 M{
1 y+ `5 ~* j- T( Q9 w CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );" {" {: C% i# X+ W$ R i, N
if( bStart || !m_pItemElem )& N- T% e+ Q) V7 i( d
{
+ m4 i0 C3 Y9 K1 S; q; b1 t pBtn->EnableWindow( FALSE );- w" R1 w* d% Y: t
}else
& h) Y/ `3 \ }3 f pBtn->EnableWindow( TRUE );
3 t0 n3 Z1 A* ~ ]6 @1 q5 z- ~; T if( m_pTexture )
6 L$ M% f) Z" R {
/ `# b5 y4 _7 a$ }! I( Q LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
5 C4 ^1 c4 ?! r+ p9 E( l if( wndCtrl && wndCtrl->rect )
6 v* z- ~5 C* W {
' _9 }+ A |/ u% P+ W) c( r m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
. @0 }% q! s% X3 H" e4 O3 Q/ j9 E }
; {& m, T( ]+ _1 O; o* J }
9 q# y( \" x% `6 i}/ t a! D, U: q; v
& i3 s! k5 Q; ?# P6 R' L$ t/ _! A9 GBOOL CWndAutoFood: rocess()! Q4 B% N3 t. T9 U
{: |: j0 I- R8 N0 G8 V
if( bStart )
8 `$ P2 A: R2 ~7 J {( U: u+ v- y* f% p4 T9 O
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )' `6 x2 \# I) ]8 P
{% O7 S m" C# b2 W* S
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
; F: J7 n! X6 S$ d g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );9 ]% m- f) {& A# a; U
}else{& |- l" S2 P: }# Y9 Z( x8 ^# {
bStart = FALSE;7 i1 ~+ c6 D" [2 q" d0 g9 F0 J
m_pItemElem = NULL;
3 b6 y. e. N% ^* l# k8 s% t }' [* a3 X9 b3 v' m9 x
}+ F4 \) ^0 M) [' M
return TRUE;8 W( _: @3 E+ n8 A
}; D, |/ W# r, i3 h9 g6 M
+ ~) L% r. p0 g1 |, _+ |
登录视频废话:
9 m% W( N- U2 o4 \1 z( i R尾翼:
& N/ s" Z$ k+ E/ H# e/ Y& V' l/ W6 B# \& c' K
代码:
' L; A4 L' ~4 l( R. H. ^0 x2 `+ ^2 X% F& b: n
void CWorld::SetLight( BOOL bLight )
/ F) g4 B6 f/ X' S6 B# _' Ddurch
3 D; z% J+ t* c2 c" e% z7 u) D" ACode:% t: b- F" L4 _+ f8 A
void CWorld::SetLight( BOOL bLight )7 `+ o9 s. A! x' Q/ E
{
" B- U$ R8 ^0 N/ E //ACE("SetLight %d \n", bLight);
: P6 ~6 a, ^+ C/ D1 ?$ y# D 9 k6 T$ j7 }+ C4 {2 Q1 k# C
#ifndef __WORLDSERVER ( P' A! q3 _/ h
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
' g5 @" A+ h" _: e8 ` CLight* pLight = NULL;2 F H* b' Q$ ]* p* ~% u: p
4 P/ L) i' [ Y
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );, X6 e3 l; Q, B5 E5 a
/ D4 o2 s1 v0 s" N pLight = GetLight( "direction" );
: |: ]& A! y( p8 g N' w5 p$ Y r1 F8 L7 v6 t0 e# W. R! E) o
#if __VER >= 15 // __BS_CHANGING_ENVIR7 k4 V, x7 B9 W% h( j# X% L
if( g_pPlayer ){
1 k7 h: Q: z4 O ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );* i5 b. c! I$ e n( H
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!8 o- f9 j& V) p. h8 j! d8 L
{
- z; o4 j" _7 ]+ d. W if( pLight )
8 A! C3 t* A7 b* ^& z( ^ {
' C5 a( J) q+ _, X pLight->Ambient.r = pInfo->_fAmbient[ 0 ];( _% E2 ]+ s2 o% H/ N8 F+ A6 e% x
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
* j6 R3 v& L3 _: W q pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
. `( e% R! v2 r9 k. t
% Q& K$ Y, P# r2 v pLight->Specular.r = 2.0f;/ g1 ^ [- b2 _# L' i+ a7 w! I, B
pLight->Specular.g = 2.0f;
* R4 e5 U( ^/ ~: N pLight->Specular.b = 2.0f;" |5 F' v& [$ u$ F5 C
) r, r6 [0 |1 n pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
0 F& Y: Y- o' v2 {1 X% h7 L pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
. f2 ?6 F4 D) N pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];* g+ @; o; C# d* S0 x7 K4 z
/ T+ T! K$ \! t' E" g2 d HookUpdateLight( pLight ); 5 K/ t3 Q2 z, \* G+ z2 z! B+ M
- w1 C! K8 Y. y5 f5 b2 E2 [: i
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );; }7 |3 }# D' l" q
% n: s6 v' N2 L0 y7 \! ?8 E
pLight->Diffuse.r *= 1.2f;. K& T7 o# l8 o4 {
pLight->Diffuse.g *= 1.2f;
% Z! _; S, f" X0 r, a& V" i! J( W pLight->Diffuse.b *= 1.2f;% x, m# C$ C' K
$ Q( F- d; x0 O pLight->Ambient.r *= 0.8f;
1 f; h) T, V2 }5 g pLight->Ambient.g *= 0.8f;$ K9 t2 G8 g1 P( D) U! p! b; p
pLight->Ambient.b *= 0.8f;2 u; q( F2 P: v) k3 z; Q8 c! Q
0 ?- P( p, m7 \: {5 @8 j5 Z/ v memcpy( &m_light, pLight, sizeof( m_light ) );: r7 ?% b1 q; W5 d
/ `- \/ n: }9 O; F- V* z+ l" Q8 N D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);- Q+ q" Z' c7 x' |$ }# M; W
D3DXVec3Normalize(&(vecSun),&(vecSun));' Z* F1 A2 _( l" S* z$ ^
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
k' `4 e; G$ @3 h pLight->Appear( m_pd3dDevice, TRUE );/ E% B) L% r6 _' o7 C1 u6 E9 b
7 {1 L: }) l4 D G' t- {4 v/ n1 K
DWORD dwR, dwG, dwB;
" I. E8 f7 b0 @" }8 F, B dwR = (DWORD)( pLight->Ambient.r * 255 );
f6 w$ R4 V) l8 c0 v5 w, K/ z dwG = (DWORD)( pLight->Ambient.g * 255 );
& C( b4 `& @! v, y dwB = (DWORD)( pLight->Ambient.b * 255 );; k8 `3 o0 u6 U* b& I
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
0 r. Y9 a0 p& ~( ?7 i } B$ i5 a) \9 y
}
6 a: ~/ V7 |" W2 f1 E, I }
) X ]9 k; B- J* M5 u, Z5 f else
' o# T q5 W( b. Y, Y4 @#endif
1 W# Z$ `: ]3 [. `. } ?+ v1 ?
0 q& h( C* B( c" \' L if( m_bIsIndoor ); V) a1 x6 Q9 i1 n+ @
{) _4 T1 f2 U. t# B
if( pLight )
& u$ f4 s- |8 M. y, M% Q+ U {
5 x$ @3 B5 {5 ]" c0 ]" m4 ] // à??μ oˉè*
6 Q9 y4 h) u7 t pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
$ ]3 }7 e T, V( ? r& L; ] pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
) a+ x' |& k8 {+ W7 k pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;' e) ?% c6 G+ T: g( q; ?
* B- [" A! n. p9 c" i% E
// oˉè* ??à? 4 I9 ~2 P( s$ o, E$ o
pLight->Specular.r = 1.0f;
( U8 _$ H; ?6 ]( E! ^ pLight->Specular.g = 1.0f;
9 l, [5 `. R0 v: o6 A pLight->Specular.b = 1.0f;
9 [ E% d- q: d, A // àü?? oˉè*
# `4 { o) D9 Q( L pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
' n8 G7 a: j! y, W" _3 f1 r pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;3 i7 K( S) ~0 P- H5 o+ P5 c% ~
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;1 h& h* x. U `+ X+ T; f
8 A& Y+ E- a: Z) V3 m8 j* V! p# h" x if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.$ o3 Y, U" k& E9 B- V
{
9 q4 ~% `) a& Z5 y& } pLight->Diffuse.r *= 0.6f;9 m) o9 x: w, N
pLight->Diffuse.g *= 0.6f;
. o8 ^& L( }& u4 l pLight->Diffuse.b *= 0.6f;
8 I Q; j6 q8 Z3 S- P pLight->Ambient.r *= 0.7f;4 B: D2 Y$ s: i( d
pLight->Ambient.g *= 0.7f;
) f" l9 @; G% o; [0 z pLight->Ambient.b *= 0.7f;; g: I5 s2 h0 a) @0 w- Q% K( g/ {6 M
}' ^5 G) p+ _" e, I* R7 l
4 a4 d4 F+ I. l#if __VER >= 15 // __BS_CHANGING_ENVIR
$ B3 G2 T9 [! e% o7 l& g if( g_pPlayer )& d2 q9 U* i3 C9 s) |. R
HookUpdateLight( pLight );
8 M& m4 o+ c7 D% _0 }& F/ R#endif
, e0 Z4 {5 |. \0 t memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
* U( b) i$ f3 X( `% `+ P/ i! J9 n+ \7 ] t( R* h. o1 O% {) z
pLight->Diffuse.r += 0.1f;
' a2 m6 F' @+ O+ _3 O pLight->Diffuse.g += 0.1f;& i; D+ ^8 W* G+ N4 a
pLight->Diffuse.b += 0.1f;
- Q5 w! j; z6 o8 d+ J/ {, j // oˉè* ??à?
. T& P$ p Z9 Q$ m ^ pLight->Specular.r = 2.0f;$ B" z; e& E+ X! o) G6 N: E. {
pLight->Specular.g = 2.0f;
" H6 G* c- C: y X2 Y% u pLight->Specular.b = 2.0f;/ c; V3 u" T9 X. R# w3 q* x9 r/ E
// á?oˉ
7 c4 A: [3 l( |) q i pLight->Ambient.r *= 0.9f;
: P) F* D* Q2 q4 U# Z pLight->Ambient.g *= 0.9f;
# [& |4 l( }8 @% \! I pLight->Ambient.b *= 0.9f;! i4 \% a) F) C( t* q5 g, \0 |, I
! N9 M9 u- ]/ i" ?
memcpy( &m_light, pLight, sizeof( m_light ) );
s5 x; e+ S( Z y * [+ d) a% j5 w$ Y
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );: d7 U& O9 U) g" i' w' M7 n' T
pLight->Appear( m_pd3dDevice, TRUE );- U( s' C3 Z8 c' Q3 G$ ]/ l b
- X! F# |9 i( w* n' K DWORD dwR, dwG, dwB;% {# A0 w" T. u9 l0 D2 B
dwR = (DWORD)( pLight->Ambient.r * 255 );
5 B4 n" P: ? L" F) ^. F dwG = (DWORD)( pLight->Ambient.g * 255 );
% x# w, e% @8 I8 b dwB = (DWORD)( pLight->Ambient.b * 255 );7 ~; Y2 q1 T7 h5 R5 v1 i" J
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
+ ?* j; m" m3 r' X! [" H }
* @$ Z$ a+ f6 Z& L; }( @( c$ d8 Y }
# d+ l' ]3 |0 D: i- c( e8 M% ~ else$ q0 A% e; P+ z2 L+ F ?8 G
{/ O8 ?4 M# ]$ N8 w- z
if( pLight )( e! f8 ~! X7 F {$ T
{
: Q6 |- @! C" s0 z8 R4 t3 f
$ r0 _' `+ p% O8 [8 @0 F4 ] int nHour = 8, nMin = 0;3 z2 H) x2 q' Q7 Z6 X: a h
#ifdef __CLIENT
& }" n+ a# u ~2 B // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. & a1 Y9 {- W! e1 B2 |
nHour = g_GameTimer.m_nHour;4 n3 O! `, z* i$ h
nMin = g_GameTimer.m_nMin ;/ e+ h! [3 W! n% |! o) b8 ~
#else: c* l8 ]: ~% r$ v: A9 ]
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
: ]5 I4 B9 p5 _/ j2 p$ p7 S, C if( m_nLightType == 1 )8 u2 r$ k- G3 {% Y
nHour = m_nLightHour;0 X+ E& R& g( j0 l) {
#endif
* z! T. e$ K& ~ nHour--;& C% M6 S& c2 U' H0 a
if( nHour < 0 ) nHour = 0;
+ g8 \) t* L# c3 c3 A$ @ if( nHour > 23 ) nHour = 23;+ }$ M( w/ K% k1 J3 ?
2 ^; G9 Q( o: |* J9 G' O8 E1 \# E; Z //if( m_bFixedHour )% Z) Y4 r; D! T) F( ?. \: D
// nHour = m_nFixedHour, nMin = 0;3 G3 p! T6 b! \8 w* _3 m) {
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];& [! O# N' \- F; Y
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
; t* R4 Z3 D- x
6 K% S$ T/ N6 w6 X( }, y1 z' Q //m_lightColor = lightColorPrv;7 q+ Q) J6 n$ m& m3 M ^$ r, f' N
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;7 z6 m+ ~+ u. ~ v0 [" Q
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
1 U* }- z' H( N4 g; q* H8 r; H: T lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
2 z% k; d+ t' c: f. T lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
( L. ?; {* I8 I$ G lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
- Y2 \4 z9 d R$ v+ w+ K- [3 \% j lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;: t& [# k/ A) \! y4 q r: g
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)1 n: z/ x. P" e5 S* j* d
! y" b+ K. V4 W // à??μ oˉè* 3 @) k( G( t* T3 p
pLight->Diffuse.r = lightColorPrv.r1;, o+ E/ }! X) }/ S7 l
pLight->Diffuse.g = lightColorPrv.g1;
( v1 Q* M& M( d pLight->Diffuse.b = lightColorPrv.b1;2 o) c0 J6 @" S/ @2 P8 h: V
// oˉè* ??à?
1 F3 v5 K1 F# q: a4 _ R, L. y5 A: o d pLight->Specular.r = 1.0f;2 U! g# I5 S* { B/ e
pLight->Specular.g = 1.0f;
5 G7 ?+ R) T' y% f* y9 b pLight->Specular.b = 1.0f;
) M/ f$ e, s6 Z/ l+ H/ j& ^3 K // àü?? oˉè* % t" @8 R8 M, E* l/ B, o3 P
pLight->Ambient.r = lightColorPrv.r2;/ s9 l3 A3 P( E3 s6 n" r
pLight->Ambient.g = lightColorPrv.g2;
# c% R+ E! _ c3 ^ pLight->Ambient.b = lightColorPrv.b2;
$ T/ l( S2 v+ h+ [* Y# O( G" V# q* A; G
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??./ e. N5 ^" I' g9 H( Z; Z8 \9 e5 _+ s" q
{( }5 C! |0 n: G8 F( L1 x
pLight->Diffuse.r *= 0.6f;
3 ^! H$ Y2 Q/ m: j" f9 F3 u pLight->Diffuse.g *= 0.6f;' ^4 G2 c8 t" F
pLight->Diffuse.b *= 0.6f;
A; o5 {* X; T5 K6 g8 l pLight->Ambient.r *= 0.7f;6 R8 o6 `. } X/ X2 X" B2 @
pLight->Ambient.g *= 0.7f;5 | |9 q4 E2 J) k3 v: Y" V2 b
pLight->Ambient.b *= 0.7f; r* N! Z+ }5 L
}
8 O W0 n( }" A$ l* L 8 H/ m& F. X4 t# o4 a. Y( \3 R
#if __VER >= 15 // __BS_CHANGING_ENVIR" l# Q3 Z* b; I9 y; A# b# d6 w
if( g_pPlayer )9 `; E6 m7 i7 m5 @! h$ @
HookUpdateLight( pLight );
' r% o t* D7 S/ ?#endif
- s: b5 K/ T3 h- B/ A, l6 O memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );& d* r2 Z8 k5 z! w
: n/ I( ^2 M1 n+ J8 l) k" J
#ifdef __YENV$ [* o7 u- a& V# u9 _
pLight->Diffuse.r *= 1.1f;. I& I) g, E/ T- `
pLight->Diffuse.g *= 1.1f; o( D" O1 \! m
pLight->Diffuse.b *= 1.1f;: H S( I# V6 V, y& C) k
// oˉè* ??à? 2 N; ]* p' I3 G$ F; G2 \0 H C. {$ T
pLight->Specular.r = 2.0f;) ^1 q! c' |0 g! s1 k* u6 @9 l
pLight->Specular.g = 2.0f;
+ E$ l1 t. a1 ?6 f- z2 ?+ K pLight->Specular.b = 2.0f;3 k5 \" Z. r- z% R2 g0 [
// á?oˉ
# C3 e! x* s8 w0 x pLight->Ambient.r *= 1.0f;
5 }9 u2 T1 G. N/ q+ r4 V/ s8 M pLight->Ambient.g *= 1.0f;
( E! j6 o2 ?$ w. \! W- P1 D pLight->Ambient.b *= 1.0f;
0 m/ z# [& x1 N#else //__YENV
x* `/ A$ \( G4 f; j6 L* [0 k pLight->Diffuse.r *= 1.1f;& ^ q. v# F, U
pLight->Diffuse.g *= 1.1f;9 T- V7 [, t: ^
pLight->Diffuse.b *= 1.1f;1 n! P$ F4 S5 I/ k$ z( i& Y" ]
// oˉè* ??à? Y' Q6 ^8 {" p4 ^$ q
pLight->Specular.r = 2.0f; ?& t0 c6 A# _/ C+ M& h
pLight->Specular.g = 2.0f;. i3 O; B3 J: N2 U* x
pLight->Specular.b = 2.0f;: M0 ]# h' }9 ~
// á?oˉ $ ?' O$ `7 F/ z3 T% n) J2 d
pLight->Ambient.r *= 0.9f;( b% w* K9 _5 d3 F5 C+ |& s. J
pLight->Ambient.g *= 0.9f;
, X: u m7 k/ d+ k pLight->Ambient.b *= 0.9f;
3 F9 f8 K2 Y! ]% v5 j4 d4 G" \( k/ w# d#endif //__YENV
) @+ U1 F4 y# T
; C& i. a4 \: l" t9 I! [) G: _ memcpy( &m_light, pLight, sizeof( m_light ) );/ r1 \" c4 z) n$ j ~3 L# j1 O
4 N2 B' h. E9 g D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);& \' s1 {% R r/ Y: N1 S% N& L
D3DXMATRIX matTemp;
: c5 t5 u( }! f. ]8 f* ? static const float CONS_VAL = 3.1415926f / 180.f;/ g$ Y6 w1 I9 S+ O# D* H
- b1 F& P4 A( B$ D8 L7 ~& t
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);+ f( k4 V! W' F# v4 j
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
. q* e' e( x2 P pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
9 `$ r; W. {$ O! a. Z7 G; S* b pLight->Appear( m_pd3dDevice, TRUE );
: U7 U4 ?$ K- z0 p9 G, u' I8 e2 t0 o1 H! H( W* g0 b
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
0 d7 o, p9 H9 L' h( V // D3DXVec3Normalize(&(vecSun),&(vecSun));
% p1 G: n( ], ?2 a3 b w // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 8 K/ q1 s; N* X. x2 e$ d* |8 G
8 G5 _+ }% Y5 @+ m DWORD dwR, dwG, dwB;
8 R. V% s% R$ T dwR = (DWORD)( pLight->Ambient.r * 255 );# l S, ~# M% q, S2 R0 W
dwG = (DWORD)( pLight->Ambient.g * 255 );, M7 N- e: v/ U6 j! E
dwB = (DWORD)( pLight->Ambient.b * 255 );. @: r2 e) C8 j* R
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); % ~. f. ~$ `: T7 t
}1 Z: i) |, r/ R/ E! n% r
}
, G9 s& k6 ?/ z+ ?4 g
2 [* v8 N. d8 P9 t$ p6 m m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );" m( Y+ _* D4 {
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) );# Z7 H6 U2 i: y: i
::SetLight( bLight );
+ F8 e. ?: }: B2 d( @9 ^2 ~: x* ?3 Y2 I. g
// ±ao? ?D?í???ó á¤à?
U! ^: u% S/ m! q% r, h `# R3 m m_pd3dDevice->SetMaterial( &m_baseMaterial );
0 F, C' E( P. s' f4 ]* w8 ?1 c# @ 9 ~0 {4 }4 D: Q2 H7 T% u
#endif // not WORLDSERVER
, q9 A5 y; [+ j. j2 t9 S$ b}8 X+ e1 o: r. K1 ~) D& D
并更换3 Y. B% N. m( F0 s7 c' E6 G
Code:
! i- w' K3 Z2 Q6 O& p__FLYFF_INITPAGE_EXT
9 G1 p' _- t# C _( n定义. q B+ e" B/ F! O7 j
? w7 }' p9 ] t* y$ E$ D
3 M; {3 l- D1 A2 C) q3 g
! Z% i9 d& w9 h; q1 b% u
- i4 i: A, f$ _/ Q$ w
现在终于删除我的狗屁加速...; W2 B5 i1 z: K: `4 `) K, p% y
6 U% U4 C7 A- W
7 X% K" q" }( q" D* }! N
: D# g3 @2 t' q: E" p
|
|