|
|
食品车:
" h, x9 v- A& f$ d9 N4 l) O& ^( C尾翼:
; {% I& B- i( e, g6 S0 C. x
" O9 Z. T! b( Y6 `. |代码:) r! I% F5 t4 \7 ~/ F4 l5 U& O
CWndAutoFood::CWndAutoFood()
( {, k4 V& o- O{! y9 h- |" d" X
m_pItemElem = NULL;+ u4 s- p' ?4 @% I4 X, N' {; }" p, r( Q/ {
m_pTexture = NULL; C) {2 R/ t0 {2 T8 H( k7 C1 S
bStart = FALSE;
, \+ p7 ~2 G2 s+ S}
2 d6 X, Q/ g+ p0 \" `
: o+ |; d' z2 k; ZCWndAutoFood::~CWndAutoFood()+ y3 c0 p# ?, V: H! M/ g+ m j) s
{
$ K9 o$ w" \+ d6 Y5 V% l3 G* _ AfxMessageBox( "AutoFood ist gestorben " );
7 P# ?! p7 L# ^) S2 ~2 D}
) Z! i$ S( w( a; C3 Z" IBOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
7 Q0 e! V+ y7 {& o4 R" i{( V, O3 R6 j2 Y& T
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
" |7 |* G: E3 W: `. Q X/ n p* B}* W) y) j6 Z5 [& U
) g: B' e0 |7 q: VBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )- [6 l+ B9 i* V' g2 P& X
{
8 B u. g" Z' w& P LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
3 y* [/ L. n% c7 N CRect rect = pWndCtrl->rect;: O- ^8 n- P: e, m' ]1 A; ?
if( rect && rect.PtInRect( point ) )
! Q) A+ y$ G3 K/ j/ C {5 {- e2 o, z L" o/ l- _
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );5 Z3 e$ d, l3 u1 k8 I) S
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )2 v- ]$ D: _9 }, c" x U
{" s: ~+ g0 q/ T5 w
if( m_pItemElem )1 b/ x9 n. Q7 K: K1 r+ Z8 Y- D [
{. j( o/ y' o7 B+ ~
m_pItemElem = NULL;; I' s& D2 }+ H4 I
}/ n4 E% W8 h2 D1 R8 J
m_pItemElem = pItemElem;
& U. b2 O- S; f* `$ D/ H m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
n2 I& b* B: B* S+ ] }else{0 r: K, `9 u. V; }
SetForbid( TRUE );
+ F- \( p( d0 N3 v* I }, _! {5 j/ [/ p4 S# b) [
}else{
# S t; l- Y6 N" A1 r SetForbid( TRUE );! ~/ t( \3 d& Y3 ?1 b
}
! S* J. ^* m* N. b& m return TRUE;
& |5 m* j: d$ j}: p2 c* X4 @! g+ M. \; @
7 G1 U8 A* y( ^# {: `; ]" XBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )* y; y" m1 M0 I9 J
{8 V* W6 S5 N9 D2 ~
switch( nID )- s( H5 Q; K: d4 _7 E+ F/ K
{ a V- R E1 X- |
case WIDC_BUTTON3:% Q5 P% [0 q$ o; _4 Q
{
: Z9 Q& S# r: z- z bStart = TRUE;7 S3 J& q$ f& ]" }; r
break;
& q" W8 q/ @* d5 ~& y. J) P }2 Q+ M8 ]7 G) }" x
case WIDC_BUTTON4:
( l( ?) \9 g5 s {
" B, r- h# d/ H% ] bStart = FALSE;
# S$ f6 A5 w( s1 h9 Y$ V break;
8 r% R9 A7 X* e8 u2 t( {: \ }5 H1 T& n# F7 C& t [9 w
}5 }, U4 [+ y! @5 A% E( ]! Q
return CWndNeuz::OnChildNotify( message, nID, pLResult );
: O$ q- ^8 b) y5 }% T% |}
7 l$ S4 J d$ J/ [, b' ~9 gvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )8 C% A+ y7 v. J/ e1 \$ Y2 \( k3 W
{, e* G' v. a# w- E8 O+ C
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
I- O5 V% O% Q8 v! z/ E& t if( bStart || !m_pItemElem )
' l6 m" R5 o/ B {
0 X( e- y& O+ ]+ S$ \- C c/ K pBtn->EnableWindow( FALSE );
7 f) n2 z. r. N4 u) B) s }else* Y+ c6 ]2 v) |
pBtn->EnableWindow( TRUE );
7 H% u/ [- P" K if( m_pTexture )+ s, a9 r b- D) x
{" P$ ?$ e6 A* w% c% d$ x# {1 |
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
, r9 [( K4 t2 B. ?8 g+ S1 b) E1 T if( wndCtrl && wndCtrl->rect )& B3 P3 z( \- m. s
{( U0 W/ N1 N2 j! k& @$ y/ D2 s, x
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
5 h6 a( s4 ^8 U: m& S }
9 I) _4 {: F# L0 I }
@8 y. ` p! F& q6 V% b}
2 ~, v+ ^ F, _3 P$ G
. f D0 O* t: h; B) S& ?* P- ~BOOL CWndAutoFood: rocess()9 \9 P' A8 W' h5 S* r) U& b5 `
{7 O/ t" w& Q$ Y
if( bStart )
4 L; ]) X" [' T; Y6 [5 d1 R {
; }6 ^# ~1 j" _- _; a3 h. I if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )6 m4 m- f6 E8 R/ [
{
5 Z9 l7 ]1 |( k- G if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )" c0 Z4 [8 |) U3 ^0 p
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );& f/ F6 I/ u" \' W# d# a1 p5 p5 ^0 {' r
}else{
( O% b8 c3 J6 ~) k6 `; c- n bStart = FALSE;$ [/ c* x% t9 R" V+ N, V# E
m_pItemElem = NULL;0 m* z& \4 h3 P
}
* |3 f6 x# T& x# z9 c+ ~* l }. S; O# I0 n: b, W6 R$ e
return TRUE;
8 S: a3 h' j( g9 c( V" O& j4 d4 T( r7 @}* O( r) b3 W% E) {3 V/ p
# ^& E) e; C0 C# K7 h8 l
登录视频废话:! d$ V* h/ w/ [3 _) i" I
尾翼:. d! c5 x# k' l& |" K9 {5 Y
$ G, S+ g8 ~# ?8 t1 {- |; s7 L8 o
代码:
" Y+ S. m; k. D1 E3 R/ Z
" E3 H% A0 p1 x2 o- H# ^void CWorld::SetLight( BOOL bLight )* J) R" ~' b; a8 s0 H
durch
I/ p7 W+ _0 `! G9 j2 @/ tCode:) H& R1 F+ n6 Q, i. C
void CWorld::SetLight( BOOL bLight )
" v3 n# {# @( d s1 g \. }* K{0 @# L3 M( p! x- V
//ACE("SetLight %d \n", bLight);
, o* A4 w7 Q( B4 R 1 x+ p- v" O9 _7 k: Q; @. i
#ifndef __WORLDSERVER
' _1 P, Y7 D7 t DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);4 I( @' g+ J1 c/ ~
CLight* pLight = NULL;8 A/ Y. V+ q3 G9 D3 b1 I
0 d' u! G* ~1 v% J# g
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );+ O- U& j+ _; P; ^, l3 l7 j, y1 G
; k7 E1 o; Y6 ^# V! Y* s8 E pLight = GetLight( "direction" );4 E, _7 Y/ o' M6 a' b% b
|" p' V; l7 j# T1 a8 d8 P
#if __VER >= 15 // __BS_CHANGING_ENVIR
5 v e" q h, A4 B; d if( g_pPlayer ){
4 V* g" f6 b( g# ^& P7 g% m ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
/ D e! m# w- T' t# u8 g0 \ if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!, V; V' j) `2 Z/ ^. \
{) l* x) W& j G$ d
if( pLight )/ l! p3 k+ c4 A# k& E
{
1 t1 _" o% m$ {5 }) ]0 T pLight->Ambient.r = pInfo->_fAmbient[ 0 ];& o- `) i, c3 _( b: a
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];; [! ?+ U0 `+ w$ K
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
& R2 n" @3 L& b \
& K Z$ X7 p/ D R+ b& {3 F pLight->Specular.r = 2.0f;
( U. ?2 I) r' s+ h" R pLight->Specular.g = 2.0f;( p, r) a0 B: v2 x0 ]
pLight->Specular.b = 2.0f;5 x2 W8 r- T% r9 \. |/ d" P
/ R1 v: E% _, X, i1 Q pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];+ ?$ j! Z) }6 |6 e+ h9 W. t+ ]
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];6 V2 O3 m0 j: N: b @3 |
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];9 m* L* Y1 `- W2 y5 _
9 ]1 C& N2 }3 O; d
HookUpdateLight( pLight ); + _, P8 N6 i$ |' D1 I n) z
+ Z/ {/ ?7 X; G4 Q( G) v memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );; R* b' n9 c% P+ ^) M# s
' E/ B) O9 u& ^8 @* m
pLight->Diffuse.r *= 1.2f;
7 R( d4 n, s( @2 m pLight->Diffuse.g *= 1.2f;
`( m( [) h2 \$ b: v pLight->Diffuse.b *= 1.2f;, @7 s; {* [7 f6 Z6 U- N5 E' t
$ X% ?* @' {, O6 i1 x pLight->Ambient.r *= 0.8f;
/ r0 ^2 Y3 G* j! ` pLight->Ambient.g *= 0.8f;
# l6 T/ s$ b' J W4 x3 a pLight->Ambient.b *= 0.8f;# s, j0 H, [6 D$ }& c
0 S7 o& x9 k6 O memcpy( &m_light, pLight, sizeof( m_light ) ); [1 k$ _& r" M: W4 ~7 }
5 X ~$ \2 o U# y. m; e
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);5 Q+ t, A+ c' p5 t
D3DXVec3Normalize(&(vecSun),&(vecSun));0 w( j3 z0 P3 K- h2 r
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
, }4 y2 J; O9 W pLight->Appear( m_pd3dDevice, TRUE );% D5 I9 c! l; ?0 r' K0 j1 w
6 x( L2 B( L5 w) A
DWORD dwR, dwG, dwB;- M% a( k: y8 D( M C! r
dwR = (DWORD)( pLight->Ambient.r * 255 );
4 E1 k4 p, Z; o6 x# x dwG = (DWORD)( pLight->Ambient.g * 255 );. ?6 p2 Q0 s6 R ? _
dwB = (DWORD)( pLight->Ambient.b * 255 );( v! W' R+ k4 d" K
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
/ L2 k8 E& O6 v; k H+ C/ ~) y }
0 L" d R, W! y1 a; g' ^ N. S5 y0 H }& U2 ]7 j9 T$ l7 _/ A
}
: s: I5 U. E! Y; h5 T7 T else0 e4 ~! g1 G; L0 i7 y( _
#endif & i0 V% T, G% U! w) i0 ]+ b9 i9 P
8 X# [4 o# H4 q R1 Q& @. T6 h8 E
if( m_bIsIndoor )
# d: u5 z0 p6 S$ A( L {/ L+ P9 n& f& e# _- Z. {
if( pLight )8 P6 F, L$ q, b% F
{
d A* Q6 n4 o& M5 Z+ L' [ // à??μ oˉè* ! ^0 m7 \/ {+ j4 G# I
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;. K$ s& n7 B* c6 L$ i2 z
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;' |( |: K( D1 y
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
7 s- E5 a3 \7 `4 J( y; e& N `; G" o& X n; Z. |1 ]
// oˉè* ??à?
& M! C1 W% s9 w6 Q pLight->Specular.r = 1.0f;
' D5 a! Q: z: S; ]$ l pLight->Specular.g = 1.0f;
$ Q$ j( X' N+ J' _# V, s1 T pLight->Specular.b = 1.0f;5 L8 } g' \# o& w! V' p% q
// àü?? oˉè*
# n+ ]& A& F* P3 T- n1 ^ pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;5 M2 J. p! i0 v7 f: Q! h
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
# Z0 F- s9 E8 |9 ^7 ` pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
5 d4 R' `- h, ]* k% B7 H7 n3 n
1 E8 I4 s. R0 F+ V8 ~; X if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
: T8 S2 @) w4 h/ G {
. q/ A1 z8 b* H0 ^, x9 @7 ]* H pLight->Diffuse.r *= 0.6f;" S( f6 ~7 \! `& u( V# |7 [
pLight->Diffuse.g *= 0.6f;
1 U4 e& z) ]2 p9 d$ p5 X. Y pLight->Diffuse.b *= 0.6f;
. j( j! x( E7 D! \ pLight->Ambient.r *= 0.7f;
/ b2 N) W5 d2 g2 m pLight->Ambient.g *= 0.7f;
5 [7 h; X! x2 }- Q0 s: ^2 d+ J pLight->Ambient.b *= 0.7f;5 P3 Z, F2 B3 @, M" }4 \3 @
}! U( k3 |9 i# A
5 x, Z* E6 K8 X# e0 _% I
#if __VER >= 15 // __BS_CHANGING_ENVIR% ^4 P2 K7 B7 J) E ^3 u/ _
if( g_pPlayer )
$ |) j" `- `( d0 C! ] HookUpdateLight( pLight );
5 @5 `% f! I% F7 z1 Z4 V, B, n#endif# {' e! L* R, ]8 {$ i
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );" |7 o' o1 r& z0 p" J
. r( V6 ?; Q8 m( o6 Z S
pLight->Diffuse.r += 0.1f;
, i& `; B3 V( ^4 {1 \) t+ { pLight->Diffuse.g += 0.1f;# O. G2 e H, S1 \9 c {+ X
pLight->Diffuse.b += 0.1f;
/ p- P7 S7 O/ H2 ~! [. ?& | // oˉè* ??à? 3 j& z9 W+ C* m- v3 n6 ?$ G
pLight->Specular.r = 2.0f;
; U9 F0 \5 c/ ]5 V# J pLight->Specular.g = 2.0f;! G/ i7 I9 A' j% w0 e. c( Q8 d
pLight->Specular.b = 2.0f;
" Z! N# X: i: g // á?oˉ ; o( N$ ?1 k0 h- x
pLight->Ambient.r *= 0.9f;. h% p' _8 P1 v4 |( c* T
pLight->Ambient.g *= 0.9f;
0 e$ m9 ~6 z" e6 i* q* G7 O pLight->Ambient.b *= 0.9f;. [9 Y% ?/ V2 M* z# A
* e, r/ f( D' @0 a; w: b; g memcpy( &m_light, pLight, sizeof( m_light ) );1 v3 Y" q2 u) j$ M
1 W1 H: t# L5 U pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );. o- C9 z* c. ~6 O6 o v
pLight->Appear( m_pd3dDevice, TRUE );4 ^6 U1 j5 M% J3 w9 _( h2 y
; e" N3 G* t9 G, l
DWORD dwR, dwG, dwB;
: O5 d! E+ i- t" u$ ?# z1 Q/ Y dwR = (DWORD)( pLight->Ambient.r * 255 );8 ?5 {6 j, t; Q; B) e) `
dwG = (DWORD)( pLight->Ambient.g * 255 );5 g5 a6 \- g) j" u1 A3 L
dwB = (DWORD)( pLight->Ambient.b * 255 );5 h. P) f+ ^, B) Q, _
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
- z! z& n9 e, N u- q }/ e; E& |0 D$ l D! U
}7 a5 ]8 z I9 k4 o+ ^
else. G$ G& v3 [, [4 D* {" P
{
' }0 @ }" L. v/ T" @* R if( pLight )
( l* e9 a6 Y8 b! ~ {
) z9 t, c5 ?1 T( v# A' y : J/ T5 @6 I$ {: R
int nHour = 8, nMin = 0;
6 F! f5 u' j! _$ r/ z1 ~ #ifdef __CLIENT
7 R. P4 q, f7 x& a- b+ `, _0 k4 G0 X // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
' ?- S/ v: g" T' W6 N. P nHour = g_GameTimer.m_nHour;( H, a: W" T# S6 I" c0 I2 I# T
nMin = g_GameTimer.m_nMin ;
% F3 _3 z+ T d% @ #else
' {2 g: u& D* U( l8 c- |# I // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.' U4 w( z& R$ T. ]0 I8 j
if( m_nLightType == 1 )* C, c; u; S4 ?& {( R9 O5 L9 i6 C
nHour = m_nLightHour;
# p: y" K# i- w+ e #endif" Z, c# ^3 R5 T* e |5 O0 [
nHour--;: B+ |7 ]; x# J7 j: \* K; u) [
if( nHour < 0 ) nHour = 0;% C: q/ \. v O2 K
if( nHour > 23 ) nHour = 23;
- @' ~* p5 Z1 K$ [1 ?2 O2 [
, S" M# E% |; a# u) b6 J* d# h+ ? //if( m_bFixedHour )
3 }/ ?% B R: o0 D* I. |& } // nHour = m_nFixedHour, nMin = 0;
4 f+ u! a9 u- A ^0 C, C+ w LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];" K4 ?1 s5 C5 R: c
LIGHTCOLOR lightColor = m_k24Light[ nHour ];( x% F5 j/ K- k* b2 c& ]
" b0 l7 @! E" {7 E6 f
//m_lightColor = lightColorPrv;2 D! f; ]7 P% R9 ?8 T' Q2 m. J9 i
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
# V: d: @$ }. E5 a/ M, g lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;2 d* u" j- v% n) G @1 _6 I
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;, [: K/ n5 B2 w8 ?& G; Q; q
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
6 r' M6 y% L5 ~* \$ [ N lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
& W- l7 x# j* r! u lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;4 t1 S+ _: K+ E2 M, z% }4 a
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)8 g# K2 z/ M( A2 y
% V: h* y/ B* L! _
// à??μ oˉè*
O! a$ @; p; m pLight->Diffuse.r = lightColorPrv.r1;
+ R% R# R4 b( e1 A. b" E pLight->Diffuse.g = lightColorPrv.g1; ?3 S# O2 Y$ X4 A. |& r0 `
pLight->Diffuse.b = lightColorPrv.b1;* f4 ~- H2 I( L* g( n( Z
// oˉè* ??à?
$ A: V+ y5 c/ @, y7 {1 Z3 `) Y pLight->Specular.r = 1.0f;5 @" ?) K7 Z+ p6 v l
pLight->Specular.g = 1.0f;: L+ K4 p$ a6 h! E+ _1 G
pLight->Specular.b = 1.0f;' J9 Z. Q% q. l! X: w
// àü?? oˉè*
9 x* B( A& r& n3 W0 n pLight->Ambient.r = lightColorPrv.r2;4 ^' j! p& g5 G$ f
pLight->Ambient.g = lightColorPrv.g2;
* m5 X9 E) h* ]1 ]% z) O3 r pLight->Ambient.b = lightColorPrv.b2;! l7 ]/ ], X. x
6 b0 ~8 \( N! P" Z2 l5 A* K if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.& u2 U8 W5 O/ v3 G" R! J
{
/ r, t9 s- C* [5 P( [ pLight->Diffuse.r *= 0.6f;
, \9 c: n$ W3 X2 T* N6 A( _! ~/ { pLight->Diffuse.g *= 0.6f;# _/ |) N; r: x. K P
pLight->Diffuse.b *= 0.6f;
- D0 D9 }: F$ L7 |0 h pLight->Ambient.r *= 0.7f;; i" ^- ^( s! e* U
pLight->Ambient.g *= 0.7f;- H9 g- }+ @. b. m4 Z
pLight->Ambient.b *= 0.7f;
) R7 Z& m+ C* B, @# w9 J }
- A: v. g$ l$ y( n/ {2 g 0 x$ X/ a; \* }$ I# t, x. j6 ~' t
#if __VER >= 15 // __BS_CHANGING_ENVIR
. J: _* G3 U9 v! ?7 N if( g_pPlayer )
% ?- y' @ ]" O7 E HookUpdateLight( pLight );
& z h$ W7 ~5 r( C* P#endif
0 @0 m* g! }! p6 z9 C memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );5 [" D9 c3 u ]7 Z1 _( W( |$ k4 R
G* X) I* _! n: b1 f6 Y( {1 t1 D4 u. `#ifdef __YENV) Z5 i8 [% V( a) Y2 \4 v6 r
pLight->Diffuse.r *= 1.1f;' i+ Y' _/ T- d! V/ z
pLight->Diffuse.g *= 1.1f;
1 h$ E# W `( f pLight->Diffuse.b *= 1.1f;6 G) v& l( ~- W6 f. ]9 k% m( V
// oˉè* ??à?
' G% c, q8 R P' N0 q8 K; f! o3 H# u pLight->Specular.r = 2.0f;
7 H! @/ z; w& V8 ?& o! B$ g- p" l: i pLight->Specular.g = 2.0f; C& U! G" a+ f3 u; `4 ~
pLight->Specular.b = 2.0f;
) o: [& s1 `4 ?- r! I // á?oˉ
/ w. {3 w) l# ?4 V pLight->Ambient.r *= 1.0f;
7 ^ M$ p) G# n' \ pLight->Ambient.g *= 1.0f;* L. `+ b) x5 [, |$ u! P0 [
pLight->Ambient.b *= 1.0f;0 e! G/ I$ G; j$ B
#else //__YENV# W, E1 |+ V% k! U2 F' K
pLight->Diffuse.r *= 1.1f;
, w) ~" I; Q( y! c" y0 Z pLight->Diffuse.g *= 1.1f;! L" j- V& q6 d- q
pLight->Diffuse.b *= 1.1f;
. Q+ `0 f/ _% `6 Z4 W9 H e; v/ b5 y [ // oˉè* ??à?
: L0 P$ k8 a: f. H8 C/ @ pLight->Specular.r = 2.0f;
3 r% M3 _8 E* G6 y pLight->Specular.g = 2.0f;% `1 H/ W: i- T- j) D" g
pLight->Specular.b = 2.0f;
! t; T) B9 U$ P // á?oˉ 6 j' j2 ^7 M( |; R, C2 h
pLight->Ambient.r *= 0.9f;
* h. [" E4 l) \4 t! E6 A pLight->Ambient.g *= 0.9f;
, m0 w6 H5 q% l- \ pLight->Ambient.b *= 0.9f;
9 @$ i7 `$ ] W2 g T#endif //__YENV
9 a0 R- D7 V( R6 U
e7 s1 N, u7 U memcpy( &m_light, pLight, sizeof( m_light ) );
: n3 C: u6 q% u , k: z2 I) ?2 E9 O8 V5 b0 F, ]0 g
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);. u! |3 v9 N4 g$ K0 Q ]9 W7 v
D3DXMATRIX matTemp;
- e5 t6 [. h9 w7 @, h" N static const float CONS_VAL = 3.1415926f / 180.f;2 Y* f2 m2 v% z0 L4 G3 K. L' Y9 ?
7 p0 T" b6 F, x
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
) m; i+ F1 j' p( o2 \% c/ W D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
) R7 }5 ^9 ]9 I% E' `) P6 w) t, i pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); " e7 u& ~: c4 u% h& \% b* i8 i
pLight->Appear( m_pd3dDevice, TRUE );! Z; @, e3 M4 _7 x( U+ E5 M
( Q( J( P% N9 K! a T* l1 y. B
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
5 }! q. \) i, B6 g! k" `* i! i // D3DXVec3Normalize(&(vecSun),&(vecSun));. ^3 z6 g# w4 `. Y
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
) K. G$ l( i# d0 ?$ j( j, m) N
# g1 ]. t! @# I9 O# _$ v DWORD dwR, dwG, dwB;6 w7 t8 M1 [+ U
dwR = (DWORD)( pLight->Ambient.r * 255 ); [) o3 L* L: n5 }1 Y
dwG = (DWORD)( pLight->Ambient.g * 255 );
8 G! S( d5 U1 a5 C dwB = (DWORD)( pLight->Ambient.b * 255 );
" o/ ]; X+ Q. \" h5 f dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
2 E) L& K' ]! U1 W) H' a+ ` }/ G* @0 t g+ K# o( g
}
* `7 ^. [# p# ]( ?, e, a: e4 S. C; u: o$ _ A+ s, Q
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
7 A+ S' e: l. K$ g: L9 X9 h 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, L5 j8 _# T* j9 i. M4 r ::SetLight( bLight );
8 M9 ?+ [1 d# U2 K6 Y% }. U0 K! j! \2 q- E z% f
// ±ao? ?D?í???ó á¤à?
8 [2 [1 c$ Z4 F& E m_pd3dDevice->SetMaterial( &m_baseMaterial );7 A" K: C2 ^* r y4 z
- ?+ V& q$ _2 k( o) j+ x0 y#endif // not WORLDSERVER( x* ~' @/ U9 M
}
# E% r& K. T4 s5 L, P) ~并更换# g" m1 w/ T+ C: X* p9 f1 `7 H* h
Code:# [2 J, M1 I- j$ l$ ^
__FLYFF_INITPAGE_EXT) J+ w( e$ Z! k. ^
定义
7 U) u' q/ G' K( p' t3 \
( N7 U- H/ j% N4 i( C. A% T1 ~; B
4 M! n# Z+ {* y& ~, n
( d" u5 {8 a. u8 x! ~! p6 G! k' z7 i; c, k/ J
现在终于删除我的狗屁加速...7 g! z7 @( A5 o i4 D
0 ?2 f: a7 Y D2 u1 D9 G! Z [% _! q
E" t$ E7 S& [( x: ?3 `
. B4 A3 Y, A( T. X' B, r
|
|