|
|
食品车:
0 _3 e7 L3 ]& s$ i9 b2 c1 f尾翼:
5 a) L- \: f0 ^/ @
% b& @3 J3 c% q- ?& I; `5 U代码:6 k. B; n) q. }: o
CWndAutoFood::CWndAutoFood()
; {3 K# j/ P. _+ }( G5 p$ N. U' O{
/ Z. s3 U3 t9 p6 f; {9 ~) z% K4 I m_pItemElem = NULL;
9 U; W; @! B* e$ n% [, Z9 N m_pTexture = NULL;! w, {3 C% w3 t" M- v) Q& S8 r& K
bStart = FALSE;& l3 P% t' y7 U, ?; p0 [
}
& e$ j1 t- `/ Q* v
! W. j6 [: B% ^: [' oCWndAutoFood::~CWndAutoFood()
: ]' M3 D- S$ {: U c{7 V- w- J' n8 b8 g6 Z
AfxMessageBox( "AutoFood ist gestorben " );+ x7 D- e- s: E, `9 U/ F# i7 U
}
- F2 e0 S. p1 r. _" ~4 ~, s, pBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
) ?) N+ e% `4 V* q1 D9 p{1 T% Z; n$ F, B3 ? Z, R2 i
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );! a% v0 B; c5 f2 i1 H( u( s
}
9 R$ o; @5 G/ ]1 `* A3 d! n! g* ?: V4 c, G% Z$ b) u4 J# p3 M) U1 e& ^
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )+ y* k4 z1 D$ ~3 w" q
{
! [, a3 D; |! { LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
* u0 v, D( X' q. A% l9 u CRect rect = pWndCtrl->rect;& i9 C& Q% ~; d" w* V: Y( K8 M5 {# U
if( rect && rect.PtInRect( point ) )* S# `2 a- i0 P/ ~! ]
{
0 a1 R3 y* Q$ Y- R' b& y CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );2 |" B4 `9 S9 w, O2 L
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
- A7 a* ?3 b, @3 {' k- n {
9 ?8 C' I. @1 |+ b% E if( m_pItemElem )
0 H2 M% X) r$ k8 I* m3 K# e {
8 d9 ?: j1 D% Z) _( o, N4 k m_pItemElem = NULL;: k- a0 f/ e, T! m3 _, M
}8 r7 g" G8 W% L" t1 Y: ^8 E& O+ S s
m_pItemElem = pItemElem;0 i0 N M' p. C- k' v
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
. h$ N& N$ {0 m3 G4 K3 y }else{
% k0 E) j8 P) e2 @1 D% y SetForbid( TRUE );/ a6 ~- m$ y1 s
}* e5 f- w+ T# w( m3 `' n) ?
}else{
4 D7 h. [4 c. l9 D SetForbid( TRUE );# V, Z/ q9 n D$ O
}
x. V/ J5 i2 q1 f* e3 q& | return TRUE;0 J( F7 v S: ?; w/ r
}
- K$ _. z7 ]( o2 q1 b# h. R u/ [. O5 j( |1 |: X
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )0 r+ L" T2 W' e- M; e+ J
{
0 P: c; T/ m8 ^9 J+ p% G- V switch( nID )
9 A" R# U3 y# d! s8 \8 o+ W; | {# P8 w1 V, W; ^# G& E7 |
case WIDC_BUTTON3:( Q6 {; C- v8 \5 d
{7 o M; P( G& z( f
bStart = TRUE; m' _! h" S# Z- d* ^" Q& P
break;
3 F1 Y- T0 n. ]) _: T& w( K }
! ?; ^0 H$ O3 M case WIDC_BUTTON4:% l8 D( N v/ L' v; R. @
{& [2 E# p# I: Y6 e0 b
bStart = FALSE;( }& y' t: U( E" M
break;0 \2 G9 S% y; d& Q& D
}9 q! a7 {" W% z x( ~
}
; M6 K+ \1 |: @) y) z return CWndNeuz::OnChildNotify( message, nID, pLResult );
7 F1 t. T" [. P0 Y; {} 5 q8 L" z/ i- o$ f
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
3 f" P4 E7 w1 |% y0 t$ A8 X, e{9 ]. D) x: T: U
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );! M3 R. }0 c! ?" q
if( bStart || !m_pItemElem )7 b3 ^, ~5 f3 j
{ w6 A" k, V; a1 `
pBtn->EnableWindow( FALSE );
! N" N, ?6 c# I7 k+ K3 n }else# W) V+ m; h- ^ ]6 E
pBtn->EnableWindow( TRUE );/ O' z9 R h! u s/ b
if( m_pTexture )% J* `! K4 p! ~* l8 C+ P4 x) @
{
7 E- ^2 g3 o" [% {& o! @ LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );0 |& H/ t7 |& w& @! W0 j" o
if( wndCtrl && wndCtrl->rect ): v+ G: D: w- S# d' W7 \ V
{7 [, M" p$ V' W: V4 H2 s& o- ]2 D( w
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
) [' o2 B5 x _ h/ {, ] J }
) W8 [ X1 s U+ S5 ^ }
+ _ \9 e3 F- W5 C$ N" ]}8 B9 {* O( W3 a: |0 M" }
+ @4 F6 x& v' b1 F- C0 }4 O
BOOL CWndAutoFood: rocess(); M, w. R5 _" ?1 J) I
{% E4 m* m% R9 y. \4 ?
if( bStart )
6 d& Q h, ]9 K; O {
% W j0 D! W O6 H T if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 ). m5 Z4 r4 ~; ~) a) F
{0 e g3 v. s7 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() )1 d/ J3 v4 ~2 H
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );# G/ E% K& E5 C B1 ~/ H* |; ]- w
}else{
+ L. ]/ S6 Z& {/ l; | bStart = FALSE;3 f" i! H/ j( L7 N
m_pItemElem = NULL;& _( [4 g1 C/ _: q+ X/ w: l
}2 B: v" M3 _$ A
}
$ a* f$ M9 X r' a0 J return TRUE;
; S5 S9 y" T' Q/ O( A! c* p- O}. ]+ B9 Q9 r3 M; \" `
" S3 Z9 S3 ]! l" T2 W7 N0 [- K
登录视频废话:7 j+ Q( W: n+ g" y9 \
尾翼:8 Y) u" u; a" x
( W" ^* q# d* }5 U3 K6 m5 s
代码:
1 A. v9 d0 g) o
( K2 c% R$ P+ x l: N/ ?! ]2 dvoid CWorld::SetLight( BOOL bLight )7 K- q" B6 O; j/ l; A
durch6 T' k$ z- e- f8 {, F1 k
Code:
\0 h% f3 l+ [0 F: u8 M, m3 |2 j0 s3 nvoid CWorld::SetLight( BOOL bLight )
/ L6 X; d9 [* f2 i! g3 c, g{6 w! ]* L* @! [' j) P7 H
//ACE("SetLight %d \n", bLight);) G _% }7 L2 y, |+ Z; @
! A4 z: P: L7 v! r6 g. w& p
#ifndef __WORLDSERVER
# t' Z! F, a7 O# D6 D9 J DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
4 I" ?3 ], h: H CLight* pLight = NULL;
, @3 F4 X, o5 @: G8 O N9 n
0 M O3 X1 H( }" u D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );" l, f5 X4 U. g6 E t
+ Y* m; T' S( p& ?
pLight = GetLight( "direction" );
% } a* @8 I' g+ D8 @
; Y. F; ~$ X5 d; B#if __VER >= 15 // __BS_CHANGING_ENVIR9 `) K: {& ?. @# @( q
if( g_pPlayer ){
0 J3 D: I! R! F$ l$ n6 g ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
* [6 L: t; ?& F" X if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!+ s; G8 K. f9 H- P- ~0 q" U$ U
{+ Q/ `& v3 Q2 \+ O
if( pLight )4 u4 B3 ]' ?; u% l1 }5 Y7 ]
{
8 z% l4 |; w) ~& k; H. g+ o pLight->Ambient.r = pInfo->_fAmbient[ 0 ];! o3 S' S. {6 K' Y' z0 N
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
3 T3 i9 h4 z) |* B( ?0 _ pLight->Ambient.b = pInfo->_fAmbient[ 2 ];0 k4 B! |) L" v- F& O7 {! ]
% R$ }+ B2 _% _$ L( T& m pLight->Specular.r = 2.0f;
. W+ N& Z7 K* e ^4 _0 a pLight->Specular.g = 2.0f;
* z4 _1 d* s$ N& A8 ^+ B6 S pLight->Specular.b = 2.0f; O+ [6 ?- x! M, ^5 T
+ _+ [$ b( [2 o2 p pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];. Z' }9 K* r( k; @! F
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];. M+ J6 M0 ~; Y, d2 n
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];' @3 _. u/ u Y5 Q1 [5 u
2 f5 n4 \& g) M& O
HookUpdateLight( pLight );
- U# S7 B5 H: j1 N2 ^: n! y! h, u7 M) ]" S, ?% K( L
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );! |/ ^. o1 H( \! g+ J* }9 f
t4 E3 b4 Y$ l; _* I r( {
pLight->Diffuse.r *= 1.2f;
# U7 e I- A; `: m/ r8 d) t pLight->Diffuse.g *= 1.2f;
" { _$ U! g+ G- m pLight->Diffuse.b *= 1.2f;# y- O: o; G. `; K
: l! V6 M" n4 j! a$ ? pLight->Ambient.r *= 0.8f;
8 X9 B& N9 @/ l% V: N% M pLight->Ambient.g *= 0.8f;; I# h) W( f4 f* X
pLight->Ambient.b *= 0.8f;+ G; N+ m# }* B7 b, Q
) p `# h3 l* ]5 h- v- P7 g
memcpy( &m_light, pLight, sizeof( m_light ) );$ C; m& O- ~0 d/ G& t
+ T/ w/ h9 N2 d1 u2 M4 D7 A
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
& L/ |' ~& W7 N+ f: l/ e D3DXVec3Normalize(&(vecSun),&(vecSun));
% e0 w2 t- Y3 a$ B pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); % P( m: L/ ]" j) }
pLight->Appear( m_pd3dDevice, TRUE );! S7 B" ? j! j
7 H" k7 ?6 [" |( T; U2 D
DWORD dwR, dwG, dwB;
4 n2 P1 n7 g) P: ?4 D2 T: I dwR = (DWORD)( pLight->Ambient.r * 255 );
- R1 e9 a- U1 B J4 m- g dwG = (DWORD)( pLight->Ambient.g * 255 );
- t9 [9 B9 o+ @- e; c% N6 k dwB = (DWORD)( pLight->Ambient.b * 255 );
# S! o( K$ q* ]( g! `; z1 ^ dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );/ D9 N7 ?; Q6 q2 a6 [4 {
}
/ Q7 v/ _% V4 h w" j6 T }. ?* j6 J! m/ C, n( B8 |
}5 H1 o: Y7 B4 P& @- f
else0 E- Z6 E E2 V# |$ y! J7 J/ M
#endif 4 v9 u; u- f. v
( s; ^* x2 x8 g2 j9 s
if( m_bIsIndoor )* |! k& T" g! z( M
{+ I: w% t: C$ q' m/ H$ ]
if( pLight )
6 C: A7 M4 [ y { 7 o! G% w5 I: i6 n
// à??μ oˉè* 6 Q$ b/ C/ C3 U# L
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
) a, F6 U' B2 V$ g+ R- { pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
1 T' O; m0 b! u/ b- e% W- l pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;6 @' Z% q( R% I- X) Y9 b
0 n' I- t# n: y1 I' v0 W // oˉè* ??à? 2 B# B$ K6 ~6 R
pLight->Specular.r = 1.0f;
# |" V* f4 |+ M4 E6 @$ c4 q* T7 F( G5 Y pLight->Specular.g = 1.0f;- t7 S/ K) R1 u5 a; r6 Z$ m5 g
pLight->Specular.b = 1.0f;
7 B, n1 r% s/ V Q. E q2 M- f // àü?? oˉè*
: O2 j- J2 }. R3 H6 `* d( F' @: r pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
. H4 B- p& j: H, e0 D4 t pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
( k5 [# b) _, U pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
7 B& i! y) j6 b1 J; c7 U2 I5 M! J/ q$ f+ I
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
" D6 o4 _6 ~- K$ U: J& o0 ^# p3 Y {
5 W( Z* {5 Z8 C4 ~ pLight->Diffuse.r *= 0.6f;
% Q0 Z9 U$ g3 Z' ]5 k/ P$ I+ d pLight->Diffuse.g *= 0.6f;- u( |$ a% p' V x8 X
pLight->Diffuse.b *= 0.6f;
7 Y) i* T8 d. h7 L pLight->Ambient.r *= 0.7f;! ]( m9 j5 ?0 J8 H9 A1 b
pLight->Ambient.g *= 0.7f;
( L/ Y+ W/ Y6 W. Y8 G5 W pLight->Ambient.b *= 0.7f;8 x* j+ U v$ V3 j6 K
}. U3 X7 i1 f. b" K6 o3 M
1 R0 h7 n: r; v1 G* ~2 W#if __VER >= 15 // __BS_CHANGING_ENVIR
" p. b/ W$ k9 l' x x% M1 x. U if( g_pPlayer )
8 z; V) N1 E3 o# S( _$ W HookUpdateLight( pLight );& }! J6 d3 Y% V0 Z
#endif
9 D% h4 p. b# _% I" }* d. V. C9 u memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
+ f. G) H. ?7 W0 }* h: q' u6 g9 r- c/ ^
pLight->Diffuse.r += 0.1f;
1 ^. ]) O, _6 Y+ t pLight->Diffuse.g += 0.1f;
, _+ m1 B: D% |. W7 W pLight->Diffuse.b += 0.1f;
" P/ a; L1 f/ t7 T6 O/ j1 q // oˉè* ??à?
% q, e) r" C9 [ pLight->Specular.r = 2.0f; u( u# S m, M
pLight->Specular.g = 2.0f;
( A+ P4 G0 R' h/ R/ I* I pLight->Specular.b = 2.0f;
6 O" u5 a6 l) D // á?oˉ + i0 q7 p |% e/ p% U6 S( c
pLight->Ambient.r *= 0.9f;5 o1 C( [% E& F) C# a$ Y3 X" `( s
pLight->Ambient.g *= 0.9f;% K# g ~) K3 t. Z+ ^
pLight->Ambient.b *= 0.9f;
! P6 d/ U7 r% q* b7 O
& A" \. I3 v. ?( u1 g8 ? memcpy( &m_light, pLight, sizeof( m_light ) );
5 s4 D3 W& `+ y/ r) A% N: ^
- g8 i. }9 B' H2 n3 q pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );: a& f% l0 |" K: E" _ ]
pLight->Appear( m_pd3dDevice, TRUE );. \$ N& v7 R4 Y8 m0 x8 Y/ }
4 L# X6 P* K8 m; O, i
DWORD dwR, dwG, dwB;
! i# Z$ Y% p8 {3 t3 A5 S" ? dwR = (DWORD)( pLight->Ambient.r * 255 );; v5 q6 O0 j) b2 H. J7 [
dwG = (DWORD)( pLight->Ambient.g * 255 );
2 D2 h; q5 _( K dwB = (DWORD)( pLight->Ambient.b * 255 );
: l3 z1 ?/ \7 c$ G5 j% ] dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
: ?: [! k$ p, o. m }
* t- n# E6 \, y1 M6 x, `" z- R; s }
9 T D7 \) t6 D. s$ T# s else' K, P! ` n' {
{
% j8 J+ R2 l# ^% s* Y+ ` if( pLight ) }3 O+ w1 M; d. l
{
5 i5 J% T7 S1 x 8 {' P, Q# t, `- H; u
int nHour = 8, nMin = 0;1 z+ p4 a3 M% D
#ifdef __CLIENT1 h0 k" u$ I4 |+ l1 ?, O% w
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. 2 ]5 F, o3 c3 A" B
nHour = g_GameTimer.m_nHour;) f6 [9 B9 A5 i6 S" E+ u2 P
nMin = g_GameTimer.m_nMin ;
' n5 s& |0 T# k# J #else! ?0 e& x, u% R) c. \$ H: S) S
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
9 O( X% A- E# g7 h if( m_nLightType == 1 )- d7 s; B" j2 \' s; C4 Y1 g* `
nHour = m_nLightHour;
$ R5 `6 c3 G* ^9 L! e% L #endif
( {% V1 T" F, D9 \ nHour--;9 c7 k- C# k& D/ G# \/ h/ J2 M
if( nHour < 0 ) nHour = 0;
) Z: y4 V% I: G if( nHour > 23 ) nHour = 23;
+ e. U; [2 T2 i' {% K9 C3 ]& P' J' d, ~6 {4 s4 y! m
//if( m_bFixedHour )/ l3 D/ N# w0 a/ |1 [
// nHour = m_nFixedHour, nMin = 0;9 i8 P+ b, F( |* C$ h
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];4 Q& O, f& Z5 x% ~( t, c4 N# ]1 J7 c
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
. g- L G: y* }5 h; E F4 u# n* ~! D
//m_lightColor = lightColorPrv;
& W; G' o' ?' ~& y( I' d lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;1 O; E+ e; W2 {$ \ Z9 F
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;5 A) E6 O9 B# `7 o% N# o
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;: f8 m2 C& O; N i6 V7 f* Y
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
, L% Y0 h8 Q: A1 @( s lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;8 A: g+ e7 x$ t) p# M
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;) O, i) R0 Y d. ~9 `' y
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)3 S* v& ]4 j2 O! |: J2 q; k
$ Y5 {+ |4 M7 U! R4 N8 @7 x: e. q
// à??μ oˉè* . b1 ^ _1 `: ~4 Z. ]
pLight->Diffuse.r = lightColorPrv.r1;6 q$ r9 g& n3 ^% `9 n; v
pLight->Diffuse.g = lightColorPrv.g1;
9 j, ^1 I( H' v( t3 y; y/ a) c pLight->Diffuse.b = lightColorPrv.b1;2 V' }. r# U6 a
// oˉè* ??à? # ~% T# N. L. g6 x$ D
pLight->Specular.r = 1.0f;
, B; O: h) s! ? pLight->Specular.g = 1.0f;
3 s5 g% \- ?2 { pLight->Specular.b = 1.0f;
- ^/ D) v# e2 ~# U // àü?? oˉè* , r: z }7 G8 g' y2 W
pLight->Ambient.r = lightColorPrv.r2;$ ^ H) i. V3 @7 [2 I
pLight->Ambient.g = lightColorPrv.g2;: ~5 I+ O7 W% ]) ]+ n9 c7 C
pLight->Ambient.b = lightColorPrv.b2;4 C9 g @% ~; U
4 \2 P4 \5 S- x' m3 ]7 ?
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??. H' C0 F2 k6 Z9 F8 ]
{
* U5 Q$ s+ W. j pLight->Diffuse.r *= 0.6f;4 k% |' [2 u4 y/ k9 H2 d
pLight->Diffuse.g *= 0.6f;" e& k/ i: f( Q7 e% A
pLight->Diffuse.b *= 0.6f;* X# S) F5 s/ T/ S$ }- Y( S' p- y; b
pLight->Ambient.r *= 0.7f;0 ~2 \; {1 j% u$ k) }; `
pLight->Ambient.g *= 0.7f;
* ^7 W5 y6 `8 b x$ f pLight->Ambient.b *= 0.7f;
# @( k) |, D% v- p/ K+ x }
5 I0 N: h7 ]2 E; n
1 A+ g7 v5 c1 b2 ^#if __VER >= 15 // __BS_CHANGING_ENVIR, f& B/ b4 V) M6 L
if( g_pPlayer )& p& g- Q$ L$ |, |* L% G+ `+ ~1 s
HookUpdateLight( pLight );
5 g0 |3 y. s* }2 C* ~#endif
5 K/ @0 W+ p: L5 s: k memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );8 l# }! M1 E6 ?* ?9 C) E* F* i) j
4 Q3 ?( p. S) m#ifdef __YENV
- X; A' k$ S) z4 L, ] pLight->Diffuse.r *= 1.1f;
1 T7 H5 c4 O, w* q6 H L* C pLight->Diffuse.g *= 1.1f;- @" ^5 B9 g* d+ x
pLight->Diffuse.b *= 1.1f;& e) _9 I- E4 B8 m1 v- [5 \
// oˉè* ??à?
. l+ i2 W1 T* K4 P0 V5 A pLight->Specular.r = 2.0f;
! B4 ^2 s) f4 ]2 q pLight->Specular.g = 2.0f;
; r2 X( P+ v! K# r: W+ z5 |# B pLight->Specular.b = 2.0f;. B- L3 I- x7 x6 ?( @
// á?oˉ
% A! ~5 @, G) T+ v. E; y K pLight->Ambient.r *= 1.0f;
% }5 R! X8 f4 U2 l/ Z$ g pLight->Ambient.g *= 1.0f;: O) v) p1 Y+ t* z m, v; Z
pLight->Ambient.b *= 1.0f;# |6 r7 j4 L7 h u+ M9 w; J" {( j
#else //__YENV
; x; {: {5 W' k- L5 _ pLight->Diffuse.r *= 1.1f;9 T) T: A7 K+ i# E
pLight->Diffuse.g *= 1.1f;
* m; L" A! I4 A2 g& ^0 l0 I pLight->Diffuse.b *= 1.1f;6 Q, z" g2 {& T9 }; X7 w
// oˉè* ??à? 0 H% Z; L6 Q! i
pLight->Specular.r = 2.0f;
! |8 s; P* B, Z7 S* e pLight->Specular.g = 2.0f;
1 U$ m4 k) c) w7 V% f r# y y pLight->Specular.b = 2.0f;
/ B: V% M6 |0 v3 {+ O4 f4 f // á?oˉ
3 B/ L( [8 q* s' ~) C, a# C3 G pLight->Ambient.r *= 0.9f;
" D; ~/ L3 ~8 W! @' n pLight->Ambient.g *= 0.9f;
1 c/ w: M5 `5 ^7 p/ T6 t pLight->Ambient.b *= 0.9f;
# n. t R( e9 F/ x#endif //__YENV ; Z2 T; U& x8 x d( Y& o3 j
$ O: G8 ~- D2 v5 _# x memcpy( &m_light, pLight, sizeof( m_light ) );2 c* H: Y7 L0 g' \/ X
4 V, A5 b w1 a) A# g D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);" i& h, O. N g' x" _+ o
D3DXMATRIX matTemp;
9 l" e% O) I& t( O; I' S0 g static const float CONS_VAL = 3.1415926f / 180.f;
, M- |; g5 V: Y7 {. e! F
' C1 G5 x# A( Z9 C3 h7 S4 _ D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);" U9 [8 ^6 e& `# v Z8 [, I. s
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);- p! ^# ^, o" x
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
( P+ d; C3 }8 l- W pLight->Appear( m_pd3dDevice, TRUE );
2 j+ P, C/ q q2 t! |$ X$ N4 L! X, ~# z$ {
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);/ Q! T& }, z& }2 w$ N. P
// D3DXVec3Normalize(&(vecSun),&(vecSun));
b6 C$ c; }) L; |/ n" a // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
- K Q' z# F$ g1 s
- L3 d8 J z. h# j' [0 K- m DWORD dwR, dwG, dwB;+ g; `* T% s& c5 C: x( n
dwR = (DWORD)( pLight->Ambient.r * 255 );3 U4 c e4 }5 K; H9 b
dwG = (DWORD)( pLight->Ambient.g * 255 );
5 Q3 e/ g _9 C* K4 Y( { dwB = (DWORD)( pLight->Ambient.b * 255 );" E2 H! }4 f/ f+ l- r6 w& T! ^: W
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); + J5 Y6 M% @$ x6 g, r9 j
}
\! T7 [) z' I! \' z }
5 b; p( w8 a, W$ B. [3 t4 B, y" R6 q, d/ e% c+ ^
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );! @# T# K# P0 b( F
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) );2 Z* H5 n$ A: _8 F
::SetLight( bLight );" T+ W. T7 F2 e9 @ V: { a
- i, z5 C: z$ }* _" r& s0 j- X
// ±ao? ?D?í???ó á¤à?
: n- }% d( [* ^) i m_pd3dDevice->SetMaterial( &m_baseMaterial );/ z- ~9 z* M4 N
1 A0 E; d0 u8 P* g#endif // not WORLDSERVER& V, u2 R3 Q* l8 Y% W. V9 C
}0 B! e1 l% n1 W$ d. v
并更换* @/ c+ l; L0 O* T% i
Code:
. E" u" I( e1 d* A% A& t. b; V__FLYFF_INITPAGE_EXT1 @* h9 p# B. e5 E8 c9 ?- l; I5 f
定义
0 F/ J3 @+ F f7 i k( f; j" T! b; z6 v- p6 c
% G1 C$ w4 g* Q- }! E# p& V
0 Y; _! e( Z$ U5 L& {2 R
5 ?% w s+ {' q3 ] P
现在终于删除我的狗屁加速...
1 H# v) L; U. b% E& f3 b+ u4 p) v5 ?2 Y3 k- c8 U1 E$ u
0 ]' i T! d3 @( A6 Q, l J+ C7 U3 O+ U% U2 P) ]# z6 k" U
|
|