飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
/ I" ^! t8 x: G7 s
尾翼:
1 o5 L3 E3 ]4 ^) q% F# U" V! w
& b$ B0 w) b2 g/ a* X& r( e- W
代码:
; P/ l$ s. G3 E+ I( R6 V
CWndAutoFood::CWndAutoFood()
5 `7 v3 O& C9 L: k0 h3 z7 Z
{
' {# S4 p) Y3 `5 N
m_pItemElem = NULL;
) ?! x. U. \7 [4 o
m_pTexture = NULL;
: u7 r9 z3 z/ T2 a, x# A6 O
bStart = FALSE;
. ~# }2 D$ K! Y+ `
}
7 b9 ]2 i8 U0 ~" k; C1 D
& t% G, ]- j, U5 I* |; l+ b& K
CWndAutoFood::~CWndAutoFood()
3 K+ j* Z4 y7 n' r/ }2 |9 ~
{
/ z& }' A; k- _; u: y! i% c
AfxMessageBox( "AutoFood ist gestorben
" );
0 p( l$ ~5 Y p2 T! Y+ D
}
. @/ e! X: Z. k8 k H9 [
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
- a) m0 e6 p, N/ y/ z
{
6 O: r! o! ?8 v1 S0 {& f( ]
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
. d" [7 I ?( W, d$ y( _0 d) ~5 ?$ c8 n
}
2 R* J5 s5 P/ X# H3 X
8 A/ o1 i8 D" K& ]
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
( Y9 Q) Y: Q, v; t) v" q
{
7 I+ W3 O4 `9 f3 G' s
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
) X2 M- p- `, T; e- |7 D( U. H
CRect rect = pWndCtrl->rect;
' q! q7 Z# l1 A" J* H
if( rect && rect.PtInRect( point ) )
. q2 e4 A7 k- D c4 t4 A: e$ |4 w
{
6 j% c( T z% @5 O6 S" c3 c- ^
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
: L) s, E. \. |' P
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
- L: n0 f( n8 [+ \
{
8 c" Z+ X" d" K9 y, F( R
if( m_pItemElem )
! r' l. s- t$ |# ~/ u
{
8 A$ N- N0 `& Y9 K% _* v
m_pItemElem = NULL;
3 z. q8 A- p' C
}
; @( ^ R E3 U, t& n
m_pItemElem = pItemElem;
5 O; ^- K! [" {1 }3 ]% b
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
$ {: A4 M& w7 h% M. ^
}else{
- @/ l3 u: H. ?. I6 }' f/ Y L
SetForbid( TRUE );
" F6 D' U& Q# s* F* _
}
6 t3 Q+ m/ M5 a: U
}else{
+ a2 K; q: c$ w, D. A2 H
SetForbid( TRUE );
; M3 e: F. V* b/ `7 l- K
}
[9 E. Q; ?% z; H% {2 H) a2 L
return TRUE;
% U: \. X6 l( Y$ a' [: K
}
6 r" r5 U8 c/ F0 y! `% W/ {& w7 g
6 q' a5 m, W9 J2 j( m' Y' [1 q
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
" s: r' N; V5 _' R# R1 a
{
* `7 _8 R* u2 H6 \4 N
switch( nID )
+ m3 y2 R: Y3 u" {2 ?, H
{
, m2 ]4 L$ |* m8 o" B1 E
case WIDC_BUTTON3:
( f1 U) i; f" G* F5 `, [1 I
{
" c. ]5 x3 C% \
bStart = TRUE;
- X1 W, q, Q4 Z9 O, g
break;
+ u* f; F8 F+ o' n) @- o: l$ D- T7 b
}
6 N2 g9 M6 q( f U! q& m2 @
case WIDC_BUTTON4:
7 n6 `. k" x, K
{
( L( i2 [1 Q2 l2 D7 q
bStart = FALSE;
6 Q7 ` U4 o8 v p! `9 z- R5 J' Y
break;
9 G/ ` y2 F4 `5 u7 F; M$ @8 W9 k
}
0 H" Q# t1 n/ P/ o X( Y8 _3 z
}
8 }$ s) X% a, f, R- b8 v
return CWndNeuz::OnChildNotify( message, nID, pLResult );
: j/ y% {! b' d4 z* |
}
2 c4 }/ \# x# I4 Z1 @* b; G
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
9 Q$ y, M2 S2 R9 Y# d# ]
{
+ g) t0 M6 b* r o( w
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
5 P" N6 w" n5 g- A+ R
if( bStart || !m_pItemElem )
( R2 D! p! X' j3 w2 k \. e
{
7 G9 t" i- r7 J( n( v8 d; a
pBtn->EnableWindow( FALSE );
! A% j' |; `7 j
}else
3 Y2 M3 k1 r' O" L! ]/ | l' v
pBtn->EnableWindow( TRUE );
# ]7 T8 E- K4 n% D+ l+ ]
if( m_pTexture )
. o# }8 t' h, K5 c) p* U) H
{
! z# {' ^& d% C. D; p
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
1 U, }$ V7 d9 {
if( wndCtrl && wndCtrl->rect )
% Y5 m2 [* E- a4 }; N1 r3 t* e: I, `
{
. l# j; ~9 t; e( i# Z
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
- B" _6 s) U+ x4 y3 q3 P
}
3 S- m' a2 [2 y. F
}
V& i, c# b6 x, K
}
* J5 C6 o) t2 ?+ I+ d
% x+ Y4 F8 {& G3 g' {! Q( @- l
BOOL CWndAutoFood:
rocess()
$ T. L3 O2 {" p( B
{
- Q- L& g, |9 {, ]5 S0 c# |8 ^
if( bStart )
- Q# t* |: }! \
{
" Q: A. F6 O% C
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
& q" K3 Y$ e- J8 S( u
{
A1 ~: a4 `, U: p- X; 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() )
' _' ~8 c: o. x |8 `
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
. |' H1 }9 [+ L0 |8 |
}else{
8 y7 J$ Z, f/ U- i
bStart = FALSE;
5 v) j9 u/ `% x; a0 J
m_pItemElem = NULL;
: y1 h4 h% ?3 w5 F
}
0 e4 D: C/ T/ w. z7 Q; P
}
9 y. o6 ~# q5 J1 g, @/ O& H8 r0 y
return TRUE;
8 S, @2 v) j: w" G+ _7 E. y
}
- ^# f9 f* V# r3 O% |
# ~/ ~7 ?& X* X) ]7 O% _
登录视频废话:
. [) G* l' D$ }# U& K: i
尾翼:
5 V0 D. y' S7 r
" n* ]+ H% o# a7 H" ?
代码:
% D% K T; g `& ~* {3 S
/ n" b: p) W4 G/ b
void CWorld::SetLight( BOOL bLight )
% j" l; }9 @. m" n
durch
, z) O" d3 L, c! f5 R3 \0 k# m: ]8 {
Code:
# ?8 i1 K( N0 E: L: Q6 Y
void CWorld::SetLight( BOOL bLight )
_0 y0 @3 Q* i/ t' }! B
{
, I# q4 Q: J7 o! }7 @; e
//ACE("SetLight %d \n", bLight);
0 }2 G6 r: @1 D" Y- k
6 k G* p# v* _% V8 I! `7 k
#ifndef __WORLDSERVER
" d$ y- K2 r4 X: Q/ N; G1 q
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
, A$ J1 W \ v# F3 j! ]
CLight* pLight = NULL;
3 D1 a7 r8 p# H7 Y, P' T
4 g( Y; u5 K6 d: U. K# i& U) _/ R9 Z6 I
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
0 ~- e, r. h" b7 R
2 W' ]0 g, { I0 P
pLight = GetLight( "direction" );
% K" L: V; m5 N) {' o
7 w8 d$ W8 o$ L; N
#if __VER >= 15 // __BS_CHANGING_ENVIR
; o5 m4 q# N8 C0 B8 ]
if( g_pPlayer ){
- L# A8 y; Q; V. l6 p; z8 h
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
$ L7 L( z8 b6 ?+ ~( O# T. @
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
. }) Y+ d2 x5 x4 L2 L
{
# c; ?: [7 u; n% e
if( pLight )
n; K7 f2 O6 K, G, P
{
7 C& k8 k! p- W4 |
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
/ a8 F# i' ~( N' E3 y
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
# L& c) w. a/ Q7 n/ z
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
( @8 p* l* Z, U0 m& q! h& K3 W
1 x' a' ?% C. ]- B4 O1 e
pLight->Specular.r = 2.0f;
, \# a5 u$ u7 x, A" ^& K V
pLight->Specular.g = 2.0f;
' ^/ u$ C! t4 Q. }% \' Q, ]1 p2 p
pLight->Specular.b = 2.0f;
, G3 d0 ]( X5 U. i- v1 O% w
* I: W8 G v) X" h( g4 k) L' ]9 h
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
6 C& s+ X7 g# _5 @9 @; w
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
1 p0 T4 @# d( T, t. G
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
8 d6 z/ ]! e; O& g
' E2 K- S* i6 \3 [+ J% o
HookUpdateLight( pLight );
) [/ _5 J$ l5 t( P9 n1 [" _. R
9 O2 @" O3 h! A2 Z) u
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
! y3 F4 W8 @- Z/ x
- ~* @1 g- V, K" F, v% a3 W
pLight->Diffuse.r *= 1.2f;
6 r" k& f+ m5 d- K! P+ k" R! c2 z r! N
pLight->Diffuse.g *= 1.2f;
- F" V& b6 Q. B$ Z% a; q7 P+ H, @
pLight->Diffuse.b *= 1.2f;
5 _: u( }$ V: ~
1 b, H1 a; p1 L F l- |3 N
pLight->Ambient.r *= 0.8f;
7 f! K: a$ O7 a3 v! E6 J ~
pLight->Ambient.g *= 0.8f;
r/ {. e2 @1 p3 {( w$ }
pLight->Ambient.b *= 0.8f;
- T u% X- z" J
7 l! P( |- _+ B. O8 O/ h
memcpy( &m_light, pLight, sizeof( m_light ) );
9 Y$ J5 \4 g, `. h- c
* O- @) I: S8 s9 P
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
; g+ ?8 n, q0 i- s" Y# h: ?3 ~
D3DXVec3Normalize(&(vecSun),&(vecSun));
; ]2 e; t" _$ {$ p
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
4 O, B- N) d' V/ K) h; _4 M6 ?4 e
pLight->Appear( m_pd3dDevice, TRUE );
7 o9 w! [2 t- y4 U
2 g# A5 i- c% a, m( `1 s
DWORD dwR, dwG, dwB;
2 v5 L5 q' v, q7 q$ f {' a
dwR = (DWORD)( pLight->Ambient.r * 255 );
: q% V7 ]: s. `+ j" u
dwG = (DWORD)( pLight->Ambient.g * 255 );
6 y. O7 t6 C- Y. l r
dwB = (DWORD)( pLight->Ambient.b * 255 );
: I8 `+ r" F! n. ]2 ?6 }& d
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
6 G( X- C! s7 Q, D
}
' ^/ r7 E" r* M
}
9 Q/ M+ i% P$ K7 @
}
) |! c& A q! M, Q, a# b% A
else
8 \4 G5 q# _1 Q# Y3 r( ?
#endif
4 t& Z2 e: f. U q. I4 E
% y4 P9 |6 G! e3 V% {
if( m_bIsIndoor )
; B5 Q* N+ X8 H0 `; `4 u, c
{
1 V7 a& Y) l! I) o$ C
if( pLight )
7 U5 q# ?9 h- U, m& ?
{
) h: d. Q K3 V2 O7 d
// à??μ oˉè*
+ E- i1 e& W C5 s( [2 ^
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
7 b$ d2 H. Q' h% O/ h6 d
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
4 F, l7 j ]# z0 a6 d4 G; t6 Q
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
, n6 v- P- w( x& y
% x3 m6 }; `1 w- C) o
// oˉè* ??à?
$ ~1 l, g5 z7 f1 ~
pLight->Specular.r = 1.0f;
( s% \- ~: w$ }8 D- i0 Q
pLight->Specular.g = 1.0f;
: @ r( s- w4 H4 G
pLight->Specular.b = 1.0f;
+ ^9 U! S, x. k, c. |( n
// àü?? oˉè*
( U0 e) r O4 ~' m1 r
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
' J! O$ f: x3 X
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
( [& M& \% ]" Q( `( x
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
' _. {+ c& J) `, h! z
# q: r1 X1 l0 j4 J+ B7 Y
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
- T8 @ y5 p, d6 K
{
: @5 s: E6 D7 l) a) l! B5 U, ?
pLight->Diffuse.r *= 0.6f;
2 O& [6 _/ g9 S
pLight->Diffuse.g *= 0.6f;
; O# n6 N& g T! }7 m( y6 _
pLight->Diffuse.b *= 0.6f;
3 H0 @% X: i) S. y5 h: K" h
pLight->Ambient.r *= 0.7f;
8 b. d2 i/ a0 g# w. C
pLight->Ambient.g *= 0.7f;
+ L& B. S2 m; H+ b, v& m
pLight->Ambient.b *= 0.7f;
* G( p7 n5 ?: w& c
}
2 H7 J4 H5 a- i- @; o7 F
/ P* s8 J0 J* g; N6 j+ f
#if __VER >= 15 // __BS_CHANGING_ENVIR
7 w% ?+ c4 t. M+ J9 \1 h4 l
if( g_pPlayer )
/ T' t3 o) N' w" X; G
HookUpdateLight( pLight );
9 j& ~7 g9 t2 Q. T7 G( ^
#endif
) B9 p& U& r' ?7 q1 b$ ~
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
- V" J' y! L$ Q# Q" ~: s
# X& f7 s, A9 I( K+ C
pLight->Diffuse.r += 0.1f;
9 n" c& O7 ?( ~# m4 i0 V
pLight->Diffuse.g += 0.1f;
5 m6 e: @ v$ F7 G( f% \
pLight->Diffuse.b += 0.1f;
" }7 B) o. O" M5 c
// oˉè* ??à?
8 X+ X ^! @3 O+ S
pLight->Specular.r = 2.0f;
& l/ w% g3 X% Y7 X/ @% H
pLight->Specular.g = 2.0f;
% A% h4 n7 U# P. G( ?( }- a
pLight->Specular.b = 2.0f;
# t3 v& H9 h5 }) S& H
// á?oˉ
) V( `8 m4 G1 S9 n. x0 s# O
pLight->Ambient.r *= 0.9f;
/ _9 L R& m7 x7 \. B
pLight->Ambient.g *= 0.9f;
* \% X% I# R! Y5 Z* {
pLight->Ambient.b *= 0.9f;
/ L9 f( S, r* G5 d5 X: K! f' V5 r
. I) u. _3 E$ y5 i9 }0 @4 [
memcpy( &m_light, pLight, sizeof( m_light ) );
0 M3 `4 ~8 d& |6 z. W+ ~+ {0 _2 C1 i
& m& F% c: ~9 j* e
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
/ W( \5 ~( a- b+ ^" p6 V6 ^
pLight->Appear( m_pd3dDevice, TRUE );
: Z/ S. y% X! t" |% Q8 D
; i4 j z1 G$ `7 p
DWORD dwR, dwG, dwB;
$ m; c; c* F; D+ j! ^' V9 k
dwR = (DWORD)( pLight->Ambient.r * 255 );
& ^1 ^( [& K, U* ]& i- {8 L) X
dwG = (DWORD)( pLight->Ambient.g * 255 );
. i7 ~5 u( J8 J* z- [! V
dwB = (DWORD)( pLight->Ambient.b * 255 );
/ l) F+ O ^ U' G/ D
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
2 P# w% z8 g3 ~* T; {$ ` S( }
}
' l: @2 G7 p( e) y2 t2 l0 @
}
8 X8 I% \" K: j
else
- ]( ?# D, e/ q/ B( m; N
{
1 X7 O$ o& R3 E5 u0 C( z
if( pLight )
; Q& y. A9 A4 w9 W$ t
{
# @4 `& u3 @/ {0 N/ u
+ ?5 {' Z( d' Z, h# V
int nHour = 8, nMin = 0;
% F4 v, t* A# k) n7 l
#ifdef __CLIENT
~% e! D( U+ ]+ u- T% O" z. {0 b( ?' j
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
7 N$ r5 X( ^; v. Y6 b
nHour = g_GameTimer.m_nHour;
N8 I. u, Z6 P* K! ]0 R
nMin = g_GameTimer.m_nMin ;
3 t, E' e" J. m2 u) o8 r
#else
" {$ d; k! t$ X/ [( k/ s
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
( W/ B7 d" d# i2 {& ^/ K; y
if( m_nLightType == 1 )
: ^4 p) x! T/ J. D& g- V
nHour = m_nLightHour;
7 z& N/ f9 i* |* H$ @; t
#endif
7 F! C0 O( Y( T+ p2 |% X- ]
nHour--;
+ O \& _* G/ w k
if( nHour < 0 ) nHour = 0;
, f1 f/ ?& X" }
if( nHour > 23 ) nHour = 23;
% B$ \+ z9 ^/ D$ h
! v0 o/ j5 G. T8 t: Y5 y' r5 A
//if( m_bFixedHour )
/ v# s( m( d% J7 ]
// nHour = m_nFixedHour, nMin = 0;
3 j7 c/ f2 a( L9 P4 d
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
/ H% L8 D, q. g- ~
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
) J z4 Z& u1 ?5 h' y5 w9 |
$ u) ^8 d& m) k3 f
//m_lightColor = lightColorPrv;
# @! X0 r- Q; L5 h, V: {1 `% Y6 J
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
8 l& R" C$ F+ Q1 K/ D0 H
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
& {$ u, Z8 ?' s- P6 Q, g
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
/ _5 x) D2 r% o& g( J/ v+ N3 r
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
* [* @, D1 G) d7 F9 }! P* P
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
2 y" K0 W8 S& R, O; ^
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
, S! b, h6 D" B/ {+ A8 w
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
9 t$ d8 F# Q9 A7 y6 ~4 ?
! A3 f- h' Y2 `/ y
// à??μ oˉè*
" s8 j: F; l, d( J
pLight->Diffuse.r = lightColorPrv.r1;
6 ~2 z" D6 D$ H; N1 l: T
pLight->Diffuse.g = lightColorPrv.g1;
6 ]( B+ H7 {8 G# e9 k2 U
pLight->Diffuse.b = lightColorPrv.b1;
1 J& z4 s/ K6 L8 l
// oˉè* ??à?
9 J Y$ d8 y% g; r9 D
pLight->Specular.r = 1.0f;
. ?8 U* g& d0 n+ b) D1 O
pLight->Specular.g = 1.0f;
, S3 g3 a: r6 w' [/ Z/ A; r
pLight->Specular.b = 1.0f;
1 H, H- z v* p! Q8 c, m, j/ @3 O
// àü?? oˉè*
+ m+ Y6 {1 Q, o1 f a' E
pLight->Ambient.r = lightColorPrv.r2;
6 {+ L# p3 Q6 R0 m
pLight->Ambient.g = lightColorPrv.g2;
5 E% |% t/ o. f' e9 E
pLight->Ambient.b = lightColorPrv.b2;
& [( u( f+ G& B$ Z" S. P0 A
' [; j( }# z5 v% E6 Z
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
. N" F1 a4 |- v) V; i/ P" z7 f4 I: G
{
; \! T( G- o5 B6 O! U
pLight->Diffuse.r *= 0.6f;
9 ` C# k$ f g& C7 b% Y
pLight->Diffuse.g *= 0.6f;
% t! Y: |. F7 |
pLight->Diffuse.b *= 0.6f;
3 V& H, L2 g3 o& v3 _* l9 C0 ~5 X! i
pLight->Ambient.r *= 0.7f;
9 Q8 A" [' p/ o
pLight->Ambient.g *= 0.7f;
2 O% Q3 q+ G2 C' C
pLight->Ambient.b *= 0.7f;
7 }, A2 ]4 W9 j# C+ R0 t$ @! }
}
) g3 H$ y7 d) p8 L5 H6 ?; \
5 @* R% N! a; h7 _/ k B( _
#if __VER >= 15 // __BS_CHANGING_ENVIR
& S6 g% D+ q- r. a0 D! [& j% W
if( g_pPlayer )
) G7 E6 M, z7 F$ J
HookUpdateLight( pLight );
' T% o7 p. Y1 K
#endif
# K. ^/ A2 k3 M' J* K6 x$ Y2 u3 q
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
8 `# n6 y k6 a# \) M" l
0 N" U1 L2 s6 @' m
#ifdef __YENV
6 J6 o& Q9 E; l9 ~
pLight->Diffuse.r *= 1.1f;
- }9 G+ a2 U. D5 m8 m
pLight->Diffuse.g *= 1.1f;
3 @' ^ ^% s" i4 N$ W" A/ Q |
pLight->Diffuse.b *= 1.1f;
{3 y/ d/ i* w
// oˉè* ??à?
" ]+ ^9 X" [* N3 T, G! u* g% l
pLight->Specular.r = 2.0f;
% ?( u8 H8 L8 Z) L2 K1 Q
pLight->Specular.g = 2.0f;
1 c* O M3 h! E. S. [& v. A
pLight->Specular.b = 2.0f;
7 V& x, P3 u) L$ N% w7 f2 p
// á?oˉ
# \( U7 {( k# z6 i; N
pLight->Ambient.r *= 1.0f;
0 A/ o1 Q: U4 Q5 ]6 R4 I
pLight->Ambient.g *= 1.0f;
( |1 }' h0 h. v$ L; x& ?& E% c
pLight->Ambient.b *= 1.0f;
& x* V- W5 M8 y) ?. O$ s
#else //__YENV
, Z6 T% Z7 C, X* m/ s1 @* t% g+ ~
pLight->Diffuse.r *= 1.1f;
- ~1 `0 ^6 b7 B
pLight->Diffuse.g *= 1.1f;
0 N7 ?7 E3 f U6 r0 k- k2 ^- C( V
pLight->Diffuse.b *= 1.1f;
: ~( Z0 C" p7 _
// oˉè* ??à?
% m1 C/ N. v! f1 P) B0 k" c6 d
pLight->Specular.r = 2.0f;
% {7 L r" O3 d
pLight->Specular.g = 2.0f;
. n6 m; W+ N2 K" M( w- o0 `
pLight->Specular.b = 2.0f;
. N' y, X# d( j& ~
// á?oˉ
6 g8 e( D: v# l
pLight->Ambient.r *= 0.9f;
7 k" @0 m V; M% P
pLight->Ambient.g *= 0.9f;
2 i4 o% R" ?6 t3 S% C7 l1 V
pLight->Ambient.b *= 0.9f;
* y5 e; j* u6 p
#endif //__YENV
' s1 \4 W9 M+ }4 }/ v! n' @
( Y- \+ d, l3 t
memcpy( &m_light, pLight, sizeof( m_light ) );
0 \# z3 E" F. w4 T! t1 V& U, e8 ^
1 m+ D! b8 b+ t0 d
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
3 c0 z0 c a- l0 {
D3DXMATRIX matTemp;
# U+ V8 V8 t0 s0 p
static const float CONS_VAL = 3.1415926f / 180.f;
% p) s+ C9 s6 T9 U9 S
. s; k2 ]9 C% t' v! K; l1 ]
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
6 z4 @5 E7 r+ H$ u" d# E
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
# l) N! W4 A5 H5 U3 S
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
4 z: m j! j; Z3 t h$ T( x; a
pLight->Appear( m_pd3dDevice, TRUE );
! f- v- |0 Q3 e4 C$ p5 v; ]* Q
( o" S% e0 U% ~4 G
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
- s, V* n; q z0 @3 V
// D3DXVec3Normalize(&(vecSun),&(vecSun));
- Z3 @+ Y5 Y: H2 r4 u
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
0 e ]# ? h; _! P" r- r. Y/ e
5 e; O- f3 A$ m* |( N: b) F* D
DWORD dwR, dwG, dwB;
- O4 ?8 a2 L- M6 Z
dwR = (DWORD)( pLight->Ambient.r * 255 );
7 P) g2 J2 w* W& |/ b: F9 T
dwG = (DWORD)( pLight->Ambient.g * 255 );
& U5 q/ }+ s% {; ^- r
dwB = (DWORD)( pLight->Ambient.b * 255 );
2 o. `/ w* A3 W% T- @2 ^* o
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
/ d2 a* f5 }+ c9 w
}
) ?- r% `7 y& m& X4 }9 |- k
}
7 X2 ^& @; ^% |) _9 h g
8 `' L; q: E) w2 f
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
5 {7 k) t6 k, |9 k+ X5 J5 l
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) );
7 c" }# w+ z/ G' V- o/ j% l
::SetLight( bLight );
( U, a; {. T, X; K
, K( `& `2 ^( c4 \+ I
// ±ao? ?D?í???ó á¤à?
$ s, m, O4 F. J1 D- \
m_pd3dDevice->SetMaterial( &m_baseMaterial );
8 _" e* f* |7 ^; V! w+ m; i
$ w- V$ v4 H6 F3 z4 v
#endif // not WORLDSERVER
/ e/ z2 X& J7 N: M# s: a- H
}
( B- ?: |: O" u, W
并更换
% q# r; J$ N0 @1 R
Code:
& r+ B$ Z& R# T' D" c
__FLYFF_INITPAGE_EXT
1 W0 W! h" F6 g' R# _
定义
) n3 f5 K+ `! _
. u/ a) w' z5 f
8 H; c! ?8 c( b) q' D$ h, e
4 f9 t Z; u2 u3 S
8 M, Q- X6 \; L+ B9 `
现在终于删除我的狗屁加速...
J `0 t/ v9 ]7 W, h
3 V/ L0 `1 V& E0 X( u l" Y
0 E1 c% @& w, z
2 C& Q! ?% G6 G) c8 K) T
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2