飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
7 D7 Q: {$ \. |- p# v" I( f
尾翼:
: i5 F3 s) l+ R" v$ a" e% d/ _
- T. D3 R# g+ I0 S
代码:
4 \9 R: [, C j" l0 {3 [$ L" N
CWndAutoFood::CWndAutoFood()
% \7 q7 p' o" y' \+ q
{
5 [% q8 e! F [
m_pItemElem = NULL;
9 b+ P3 A' ] i& o$ P j
m_pTexture = NULL;
9 ?8 Q) _& g7 I# T( y
bStart = FALSE;
- t' z; ^ m$ G$ y* O7 n* O
}
& _3 U% }! Y% \. }6 e
: K) Q% s( D. J4 b! W! l k& [
CWndAutoFood::~CWndAutoFood()
1 D: d- `' d6 S5 a
{
B4 Q% d: s2 z. j8 O
AfxMessageBox( "AutoFood ist gestorben
" );
! m7 @" X2 Q; J H9 t% \4 j4 P T
}
. f. n5 |& o1 A o2 P" c: y1 }7 \
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
. M. Z0 B. h6 S9 d) j
{
1 `, v( n! e% L
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
3 @) J0 S7 @% g; E
}
" e4 w2 V& [( x- y3 N
; F1 U3 r% }5 j9 J0 Q7 _, g! I
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
# f, \7 A* Z" U4 z; ^6 X0 D
{
. E" j" C" E8 L6 e# ]7 t
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
& x" w7 D! N: b3 B* w2 t
CRect rect = pWndCtrl->rect;
0 \% C$ v4 R7 K9 r, A
if( rect && rect.PtInRect( point ) )
2 E; {6 I: D( X5 M; Z+ \4 y3 o
{
. l6 X- t! }" Y3 T; e" l" X9 M
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
/ k3 w7 g n. t! ~5 K- y. N
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
6 N* Y# T2 r8 y+ k7 f
{
" ]3 I* G0 t: {2 B' u
if( m_pItemElem )
9 q% u1 S7 ^; C& o0 q
{
6 [6 j" ]4 Y% a v
m_pItemElem = NULL;
D. J! m8 W0 \6 p) f
}
2 Q. ~' a/ g$ [# z, c$ W
m_pItemElem = pItemElem;
: @/ a4 ^% D" }' T
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
' w0 ]+ Y( S3 t( Q
}else{
4 Y& k; m4 b( {9 l* e# G
SetForbid( TRUE );
2 j2 g5 z& E' l' H
}
9 W" A! V2 |- F: v5 o- A W
}else{
) M+ k- A1 B2 `! d& y9 F
SetForbid( TRUE );
9 c* j! l6 h# e) r# [) x
}
% f; H, C. W) e
return TRUE;
1 m9 [" Q4 m* p" f% m( m3 @
}
' y# W8 G, u9 P9 V3 v" R
, A3 w1 E" W1 ^
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
( W" @" \- B$ [
{
4 q! Z# ]2 _" r/ V z
switch( nID )
4 n; r1 d/ w! |. r! o1 J
{
' O) S/ H: \9 X" B) A5 t0 V) X! ?: ]# u
case WIDC_BUTTON3:
' X" B& L" [) M& R6 C
{
" ~ ^* \ v! g( |
bStart = TRUE;
, J" v* b& `% P+ t J% L
break;
" u4 S6 Y N1 [8 E9 V+ x. ~7 x
}
) U% k. `" p7 E4 k' m
case WIDC_BUTTON4:
; m3 N! M+ P4 i) l
{
( o" h& k- M% F O) P( j% e
bStart = FALSE;
3 D/ t" K* K9 T; ]4 u- d) o
break;
! i- r. M0 B. X: k W2 B6 H
}
8 h0 e/ J) b* i0 {" j+ \' a! x
}
. F' z7 d; Z" j4 t0 Y* e% j
return CWndNeuz::OnChildNotify( message, nID, pLResult );
! x2 r, o) v9 q0 J9 Q
}
: X+ C* `( L& S3 w$ G: ^
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
6 a" r/ ?8 O! s: V) V% `5 u$ r
{
7 B) D9 j: W. v5 Y7 L
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
4 P4 c* R9 t2 ~, f! Q: {# N8 z/ r
if( bStart || !m_pItemElem )
5 S( ~) v( ~ U) C R0 {
{
$ b! I; S' t3 t
pBtn->EnableWindow( FALSE );
% y* Q, s. U0 v5 e
}else
$ d2 ?* @* Y" C% n7 X- @! ~) p0 v q
pBtn->EnableWindow( TRUE );
* o- U, C2 y ]1 [% w) c
if( m_pTexture )
! U' q7 E1 i* ~3 o/ s2 `
{
) A. x4 u2 k: v6 F$ b0 ^8 W
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
- E" x( n; e6 j6 m
if( wndCtrl && wndCtrl->rect )
# e' C3 z' a5 c# G
{
1 ~5 Z- ]4 k- r/ H- L3 Z1 B' E; f
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
0 L& \$ H+ T- a9 a( S
}
( p$ X6 B5 j. ?6 V
}
% w! U, J5 g! x6 Q0 O* s# T& S
}
7 f- m4 X# I: Q9 Y
4 ~1 P% e6 E( \# Z5 b5 F
BOOL CWndAutoFood:
rocess()
- J7 n! P# w; _. U( `
{
# f9 o+ K7 K1 g+ H
if( bStart )
2 k5 ^) i4 C+ l, o, c6 C8 T8 L
{
, L4 s; n8 d+ G, ]# G# b% T
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
: I3 W$ `* }' r6 U
{
3 G' R6 _6 Z# S. y& y! e! q! L
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
6 i$ ^+ ^5 o5 ^! K6 ^0 T, Z
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
2 ]9 F0 x& j* [
}else{
& G3 O! B/ f& U9 U
bStart = FALSE;
9 S( Y/ I g) x( D4 T
m_pItemElem = NULL;
, t4 h( q5 t, m% Q( {
}
, R) Y( a8 a( l0 g1 v! z
}
6 Y8 ?+ \: B1 N
return TRUE;
& U: }# R5 k" @2 k7 m5 b
}
7 \' i. U7 G" C; r( c! f
. M2 ^6 J8 x2 p- H6 k7 n
登录视频废话:
7 P& s) O$ w5 J5 S
尾翼:
) A+ P. C* j: d/ P4 U% n' r( a7 e- b
0 @/ z2 ? i2 `$ S
代码:
% D7 s7 X O# H# m) e
, S# o) f9 L) W+ R
void CWorld::SetLight( BOOL bLight )
4 {. L5 P6 p& q
durch
! b' X, [ \0 c3 h4 _2 s
Code:
$ ?, r+ _' L7 |$ }
void CWorld::SetLight( BOOL bLight )
' S# D; i$ O$ c/ b, {
{
! a, j# `' D% H9 P2 }6 v
//ACE("SetLight %d \n", bLight);
; R( g) P2 D8 R& X5 R# M5 u9 ?
8 C. C( m' s/ W; l5 o" u" ~ S
#ifndef __WORLDSERVER
) l g8 F& z# T. K: l
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
Q$ T5 D5 R% z( ~5 Z; G5 _% ~
CLight* pLight = NULL;
1 N+ [2 v# d O- k3 }# K. g* P. X
6 [: J, l$ A# k
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
, Z. \' K8 U: j
/ a2 |- ] O4 P' O4 n
pLight = GetLight( "direction" );
8 V; C6 b: B7 [/ y/ t
4 X6 V7 q9 }' s9 ]0 q; P
#if __VER >= 15 // __BS_CHANGING_ENVIR
% `0 F B: Z2 i" j4 }" u# M6 {7 e
if( g_pPlayer ){
* w7 ^9 N9 W" Q7 h. C0 m
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
X! B0 }4 _, U( G
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
# v5 f) m* j5 ?" i
{
- s# s0 V3 U9 R9 F3 \
if( pLight )
6 D- y6 Y& _0 Q" x9 a
{
3 d5 M. ?2 e; t8 r* H' I- W0 R! V
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
1 o0 Y) x8 [ S0 }/ |7 A/ _ @
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
: I6 u0 U* h2 a7 Q
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
1 F \" o: m4 y) R7 `# W
9 B$ Z! M( D8 o8 Q0 B Q
pLight->Specular.r = 2.0f;
& k5 v4 s. `4 v/ x2 c3 N: o4 p
pLight->Specular.g = 2.0f;
) X" M: c9 i2 R4 I1 F
pLight->Specular.b = 2.0f;
, H) b, q }$ `
3 K$ Y6 O! P$ @9 f" b: u
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
& X2 i+ o9 i* _
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
Q3 H) Q- m' U7 Q
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
$ y* R* l0 o- W4 e/ H
7 s/ n9 p0 u$ c% k6 P, J4 M7 f: A
HookUpdateLight( pLight );
5 ?1 _1 V* Z6 f2 m% A$ a9 f
! s7 n7 c b# z K" q
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
& O D3 F# p# c6 n1 q' m
- t: K8 P" D' r
pLight->Diffuse.r *= 1.2f;
: M& X, b: e# m6 C3 p* V
pLight->Diffuse.g *= 1.2f;
; V! u; H# M% T. O8 [( ^
pLight->Diffuse.b *= 1.2f;
$ K# s# @, @, L2 Q- \1 y2 B
4 Q* k4 H" S1 Z% o9 k# Q
pLight->Ambient.r *= 0.8f;
4 j; |8 j' i4 k' ~. P& ~3 {( \
pLight->Ambient.g *= 0.8f;
5 [ D6 H; L0 a0 |2 N& R
pLight->Ambient.b *= 0.8f;
; [" q2 t5 ^' J0 |
7 R/ ~% [2 O9 j5 n; N4 `) W
memcpy( &m_light, pLight, sizeof( m_light ) );
7 I. O+ T8 Y8 n# ~
5 @! `4 g i* {4 \) |
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
2 H4 F& O2 g6 V1 Q
D3DXVec3Normalize(&(vecSun),&(vecSun));
1 w) O8 R9 d, h7 y! U. g7 N9 D
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
! x/ y/ x/ S, ]4 x2 W
pLight->Appear( m_pd3dDevice, TRUE );
- T" |$ }! ]4 \3 Y
3 e1 Q/ ]( z' l" \5 n- ?" f
DWORD dwR, dwG, dwB;
: h9 e( K( r4 m) u J
dwR = (DWORD)( pLight->Ambient.r * 255 );
c& c# L: a1 p' P; M5 k1 ?
dwG = (DWORD)( pLight->Ambient.g * 255 );
. W+ q! M$ C& a& A% ]
dwB = (DWORD)( pLight->Ambient.b * 255 );
" m9 v; T3 y% q3 x; W/ A) n! Q1 ]8 O
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
7 `& S8 H4 o; \! e: l+ y8 a
}
, ]4 {" D8 K; j6 ~( _3 f( B; M
}
: q/ G9 T- _, K" ]! h
}
5 G( s" G8 ` b
else
) H: Y6 q1 f3 J
#endif
: C0 ~2 H' F$ A. ^
6 R9 c& r8 c3 z/ g9 P+ @
if( m_bIsIndoor )
E ]+ Z8 r7 g5 N
{
; t& s- J+ @* ^& I* | b' E
if( pLight )
! k, J, J8 B3 ?9 X' D+ Z
{
4 E5 [8 T5 ]0 F5 n% o
// à??μ oˉè*
9 R/ c. a! i+ Z$ B
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
0 v! {' B5 S( ]+ C: L
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
: w' F: {- S9 x& k0 v. q/ `% o# v
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
* Z! T5 p" ?% e' B
! U: w n8 E8 o
// oˉè* ??à?
: d% _) `$ k* G+ p
pLight->Specular.r = 1.0f;
+ l& z7 Q' x7 e \9 I5 ?
pLight->Specular.g = 1.0f;
4 T% L+ k' t' ^5 s' K6 m/ r0 V
pLight->Specular.b = 1.0f;
/ O% U; o0 ?0 F( e: x+ y
// àü?? oˉè*
# C' e; c" |! [+ U% f, | }
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
6 k7 J% Q, p" }% E, c' a# c8 M
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
$ {5 I# _6 |! j3 G3 @; ?
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
/ r4 U7 H7 R" S* H
$ E& ]% U* \) v( M
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
" p' _% A' U$ i, A9 y
{
" L& P& W8 W0 _# m
pLight->Diffuse.r *= 0.6f;
/ G, i0 ?+ O. L
pLight->Diffuse.g *= 0.6f;
3 {8 Z0 |% ?1 g5 ?( @
pLight->Diffuse.b *= 0.6f;
! o8 ~: y3 v; X
pLight->Ambient.r *= 0.7f;
1 s: K: m' E* c/ F4 V; b Z* P3 v
pLight->Ambient.g *= 0.7f;
$ ~- D' ^6 i& l9 R& u# u! Y
pLight->Ambient.b *= 0.7f;
/ m$ O5 z8 m$ M) {9 H
}
& }1 W# K, b5 i/ V
% h. I' i% u8 W) D! i
#if __VER >= 15 // __BS_CHANGING_ENVIR
/ Z9 p3 i q% w+ `
if( g_pPlayer )
! D* z0 O2 y# L( w; \0 J6 ]
HookUpdateLight( pLight );
7 V; {& p* _8 w& Y
#endif
m( d! h& C/ d2 B
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
( Q" M1 D% q5 _0 `$ f( G' L
! x2 [/ o. H1 g3 {: P3 w5 D
pLight->Diffuse.r += 0.1f;
% N& P0 P$ c4 V. t
pLight->Diffuse.g += 0.1f;
5 ~( Y$ g* i, j" Y% \" c
pLight->Diffuse.b += 0.1f;
, M l. I: \6 K# l
// oˉè* ??à?
4 m: G( Z3 V0 x4 z* }# T: w$ y
pLight->Specular.r = 2.0f;
; X; F4 @% K' a7 f* e: O7 v5 q
pLight->Specular.g = 2.0f;
; c+ n) M% n- p" h
pLight->Specular.b = 2.0f;
$ s) h5 L; U4 W% K; B' S' W: b
// á?oˉ
* V9 F; |9 ?1 b5 F' I' S( k
pLight->Ambient.r *= 0.9f;
( k! A* Q7 w7 ]! h1 f5 b$ E, V
pLight->Ambient.g *= 0.9f;
% W6 [- g+ {0 _. Y
pLight->Ambient.b *= 0.9f;
2 H! E9 b3 y a K8 C" `- K/ E L
( {0 o: ^5 j4 \% s, H: C4 ]
memcpy( &m_light, pLight, sizeof( m_light ) );
5 V& H1 I5 m2 F
+ C5 p4 B6 P3 H% H2 e' u: M' L
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
1 H. g1 I) @$ M4 p- N" U
pLight->Appear( m_pd3dDevice, TRUE );
7 g/ p: p& f' b0 B5 A9 f
) F! f: y! S, ?/ [
DWORD dwR, dwG, dwB;
% m5 V3 h: h3 D, F/ Y% h
dwR = (DWORD)( pLight->Ambient.r * 255 );
' L/ v) ?& X8 I( R
dwG = (DWORD)( pLight->Ambient.g * 255 );
3 e- y/ ?! Z" J4 f" w
dwB = (DWORD)( pLight->Ambient.b * 255 );
' C0 m" n2 W, B) d/ b! O" ]
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
( ]2 g! l1 i) |6 j* V
}
9 p7 R# C; m1 q3 e
}
8 D+ O5 {: @/ Y( k' r' p
else
3 k% w" Y, ^( @
{
$ C' B3 g/ _& |8 h) ?% ]0 w, |% _
if( pLight )
& ^! L& i1 U) `) p* U
{
1 b2 u6 z6 q5 ~7 W8 V$ @* z: w
9 t; k/ c# B, L$ B
int nHour = 8, nMin = 0;
1 T8 [5 s6 c: H3 R3 m
#ifdef __CLIENT
3 o7 A5 p2 Q2 }
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
U0 i1 n- a3 o! V/ N5 ?( Z
nHour = g_GameTimer.m_nHour;
: d, U- V/ v6 x- j6 t; V
nMin = g_GameTimer.m_nMin ;
t/ A, ~) D" r% ^. E$ K) Q8 W
#else
/ d- L5 [" f% a: e) c# y, _8 H
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
! @! h) A4 p3 J G2 ]
if( m_nLightType == 1 )
9 p5 J; Q' a N4 X5 g4 U. j
nHour = m_nLightHour;
u7 X* z- t$ ~3 t
#endif
1 q$ {8 g2 t) C% w9 S; r( \4 u
nHour--;
' I# Y. p* s. o; p, U/ n
if( nHour < 0 ) nHour = 0;
, d% o7 }; n& m K" t- R
if( nHour > 23 ) nHour = 23;
7 r# {+ n& j2 P2 a$ U( i! s8 [
# [) v. S, J7 g; P
//if( m_bFixedHour )
5 V7 Y% N, [2 J
// nHour = m_nFixedHour, nMin = 0;
6 U4 y1 M* H; T6 c8 P3 l
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
8 W- C, w9 r7 C: j' Q) Y6 I
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
9 f5 \* @9 n( T) p+ u/ N+ y- @9 l
* ]: X# _7 i( M7 u1 N0 N1 Q+ K
//m_lightColor = lightColorPrv;
& m! H" g6 z% m C
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
; F0 S5 T2 E: y' i5 V$ y8 ~, p
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
5 g8 c0 v# g% s6 S% b
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
W3 E3 _. R5 x/ R# K4 j' M
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
" u! P- } t* t' q. R2 W% D2 d
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
- C8 H2 W- [! m
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
" ~1 N5 `1 F7 ]/ w2 _
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
5 H' l/ S1 s$ O4 k0 M
) I: |2 s8 _! v8 b( G" R, Y& v! d8 b
// à??μ oˉè*
" f$ t% R2 G) k
pLight->Diffuse.r = lightColorPrv.r1;
& ^6 x6 c* T6 r" c7 v
pLight->Diffuse.g = lightColorPrv.g1;
3 H$ h% @0 c4 Z
pLight->Diffuse.b = lightColorPrv.b1;
/ q( G5 C7 B/ v7 o+ i
// oˉè* ??à?
5 L9 d8 u; n# y4 ~ T! g2 `& U7 q
pLight->Specular.r = 1.0f;
4 c4 e9 l6 R$ Z+ J5 \
pLight->Specular.g = 1.0f;
7 H/ K2 B) P' ]6 C7 S% R+ _. U
pLight->Specular.b = 1.0f;
( `# b$ u9 b7 R5 r5 T3 h
// àü?? oˉè*
% E6 _- m/ w+ T& @
pLight->Ambient.r = lightColorPrv.r2;
4 P) h9 c# U" s0 r, |! b
pLight->Ambient.g = lightColorPrv.g2;
& [ p8 P& |+ q; N7 I" T) A; U4 R
pLight->Ambient.b = lightColorPrv.b2;
% A5 X9 A, B, [& ~; U" J* F$ k
5 r+ y% g" H" L. {. H: G
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
+ ^/ |# F. v: r: r: \. w4 L
{
2 H/ N% p/ @/ s9 L
pLight->Diffuse.r *= 0.6f;
4 q& i; G: j2 c# F( |8 M
pLight->Diffuse.g *= 0.6f;
+ g; `$ k$ X0 [
pLight->Diffuse.b *= 0.6f;
- V, r! ]9 F7 j& n8 c% X! Z
pLight->Ambient.r *= 0.7f;
0 Z( k5 h. Y4 j: H
pLight->Ambient.g *= 0.7f;
8 Y9 ?+ L: ]" {" t+ u
pLight->Ambient.b *= 0.7f;
+ @6 J! u- P# `+ j
}
( d5 R3 p+ g/ k" D1 |
' o* i( g/ u! x; A$ ~3 ?
#if __VER >= 15 // __BS_CHANGING_ENVIR
4 K+ \: s- r" I% N
if( g_pPlayer )
+ z" ]; _: Z3 W
HookUpdateLight( pLight );
7 X+ L0 Q4 Y5 p2 x: ^! p5 W& h( \+ i
#endif
1 _3 U$ `, ]' d: {& U( _2 I
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
' @9 }! W- \# ^$ ~ T$ V
* S9 I% K6 R g" ?1 ]% f; s% ~
#ifdef __YENV
+ t5 X6 b+ J: O; ?9 a7 z1 g8 z6 _
pLight->Diffuse.r *= 1.1f;
* b6 u9 c, q" T1 _/ _
pLight->Diffuse.g *= 1.1f;
5 D7 T! ]( a a2 r& H v
pLight->Diffuse.b *= 1.1f;
0 f7 M' x# _: p c7 m5 R- W9 w
// oˉè* ??à?
% N" i. w8 x. c
pLight->Specular.r = 2.0f;
+ X2 X* v6 d* o
pLight->Specular.g = 2.0f;
- b2 l! P) b7 E5 T' y7 k
pLight->Specular.b = 2.0f;
% w; g9 t ~# }+ L+ s3 M
// á?oˉ
/ R0 F+ E b. T( ~
pLight->Ambient.r *= 1.0f;
# e& s+ V5 j" r$ o3 @0 R! r
pLight->Ambient.g *= 1.0f;
- u% B; s* K% M" }' z/ L5 X
pLight->Ambient.b *= 1.0f;
7 m* z! J$ @$ {# ^: ^
#else //__YENV
# z3 Q' A# ^+ u
pLight->Diffuse.r *= 1.1f;
# g* f5 o& w$ ]1 ^+ W
pLight->Diffuse.g *= 1.1f;
( A6 @8 A6 W3 T; V" Z
pLight->Diffuse.b *= 1.1f;
- l* @$ F5 K. V6 ? o( o% ^
// oˉè* ??à?
1 ~% S2 ?# v& V
pLight->Specular.r = 2.0f;
! R* K' ]; i; k( F& ~4 Z$ A
pLight->Specular.g = 2.0f;
1 I p& Y" w- s M6 I, d
pLight->Specular.b = 2.0f;
& V2 N6 E, |7 s0 `/ W! M' ]- g: A7 J
// á?oˉ
# J" U* y: ^+ n+ H8 p0 m, {. _
pLight->Ambient.r *= 0.9f;
* V5 ~+ l1 h1 r" ?/ O3 `' [9 h" o/ e
pLight->Ambient.g *= 0.9f;
! _' X1 o( S& [, v. V4 T: F
pLight->Ambient.b *= 0.9f;
4 I1 z5 _2 s, j
#endif //__YENV
" @0 ]0 u! N+ ?8 p! B9 G. v( P
% t: Q- Z) i; p$ J5 X/ K# L( }% ^
memcpy( &m_light, pLight, sizeof( m_light ) );
4 m( j" ^2 C) k6 [: N- b
- H! ~' g9 R, u; g/ X
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
9 M% s8 o9 r) k$ M5 F0 J. _1 h0 ~
D3DXMATRIX matTemp;
% |% D! I t3 K. e* f) l7 R
static const float CONS_VAL = 3.1415926f / 180.f;
( a2 T. C5 }. B3 P3 j
- O/ }- _6 F1 W8 S1 p* f. v
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
' m; a$ e( g3 X. ?7 }7 c
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
2 d. @" o2 Z! h; u' P6 k
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
f, Z$ a* ~# K9 F, {
pLight->Appear( m_pd3dDevice, TRUE );
* f/ R: G7 a" }$ B, s
9 t- h9 N' P. l7 D& L
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
" K2 w. G. p; O: S) f
// D3DXVec3Normalize(&(vecSun),&(vecSun));
! k8 A& s, W$ e, [, n" O( t
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
1 P- e$ B v A) t6 z4 [. p
3 w5 G& A$ g% ]3 F
DWORD dwR, dwG, dwB;
0 w8 z, g" K5 |4 ^2 C' n# i
dwR = (DWORD)( pLight->Ambient.r * 255 );
# H* @! c, A o$ L
dwG = (DWORD)( pLight->Ambient.g * 255 );
; S3 Q$ F* I: p/ d
dwB = (DWORD)( pLight->Ambient.b * 255 );
* P6 w2 n+ U$ d8 p2 W8 ?7 a0 O
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
$ {6 ?. v1 E3 X3 v- \ a. p* t
}
G& }% b+ ?% O1 t6 j2 _- N
}
; p. Y6 Z5 J) x2 q" n1 U
5 |. N4 O; [: Z- p+ p
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
- n& R I" W6 @
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) );
" W. ^; I! \; ]) l* B: x5 s; a1 m
::SetLight( bLight );
6 Q7 _: _; d* [/ h7 ` g5 T
, e2 h( d( _. {, d2 k
// ±ao? ?D?í???ó á¤à?
: E6 Q0 o: s' `. G. [
m_pd3dDevice->SetMaterial( &m_baseMaterial );
+ V1 |# [( K2 T- m
& i- P) l1 B- R4 L' n* F
#endif // not WORLDSERVER
* S( t3 I( V- R8 g# ]; b* d8 L
}
) C8 k: z( W& J& D1 ?$ O. F- u
并更换
# M3 u: j$ b' C. z* m
Code:
7 B* |2 |: r" g
__FLYFF_INITPAGE_EXT
# Y/ e* n" j( v
定义
& @4 K2 G, w3 [5 j
0 r& U6 x! ~0 d
$ {. l% F D4 \
* O2 V3 m& z) z r `% E+ M
4 }1 y8 e* p% ]% q6 w
现在终于删除我的狗屁加速...
% q& J, V; f! }, W2 n
, a5 H. |% x6 ^* z
) Y4 i- k7 ?8 {; {2 c
1 b/ P' O5 n; O, }
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2