|
食品车:
. ?3 M% D: @: t9 P尾翼:
6 r' t, Z( e- Z. b9 P* \( S) F
" P( G& v: [4 u+ v: A' g代码:3 K; l U: I: z, E
CWndAutoFood::CWndAutoFood()4 x, I6 x/ Q" _ o1 h3 f# g
{
! ~& _/ n0 q: I% s3 c/ H m_pItemElem = NULL;
5 a2 ~; u" x! k e4 s t$ H m_pTexture = NULL;5 K) |8 C2 x9 o5 ~; G
bStart = FALSE;
! R9 Z6 d8 }# X' s; j% o" D}0 @* t& {0 C% p7 [7 ^5 D
. [$ G# S& [* ~6 D% WCWndAutoFood::~CWndAutoFood()
( x2 ^3 s0 X3 o' h$ k{
* _5 \( y# n9 `5 Q1 }/ h AfxMessageBox( "AutoFood ist gestorben " );8 e$ c( p/ |5 v, p) z# P( n' h* @
}8 m" G. V; K% `$ `4 c9 g1 v
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
1 J" e( {- y; Z7 \' M) b9 p{
- k4 ^. U ], Q/ Y; e P9 I( ` return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
6 ~- W$ J$ x$ v q I}
: X) H B: O3 E( i6 c7 Y
: E* t4 i/ d9 r# m" lBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )' i/ v ~$ m! H
{
$ o) F8 y3 Q: A LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
- d+ v$ y9 ^# @, m8 d% k CRect rect = pWndCtrl->rect;/ V* |- U3 b0 j8 |7 Z
if( rect && rect.PtInRect( point ) )
; A9 \7 z: k( e8 [ {
0 S0 H) |+ `, R8 ?7 ^. G' e CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );- p. x, j5 Q w# p
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
2 M0 N% Z" O2 ]4 ~ {
: x& p3 U7 y/ D0 _ if( m_pItemElem )1 o; ~9 H' A2 J0 _" t2 n* ~4 `" r
{( Z* c' ~1 B" a( _- @. l
m_pItemElem = NULL;3 v& n. }9 `( Y( C/ o8 G
}
5 O: i5 T2 {& g! M& c0 D9 [ m_pItemElem = pItemElem;
! k, V& C/ j, F+ g m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );& k2 O& o8 m& A. S9 v' L6 W
}else{
2 S |3 W0 ]% S0 y1 L SetForbid( TRUE );& n7 y% G' F1 o3 y
}) W5 R4 f( Y7 F8 M8 P6 ?( R" q
}else{% K# ^. n* p5 t
SetForbid( TRUE );3 K" x r3 K. L9 F# V5 B* ]
}+ J& ?" q- ^$ f/ q
return TRUE;: |0 r0 r2 W& x. u4 }) \: Z
}
7 \4 I# v5 N$ y+ {0 c7 F: O2 i4 L% M8 k! J4 x# n+ j
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
! c. g# u, q0 j8 G6 j! n: i8 X{
, o! b* @0 S4 \6 d switch( nID )+ y3 @$ _. f* A
{. `. d3 O6 K" V- a
case WIDC_BUTTON3:1 `! p2 F% i+ z; D
{
9 n: l3 M: B7 ^ h1 b# O- Y bStart = TRUE;3 [% u% c! m$ q3 a1 E& y0 Y0 g
break;
1 W3 \! s( u4 N. X! _. Y3 ? }2 z6 A% Z. j! o! H5 J$ D
case WIDC_BUTTON4:
* ]* ~% A0 l5 T F$ R {
6 p# B4 k- J* F bStart = FALSE;$ i- n6 V2 I$ I+ v
break;1 h8 p+ `+ h& i& @" d
}$ `& f% h9 m5 D9 N+ m" _
}
$ t: [+ j& O9 S8 U+ w/ B A return CWndNeuz::OnChildNotify( message, nID, pLResult );1 ^, o5 V1 r# Z: w B' s
} : A+ i3 F; {+ N( k2 v# \2 s' g
void CWndAutoFood::OnDraw( C2DRender* p2DRender )( W. a" e$ q5 e, P
{
6 j9 `) O8 D8 @/ } CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );3 V: G0 l) a2 A8 K. C/ P4 I& m) o
if( bStart || !m_pItemElem )
1 L9 t6 r% r( H; t+ \ {
- S- A$ ?. j- X9 b) Z/ K pBtn->EnableWindow( FALSE );
' Z; U9 n( `5 g# u) J/ { }else
1 w/ O6 e$ e6 X# _ pBtn->EnableWindow( TRUE );2 l" p% h- F2 F$ b
if( m_pTexture )
8 Y; j" B5 }4 X7 O: I$ b {* H: h7 c0 ?. a+ x0 u
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
3 {& x4 u% \1 F: p8 C- h6 @ if( wndCtrl && wndCtrl->rect )
8 {, r9 b7 g. i" L6 F {
C, X+ Z0 o" z m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
. |% ^1 X4 k; [# _) N }2 F6 \6 H+ S( ~3 X
}
, J7 J0 N) |8 K" s$ P' b6 r; T}* O, {* Z5 x) y; N, G/ Q8 h
0 `* J8 t8 K. E1 x( LBOOL CWndAutoFood:rocess()( ^/ _, [% a! |5 |
{
' c! h/ P2 l7 ? if( bStart ). W9 e7 H; {3 R# o( R' _+ I/ I
{- x! n* k3 {' o0 w* [& I
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 ): _+ |5 {! h' z& u6 E( s0 j
{
# m1 A/ V$ P$ t8 q7 ? if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )$ g+ |* N! |9 z2 Y7 z3 Z K2 Y
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );* K4 w8 y; t. ]8 ^+ C$ D
}else{
6 S5 _6 c! @ `6 T) h$ W+ w bStart = FALSE;
+ e& i7 |# m0 ^) h; m m_pItemElem = NULL;
9 F! O2 V5 i9 r7 E }
1 q' Z" j- T5 z$ J% \0 {: U* }/ k. ? }8 W/ W5 V# w& ~! D0 n1 [
return TRUE;- d k. ^/ b" `/ ]6 ^
}
4 N% s3 x' p( o! v5 {8 e( D
& ~% y$ \: \0 S! ~: g登录视频废话:: s6 Y$ G% z2 _5 W- \+ u
尾翼:
# }5 d& |) y2 w- L- V7 V ~8 @7 B/ R
代码:
/ A! g0 R( _2 k4 j
; t6 f0 s9 x7 Tvoid CWorld::SetLight( BOOL bLight )
0 k2 e D; U6 sdurch
! C* A4 M* E3 N% Z7 ~Code:# s, [+ i0 ^0 w6 D
void CWorld::SetLight( BOOL bLight )
0 E0 V! L- i: }$ j{1 r; J$ v& b5 o) H/ p3 f
//ACE("SetLight %d \n", bLight);
, Y, T9 Z! P6 J8 @, z0 _, I
1 C9 G5 d5 P3 `& K/ A' e% ^#ifndef __WORLDSERVER - Q+ m5 d' O- i: o' M) c
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
( q/ U* f- t" @8 g. K CLight* pLight = NULL;. W& m/ D$ E* M; k: S' [
6 Z+ d+ j' n5 u/ Y+ x! I
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );; j4 \9 o2 }& |1 c: e
; |% O) g9 }8 l. K [; K
pLight = GetLight( "direction" );, \* i2 t4 t* Y8 F, Y
/ B3 {5 [+ S! u, a#if __VER >= 15 // __BS_CHANGING_ENVIR" o; J2 ?# {0 e' g5 o7 v
if( g_pPlayer ){* h5 U& o' K8 ?
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );* y( I5 E' l1 H2 r" k
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!/ F; z2 t8 R- D: m) s, _6 q, [$ x
{: ~* B' d/ L" F8 `: ~$ B
if( pLight )' W$ [7 {. o, @! f: M- @: @9 r4 Q
{) l0 p% e2 n, h8 {1 s, f
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];1 O2 V E0 U3 X% o5 P: |- A
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
3 ~% W6 }/ R$ f) D/ x, j6 M pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
0 b# G4 S, o' K* j0 v: S A( _) [1 d' @7 f" |# I6 Z
pLight->Specular.r = 2.0f;0 B: |" h. t$ ^' n0 j
pLight->Specular.g = 2.0f;
" {) u1 k5 O h7 u& Y( D' J* S pLight->Specular.b = 2.0f;5 r: x' m5 u1 y0 R- |9 W: v
$ p: d0 I# D5 n5 V5 s$ G, ]
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];# Q; v3 ~' B+ @' X9 P, O
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];$ o2 N6 I) s: O( k+ o4 l. {- u8 s) {$ Q w
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
7 y1 |# ?+ {- h3 p M+ U, S. f
9 J/ Y' Q- s' h' f3 h HookUpdateLight( pLight ); 8 j y/ Z' M! `7 Z8 \; I
/ j: X$ ~& Y: V O
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 G# U6 j, U+ {6 \. x% ]$ z2 X4 c 6 p7 p1 H C" ^
pLight->Diffuse.r *= 1.2f; I/ b( D" ?1 B* L% y
pLight->Diffuse.g *= 1.2f;
$ u A9 b/ q* U% b& p- H* x* N pLight->Diffuse.b *= 1.2f;3 h9 x- I. R0 k( V/ ~( H4 F' t
0 I# E- Z) h9 O0 R0 l' m
pLight->Ambient.r *= 0.8f;
7 {5 B+ @$ S1 g' v" J. _* D* c9 F" E pLight->Ambient.g *= 0.8f; w- y) Y( T d& [* w
pLight->Ambient.b *= 0.8f;
6 J5 c" J3 f) D" V" `# j : [2 o* ?9 g1 w, u* j6 P% o
memcpy( &m_light, pLight, sizeof( m_light ) );1 `0 r6 M, B7 c
( d6 m. G7 q% E2 k/ T D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
& l+ q& p: B4 A$ [! a! V6 { D3DXVec3Normalize(&(vecSun),&(vecSun));; [7 H- M/ S( U0 e% q6 }5 @! k
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
3 ^" A( X5 t" n) z# s) m; l pLight->Appear( m_pd3dDevice, TRUE );
( A5 v# i% E+ E+ U4 ]: T
1 n( t0 M0 y: I& | DWORD dwR, dwG, dwB;; G; f3 [9 a" s* F
dwR = (DWORD)( pLight->Ambient.r * 255 );7 S# m3 F1 ^8 @* j6 m' l! c; v3 b6 p
dwG = (DWORD)( pLight->Ambient.g * 255 );- ]4 R; K. S. F; E' E
dwB = (DWORD)( pLight->Ambient.b * 255 );( h! Q- ^3 m3 N2 u; t+ h/ X9 l+ F
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
- |: z( X7 W$ @ m }' a w v* @+ T* K" v) Q" Y6 B
}
3 o( Q2 G$ M; R( ?5 _7 a4 d5 D }0 Q( w: l$ j6 V
else
6 l# d7 O7 P1 H$ w" K5 T#endif
' R5 _- q/ I2 {1 R' g4 Y8 I& @7 l! m n- Y1 R4 @
if( m_bIsIndoor ) x" ^5 y" _' ]5 I) [
{5 a0 Y0 k1 l7 h" d% T8 y$ N. A
if( pLight )
; m# d& u5 K2 R3 w2 L6 t { ! _& P7 p1 C, y) h8 Z' x: E& u: z
// à??μ oˉè* 2 \9 V' ^5 T) n- @
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;3 t0 y! D; s; _9 f- v7 B
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
1 h9 T: @/ h9 n- D pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;0 l! S J* c8 G- ^: _1 ]6 V
' c+ g! \$ [5 f, Y0 J) ^& K0 g // oˉè* ??à?
* W5 g8 A) r! a5 q pLight->Specular.r = 1.0f;
" x3 i7 G% H7 O* j" ]+ K6 T5 L pLight->Specular.g = 1.0f;
) L' d, j( }& { I P0 D% c" V4 F pLight->Specular.b = 1.0f;/ i* ^+ ~1 Y' P! `8 h# N0 j
// àü?? oˉè*
/ {" D. P; P$ y3 J, Y pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;* C0 |9 L, g& [+ [
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;1 u! v/ g: }2 S# g
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
* k/ {' N: O1 w- O6 Q- M$ R$ k5 s7 N! r
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.3 J3 I. x! Y ^7 @+ x
{& o! Q8 `, T1 b: a
pLight->Diffuse.r *= 0.6f;, V% a" a! ^% l2 a; [! R* ?; x
pLight->Diffuse.g *= 0.6f;) P: F% {9 p% H& B6 Z2 f. b c
pLight->Diffuse.b *= 0.6f;* r2 r3 Y* J, Z
pLight->Ambient.r *= 0.7f;
1 n. e' S# O4 Q5 Z( [$ P: p* v- G pLight->Ambient.g *= 0.7f;' T' j3 Z& I& d2 @. f; o
pLight->Ambient.b *= 0.7f;' u" K3 j4 C: }! {9 l+ t
}! G1 a# I% z6 B% `4 s, _- v
. J8 V+ o1 O' _6 X$ _
#if __VER >= 15 // __BS_CHANGING_ENVIR, R4 w/ s' ^. K w, S! y
if( g_pPlayer )
# k$ S i8 P& R) o: o! `: v HookUpdateLight( pLight );. D5 T/ k1 A% c: K7 Z/ j
#endif) ]2 K$ x. P% s
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
8 B( D. p2 `3 C% s# n$ d0 h& a6 I1 e" h
pLight->Diffuse.r += 0.1f;
8 d& @' ]7 q+ n pLight->Diffuse.g += 0.1f;
8 i1 |; V; Z- I3 X pLight->Diffuse.b += 0.1f;' B# X+ v0 P& f9 b4 _
// oˉè* ??à? * `; O# y! X; H" \; B5 d) ^' ^4 ^
pLight->Specular.r = 2.0f;& L' V: y s# L! {+ I0 u; P0 a) ~
pLight->Specular.g = 2.0f;1 A+ `% v7 n% j' @0 U
pLight->Specular.b = 2.0f;/ X9 x. r7 M* l
// á?oˉ
. T2 d3 m& U0 y) { pLight->Ambient.r *= 0.9f;6 ^$ g: M X# s5 I. h& O% [. G0 H
pLight->Ambient.g *= 0.9f;# I% q9 {+ ]8 M+ f
pLight->Ambient.b *= 0.9f;
: \7 q, Z7 Z! e7 ^! k( {/ o# H1 J ~" K. C$ ?6 W5 d
memcpy( &m_light, pLight, sizeof( m_light ) );, w* M% B8 W7 C2 K+ k
$ b8 K) T& M. j# l @
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );! F6 w6 [- x D0 v
pLight->Appear( m_pd3dDevice, TRUE );, T, N7 v2 z8 s. \4 z+ F& X
- x/ i/ m( q1 S( W DWORD dwR, dwG, dwB;
+ U+ S3 [" _, t5 u8 G U6 Z dwR = (DWORD)( pLight->Ambient.r * 255 );
9 C* J$ `! F- E$ N, i( p dwG = (DWORD)( pLight->Ambient.g * 255 );+ V4 B1 G$ x0 |2 O" ^# H# G
dwB = (DWORD)( pLight->Ambient.b * 255 );. Y* ?, F5 x# E/ H( J1 H6 `7 R
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
4 m2 T* V, Y' [ }% ]9 v) e% n! d; Z0 s. i
}6 Z: ~6 }7 X3 E) L9 |0 e
else+ U9 ?1 y/ ^3 N8 s+ z" d" x
{/ q4 K1 _( O! }' D% [
if( pLight )2 T2 i: { p7 |; u; \$ V8 }8 O4 ~- ^! n
{( I: M% p& c3 D8 i2 Y
/ q. G$ b5 k$ \ }! L int nHour = 8, nMin = 0;
: ~# a; i- R: Y# Q- T, d0 c #ifdef __CLIENT
6 Y b: B0 a4 j) w! M% | // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. / I7 ~- c# {- C
nHour = g_GameTimer.m_nHour;
6 f9 Y6 _* ]* W$ R6 O5 D8 h+ E nMin = g_GameTimer.m_nMin ;+ c- `5 r# H; F; Y1 \
#else8 n: A7 Z9 e) X$ z9 e
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.. N/ y. q6 q8 @7 x% t- \$ [
if( m_nLightType == 1 ) a/ R8 v. n+ u: c
nHour = m_nLightHour;
" D6 P9 U# V* G3 z #endif) a; m0 x! f4 {/ X m, d) O
nHour--;( z+ C6 j+ g8 l) F1 ]8 [
if( nHour < 0 ) nHour = 0;
( s4 R/ ]' D5 x9 x. J: A+ B4 A if( nHour > 23 ) nHour = 23;$ ?* e x6 E& p% B* R
. p9 A6 z8 h; Y. T //if( m_bFixedHour ) u5 d* _9 J9 ]$ x. q8 G! N
// nHour = m_nFixedHour, nMin = 0;: E- W" ~. X. N4 z2 R
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];6 [0 w* q* b2 ]. A5 l; @
LIGHTCOLOR lightColor = m_k24Light[ nHour ];! v) P) }* s- p
, A, b: p) {& \! C/ e( g
//m_lightColor = lightColorPrv;
$ [( [3 E0 V. r0 y lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
9 f, A* J' j0 ? lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
+ B: z* R) H1 Y( |+ j# j c, ?6 p lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;0 [5 Y/ m' C0 u* ~5 f
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;% a1 v7 q: ^; ^% _
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;* c" u- D! n8 n# F _+ D; Y: `
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;" l. |5 o2 a: |, T: W& ~
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)! K; J; v9 X( n% U
+ J" v6 \2 z, O$ t7 U
// à??μ oˉè*
7 T+ R3 K) r! G- w( b4 E; b" \8 C pLight->Diffuse.r = lightColorPrv.r1;) K5 w: o; |/ [4 \: z( R; Y; _9 H
pLight->Diffuse.g = lightColorPrv.g1;, U+ q' P# S. z
pLight->Diffuse.b = lightColorPrv.b1;
& s1 {, U( e! J% x8 { // oˉè* ??à?
9 L' T0 n7 B. A0 \: D9 i' i pLight->Specular.r = 1.0f;/ B+ P' ?! I% h3 O+ [
pLight->Specular.g = 1.0f;
! G, ]: i6 f* c: s: n% |9 ` pLight->Specular.b = 1.0f; ?0 X q# h6 Q; `3 ?7 G# Y
// àü?? oˉè*
: v0 c& M' ]. P6 B+ I* r pLight->Ambient.r = lightColorPrv.r2;5 k) v, l8 \7 v% T
pLight->Ambient.g = lightColorPrv.g2;, A' R: M6 T+ N$ t. j
pLight->Ambient.b = lightColorPrv.b2;
6 b5 X& e) s5 F4 ]
' b& f- g5 n; F) T' p if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
0 l/ U2 ~. Y; x# I' E {
+ E! f. f" g. d) ~# y' u pLight->Diffuse.r *= 0.6f;: C9 Q8 u; X3 E9 R: ~
pLight->Diffuse.g *= 0.6f;' l2 a1 v6 ]6 c( a0 E% O/ x! z* V
pLight->Diffuse.b *= 0.6f;
1 h+ X* x& y$ S pLight->Ambient.r *= 0.7f;! G$ Z% E8 R3 y/ E' @$ u* @2 T
pLight->Ambient.g *= 0.7f; a! D% Z+ X2 R& ~* s, ~
pLight->Ambient.b *= 0.7f;2 t/ U6 _* V/ w/ |9 Q: |5 V* u
}
' E# m$ f: O a " Y0 r4 ?! c# q9 C7 [+ M% g6 o& W
#if __VER >= 15 // __BS_CHANGING_ENVIR. e2 ~+ H: S+ X# \! L0 _
if( g_pPlayer )
7 ]1 Q% ^0 ^) a4 @ HookUpdateLight( pLight );
2 e$ w* I0 s$ s* p#endif% _/ J; @8 |' ?& ^$ Z$ m9 D) u
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );3 I8 @1 L2 p" }
4 V' i; R* n8 z: R+ U- P0 Y" m
#ifdef __YENV1 G5 B0 k' U2 x1 f% e0 S# F* ^5 _/ d
pLight->Diffuse.r *= 1.1f;) I X# z1 ]: G4 K% Q
pLight->Diffuse.g *= 1.1f;2 _! ^' i. E7 f3 g5 u4 z
pLight->Diffuse.b *= 1.1f;
, K/ X) o( Z) \2 J- i' e // oˉè* ??à?
8 j) f5 I# }- O! g( ^! _ pLight->Specular.r = 2.0f;2 H" ]: b; [' m7 U' }
pLight->Specular.g = 2.0f;
( @5 q: ]; D+ Z9 x7 Q$ t/ e pLight->Specular.b = 2.0f;
/ u/ r: ~( t) J2 B // á?oˉ
* }6 i$ P/ U' m, d pLight->Ambient.r *= 1.0f;) n ^8 c% U% Q5 l3 i
pLight->Ambient.g *= 1.0f;, [; `6 q# Q9 t7 s
pLight->Ambient.b *= 1.0f;
; d) P F( ` t/ r9 X( A#else //__YENV
. @& v% F& D+ i, |4 @ pLight->Diffuse.r *= 1.1f;
1 r w' G% s6 R+ y/ d: q pLight->Diffuse.g *= 1.1f;8 G' R) r/ m6 p( j5 A. b* U" L
pLight->Diffuse.b *= 1.1f;
. l7 G C- o, |3 @% o+ v3 G2 t# H5 n) f // oˉè* ??à? , Z/ D' Z E2 @' N& U8 e
pLight->Specular.r = 2.0f;
9 W- l1 l }- \ pLight->Specular.g = 2.0f;- v# z+ O5 T, M$ j n( v2 p9 T
pLight->Specular.b = 2.0f;
4 W. O- N: P! o; A- }6 L- a$ u7 \ // á?oˉ ) u, S7 C8 n9 B( I% X
pLight->Ambient.r *= 0.9f;
6 @) W6 M7 l2 Y pLight->Ambient.g *= 0.9f;& W! [ ^2 s1 {; r; y5 b, ]
pLight->Ambient.b *= 0.9f;
& r- l6 K- }; Y! W. V! J/ `#endif //__YENV * z3 C8 B- }3 u
2 m4 e7 O- u n2 q
memcpy( &m_light, pLight, sizeof( m_light ) );. L$ x5 u: ]5 \! v& z
8 K3 }; q+ }; C, \3 |7 E/ f8 H" X4 ?
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);- h8 l! U; U4 V1 m
D3DXMATRIX matTemp;
; I5 R" R. p& E! h k8 M static const float CONS_VAL = 3.1415926f / 180.f;
9 Z. C! i7 a C" ?( `: e' K, a" H( R/ M* m, L+ o8 z0 p' U$ N' k
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
6 |" O- ^$ q6 y( Z3 J7 r& }8 i: ` D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);; }+ J/ w% @! [$ K9 V* m* F
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
' J9 ~3 u7 Y' G! R2 G pLight->Appear( m_pd3dDevice, TRUE );2 D, F; k" }: N) }2 R
$ X8 X5 W3 v% E7 \ // D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
0 i9 |+ v- S: L' j- ]' E# D // D3DXVec3Normalize(&(vecSun),&(vecSun));
' d; |% d6 t4 V // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); ! P' Z; r( K! b ? t! r/ X
) y7 x# t8 c# q: r: \& V3 l) p0 b
DWORD dwR, dwG, dwB;
s2 \; o M R* E1 n dwR = (DWORD)( pLight->Ambient.r * 255 );% Y) R O4 a0 ?0 ]- d
dwG = (DWORD)( pLight->Ambient.g * 255 );
9 Q4 n5 N/ F. k& O( h, y dwB = (DWORD)( pLight->Ambient.b * 255 );/ Y Y8 }5 U- r5 A( M- K" S
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
' u1 l" J- h( [; G }
1 w: ~' v4 G: H }
6 ?, ~/ \$ [9 p* A5 y; [6 X
+ k6 _! [1 `% P5 W |: c m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
! B8 m; y# t8 Z 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) );' G4 |/ c% ?$ S9 E+ t% R' P
::SetLight( bLight );& N, S3 k- K- E8 N* ^# n
# V9 {: |9 c! n D0 Z // ±ao? ?D?í???ó á¤à? * X) O3 t9 ]0 k; I3 d
m_pd3dDevice->SetMaterial( &m_baseMaterial );
( C0 s8 ~9 |+ D. s/ W 5 X: [* ?& ]- d3 M+ d
#endif // not WORLDSERVER6 p f+ {8 @* r( y
}
1 L! W) r1 }. t$ d$ m并更换, A- h: E) ]$ x
Code:* z* }4 K1 N3 a P; Q- o
__FLYFF_INITPAGE_EXT
' S3 i- r6 Z, B* L, O' [定义
; ^+ |3 V. `0 O+ p( v8 ]+ ~: r! r0 |5 K2 B
5 N3 p# A, [7 @# B! Z0 D8 c: V
7 K+ i V& x5 R, y$ r
; V# o! I$ M! Z Z现在终于删除我的狗屁加速...$ z' P6 A0 Z. m, k
: A h3 |* {( W
9 E; Q' s8 p7 s' P0 C5 f, ^+ |0 |5 B. W2 c8 v
|
|