飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
9 a# F( |9 d$ e. T
尾翼:
5 ?: g a* @/ s
/ ~# }0 w- q- ^- Z1 R
代码:
' d, Q3 B+ L0 F) T
CWndAutoFood::CWndAutoFood()
% Z4 m9 n" O" ^6 O
{
! x; P1 C) x4 s
m_pItemElem = NULL;
, {" B4 j; f* u2 E: _, L) q
m_pTexture = NULL;
( T& q( ^& \$ [8 K6 x& H% C% B! ~
bStart = FALSE;
! R+ k% y7 L, A
}
- p# X$ J2 h$ S6 e) \
4 L, Z$ L/ [% M
CWndAutoFood::~CWndAutoFood()
' F/ ?, o# E# `+ ?4 Y
{
' {* ^7 S3 C# y) ~( D
AfxMessageBox( "AutoFood ist gestorben
" );
4 e3 M3 ~$ N4 b- N+ m1 `1 P
}
) {8 c E5 [! w/ x
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
' G; H5 U7 a; {6 f: M j
{
& E2 r2 K3 U: O
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
0 p' l1 K, q2 C
}
- j" {1 D8 M' {0 z2 U
) ]. l) d7 V; r5 j8 u* j5 o. z# B
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
6 c Z; G8 o7 h0 U# L
{
! z% x: E/ l4 ?1 Y; K0 K
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
, K- m& T* _( s; F
CRect rect = pWndCtrl->rect;
- n& w$ v; T' g7 j+ v, m$ l
if( rect && rect.PtInRect( point ) )
% n# U. X0 W3 ~% Y' g5 X
{
" L: v# k* i' T4 q$ v( S4 f/ b' u
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
, ]$ b; q# I$ y1 r$ k# H% \" S+ S* h
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
* J& t: F5 K# C
{
, _# l( x' R7 i6 S7 |3 @
if( m_pItemElem )
6 p6 {& G4 L* x5 T. p
{
% |' S& s5 \: A. d( Q* ~5 `9 R3 i+ h
m_pItemElem = NULL;
* V( M8 c* C" v( O, n. B# Q x
}
@0 N4 V0 f2 H, v; E
m_pItemElem = pItemElem;
$ k) {, O7 g! K* q+ `- Y" M' W
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
- `1 g1 T0 L7 c. w" P
}else{
1 P* v: x: t5 X- Q j; T' B
SetForbid( TRUE );
( D' Q, h! ?# C' e0 t
}
: b, Z: k1 Y" X, c: Y( e. b4 g
}else{
1 M) _! n& x1 ^/ Q$ C6 W
SetForbid( TRUE );
0 I8 J+ p/ L2 c6 o. F5 |
}
3 W% _9 o" d5 D( I8 k0 _
return TRUE;
" h. E9 a! W) x7 i8 h- b
}
0 e0 [, e3 G* W
+ d1 U7 i& A; @5 z; m
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
9 D( w/ ~4 u* t6 w1 S2 z J8 q
{
) ]2 U* R2 J3 _" I/ V: U0 j& |
switch( nID )
( E# S9 U, ?1 v( B( ?4 r# K
{
9 U2 x0 ], ~6 [! ~
case WIDC_BUTTON3:
3 N D6 _' z2 S$ G% S
{
! V B) s( l: s" @& Z( P# j: L% Z
bStart = TRUE;
y& H4 X. {, h0 j. Y7 N
break;
! b5 Y# ]* |% r [. I# D
}
" n, S" ]" O; d* x0 s$ n
case WIDC_BUTTON4:
1 t1 U. n# \3 O- t( E: Y: d; t3 P
{
2 x$ u% D9 ?6 g9 Z: c' ~) M; b
bStart = FALSE;
9 @# x: {# C9 F/ Y) o
break;
1 V" y. G7 I5 ~% H5 y% X: d3 ?
}
0 P: \# C: O7 s7 z
}
( b- q; F/ s1 |. l, t
return CWndNeuz::OnChildNotify( message, nID, pLResult );
6 g. ~6 \0 r. ^; `( G& R" f
}
% j1 T' T( B0 W t: e g A! p
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
9 P% D# T: q* Y" ^$ Y4 ~
{
7 g$ V. J% [0 k( W* X: W' m
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
# @& G- G; S1 r4 r8 b, I
if( bStart || !m_pItemElem )
0 {% f9 N9 c! P! m
{
* a5 \! l/ `+ k" F1 J- H
pBtn->EnableWindow( FALSE );
2 G t* g$ Z$ L. t9 `+ i! P1 L7 w2 j
}else
" @2 X. k9 S4 ~
pBtn->EnableWindow( TRUE );
! @0 m# R6 A$ k" V7 }. k5 ]
if( m_pTexture )
0 e5 Y! Q" ^' K
{
' d* L( [ O" E
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
, ^& R7 j. A% G' \5 y1 e& {
if( wndCtrl && wndCtrl->rect )
' o" u$ S; U. I+ q
{
5 [: B# N" p- P
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
! Y' M! W$ Q/ O. A/ {
}
C1 v3 E* O, k8 {+ V T
}
8 u. R3 N3 U2 |6 c a
}
8 f* Q% n- Z0 w7 m/ y3 Z7 P
( }9 q4 r; R- A6 r# G; ]* m
BOOL CWndAutoFood:
rocess()
. |( f' q0 @1 p& Z: \$ T
{
% b9 `2 S, L: K, u' J
if( bStart )
0 K' c. [& b ~: Q1 S0 A0 h
{
2 K, m# ^; {/ }% |6 d- A
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
7 d, U) h- g2 m- F
{
; ~' J+ u, t# ?# T% l2 R8 w, 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() )
( r. c2 N, w2 o) Z
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
) H# {! K- f$ s0 |4 B
}else{
8 v0 d+ U( h5 O. i% r7 ~
bStart = FALSE;
! q8 ~( U9 l& A8 Y- z5 ^. W
m_pItemElem = NULL;
8 v! p& r* t* Z/ ^8 J" t
}
8 ~; E `% ?+ f1 M
}
o2 ~. x% \% u! c# Q
return TRUE;
' B2 k8 @6 \% X8 i% u; y2 o
}
' D7 g8 q/ u. x6 @7 T B, |+ j
+ B; T+ F! f/ t+ g
登录视频废话:
7 r5 I: I* B' D* \0 g
尾翼:
M# c' `' c/ s& V9 [
8 _: P# F9 Z: o" a
代码:
' m; j- _; f# C
- b; ?9 ~0 F6 E+ p
void CWorld::SetLight( BOOL bLight )
8 ~3 ]* O/ \. q
durch
* M8 ] B8 B& \1 _
Code:
. r# q8 w y- J
void CWorld::SetLight( BOOL bLight )
, W9 f! T: k: K9 _' I/ G3 [. _5 }" @
{
3 L! M+ Q$ I9 \; v0 b8 |
//ACE("SetLight %d \n", bLight);
( B6 }. Z, J# T( a7 m
7 P) m: q" m4 p5 z( k) Z
#ifndef __WORLDSERVER
5 L! l( B9 N: p$ R- P; p
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
" u7 ?2 S9 L# Z y9 ]. o
CLight* pLight = NULL;
5 b0 v; K$ c; {, P% T3 U8 L8 E8 T
0 o* _0 b3 a# @# O
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
, _ M8 t/ p# T+ N: M- ]' K4 `
# q! \5 A7 ~- e$ N' F; O3 e- }+ i
pLight = GetLight( "direction" );
3 i, F& g8 o# ^3 q
9 Z" |8 r4 d6 B! D- {
#if __VER >= 15 // __BS_CHANGING_ENVIR
6 L1 h b9 p; u0 y; N
if( g_pPlayer ){
( @. P! S3 ~8 J
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
) [' t5 v: g! E6 C- \) l: g
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
( q; \9 V' n' R+ X
{
: C8 p) D. p! X! B( ^
if( pLight )
0 {* V2 c. i5 J3 Q9 R5 ?% B
{
$ @/ Y" G; Z1 x( P8 U
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
- }4 i9 {1 j+ F7 e& ]6 d& v
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
. Z' U2 o2 I; i7 o2 J& C8 Y, v
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
+ U0 q$ `- B5 `3 T
# z+ Y& v' f( |. t* s8 u( Z) Z
pLight->Specular.r = 2.0f;
) S3 U) V. V ~. }$ M5 g
pLight->Specular.g = 2.0f;
3 s0 L; b/ L3 S+ V6 O h# M
pLight->Specular.b = 2.0f;
" X. m+ Q% o1 d% ]$ V$ J
- {* C/ M( }8 E1 K4 R
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
5 ^% P) F1 A0 o( I; K% k1 N6 O
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
) }( e5 g3 _1 f
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
- I0 [ r6 S- L) f6 m
5 g$ W. Z, b0 Q/ C H" h6 j
HookUpdateLight( pLight );
/ f z+ @0 R8 B0 ]# K
: x+ {. b* l& N- V5 L
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
8 o# v# H# b, g9 j: I: ]
9 {' [3 D- `8 n
pLight->Diffuse.r *= 1.2f;
3 h0 I) p! s9 @% t+ X; y: J* H
pLight->Diffuse.g *= 1.2f;
3 `8 F3 N& e$ {
pLight->Diffuse.b *= 1.2f;
1 ^1 b% G) ~/ [: M3 y2 L5 T
) n' k1 A% B/ t9 |! |
pLight->Ambient.r *= 0.8f;
0 K/ o* i, [; f
pLight->Ambient.g *= 0.8f;
6 b& ]4 u: \- R0 U: j- O
pLight->Ambient.b *= 0.8f;
, v+ O+ p$ ~" v2 H4 v
2 X+ T. B9 J+ b) o; ]& A0 C" O
memcpy( &m_light, pLight, sizeof( m_light ) );
/ B! p1 I3 }* F3 r" t6 d
/ V& L1 q9 I- N& R+ D/ V
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
5 f) y: Z% Z& ~2 h3 @
D3DXVec3Normalize(&(vecSun),&(vecSun));
s+ K/ e/ s8 L
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
# Z& l5 d! R' f
pLight->Appear( m_pd3dDevice, TRUE );
* e0 K0 i0 P- {3 ?- ] a9 a* w$ c
: N0 k8 a" c1 k" _6 _4 M. {5 f
DWORD dwR, dwG, dwB;
! J4 X# h5 O% \
dwR = (DWORD)( pLight->Ambient.r * 255 );
' O6 ~+ P4 F$ a' t1 W8 I6 K+ v2 h: D
dwG = (DWORD)( pLight->Ambient.g * 255 );
) T4 P) O- N0 n9 I1 M( q
dwB = (DWORD)( pLight->Ambient.b * 255 );
& J( }; S/ `5 q7 }) U' b: q
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
/ t, Q- i) x+ W
}
+ w3 Q: |* Q9 E4 ^% O/ ]4 s
}
% F$ E+ D; E f- C. I
}
2 P( x0 @) M |2 C/ q" h3 K
else
: z. @8 C) Z. Y- R6 A1 N( Q( t
#endif
2 C+ N. N7 ^+ D# [
8 V; F9 q1 v. ]$ u/ b
if( m_bIsIndoor )
9 P8 n. K; E9 G# g' m( W8 f' N6 {- x
{
. u, d4 w9 W0 _7 l7 N7 B K
if( pLight )
* f* d" q7 J1 U9 Q0 N0 Z
{
' ?: A7 N/ w! |' G$ Z
// à??μ oˉè*
U) A4 C( D4 W7 Z" g6 d' D
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
# E: _. q$ m. X2 p- M: O
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
0 P1 _! S$ ^7 `0 h* t+ M
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
; g& W0 t& z) }# ]9 _
* C1 }8 r) }* ^+ [4 H
// oˉè* ??à?
. K5 I7 Q8 e: l. t
pLight->Specular.r = 1.0f;
' q% F0 x( I! k7 F, ?
pLight->Specular.g = 1.0f;
/ `+ L3 K0 y. |8 Z
pLight->Specular.b = 1.0f;
% K: {) M J$ A' V$ i
// àü?? oˉè*
. y& L: K# c% G5 q# @) i
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
8 b2 U; r# I0 E, n3 |8 \: h
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
: H5 U M1 s% A7 y7 \2 ?
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
3 k6 f3 j+ m3 }3 I4 l: l. J* ~
6 g$ W' t# J+ k# E
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
/ a) @" v3 v4 n6 E2 e1 U& ]+ a
{
. g/ u) t+ ]3 V9 D
pLight->Diffuse.r *= 0.6f;
- i' ^, r6 K- N
pLight->Diffuse.g *= 0.6f;
0 ~9 D( f4 j z' D; T3 V
pLight->Diffuse.b *= 0.6f;
0 N1 _4 t4 U: [: m6 i
pLight->Ambient.r *= 0.7f;
1 D' S' M8 v6 B0 a# [ O
pLight->Ambient.g *= 0.7f;
$ _5 }$ S. T- v# g! Q$ Z
pLight->Ambient.b *= 0.7f;
' Y, `& l, f/ [7 ]# C4 ]
}
0 l5 t& n- N0 s/ W3 ?
, m* r, N( a. t4 Q7 t
#if __VER >= 15 // __BS_CHANGING_ENVIR
: f' s0 F. Y# {7 r. d
if( g_pPlayer )
; s, O; m( N! t4 q
HookUpdateLight( pLight );
! i* V5 O0 ~4 h! k/ L
#endif
) q6 f# P+ r7 e: V* ]
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
6 x' E! n3 b1 Z% J( h0 J
T- I s4 b$ X7 n$ e1 O) b
pLight->Diffuse.r += 0.1f;
, ~& b3 |) @' X
pLight->Diffuse.g += 0.1f;
! V2 a% n8 ?& R% h( W
pLight->Diffuse.b += 0.1f;
& Q6 r% n1 b+ f! E" r) M! ~$ O
// oˉè* ??à?
# s. Q- _6 c" |( |) Q9 v- I# d
pLight->Specular.r = 2.0f;
I6 P/ ?9 a0 R1 Z# L
pLight->Specular.g = 2.0f;
/ ^0 B* A$ y1 _' c5 m' y2 k
pLight->Specular.b = 2.0f;
2 _7 m8 J! a* b
// á?oˉ
% m' o% m. l3 `4 P$ U$ T
pLight->Ambient.r *= 0.9f;
5 j6 Y1 h6 g. U7 P+ a+ _
pLight->Ambient.g *= 0.9f;
# |% q& w7 e7 Z$ s4 R) ^
pLight->Ambient.b *= 0.9f;
" p) C1 V: q7 n, L( U
% f3 x3 r* ~2 C, W* X8 ~1 w3 ]
memcpy( &m_light, pLight, sizeof( m_light ) );
) D3 ~6 V+ y* f- y
1 N# H+ p" x- c
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
G* ]6 r' T% S" w% {
pLight->Appear( m_pd3dDevice, TRUE );
( o5 S- ]! l4 V, ?$ t
* u7 t2 \3 w0 x7 }# _) `
DWORD dwR, dwG, dwB;
; ^, m8 O, w* B" u
dwR = (DWORD)( pLight->Ambient.r * 255 );
- r/ u. V) F8 X1 q
dwG = (DWORD)( pLight->Ambient.g * 255 );
6 {9 B+ X% {% ~- f5 D+ b# u
dwB = (DWORD)( pLight->Ambient.b * 255 );
- y0 q" q7 o, A7 S/ k7 R
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
: h; V0 ?* K2 A% q
}
/ J; ^6 h* I+ N9 s. ]; R
}
% B" U; ^5 P' r% c- V* K
else
7 |9 Y4 t* I# \5 z* C6 ? C
{
: {8 G" _! T, j' c
if( pLight )
5 c# |2 c$ n# T( h- m
{
' M1 q* f9 o0 D7 V- z3 {$ l
: T6 _4 g$ b% p0 ?$ o' S: f
int nHour = 8, nMin = 0;
% b+ f$ ^" q5 w/ O2 C0 F8 {0 H
#ifdef __CLIENT
8 K8 Q- x6 u' L$ ]' x5 `3 L
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
; d, z- h2 ]7 M1 N, d- m% ?3 w2 I' O
nHour = g_GameTimer.m_nHour;
* X: @$ l% n) D. H
nMin = g_GameTimer.m_nMin ;
! i$ _/ O" J/ ?) a' _4 c; N' q
#else
* M( K! u. B4 y& J, }
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
2 X0 ^) H$ f3 A
if( m_nLightType == 1 )
1 d5 j5 t' Z& a: f/ t# c
nHour = m_nLightHour;
4 y/ j# M( s+ @! o) u
#endif
& u2 m7 N7 F, g4 _% y% O# I: [
nHour--;
' W* _, V0 f: O9 ^* x
if( nHour < 0 ) nHour = 0;
* y2 j$ Q: O) M5 c+ v5 |
if( nHour > 23 ) nHour = 23;
; F( f3 e% u9 Q+ `0 f
3 K; D7 y" y7 C3 g5 G( t
//if( m_bFixedHour )
' l5 o* k0 f3 \: O0 r
// nHour = m_nFixedHour, nMin = 0;
* b9 U4 o5 q- q2 G/ r
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
* X7 w- Z2 }" H
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
$ e4 W# H1 g5 f( M: q- @4 [* P- @
9 p. z b' Y6 d1 v( i
//m_lightColor = lightColorPrv;
$ \# K( i+ V$ p' b1 a ^- E
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
" @5 u( t3 O' O" N2 ~" h7 n
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
% e* `0 @. V! Q) h" ^
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
$ [7 g# m; }+ Y% K. }
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
@; d& c9 G3 g! D/ V( t) I
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
; w: Q& i3 g9 |* k! \' ~6 k
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
T: w. u8 ]: a4 ^8 Q6 K9 r
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
7 i5 T. o, r( C/ h: i
. ]( }3 Y2 U! e' X6 |
// à??μ oˉè*
2 i. V# h0 }' x0 z, P7 e, ^
pLight->Diffuse.r = lightColorPrv.r1;
0 I2 R% i9 n* `4 ^
pLight->Diffuse.g = lightColorPrv.g1;
N! [3 d$ k# d3 T6 g
pLight->Diffuse.b = lightColorPrv.b1;
0 t3 h2 ~' b( F/ E
// oˉè* ??à?
# Z+ N5 k$ s1 n7 W
pLight->Specular.r = 1.0f;
2 V$ }2 D$ o+ f& D% _; c- l; n" e& r
pLight->Specular.g = 1.0f;
2 D4 o& q2 \& i4 c) P& d2 a
pLight->Specular.b = 1.0f;
5 s' w4 M. Q/ J
// àü?? oˉè*
: Y& x1 H. T/ B4 H7 _' O; K( G6 J
pLight->Ambient.r = lightColorPrv.r2;
% ^' f0 A/ T! g) @7 Y/ k3 s2 A
pLight->Ambient.g = lightColorPrv.g2;
; _* y6 c' S& k% O N
pLight->Ambient.b = lightColorPrv.b2;
. C7 D, @) @: N8 J
/ l5 v0 `7 Z3 B S
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
; J+ n$ d4 l, z: i
{
, J5 Z% z6 ? R1 |, B1 }
pLight->Diffuse.r *= 0.6f;
* I; K3 q2 M& U. K) {
pLight->Diffuse.g *= 0.6f;
9 u: L; @1 R# F# ^/ [" Y
pLight->Diffuse.b *= 0.6f;
' {2 R4 R" u" F# f
pLight->Ambient.r *= 0.7f;
9 A: D0 c( u( O. t! _; ?/ `
pLight->Ambient.g *= 0.7f;
# @/ h, ]+ ~2 `
pLight->Ambient.b *= 0.7f;
$ a' R1 h0 V; R: ~! w" Y
}
, _- c# t7 M$ g' _7 o9 q9 A- T. ^
1 @% C+ r5 b6 n/ J. |* X8 W$ O
#if __VER >= 15 // __BS_CHANGING_ENVIR
3 U# H3 a; O& P; a) g
if( g_pPlayer )
: ]. k2 [0 `; G! y
HookUpdateLight( pLight );
+ t6 d0 C. B" H) x% |
#endif
# f' b* ]' f! j% x1 Z4 o
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
( U9 Y$ c; K3 M* ^
. T( H, y" v+ |5 o1 ]0 i
#ifdef __YENV
& v9 P7 ^9 }+ H1 x9 j8 b
pLight->Diffuse.r *= 1.1f;
2 k+ a5 {! ~8 t4 D4 F0 o0 G
pLight->Diffuse.g *= 1.1f;
& H" k% E4 d2 d" L0 a: O4 g% n! ~, }
pLight->Diffuse.b *= 1.1f;
7 H8 ?1 q6 z: R
// oˉè* ??à?
0 P6 ` m! p1 g3 k
pLight->Specular.r = 2.0f;
3 N8 g+ f3 j! X( C" H0 u$ p: V7 S
pLight->Specular.g = 2.0f;
$ X( s. w J ?. E o/ _3 `
pLight->Specular.b = 2.0f;
8 d+ ^/ m# y) Y) ]7 }
// á?oˉ
; h6 t( _4 b& e0 m0 w% I) ~" @
pLight->Ambient.r *= 1.0f;
, l4 z! c+ z% C. g3 K5 v
pLight->Ambient.g *= 1.0f;
1 | R6 j e5 d! p+ }3 C
pLight->Ambient.b *= 1.0f;
, q4 f! q4 P# }+ M4 ?
#else //__YENV
* p* k; ?) Z8 Y; [: E2 l( @5 i
pLight->Diffuse.r *= 1.1f;
$ f3 h+ v+ M; R" j
pLight->Diffuse.g *= 1.1f;
8 P: c: q1 K, K* R6 I2 w1 s% ^/ `# H
pLight->Diffuse.b *= 1.1f;
G6 X* K+ U6 @, H
// oˉè* ??à?
, K7 d4 N4 C2 t* v( X- @6 W
pLight->Specular.r = 2.0f;
* f" h+ y2 V. z- c6 T1 R j% q5 Q
pLight->Specular.g = 2.0f;
1 W; _$ a8 I1 y# Y
pLight->Specular.b = 2.0f;
* T* V/ d- a9 K4 o/ c
// á?oˉ
% t' M U2 y$ F$ _3 {( Q
pLight->Ambient.r *= 0.9f;
* q- ]1 r; L& v& ]7 f2 h
pLight->Ambient.g *= 0.9f;
6 ~+ F4 v. r9 _. ^& @3 x" P
pLight->Ambient.b *= 0.9f;
P2 A# K; p" j8 o" Q$ V1 \
#endif //__YENV
) {- Y! y! n" M
+ a& v6 ]6 R' N C/ w
memcpy( &m_light, pLight, sizeof( m_light ) );
7 Q; T: ]* x3 d' ~6 u
2 c; \7 ^6 o6 ]- o' x0 g- E( ]- w
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
2 F+ Q/ j* h% J: D1 G0 @
D3DXMATRIX matTemp;
/ R/ J; L, A3 D X3 |3 T/ K
static const float CONS_VAL = 3.1415926f / 180.f;
# e) R; l4 p+ V6 H3 A1 W# W) i
2 o7 ]- D- ~! S+ l3 s
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
- M: [! Y) }0 A
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
) q! H& L, n' g$ i
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
+ n# l, t" n- _) N& _; C
pLight->Appear( m_pd3dDevice, TRUE );
9 [+ M# ]- b9 G6 ], c5 ^! d: ?! S4 d
3 f7 G7 m% V& d& s$ w. f* n; p; I
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
0 u7 m% q6 i. q7 J
// D3DXVec3Normalize(&(vecSun),&(vecSun));
w/ A. g5 p8 |0 J
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
' a# P2 \' |: e
- E8 M" O! W1 V# H1 Z$ x$ @. H
DWORD dwR, dwG, dwB;
6 h, C0 B1 O/ y x% B' m. P. i$ ?% I7 S
dwR = (DWORD)( pLight->Ambient.r * 255 );
- q$ _* E" C5 M1 V6 h) N
dwG = (DWORD)( pLight->Ambient.g * 255 );
) e2 T" V: G+ m1 Z9 S" W" k% C
dwB = (DWORD)( pLight->Ambient.b * 255 );
8 s! n" ]: s. u
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
% G. c# y+ K6 N" a
}
- s N! ?0 Q: [- o
}
* Z1 ~' ]/ ^3 ^' ?8 ^1 A- j; @; |& q
: o2 g0 @( N: c9 w1 q
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
, i& ^+ _5 L7 W& 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) );
, ]0 B. m0 d+ }) K. z2 `
::SetLight( bLight );
: V) D# r2 K7 @" w( m
( V6 ]$ w; \4 F6 T- M
// ±ao? ?D?í???ó á¤à?
6 G% T7 }$ A4 A& `2 b
m_pd3dDevice->SetMaterial( &m_baseMaterial );
0 m* N6 n, n5 O7 Y* ~
9 F1 V( \% _' a( t' r! x( \
#endif // not WORLDSERVER
. f1 X8 r2 U; o! T( i! @
}
( k3 h; [" v! }1 J4 d+ }6 i7 i
并更换
+ C/ d; t/ J7 m2 j7 I7 [1 Q$ e
Code:
; b& R) c% W3 p3 l$ h
__FLYFF_INITPAGE_EXT
) M' l0 W# S1 @+ j
定义
5 K9 m2 B( X% W/ G" e
/ I+ j1 I+ m3 _( C& D" g3 I4 [
& Z1 T2 M, p" h3 \# Q5 o
5 A( B/ z- r) C( ]
' N# p6 z/ M: d9 G7 T l/ e
现在终于删除我的狗屁加速...
G# @0 v" m" g$ C0 F$ R
" N+ j6 W4 H. M4 w" B' u( g
8 U- k# ?0 N( F+ f1 Z0 L" z
( w! c* n) W% |6 U; r5 L# w$ A8 q7 _8 _
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2