|
|
食品车:( c7 d8 \2 t+ c
尾翼:
" U* a+ b* v$ P. u
* `! m, S# p4 v" I9 x; {" d代码:
9 |" h( P U4 n! o3 _CWndAutoFood::CWndAutoFood()9 L# N, ?3 W, C* W% `
{0 ]( v8 m* G8 n0 F
m_pItemElem = NULL;/ L* p4 t+ b5 I7 x% v7 Y) X1 q
m_pTexture = NULL;
: F" D3 C+ T7 u% E8 x bStart = FALSE;
% S6 n- [( P% s6 ?. {}
& ?7 T% D3 R" G+ r. w, h/ O0 g% a9 g. w
CWndAutoFood::~CWndAutoFood()
' R; Y* h8 S2 {4 W{
9 F0 j5 U5 j$ U- n% w; ^9 C8 J8 w AfxMessageBox( "AutoFood ist gestorben " );. S ^& H9 S$ d" I2 y3 Z
}
) w/ o0 ]2 C& M1 X E7 c) H- ~BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )9 Q( h( a% ?2 b' y$ L: T$ S
{
, Q$ k. S# `$ a# w' _ return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );% R4 @6 J# o2 x4 y4 C" D% I1 q/ y& o
}
* R6 D: g" M6 C' v2 E* j n$ d0 m* `
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )- G. `2 W p& M7 j6 u$ g. K
{- e9 m' Z8 q* y: Z( {0 @
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
, A1 W& q! `% G% Q S% Y CRect rect = pWndCtrl->rect;9 @ F, ^' Q' D2 @
if( rect && rect.PtInRect( point ) )+ t+ g1 a" s& j5 j9 m1 |6 W
{
# Q% A0 Y; d" z- j p6 {6 W- X CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
+ \% f" J' S+ b* M' `) a: Z2 _! J# y if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )# x# w4 @9 m0 T
{" ^" d( ]: I8 F
if( m_pItemElem )
! d/ ]% H) V" g L- c0 c' K {) f# I4 j, N# b5 c
m_pItemElem = NULL;
% B; j- B0 {0 P M2 Y/ f) ?' m0 f }
4 U& w1 @8 N% a* d( u# B2 N m_pItemElem = pItemElem;
+ E& G% K! G5 o+ i5 s: y" Q m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );& Z) J) I q; G4 s2 b
}else{
" g& K8 K+ A. ^ H5 S8 C+ a6 M' V SetForbid( TRUE );, p, p8 }9 e: I. k( E" E
}: L! d) J# p L* ]; w
}else{3 ^' z( p7 ]) }8 J
SetForbid( TRUE );
+ Z W6 R! ^+ W: D/ w }
0 k; ]: T( J& u. s {1 H$ f1 V return TRUE;4 J% `2 X" C7 F5 o( i; E
}) j `+ o" A# R5 r3 X' z
' H1 q& h4 L* q' NBOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
5 y0 ?& g" r, n) u4 U p7 r9 o{) B2 M7 ?- \1 Y; H
switch( nID ), E$ @) H# J( B: s A! ?
{: p3 K0 h c8 Z
case WIDC_BUTTON3:
* D% w+ i! M* B0 \! p* n {' X6 X. e( f& F
bStart = TRUE;* A, z, S0 Y8 }7 z' U7 ^
break;
; n% Q* P2 X6 q }$ e# }0 n5 {; l. g* N7 }1 |5 m
case WIDC_BUTTON4:
: t2 y! A; K8 ^; T# k8 W {, I1 n: f y! n6 J" w
bStart = FALSE;
4 A: ?' G* y- M6 [/ l break;
! M$ S/ l) {" t }2 m4 Q" a6 P% A! j9 l( k" ^+ }* ]
}
$ f: q2 R. p+ m4 G' X return CWndNeuz::OnChildNotify( message, nID, pLResult );0 J" q# B+ C2 @0 X7 {1 `$ f
}
( i3 L2 } |( L& @8 z7 e# bvoid CWndAutoFood::OnDraw( C2DRender* p2DRender )
7 F6 q+ c, o% B$ V{
( g9 D4 Z% s. I$ r; p, y X CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
) ^ Q" S. G- Q8 v1 W9 |+ ?. d if( bStart || !m_pItemElem )! L; `; D5 {0 y1 J
{0 S- o9 _+ |+ ?& ?' {3 s; ^
pBtn->EnableWindow( FALSE );
8 J% l: D1 ~( c4 o0 q! G' i }else
$ _% a! {" F) D) ?6 @, r5 w pBtn->EnableWindow( TRUE );! w5 A; n$ ^& ] c3 d4 V5 s
if( m_pTexture )- m6 H4 C6 U3 [9 u3 E# E5 {2 B/ x
{ {* o+ `8 z$ |+ X& j
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
: N ]; t# S+ ~7 H2 y7 j if( wndCtrl && wndCtrl->rect )" e# p2 c$ f M
{
4 o( E& N1 {( y: f% p6 C m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );6 q$ i$ l3 c1 z; W0 M. `: c8 o: x
}
9 |% {: F4 q' p: ]3 ]$ R }# Z3 @* r" V; g, H x S* K; e- m
}
7 E* k0 ~0 V+ ]) X! V, [* F2 J$ E3 \2 S
BOOL CWndAutoFood: rocess()* B: \! M" E7 b1 H% J
{0 j6 e. h% g, ^) J( ~! [$ i
if( bStart )* ~! `9 w9 C, O$ V; c( b3 V6 n
{
& K0 s1 L! Y! J+ U" d7 e( u6 V if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
# |# x0 G, [# O" l. `9 ~- G {5 T# e' J5 }1 x3 v' s# u% }7 S
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
' N' J: \9 \0 m& e) n3 ^9 e/ K g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );# E- `' b# V) S& o& |
}else{
" {/ U( R: Z/ k bStart = FALSE;
4 R r! ?) q* p m_pItemElem = NULL;/ i* Q6 o) Y5 r. n9 K1 e
}, U$ p9 R% k, Z# q7 [0 ]
}
+ C* W6 Q, Z( s) M6 }7 Y; D return TRUE;
' x) o g/ g4 D" A( {* W7 u}
( m1 D) N& c3 h" l ~/ Q& K
4 J* ?+ N) Q7 i* a5 w A6 _登录视频废话:
( \' O" H! Z( i) L尾翼:- a4 j6 \7 E$ j. J1 T
" ^+ P' a6 B" ]( }* S0 `# ]" G代码:& {& F" Z& w r
5 Q5 ?' R7 }7 X" W9 @1 Y
void CWorld::SetLight( BOOL bLight )
, F" }) W2 o4 l5 M! y' kdurch
$ }8 m, b; q; N3 _. v1 }% }Code:( A0 ~ i! [6 R2 Q- V! Z% P
void CWorld::SetLight( BOOL bLight )
3 V/ ~1 r8 U% o) Z& l) S{; z3 F) k0 R, S0 ?; b
//ACE("SetLight %d \n", bLight);
0 Q8 Q/ j8 T( @3 N
4 C, N2 `6 q5 e6 q0 Q# T$ s#ifndef __WORLDSERVER + y1 R D2 n8 h; _
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);. u( L0 N. ~) W/ L4 @, \
CLight* pLight = NULL;
2 ], @* c4 n6 Q' M3 G R+ [* w% L$ R& I' l+ S+ F$ n. h: f8 J# F9 N. k8 z
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
; G" B1 `# l1 G1 a$ l# z) h- d) S1 [5 h$ E5 @; F; C0 g
pLight = GetLight( "direction" );; U3 k$ h; m8 u: Z
& e, ^' |: e- K9 q
#if __VER >= 15 // __BS_CHANGING_ENVIR3 g" M3 ]' y3 A1 `+ X J* O
if( g_pPlayer ){2 ?$ B" U$ m/ t& ^) T
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );8 n4 I5 T* T3 n
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!' M4 K! ]2 F: G3 G! b; x9 K
{7 Y( P& C8 ^0 d& I- W
if( pLight )8 i; e* Y2 N& |9 _, l+ k9 P
{4 T; m$ U& r6 n3 }2 X+ A
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
' Z6 z2 I. Z0 W: X4 E pLight->Ambient.g = pInfo->_fAmbient[ 1 ];% K! M% G2 a) X. z$ A( @
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
+ y2 Q0 D7 b# E, J/ ^ V/ O$ Y7 t$ M; {+ B
pLight->Specular.r = 2.0f;$ ?) ^$ Q; Y" n+ g: F
pLight->Specular.g = 2.0f;
/ _1 s/ Z6 Y" _( A3 m6 Z$ Z pLight->Specular.b = 2.0f;
- k. E8 s5 Q5 S( P& L
$ ]& N( Q7 z( y6 A1 @, Q8 H pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];1 N2 X) P2 t1 Q6 K+ d
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
) u1 v/ C# F2 J9 e( I4 o$ J" \ pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
. `. @. ]# x6 ~+ v. {* ^
* M# z. r, k0 V1 B$ ~# O HookUpdateLight( pLight );
" R& U8 M# ^6 K* `# M' U) X+ O9 v! y. E6 u
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );1 i, G( [: T/ c% w$ s
$ `/ [: w+ Q) o' w; M8 X& [
pLight->Diffuse.r *= 1.2f;7 a& E3 j D( e; J
pLight->Diffuse.g *= 1.2f;
1 f3 I- q2 i, W% R/ r) w/ {9 y pLight->Diffuse.b *= 1.2f;
8 W" N2 Q; j2 c
7 u! ~5 t# H& | pLight->Ambient.r *= 0.8f;; O9 R0 s' N, {% _4 m2 l, ?
pLight->Ambient.g *= 0.8f;
6 W$ | z+ _/ X8 C. s pLight->Ambient.b *= 0.8f;
% y1 J9 x0 A) I! g
" ~9 l s2 v0 V memcpy( &m_light, pLight, sizeof( m_light ) );) ]. b0 ?. V3 t" W
/ N7 i0 e! H1 w& m
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
/ E! _ d6 Z; I% X& V7 j1 l- Q2 I$ V D3DXVec3Normalize(&(vecSun),&(vecSun));0 A) c9 `' V4 z% y1 f
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); + O) _5 X4 `) M
pLight->Appear( m_pd3dDevice, TRUE );
9 l1 H$ D5 y5 H
6 {3 o2 h4 E$ |% f# @% Y6 I4 X DWORD dwR, dwG, dwB;
6 M. |& t) F6 Y- ^; N dwR = (DWORD)( pLight->Ambient.r * 255 );
% G; N P: k/ o' K dwG = (DWORD)( pLight->Ambient.g * 255 );
& f: P' ] J. x5 z, K+ j dwB = (DWORD)( pLight->Ambient.b * 255 );1 t% ~" \' [8 i; K
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
0 j, o( Q6 t# S. M# f }
$ ?6 }0 m6 b2 {( x }6 ~2 \- W' E& L
}
0 w {" X+ I9 N else
6 p3 U8 |1 w6 l1 ^2 C% h#endif
* u' B* w q i" w3 \$ n- p
5 e* d: ^6 Y4 v2 ^3 T# i, r if( m_bIsIndoor ). n6 y: A* }7 o. N8 }8 W6 G+ i2 V
{
7 ~, v" c! a& u# ]& @ if( pLight )
4 e0 o* m" S3 r0 X5 I {
! ^) f1 M2 \; C/ ^! Z$ ]1 l+ _ // à??μ oˉè*
& t# K V7 \% y pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;) m% g# t X+ O& K
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
" \# u" @ {& {7 O8 ] pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;% j; \7 K3 A9 k" Y. ~
- q, I. U+ J4 j3 L9 D, w+ @: K5 z$ Y
// oˉè* ??à?
- x- G8 o1 Y x7 T pLight->Specular.r = 1.0f;3 n1 B0 m: L. n# W; [
pLight->Specular.g = 1.0f;( ]7 s1 V9 h+ [ i, J3 Y
pLight->Specular.b = 1.0f;9 P5 j6 ]0 {2 G6 f3 h4 \+ z1 M \
// àü?? oˉè*
4 f& R2 Q/ N1 r' Q pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;8 }) q7 }& @/ _1 K9 a* P6 m
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
6 Q; f' T, i8 F" `! Z& f5 ] pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
: g. x' J( O& T3 j/ N ^+ r9 Q$ G2 E
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
- Z3 l6 b# x0 H7 B {
5 ?( a P7 b8 f- g+ r. U d+ i7 ` pLight->Diffuse.r *= 0.6f;
5 G1 g) z# F+ O. @ pLight->Diffuse.g *= 0.6f;
; t5 ?3 W! G1 Y& ` pLight->Diffuse.b *= 0.6f;
& S" I0 I; G; y L+ A pLight->Ambient.r *= 0.7f;
' k4 a$ t' S, D0 n! {/ Z7 K pLight->Ambient.g *= 0.7f;
! b, d) t) W1 c" C! ]* ]$ y pLight->Ambient.b *= 0.7f;
* m* V* B e6 a! v }1 j4 C, n- X5 G# L; I- H
/ @7 F! U Y: [/ ~( F! n& j#if __VER >= 15 // __BS_CHANGING_ENVIR- g9 M( \% X$ g G1 c0 ~" ]
if( g_pPlayer ) n: _+ |% V$ K& Y3 h1 o
HookUpdateLight( pLight );
! T8 H5 z+ ~6 Z3 z' Z" z( Q#endif
. l% p8 p; i7 u' J/ D memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );- i$ x8 A5 Z* l5 ]/ e
9 e! [$ G8 A. ?0 h pLight->Diffuse.r += 0.1f;
& h0 P# X5 |- R$ { pLight->Diffuse.g += 0.1f;
T/ t6 E1 E. M$ W1 f8 W+ P pLight->Diffuse.b += 0.1f;, `- h! ?; [1 i2 h) H. h
// oˉè* ??à?
' \' X0 w2 S' G2 ]# }) J3 q pLight->Specular.r = 2.0f;- {1 H- E5 h8 l6 b9 L" [* R
pLight->Specular.g = 2.0f;
7 Z7 ^4 g' r1 j* A- C pLight->Specular.b = 2.0f;
5 K2 }: c' v5 V5 e9 O // á?oˉ : k% w. i# W; V1 a" W7 x0 \1 O& Y0 z
pLight->Ambient.r *= 0.9f;3 N; w |$ f1 t; ~
pLight->Ambient.g *= 0.9f;. t6 p* Y5 a' Z6 ~% O
pLight->Ambient.b *= 0.9f;
% V1 v3 S, S6 H1 F2 }6 s4 u: K$ i* S* k0 {; F! L s- V9 C
memcpy( &m_light, pLight, sizeof( m_light ) );
) ], Z* [/ E4 N . p2 m' Y2 {0 M. s6 m$ p
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
/ M6 ?& h6 S4 j# u. O! i" K7 p pLight->Appear( m_pd3dDevice, TRUE );+ [) w3 I3 t. _9 o! E1 N
, J3 W& w8 k2 d' Z/ f7 @
DWORD dwR, dwG, dwB;
. w& d I; \& X6 S dwR = (DWORD)( pLight->Ambient.r * 255 );+ R8 v0 Z& H0 s
dwG = (DWORD)( pLight->Ambient.g * 255 );
g' f" t( ]! ~+ Q2 x: I' f dwB = (DWORD)( pLight->Ambient.b * 255 );9 C% F/ j: D7 Q& ^; u0 i# A% J
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );+ Z! ]6 a% T5 ^; W4 K, {3 u+ `
}0 y+ K0 f1 |1 ~( Z" m1 q
}( `' F. f0 h; u: s8 v
else
6 K$ {: C9 F ~. U* w" x {
: G8 K/ f% M" f ]& x if( pLight )4 N( c; ?4 D) X; [% u, b+ l$ K
{- E; t4 v. A2 ^
3 t. L0 t2 l. J0 Q, F% i- e
int nHour = 8, nMin = 0;
1 L5 } j8 z" W2 h #ifdef __CLIENT
) a, s( m$ E; T% u // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
5 C4 A) Q8 p# \" W) B/ r1 a# H nHour = g_GameTimer.m_nHour;
/ Q" ~: r; B6 u* c nMin = g_GameTimer.m_nMin ;+ i. e% r: `0 g7 e7 \! ^6 }2 l, G% W5 R+ |
#else
! q6 V5 c9 y& F0 g: G1 D# Z, |; P // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.7 F" S. ]/ G; E6 c1 ^
if( m_nLightType == 1 )5 N, S. J' ~0 L0 o% \. e
nHour = m_nLightHour;
9 V |9 ]0 ^# s #endif
6 g* _, A( ~1 J) ], O, } nHour--;
5 b Y$ k' U2 N3 A& n: W if( nHour < 0 ) nHour = 0;- V7 | i, b8 F0 @2 K2 P" }. c
if( nHour > 23 ) nHour = 23;0 m) h* }8 \+ l" @9 {$ e% O% v$ o/ J
2 J) ~+ P5 o( F$ o8 [ //if( m_bFixedHour )
/ ^9 c( a- b$ e; B2 ? // nHour = m_nFixedHour, nMin = 0;
" T+ e S* I0 g% M) R( |1 u LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];, d7 p- R7 G' j5 k, e' ~. D. j
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
0 w0 ^& L' M4 E9 b- r$ {/ ^8 i1 l3 v
//m_lightColor = lightColorPrv;1 W: q3 H/ Y* l' p5 N- x
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;, P* l; p8 G/ N5 e
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;. `5 ?, t N7 ^$ z8 E
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;6 i: B8 ]& a1 ? z2 e3 Z+ `( P2 h
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;! w4 x1 B% j h$ h9 R9 A. ]1 ?
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
y# m- T: F9 }. p2 _ lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;4 `! d6 t! l; C/ w" N
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
% g) h" n; z$ O: B1 D5 T I* F) b
; B) c* T- o. X# J# [! p // à??μ oˉè*
1 n! [: U4 u0 H4 i pLight->Diffuse.r = lightColorPrv.r1;
% V- H; a3 z3 X- A pLight->Diffuse.g = lightColorPrv.g1;
+ ]4 g! x$ v0 e) x* n) q7 u9 Q pLight->Diffuse.b = lightColorPrv.b1;6 T8 F Z3 z& h& T
// oˉè* ??à? 8 y( Z! j3 c4 t9 `3 e4 J/ J/ Q
pLight->Specular.r = 1.0f;% V9 W( X2 G6 n) s
pLight->Specular.g = 1.0f;& D/ v* }4 i: E4 W
pLight->Specular.b = 1.0f;
4 L5 n8 m5 J3 P3 r // àü?? oˉè*
2 Q- m" K: C) o- P- U) @3 w$ U% f pLight->Ambient.r = lightColorPrv.r2;
7 e" l% g+ ?5 e pLight->Ambient.g = lightColorPrv.g2;4 g0 T$ [5 J+ B2 s& n
pLight->Ambient.b = lightColorPrv.b2;3 x/ R1 t. C. ~( ^/ h/ L* Y
2 u. A9 H S( K3 a q if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.9 q5 M2 Z, y. o" g) C" ?
{% P5 R# u' p8 V3 G/ a6 ` B
pLight->Diffuse.r *= 0.6f;3 M- Z: I: k+ ^# r
pLight->Diffuse.g *= 0.6f;
" F+ l9 F3 q, E& U, ]; q+ l) ^ pLight->Diffuse.b *= 0.6f;/ a! U& s, q0 E+ M# J
pLight->Ambient.r *= 0.7f;4 r& Q3 s- n2 C: z7 g' E; b
pLight->Ambient.g *= 0.7f;
3 M6 p5 x) {( ^4 z, Q$ y |# P pLight->Ambient.b *= 0.7f;
1 R& v2 T. j( P& @6 T5 y+ n* n }% H8 V# H2 Q( Y; Z
u! R& ^. a$ j% g) u7 o#if __VER >= 15 // __BS_CHANGING_ENVIR
# D. ^6 x; _4 F, q2 U8 M' b if( g_pPlayer )1 e5 a7 m+ s' ?0 l ^- U+ N
HookUpdateLight( pLight );
$ u* k# b# L/ o, s1 i/ w#endif
. L$ [' r' H! E6 \: @- e* z memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );0 H- m5 A: o; }7 I* u
/ x# y5 j$ c/ V( V' M
#ifdef __YENV
2 _' u2 ?% J# i" j' A. R pLight->Diffuse.r *= 1.1f;" V M O3 p/ \4 ~$ ~' `
pLight->Diffuse.g *= 1.1f;/ `- W9 X& t' ^3 K6 G5 S
pLight->Diffuse.b *= 1.1f;( d) U% y. f9 D7 V7 I
// oˉè* ??à?
# Q' @7 _2 w4 Y1 ^! v pLight->Specular.r = 2.0f;$ U8 G' e0 A+ @1 C3 s0 v
pLight->Specular.g = 2.0f;& O! S) |& ]+ z! g5 S6 T, ?
pLight->Specular.b = 2.0f;! j/ ? ?2 R C3 c6 R5 O* p
// á?oˉ
" t& g+ E+ p0 M- l pLight->Ambient.r *= 1.0f;+ y1 x2 r0 ?1 f' b4 R, q1 m. O- V
pLight->Ambient.g *= 1.0f;9 G/ y) P* g& q/ E4 ]
pLight->Ambient.b *= 1.0f;5 _/ x% Z. a1 h! r
#else //__YENV
6 z- n4 K, E; i+ O0 d; L pLight->Diffuse.r *= 1.1f;
/ p( l5 W6 U7 V9 a pLight->Diffuse.g *= 1.1f;2 P4 h5 s+ ~, c7 @# z. z) R
pLight->Diffuse.b *= 1.1f; t+ ], a W$ _6 W( O7 r; I/ E
// oˉè* ??à? ! X8 Z0 ?: Y7 P1 ?
pLight->Specular.r = 2.0f;
! W3 h) X$ d/ K pLight->Specular.g = 2.0f;/ U# F$ r! Y! [8 p
pLight->Specular.b = 2.0f;
8 D, d- L6 Y# H5 T, j# t // á?oˉ
% Y) z, `9 J% N! f# _) o0 V pLight->Ambient.r *= 0.9f;0 ^0 q7 ~7 X9 K/ N p. k, J
pLight->Ambient.g *= 0.9f;
5 w* j0 }- E; n1 b/ `7 } pLight->Ambient.b *= 0.9f;; V1 @) n: }( S6 i9 r0 Y! e
#endif //__YENV
0 r) A6 e' ]5 C: [ - [: h6 |% A" Z
memcpy( &m_light, pLight, sizeof( m_light ) );. L# f$ o$ G t. r
' z6 x4 d( M2 H+ A% n4 k5 }
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);3 K% x8 w5 f- T% w- } `1 L4 J
D3DXMATRIX matTemp;4 J. Y% N: c' q) ^$ r
static const float CONS_VAL = 3.1415926f / 180.f;
: [1 Q# a; R5 t+ h# l" K' ]* C
7 i. v" `( X) | D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);, w% f+ H/ n# P) R
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
4 I+ c" D) V) k. F5 a1 k pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
* p# m* v. R4 u5 K$ F5 F: L pLight->Appear( m_pd3dDevice, TRUE );
) B! g E* U D4 _# S+ Z& v$ ]1 f, k3 T3 c* d% |8 n
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
g3 m' E5 q# L/ }$ C/ G; N // D3DXVec3Normalize(&(vecSun),&(vecSun));6 o5 B1 t O4 J0 Q' I O
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
3 h& r8 O# ], k( }+ v$ \( |4 F& u z* N3 t6 y; d4 I/ _! A
DWORD dwR, dwG, dwB;5 {6 D% A: H" N0 [
dwR = (DWORD)( pLight->Ambient.r * 255 );5 C; Z# ~4 O! B# n
dwG = (DWORD)( pLight->Ambient.g * 255 );- H' E: x0 d- E3 B
dwB = (DWORD)( pLight->Ambient.b * 255 );3 G: s' P% e) @) m: e3 d
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB ); 8 F" ~9 j* ?6 s$ _/ |
}3 N) G. b" ] N0 [3 X$ `8 n
}0 }, m5 o2 i* }$ w3 I4 q: V
( ]( A7 y. _- J- B h
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
$ M; [9 m, v5 }- T/ M7 h2 S 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) );
- o6 X6 F0 f1 _8 ]" d ::SetLight( bLight );
6 D4 G/ |4 O) D$ r6 x, v2 q
) j$ L. C% f1 Q3 l5 n5 \ // ±ao? ?D?í???ó á¤à? + @2 u% F% [3 y a' J
m_pd3dDevice->SetMaterial( &m_baseMaterial );
$ ?) c$ Y1 v; O1 a; T % ]5 [5 S X: g0 t" ]1 N) @* x
#endif // not WORLDSERVER
+ t( V' d% p5 a3 e& N' {2 n+ z% Z}" Q& C: m# k: P. B# A1 G1 f
并更换
8 D" ?& R1 U5 x1 l$ g* {; eCode:
( C2 g; m) O. ], F }6 ^__FLYFF_INITPAGE_EXT
3 U, |4 D+ ?* ^ S% }& ]定义: Z z- M+ ~% d& e; e# ?
/ L9 M+ @( d* S! E1 i
7 S- i+ x- g& ^* `% @5 D8 q( k2 ]9 ]' C% h
$ r2 y' ]2 K5 R# S现在终于删除我的狗屁加速...
4 f6 a0 d7 T" L' ?4 M* C. T5 u+ e* I# G, B6 }2 k+ I1 K5 T
" E7 x( I; H+ k7 c" d+ v
# A0 E/ O3 w) M& f' V# [; W
|
|