|
|
食品车:: r, h+ E- P$ i$ J% A* q' ^% ?
尾翼:
2 C g0 i0 ^0 ^0 `( b$ n
. m4 @4 Z) n4 |3 R c. s$ s) C: r代码:
( ~! O+ Q9 g- m, y) Q2 \' XCWndAutoFood::CWndAutoFood()
- ~, m* d$ W/ u( [9 z{
# i' I7 o% s/ r( c9 U m_pItemElem = NULL;
) ~7 M# o6 G6 H3 B: ~ m_pTexture = NULL;. s) d I, b2 e! u
bStart = FALSE;
+ y' G. [& T8 b c0 R$ H* P5 p+ B% G}
3 Y; ~% M6 ^7 W+ h) F4 W+ [1 d
CWndAutoFood::~CWndAutoFood()
" U: d# K! W! k4 S- f1 k( t1 y{
, ]+ j. S- U1 r ? k [5 H AfxMessageBox( "AutoFood ist gestorben " );
$ v c) p. T6 h- P2 K" q+ j9 t- _+ [}. F; y. u3 B( s f) r3 G8 i2 f
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
* S7 y5 r8 _6 ?) z2 l{6 h2 j) T! R, {" ?
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
4 Z8 r" D( }+ B& @6 p}# C8 v( J! w6 s! {: N( R
8 [7 [2 @: t7 k* L& c O1 ]/ YBOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )% t/ B* e# R9 [' j* u7 }: {
{" c. N% ]/ N' [0 q2 o+ L" @, `) L
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
/ m9 `$ E8 x" M) K CRect rect = pWndCtrl->rect;% L' j: w2 Q/ m" |2 N
if( rect && rect.PtInRect( point ) )
1 E0 Z# N; s5 { H, y1 n {" K j: z1 j/ m# z" @
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
7 D( U4 K7 R, i7 I if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD ). T5 f& @9 d7 m
{
, G; ]8 U/ o, f8 q: i8 f4 h2 ^6 U9 c if( m_pItemElem )
4 Y3 R5 k% Q6 F {& ^' K5 A/ x+ Q: K
m_pItemElem = NULL;* ^) X0 n! [- w C: ~
}) F0 x$ w5 L6 I3 G
m_pItemElem = pItemElem;1 L- `* O. P7 r1 a# G
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );2 x3 s1 G& I4 G& |/ Z, j
}else{! l# a6 L! M0 P/ o! v w, h) ]6 _
SetForbid( TRUE );) H3 {5 Y) I" @
}
- k& i" j6 {# q; X }else{
3 l' S4 l4 T- T% E SetForbid( TRUE );& c }: E) |& t1 h& k! i
}
' _4 r' X) b6 W1 s* M return TRUE;! x3 T4 i( k! z+ C: w! T
}
3 n/ U2 h Y, d7 [$ k5 F& L, Z
2 q$ j/ `. V0 w8 h# ]BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )/ ^9 K, P: \8 o1 p- d2 h: n
{5 v8 C: E! Y* [
switch( nID )
1 t. }6 \9 o; ?( j2 p6 d { L# y) C0 r- y$ j
case WIDC_BUTTON3:# `6 P: z/ B( p# ~8 J0 b/ o( a( G
{
3 j+ O& k1 q5 n. ]9 |* N bStart = TRUE;
0 u4 y. N7 V7 d, v% v break;5 Q, `/ t! d' G8 L
}
) \1 E; U* |4 K' a+ {# B& P case WIDC_BUTTON4:2 K+ y+ f9 B9 K
{
& U0 a. \( G, j+ {$ q7 | bStart = FALSE;% U) |' n2 A2 S8 r; i( u. j! f
break;/ W4 t6 f: d/ L$ B) V
}
' O# ], D) X; F3 _. |8 `: j }. [! l! L5 A, s9 ^
return CWndNeuz::OnChildNotify( message, nID, pLResult );
6 n5 R% n' T8 S+ d} 1 c6 \ V& i9 k# m) e6 R* c
void CWndAutoFood::OnDraw( C2DRender* p2DRender )7 T% P; V: C! C% o- y- M
{
5 _% ^+ ~+ N# b: o CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );" ^( G* }0 D. c/ p
if( bStart || !m_pItemElem )* X- X4 x& K4 E2 [1 s; g. E% [2 G
{; f' C7 X! a1 z9 A/ X) O% m$ [4 k
pBtn->EnableWindow( FALSE );
) h) J. e" l& S3 r, \8 |4 P9 } }else
1 v& m3 d T+ l. l- d5 ? pBtn->EnableWindow( TRUE );
' Z! v" J3 O+ o! N4 _" ~7 b3 K if( m_pTexture )
9 p0 ], w# v) ?* s9 [6 J {4 O {1 Y( {+ u. j! B# |
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );+ h5 m: t+ l% b! O2 Q7 p Y, h
if( wndCtrl && wndCtrl->rect )
' B# C! n# b4 H, P2 ~6 b {2 b D! X; c' Z# H/ u
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
2 ?% i' y) G! [ }
/ I _* Z3 V0 r4 q }
, T. Z1 p {! d5 k T}2 q) w/ ~ T: U' w0 u/ R" s
( n M) j/ g2 ^& S8 r" eBOOL CWndAutoFood: rocess()# x/ ^" o* v2 a+ R" { I" }5 N
{8 i }# m% U3 y0 K7 l
if( bStart )
( b; a9 y8 @+ e {. N/ n. f5 X0 x; A+ \
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
& Q" [, Z5 ]! x: B+ C {
. C. I( ^# ~& y if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
' t8 r n d) S- ^& {, U2 U g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
% g+ F8 s* b6 s& b# z }else{- E' b" q7 i3 U! Q! ]( S2 Q
bStart = FALSE;
) R1 y* l- u$ Q, p m_pItemElem = NULL;+ P1 w1 Z" @4 _; S5 ^ t' u, o4 M
}+ h( I6 G, ?. B/ r* I! M2 L e# x
}
g: h: ^: f9 T. X) H return TRUE;/ {1 D* }( W% b9 |1 |, G2 S! f5 p( s
}
* u. t- Z' K- C& f0 {$ A ?, p2 u {" Z5 o# @1 E6 E
登录视频废话:
& ~3 s' ~. r7 {- y y尾翼:% m8 T! e# _( ?" ^) N
, b# L* ~' v. S3 m" Y3 B$ Q7 x
代码:4 o: t6 m4 C+ C" E& C) R
9 t1 n4 r2 ~, c, d" o
void CWorld::SetLight( BOOL bLight )/ r# X8 q# {( v
durch, C% o# s' H9 p1 P; B/ {, [ F
Code:
. V, k. F. _- h3 [( K! x, Zvoid CWorld::SetLight( BOOL bLight )5 y! y6 }6 S- r: N" M# E6 A# P
{! G( E: N! L9 B) J
//ACE("SetLight %d \n", bLight);
, ~2 T: E$ [ B0 D, b0 w
1 f& c {) P$ J0 D#ifndef __WORLDSERVER
6 a9 y9 {2 R. V$ E7 y1 l) B DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
; H+ g T) Y9 r0 @ o CLight* pLight = NULL;( x! F/ Z* m0 z, f% s
k, Z8 g' w9 P) P" i) g D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );, c: u' D& n1 ?: ]: t5 A) s
. s0 k0 T" _! ~2 Z8 M! E) Q pLight = GetLight( "direction" );, U5 U4 C1 d# U, H( d1 y0 t# ~% H
: G7 }5 ?) \) j& Q5 ?#if __VER >= 15 // __BS_CHANGING_ENVIR7 Z0 W/ j' I1 r% |) B9 M
if( g_pPlayer ){
: @8 b4 x% {" O& T, g ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );/ j, Q+ X& ^" w* Q* Q8 O/ v
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
% F# e+ j6 C& |" K. t7 J {
# {, M- x# \' A0 S! E6 D% _ if( pLight )& |) X* I" ?6 a8 O
{
( ^0 R% r0 \1 r3 Q8 c4 t v pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
9 s9 J7 ], C' ~; s pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
0 Q: m: G' ~+ M+ [6 L8 P pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
# U8 `" d4 b) W5 z% u! q7 M
7 [# p( @6 r$ G+ e& z! W" v pLight->Specular.r = 2.0f; g R& e# `- Z R
pLight->Specular.g = 2.0f;
5 w$ F( E( a+ `& N0 A; o4 ?, k, s. W pLight->Specular.b = 2.0f;
B0 }2 P0 X2 b+ q% }; l + H6 u$ x4 E; k4 p
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
2 m" ?* e) f- G3 ^" O( i pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
! j3 x, {) a# M/ p) @$ u1 I pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];/ `9 Y& `2 Y/ c+ R1 {: s0 w7 e
d: d$ H2 I" h
HookUpdateLight( pLight );
' }% ]9 z( K4 d7 W
( W# n }5 T% v; ` memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );$ T) }" R. W, f" z$ i# P
0 b9 Z G' ]7 U2 z1 ?7 _
pLight->Diffuse.r *= 1.2f;
+ O* S. M3 _0 m( e2 \ pLight->Diffuse.g *= 1.2f;
; T7 _& s1 e1 k/ M, z. ^7 r) E9 Q pLight->Diffuse.b *= 1.2f;
" M4 q! v9 \4 R# w' Y6 v
* C3 Y$ X; P" Q! l. ` pLight->Ambient.r *= 0.8f;
( Y9 u+ y. g1 ~" C4 l* f) T) y0 L6 o! l pLight->Ambient.g *= 0.8f;
5 B3 o' Q7 _4 R# U1 ^ pLight->Ambient.b *= 0.8f;
u; W) y9 \" t. U; O/ i
# V4 W7 `+ O; _2 |0 U memcpy( &m_light, pLight, sizeof( m_light ) );% H/ k( j# D8 k+ t8 c7 H
+ f) p# X4 Z( C2 S2 U' G
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
; \7 Z; t* n6 y3 v. h6 ?% ^ D3DXVec3Normalize(&(vecSun),&(vecSun));9 j% S( M- x$ Z2 t* } ~4 K/ J
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 7 y9 V+ v1 F. g7 L& G9 |/ K
pLight->Appear( m_pd3dDevice, TRUE );
- l* g* V. R0 Y2 v
; W7 I) ` r! z1 w: a DWORD dwR, dwG, dwB;1 Y3 l7 w! a* v& Q; c; F
dwR = (DWORD)( pLight->Ambient.r * 255 );
) l, m6 O& Z5 n) G2 A; t dwG = (DWORD)( pLight->Ambient.g * 255 );: D- Y% A/ T) W: D5 R
dwB = (DWORD)( pLight->Ambient.b * 255 );
" N. \; p9 m& ~, M dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
. r3 C3 W; ~5 Q$ w) r5 C }4 n# {& m0 b3 C D$ y' u
}
" y: w2 u7 R% b' P$ `- a }. y9 D; A$ ?$ p9 M9 ^- N
else; X3 z( x# I4 k( Z: d; e) ^
#endif 2 O2 m% W( Z8 |/ y% D: R& f
. B3 t% L" b$ t8 U
if( m_bIsIndoor ) h0 ~8 X) u t
{+ z- \% c8 G, _& Y7 [
if( pLight )
3 N. g0 U# M' C. y# u {
$ s* O, f8 V: Q7 H1 Y; G5 | // à??μ oˉè* 0 p8 A, d2 ]; N3 o& j8 H' b: R
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;) Z+ [( m- ` P
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;6 h/ w4 f$ q* I2 _. M" z2 A+ ]
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;' B" v5 `- U+ U5 H% ], [1 S
3 x7 O2 u1 `/ B; ` // oˉè* ??à? ! o0 z4 U0 D; P' q0 w( C, N
pLight->Specular.r = 1.0f;8 F/ N( T% Q3 ~ `9 d( n0 N
pLight->Specular.g = 1.0f;
" s, _% Q# J# |' ?" Z pLight->Specular.b = 1.0f;
$ T& _: L. D0 w9 e3 P1 X/ i // àü?? oˉè*
. z: m( }/ R- h5 ^ pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;2 j$ r! u+ s, h+ z# x
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;5 ~% _+ a. u( B- c x% I
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;+ S; Z" O! p* d. i* d* X" e4 ]- D
+ b8 x, {, C! Y9 t if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.; g+ \1 Z7 W! D) E; i8 R/ x
{
- ?3 q4 I% T3 S% M' e pLight->Diffuse.r *= 0.6f;+ O4 J; G( b7 T; e7 G1 U# `/ U
pLight->Diffuse.g *= 0.6f;
$ n$ Z" i. M3 b5 N1 S o* _ pLight->Diffuse.b *= 0.6f;
( G. l; F' L& I! a/ z pLight->Ambient.r *= 0.7f;
( \% K! G/ W2 H- r8 t6 M1 m0 x pLight->Ambient.g *= 0.7f;
9 n/ s6 C( U; b# [ pLight->Ambient.b *= 0.7f;3 ]3 B6 W, G l/ L
}
, l7 b$ o9 [( G+ S3 g$ _9 l# E; ^/ \+ F% F9 z+ `5 t6 f# {
#if __VER >= 15 // __BS_CHANGING_ENVIR3 N! w4 l0 w/ n# V
if( g_pPlayer )/ |% R K |, J; G+ G9 d
HookUpdateLight( pLight );
1 G2 E5 w3 u; I$ a1 R w6 V, O$ g#endif* I! M( H8 g, ^ {4 q# b
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
: f. v7 M4 O4 }+ {
/ G* h4 `) ~" h5 C+ a/ T/ N* D; T pLight->Diffuse.r += 0.1f;
Q" D5 v8 s. i9 { pLight->Diffuse.g += 0.1f;
; O! ~! g7 r+ g$ H; w pLight->Diffuse.b += 0.1f;
% m0 T9 W7 m i7 D8 T6 V: V6 B& r // oˉè* ??à?
: y$ e5 @4 u; K: i! _ A3 _ pLight->Specular.r = 2.0f;
: R" {- Q0 P _1 @ pLight->Specular.g = 2.0f;9 t# \! I- Y# i! g
pLight->Specular.b = 2.0f;
d2 {. e7 g, p. d5 P/ W' r2 p' \ o7 W // á?oˉ ; M/ `: R% q! a
pLight->Ambient.r *= 0.9f;+ \! O7 ]8 ]2 P2 ]- v1 b1 L
pLight->Ambient.g *= 0.9f;6 X6 M& B! s. r6 e `. [
pLight->Ambient.b *= 0.9f;+ g5 p$ f; |9 A/ P
' w; ^' W8 W- O' V+ w1 a4 z3 _ memcpy( &m_light, pLight, sizeof( m_light ) );
6 |9 M7 ~! k! N* ~/ R8 c4 d 8 G! x( n& \; @4 f
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
* y7 `/ ?) i+ \# P6 v pLight->Appear( m_pd3dDevice, TRUE );
- j1 E0 U2 L; v" s# u9 Z * p0 c* C* N) }" D1 G; t! c e, ^
DWORD dwR, dwG, dwB;
/ j( `1 F% w! j: f) C( q4 ] dwR = (DWORD)( pLight->Ambient.r * 255 );* ^$ N* j0 T, C( `& ?
dwG = (DWORD)( pLight->Ambient.g * 255 );
+ w( ?9 {- z4 l, _, t4 D* { dwB = (DWORD)( pLight->Ambient.b * 255 );
7 F3 R: A3 b5 ?* j+ f$ c& {' m0 _ dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
5 l* u* p& m7 k" r; ~3 L* V* }$ u, o }! e2 Z+ O7 X$ Z6 c, G
}
6 |7 H* m( o( F3 k5 a else
0 I/ Q4 ^7 r5 v {
, z* ?; O# y- \ if( pLight )0 I; q1 P, R5 a% t# m
{
$ B: L9 Z/ }8 k. ^ 1 n7 S+ R$ x. J6 d$ }
int nHour = 8, nMin = 0;
0 R; J s8 ]8 y$ R- Y #ifdef __CLIENT
, W( x/ T1 o! x9 l7 o // ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù. % B5 e' q3 ^$ k/ ^$ ]9 ^& D1 c& S
nHour = g_GameTimer.m_nHour;
( y8 ~6 ~* A" \: u: D0 C nMin = g_GameTimer.m_nMin ;2 e! Z7 F0 r6 {3 T
#else
6 F4 Y. V0 j! S7 z* j( @ // o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
8 w$ k6 _/ ~. k/ Z i if( m_nLightType == 1 )
7 H7 X' t3 C2 z: h" L. E+ I nHour = m_nLightHour;5 ]1 ?) p P; Z/ j
#endif* j b6 X$ M* n" K9 O% C3 @: }
nHour--;9 s, s! ]4 l" I! L
if( nHour < 0 ) nHour = 0;
7 J, z# v5 i* C2 U/ T8 [ if( nHour > 23 ) nHour = 23;- D/ g* ^" C2 x7 }
: Q: [" ^: e! X9 J, M' g //if( m_bFixedHour )
0 s* |0 r7 J5 O0 ` // nHour = m_nFixedHour, nMin = 0;
q9 s+ G$ {, v0 S2 c/ d+ v LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
y, C7 W$ V1 }' D$ x LIGHTCOLOR lightColor = m_k24Light[ nHour ];
* W9 b+ h j# {7 `+ k; `9 _
! B% C, {/ Q' M4 O, `4 Z //m_lightColor = lightColorPrv;
& D- ~, N3 K$ e/ y- Y lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;( `2 p4 N; s& `; y9 s0 C
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
) r. J5 e8 M7 h0 c. h7 N' r; q7 B+ }$ R7 v lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
& k. o4 P8 x/ D- Z2 S, G# u( D lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60; o1 n" Z# Y) T3 X2 W! P- l
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;9 A8 U, s2 N, Q4 ?
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
) g; Y$ _3 _% f Q( W // 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)( F4 ~: \4 d' j
$ J$ Y, Q& v' N, C; G
// à??μ oˉè* / d1 ]) f8 C8 z' K7 {( z# y$ s
pLight->Diffuse.r = lightColorPrv.r1;
: p" q D& S. M- M6 N& i! k# G/ Y pLight->Diffuse.g = lightColorPrv.g1;
3 Z# n7 H" H, F+ V. i pLight->Diffuse.b = lightColorPrv.b1;
: @/ R' N# c6 F) h8 N // oˉè* ??à? ' Z4 M+ X8 f6 U) }
pLight->Specular.r = 1.0f;
1 x) B) \1 b( W. W* ^7 a pLight->Specular.g = 1.0f;
: `, w7 _, u6 G+ a. q8 b6 } pLight->Specular.b = 1.0f;
$ N5 W, X2 g# e7 t // àü?? oˉè*
( ~3 `; m) T+ `" T `' O7 O pLight->Ambient.r = lightColorPrv.r2;" Y4 t+ Q' ]8 ?1 a/ w8 ]& ?
pLight->Ambient.g = lightColorPrv.g2;
, E J+ n- m$ I3 m# z( r pLight->Ambient.b = lightColorPrv.b2;' ^$ r) o4 d% [- F) O3 u7 a; W4 l% \
! Q2 ]$ {4 q- h4 r3 M if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??." R# y! }4 K/ n
{" E; B$ a A: V$ |4 B g3 i5 T
pLight->Diffuse.r *= 0.6f;2 p$ F7 n5 X U- e. ]2 w+ V& |
pLight->Diffuse.g *= 0.6f;
9 x$ l g& K$ \7 @( n! n pLight->Diffuse.b *= 0.6f;4 @2 v+ [8 \ Y4 T2 B' A
pLight->Ambient.r *= 0.7f;
( g# U8 y7 N0 n& v C( n pLight->Ambient.g *= 0.7f;
7 R. ^: y" E5 x6 o6 Q( R1 q pLight->Ambient.b *= 0.7f;# w9 o1 A9 ^. ^- v
}
; h5 E5 d. I( n + h7 H8 L j" }2 H7 T6 ?
#if __VER >= 15 // __BS_CHANGING_ENVIR
3 u; K& |+ ~, Y( {% ?4 K6 M) x if( g_pPlayer )
# o3 {$ c$ m7 K( c8 C) _7 e% r" g) X HookUpdateLight( pLight ); 5 j6 B" q) \7 S( x5 j" `
#endif {; P# P" w \' e" Z, L
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );0 }" d* C3 D, o% C' v1 H
: D8 q9 H9 j. p: Q3 @
#ifdef __YENV8 r: i: K9 X$ z2 l
pLight->Diffuse.r *= 1.1f;. Q0 U! X8 l4 Z0 e
pLight->Diffuse.g *= 1.1f;
( e C8 c0 s V& o pLight->Diffuse.b *= 1.1f;( P, N, {9 X9 c
// oˉè* ??à? 9 M2 |1 e3 G' p1 x- D! U9 m
pLight->Specular.r = 2.0f;
$ W' }: q4 \- R& _9 Z( Z pLight->Specular.g = 2.0f;
% P' n4 m U: a$ q6 \/ N pLight->Specular.b = 2.0f;
" m d% G8 A9 I/ F // á?oˉ 1 Z/ G1 M, D4 o5 t; |
pLight->Ambient.r *= 1.0f; o2 J+ [- d4 I3 ?! b
pLight->Ambient.g *= 1.0f;
, {$ ]# ?+ q- J% O; B pLight->Ambient.b *= 1.0f; N) s" d3 k5 x& A# B
#else //__YENV
9 k, Z0 M8 w( _9 l2 } pLight->Diffuse.r *= 1.1f;' \- ^+ ~# o8 t- m8 T6 J, g
pLight->Diffuse.g *= 1.1f;' g6 R% [6 H. K' G! f8 O1 C
pLight->Diffuse.b *= 1.1f;
( F8 F% ~- w4 I) {3 j; R3 j // oˉè* ??à?
, \- w6 \3 p5 X w- ?* w pLight->Specular.r = 2.0f;- u- L9 D" ~) \, h0 N( P% d- @
pLight->Specular.g = 2.0f;- f# O1 f2 V, @. l& z( D6 [& h- j
pLight->Specular.b = 2.0f;' a" {* D# W2 t
// á?oˉ . r9 K' ?* s+ M! t0 v6 ^7 s' a
pLight->Ambient.r *= 0.9f;
& }; V& Z( l( r2 | pLight->Ambient.g *= 0.9f;7 P6 v/ C% i6 N c
pLight->Ambient.b *= 0.9f;
0 \! ]/ X D. U$ K, o#endif //__YENV & L; o; L) a* x
; g% ~) I, { D1 h6 f) _- e memcpy( &m_light, pLight, sizeof( m_light ) ); `( f i8 a; S% y# }+ C
) V- j% K9 Z% h
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f); M4 a' u3 l1 Y' w3 `8 b
D3DXMATRIX matTemp;/ t1 r% T! H1 {3 I! b
static const float CONS_VAL = 3.1415926f / 180.f;$ D- U( {4 I- q
. Z, S' x4 o( J1 Z: w* K
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);6 h% W% i' b+ o2 F1 f7 Z1 e2 z( \/ P' M, j7 l
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);% h- H9 x- ^2 u& P Y# j, Q
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z ); # n! z" R( B" h2 h$ E4 Z$ U9 U
pLight->Appear( m_pd3dDevice, TRUE );
, m V1 k3 |; D; f9 ^& F7 J3 l; s2 Q; _; y$ p
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
5 E" x* Z4 |1 T O; m8 n // D3DXVec3Normalize(&(vecSun),&(vecSun));
% m1 Z$ Q% ^7 L. o // pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z ); 8 T3 h4 N; f) D! Q/ `
4 M. Q1 J9 ?3 y1 M" Z) v
DWORD dwR, dwG, dwB;
& K8 ]. o/ n5 M5 _0 c, T) X/ _( N dwR = (DWORD)( pLight->Ambient.r * 255 );6 D9 e) V' X( C9 ~3 V8 @: o5 F
dwG = (DWORD)( pLight->Ambient.g * 255 );7 _' G5 p A8 \* G; U* d( X9 M
dwB = (DWORD)( pLight->Ambient.b * 255 );
3 g& h8 I7 o! Q T dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
- B; [, E7 t: x3 h+ [ }, X( X# @( E- F( h9 ?
}
* z7 j @! U X# B
1 u9 _$ V" C$ z2 c) K& d, U m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );! \7 E L/ A( X# j) I0 Z M$ f5 S6 C
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, x) d# S4 S* C, b& y
::SetLight( bLight );% z6 B' M7 i, C0 L& M S' |
$ E3 s5 m, K8 \* f* K, m
// ±ao? ?D?í???ó á¤à?
$ s8 z7 G' q" g! N$ V) B5 _ m_pd3dDevice->SetMaterial( &m_baseMaterial );
4 h$ Y7 Y4 c5 ^
: A" N' V1 s% x: z#endif // not WORLDSERVER
5 O- ]1 y8 i- `9 u' H2 Q1 L}$ [0 L# a. g% b5 e" @9 ^7 S
并更换' G. W7 {. E. @5 \2 g
Code:
$ i# J* T9 d% J F% j__FLYFF_INITPAGE_EXT9 a& F9 k0 l/ U4 j! {
定义
. R: ]; N3 t7 |& \( b+ j. j0 o# b- V! T
4 N& q/ v; `- E9 Y6 h% R0 c6 o( f+ n8 U; H. Q1 h
' k: t0 T! ?% ~7 R现在终于删除我的狗屁加速...
, u; Y$ |# e0 k7 I
' H, W( Y: J. \& E: [$ ]7 m9 p
) r7 v. x; v- f' R7 Z
|
|