|
食品车:+ P% w. [ D' P7 h9 N0 ~
尾翼:
( ? v, p. k( c B- S5 h
$ x4 B1 r K6 m3 @3 S/ N代码:
) F6 ?) J2 @; E. CCWndAutoFood::CWndAutoFood()
2 M" w3 K4 ?' s0 F9 m9 ?$ m{
5 W" x' ?* ?* F7 h8 u- R+ \ m_pItemElem = NULL;+ j- d" H( ~* Q
m_pTexture = NULL;' Q8 _6 H& l8 g/ B) r$ P
bStart = FALSE;
% }: y, k" M1 P) i2 Z; r- w: S}
1 G. B1 L$ Z @+ d3 R D: l `4 t* W* S3 J$ L9 r
CWndAutoFood::~CWndAutoFood()
1 g- V7 C! r' u& Y2 {. G{
7 p; n- \: U* R AfxMessageBox( "AutoFood ist gestorben " );; {/ H# M& D5 M( O1 N
}2 Q7 C2 w0 g4 q: k& L9 }
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )9 Z# j) x6 k2 o R @
{
[5 A: F" y# B- E! N# R1 Q return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
% m( |$ n A- @4 ?6 P3 }}: i/ O3 d/ M; m" N# k2 w
3 H$ f% g7 g+ g* zBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point ); |* S+ k5 H! Z' X- \0 S
{" o# n7 L8 ~' p9 ?5 G8 _
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
5 M' G6 z, R9 b A* ] CRect rect = pWndCtrl->rect;
% Y9 `3 c; W3 p W9 _ if( rect && rect.PtInRect( point ) )
$ \! t) V7 Z& ], F' d {
/ i" x$ Z7 w" n& [ CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
- |8 O. l- O4 I; q if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
* @# {. F5 x) l" R. F" ? {
- z% x6 c# Y7 P8 ? if( m_pItemElem )( G8 B- A& @; G) U# h/ m
{
& k9 u! D7 o$ M4 o0 S m_pItemElem = NULL;" f* V% R1 N8 B; Z
}7 x- w& }- R+ X" j: ?0 U
m_pItemElem = pItemElem;
$ [, H0 {# b# { m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );" ~% X0 e; A* v7 n4 Y0 p
}else{% x1 u- h& C4 }; M3 t4 A0 T
SetForbid( TRUE );
' G, M/ s5 p; }9 ^% \. W+ t }
' \# N( |8 b" w, K3 B$ D. G( h }else{+ d# p5 e' e+ R5 b4 z' m. M% `
SetForbid( TRUE );
3 c* I% \$ w5 c5 c N( g" J- p }
' z5 c: n* T2 j. W; z; u# O2 j2 {! ~ return TRUE;2 S4 B( t5 w- }, A
}' `3 ^7 F% d6 L* Y4 ^/ F
1 }8 c4 ^! n) I$ ZBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )& F! k* H. S" D/ C
{
4 ?3 m3 v0 ^8 d" m' F4 U8 g switch( nID )
; ~. C* m& y8 L {8 a E" `* b4 z& U) j3 k
case WIDC_BUTTON3:
/ K/ D( ^) c) A. E" c {
/ }7 W- x* ~$ N9 C6 X$ R! Q bStart = TRUE;
2 X D; ~3 l2 m% M a break;. ?' H7 s% `2 l ~& [' }
}
* ]/ Y; N# O7 q0 C Z3 G case WIDC_BUTTON4:8 P0 ]( {4 f3 f" |1 a3 f
{; L7 Z* p% h7 k- f7 |
bStart = FALSE;+ q- s& Y( k0 v2 V$ Z1 Z
break;
( N' N% D$ ~7 e3 @8 p8 }( q }" ~( p% k+ X3 N
}: i3 {: |( ]) f% u$ |
return CWndNeuz::OnChildNotify( message, nID, pLResult );. a7 B. V+ F0 L2 X. U) _
}
& P) q9 q+ g# I5 d8 y5 z. T. Wvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )
: g8 o" M, |. y! Y{
. o- D& n6 Z( l: o/ v CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
8 k1 |7 z% }0 S7 w" m- u. S1 ]1 l if( bStart || !m_pItemElem )
; U% Y1 E/ t5 e: K, `* y {
3 G# ]4 e6 c8 m4 v3 X! `( b* Q pBtn->EnableWindow( FALSE );7 B6 L1 L# ]: G K' \
}else3 [0 L4 g4 f0 F8 Q( Q
pBtn->EnableWindow( TRUE );/ Z1 ~ E) \6 S7 T0 _+ ?+ w
if( m_pTexture )
, x! w5 _: e6 J$ S! R6 s {
$ J9 J8 J# R3 g) E( Y/ D LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
. v/ L0 H4 ]7 o+ @ if( wndCtrl && wndCtrl->rect )
! A& g- [( C5 w9 f$ v4 Q* ^ {
, \# \, \+ l1 c9 A* w$ i m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
! b: `; D1 a$ |+ x }
; ~; e; Y, [# Q4 H }
! B! q, \8 C* y W2 h2 g}/ R. [: y& u6 G z
. _4 P/ v+ g) R z. OBOOL CWndAutoFood:rocess()0 U1 |8 Q6 c G' I
{+ c6 F5 u1 H1 x5 \: ~8 i
if( bStart )0 e# q0 O0 u% H! I4 Z
{6 l, f4 a9 o0 T/ S- Y
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )$ r2 z, T& g5 e7 {
{
. b$ F- J& g& I. M) A9 `" O if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
5 @9 y+ K5 n. T2 F* I: ` g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
1 ?; h5 k2 ]4 m+ }" U6 X }else{
% @9 c3 Z2 F0 |4 a! [& G4 q bStart = FALSE;
1 ~5 I {; Z B2 i9 U& o m_pItemElem = NULL;9 u1 E5 K0 x, i/ N6 D7 U7 b x7 C F
}, D& V6 o" l" i+ F
}4 _" H/ @9 Q# J
return TRUE;
; n# N9 P R" F4 |' A}
$ @. s1 ]8 l- ~; l+ Q# o1 X d) F/ U2 E' k( d9 O( d
登录视频废话:4 }7 x$ O j& l* H1 d# N
尾翼:
6 N" w3 ~1 N- t3 I, j* Z2 U, J9 e/ W3 I* n* u; c+ a
代码:
9 m/ d& O6 J5 }
" _: a. Z% [0 v% g3 zvoid CWorld::SetLight( BOOL bLight )6 L! d3 Z5 K- k- P6 T3 F5 X5 f
durch1 r3 O5 T$ }! W4 o& _1 |
Code:' `6 U# y5 c" Q+ m7 r# i' N
void CWorld::SetLight( BOOL bLight )
' W" k7 o! G) k' Q' M) S3 v{* @% s$ S* Y8 T8 F& q1 k* o; a
//ACE("SetLight %d \n", bLight);
* y0 T6 s; d% e; l9 G / `8 g' i% r9 U0 i1 n' M
#ifndef __WORLDSERVER 4 U% P/ z) @2 n# ^, r% ~
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
: x2 \4 n1 Y7 m7 n R CLight* pLight = NULL;
2 O* q1 R3 L+ X; k
& e+ m8 L9 d- S: Y+ I" {( u$ g- M# d D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
, W4 C4 G: {% R v$ m
" R% Z: b' a; \$ g' A4 \5 f pLight = GetLight( "direction" );
% O, Y6 ~# H% `+ H, W7 x/ W* U, Y1 J1 a* j( N; J
#if __VER >= 15 // __BS_CHANGING_ENVIR
1 d& ~8 }( h, ?' G if( g_pPlayer ){. M0 P( N) o* M- J
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
( v% [6 A- S( D _% A; } if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!1 C8 i+ v8 x4 I P5 q3 g
{
4 `5 w7 K. c* ?3 ?$ Z1 [1 K4 Y if( pLight )
9 U$ n9 B$ `" t {# c4 R0 }! F' j/ U( l
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];& s8 B4 H8 O; P" k4 \& P5 _' c
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];9 ?2 g2 ^) M1 U7 w3 s
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
5 c' L, Y. c; H1 c& Z6 D$ M
! X1 q. p, i+ [# N pLight->Specular.r = 2.0f;! |6 H/ s9 [7 h
pLight->Specular.g = 2.0f;
) ^4 c4 w9 Y/ \) ^' g pLight->Specular.b = 2.0f;
9 l o) }- c0 @! w
7 C# S+ i, @4 C0 N; g% Q: P: _4 J pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];6 W1 M7 c, `! Q3 g
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
$ s# k! i1 f) t( ^. [9 n' C pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
- l6 h& X# L1 q" M Y8 \ I ' u8 H- \9 X# }# w- O; [7 D
HookUpdateLight( pLight );
9 M3 Q: _. C" ]+ x( U7 n- g- G1 N4 p
. T( d9 C0 S$ c& a memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );: S+ h. k; B' O8 q% z
% |6 F# R2 E& G5 e' M* I pLight->Diffuse.r *= 1.2f;& C. U6 u- @: r8 ]4 j1 E2 c5 e
pLight->Diffuse.g *= 1.2f;
# i! x' e- H$ Q2 L9 R7 e pLight->Diffuse.b *= 1.2f;1 y/ U1 Q+ t* i$ j2 z \
0 p2 O5 q+ d6 G: ~! T
pLight->Ambient.r *= 0.8f;
( C! L4 V9 ~- p* u" k pLight->Ambient.g *= 0.8f;+ F& u1 t( s$ ~6 ]6 [& t u
pLight->Ambient.b *= 0.8f;: x4 D3 T4 D) j) j& g; e
1 R$ E: E. g! B memcpy( &m_light, pLight, sizeof( m_light ) );5 m4 s8 Q- m3 j! {: _9 Q
7 ^" B' M8 L/ q/ p: z5 j2 @ D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);# k- B/ q% f4 {* C; i) L! J$ y& E
D3DXVec3Normalize(&(vecSun),&(vecSun));- F, _1 c3 }% {/ L
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); , {2 ~5 T2 P5 x- P$ u0 {* t
pLight->Appear( m_pd3dDevice, TRUE );
# n, v3 G6 n1 j0 y6 A, C 1 f. p. Y$ m/ @$ D, A9 L) ]2 a% J6 K" Z
DWORD dwR, dwG, dwB;; c) F% J+ d g* M7 W
dwR = (DWORD)( pLight->Ambient.r * 255 );
. p1 S. H; h% D) X dwG = (DWORD)( pLight->Ambient.g * 255 );
/ W# \" W `2 x dwB = (DWORD)( pLight->Ambient.b * 255 );
! R; a- u0 v; U dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
9 e+ X2 d+ F- H) n. z }
+ u9 T2 p& r: B9 Z% { }
% z6 G5 s9 v5 t) q0 X- ?. p$ K7 G }4 @2 k2 A- Y. i5 f2 C3 L0 M: r
else
* F. U8 W5 @1 i) I# s- g n: w- i#endif
; m9 K6 i1 ]7 U3 ]4 B( S B* {* u; O( y- @+ C6 q
if( m_bIsIndoor )" ]) H4 P/ J8 z' u* v$ m
{
0 _0 Y2 k, \0 }1 j) L: W A if( pLight ) x, y. m/ i- x1 |4 F0 O
{ $ o( Q% G8 ~) f' b
// à??μ oˉè* 1 g: u" P2 }% B- T/ e, y- x7 a) P
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;. v Y/ w- V3 D& T
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;2 }" |! O6 t" E1 d5 y( {
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
2 Z# k# f3 x' G" _( x
: |$ ^ L$ u; }$ ` // oˉè* ??à?
9 F2 T9 P2 @$ r4 M- Q" {' a pLight->Specular.r = 1.0f;# Y/ H2 Y5 R S X6 ^+ ^3 } l+ [
pLight->Specular.g = 1.0f;3 v+ H) p1 C# f
pLight->Specular.b = 1.0f;5 O3 M6 p! W/ p" [% H$ j. I
// àü?? oˉè*
: p1 M7 t% \* d3 @* \* d' m: g pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
) z0 ~5 M3 ~3 c pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;$ c$ Y; A. ?$ @6 ?4 X
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
" [; m- P1 D7 ]! F8 ~$ _% Z% g7 l0 R
0 `/ s. e' Y+ c! n1 \1 L# r$ g8 Z if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.# [( m! ?4 W7 m# F
{5 U0 l( o$ Z1 m- M- ?. f; \ p
pLight->Diffuse.r *= 0.6f;
/ g8 N) g+ [" f+ D. ~9 u; c( ? pLight->Diffuse.g *= 0.6f;
% o7 Q6 f6 A2 v" {* C pLight->Diffuse.b *= 0.6f;
8 ?8 i4 X# M# @$ I/ L. e+ M, n pLight->Ambient.r *= 0.7f;
5 I0 q" g7 @1 X6 f pLight->Ambient.g *= 0.7f;' ]: N) t: E% ]" C% Y9 b9 ]6 F8 b
pLight->Ambient.b *= 0.7f;+ M) `5 b* D4 Z( \4 ^
}( ?# O. f3 g5 K5 h: b; t0 H e, T
8 f( Y2 a% b# a# h' n8 g#if __VER >= 15 // __BS_CHANGING_ENVIR
5 F1 w, X* _& e* b k, [ if( g_pPlayer )0 K; C! e& A m2 ~
HookUpdateLight( pLight );4 [2 T( Z3 @" v* n) v$ Y
#endif
2 M) @6 p5 Y1 u- l1 [# N& D+ z memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );* J2 X( z0 a$ r' Q* m
1 U( x9 o9 h3 x5 ~" x8 ] pLight->Diffuse.r += 0.1f;6 V0 x: f" U8 F0 I7 b$ R
pLight->Diffuse.g += 0.1f;
( J$ ~6 U$ i. g0 U( \' W0 ` pLight->Diffuse.b += 0.1f;
5 c& K- c" l1 w' L8 N, K1 } // oˉè* ??à? 3 C* Q4 {5 m2 g7 J0 }
pLight->Specular.r = 2.0f;9 y) h, {- y" k* M0 T# [- j& Y
pLight->Specular.g = 2.0f;# Q8 t2 r/ m: r
pLight->Specular.b = 2.0f;
) @( ]+ E, J* l \+ L // á?oˉ & d3 N+ `! W7 G1 J& Q# Q& k; V$ N
pLight->Ambient.r *= 0.9f;* B& }- ~6 X: e; p- s: x8 J ?
pLight->Ambient.g *= 0.9f;! M0 z$ m! j @, p) K6 C+ D9 `
pLight->Ambient.b *= 0.9f;
% w5 ] V6 z6 ?; ]* T& i
# }5 Y, l- B6 }, [$ Z memcpy( &m_light, pLight, sizeof( m_light ) );- H2 p8 x; g- y% j! ^$ K
0 n4 ?- x x3 q! {% _7 }
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );% r; n, ^/ Z4 u
pLight->Appear( m_pd3dDevice, TRUE );) G: A" X" W& y
7 Q6 ?! s+ p |& n DWORD dwR, dwG, dwB;
4 b& i$ ^% \/ U9 j+ \3 o0 H dwR = (DWORD)( pLight->Ambient.r * 255 );7 B8 b. B, R) i# j( O! Q( h6 f
dwG = (DWORD)( pLight->Ambient.g * 255 );
1 g/ ?( ~1 o# a( { dwB = (DWORD)( pLight->Ambient.b * 255 );+ `8 u b9 I+ w
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );8 W I8 e u( o0 U0 |' M
}
2 }2 S6 `, E$ W& S+ p }8 U/ s6 t) B3 L# U0 c; m
else
0 W% ?$ D m1 f" h, z' L {
3 q& s4 }% d3 ]% i V) ~, \# } if( pLight )
* M5 v9 b8 p' B: r# e0 h9 G6 | {- ?6 Y, W9 i; Z/ ?( ^
- _* z+ S6 t+ e/ P+ K1 w. \7 I int nHour = 8, nMin = 0;
# E$ W4 p! u: T+ E+ S$ T #ifdef __CLIENT T- m5 Z' Z. A+ c5 L/ J- W+ e3 o
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
% k, `) r5 z0 b+ Q( n# R7 } nHour = g_GameTimer.m_nHour;
" A" S) n* P" \$ B! v9 j nMin = g_GameTimer.m_nMin ;
% ?+ ^4 Y& ?9 ^8 {6 w #else, ~) {# O8 W( p( ?
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.( \ G# P. E9 |4 Z& P; ]+ S/ L
if( m_nLightType == 1 )
) B& H7 Y c' E8 M4 m8 I* S nHour = m_nLightHour;
* ]& m4 }6 d" ?5 A6 u; d #endif0 `9 R! l$ Y" b6 u, s% v
nHour--;+ V; v# s+ } O- q ]+ i
if( nHour < 0 ) nHour = 0;
4 u* e$ Y$ v% r2 b/ q( W4 m if( nHour > 23 ) nHour = 23;
1 g) o* I: A* _8 Z3 X/ s$ K" t5 g# x% { S
//if( m_bFixedHour )& B; W8 [1 g& m6 E
// nHour = m_nFixedHour, nMin = 0;
; ^# D# e! c# f* M; x/ G LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];+ v- }. G; t% s% S6 l
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
$ b9 ]* i+ E4 Y2 Q- w
, {! z0 w8 K$ x& F //m_lightColor = lightColorPrv;
! Y: _# O& @0 t: p7 [+ w" ~/ M lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;0 J2 ?& A5 {2 a2 x1 b$ M; ]
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;" y9 h& d' a4 s) T( x
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;7 {( t' E" i1 l8 D
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
4 V# c9 Q" T1 D" B6 T. _. Q lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;9 D$ C+ a' y$ c
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;5 P8 }4 \& m" h, [# y
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)5 v% p R# C! o
I b* b5 }$ o! j // à??μ oˉè*
2 b# A/ o3 {1 A" @$ f& g pLight->Diffuse.r = lightColorPrv.r1;
$ `& N1 e% n) y5 A* A* c! U! w pLight->Diffuse.g = lightColorPrv.g1;
2 A" |: l( T1 f/ u! I pLight->Diffuse.b = lightColorPrv.b1;
2 i6 A( q6 ^6 { // oˉè* ??à? ' t* P: e$ e: G" k' q8 X
pLight->Specular.r = 1.0f;( Z7 d e' `8 H4 H* O
pLight->Specular.g = 1.0f;5 x' i& r: T1 L* l6 c$ ?
pLight->Specular.b = 1.0f;8 o: `" |; X5 |. J" |* o
// àü?? oˉè* ; u3 D1 H' r7 E
pLight->Ambient.r = lightColorPrv.r2;( K- H2 d9 M, C
pLight->Ambient.g = lightColorPrv.g2;
5 q- `( Z" ^0 f/ o/ [. P7 E pLight->Ambient.b = lightColorPrv.b2; E |- @! O. I/ C
3 r9 K. z, f) X! x" p* h
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
# S# A, E+ M% W U {4 l5 }4 ?/ K3 [* I, [
pLight->Diffuse.r *= 0.6f;( J5 T- L& s# C/ X8 l" z
pLight->Diffuse.g *= 0.6f;! y! P* T- x8 V! u ~
pLight->Diffuse.b *= 0.6f;& f7 G4 s8 e* d7 q6 Z
pLight->Ambient.r *= 0.7f;
: q( G0 I+ X8 a4 C pLight->Ambient.g *= 0.7f;
5 T4 r9 d9 e4 N( Z6 {3 j0 M" Y pLight->Ambient.b *= 0.7f;
5 \1 ^. G9 E! d- H# j }4 v" a% X& ?, W, t- f! \* f5 u! t
! a$ P# N# v1 @6 j( h3 D# @#if __VER >= 15 // __BS_CHANGING_ENVIR+ g6 ~' D- }$ m: G ^+ B ]7 ]
if( g_pPlayer )3 L. c0 a# L H6 D" U
HookUpdateLight( pLight ); ' A5 M% u2 [ i) }8 T3 ^7 F% o
#endif/ y# u* B6 c v! D( d
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );! F7 j* F1 @" D7 C- a! W7 o
- H/ H( ^) P& [6 Z! r6 H+ D
#ifdef __YENV5 n2 I/ G: ^2 L8 m, r
pLight->Diffuse.r *= 1.1f;9 e P& y& B% c n+ X
pLight->Diffuse.g *= 1.1f;6 Y% W3 k& r0 d( ^
pLight->Diffuse.b *= 1.1f;
, @, D7 N' C& J) r, |% W- ~ // oˉè* ??à?
' p$ \* ?0 c4 R0 l pLight->Specular.r = 2.0f;
6 F0 M& w: f+ O5 w2 P$ p1 r pLight->Specular.g = 2.0f;; f0 z \9 V* [/ X/ j! v5 h
pLight->Specular.b = 2.0f;% w* }0 P1 M! P2 S2 A
// á?oˉ 3 v, L1 y0 @& F
pLight->Ambient.r *= 1.0f;+ E$ ?1 A' i! ^' Y: I# R
pLight->Ambient.g *= 1.0f;
( n1 V# @, X. o pLight->Ambient.b *= 1.0f;! e2 a3 H/ A( h5 {# X; X7 d5 F( ]
#else //__YENV9 m1 T6 g; f- p0 j. l7 t
pLight->Diffuse.r *= 1.1f;; }6 |2 o- @% A. d9 n B% b0 b
pLight->Diffuse.g *= 1.1f;
& ~5 e$ n9 I4 D' G$ g- n pLight->Diffuse.b *= 1.1f;
+ G, l- W: X/ {) V: t- ^8 K D // oˉè* ??à?
9 X1 G7 F+ ^, T' i( M/ l pLight->Specular.r = 2.0f;0 m( Y% O9 o/ o `
pLight->Specular.g = 2.0f;
\. O2 O! B G) O8 W/ P+ Q5 ^: S0 c pLight->Specular.b = 2.0f;
# ?' w$ _% L! [6 z7 V( G* h // á?oˉ
; g/ b: n" l' |8 Q0 c) D pLight->Ambient.r *= 0.9f;
9 A: e7 ?# t) R- `1 h0 X0 L# f pLight->Ambient.g *= 0.9f;
( P* w' u! t# ^0 V+ ?2 v& z3 E& I pLight->Ambient.b *= 0.9f;# B% p& J/ s* P
#endif //__YENV & `/ P7 E, l1 A0 U l0 w
+ u& g+ O8 q# b memcpy( &m_light, pLight, sizeof( m_light ) );
6 L4 J+ n' a$ c! g9 c $ E% q5 z9 E; @5 T( i* g
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);% e/ N9 M" k+ e2 M" Q x" y1 J) B( h/ d
D3DXMATRIX matTemp;. M' ]' T# B# T9 w! }; L, o/ q
static const float CONS_VAL = 3.1415926f / 180.f;
0 F" x8 c4 y0 u) V4 ]8 h# x5 J0 u$ x. H* b' Z3 Z
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
. ]( v' U1 L; u0 m D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);6 z0 g( c" d- @9 {0 A( \: a
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
: W7 g# s: U U) o pLight->Appear( m_pd3dDevice, TRUE ); ^+ l# X' r3 w
4 R1 O. ^/ U8 w, f* G3 c
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
( b, b! G1 m7 L t3 x7 {9 o! ? // D3DXVec3Normalize(&(vecSun),&(vecSun));
& `; h/ l# P9 X // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
7 H2 X& H& s3 F! n+ G1 K2 ^" C7 |) b0 a. k0 O
DWORD dwR, dwG, dwB;
8 l" c% W! q4 g3 x' a" ~" o dwR = (DWORD)( pLight->Ambient.r * 255 );
% m) W8 i" n& G6 G) Z7 A/ a6 { dwG = (DWORD)( pLight->Ambient.g * 255 );
! U/ X# w& Q2 ?3 M- P# L dwB = (DWORD)( pLight->Ambient.b * 255 );; n- @' U. [" x5 _! B
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); + ^7 ?, Y3 H9 c* E6 X6 y8 q8 J- l
}% u0 s2 ]2 v* x5 M% m
}
9 K9 g$ g& i9 Y) A8 q
* h6 B; F) s( l' j* f @ m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
2 Z' ]7 x5 I* v/ q! l- A 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) );
/ R* c/ R* S- y1 k9 \ p ::SetLight( bLight );
* j8 \* n1 o( w7 C @$ Z
0 N5 i j4 ~1 l' ^; P // ±ao? ?D?í???ó á¤à? * Y7 k% |1 N8 `) e
m_pd3dDevice->SetMaterial( &m_baseMaterial );. R- g$ a/ _# A8 j
" F+ T4 u/ K* X, }* q1 ]4 y- S& t
#endif // not WORLDSERVER
. U+ F' l' ^, U6 \7 R1 o0 b( @}
0 z& U" k! G: ~并更换7 r4 [2 U4 e1 I4 {$ V2 Y5 S" f
Code:4 m: w; [# h" c
__FLYFF_INITPAGE_EXT
2 h. n0 }. D1 j5 V7 v. m定义+ d2 V+ B1 s; W8 X' b/ H( `$ E
& H1 {0 m& j" G# y
a% x, s0 m! h( b$ ~3 @
8 b% f$ G; Z! a1 ?# {; }* X& J8 r1 X
/ a; C( ]2 @# S+ I8 {: m/ M4 L, s/ y
现在终于删除我的狗屁加速...
1 \2 C3 L- I- v3 O' e" Z- R7 t% k' x0 Y& y8 a3 W
% a. r4 x- o" Y& \ L+ q- m/ w3 Z, J3 Z+ ?6 ?
|
|