|
食品车:% K7 G2 I1 Z+ F% ^: Q% m8 p
尾翼:* V7 s# @5 I( o; l, e, c3 i, s
8 s. V" p; G+ t$ ^6 m6 a
代码:
8 T" u) F$ h. ^4 _# F/ oCWndAutoFood::CWndAutoFood()* O f% a. f5 d( |* x! S$ e
{! y# D( ?1 k/ E0 z! E
m_pItemElem = NULL;
9 r0 Z: A2 r+ ?- w, {& y m_pTexture = NULL;! n* g! n7 g& }0 e
bStart = FALSE;: z; e3 Y3 }9 ?. Q0 t( v {3 F- O
}( y* O$ `& A" j% N+ Z1 f% U
$ g- c2 M$ [# s! U4 i+ y2 NCWndAutoFood::~CWndAutoFood()8 r4 b! T- F- p2 Y7 v
{3 Q9 p) I5 E; F3 y0 T/ B
AfxMessageBox( "AutoFood ist gestorben " );
; ^. W, Y* s; k- q}
' s+ C( c; T6 J3 ~BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )& Z8 X* E' V8 [/ n6 D+ h
{
7 f; z Q; I* A4 u& }4 P, z* f return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );: R" H$ v9 \# @( d' _3 f/ S$ n
}
, |1 W& V K; `7 {% J
+ p) ~$ {9 ?9 }% e0 {) Y& z% M# _BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )6 h5 ~% v/ l D, \5 Z
{) E e, R/ H7 {# y/ v( |
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
) T$ q7 w* w$ v" J CRect rect = pWndCtrl->rect;
3 m# l2 P" ~- h7 T if( rect && rect.PtInRect( point ) )
# \+ d! P8 y4 R1 C7 ^ {. E7 w8 q C e3 n$ T! c% Z
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
. D: p7 V* B: f if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
; J- u' W3 K9 c# t1 O" S {
* R# e, z9 J) E; g- ] if( m_pItemElem )5 k1 g+ M2 G0 B: _/ \
{
2 V+ @0 _$ u: s* j, ^7 {( z m_pItemElem = NULL;) e2 J% \3 r$ I. Q
}
% g8 m( J; g0 T- n+ @ m_pItemElem = pItemElem;
1 g3 f. x( S( W; v m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
( k: ^; _" ?2 K) k }else{# g7 ]2 m4 K2 M0 J0 m
SetForbid( TRUE );% Z8 J% ]0 `! _8 O( f+ Y: P
}
: o" f7 V" M: M" p( X* { }else{, x: j; ^+ u8 {
SetForbid( TRUE );
& ]# W% B; E4 T) w }8 s! b6 U7 A1 C; g& H; N* o8 e& r
return TRUE;' I- l; u8 a! h' T$ h/ H
}
$ E5 E: B' l$ @& h% z8 B. y- J" o% ?9 U
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )$ {% A ?3 |" q8 o* `
{
9 n2 D4 E5 V, l switch( nID )
: n8 n+ y2 o, U) d& A7 { {: C7 _' ~7 ^$ C
case WIDC_BUTTON3:- ~1 [, K% q6 E+ g# `! _7 Z8 M( r
{
; t3 A4 ?: u' E+ |, I bStart = TRUE;! k8 D9 x. L# @
break;3 s8 C4 t, h/ u% l" G4 W
}" y$ M1 H5 d/ O& v8 F: r
case WIDC_BUTTON4:
# e0 B. L0 O8 c5 ^# q+ B$ d# B) l4 ~ {
/ f, H$ Z- J" T2 C; m- U bStart = FALSE;
: ^3 ]6 x' y7 a# c7 w6 F break;$ z, N5 H" ?2 f) T
}4 C ~7 B0 Q; n* P
}) U2 r; z3 {+ e/ @: X# P4 I
return CWndNeuz::OnChildNotify( message, nID, pLResult );* z0 T4 `% ~& ^! D; V1 L7 _+ s- B
} . p( o9 M& l& r: f, y+ h0 D0 N
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
9 i6 C: [3 T7 w* n U% E{
4 r+ ?# z1 C8 R* u# Z7 j CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );* l2 _; b, ~5 g6 S5 y
if( bStart || !m_pItemElem )
+ S8 D( x" Z: R" c7 W {
: q6 Y5 |8 l( p! M) r6 o pBtn->EnableWindow( FALSE );1 x0 S3 ?! L2 E2 k5 d
}else
! }5 T/ n3 u5 W/ e" O pBtn->EnableWindow( TRUE );
* p" \: w% L" [; F if( m_pTexture )
4 f+ U o& O0 Y; G: ? {& m6 O/ V C) U/ |3 ]1 ~
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );9 A* j2 M5 e; l$ _/ k7 N
if( wndCtrl && wndCtrl->rect )
! x" N) _3 S' v+ b0 U- b {
& S) s0 B/ o1 W m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
, q" j5 z7 e) z6 S3 }+ _ }
: c. j# q/ |9 K- G }
3 S# J7 }0 m( n4 H8 Y! R7 A b/ Y}
3 O3 K7 _) x. Z* {: O! D
9 w* c* U1 j* w7 T6 G6 y+ R) XBOOL CWndAutoFood:rocess()
9 q/ n) f' g! Z) W2 ~& z; l{2 E4 E8 d N8 h% g
if( bStart )& e1 h) [. z G, R, o# Z+ F
{& K6 g8 L: ?- K/ v5 P; n6 v
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 ); i6 g/ i' n G& g: p1 e8 f: v
{
# l& H. \4 x& N2 u4 m; o5 T if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
8 Z+ B" L" h' Q% j9 P g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );2 G# t$ i b4 L: l' T
}else{$ C+ z' q1 \( j* u) r8 F% \
bStart = FALSE;4 C) O! M% u. A9 |4 Q
m_pItemElem = NULL;& k9 |3 Z, ^9 J3 ?( S) P8 }
}1 r; v& B6 ^& l
}+ k; T0 k D9 z; R8 I- z% w5 @
return TRUE;
' H& H( s6 M b, b6 g}# u* s& {$ p* [6 W2 `$ F, @
' J' s. B) s w9 j: H- V4 d Q- h6 n* P
登录视频废话:! @. A7 q; a |. ]1 ~, l, x4 q9 i
尾翼:3 W8 ]# L" }$ N0 Q7 q
8 \# T! v, ~7 M: c
代码:
) b1 H/ N) b7 o3 z4 L; D8 M) S8 {6 E" B2 B0 [4 Y& s6 K2 F
void CWorld::SetLight( BOOL bLight )5 N2 |* O J# R/ [! s$ r
durch
# M. W$ _9 _! w' t9 e9 D0 WCode:
; G& J& ^, T& Gvoid CWorld::SetLight( BOOL bLight ), Z8 Q) N7 M0 q+ }4 K
{
8 o3 }4 d! [0 Q- O; k' N$ E: |$ @ //ACE("SetLight %d \n", bLight);9 a( \. B3 Y7 T& t# i. f
( U5 V9 M0 N* T6 w
#ifndef __WORLDSERVER
% m5 P E4 y, E m5 u$ U DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);' P: v: W0 |4 n) f- o+ g, @# r
CLight* pLight = NULL;6 u; p* e3 t. {0 v# ]$ o
9 _: |" X* ~& K0 i. Q* Q D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
: E1 V* C, ^6 U& q8 q; F m# i/ ?. S
pLight = GetLight( "direction" );8 Q! B+ J, p9 Q/ `+ ^1 G- W- x
L/ y. M% ^6 T% u#if __VER >= 15 // __BS_CHANGING_ENVIR- M! o! B/ I" J$ u( t7 l2 C
if( g_pPlayer ){+ k0 h. a2 G1 j
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );5 l, x1 n+ g( r' I0 k' ~
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!6 a y N# _2 m
{
9 H; i; S3 j/ b1 A if( pLight )0 n" ?( X5 x" x
{$ [6 {$ t! ~' _$ I9 g% Q
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
5 Y+ I# E- ~+ Y; N$ \; G1 A, B pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
: Q6 o( F6 M4 _4 ]( g5 b pLight->Ambient.b = pInfo->_fAmbient[ 2 ];3 ]" S+ U: b, B
/ k V* C& E9 l7 p$ ?' M i; k
pLight->Specular.r = 2.0f;
. ~9 ^0 i0 B: v: Q4 ?7 V pLight->Specular.g = 2.0f;
9 e" @3 q! d) Z+ g( O3 _6 g pLight->Specular.b = 2.0f;9 c) W/ J& O N! t' F
- F+ L3 f! Q# f! H
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
. c3 H0 ? n# @& a8 y$ ]+ g pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];( R4 D; }8 C; Z; Q& U. q6 S
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
7 [ {* v; J& X. }$ Q# o5 M6 G 6 R+ t' _+ P3 |7 I
HookUpdateLight( pLight ); 1 @5 R, s Z/ {7 d4 b
/ Q A1 U" U/ `8 W( u% a- { memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );; T ~. A" e/ W: h; v+ {) o! o% n
1 ?1 b% G$ h# b* j pLight->Diffuse.r *= 1.2f;# u; A3 R' t( p3 {/ Y# b+ x/ s
pLight->Diffuse.g *= 1.2f;& { w& q8 a2 ?: F6 G1 R
pLight->Diffuse.b *= 1.2f;6 ~1 z+ |; o. `! |
* i2 ~, M+ \$ Y0 } pLight->Ambient.r *= 0.8f;
Z Q9 k+ C; w8 R. X pLight->Ambient.g *= 0.8f;8 ~* e6 B) C6 y) e. Y4 d% Q% C2 S
pLight->Ambient.b *= 0.8f;& U# ^) R- T8 q: Q- x
5 o, L% a& ?+ z) F5 U
memcpy( &m_light, pLight, sizeof( m_light ) );
2 ]* w, V3 P2 _( o }1 g6 L; b/ U$ Y% m1 C3 E* S
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f); j% d" H5 i- c" ?
D3DXVec3Normalize(&(vecSun),&(vecSun));" i* y( a: |' @: I/ ~+ G3 Y
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
+ y; m1 e( y0 q1 R pLight->Appear( m_pd3dDevice, TRUE );
- y `& o1 Z3 Q* P2 N + `3 j! y: A" Z' p! ]% \
DWORD dwR, dwG, dwB;" A# |# H! d% q
dwR = (DWORD)( pLight->Ambient.r * 255 );
- C8 J/ e, v9 T0 J) N4 D ? dwG = (DWORD)( pLight->Ambient.g * 255 );# Q, Q- T Y) l; a2 v- e: k" Q/ x
dwB = (DWORD)( pLight->Ambient.b * 255 );5 c: G1 E( B/ N1 }( A0 w
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );3 V6 P# j% I/ v5 t4 e; B
}: J; }7 k. ]4 K2 M4 y( {* z& x
}
" S( _4 H) y# X }
# q( ^( @ s! r3 A/ k$ B" _ else
6 w0 R3 S+ ^! [7 |3 y. H#endif
4 }0 G; g' B8 Q$ }' H. q. {8 `
' V' V4 [3 c1 e9 E' [" }2 q9 M0 Z. o if( m_bIsIndoor )
0 w# o: x4 G" D8 L' q$ P% u {
; y1 s& Y0 l% }+ J, n if( pLight )
+ W0 c( j% X7 B; {7 {% r1 y { 0 W8 |5 J9 b8 Y) p$ Y3 u) P
// à??μ oˉè*
, n8 d4 \4 R# a2 S% J" j/ j pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;: h; p Q6 M+ Z
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;5 {# L( Z3 D* f1 g, @$ `
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
. s- s" C7 ?* Y# B5 S1 G5 a) J6 d9 i1 W$ ~' v( l$ ^, D8 \
// oˉè* ??à? 9 ]1 F' ~/ e6 \
pLight->Specular.r = 1.0f;
& I8 T& }5 }7 J+ g3 M7 c pLight->Specular.g = 1.0f;; H# }1 M( v5 c9 k! l: n$ X7 p7 a
pLight->Specular.b = 1.0f;
6 P6 P! |3 p* s9 t' U1 t! n" y( V; I // àü?? oˉè*
$ u1 q1 p+ |9 h3 {6 Y6 W3 p9 d pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
+ {9 E+ @5 D5 F+ I( k: t pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
0 L% z- M' y S8 B5 A' c pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
+ u8 J/ a% {3 n- e; P* `. g
* ~8 A7 e0 n6 E, W if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.5 Y9 [. F1 I6 {9 |: ?# V
{/ u6 e) y. r. h" v( Z
pLight->Diffuse.r *= 0.6f;
g4 r: D7 M$ r( H4 p pLight->Diffuse.g *= 0.6f;3 n6 e& J- i7 S4 q
pLight->Diffuse.b *= 0.6f;
+ M/ } |) B. |7 K: w pLight->Ambient.r *= 0.7f;9 U0 j# Z3 ` ]& ~ ^
pLight->Ambient.g *= 0.7f;
3 L8 G/ ?# o, O9 s! Z. ` pLight->Ambient.b *= 0.7f;' c* c& t4 K( J/ x
}
6 b# C C! a9 g0 j/ ~" M0 A, ?3 R, @1 b; H( \0 E
#if __VER >= 15 // __BS_CHANGING_ENVIR* S. p' g! s0 ~3 A$ V
if( g_pPlayer ). `8 |+ H& n/ z" Y8 D' ]
HookUpdateLight( pLight );0 _5 D/ i. W/ t
#endif* d9 ^. ^7 Z! \5 A
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
. R: v u( |4 A9 z: D p9 |$ h/ q8 ]2 W5 I
pLight->Diffuse.r += 0.1f;
' [3 r6 `$ L/ ]/ T5 w pLight->Diffuse.g += 0.1f;
1 Y' g2 o) p4 u pLight->Diffuse.b += 0.1f;% a3 a/ z( ~1 R% w, u- c" E
// oˉè* ??à?
* [7 T5 Z1 r& I: [) R: O2 I. q pLight->Specular.r = 2.0f;5 E# s1 z- ?; _0 h4 j, s
pLight->Specular.g = 2.0f;
0 a0 N+ o7 u: A) c8 v% k pLight->Specular.b = 2.0f;
# p: P+ b- |0 o( N- J) H // á?oˉ
* [6 @. z/ h% R$ P# E2 t pLight->Ambient.r *= 0.9f;
% Y# M+ d. Q" M# r, m pLight->Ambient.g *= 0.9f;
^2 r5 s; q5 P; i; B: w pLight->Ambient.b *= 0.9f;5 ?% `% Q2 S0 U
% H1 h N- L! x+ `
memcpy( &m_light, pLight, sizeof( m_light ) );
9 I& s" N/ \7 A7 l1 d; X % `& v+ f9 g* s1 W
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
# P/ }7 _; _8 w, w( E; _ pLight->Appear( m_pd3dDevice, TRUE );; Y: {# N& p7 r7 e9 _8 H( D
6 F0 ~/ x9 \: v, f3 U. b4 V* ~ DWORD dwR, dwG, dwB;
/ @5 B& M I R+ N- a- z- i5 O dwR = (DWORD)( pLight->Ambient.r * 255 );1 _9 o* I# I& o% ?! V6 J
dwG = (DWORD)( pLight->Ambient.g * 255 );7 Q! ]+ e0 a2 A
dwB = (DWORD)( pLight->Ambient.b * 255 );7 t j" M4 `% \
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );5 q( _8 w/ Z7 D; y! W
}
% C$ K+ m' f8 S& w6 Y7 s }
2 u! U) v) [% O. K else
6 l4 d; D# I0 ], C: `4 w# i- X {
* Z2 j/ u+ e e: Q% y, \9 ` if( pLight )
, w" }& ^7 c" m7 ?, } {2 B% \$ F: E2 _
4 p- a2 \1 H" N2 [' X2 s [. o
int nHour = 8, nMin = 0;1 `" I& j1 q% X
#ifdef __CLIENT$ y; A! F6 \5 Y5 _+ R+ |9 {9 A
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. - ]& T1 j9 ?- D
nHour = g_GameTimer.m_nHour;
( Q7 y% ^ d4 N; N nMin = g_GameTimer.m_nMin ;- T# _! O [. v+ H! `; o
#else
- C0 W2 y; g+ _ // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
3 C; ]% o% B# |9 d! K5 R8 Y1 i, a if( m_nLightType == 1 )
% O/ z) y/ X. M" U nHour = m_nLightHour;8 q$ I1 a4 I% j* n$ E" M
#endif
/ D' p2 P" C- y! G nHour--;
/ j% q: C7 }2 Q0 [+ S# f) A if( nHour < 0 ) nHour = 0;# e6 w2 d' g) N5 p: z
if( nHour > 23 ) nHour = 23;# Z% A H: s7 b2 X
% G$ w6 b- V1 _# e! t: H! B //if( m_bFixedHour ); g% |' `7 d% ~5 d% L3 a- K
// nHour = m_nFixedHour, nMin = 0;
1 Q9 p7 a+ Z2 R2 l LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];2 {1 Q# C# D( k7 A" q( l& n% ^
LIGHTCOLOR lightColor = m_k24Light[ nHour ];8 z0 |7 P/ _$ A+ v% g
: i m/ u$ b* Q" S //m_lightColor = lightColorPrv;
( M6 w, R0 E; n, b a; V" V lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;" j* `6 z- @( ^) N
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;# F. V" I: {. n0 h, P$ W% D0 q% D* H
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;1 ?2 W. ~) Z% P% r
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;8 a" T; M) `# H5 \
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
: q2 h& Z0 x- x7 d/ q lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
1 ^- ?7 M% W( _2 h3 k+ {. J // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)* |/ F: U% O- e2 E2 ~- i2 n
! _5 h$ l& b5 {, [1 q // à??μ oˉè* . i1 N4 J Z) M4 ` a4 O0 q
pLight->Diffuse.r = lightColorPrv.r1;
& V5 `+ d. o6 G& i2 P pLight->Diffuse.g = lightColorPrv.g1;
7 Z& N9 y' V: M pLight->Diffuse.b = lightColorPrv.b1;( Q- p: Z s7 N5 P
// oˉè* ??à? 3 b& U! R, M& |3 t
pLight->Specular.r = 1.0f;2 X5 ]4 l/ c8 L% ~+ y; S( U+ ~/ J
pLight->Specular.g = 1.0f;
# t/ Q( z3 i0 v8 k5 L) p) } pLight->Specular.b = 1.0f;/ t3 N: _- D8 }$ R, a1 G. v
// àü?? oˉè* 5 Z* A7 L7 k, N! b+ x
pLight->Ambient.r = lightColorPrv.r2;$ _2 Z/ P0 i$ X7 L2 r' S A0 v
pLight->Ambient.g = lightColorPrv.g2;
, `5 f3 \& ]" M+ C' x pLight->Ambient.b = lightColorPrv.b2;
. r7 P4 Q. W$ P' ]% c7 o) X+ W
& }# `' _. K6 F1 U7 u# X/ S if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.4 I2 K1 h& Z6 @7 a9 T W$ I
{
3 k+ R: Z5 _2 {. p6 J4 b5 W pLight->Diffuse.r *= 0.6f;
" Y7 x2 l- S( z0 z3 P; o; o pLight->Diffuse.g *= 0.6f;
+ g. b2 v- n n0 Y. }8 q: S2 [ pLight->Diffuse.b *= 0.6f;
4 {* m! O2 E; E9 \/ [0 [) j/ ? pLight->Ambient.r *= 0.7f; }9 a' Y/ M& }/ l/ t5 V& ?9 J* S( l
pLight->Ambient.g *= 0.7f;
3 G) q8 W' Z: D+ u pLight->Ambient.b *= 0.7f;
6 r1 ]5 s4 L' X( B% | }
4 M& i' L3 S8 N; j3 s: @# Z% ^
" d, H) p: H3 J k, k8 v0 Y#if __VER >= 15 // __BS_CHANGING_ENVIR
+ S6 G t% D3 M9 H! ? if( g_pPlayer )# x* b9 p; ]3 Z+ S" y
HookUpdateLight( pLight );
, |$ T3 Q5 w4 Y+ t4 d#endif
* Q3 @7 Y1 ` C memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 B7 T7 _3 {$ v8 d
5 a0 W1 w# p. V& q& `#ifdef __YENV+ Z& W# f' a2 x7 ?% n' y! [
pLight->Diffuse.r *= 1.1f;" e% I. H. H+ ^
pLight->Diffuse.g *= 1.1f;, J& B, _9 P/ N5 ]0 o4 R
pLight->Diffuse.b *= 1.1f;
5 u- t/ D( y' O2 q( j1 r // oˉè* ??à? 1 _; {2 S4 B/ [( y$ z" c
pLight->Specular.r = 2.0f;9 h% }, V- [8 e1 k
pLight->Specular.g = 2.0f;
' T% E; m7 W# G' T5 p pLight->Specular.b = 2.0f;* @2 E! u2 N( ^, t; C( F
// á?oˉ
/ B6 @: X0 @. F2 ~! B3 D1 y4 @0 j pLight->Ambient.r *= 1.0f;
# P' |+ i0 N3 G' n9 W+ L' C: N* V pLight->Ambient.g *= 1.0f;
- l/ A; k5 h/ U( i! Q8 L* z pLight->Ambient.b *= 1.0f;
5 G* G& H4 s% O! {2 `#else //__YENV; \$ \" X5 g* X2 D3 ?1 J
pLight->Diffuse.r *= 1.1f;
" A* [ j( R4 X6 Q0 ~: G# H pLight->Diffuse.g *= 1.1f;
! N' b: m$ y, @0 u$ q pLight->Diffuse.b *= 1.1f;
7 k6 [. c. q2 s1 @* ? // oˉè* ??à?
7 [& ^7 i# l6 O: X5 U: v& H pLight->Specular.r = 2.0f;
3 Y+ i- Q& d$ G1 `) ^8 P pLight->Specular.g = 2.0f;
3 _, f7 s. C1 q P$ W, x pLight->Specular.b = 2.0f;8 i/ O( v' g( ?" d$ O Y0 o2 v
// á?oˉ
5 y; H/ p z; U' S0 f pLight->Ambient.r *= 0.9f;
& `' z4 ^* u, q0 q# O W y0 _8 D4 V pLight->Ambient.g *= 0.9f;5 k" ~# @4 T2 q5 ^0 f
pLight->Ambient.b *= 0.9f;4 |/ Q) b6 U6 h
#endif //__YENV " C# n4 S# f4 b" h Z) L
' V9 a- u; Y; a
memcpy( &m_light, pLight, sizeof( m_light ) );
) O' a/ Q. c# E Z
. R' u4 Z) G- G- V D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f); P' {6 U, d# l2 a* ]5 D& S
D3DXMATRIX matTemp; h+ W+ P6 L" i, @
static const float CONS_VAL = 3.1415926f / 180.f;
6 J% @2 b3 _& S
! t. e3 N- F4 H/ k- }- d, G D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);$ f+ ~: C! j! q
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
3 s p( ~2 a: ]( q pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
0 c) w9 C; C0 V pLight->Appear( m_pd3dDevice, TRUE );
% n) `- @: z' k, \6 ^( W: f/ H
& I1 E& H; b0 ^: R // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);9 V! X* S9 X/ J Z4 e# w( e+ q4 f
// D3DXVec3Normalize(&(vecSun),&(vecSun));9 ]& l& P( P9 D8 |2 a
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 5 Z$ P* T) x' M' H
9 ^; X% Y3 z+ d; [7 m
DWORD dwR, dwG, dwB;6 f2 O3 N3 s4 T4 d+ X
dwR = (DWORD)( pLight->Ambient.r * 255 );
' f7 h) S1 d3 D; V8 d! _ dwG = (DWORD)( pLight->Ambient.g * 255 );6 \- \: |( n: _, S# ~7 D* D
dwB = (DWORD)( pLight->Ambient.b * 255 );4 G4 L& X' @) b$ D/ K* F0 h! m
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); - S6 s$ \. f6 P# C. q8 R
}0 \) h" v" ]9 O+ G1 @% U& E
}) m: D2 O7 m( C7 z
. p) n- e* ]( v) ^% f
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );/ {! m1 B, r A7 L/ ~
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) );
; b% ~+ g9 k/ i/ z% G# e. v ::SetLight( bLight );5 ~; Q! ] M6 i& e) o
, P! c. M$ Y- o5 z$ h; h* v- {( t
// ±ao? ?D?í???ó á¤à? $ l2 R. }1 t2 T* h
m_pd3dDevice->SetMaterial( &m_baseMaterial );
7 ~. p4 X" K8 T" y' K/ K0 s 8 Z3 Y7 F( C7 v" L$ x. c& K
#endif // not WORLDSERVER3 M- x' {7 Z- z2 R/ `
}; C) K! ~ w: N. P# N
并更换# Y+ O) c- F5 I. J: d7 Q3 v
Code:
# |6 H9 O2 J; W__FLYFF_INITPAGE_EXT
* a0 [" ^4 b8 S) d# ]! r3 V定义1 ~6 {, `( Z! T# w
* [8 t* Y9 l; p" h
4 A% I+ L5 q$ h1 {( k( X9 X
. r( ^8 s8 W7 R+ P& T
s* ]3 u; V8 F, G/ y" a现在终于删除我的狗屁加速...
1 N+ Q6 J* ]! i# V0 W5 K P/ j
5 v$ j8 P8 U( q2 U! K+ @8 e4 {0 G, k( P/ q0 h
- ^# [+ z# b5 L- t2 D0 z |
|