|
|
食品车:
- t9 Y; G5 b/ N1 A) {尾翼:7 ]0 ~* I, M p9 |# o
, {0 X8 c( J. @9 f3 H
代码:
' X7 ^) W2 a7 pCWndAutoFood::CWndAutoFood()
5 p2 @. R0 s8 n{
+ y: a* ^, r- @' F m_pItemElem = NULL;1 a1 K4 ~; @" L% c
m_pTexture = NULL;
3 ?+ {4 V, V( h3 `+ R bStart = FALSE;& V, n' G. t$ F* r
}2 a" y: U o9 P, K& _0 [
" \% Y; a V; A5 UCWndAutoFood::~CWndAutoFood()
: J( q% d3 K% F& _8 I! o( N! g" j{
1 F6 H# a% |! ?) o8 h7 L5 V3 F AfxMessageBox( "AutoFood ist gestorben " );
, n6 X- c. v6 U3 ]- B8 l# ?}
5 ?2 \, L/ h( K3 `! I# ]BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
5 G- u7 k% O3 n. O% E8 O{
( a! i3 @2 B0 _" {; e return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
' {9 b0 B, w6 \4 u$ R1 Z' @) z9 n}. h. c% Z) W7 W* x2 s6 Q
$ Q9 V4 U& ]" q1 s2 ? r1 NBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
" u7 j- A: ?# A. |1 V* k{
3 Q6 L- ?+ n3 c% o& X( m& r2 v LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );6 r* e& s( v- h3 ]% k5 t
CRect rect = pWndCtrl->rect;
* }# X9 I% Z) H& G& m' W8 p8 ] if( rect && rect.PtInRect( point ) )0 ~% {/ O |* ?6 R+ }
{" I% ]/ O, S5 k1 c9 [4 D
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );& q6 q/ f4 E: M6 ~# k6 m8 ~) Y; M( n
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )# y9 H$ d5 ~% U6 ]- f6 ^
{1 ]4 S9 u& y% m' l' Z; N
if( m_pItemElem )
* N6 Q I+ V( V7 f# Q& C( u {
) ?2 G1 S$ A. i, R; {4 j m_pItemElem = NULL;
) C% j& D# W* X }
2 `3 X1 ^, ]; @& G* c9 s- t+ M1 J m_pItemElem = pItemElem;
+ A2 n J" N+ A: z0 z m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
. _' \$ N! W* P9 K }else{
% a7 o9 c: |# T( G2 K& F# p" h6 R6 E SetForbid( TRUE );" I; J( L; B0 w- s* [7 `
}" X* F3 E: K. q/ o% n- U
}else{
# A4 O% f y5 l+ y5 q. v* d- L. W SetForbid( TRUE );6 S/ ], o( I5 W$ y0 K
}2 U( f* ] X: E# F3 {$ S. [! m+ C
return TRUE;
! x% v, J; n3 K, @" ~6 x/ n}
( r) i, T3 A" B
* }/ _: @7 l) m7 C3 XBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
: s# V4 T+ t6 g' _2 }" ^7 f+ j2 z{6 k% \' \# E9 R" d# t! F; i. k
switch( nID )
2 j0 p# T& }0 u! o7 Q {
5 W! Q; u3 r9 B case WIDC_BUTTON3:4 X+ H' i3 k' C
{* ?8 d) l W* L$ Y
bStart = TRUE;: y4 W& r2 v' o$ C# {" @* T
break;
" a+ f7 `6 A6 c( g8 h) G' {3 [ }0 v! u3 P7 B, }1 ]- @9 \* j
case WIDC_BUTTON4:1 C+ I4 t6 b+ w# F. }
{! ^1 S) f' E) x2 k
bStart = FALSE;9 ~$ w' B! H4 m' @9 ]+ ~5 H$ l( B
break;9 u$ g4 d. N& y5 f/ s
}* K O& U, {$ U- x* L% T
}
6 X7 C1 H- g( N/ l; N$ n0 h* R, j* e return CWndNeuz::OnChildNotify( message, nID, pLResult );
/ G% ~$ s2 y- p/ z- {}
3 k. U f1 f2 r2 g) ~, rvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )
y' _8 K! K9 S{
/ R7 f- R# \5 u; P' e CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
* Q# E( k3 C% ` if( bStart || !m_pItemElem )
7 @# V) _1 I( |8 W. o* p {9 c# y5 p* N+ R- d% p! G
pBtn->EnableWindow( FALSE );& }+ g8 ^% O% d8 ^
}else
% Q$ G) c2 m8 y& ?+ ]& v pBtn->EnableWindow( TRUE );# h; A0 P0 N: A
if( m_pTexture )
, d- m6 X) m! _ {
, M0 y/ v! g& ~5 R- J LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
6 O: ?7 h; d/ t6 i4 {( C& c" Z if( wndCtrl && wndCtrl->rect )
3 ]( p4 e; E* v' B6 I( e, S/ I {
0 Y, v& q& M X" I. u m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );! L2 V& E( G) m' J; V' P
}) X# i3 M* o% |% T7 P. @
}7 ~* B) z9 ]' L+ ~* q( a' X# ?
}4 M' O% ~8 H' N. U/ x
. d7 P3 w) ?5 i
BOOL CWndAutoFood: rocess()( h0 ?/ v9 d/ L. ?# U, N( ?% ]5 }
{3 L. a1 u8 @# P! q' R3 d* k
if( bStart )
% N- v" u) X0 G$ F7 n- v/ F- A {$ R+ x+ H3 P* G6 z
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
' |4 }- z& I' s/ ^" G {( @. Y( G4 a& r
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() ), o2 `9 [% c# n& }" P: }4 a
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
9 v0 m) j. ~, o8 W; \ }else{
- y4 }+ i* p) | bStart = FALSE;/ F$ Y# |0 n: v) s# U: Y- | a
m_pItemElem = NULL;
! O7 f( B1 t' n* P }, | ~" [3 B& a5 @
}" s( M- z7 t2 l9 C% a
return TRUE;
% l: P# m9 |6 _. Y( g' }}. }& c- q' a5 C; f" n
; W6 K! X" l D" E: d% R登录视频废话:
, ~. E. p- N. v& p' R" b: k尾翼:
* H0 k: `7 ?# O' v1 d4 t$ t4 P# N& n
代码:
. i0 ]2 W% g% @8 T' M+ Q
6 e7 W6 B7 J4 |void CWorld::SetLight( BOOL bLight )
! @# S( o; R; |( F# ?, }; q2 t Idurch
, [! D. h; {: zCode:& O. p, l. m# X+ f
void CWorld::SetLight( BOOL bLight )
3 j! Q9 [; c9 |4 ^1 Y( ?. U{3 X5 O% c& J* F
//ACE("SetLight %d \n", bLight); H( P% ]) o# ^; V. i$ ~, E
! x0 [% Y* C+ X4 C' Q; ]* |#ifndef __WORLDSERVER : t/ M+ E! m5 _& Q' Z
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
* ]0 U$ l* S! E' A# d CLight* pLight = NULL;3 O- c& h$ X# \2 }
: p: M8 k/ C9 K" x% z: C
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );1 I' Q) J) r- o% |" ~. d: L
, Y7 y5 V- X7 P pLight = GetLight( "direction" );1 h) _7 B$ Z" M% N1 Q0 b, e* E
, L* T' L m5 W& ^
#if __VER >= 15 // __BS_CHANGING_ENVIR
* d# T% o& J1 j! Z* T if( g_pPlayer ){4 ?9 Y& a7 w3 ^7 y- J- Y( n4 @7 _" R
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );& i9 k1 ?- P& N9 _/ k
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!6 w( B. E/ f0 V, B& w% Y% q
{
" D$ |9 R1 b$ \4 L' ^* x if( pLight ); I& Y5 |" H6 ?3 {) r0 i4 z4 i
{+ ~3 v7 q6 f3 R J7 ?
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
9 Y& k8 c4 S# b) k) @" B pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
. N, B" ], [% J6 k6 w0 X pLight->Ambient.b = pInfo->_fAmbient[ 2 ];& v' a; ~- P, w7 e: c4 V# v2 P
2 \+ A1 h$ i- @, E7 @
pLight->Specular.r = 2.0f;8 Q6 @2 U9 g# a2 g5 `( h$ N
pLight->Specular.g = 2.0f;
4 G N, y) o/ v pLight->Specular.b = 2.0f;: k n n9 X* ?: M8 U( u
" E! s5 D9 ^ b; H pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];& \. Z% |. ~* q# A6 O9 {
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
$ P- p# z0 Z) m( M) }6 I. d0 T) V pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
) \/ ~$ z, M; X' y H
p$ I; k$ X4 E# t HookUpdateLight( pLight ); 9 t7 {( e+ u- R \
4 z. E5 I# q, V3 V2 B: L
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );, h/ ?* q# W+ K! y3 k/ y! R) l
! Y; k# l/ j# f* `6 T pLight->Diffuse.r *= 1.2f;% o- D% n% k3 ^6 C
pLight->Diffuse.g *= 1.2f;0 w* b! k& z4 a2 d2 U) t9 E# a
pLight->Diffuse.b *= 1.2f;
* }) {5 L% L* @( {. O& v6 m* f4 y `2 M. s, A1 n" r2 D8 I
pLight->Ambient.r *= 0.8f;
! R3 r% W# V7 Q# K pLight->Ambient.g *= 0.8f;0 |, p! k) R2 F- d9 N. r
pLight->Ambient.b *= 0.8f;
. O6 E3 Y L6 b6 d+ U& q; b & ~. F0 c8 Q) b
memcpy( &m_light, pLight, sizeof( m_light ) );
1 | m- X9 D3 o: d+ B( v" ]% F
1 b) Q1 {) b* ]3 ~7 O D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);- B. M2 ~% ~, O
D3DXVec3Normalize(&(vecSun),&(vecSun));
% R: N8 G' y* n+ f: s" @9 d pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
+ ]$ `( w" L- G) [. B pLight->Appear( m_pd3dDevice, TRUE );& H7 Q) o& V- N
) O& D* C' I9 T DWORD dwR, dwG, dwB;. g8 f( [6 \% d' k6 N3 r( n
dwR = (DWORD)( pLight->Ambient.r * 255 );7 e& d6 e# A8 [
dwG = (DWORD)( pLight->Ambient.g * 255 );
/ W) e" x2 I1 ?9 u" M dwB = (DWORD)( pLight->Ambient.b * 255 );" _6 U; K2 Q( Q# ^3 |
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );- m5 U1 y( p) }: c: S3 ~" f
}! |' G& Z2 R3 b O7 E) K2 @8 a
}. G2 U! ]3 Q7 Q
}4 E `' D. G7 G3 h2 D3 g; ~
else2 y2 [- G' g+ W F8 m# F, N4 L7 z
#endif " y8 _$ c; M9 l' r2 K K
9 t. R2 o# Q; G: k# ]9 j if( m_bIsIndoor )" u: W, R$ s/ w
{
{1 I* \8 R6 s" Z# N! N if( pLight )
) K$ }- K5 i4 K4 C; t* I3 V { $ Z3 {6 P+ d6 c9 G2 p. I8 _
// à??μ oˉè* 9 Z5 U; ^* a; k; G \) v
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
! E1 N# q+ e. B+ h pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;, z, v7 A+ X' P: K/ e; \
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
5 p+ _$ \. N& F' M1 m) o6 n% G
3 }9 P6 @% S! m$ z: e5 v M, p( R // oˉè* ??à?
8 z+ [9 L% |+ ?$ Y3 m pLight->Specular.r = 1.0f;0 D% T" J- \6 E# b
pLight->Specular.g = 1.0f;
, x' i" |' ~4 k4 D- @% Y+ g8 w, g pLight->Specular.b = 1.0f;
5 J3 @6 F* `1 d7 m // àü?? oˉè* 5 @' h6 W' S# s( ]0 Q1 s6 n
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;1 t. D5 }* D& J" T
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
" _8 j6 h, v+ g e pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
1 d/ P; n& c h7 b: z( i$ S) c4 T$ n+ M
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
B2 v B# p* p {
& @0 r3 Y- ?9 A0 L' }* u pLight->Diffuse.r *= 0.6f;: j. R+ Y A$ O) m# w, b0 c f
pLight->Diffuse.g *= 0.6f;9 n; B" c; Y9 O1 E& g6 R
pLight->Diffuse.b *= 0.6f;2 V: v% F% L- s3 g g
pLight->Ambient.r *= 0.7f;
' R- A! `( n7 `8 a! C) y- h+ @3 q pLight->Ambient.g *= 0.7f;+ y# M2 m6 {& Y- s
pLight->Ambient.b *= 0.7f;& I3 S9 _2 w' f4 b+ B+ w$ \% f
}
" m* s0 E3 @7 H
1 X X4 m ^& c- {#if __VER >= 15 // __BS_CHANGING_ENVIR% g3 z; p6 f: F( Q$ |
if( g_pPlayer )% q0 g0 T' {2 P& h% \( {5 ?
HookUpdateLight( pLight );! c/ |# O6 o3 t. x
#endif
t/ B# [5 R, @+ \2 B* z% B& h5 e memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );, H/ x S' p5 u# ]5 l
; N6 Q8 E' y' D pLight->Diffuse.r += 0.1f;4 g. @8 ]* }. e2 M5 K5 n
pLight->Diffuse.g += 0.1f;) O+ \3 ^* Q1 V4 C2 F% z8 |! w
pLight->Diffuse.b += 0.1f;
2 F/ l# @# R3 [! W; K* ?1 p // oˉè* ??à?
9 l' H2 `4 b$ a1 h pLight->Specular.r = 2.0f;
% f: j7 A0 H1 J9 A0 \ pLight->Specular.g = 2.0f;
+ s7 ?, k6 Z; V% f6 J) T pLight->Specular.b = 2.0f;, c+ w' }3 m/ N9 F: k1 [8 ~7 t
// á?oˉ
5 u: f1 _; K7 M7 b pLight->Ambient.r *= 0.9f;
. S% o# v) }3 `! S pLight->Ambient.g *= 0.9f;
9 v' A" a" f A: e& a4 u pLight->Ambient.b *= 0.9f;
; H1 t ~+ p1 R! ]) e- C) B$ I, J' E
& |5 h9 B7 K+ {9 d* C! U( Q5 u m3 h memcpy( &m_light, pLight, sizeof( m_light ) );5 d' Z" B( Y6 a0 [: @
# E1 q* O9 a% T" L5 e
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
+ \) ^& p/ J- ]8 x: o pLight->Appear( m_pd3dDevice, TRUE );
* A( @' h1 M* J) O' F
9 C5 m/ P" W; p0 O DWORD dwR, dwG, dwB;
8 `4 r8 P0 C1 b& ~4 l dwR = (DWORD)( pLight->Ambient.r * 255 );3 t l( Q9 S- G2 t9 [* B$ ~8 K l
dwG = (DWORD)( pLight->Ambient.g * 255 );6 r$ I9 `- W; ?. T2 A* S1 G) B
dwB = (DWORD)( pLight->Ambient.b * 255 );1 b1 w0 {5 c- b3 q5 ^
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
4 \5 i- n. f5 s: j* q }, t- ~3 Z) ~# K# i. T# I
}5 t, C* M( }8 D; t1 r% S/ o0 @
else
- ^$ h' y3 r; W+ ^0 A/ H5 k: r {
+ l5 ^) T+ Q4 B0 j- @9 R2 I; Q if( pLight )7 a3 M3 z! h0 Z. y$ ]0 U* S$ l# ?% ~; B' R
{0 {* t0 }; X3 R& \. g' R! t, J
% j8 P$ |% d9 C H0 I int nHour = 8, nMin = 0;
: s- ]9 O8 t% S #ifdef __CLIENT
& m% l% J( X" ]8 l2 R // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. % }7 G1 Y' n6 {: o5 \# a
nHour = g_GameTimer.m_nHour;
8 ~4 J3 ]- H3 s& _3 p) ?+ Y nMin = g_GameTimer.m_nMin ;" @) V) b. n) ~: P
#else
/ F4 h, N& i1 i2 L; I2 a# O // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
$ m' l- K# [ t& | if( m_nLightType == 1 )
* P1 W+ [4 W5 [3 ?$ `' N nHour = m_nLightHour;: j% t8 u7 w: a% Z/ W( X1 E
#endif# |5 s& n/ N) O* h. Q S8 M
nHour--;" ]& a9 A8 g% q
if( nHour < 0 ) nHour = 0;9 K% Y$ X0 M, Q- n9 Y8 B5 o5 D
if( nHour > 23 ) nHour = 23;* D0 d9 i4 _" D i0 ?8 A8 G6 _
+ G4 j$ [" a- l" y# ^8 ~ W8 j' n( N //if( m_bFixedHour )2 @! x0 e/ u# Y* Q- X2 Q5 R
// nHour = m_nFixedHour, nMin = 0;2 f1 a' Q/ M, ?
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
& f' L) T; l7 q LIGHTCOLOR lightColor = m_k24Light[ nHour ];
5 ~& ]. N' A2 R+ D; K; y6 V; w) b
% T: @2 ~* r" s7 F1 t2 q //m_lightColor = lightColorPrv;" a$ a9 V3 X7 K/ U# ^
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
% C z& D! a4 f7 x% x3 ` lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;' C5 W' }1 {8 e
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;( N) f; C- o: ^ h6 @
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60; l( K5 w; |3 b: i6 y
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
1 P8 }! P- a ]3 n- A: F9 H lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
1 J) W% N2 x; z0 t" J // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
# c6 r3 w |- Y" G' Q$ }! x7 S9 m5 q% q; j
// à??μ oˉè*
6 |9 A) Y. J* ]6 S pLight->Diffuse.r = lightColorPrv.r1;
, S, q& m2 c) {6 a) t pLight->Diffuse.g = lightColorPrv.g1;
: p# u$ O$ c& ^1 d0 A& N1 [3 {* Y; z pLight->Diffuse.b = lightColorPrv.b1;4 A7 C) o% S8 N$ [8 Y5 J
// oˉè* ??à?
6 @9 R1 [; ]9 y& R pLight->Specular.r = 1.0f;+ O( t) v9 y3 D9 o; c% [6 ~, A
pLight->Specular.g = 1.0f;% K8 {- {! M5 v/ T+ a7 Q$ b
pLight->Specular.b = 1.0f;6 y+ h% F" S4 U5 c% n* l% s
// àü?? oˉè* " y/ B( t7 P) T6 Q1 @* i, _6 l2 J1 {
pLight->Ambient.r = lightColorPrv.r2;
( g2 t: `' R) q: a3 S5 a pLight->Ambient.g = lightColorPrv.g2;' [* {3 H1 p' x& |
pLight->Ambient.b = lightColorPrv.b2;7 A4 e) k/ z1 o6 [- @- ]
3 p, @/ y/ U; R4 B2 V
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
/ k1 m9 ]9 j' d5 m {8 e8 T5 D- b( X1 K. E- ^& f
pLight->Diffuse.r *= 0.6f;
- Q3 v8 {+ T9 d* D8 r" v+ i L pLight->Diffuse.g *= 0.6f;, q2 G- T1 e; F/ F
pLight->Diffuse.b *= 0.6f;2 A S" |% S0 X9 I! d- e
pLight->Ambient.r *= 0.7f;
% b4 J. d8 c" D3 Z j pLight->Ambient.g *= 0.7f;
6 k) c- Y. |9 q: j& K3 B% J7 B3 X pLight->Ambient.b *= 0.7f;
4 {1 W% ]- \0 ^& e, N ? }) u! H+ f/ p( e5 o
& G7 p" f: Y' O* y( O: s#if __VER >= 15 // __BS_CHANGING_ENVIR
3 v% B' Y- C7 C$ u% f if( g_pPlayer )
- `5 P( k+ T8 ]2 O' j4 j4 ~* S2 F HookUpdateLight( pLight );
7 u' P1 X0 \* s6 w) R/ Q- L' t. v#endif& @+ H/ Q# ~0 z, p- W+ Y% @
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 D+ O+ _- K9 F, t' `+ r8 w5 L* {* u
* \8 t/ _$ J1 L' B% k4 N#ifdef __YENV% R2 z( S1 Z1 z S" t2 h
pLight->Diffuse.r *= 1.1f;
+ C; X1 w1 E- g: N. ]7 I pLight->Diffuse.g *= 1.1f;7 ~4 o! w4 ^5 A$ U0 i. ] f
pLight->Diffuse.b *= 1.1f;& x/ o/ d3 e2 }' }
// oˉè* ??à? 4 ^ K( y3 _0 v! J- e8 E
pLight->Specular.r = 2.0f;! X* R) \0 o* g3 d
pLight->Specular.g = 2.0f;/ {6 J1 L: j" l
pLight->Specular.b = 2.0f;- ~1 J% \. Z/ K. K. L
// á?oˉ
6 ~/ Y* C# \1 K pLight->Ambient.r *= 1.0f;
& }3 G8 z4 D" E$ O( ]; G; n pLight->Ambient.g *= 1.0f;
2 G- k1 r' S$ ~; a! ~9 W3 _. ^* s pLight->Ambient.b *= 1.0f;) Y# }) v- R7 E5 G1 F$ P( A- f, |
#else //__YENV
% x0 n2 { }; W- o$ Z pLight->Diffuse.r *= 1.1f;( e- J: f! Y3 Y
pLight->Diffuse.g *= 1.1f;( D/ o) a8 m5 r" P
pLight->Diffuse.b *= 1.1f;( C9 A: r, }' C3 C
// oˉè* ??à?
; i6 Y' C2 A- F4 I, ? pLight->Specular.r = 2.0f;6 n3 h3 C/ F, _
pLight->Specular.g = 2.0f;
/ q O3 N3 A, J# ^. ?2 ~ pLight->Specular.b = 2.0f;% i2 j9 R$ t* E3 E- i' J: S
// á?oˉ
, P2 M: @# b: U& t pLight->Ambient.r *= 0.9f;% ]2 E$ B. `' A* l1 y/ f* V
pLight->Ambient.g *= 0.9f;! C* J& g! y0 C! P8 n4 f
pLight->Ambient.b *= 0.9f;
# I% y$ K5 g& c4 S#endif //__YENV
/ {' O/ H8 W3 f. R5 l+ ^. u 0 M) |$ B) o+ F( Y
memcpy( &m_light, pLight, sizeof( m_light ) );" h) W5 u+ n: Q. @* ?* W+ t
8 x+ G+ ~. y: _( m D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);/ I$ |2 x; t' `
D3DXMATRIX matTemp;
7 [* h, L D% Q* M4 P static const float CONS_VAL = 3.1415926f / 180.f;
! b# l. o- |: q. T5 }" D' _3 F, j; d9 _
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);* ^ O j8 @8 P* L1 F
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
9 v" {( R- P, e pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
! M4 `: H: d. r8 Z3 i- u4 M pLight->Appear( m_pd3dDevice, TRUE );$ p; I) E' w0 k" I! x
/ p- ^% S+ H7 j. } // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
. x$ y- i; N( I" X4 d, m0 y0 p: [$ e // D3DXVec3Normalize(&(vecSun),&(vecSun));
4 {" P2 j& w# x8 v, h3 @ // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); ( x; P# t1 N$ D9 F) n/ o
9 {5 c! _2 q. f
DWORD dwR, dwG, dwB;
, E- G- d5 M8 n, Y3 T, y dwR = (DWORD)( pLight->Ambient.r * 255 );* k) @+ o* r' e7 e
dwG = (DWORD)( pLight->Ambient.g * 255 );
# c; z* v( w9 z, E* P/ R" W8 K% ]7 x) m dwB = (DWORD)( pLight->Ambient.b * 255 );5 h7 A2 @# U3 K* g
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
2 B& K# s4 @8 |9 }& F0 o; _ }5 r o# t& ?9 i9 t$ Q1 P
}, P2 T) }7 {7 d9 a4 N6 ~- |7 T3 @
8 _ G0 c$ u0 B) Y) y% \9 T7 [- O
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
) p# `( M& G$ S4 v" t 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) );# V" D8 k" U' f2 E, ?
::SetLight( bLight );6 \6 g. y8 ?, X! \1 @3 m
' P0 H6 ~6 _* n+ T+ b- |9 @# Y3 b
// ±ao? ?D?í???ó á¤à?
2 g' _6 Q1 G* b7 K: X! |! ]2 F m_pd3dDevice->SetMaterial( &m_baseMaterial );1 _, N( b. K& x1 x
9 X O2 e* f* u7 C
#endif // not WORLDSERVER
: z d, g# R6 @3 U9 R& l6 F5 S' L}
* m6 w8 Y% h5 M2 K# L3 N" t并更换0 O6 h+ c' y/ P. T: i, H
Code:5 v% e. H5 _3 C" Z
__FLYFF_INITPAGE_EXT5 A. A# f ~* ^! |# B" k' f+ E
定义
( Z7 c. w0 n5 ?4 N3 s! k. }# V- U y2 Z% n3 \) }- x, M! d% j
: O3 r* c6 i8 h7 g
2 o3 _4 u2 n! s
$ [4 U5 C2 ~3 V# t& x" J4 x现在终于删除我的狗屁加速...
7 o3 e6 |- N9 n2 Z: l) q3 @7 ?1 x x6 ^) m% k& X0 n
% ^) L1 ^9 S: R: U
' A" ^7 w2 |, T+ U |
|