飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
: J( t. H' p0 y) D
尾翼:
2 r8 ^1 u8 n5 N u9 l# `1 ^
9 H* B4 M" \% Y% L9 P( _8 S
代码:
4 U3 D l/ I, h* Y. ]
CWndAutoFood::CWndAutoFood()
+ {5 r* o) A0 W
{
2 ]7 U7 g2 e/ u( O
m_pItemElem = NULL;
. N! \2 i* h& e, f O
m_pTexture = NULL;
7 g' A0 Z+ l2 p2 p
bStart = FALSE;
( L4 W# n2 n a' U7 W' u4 ^& Y
}
+ {" \% ~3 }( L5 I& Y6 k
2 Y _2 {# J8 J
CWndAutoFood::~CWndAutoFood()
0 S! v2 E, b- ^% j$ u7 b2 D8 E4 e
{
6 n% X# z! T& {
AfxMessageBox( "AutoFood ist gestorben
" );
' a! _* t, Q: ?% c# E
}
3 k- l2 t) Y8 d& R- n) V. {
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
/ ^& N7 Q3 X8 C% }' ]& n3 E
{
9 w8 B& E: W6 D, v- S0 a- A/ l8 v
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
) ]9 d2 [: y+ U( d% W+ a0 T
}
+ Z8 t& T$ \# W0 R4 r( c* ]
, d# w, `2 r r
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
! N' c- E/ t t% H4 `& ]
{
# r1 R/ c. ~4 L4 G
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
+ C, K) g9 U( z! N& N
CRect rect = pWndCtrl->rect;
5 p+ h: k& J' R- N# }$ m$ z% ?4 I/ P
if( rect && rect.PtInRect( point ) )
3 f( M ]! u* z; ?
{
& R; m5 T) h7 C/ R
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
& {" _7 ?" Q6 [2 n7 I' _6 Q. [
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
- F: l1 S3 k8 _
{
) `4 Q5 w1 A4 O7 ?2 E- A
if( m_pItemElem )
) d7 i& g8 ?, ?! y; |) f
{
/ j6 ]3 B- J0 Z( E: P5 S O& G ^9 ~
m_pItemElem = NULL;
( n7 C! t+ \" `3 M
}
" l- A9 d) l$ y6 S3 h. E9 s+ S3 @
m_pItemElem = pItemElem;
g+ K) ~/ D9 H' L7 f, X
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
* `2 H8 d8 |1 A- E, Z9 _( I
}else{
* b0 a9 T" l' t* k0 i6 z
SetForbid( TRUE );
$ h8 \* R) y6 o
}
7 k0 b6 ^# i# ?5 l& O) {
}else{
4 m; `0 k( Z' G2 d
SetForbid( TRUE );
5 ^- O5 W X% P1 c% ^' Q0 b! J+ i+ O
}
' a- P+ t( V2 R7 ^+ W8 t: t
return TRUE;
, X( H+ M5 }4 u, u* v
}
1 k/ Y! E$ v, T" G# J$ A( N" P
1 @3 ~1 f" u3 C& p, J
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
' i. @* a( X% q2 F: O2 M6 X
{
# y' u+ u! N |, |+ a
switch( nID )
# N2 d1 j) D4 k' ~. K1 A2 Y
{
8 ?2 @' R9 h' S
case WIDC_BUTTON3:
0 ?8 J. F9 u2 `+ L1 A+ S; R# x
{
" P9 v' ~! d2 N" u& b7 N
bStart = TRUE;
3 l6 g% z) V" t- h4 u
break;
9 i8 F* x) m5 m! u4 N* L
}
6 x$ W0 Q: N, M$ _6 Z- X7 k& `+ M
case WIDC_BUTTON4:
* q* J1 E0 W& v
{
& u. o1 }/ ]* q+ v( ]
bStart = FALSE;
1 } a; F& Z0 }. i, `" G
break;
& G& q1 @* \- I
}
0 G: d* q: i3 r8 E$ T+ b1 }
}
3 f2 J; Z: r* B' a- V
return CWndNeuz::OnChildNotify( message, nID, pLResult );
) \1 |8 a3 e6 S _ @+ G6 Q
}
2 e! \5 K& l+ x; n3 m# ~
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
6 L/ d. ~6 R; c! j4 D9 S7 ?
{
% {$ `2 v$ G1 X" F. Y+ M
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
- X6 @4 k. a+ x$ H) T5 X# C
if( bStart || !m_pItemElem )
5 `8 {7 N1 G- F3 g9 v0 \
{
' ]. K$ m/ y& C: o" u
pBtn->EnableWindow( FALSE );
l; m6 n3 o. @4 y( W
}else
8 i2 X6 H) m6 T: k2 n$ z4 m
pBtn->EnableWindow( TRUE );
/ {8 z5 C* L. O3 B
if( m_pTexture )
# Y4 }; [& J* V& V1 ?
{
9 A& o' ?/ `* {! j
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
. f: J+ o. w/ D9 U/ n
if( wndCtrl && wndCtrl->rect )
% {1 i+ [! w8 s6 m2 ?6 h1 p0 J
{
0 d F/ m( B V' g# j* _& n" |% [
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
+ [( N" }: _* l! P% \
}
8 Z8 ], A- e) Z* H
}
7 R& G$ O7 i& P6 S7 @
}
: ?; C1 _4 q* T' W1 c
* {' t. j) w$ S D4 J/ f; O
BOOL CWndAutoFood:
rocess()
& A$ ^" r+ t8 \( X' y6 o) R1 N A
{
. h1 U5 f' r8 R- h9 U
if( bStart )
C) A r" C# f8 V0 Y: `
{
& p3 I' S7 m4 [6 j4 ^8 g
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
2 T8 C7 l0 G/ N' v) e( a0 p9 |
{
( O! G* J! }$ e% Z
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
+ V; q# G; M' t4 S5 v5 B( q+ ?
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
; x8 @6 \* [& `+ E
}else{
# |' ?* m. Y; R J
bStart = FALSE;
# l3 F2 a& @5 b/ K/ Z7 k. e
m_pItemElem = NULL;
2 o* x, q* t: L; A. B* k1 m
}
0 E8 @9 j3 N0 X4 m1 Z1 v$ h& G
}
9 L. v) o) k; N1 S! U- ~
return TRUE;
& \8 h8 v" g' o$ w' r; X
}
$ Z* @9 O: ]% [3 M2 V4 {8 X* g
2 A5 f( _6 x; e+ _& f( L
登录视频废话:
7 J: a/ x1 M7 e5 Q2 c+ ~9 p; l
尾翼:
' ~7 w( u1 a- Z: @* M9 D
& M0 v3 O% \" n' C8 ^8 `6 [
代码:
8 E* N3 ?& f t0 L
1 a7 S: B. T. a: L3 N
void CWorld::SetLight( BOOL bLight )
) z$ d* A6 Y2 D, Y9 q
durch
$ F) ?9 m- G! L+ z4 s# K1 I
Code:
# L5 t( y4 A" m
void CWorld::SetLight( BOOL bLight )
/ r/ y8 Y9 S* g* \$ s; O
{
) d9 D& h) S- o H, m% l# ~
//ACE("SetLight %d \n", bLight);
9 l% ~/ W+ N0 ^& c1 e/ O
% C$ `! O( w% a0 U% P4 C
#ifndef __WORLDSERVER
- r7 r: r$ B/ v' Q& ^
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
+ Z" p* `+ W X
CLight* pLight = NULL;
1 A. f# l3 C0 \2 c7 e2 p Z
4 T5 G) a6 H3 s( N
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
) \. q- u1 l% f) }% r
M- ?. w0 x: M- L% C" y5 h0 J/ U
pLight = GetLight( "direction" );
9 n6 x: l0 R( T) m4 N" Y; A3 Z8 O% j
% H6 k2 ^6 r1 N4 z/ q) s; b. _" Y
#if __VER >= 15 // __BS_CHANGING_ENVIR
( b* n, R# X. L$ g
if( g_pPlayer ){
- b4 g2 i$ i0 Z0 t
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
, |) T' d t* ?, ~* F2 w
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
' r- {7 {' l8 O7 n# X, Q; u; C
{
0 w5 m( z) f- }+ W, q2 {
if( pLight )
6 n+ V' E9 [: M7 {
{
' W' m/ X+ Y- G. a' b/ J
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
$ R* w6 f3 c- |5 a# Y
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
/ d' Q) e* A& v* i5 J
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
. G( n7 y7 u e5 m3 [
% r8 X2 {, j1 ~8 e# a
pLight->Specular.r = 2.0f;
! x( S: M( y( T& x# X# H% S
pLight->Specular.g = 2.0f;
$ k5 a. U1 n( J1 f; |3 L0 E
pLight->Specular.b = 2.0f;
" ~" I1 D; c" J2 E; ~- `! e
* V+ T9 }# _ P9 ^1 g% `6 {6 Z" j* g7 R0 v
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
& s1 ~2 |0 M* `7 `2 F
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
; b8 |- I2 H& i: A" z+ X8 X
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
/ w) P- G/ k1 x9 H, f, u
/ E4 Q( D0 V" O
HookUpdateLight( pLight );
9 g' {5 a' }4 C+ G
" ]- m' U. _( p5 |
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
/ {: H$ \, \ M/ f8 V1 |0 i
0 d/ f7 |/ P+ @; ^
pLight->Diffuse.r *= 1.2f;
- Z( R5 |$ s/ {2 U
pLight->Diffuse.g *= 1.2f;
) d3 \9 @% |4 i3 L1 U% q% \# h! J" Q
pLight->Diffuse.b *= 1.2f;
) H, A; o j$ k
! d# l1 m8 j: S& x
pLight->Ambient.r *= 0.8f;
9 ^/ H" _; r {3 m, d& ?
pLight->Ambient.g *= 0.8f;
: m) R- z/ X0 F* X. ^3 j
pLight->Ambient.b *= 0.8f;
: @' O6 H% G( c) D
9 J1 D- G1 Q. T3 N4 B* n1 n
memcpy( &m_light, pLight, sizeof( m_light ) );
! ~. [9 \. Z! v4 f" [/ ] O
& U/ m( ~1 n# {7 d
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
: C2 Z7 v2 a2 C5 T8 o) q
D3DXVec3Normalize(&(vecSun),&(vecSun));
S4 E8 _# X& w* h8 y" S* a4 C6 C
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
( e. n; j* }! j' ^4 H, y9 b% j }7 O
pLight->Appear( m_pd3dDevice, TRUE );
& g) V. L; ~5 X& e0 F4 \1 `
3 {4 J: k" e1 [! l7 E& R! m( z
DWORD dwR, dwG, dwB;
* \ Z. }& }3 n# b1 R
dwR = (DWORD)( pLight->Ambient.r * 255 );
0 ?/ M$ U6 W' y. @% i. F- ]
dwG = (DWORD)( pLight->Ambient.g * 255 );
! P$ Z* e, c2 Q5 a. B
dwB = (DWORD)( pLight->Ambient.b * 255 );
% A) Z! ^' E2 `2 r3 Y- j0 C
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
, ~" o3 O9 y8 q* u) ?( c3 i. W& }
}
_) G( T) V" l' J
}
/ k% q5 L% ?5 i# S* _: @+ t% l7 s
}
P- i9 ?. O( v( `! K+ g
else
3 V" U1 Y4 g) x) u
#endif
}: ]" ^2 q1 P. d; ^. \
! P; @! K3 o" _; }( r1 @
if( m_bIsIndoor )
4 {( `1 ]4 Z% i7 n2 j
{
$ R& `& r6 ?& _0 A* ]$ ~/ B# \
if( pLight )
# C* @6 ?' I# m e6 n/ M( s
{
2 b/ A. u$ l& `5 @. q* M+ [
// à??μ oˉè*
" n& R2 S% z- W; e
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
1 r; |; H$ v3 W
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
% v9 D$ U5 \& ~" e" v3 [5 M
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
- r( P! b6 F6 z+ Q; Q
/ O3 b+ U, ~& X
// oˉè* ??à?
; o3 l( Y8 ?% T6 a9 c
pLight->Specular.r = 1.0f;
/ g* F$ d4 U# S1 }! N+ y
pLight->Specular.g = 1.0f;
. X3 z7 b% J6 M; T* u! @+ |
pLight->Specular.b = 1.0f;
]6 A; J5 ~( {0 l
// àü?? oˉè*
: m$ t- o4 `. J8 d l. V
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
/ J' _8 d: r* b) O, p' p5 R
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
+ n/ ^. a6 D- N) r
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
0 E) h9 ]$ z7 m g4 R5 z# E
1 q; _1 u: [9 o+ \, @4 ^: M2 t
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
. b8 f0 b) p# a
{
9 z. h1 U! b' T
pLight->Diffuse.r *= 0.6f;
) ~4 H0 o4 j U' j
pLight->Diffuse.g *= 0.6f;
& D$ z2 @6 B4 q
pLight->Diffuse.b *= 0.6f;
; M5 H& b9 y( H
pLight->Ambient.r *= 0.7f;
. ?- L3 D% U/ y. Z7 c7 g
pLight->Ambient.g *= 0.7f;
9 m% U i! b* O; b' _7 \
pLight->Ambient.b *= 0.7f;
' k; g, Q0 n4 q0 F
}
" h0 T7 ^- x% K9 |
/ ~8 t1 M# s/ H. a# L
#if __VER >= 15 // __BS_CHANGING_ENVIR
# m$ u' U1 h( H- p
if( g_pPlayer )
% z- T) v8 T6 f
HookUpdateLight( pLight );
0 G7 s0 p0 {& P% E' c+ p; R2 i
#endif
! W$ x% `7 U! i- l$ |- x
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
M3 w# ?+ u8 Y% B6 f3 ?
% m% Q( q, h/ K% V. E
pLight->Diffuse.r += 0.1f;
+ m" x) }1 z1 \. N) V: E* z
pLight->Diffuse.g += 0.1f;
% B+ @5 N( ]% X# S. M8 r) l
pLight->Diffuse.b += 0.1f;
; q0 v" _. V+ e3 o
// oˉè* ??à?
5 h; r) D& A4 u+ Y9 ]
pLight->Specular.r = 2.0f;
. ]8 u3 S. T* R6 h6 k9 D% q% s
pLight->Specular.g = 2.0f;
! @9 l G3 q G! i3 p
pLight->Specular.b = 2.0f;
5 O4 h2 K. u/ y+ E1 ^5 G9 `* Q8 D
// á?oˉ
0 c G# @. f4 @( w. k
pLight->Ambient.r *= 0.9f;
* ]" w/ {& Y3 p& a
pLight->Ambient.g *= 0.9f;
1 X. B- ?4 S1 A* |
pLight->Ambient.b *= 0.9f;
+ j4 k/ A/ [0 `+ N2 b5 v
& n. Q& I q0 ~/ A0 @
memcpy( &m_light, pLight, sizeof( m_light ) );
# C9 g( r6 y: G' x
0 X i. H4 S0 @; p- G9 s5 U. x
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
6 w( I7 [2 D, j/ M
pLight->Appear( m_pd3dDevice, TRUE );
6 j) N. d1 l Y* I' w. u: h, |
6 ^! ?3 y( s/ a+ M) }
DWORD dwR, dwG, dwB;
: e) Q( s+ p$ m: C
dwR = (DWORD)( pLight->Ambient.r * 255 );
3 t0 C# @% ?7 ]) Z
dwG = (DWORD)( pLight->Ambient.g * 255 );
/ s- M8 J( B, f! k, l7 A& J1 ^+ K
dwB = (DWORD)( pLight->Ambient.b * 255 );
6 ~/ X# Z! R9 P$ R
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
! R" ^- V) V6 r( W/ }) E8 h
}
6 H R1 D x. a& P# O/ Y) a' S8 E3 x
}
% c" \/ n5 {/ i" s
else
7 o& s* W, L& L" i9 R5 [
{
) D$ v& N1 \! s N0 _+ }5 V
if( pLight )
8 t7 }1 n/ l$ H5 Y" r3 x! {
{
9 J$ @( y3 ^6 m, X
0 E2 u) }( q' T% V
int nHour = 8, nMin = 0;
0 P( n' G; F4 T3 Y3 y/ O
#ifdef __CLIENT
6 W" Z, h1 _, M; F6 ]
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
& k* q1 D# I$ |' z$ l
nHour = g_GameTimer.m_nHour;
% S: n3 t+ M: \% u$ c
nMin = g_GameTimer.m_nMin ;
# V; R- D: i5 B4 S; o1 z6 P B
#else
w+ a+ g5 z$ K! n7 R+ ]3 p+ `
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
9 m, Q& t4 J3 V9 B d+ Q5 Z$ |
if( m_nLightType == 1 )
4 J8 Q) ?( X4 Q+ w
nHour = m_nLightHour;
5 }# [4 Z' M: c
#endif
* y. e5 d% b1 B2 u) e$ x
nHour--;
1 m+ v3 W5 \* e6 Z. Y W
if( nHour < 0 ) nHour = 0;
- v2 P" R" m" c6 _& ^8 h7 l
if( nHour > 23 ) nHour = 23;
( a: T- j. P3 V e# S' r1 H1 ]) x
; |' c7 k. u, p" G
//if( m_bFixedHour )
/ g7 {) f$ v- ]; C/ j k
// nHour = m_nFixedHour, nMin = 0;
* V, P1 }, ?8 l7 u. r+ }6 ]: P, Z
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
$ M0 @/ n' P* t- b+ y
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
; b' V9 C7 G/ `$ z8 `( I
0 N. [3 o! v& W- v
//m_lightColor = lightColorPrv;
+ @ ?5 V0 L3 A; Q4 }
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
) k9 z$ @& L6 F R
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
& x. p; ^$ w; `4 W- K0 d
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
% T( ~) [ S2 j d6 K3 X. X
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
; j. F: v+ X( @: g& V
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
3 f0 K7 ]. p$ A
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
, Y" ^' r3 o/ f+ x" r! x
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
L9 D; Q5 G# K Q" {/ v+ `
! U t6 Q# h" B, f0 j9 a& @
// à??μ oˉè*
|% I& ^* A) o) M7 Y" x0 o# P5 S
pLight->Diffuse.r = lightColorPrv.r1;
2 t: g0 P' ]* n/ q l. n. [
pLight->Diffuse.g = lightColorPrv.g1;
0 _* k9 ^, @+ n* c
pLight->Diffuse.b = lightColorPrv.b1;
% H3 b- R2 Q7 B8 J7 U
// oˉè* ??à?
& U: e( u8 Y# A0 H( `2 _3 `: J
pLight->Specular.r = 1.0f;
) J4 B) p1 W% T# R0 q0 h$ d
pLight->Specular.g = 1.0f;
* J% d/ S. _( A, ]! K) L7 i
pLight->Specular.b = 1.0f;
* B& J) m {) E- Q: e# H; o
// àü?? oˉè*
: j* [6 V( g- u( N) C
pLight->Ambient.r = lightColorPrv.r2;
) S# B1 r/ N& |
pLight->Ambient.g = lightColorPrv.g2;
' Q o) V/ j E: L7 ^; `
pLight->Ambient.b = lightColorPrv.b2;
6 n* ~' |& p$ g+ ?6 U
" Y6 z( t4 m: ^$ j; ~/ ^
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
9 F. e4 v) V( w9 M: z6 ?
{
: j7 D9 K; e+ z- Y: e7 R, `5 Q
pLight->Diffuse.r *= 0.6f;
7 p9 }: V& J/ L2 r
pLight->Diffuse.g *= 0.6f;
3 m$ X3 P: o% v8 j5 z
pLight->Diffuse.b *= 0.6f;
/ j9 m/ X" _" v& Z6 y2 p
pLight->Ambient.r *= 0.7f;
( Y% B/ m9 C/ L+ P5 s" d
pLight->Ambient.g *= 0.7f;
+ P+ R5 R9 U6 O( w
pLight->Ambient.b *= 0.7f;
7 S& e8 V1 Q8 j- n( w
}
* d: G& {5 }- j. S R
/ V* F2 w5 s+ I$ v9 l
#if __VER >= 15 // __BS_CHANGING_ENVIR
B" @( b+ l* l2 h# h; k
if( g_pPlayer )
$ G4 D V4 `( D+ P6 S- l
HookUpdateLight( pLight );
& [3 `8 j: T' s$ H' `- r
#endif
$ ~; k E0 I K: o6 z
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
9 d$ |& |* T L: |, T3 d2 _3 V
9 [# i6 J7 |0 n* Z9 r
#ifdef __YENV
" \) c3 q, [# n* e4 L$ W" J# n. R
pLight->Diffuse.r *= 1.1f;
/ `4 Y* p4 y/ `* q* Z2 Q5 @2 O$ l
pLight->Diffuse.g *= 1.1f;
$ C+ ~# t. Q/ t( ?3 z/ t! X
pLight->Diffuse.b *= 1.1f;
: H; a/ h& n4 J: N' }- @# J4 c. h
// oˉè* ??à?
- L& g1 U& [* U6 f5 Z3 \; u; R0 s
pLight->Specular.r = 2.0f;
7 {5 R) o! o. d0 K- n
pLight->Specular.g = 2.0f;
: K( l' o9 e$ e4 E6 q' i4 Q( I) o
pLight->Specular.b = 2.0f;
+ K* N: V. I' y* W) \& j/ L: h- r
// á?oˉ
' V# z( f+ N/ D
pLight->Ambient.r *= 1.0f;
) a5 K/ B8 t! S; Q Y# a: C
pLight->Ambient.g *= 1.0f;
+ n% Z7 N0 ^7 I* O
pLight->Ambient.b *= 1.0f;
) ^2 P) Q3 d' j5 z) g* p
#else //__YENV
- @; F* |' j- r
pLight->Diffuse.r *= 1.1f;
( N6 ?) ?6 _0 \, }
pLight->Diffuse.g *= 1.1f;
X! T0 [, k4 a7 ^
pLight->Diffuse.b *= 1.1f;
3 @+ u& R M2 z4 o' c' l
// oˉè* ??à?
; m9 x1 O* e. I5 d" g/ W, k/ j. ]
pLight->Specular.r = 2.0f;
8 v* ]* m3 X/ U2 w3 ]
pLight->Specular.g = 2.0f;
( f7 y9 Z0 g* v7 c7 ^# A4 c/ e
pLight->Specular.b = 2.0f;
9 E' y( I3 L6 h$ _8 A2 [
// á?oˉ
% B/ t$ t! b1 X, l2 [
pLight->Ambient.r *= 0.9f;
2 b9 l7 D# X0 {7 n/ k
pLight->Ambient.g *= 0.9f;
9 @5 f7 H3 D+ w8 S& b& O
pLight->Ambient.b *= 0.9f;
* e v" v4 f. ?& L! y. O
#endif //__YENV
& Q4 K! {: R6 C8 n6 {1 F2 {
+ Q$ |# P; k8 O+ _. _
memcpy( &m_light, pLight, sizeof( m_light ) );
6 V3 \3 \- W+ Z
4 H1 N# E6 q9 J* ^3 B
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
6 @- R5 W% B2 @& D' |1 p, D7 h
D3DXMATRIX matTemp;
; i- `! J: M A9 N- {2 Y- a A
static const float CONS_VAL = 3.1415926f / 180.f;
# |- g4 I( h2 t5 ~5 F* a' D& ^
% T" a, C h6 F2 z/ ~3 |' }
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
$ r8 x0 B" d; p2 L) S! Z
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
. g7 J3 w' l) a+ x
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
$ k: U7 `4 C5 X
pLight->Appear( m_pd3dDevice, TRUE );
9 `" V6 M% E- x( E9 s
' |! ^ T: K( ^
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
, }% {2 p/ h' T, Y) d
// D3DXVec3Normalize(&(vecSun),&(vecSun));
3 g6 z% r3 X" @& \# C% I$ H
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
& n5 \; E9 g+ t
' S2 N5 u: O/ F T Q- X
DWORD dwR, dwG, dwB;
5 G) y6 B0 a& o2 V3 x' \; L
dwR = (DWORD)( pLight->Ambient.r * 255 );
8 [: d/ F. J, A8 I# `4 q
dwG = (DWORD)( pLight->Ambient.g * 255 );
" O) k2 t) H8 y! L8 a; f9 p
dwB = (DWORD)( pLight->Ambient.b * 255 );
2 Y5 d6 K- D) V( c: F
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
* f/ q$ p" e: R/ W, _
}
# } p: n3 \. S! K+ P. R* t& l
}
$ e3 y6 \3 x$ n% n
* m2 v5 l- Y+ X! U2 \
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
, {) P7 U- N+ A- G( _* p
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) );
2 R3 X! t' C/ `# F5 h& Y
::SetLight( bLight );
) @7 H7 Y2 ]: @: P5 W) k
! e' H7 j6 S' l! E) l7 l# Y/ d0 `
// ±ao? ?D?í???ó á¤à?
) S( v9 |" p8 v! x9 z! T4 S! F4 R+ @
m_pd3dDevice->SetMaterial( &m_baseMaterial );
6 i' V9 D. y% u8 S$ j& q! H# q
( h: O$ S' y& m9 k
#endif // not WORLDSERVER
: Z$ u- v4 c, L' h1 n8 [
}
; n: j( y: E L1 p
并更换
# T8 q, {) s8 d
Code:
+ f) e" Z2 U- E
__FLYFF_INITPAGE_EXT
' E, e, I) {1 }* g# l: D
定义
" k' p4 L5 G2 n# I$ H8 q1 O
: H' J( l* }$ U' `2 W
( @8 t$ p$ b+ ?% e. p7 O4 `
/ L" i' ~8 B5 p3 F k+ S
# D# B- \3 M8 c7 _, N
现在终于删除我的狗屁加速...
6 \0 q. L$ @+ u7 m* R
3 W& I0 X2 g7 s
& @( e% z% ^6 X$ g' s" H- F8 \
' w2 E- B* l% b" W/ x6 q+ M' _
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2