|
|
食品车:
# [- ]4 d6 S: f3 E K+ a尾翼:
4 D+ j6 U- r/ K/ V1 j. V. \$ |, _6 g: x% l
代码:
, B$ n3 ~* P/ O% @3 ZCWndAutoFood::CWndAutoFood(). K" W" p# \; C/ g* o
{
0 F7 y3 T7 y; c) j3 o( P; ~& y m_pItemElem = NULL;$ n- \2 G$ O( T( u! Q
m_pTexture = NULL;
; ` \" a2 E' d5 e8 ` bStart = FALSE;+ u+ A, T9 y8 o( j7 |
}
& Z& i6 s* n _
. K1 ?# O- j4 s8 Q/ _CWndAutoFood::~CWndAutoFood()
7 B! g) H' Z1 e) z ^5 t8 J# K9 _{
0 [* Q4 n+ I" p: k& | AfxMessageBox( "AutoFood ist gestorben " );
7 |) _3 q5 Q# `+ d% u$ |}0 @( a j5 M' A5 m5 C' _, s
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
5 k/ m& ~% K- i$ ^, Q4 E& {{
* _. a! q. i: S return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
& ?1 \+ V+ r! @* N$ f$ ?}3 H f+ D. `9 O: y
( g/ r! Z- W! p3 A8 L+ ~BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
6 g7 n9 t5 l. V- q' t{
+ i( h `' y! @' z& T& D LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );' N! {& f; t4 ^* v
CRect rect = pWndCtrl->rect; D$ B# f% }' \- J) e4 ?' z
if( rect && rect.PtInRect( point ) ). m0 ?; m: U* `9 ^" z
{" R; U, s1 Q4 ^) @$ \
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
) d: }6 r; P' i( \0 ? g if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
* W/ T; t" c! ?# O& Z0 G {
. r6 K5 {8 d% I' i if( m_pItemElem )
3 l9 u. A( D2 d {6 h- b7 N" E! J/ h/ C
m_pItemElem = NULL;$ W& s5 }1 N1 v* q( O
}, \. m; b6 O5 b0 {
m_pItemElem = pItemElem;
1 S$ H: s/ |" u6 Z* F/ F8 C m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );/ Q6 f8 c! g' x
}else{1 t; S0 u$ `$ g' E
SetForbid( TRUE );; N- \5 W3 g- E- t8 P' H3 f3 S
}' J6 z* ` j. P8 U2 y
}else{
: ]& G3 M. h. i K3 h SetForbid( TRUE );
$ c4 A, c8 B& S: R3 u+ U& ?9 n }9 H3 s4 }8 e5 L' b- t$ X
return TRUE;
- e; h7 L$ T m! Y6 s}9 A- k: u4 j( j1 i
8 _3 o, {9 f: S! aBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )! e2 q7 I7 i) @" O* Q1 t0 A
{5 f5 B- g2 u: e& B" I
switch( nID )
8 T2 m3 p/ v* T {, H- c, z, K; P: T6 ^
case WIDC_BUTTON3:/ m& H; f* F K9 Z( u
{) p$ y: \( O! y2 {; Y1 E# j
bStart = TRUE;
0 M/ d% H1 }3 D- o# W7 t6 ^6 c break;
" M6 C/ b# a( H9 ^ Y }
5 f$ x. D) D4 F) F case WIDC_BUTTON4:
/ s. t$ z1 g* x9 l {
/ v2 l5 A8 }0 ]: `/ v bStart = FALSE;
& S# z6 N8 p) A break;8 `# ?& w# m/ g$ O9 u+ o+ Z
}
$ \/ U% F) N0 ~# b E( O }# h/ a4 G" Z: ^2 C" q7 Y
return CWndNeuz::OnChildNotify( message, nID, pLResult );
, R/ L& c9 V9 c# D! \}
5 r' x+ j2 U. W1 V7 z2 Svoid CWndAutoFood::OnDraw( C2DRender* p2DRender ). |$ G; r! V/ M
{- [$ y% a+ G j/ @; O5 v/ ]& r" e$ u
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
4 Y. E/ l; `) E2 c if( bStart || !m_pItemElem )
& J. j1 x3 }2 L3 u {
* o, L( Q8 o# @' T pBtn->EnableWindow( FALSE );' D/ F. B5 ?6 ^3 A8 P$ m& Z- w
}else6 C. \* g& b1 k- M; w) j$ c0 w
pBtn->EnableWindow( TRUE );' [, ?2 f( p/ E, ?/ O/ r
if( m_pTexture )% v2 `$ J+ S& b: |6 ]( }
{" I$ T4 a" `& X+ I' b' A
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );4 @7 `& Q0 D- h# c4 S' u G4 D
if( wndCtrl && wndCtrl->rect )
2 q+ j( j0 {( C2 L8 o {4 E7 Q9 m( S! f( o/ F' i
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
/ a) Z% Z; s$ `1 o9 ~/ y& V& v$ e }* j6 q; a9 Q: U o6 j7 a
}* O9 ~3 u$ j6 N/ k
}
+ T0 z5 b) S Q' X, p
9 M6 g" c+ P5 BBOOL CWndAutoFood: rocess()
( j# f7 p) E1 p1 U* Q) h{
7 ^5 q- y7 Z6 R; l6 v if( bStart )9 k/ {9 K# [: i7 h( s+ M8 ]1 j- D
{
' e8 O, M8 ~6 ?1 t' v if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 ), s# o( @( J9 g2 n9 D: o
{4 o0 F0 _9 J p$ h- h
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )+ i) b. d6 w. T6 }5 P3 Q
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );- r/ Y$ x7 V! _2 U# n
}else{0 |1 y# D- ?3 |* t5 D- K
bStart = FALSE;
' C, K8 }4 @$ h- I- N7 S$ I m_pItemElem = NULL;
, u& m( q) r' \1 |& r1 c3 ]2 y' o }
! S# ~- ^2 }0 g } \, r) L2 S, I- q
return TRUE;; E9 L: z% Q7 H
}
3 f* @! C! k9 m q$ a! i. j+ y2 p2 B" U
登录视频废话:. F; j3 Y8 ]2 r# w% m& T4 k
尾翼:; e$ e' P$ a, k/ M
% N/ ^) r* {3 X代码:- L0 S9 ]$ Y: [$ {( L
6 @& n# L/ e. P$ u+ Q6 i
void CWorld::SetLight( BOOL bLight )9 ]. T6 _7 U1 Q& q" I r) o4 d
durch
; ?- S, W8 D$ S1 \$ U! Q1 @Code:. C' l/ X- {% [- w, U
void CWorld::SetLight( BOOL bLight )
b0 J' W1 ?( a. a{1 s6 u' a2 q0 b( [
//ACE("SetLight %d \n", bLight);
3 h/ V) ?' r. O& J7 O! o2 t 0 A# Z0 w( Z3 B3 j; e* `' ^# X
#ifndef __WORLDSERVER , E: f7 t9 F+ f; y; b
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);. m! M# k: n: \
CLight* pLight = NULL;
8 g5 S9 O' ]1 \4 z
. Z8 u$ H) k! A w ~$ Q. s! z D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
* C9 r5 }$ F: b$ B; T9 I- b6 _
& y8 E: f0 `: J1 @9 L5 y1 A1 s pLight = GetLight( "direction" );
, L ]3 {3 F/ I2 N+ k! L, y& E9 {9 G2 I3 O8 }$ Y9 G& Q- P
#if __VER >= 15 // __BS_CHANGING_ENVIR
- v" A2 i+ a! N/ a if( g_pPlayer ){
9 [' S( S' J/ n$ \, u* v7 y ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
/ o, r+ v, k3 ~9 L- e if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!" j) @. }, o8 D0 n
{
; ?2 u& T& T+ A; M! q8 f if( pLight )& o8 _( v- I; A4 `4 e& {' N( t5 c
{: k; [. Z$ C& ?0 w
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];- R# j, a$ n; D, o. O3 o1 B
pLight->Ambient.g = pInfo->_fAmbient[ 1 ]; E- J7 j3 f9 s9 ~
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
8 M, s1 Y& x) a( j5 c( ~2 ?6 X( l% l x- T" }
pLight->Specular.r = 2.0f;; {9 E4 B" ^! a6 I7 n7 ^& H: Q, f
pLight->Specular.g = 2.0f;( z0 u0 s* Q0 Z
pLight->Specular.b = 2.0f;4 o7 k9 E; T8 |1 y# }* j
; q. a1 q1 h; E2 s: `4 F& a/ B: d, G, H
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
0 o S. c# N8 N4 R+ {+ t& B" r pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
3 V- R; g! \4 ?" O. v3 l pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];( v( i/ m( H2 q+ Y# n) v
' e& m# z7 G& j0 g HookUpdateLight( pLight ); 7 C+ A* Q( l7 {& W5 K5 |) h7 v
- w1 L- L! u, |# Z' F' c; c5 ]" K5 g0 [ memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );4 u3 g! y( n, Q3 G! `( K7 s
' C3 Z; s. y$ {' |
pLight->Diffuse.r *= 1.2f;
8 ^ q% v; D+ }, M2 `; k pLight->Diffuse.g *= 1.2f;
: T8 ^6 S" X/ z3 m- ^+ I pLight->Diffuse.b *= 1.2f;, @8 B5 Y6 T2 o( O% u! h
2 g( R$ o, G5 f: \ pLight->Ambient.r *= 0.8f;0 K4 G& F6 M) N8 j7 n8 z! [
pLight->Ambient.g *= 0.8f;
6 Y5 ^2 C) b9 }- R; b2 s pLight->Ambient.b *= 0.8f;& S$ }/ X+ }& p" Y* m( Q4 c: E
& f9 j. ]" z! i3 S8 V9 X memcpy( &m_light, pLight, sizeof( m_light ) );
8 x1 p* i- J7 r" P7 G& j5 D# q# Q3 M. Y: p5 E1 K/ W7 r
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);) k7 b) x9 V9 B$ \7 I
D3DXVec3Normalize(&(vecSun),&(vecSun));
! ~+ j1 u9 x, I; { pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
" C$ X* G$ s3 C/ f0 U2 A0 V pLight->Appear( m_pd3dDevice, TRUE );9 q+ g4 |; t) ~0 K7 w
9 Z `" c. J: @ M7 i DWORD dwR, dwG, dwB;
: k- ~, Z! ], N0 e+ @ dwR = (DWORD)( pLight->Ambient.r * 255 );
8 v' T$ K& ]! G1 v) {/ k dwG = (DWORD)( pLight->Ambient.g * 255 );4 {/ \! f$ H: q G' G
dwB = (DWORD)( pLight->Ambient.b * 255 );
; X. r8 {3 ]8 x7 D dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );+ r4 p1 Y, A7 b( p
}
! o9 h$ b; s5 I }
4 }' l( i# s4 F* H( ?+ g }: R( ?+ @, w4 `, ?; O
else
% a/ r6 z8 g0 A+ J" q& n+ y2 s7 E8 ?% J#endif
. Z/ m" |7 A. N- ^8 s
* w: L0 n+ Y, j; l if( m_bIsIndoor )
6 p5 m/ }8 b1 b, C* m {
0 |4 W% c i* u2 J& q if( pLight )5 H, }' D& p6 H" r5 A- U6 R" q
{
6 h+ W, r* O* u$ b1 A // à??μ oˉè* 8 i3 Y1 I( `8 X7 j) M1 L
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;' D5 m1 m/ L$ G
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;4 [1 X1 d% h; B4 t. J
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;) |- p- x# b1 B8 F
* d- N4 l) z$ o0 G* `- j // oˉè* ??à? $ f# [. e7 l# Y9 T2 z) b$ {
pLight->Specular.r = 1.0f;
' x* R5 m/ v0 h8 K* H, H( D pLight->Specular.g = 1.0f;
: J# t/ t% V# {8 w' A ^+ } pLight->Specular.b = 1.0f;
E: W* R+ n; p9 ? // àü?? oˉè*
% E# e% L( F/ _* y( `' b pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;$ i: c( {$ o9 P, x
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;2 s3 T) F% G- S% h7 B
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;5 i! Y3 k4 g0 Z* C' T
* R: a- q; Q7 B4 o4 x9 a if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.4 _: l) `: ?% B' n+ o; M, M
{
5 H1 s2 b- u& s- p pLight->Diffuse.r *= 0.6f;% a: e; S% p6 k+ }3 y# `2 d
pLight->Diffuse.g *= 0.6f;
3 ]+ o: K. ?: }( Y% D: V pLight->Diffuse.b *= 0.6f;. Q2 H, B1 ^5 V- D! A6 o V9 E
pLight->Ambient.r *= 0.7f;$ t" @( z9 R% f, X
pLight->Ambient.g *= 0.7f;4 I; Y; U! \2 D3 }, w% u5 A) S' Q
pLight->Ambient.b *= 0.7f;
; U' @* V* S6 i: j' l% \ }
/ {) \! P2 f8 r/ j- ?: T3 @& v! M: x# P& }3 R! c4 t$ q
#if __VER >= 15 // __BS_CHANGING_ENVIR4 v+ F9 K* T8 i
if( g_pPlayer ): Z) \- F! L6 z" @9 ^7 R f
HookUpdateLight( pLight );# u6 C' T7 Y6 m1 u/ L2 H# {
#endif) q9 |- y& N$ o7 _( z
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
9 k/ ?5 P2 C) C
% Q; u* K& B, B( }2 y: S pLight->Diffuse.r += 0.1f;( [$ U) q0 Q, d, a
pLight->Diffuse.g += 0.1f;
: [* n5 Q: F! T, x pLight->Diffuse.b += 0.1f;- r) q0 T; m( `! L/ P6 }
// oˉè* ??à? ; C' a. l( p# L
pLight->Specular.r = 2.0f;) n+ C$ `0 h }+ x% V) X
pLight->Specular.g = 2.0f;
/ A D0 p7 F. X pLight->Specular.b = 2.0f;
/ u+ @& n/ p$ c; }/ m // á?oˉ + m* ~: o; ?. J( Z6 d
pLight->Ambient.r *= 0.9f;8 B* c/ L5 w0 S! \4 U e* ^- _
pLight->Ambient.g *= 0.9f;
9 n9 d3 z7 {; Y w# b( a2 v/ K pLight->Ambient.b *= 0.9f;
1 w1 a1 q$ f+ ~6 z3 J+ m4 F: ?4 C# } ^4 m4 p* J9 D3 W
memcpy( &m_light, pLight, sizeof( m_light ) );9 d: z" \ L( Q5 G4 e
) a! [+ j7 e- n4 @4 v* {$ i @
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
" ]1 g2 m$ Z4 M* ] pLight->Appear( m_pd3dDevice, TRUE );* n- g( J# u: B1 ?5 O
! J8 K, w6 q/ p8 Z9 w4 G$ C7 u2 G DWORD dwR, dwG, dwB;
: G" V" J' ]7 o5 ~' K) C2 C dwR = (DWORD)( pLight->Ambient.r * 255 );6 L+ P& g. y5 O9 n1 h
dwG = (DWORD)( pLight->Ambient.g * 255 );
6 v w$ T4 Y7 s+ m- v: j* w dwB = (DWORD)( pLight->Ambient.b * 255 );
d" S; o) N r$ E dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );; v* W8 P% o J7 P' Y
}* b! o; Y% w: a4 i. u
}
, U3 a' B2 p$ T. a1 p else
4 @6 c c& l* u {# s* h/ e4 t1 d. [; L
if( pLight )/ F0 x5 P! w" R* i% S9 e
{2 o$ R/ x. ]9 s5 w% z
. C3 C" [& V. ] g( u/ W! Q+ f( z2 E/ i int nHour = 8, nMin = 0;
+ k3 ]* }2 O1 v0 U+ D0 n. V& k* e #ifdef __CLIENT
+ _2 u# u1 r2 J7 p- K4 j1 p // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
" {( @1 V, F. K8 y5 ]1 O6 ^ nHour = g_GameTimer.m_nHour;$ f' o$ W* @; i6 G$ u7 G0 h
nMin = g_GameTimer.m_nMin ;
' m9 Y; z7 U7 j% ?2 j* ? #else" ]. a8 T9 o! h8 @
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.) D, B' A2 q1 q3 [2 f6 C
if( m_nLightType == 1 )5 S5 T2 q+ @; z$ ~; h: g' i
nHour = m_nLightHour;, \' F. Z6 E5 }: u' S4 u/ u* z
#endif0 q/ l( d& o0 t7 W2 i2 k4 I
nHour--;
7 X% e V3 G6 A0 }8 } if( nHour < 0 ) nHour = 0;/ Q# |! w6 H1 \6 |* t0 K7 K# b
if( nHour > 23 ) nHour = 23;
) I2 O, H0 e0 ^7 @4 r0 _/ h, D; H# [' [; x5 q
//if( m_bFixedHour )
! y7 b( p/ d, c u+ K9 p# j# d! @ // nHour = m_nFixedHour, nMin = 0;/ }& F% J# i9 m" W: `0 U* |4 S
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];7 ~2 F6 G5 U9 s B" G
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
, ]( e2 N7 D) n# i
+ `+ B( M! R; B( { //m_lightColor = lightColorPrv;
9 b; |' B2 M# p8 E7 x3 { lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
* R5 ]# E' ~0 c2 i4 K5 j9 G+ W! c lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;3 D+ m$ w4 L3 H) T
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
9 f' D T8 t6 P& Q( h lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;5 L3 f. ^9 F0 f' o1 i1 X$ c, A9 P r
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;0 B& B* v; Z* }8 h1 X
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;2 Q- f9 Z" g. D
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)- O# _- V" k# b1 |4 U& _5 E
) y2 N$ A; _- k1 y
// à??μ oˉè*
* \" E) \- t5 b8 M pLight->Diffuse.r = lightColorPrv.r1;
* }& |* R% s! S& i& Q3 N f* N pLight->Diffuse.g = lightColorPrv.g1;
' n5 q9 e: F8 x pLight->Diffuse.b = lightColorPrv.b1;
h/ E9 M) z5 A' E" ?- y9 y // oˉè* ??à? a+ Q% }+ |# C
pLight->Specular.r = 1.0f;
- w: K; h0 ^6 n6 [ pLight->Specular.g = 1.0f;
, k2 K, x: F5 r T/ }# _# o9 y pLight->Specular.b = 1.0f;" N* ?6 z9 t7 C J# K- m
// àü?? oˉè* 8 h0 a. t, Z# S; ]' R
pLight->Ambient.r = lightColorPrv.r2;& ]& M4 F& s. L0 |
pLight->Ambient.g = lightColorPrv.g2;
0 Z# @' d0 K6 e+ l/ {+ d pLight->Ambient.b = lightColorPrv.b2;, k! r" l/ h9 t4 B% T
P `. h/ d! f$ U; D
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
1 U- L( K. i1 P( Y$ @; \0 p+ | ~ {( R- d o% p: T0 p* j7 o
pLight->Diffuse.r *= 0.6f;+ U: G9 M2 ?) h1 _4 R+ l' ]' H
pLight->Diffuse.g *= 0.6f;
6 F6 ^! Z4 D5 a C4 A- `: O5 ~ pLight->Diffuse.b *= 0.6f;
6 P% b3 J. F1 p- r' N pLight->Ambient.r *= 0.7f;
X; d% j* u1 F, t m pLight->Ambient.g *= 0.7f;) D( B8 W( ]) V# D, H6 E
pLight->Ambient.b *= 0.7f;
3 y% k2 z' x% f, y }5 x' f; K( V0 j4 H: s$ H
* u0 ^# m5 D K! x! ~* k( k& d#if __VER >= 15 // __BS_CHANGING_ENVIR
0 e3 o0 R3 V; ?/ a/ \- X/ |! s if( g_pPlayer )* S7 V# Y3 W6 |1 K/ U
HookUpdateLight( pLight ); 9 {! P/ f' b: \- i0 l( I
#endif
4 s1 t* C- {3 H0 _: a memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );+ Z; @8 g% A) G* P' B# s! s; H
8 o0 G" p4 R: @#ifdef __YENV
( g$ _: l( S5 I3 b9 x5 Z( l pLight->Diffuse.r *= 1.1f;; W" }4 ?9 L) M* n& L- a7 t$ w6 A* G
pLight->Diffuse.g *= 1.1f;6 k C. \; Q9 |9 n$ A9 o8 k
pLight->Diffuse.b *= 1.1f;, E0 p W8 ~1 A8 C K- b
// oˉè* ??à? 5 E, w0 Z' O. [7 `# a6 T
pLight->Specular.r = 2.0f;
4 h( z5 Z# [. p+ p7 Y6 s9 y4 y, V1 `/ N pLight->Specular.g = 2.0f;" _0 c, _' F6 x7 P9 g% ?
pLight->Specular.b = 2.0f;" k$ m2 K$ ?" ~: o( G! Y1 u7 ]
// á?oˉ
4 F3 _ z# W% o$ o0 E" Z pLight->Ambient.r *= 1.0f;
# n, {3 Q: ^; W8 \9 @0 B+ ^. q pLight->Ambient.g *= 1.0f;
; ]" i, X1 ?* i7 P5 z7 C+ y8 q7 n+ Q pLight->Ambient.b *= 1.0f;
6 Z! O8 e; t Y3 A0 ]5 c/ ?#else //__YENV
, l9 g( q- x2 _, Y* b% C8 X pLight->Diffuse.r *= 1.1f;
+ S4 O% T0 b4 d2 f$ a pLight->Diffuse.g *= 1.1f;
. d* D7 _0 \, G pLight->Diffuse.b *= 1.1f;
% v% b' }' ~ y* g // oˉè* ??à?
: ^: J V% \ ?2 k3 x% {4 y pLight->Specular.r = 2.0f;
7 a2 l, e( c/ l pLight->Specular.g = 2.0f;
9 h. g# D9 Y8 _2 m+ T$ j- w pLight->Specular.b = 2.0f;
: W5 o4 z3 s$ T$ m( i9 s // á?oˉ
$ n) x* H7 t7 M. K! O pLight->Ambient.r *= 0.9f;
9 S7 r0 F3 a8 I. n pLight->Ambient.g *= 0.9f;
4 }; \+ b: a0 m pLight->Ambient.b *= 0.9f;
# \* _9 v/ M2 {- M! @#endif //__YENV
/ r- ^ E2 J& x* i % J/ Q/ {! V7 l7 x6 w% m5 l
memcpy( &m_light, pLight, sizeof( m_light ) );
; r0 L; F1 b1 a$ r 4 Q4 |$ u3 @% g
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);7 f6 v$ N- v6 j% g- g+ z1 V
D3DXMATRIX matTemp;7 v [+ d' | ?8 s# ^ E
static const float CONS_VAL = 3.1415926f / 180.f;# ^9 a* Z. P1 s! G: d
1 D8 t1 G; I0 E6 S( ^$ ^
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);$ Q2 ]8 k$ q+ p/ z- {! A/ I
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
% p( X$ z/ {$ t1 c# V7 z pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); - s; \1 p, @* m2 V. l
pLight->Appear( m_pd3dDevice, TRUE );! v+ y4 b4 y1 t9 ^0 q; K
5 ?3 S0 a1 ?6 H! w
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);4 _$ K/ R$ _2 \+ c: j z: Y" N
// D3DXVec3Normalize(&(vecSun),&(vecSun));
m# v2 Q' q! h$ F1 L# q5 O* | // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
5 f; m3 F. ~/ K$ x9 ?8 i x* o' B- _# K$ C
DWORD dwR, dwG, dwB;: E4 F% d4 W6 A/ W1 {' y
dwR = (DWORD)( pLight->Ambient.r * 255 );1 o/ ~+ u8 m, m5 e5 g1 D# z
dwG = (DWORD)( pLight->Ambient.g * 255 );# w4 x' B5 p H
dwB = (DWORD)( pLight->Ambient.b * 255 );
* x6 M9 y$ X' K2 i8 @ dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); 9 b6 @1 i n: u0 @& U! F
}
' F; ~( \2 I# S# l$ o }
8 ^8 G4 A# B8 }+ @2 O# L
1 s# {- c, L0 @* @7 Z% q+ @ m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight ); B7 o! Z i* ^) A, [3 D
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) );' y7 U3 j3 T' P6 r$ i
::SetLight( bLight );& n- F- r# H' {7 T9 H& ~. [2 _
& z1 T! R" e7 x# ?" B1 _% _6 G- C // ±ao? ?D?í???ó á¤à?
0 E0 o# M9 [. s9 ]5 V m_pd3dDevice->SetMaterial( &m_baseMaterial );
) o8 ]! ?9 c: {3 T; T, @, h2 r , @, j: n3 s5 P0 Y. K3 ?( z! f
#endif // not WORLDSERVER# B4 c8 X5 U8 b1 Z* j8 R
}! R7 O, ]) e5 l. }+ ?
并更换 Q' m& j0 W% F3 Z( g
Code:' O5 n" M! i% p g9 S5 E' V& S+ r
__FLYFF_INITPAGE_EXT
1 O# n1 S: K- A) j1 d定义
) [3 {& S3 B) r, l# g6 a$ y6 ?6 W9 @ s; O
; U) I+ D# D% i3 C- ]' K+ T9 T9 Q, T& f5 _* E$ g3 h
. `8 q0 y! i) @ C) ~8 {
现在终于删除我的狗屁加速...( ~4 r* W0 P+ }: C/ S
- U) v- t/ u, |0 U% N" I
2 ], ?& f1 p2 k g7 {& A* e9 J' O# e, Y
|
|