飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
7 A) v+ h* c2 S0 P1 E5 `
尾翼:
% W- y. V. `5 {7 ~- e" B
+ k; _6 U/ O' `& b: H
代码:
( m) Z+ W4 K. q, Y
CWndAutoFood::CWndAutoFood()
; n1 }2 i m" h: R$ p8 @
{
* g6 Z. a$ Y- |, k% ^
m_pItemElem = NULL;
9 r1 x$ V3 Z( t. z! K" |
m_pTexture = NULL;
& v! K1 G. i2 w' I. ~) X y
bStart = FALSE;
% p+ L" r9 _6 P3 l- M, j
}
T3 s; d0 d- i5 P% I" C# _
- ]1 ^+ Q/ v% x6 L2 F( ~
CWndAutoFood::~CWndAutoFood()
% f6 t0 x" h# D4 s0 {
{
5 L$ L/ ], E" y# Y- \$ w0 N
AfxMessageBox( "AutoFood ist gestorben
" );
- g2 n4 y. ~. c2 N( e# J1 ~
}
- F% T5 z" w+ o3 x7 s! Q
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
/ F! L0 ~5 X R$ G- f5 U; [
{
$ F" n4 w7 A4 [6 W7 p6 q
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
9 M* ?) e- r* E$ u' x& Q
}
- N5 v1 N2 h% `' ~' V
/ Y- w2 y9 s1 T& L$ Q6 q
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
, r) v( k6 W& k5 |! M. X
{
; u; {5 Z0 |; Q* W; C
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
- M5 _& N# @1 c6 k) j
CRect rect = pWndCtrl->rect;
! R) y. j' u. a. w
if( rect && rect.PtInRect( point ) )
3 m, g$ F& m' R( x- {/ x& J
{
/ c6 [( C1 g) I& }$ i4 A
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
4 @( `5 t' g% l+ O( t S; @2 D& D$ q
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
) R' q0 j6 k' ?% @, S# ^
{
, v$ b0 {# K. O. x- K
if( m_pItemElem )
% _& `7 Y- S# q& G# H7 k% K3 c
{
/ c( ?6 c! K, }9 ^; x
m_pItemElem = NULL;
( ]* y/ o8 `- h7 ^: x( U8 |
}
& \% n W' \ K+ D! U% A) R3 _
m_pItemElem = pItemElem;
: \& q2 H/ b# Z: H
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
7 O/ F" I* T, u
}else{
- C. m5 m" n9 L6 L7 x" s5 x
SetForbid( TRUE );
4 J. _/ u4 f% `0 O% D( i4 m: W6 L' y; E
}
# U% `1 i) u' b, X9 Y
}else{
2 m7 t+ x# W$ s/ d
SetForbid( TRUE );
. h5 a* E2 u9 s: k
}
, s* j4 S( j6 f1 i$ {# ?, W: H
return TRUE;
- b# J+ o4 v$ |- m
}
; l1 o& n- a, N: z: y9 {. s
6 x' _5 ]; F# Q6 r2 N
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
- F5 \. O& `* U7 L
{
" d8 y. r3 h0 r4 v1 Z, q& f7 [/ I
switch( nID )
% u3 c* n# `$ C M! C
{
0 @: j$ m' a/ |; e+ w+ p
case WIDC_BUTTON3:
4 Q. I+ u, E0 A: n
{
4 V. i( n) O' b p0 j# r
bStart = TRUE;
* G& [+ G1 H2 ] b b3 K, B
break;
; A, t* E1 r3 V
}
, y. n! c4 f% D4 `0 o
case WIDC_BUTTON4:
- b5 g# n9 c3 K! c* k8 [& h
{
& z: m% ^% Q5 }- N3 n7 [/ X
bStart = FALSE;
& e# L; o! q4 j
break;
2 u) X$ `, v1 Y- R
}
# b, k! I1 P. \$ I! Z
}
2 K1 v9 t6 f& }' t6 i5 @
return CWndNeuz::OnChildNotify( message, nID, pLResult );
. s3 r7 i$ S* v. A9 ?. X
}
3 }& j g& [, W R, f
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
/ }, p$ L' V: q/ }2 d2 ^
{
0 S$ P- P g0 c) j+ b9 A4 L9 J1 e
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
$ p$ g7 X7 k! x6 v& D7 O( z
if( bStart || !m_pItemElem )
& s) d# j( d' R; |4 y5 O0 g3 u
{
K7 P, Y$ `0 {5 D% j
pBtn->EnableWindow( FALSE );
% q0 l6 h; U1 G, w( q, ]
}else
4 i6 A- p0 c) u+ B
pBtn->EnableWindow( TRUE );
/ j, N& B7 R6 x7 g, X# Q
if( m_pTexture )
: Z% c9 g, ]+ s& w- ~
{
! ^) W5 Q6 p: i, H3 f: J0 |+ |
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
$ i5 r$ C9 G( S8 o1 y5 `
if( wndCtrl && wndCtrl->rect )
. y( Q3 W K8 ^% `: H
{
7 |0 a% b; t1 O9 O
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
4 J( A% i+ e0 p- ]
}
& E2 [( s9 k+ X* v
}
/ J) V" o% A4 s4 p
}
: V; }6 ?! [( U9 n& C) }& Z
i0 f4 j$ W. }
BOOL CWndAutoFood:
rocess()
. ?- p( h7 R; \0 J$ h
{
# A1 e. Y3 U; A" S5 q& g; @& |! M
if( bStart )
: J" Y. _* y- g; v* w
{
) a, ^( q i9 [0 b) x/ m
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
U# Y# g" k4 G
{
3 N( c" q6 O, F+ _" M
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
' `9 Y2 i+ G7 B4 p% \* W
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
4 S0 A$ ]; x$ W. S2 I f
}else{
+ c' H: i ?$ w) v: |9 C
bStart = FALSE;
1 V. e9 } V" w" d( w: F4 n( X
m_pItemElem = NULL;
' _) k- M! V( S) i* k. P n
}
5 Y g% U3 J- x
}
1 `' u2 T! m+ v7 ]& W
return TRUE;
e* P9 n J+ e5 C
}
0 h7 Q4 t5 B: o$ o7 a5 Y9 x
# e* `1 Y, `8 o' }& h6 q% @
登录视频废话:
' J: N. u7 j! F2 h% T$ k. i
尾翼:
& `9 `- g7 S* x6 p
5 G: s H5 e: P) ?9 \: [
代码:
+ C8 v5 x, l- E$ H
K- u0 ~- E: l
void CWorld::SetLight( BOOL bLight )
# `) ~; O, T# R; t. C6 |
durch
" i( V5 m9 R! W# M0 k$ U
Code:
4 f; U& Z) R2 W
void CWorld::SetLight( BOOL bLight )
9 n! z, `- p: y) q; C! m5 t/ Z6 w
{
- l3 l' \. O4 w! x7 g
//ACE("SetLight %d \n", bLight);
: T5 x# O1 z$ j0 }# `
/ y6 Z: Y) {: o1 Q. x
#ifndef __WORLDSERVER
& a" [3 o1 \$ H% i" H! @" B
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
3 P1 b& }2 e) m& h# h7 {& v
CLight* pLight = NULL;
" o* d- s0 `6 l; H1 G
" _: b7 }8 ~# ], ]
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
4 l. Q0 h6 u/ n( k. L3 g* V" l
2 n. @" l/ ]# ^! R& T
pLight = GetLight( "direction" );
. `8 T( K9 M7 n7 R) K
$ D+ t& y4 k G" r
#if __VER >= 15 // __BS_CHANGING_ENVIR
- f* `& b$ `2 E5 [
if( g_pPlayer ){
U$ d! }; {5 N* q& G, X2 G5 |
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
( {7 |" A4 o7 l5 k7 q2 K8 a. F
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
# c0 I' B6 f5 D3 p- p7 T
{
! o0 i# k. h/ G) Y
if( pLight )
7 u1 { P! Y- z/ H
{
$ B3 z; O" z5 `: A- q' m
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
# b& ^) {# V1 ^8 `+ ^2 f0 h
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
3 H* |6 [$ h2 i
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
) {8 }$ F3 K: c: O* ~
: u9 p" I, Y% y- Z5 l; D. [
pLight->Specular.r = 2.0f;
2 W4 W; E* c% k5 ^& h' b* J2 q
pLight->Specular.g = 2.0f;
3 D+ L; ?! [7 r4 P% e8 `1 e
pLight->Specular.b = 2.0f;
b( J( m6 f! {2 I
% l! q; u# r$ s, M
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
4 }8 e4 X' w8 T6 O( x" Q+ Q
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
" j: ^+ @- z9 |8 I( E
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
9 _ _( x1 S& W6 X0 t* p- j9 `
5 k/ d* t; F5 e0 S5 {
HookUpdateLight( pLight );
8 o6 P+ i* ~0 c
( b) q! H! t4 k3 ]
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
1 C$ u, B9 }( ~# q7 `, ~! N3 G
- B, B1 z% X* ^# @
pLight->Diffuse.r *= 1.2f;
8 p; }/ n* j4 X# ]) `
pLight->Diffuse.g *= 1.2f;
5 K0 U2 }+ ?4 R2 [
pLight->Diffuse.b *= 1.2f;
* [( K+ i/ Q* R: A$ M% j
& j; Z2 S! B3 n) q. x
pLight->Ambient.r *= 0.8f;
1 w/ I. R4 O! `8 o
pLight->Ambient.g *= 0.8f;
8 q7 p O" A0 v8 N. ? D P
pLight->Ambient.b *= 0.8f;
# j, ?& }) u* v; V3 ^
6 A# r, Q- u6 H* `
memcpy( &m_light, pLight, sizeof( m_light ) );
* z5 G* v- B+ p% C
. Z: m/ l. b" h T
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
+ j y+ }; b6 \1 O4 F8 T0 Q% i
D3DXVec3Normalize(&(vecSun),&(vecSun));
5 b" v. t7 T. ^ g3 ?% j$ w
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
" t& h) p; N R9 x- _
pLight->Appear( m_pd3dDevice, TRUE );
) ]& R2 g1 a0 Y- h4 F) u3 L9 W
3 t$ C2 ] {6 a$ H7 e$ {, t5 ^2 A
DWORD dwR, dwG, dwB;
- ]2 j$ m _) T, v6 o! ]
dwR = (DWORD)( pLight->Ambient.r * 255 );
+ d7 o2 r* P5 ]$ F! |' V
dwG = (DWORD)( pLight->Ambient.g * 255 );
: t+ d7 r7 M" j
dwB = (DWORD)( pLight->Ambient.b * 255 );
3 a: A8 R0 c- K. G( _- c/ C1 w
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
+ c! I9 T t8 \# Y) Y/ O# A" W
}
/ ^ L6 d1 a' z: z( C4 T' b: E1 A
}
& ~2 ^5 j: l, u9 ]) j/ W
}
! @' T7 J* Z0 |7 F0 [
else
8 s7 C" S. y! }
#endif
6 {' Q- S5 S& E7 D" a$ f
, w, U8 f, k4 i7 O+ l* m
if( m_bIsIndoor )
8 V" e- P- Z, x/ ?0 q6 T
{
3 g% X+ g# |8 t& K
if( pLight )
" A% c0 n7 p& l+ G+ v e
{
0 z$ S$ u# y9 D, b& T$ L8 S
// à??μ oˉè*
$ w, u& Y- r% | \4 b9 J$ s
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
' |, E8 H% f$ S
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
$ ] y5 j& \" n' Y+ [3 a; K- L
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
/ u$ C5 w) ?1 K& N
5 M- F1 a+ W" N7 L* I1 y
// oˉè* ??à?
1 `/ M1 v$ c' J$ c; G5 _) }2 t* e
pLight->Specular.r = 1.0f;
H" n9 c0 h! l% Q& a
pLight->Specular.g = 1.0f;
% X$ D5 e' m( t- N0 e/ L
pLight->Specular.b = 1.0f;
0 t. Z5 N3 q( @+ ?& W" ^
// àü?? oˉè*
6 e4 t2 C# `# [" U
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
% d- D8 p5 G9 h
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
: u. b+ Q7 u. Z2 u) B
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
\, @' S+ {, J& Y! T a2 H
9 K8 b8 g1 D$ ]
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
: ?; m3 ]7 @* g% x* B
{
' N2 g) D6 {) I. B" J& ?
pLight->Diffuse.r *= 0.6f;
6 d2 N3 y2 h( I9 E% D- G: M
pLight->Diffuse.g *= 0.6f;
, E$ U- E2 u& p- a
pLight->Diffuse.b *= 0.6f;
, m! E" n8 j7 Z. u. j- Z# O
pLight->Ambient.r *= 0.7f;
3 X7 H; y: z, l
pLight->Ambient.g *= 0.7f;
/ T' L; x- S$ W0 x. [) m
pLight->Ambient.b *= 0.7f;
) f! \% h- D5 e! V* s
}
. R& F' H; F( S8 t( l" Z# `
& P% X4 {- g% l3 L/ D/ Y
#if __VER >= 15 // __BS_CHANGING_ENVIR
7 g( q5 f% m: Y! J: H0 v: F$ w
if( g_pPlayer )
, [# f! M" N7 y
HookUpdateLight( pLight );
+ w, F/ a2 L! k1 ?0 u
#endif
0 @% @5 G1 c+ X$ ~2 Q/ V% H
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 s- W9 O* J5 W% k
% p" E) V8 G6 F, ]( W0 o
pLight->Diffuse.r += 0.1f;
1 u( f" z! r/ {; a
pLight->Diffuse.g += 0.1f;
8 F) d8 b- `/ s8 I* Q
pLight->Diffuse.b += 0.1f;
* }" A7 e$ H" V* m7 h) }
// oˉè* ??à?
! m# }8 S4 E' U
pLight->Specular.r = 2.0f;
! ?. U/ ?: P) j0 Z8 W
pLight->Specular.g = 2.0f;
2 }" x4 t ~5 r9 U
pLight->Specular.b = 2.0f;
8 q- Y+ l# A" Q8 U
// á?oˉ
! l7 t% Z8 R7 K
pLight->Ambient.r *= 0.9f;
! {) O! b2 c, [. K
pLight->Ambient.g *= 0.9f;
w3 b8 D0 M3 r& ]3 t- |
pLight->Ambient.b *= 0.9f;
v x* H" R/ h6 ^
( ~1 p1 A3 R7 z0 [0 T8 `, A1 N
memcpy( &m_light, pLight, sizeof( m_light ) );
R7 i9 c/ {8 O
* z# p1 z) q9 s% Z- f" s2 E& {9 O
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
3 y% s4 t! q+ ?# l, [( O
pLight->Appear( m_pd3dDevice, TRUE );
( t% Q3 w8 K* y6 X! W
0 ^1 z# s* s) g" U- ]
DWORD dwR, dwG, dwB;
5 E# \7 `# J: C O( v
dwR = (DWORD)( pLight->Ambient.r * 255 );
6 ~3 {, h+ I- J& C# ^( M
dwG = (DWORD)( pLight->Ambient.g * 255 );
* P% D* Y( B* \8 t3 J& o
dwB = (DWORD)( pLight->Ambient.b * 255 );
9 @9 l/ J1 B: t0 a# ^4 V" r
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
V+ m( T% K* W$ T# J7 y: l4 s1 I" [
}
. n' L& u+ e; F# Y& C
}
# z+ h9 T) K% w% M, l
else
' u! C+ M3 B2 u5 d7 L
{
W; u6 G; u) i7 R, `/ ~
if( pLight )
! z2 x( P3 H6 V- X
{
+ j9 q; |! R' g% s4 t/ J' ~! T
$ T8 E( } ]- \2 v
int nHour = 8, nMin = 0;
9 b; ^! d9 I6 e0 v# k4 R2 S
#ifdef __CLIENT
0 g0 u$ E" y v( [
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
+ e Y o2 g6 Y- l0 q# }2 _' R
nHour = g_GameTimer.m_nHour;
! k$ O" I. i( ^7 ~. j
nMin = g_GameTimer.m_nMin ;
! [- p) @( n! s- j$ t/ n
#else
}8 }3 N1 G: n: r
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
% }, z: G! {5 _7 i% N
if( m_nLightType == 1 )
3 p5 J; n) a! Y5 N6 R5 l
nHour = m_nLightHour;
" Z; Y- \0 Y+ n9 L- g
#endif
' q4 Y0 p' @& a/ C L2 y* o% B
nHour--;
, E) @& F/ t$ l$ L
if( nHour < 0 ) nHour = 0;
; V3 N& |6 b4 A) c* X
if( nHour > 23 ) nHour = 23;
, \3 b' C8 w7 X
, D7 e& y6 a6 w" @. ]# E1 X, T
//if( m_bFixedHour )
- a8 z' W8 X* i6 \; o/ P F
// nHour = m_nFixedHour, nMin = 0;
2 X- k, x# t: v, Y8 z4 A6 i
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
7 @9 r1 T- m2 R, o! y* [, a. ~1 W
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
* O/ m3 _1 k; \: V0 k9 f/ X, w
) }' v* y0 S; y9 p
//m_lightColor = lightColorPrv;
. N2 L* s3 `7 w6 g) u$ L
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
" I/ F5 O) P. m. o( d3 w* Q
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
* S8 h1 z4 A3 O4 m( f
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
/ C7 I* L; g. \6 n+ l. l4 X6 b0 q
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
. M' F% u+ u9 e( B
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
6 }5 a# C* U- w* J& [4 I4 Z
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
- M/ A8 X V. a U# B$ [3 W
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
1 ?5 C+ J. _# ]* g2 [
3 W7 X P8 }# V% A
// à??μ oˉè*
; J2 K6 f6 |# ^
pLight->Diffuse.r = lightColorPrv.r1;
; E9 v& T2 }; w
pLight->Diffuse.g = lightColorPrv.g1;
2 d2 P2 j( Z2 b) t I9 w
pLight->Diffuse.b = lightColorPrv.b1;
' _ Q+ d v7 I2 v0 Q4 s
// oˉè* ??à?
* S% A1 P1 e7 L- m6 X4 j
pLight->Specular.r = 1.0f;
6 \. V' ~4 \, N7 i! k
pLight->Specular.g = 1.0f;
; g* S$ }: D0 A/ }( `+ d9 c1 [
pLight->Specular.b = 1.0f;
- X) C% C4 w d4 ~% g+ |
// àü?? oˉè*
+ r! D& h( s$ ~" D. c+ K2 x5 V' a
pLight->Ambient.r = lightColorPrv.r2;
# A% [. S2 R' B9 e0 Q1 ?; ^- }
pLight->Ambient.g = lightColorPrv.g2;
$ |" C4 H: S; r- L
pLight->Ambient.b = lightColorPrv.b2;
5 Z8 p5 w+ y7 f7 L0 ~5 p \) B
# q# T$ P0 x4 r0 M7 h" o7 _
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
5 ?* }5 f. p* E/ a3 ?* D
{
+ ^9 r' |0 w6 `* t
pLight->Diffuse.r *= 0.6f;
9 q; L# z; `5 a* _5 }- ]
pLight->Diffuse.g *= 0.6f;
" z# ^$ Y/ O9 W2 N) x4 V
pLight->Diffuse.b *= 0.6f;
/ a% l+ D0 q" ]) D9 L& y' }
pLight->Ambient.r *= 0.7f;
' ?1 e ?' D, p1 c3 j6 w
pLight->Ambient.g *= 0.7f;
/ o. F+ ?/ ^& f r
pLight->Ambient.b *= 0.7f;
2 o8 Y) x- q4 A+ F
}
+ v! g( Y! F7 m/ v- i9 z1 x* C; X
* Y9 A( z% p7 ^2 O' E
#if __VER >= 15 // __BS_CHANGING_ENVIR
8 C1 k" D$ ~! r, ^) v6 g
if( g_pPlayer )
- t9 N& Q: {8 M) k& J9 d
HookUpdateLight( pLight );
. ]7 Y) f: Y1 ^5 ^8 ]/ ]$ a0 j7 z
#endif
) g8 H0 r0 C$ u# C6 p; {
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
5 j$ j" _* C- z: T
9 X( b2 _# y1 p$ d5 w- l% r% f
#ifdef __YENV
0 c# I! R0 y! u7 k
pLight->Diffuse.r *= 1.1f;
5 B0 V/ I9 c' s
pLight->Diffuse.g *= 1.1f;
% F9 P) Q X, e1 x2 f
pLight->Diffuse.b *= 1.1f;
. f6 v& E* Y: e S* O1 [
// oˉè* ??à?
6 e5 P. n, M, k. t$ p( i* P
pLight->Specular.r = 2.0f;
# e8 u- o/ F9 ^9 u2 `. j, M
pLight->Specular.g = 2.0f;
* E2 S4 d- L. Q/ Z+ j
pLight->Specular.b = 2.0f;
9 ~# y( `7 o9 q) h5 W/ g
// á?oˉ
8 M* q% J# B3 f9 f: G( q; {
pLight->Ambient.r *= 1.0f;
2 T+ D$ ^5 X% n) F
pLight->Ambient.g *= 1.0f;
9 ~" R2 T- G, ^; ~# z- @
pLight->Ambient.b *= 1.0f;
8 a- e$ ]3 v K8 Q" @
#else //__YENV
/ S8 w' ?8 J3 q0 F+ R( I- J( X
pLight->Diffuse.r *= 1.1f;
5 x h/ P4 d+ S3 l' {) \
pLight->Diffuse.g *= 1.1f;
a, F7 P/ V8 }( x1 c5 n
pLight->Diffuse.b *= 1.1f;
: P& S; i; v0 p
// oˉè* ??à?
$ }" `( c3 k& y0 E$ _, U) F5 ]9 A [
pLight->Specular.r = 2.0f;
; l4 |# g# C% t
pLight->Specular.g = 2.0f;
5 |5 E+ R+ V8 F5 W! ~: l+ B
pLight->Specular.b = 2.0f;
* l+ C# ]- y4 {9 L) @
// á?oˉ
2 L9 ?; w) h/ c; ]7 ]3 Y. q5 [
pLight->Ambient.r *= 0.9f;
5 x$ _8 K1 U) ?* q
pLight->Ambient.g *= 0.9f;
) n: ]( k" W- h3 D: N2 {2 P( w
pLight->Ambient.b *= 0.9f;
" C$ c3 B6 K% s2 Y: h( ~( @5 [
#endif //__YENV
- E8 i5 T& Q9 o$ N+ U6 w
3 a* |8 m: H) Z. k/ b
memcpy( &m_light, pLight, sizeof( m_light ) );
& _$ k, R9 Y/ y
" |$ u/ p3 u, J' H" d0 N) ^) ?
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
6 \ a" k! s! y- V4 o
D3DXMATRIX matTemp;
2 Q4 V7 h3 E! ^+ |4 Z$ x9 Z; a
static const float CONS_VAL = 3.1415926f / 180.f;
+ `3 J7 I; p' Z) F$ k5 l
* {0 n5 I7 s0 J0 p% E+ k
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
2 j6 \# A& F! l9 g1 P Y
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
9 A" p+ I b; s5 |. U; V
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
( T7 T* ]" |7 u
pLight->Appear( m_pd3dDevice, TRUE );
; v4 F6 N# I) z0 ?+ W
% A4 C+ G: t; ?/ Q6 r
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
v, A8 g3 N* r% R& C4 g8 ~
// D3DXVec3Normalize(&(vecSun),&(vecSun));
! w- O4 g! k6 i5 o; q9 A
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
3 \! g4 K) I8 b" P& ^2 q
* k' |2 z4 N* n; D8 R
DWORD dwR, dwG, dwB;
5 u: k- p4 p$ q( |+ y5 H
dwR = (DWORD)( pLight->Ambient.r * 255 );
" i. {8 W" N" y5 j7 e9 a; L6 P
dwG = (DWORD)( pLight->Ambient.g * 255 );
! y; Y9 i( L- ^# v6 ` d* o8 Y% V' n& O
dwB = (DWORD)( pLight->Ambient.b * 255 );
& p5 n( i6 ?" N- W; c0 R9 |
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
6 ]) z. C/ ?; A* c1 l. x6 j5 z
}
8 U4 H, g J6 \2 }/ H/ a
}
. y: K" E: v7 @ u0 i, C& W( \7 s
4 r7 p" L H: n8 N5 M( t! P( |
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
* c) \# N# d; c( c* L! Q. ^; Q! _% k
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) );
+ g: ]9 j: k% I0 x, b
::SetLight( bLight );
) h. j( D% V; [, _
8 O% X! D. H1 y+ E' x* P O8 w$ z! k
// ±ao? ?D?í???ó á¤à?
* f& H# ~6 a5 c0 |$ o
m_pd3dDevice->SetMaterial( &m_baseMaterial );
4 G3 u- s7 x5 j2 j
. R$ {) V8 W$ m0 {! }+ J
#endif // not WORLDSERVER
- C* M6 _ x5 V6 R
}
0 U- a- o: w+ {& m
并更换
$ ^) s; E2 F" d7 ?, `
Code:
1 |/ c2 U( B5 \! i7 |3 z8 |. l; z
__FLYFF_INITPAGE_EXT
( x2 ?# I$ m/ q7 N9 C. m
定义
: K1 K3 N# Z+ X+ G/ B$ S X
% m: O. d: N1 [) d8 |/ U/ m
9 _4 A5 d8 ?1 C7 b
/ I, m1 Z; I4 G+ S' y% `' P$ k* p3 Z
" ^2 o. @2 i. A. U- L+ Z
现在终于删除我的狗屁加速...
: | l3 i/ M0 m& E3 c+ l0 p S+ a
( T. U6 M' j* o! c7 h
8 I- Y! ~! ]6 M: y! k
. C/ o: l0 Y% q* f( {6 t
欢迎光临 飞飞世界论坛 (http://ffwold.com/)
Powered by Discuz! X3.2