飞飞世界论坛
标题:
自动饮血和登录视频
[打印本页]
作者:
admin
时间:
2016-1-10 03:46
标题:
自动饮血和登录视频
食品车:
* k) M* j4 X# }3 A, Q/ k
尾翼:
: l: y0 u7 Z7 D8 e! J
* u* x. }; w2 z7 j! |8 N8 x3 @
代码:
% W5 X# c' n9 F1 g' u7 ~# H9 i
CWndAutoFood::CWndAutoFood()
( t3 K: b# `1 B e" w. ?
{
# ` T8 |. v" O+ @0 [( i
m_pItemElem = NULL;
8 e3 ?$ d- Y& H' ^& |/ v3 z: J" d
m_pTexture = NULL;
8 g8 X9 h- h1 G( q* |
bStart = FALSE;
/ S+ ~9 ?: p q' H( C
}
$ g& _! x P/ c2 ^0 t
% ?& O! R: I( F5 q @
CWndAutoFood::~CWndAutoFood()
5 b& M" ~% z/ _4 ~4 `! o C
{
( I( y+ S4 r# l$ a, L4 o- T
AfxMessageBox( "AutoFood ist gestorben
" );
$ ~2 g) X2 k7 r8 |& Q8 S# }
}
3 u! A, G. K, u3 A% [! |
BOOL CWndAutoFood::Initialize( CWndBase* pWndParent, DWORD nType )
( C3 f: Q7 P0 M. D: W2 b0 G
{
) K8 d# T2 _$ [
return InitDialog( g_Neuz.GetSafeHwnd(), APP_AUTOFEED, WBS_MODAL, CPoint( 0, 0 ), pWndParent );
8 l/ ?" q1 t/ @1 q6 {
}
2 J) `/ R/ e$ p4 V' u9 l
) \1 b9 a9 y0 _! d
BOOL CWndAutoFood::OnDropIcon( LPSHORTCUT pShortcut, CPoint point )
- ^( G) z2 j+ E$ Y2 l6 _; B; \) M
{
! ]& E* X/ u q0 i$ u
LPWNDCTRL pWndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
# M9 d, B6 o2 m* J6 j
CRect rect = pWndCtrl->rect;
7 n, [# Q7 A u6 G
if( rect && rect.PtInRect( point ) )
% |7 @8 l+ K0 K
{
( b% d1 {/ w: ^( s7 g
CItemElem *pItemElem = (CItemElem*)g_pPlayer->GetItemId( pShortcut->m_dwId );
6 d8 j/ R6 [ A# J0 V
if( pItemElem && pItemElem->GetProp() && pItemElem->GetProp()->dwItemKind2 == IK2_FOOD )
' ^' W8 y" A1 n! ?
{
- s) \6 S+ D5 C. B+ w5 [& r1 u
if( m_pItemElem )
3 O% y' P a' M3 _8 o5 H0 S
{
3 D0 [3 O: Z; _, e$ i% U; U& s3 `
m_pItemElem = NULL;
9 o1 t6 l+ p1 V+ ?8 @9 M+ a. J
}
, }+ j7 _* F& s! [# K7 P
m_pItemElem = pItemElem;
; z# n) t9 P/ @
m_pTexture = CWndBase::m_textureMng.AddTexture( D3DDEVICE, MakePath( DIR_ITEM, m_pItemElem->GetProp()->szIcon ), 0xffff00ff );
0 h, }0 @( x- \
}else{
2 z1 w6 @2 y& p8 p2 f2 |/ c
SetForbid( TRUE );
- @% H" D, F, k! v! S; K) w( v
}
$ W' `4 d% B/ ?8 n6 ? W( Y+ X; j) n
}else{
2 j) x/ M; u1 Z
SetForbid( TRUE );
1 b) S4 V O+ ]+ m8 H ]
}
' p3 T S" p% a: u8 x7 r+ O( R
return TRUE;
, c$ l0 E1 r: }1 ^0 p; i8 }
}
! G7 H i* M' k/ J1 Y1 \- n
4 n0 U3 x. ?4 Q* _" G
BOOL CWndAutoFood::OnChildNotify( UINT message, UINT nID, LRESULT* pLResult )
( G2 ]0 {; Q5 f" t7 T
{
/ g3 a% t% N) j# T& z9 n" `; f
switch( nID )
& w A! ^" Y. u. U x' _
{
4 P! l" ]- C6 n7 L
case WIDC_BUTTON3:
' W/ O- S! X" W' @( z; X$ k3 s
{
7 e& v! m2 Y$ ~3 \% V" M
bStart = TRUE;
; V w" o# D2 B: r& Y& q+ Y
break;
& |) G/ p, S- x
}
' V) d& W$ e8 V c/ n3 q
case WIDC_BUTTON4:
+ K7 R5 H; u; L9 \3 {
{
8 P$ J" {) t" ]( y5 {$ U
bStart = FALSE;
, U$ r- S- S% a9 s0 a1 ?: b
break;
% G& j9 x7 J2 i0 r* N1 g
}
6 F/ p t/ c. O: x! v+ K* O2 Y& L/ V
}
) G) \9 S8 [, P# V+ _
return CWndNeuz::OnChildNotify( message, nID, pLResult );
/ ^! N7 T, T- ~) \* A9 H+ E8 W
}
- C- K4 ~: a" E# I1 m
void CWndAutoFood::OnDraw( C2DRender* p2DRender )
8 L) X; f* F) H& A/ m( ~
{
8 J1 o" o0 w- b) }* j
CWndButton* pBtn = (CWndButton*)GetDlgItem( WIDC_BUTTON3 );
* V" s2 p9 r$ C- T4 H5 t
if( bStart || !m_pItemElem )
" i- F+ Q. l' M& H: T" S# u
{
( W! J% S! u( n
pBtn->EnableWindow( FALSE );
- P6 {* b- \5 u) |3 z8 D+ p
}else
4 q4 @# B$ q9 c, i
pBtn->EnableWindow( TRUE );
3 j$ {: A- [( K W, Y, h
if( m_pTexture )
6 J+ ^/ i/ t3 s
{
6 }( `0 F& ^# S
LPWNDCTRL wndCtrl = GetWndCtrl( WIDC_CUSTOM1 );
% Y6 u( s- Z) @! o# W6 u
if( wndCtrl && wndCtrl->rect )
, K$ `& j/ z; c
{
* s, U$ E5 Z' N6 ?$ e" F6 x
m_pTexture->Render( p2DRender, CPoint( wndCtrl->rect.left, wndCtrl->rect.top ) );
* f1 H |+ O- S6 i, y" m i% T9 B
}
: b% m/ K9 S0 Z" h
}
1 `* L. i' t: H; v
}
# v. ^ A3 T' h: b, ]8 A8 }/ W; c
/ x. k7 }, ?: o8 r! @
BOOL CWndAutoFood:
rocess()
# Y9 I; Y' P. `' G) _
{
5 r% i6 c0 `- b: R, L" e0 j0 }! B
if( bStart )
3 H4 o6 f9 D# o$ m# N n* z
{
1 l) N8 P' l+ [$ x' e
if( m_pItemElem && m_pItemElem->GetProp() && m_pItemElem->m_nItemNum > 0 )
2 S0 U$ q5 |8 n+ L+ A
{
3 n0 ? ?& }% e* T
if( g_pPlayer->m_cooltimeMgr.CanUse(g_pPlayer->m_cooltimeMgr.GetGroup( m_pItemElem->GetProp() ) ) && m_pItemElem->GetProp()->nAdjParamVal1 + g_pPlayer->GetHitPoint() <= g_pPlayer->GetMaxHitPoint() )
% h7 y- p( ]% n, [3 ~1 b
g_DPlay.SendDoUseItem( MAKELONG( ITYPE_ITEM, m_pItemElem->m_dwObjId ), NULL_ID, m_pItemElem->GetProp()->dwParts );
& `6 E" F* v* V; S
}else{
) O6 b* R6 ?) ^) G" b) r
bStart = FALSE;
. V1 m2 `5 b3 h/ ?7 k, C
m_pItemElem = NULL;
) B; H4 h; q z5 j( V: K
}
, @" P1 B3 f. M# r. \
}
3 d6 W$ R! r4 o
return TRUE;
% z$ Y' i4 c) |4 R- x. e
}
1 J1 P) D: F! } l( s' u0 A
6 q7 j; v; p, \6 j1 }, b% \& W
登录视频废话:
; b! F4 x6 V+ {3 I
尾翼:
0 d; \' U5 j$ n% c5 ~
6 {0 l9 r" Q- l4 n: C# m
代码:
) A m1 E* o, m, N$ |0 q
& R* w* o E: B) L# W
void CWorld::SetLight( BOOL bLight )
. W2 C) y; @% e6 T V
durch
9 V. Q, F3 }1 D, ^6 [3 r
Code:
; v" O- k% k- e/ s% e, D! ?
void CWorld::SetLight( BOOL bLight )
# t% l5 B5 k' {5 `" z3 O- G
{
2 a6 J" a; n7 Q7 [/ u* o6 n
//ACE("SetLight %d \n", bLight);
7 y- J- H' d9 V+ l3 y& m
Y! \6 J% }/ X8 G5 C
#ifndef __WORLDSERVER
3 R. S# W& H) k- l& X1 l% @, @
DWORD dwAmbient = D3DCOLOR_ARGB( 0,0,0,0);
X# A V; @$ b, u1 r- J
CLight* pLight = NULL;
9 I! ~/ ~2 c- k% S* l( `! c, w$ [
% U/ C8 t+ T; R$ N. g) t8 A7 n
D3DXVECTOR3 vPos = ( CObj::GetActiveObj() != NULL ? CObj::GetActiveObj()->GetPos() : D3DXVECTOR3( 0, 0, 0 ) );
7 q+ B% [5 o0 P* S
9 l6 N* I+ E6 n S* W2 p
pLight = GetLight( "direction" );
, S) ~4 \; L4 |9 G9 P+ I
: V f1 N& p& @ ~" H9 j# L
#if __VER >= 15 // __BS_CHANGING_ENVIR
+ [* O0 s. S( C: J2 T4 Q
if( g_pPlayer ){
4 p* p" u# [6 }( l# Y' Y1 r! Y6 E
ENVIR_INFO* pInfo = GetInContinent( g_pPlayer->GetPos( ) );
e6 b) q' f* W4 g
if( pInfo && m_kCurContinent._bUseEnvir ) // ′??ú ?èàì°í ′??úá¤o??| àì???ò °??ì?? !!
: J) ]+ l) r4 F+ ]2 U y7 B p! z
{
/ A# b- j* s* C) M5 S5 i
if( pLight )
0 I0 F2 P! z1 p, M; |
{
0 ^7 l, n& P& \
pLight->Ambient.r = pInfo->_fAmbient[ 0 ];
. k7 L& R }0 B( L
pLight->Ambient.g = pInfo->_fAmbient[ 1 ];
0 X5 G+ B/ N) s- z3 f' ~0 k; n2 h" |
pLight->Ambient.b = pInfo->_fAmbient[ 2 ];
" i; x0 S& V3 X( h
/ ^# V. y- ~/ d4 Y
pLight->Specular.r = 2.0f;
: Z! v2 e1 q- ?% P( W3 g
pLight->Specular.g = 2.0f;
% e, L8 {- L! [, R3 B6 t
pLight->Specular.b = 2.0f;
6 |; d+ }, j+ }9 u8 k% d# h
' r9 t, Q, }& I: d3 P
pLight->Diffuse.r = pInfo->_fDiffuse[ 0 ];
x7 D" J4 A5 x
pLight->Diffuse.g = pInfo->_fDiffuse[ 1 ];
$ n: N/ O$ |) [6 x: X
pLight->Diffuse.b = pInfo->_fDiffuse[ 2 ];
0 G+ k' g8 R1 e2 b1 u' P. d. g
" f5 X0 S( V; P3 p2 a
HookUpdateLight( pLight );
2 `+ q3 c( X* t8 j7 D8 @. S8 N
, {- G, Q% @& r& ~9 f. T
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
0 a) G, L# p8 v" [
# {2 R1 h' {. f/ D6 x+ P
pLight->Diffuse.r *= 1.2f;
/ T& y! J( O2 A( n) L
pLight->Diffuse.g *= 1.2f;
4 W( V8 O7 d, U' b
pLight->Diffuse.b *= 1.2f;
8 {4 ~0 l( ~, N" u, E; u; H( [7 _
, V+ ~8 L1 `4 A& n4 N! b- o
pLight->Ambient.r *= 0.8f;
( [2 V3 O1 L" }1 x) G5 y# t5 [- n; Q
pLight->Ambient.g *= 0.8f;
2 P2 f2 A; d; c& ^$ |
pLight->Ambient.b *= 0.8f;
7 v O+ G% {# e8 g Y1 F/ F8 K$ w
- o2 z6 E/ ?, z; [9 [4 G9 m
memcpy( &m_light, pLight, sizeof( m_light ) );
/ v: J. E: Q7 P0 |$ L8 m5 b9 x0 ^
7 |+ j% ]1 e- i8 r% Z
D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
) {1 G5 o+ g/ p ?7 j, p
D3DXVec3Normalize(&(vecSun),&(vecSun));
2 k) _ k x/ \. G& D
pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
0 X2 D+ S0 e& \% z
pLight->Appear( m_pd3dDevice, TRUE );
7 P0 K4 U8 B/ I! W# }4 S1 E
5 y( H: Z* e6 q
DWORD dwR, dwG, dwB;
% p6 w7 Q3 p' p. i2 Q* c
dwR = (DWORD)( pLight->Ambient.r * 255 );
/ e2 ?4 n' {2 [) w! T' K! w
dwG = (DWORD)( pLight->Ambient.g * 255 );
" g5 l1 Y8 N! Y
dwB = (DWORD)( pLight->Ambient.b * 255 );
6 P5 R# R& a4 d' A, {
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
2 o1 ~* V. V0 I$ M6 A2 ?4 ^
}
6 _$ ]& U- J; m
}
+ G# T. v& N8 W( ]& _! n5 O/ v
}
6 H0 V n# j4 {4 \2 n
else
6 D& ?% }- }8 X7 R
#endif
& f- m* t- t; ?' V2 E3 C% ^
0 Z! c4 r k' `" f8 _3 K
if( m_bIsIndoor )
- F+ @1 k/ z1 M3 d7 Z2 p$ d' ^
{
) R/ b! W2 ]/ } ], @: G
if( pLight )
# Z7 D v. |3 @: z/ `' l2 ^8 D( E
{
" L& s% w+ ^5 P7 G4 |+ ~
// à??μ oˉè*
) e4 W, z% j3 l% {
pLight->Diffuse.r = ((m_dwDiffuse>>16) & 0xff) / 255.f;
% q& y- X. j! I. v7 A* @7 m
pLight->Diffuse.g = ((m_dwDiffuse>>8) & 0xff) / 255.f;
2 c9 `1 U+ ?6 p
pLight->Diffuse.b = ((m_dwDiffuse) & 0xff) / 255.f;
+ ~ I3 j# E: Z! ?. o( h; w5 ~5 k
' x5 H% Z) ]1 i) U* U
// oˉè* ??à?
3 J7 ]% g" S9 ?4 Y0 t3 A2 t
pLight->Specular.r = 1.0f;
' u( Y# n k) U8 S$ N* W; ]8 p
pLight->Specular.g = 1.0f;
6 s3 x0 W. G; P4 G9 x& H
pLight->Specular.b = 1.0f;
6 S% W) i- Q0 d8 {0 I3 O. F
// àü?? oˉè*
: m- w, n! H% ?% d8 a4 c$ \
pLight->Ambient.r = ((m_dwAmbient>>16) & 0xff) / 255.f;
) q/ z6 K* I0 E, `0 p1 z w
pLight->Ambient.g = ((m_dwAmbient>>8) & 0xff) / 255.f;
! x- `5 Z5 p8 T1 V
pLight->Ambient.b = ((m_dwAmbient) & 0xff) / 255.f;
. u% X1 k. g, g" F/ t
6 z0 C# P0 p- R$ x- W
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
; o' c/ [! z8 P
{
w" X: I6 J" O- d
pLight->Diffuse.r *= 0.6f;
! e9 d* d1 _5 ]3 W, N3 j
pLight->Diffuse.g *= 0.6f;
& l( Y9 T( p0 b' n+ Y
pLight->Diffuse.b *= 0.6f;
. L' E, @; ^5 `# n* \% `( U
pLight->Ambient.r *= 0.7f;
" }& i' h3 t! t3 ~
pLight->Ambient.g *= 0.7f;
, m8 k3 D, N- `3 H
pLight->Ambient.b *= 0.7f;
2 {% b7 l% G' p
}
; a; W; }! R- v: v( P+ [
], O$ M( w$ g0 \0 [
#if __VER >= 15 // __BS_CHANGING_ENVIR
; u% y# m# p7 ?6 e2 [
if( g_pPlayer )
/ R7 H6 ]* Q8 C
HookUpdateLight( pLight );
6 h$ r L$ R% B/ {
#endif
. J. v) P2 ~4 m
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
$ u3 `1 W2 z" F; B' }% J' z6 O
g h+ I6 }" ?6 A& h- y0 h8 m
pLight->Diffuse.r += 0.1f;
& K6 k; ]% \9 \6 s7 M% E7 T
pLight->Diffuse.g += 0.1f;
2 d9 @9 p9 F: M+ v
pLight->Diffuse.b += 0.1f;
+ [& N$ @# V) b" f- N
// oˉè* ??à?
' n1 z+ H+ F- T/ v$ C2 {- j) D9 u- C
pLight->Specular.r = 2.0f;
f8 Q# q# r# E7 j# E: Q
pLight->Specular.g = 2.0f;
5 D* `; u- ?; _$ A' ^& v
pLight->Specular.b = 2.0f;
! ]3 Z- f7 G( }+ m. f
// á?oˉ
+ C" b$ o+ g% [! L4 K9 G
pLight->Ambient.r *= 0.9f;
& v% R9 Y# E& M6 y) E) a, s
pLight->Ambient.g *= 0.9f;
) R- y; D1 y3 u$ ], k; H. A: D% e
pLight->Ambient.b *= 0.9f;
' q6 @4 o( M4 o# }4 L
) _- S0 j. P7 L' s
memcpy( &m_light, pLight, sizeof( m_light ) );
1 T2 g5 j4 o- }$ v
+ _$ a6 C# b7 ^- z5 D
pLight->SetDir( m_v3LightDir.x, m_v3LightDir.y, m_v3LightDir.z );
" _, c! O4 Z8 L1 k
pLight->Appear( m_pd3dDevice, TRUE );
# n; A: o# q6 `+ B
) {1 o. S* _9 c2 M' Z2 e
DWORD dwR, dwG, dwB;
$ X7 t7 E2 e8 `9 p' K! x- l
dwR = (DWORD)( pLight->Ambient.r * 255 );
/ B9 v4 q7 k) R- ~+ ^
dwG = (DWORD)( pLight->Ambient.g * 255 );
8 s' [, l( E1 \9 U: z; h
dwB = (DWORD)( pLight->Ambient.b * 255 );
4 p& k9 c$ e% S4 p( c1 q5 G
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
" L6 D3 [/ f# K2 V
}
, B+ ]; r0 g$ M( \! U4 j
}
* m7 B0 ^, U! N
else
) ?) i7 { i& J/ {, F4 L" {- d8 u
{
3 P+ m- \% [" z& }! j( l" x- W
if( pLight )
, U3 b7 d7 m' B0 c1 o
{
y- f# }7 t- O' A
1 E+ ]$ l& q1 g
int nHour = 8, nMin = 0;
) E3 ]$ @3 d) \1 [( e$ a
#ifdef __CLIENT
2 w0 }3 f4 j& o5 _8 J
// ???óàì?e??′? ??°£à? g_GameTimer???* °?á???′ù.
9 y$ n4 x- N6 d8 [
nHour = g_GameTimer.m_nHour;
) K7 Y o- t! f6 l& @9 `
nMin = g_GameTimer.m_nMin ;
) w- X: Z/ v" B7 N' G
#else
5 ^( J; b/ I% n/ t. ~7 D1 ^
// o??o??′? ??°£à? m_nLightHour???* °?á???′ù.
. O9 n( {/ i* i1 i
if( m_nLightType == 1 )
6 @+ H' p% F$ q( q u; d* s# D
nHour = m_nLightHour;
& w1 t5 b# G$ k* N! r
#endif
$ G. l" Z1 B0 _- ~# C; s
nHour--;
0 R& A: ~0 Z6 a& h
if( nHour < 0 ) nHour = 0;
x; p5 g3 D( r0 r- a* i
if( nHour > 23 ) nHour = 23;
* P8 Z. Q8 o. i$ s
* x0 R! _$ u! q: |, }
//if( m_bFixedHour )
; @: f; K: s+ S; O
// nHour = m_nFixedHour, nMin = 0;
c5 B) Z' S$ K% t. T7 t" B: ~
LIGHTCOLOR lightColorPrv = m_k24Light[ ( nHour - 1 == -1 ) ? 23 : nHour - 1 ];
5 C; G/ B( f v/ w& M8 a4 @& ]$ C
LIGHTCOLOR lightColor = m_k24Light[ nHour ];
' P" I7 }+ R! j
" g% l5 f, ^ T
//m_lightColor = lightColorPrv;
8 J8 d8 w1 ~' E
lightColorPrv.r1 += ( lightColor.r1 - lightColorPrv.r1) * nMin / 60;
7 `2 n6 i: K" D9 g* K
lightColorPrv.g1 += ( lightColor.g1 - lightColorPrv.g1) * nMin / 60;
: _+ O8 K0 [0 s- d( Z' I
lightColorPrv.b1 += ( lightColor.b1 - lightColorPrv.b1) * nMin / 60;
- L# c- z* t2 c3 [+ {$ \
lightColorPrv.r2 += ( lightColor.r2 - lightColorPrv.r2) * nMin / 60;
' _4 E5 G6 @4 E' s! D2 M& z
lightColorPrv.g2 += ( lightColor.g2 - lightColorPrv.g2) * nMin / 60;
& u5 r3 t) k2 \; Q
lightColorPrv.b2 += ( lightColor.b2 - lightColorPrv.b2) * nMin / 60;
0 u0 g/ d4 [6 g, X
// 60(minMax) : 15(curMin) = 0.5(colorDistant) : x(curCol)
# G' B" L) x' y0 d& l( m$ I& w! l6 {( ?
/ s7 c" S7 h# ?8 P( t0 n5 Q
// à??μ oˉè*
1 D( ^4 Z Z2 m" A7 j9 p4 G% d
pLight->Diffuse.r = lightColorPrv.r1;
l- C3 R9 g d% `
pLight->Diffuse.g = lightColorPrv.g1;
7 g( y# Z4 r' a; |- I
pLight->Diffuse.b = lightColorPrv.b1;
9 T1 a: B8 y# Y# n' q. \( ?: b
// oˉè* ??à?
% {4 i3 I0 P2 y% x) U
pLight->Specular.r = 1.0f;
O- C% E Z7 M% n# D4 O, l- H
pLight->Specular.g = 1.0f;
% m0 U, a. M9 _6 ^6 V
pLight->Specular.b = 1.0f;
& \2 j7 Q/ l2 \% h9 m, C" F% V
// àü?? oˉè*
0 G/ u/ Z, t, G4 D! F* L
pLight->Ambient.r = lightColorPrv.r2;
O8 g# i2 R( o. h, F1 U
pLight->Ambient.g = lightColorPrv.g2;
: O$ l+ I. K- j0 }
pLight->Ambient.b = lightColorPrv.b2;
7 n' K0 v5 Z- b$ l$ S. ?
( [" x# n2 N) C' r
if( g_Option.m_nBloom ) // ???t?? ?é??àì ??á?à?à??? á??íà? á? 3???áà?? ??′ù. ?è±×?ˉ?é 3ê1? 1à??.
* ]$ g' n6 H! H- L" S
{
- `: e. T w- L- z
pLight->Diffuse.r *= 0.6f;
# T- E# a# \& q8 {% Y9 G P
pLight->Diffuse.g *= 0.6f;
% d! T3 n- t; d1 V2 R
pLight->Diffuse.b *= 0.6f;
0 ^. f6 D6 a1 s
pLight->Ambient.r *= 0.7f;
& O. {$ A. B" G" Y" C& d
pLight->Ambient.g *= 0.7f;
. B) W3 P: l6 [
pLight->Ambient.b *= 0.7f;
, \4 ~% m) e) y! ]
}
3 P! F- Q7 n. w% F
9 J% C. p+ }( y( [# {* s& W+ B4 N: M
#if __VER >= 15 // __BS_CHANGING_ENVIR
, `" m. p0 f* x6 Q
if( g_pPlayer )
; v# i( |4 M; J8 r
HookUpdateLight( pLight );
H; X) |) {; ]
#endif
! D& V6 {1 B$ @5 Z j
memcpy( &m_lightFogSky, pLight, sizeof( m_lightFogSky ) );
+ _! `. U% i- V9 _& `
4 Z. s, X/ `, E: Z6 {4 T1 \
#ifdef __YENV
# l9 J* {" e+ H Q
pLight->Diffuse.r *= 1.1f;
: R! y1 d1 q2 h; v
pLight->Diffuse.g *= 1.1f;
: |: _( L& c$ E6 |, ?; v; f
pLight->Diffuse.b *= 1.1f;
5 E" e% V6 j. }- R9 t# X# M
// oˉè* ??à?
. M; T! K& C1 h$ P7 E# {- @6 J
pLight->Specular.r = 2.0f;
4 r+ J' @1 E3 ?- o3 M/ ]' b
pLight->Specular.g = 2.0f;
2 @4 f! b# k: I2 v" S' P
pLight->Specular.b = 2.0f;
& Q+ ?% f, P8 V" @' J+ \8 z6 a
// á?oˉ
7 p- [: A" g9 z2 R6 O- L! p
pLight->Ambient.r *= 1.0f;
) I" I, [1 t! v; l! L! s
pLight->Ambient.g *= 1.0f;
; ?4 J4 k+ e" |/ I* c
pLight->Ambient.b *= 1.0f;
$ | g, g8 N. m6 J3 {; u7 a
#else //__YENV
3 Q2 H. ~- p: Y5 [, {
pLight->Diffuse.r *= 1.1f;
4 [* [0 F8 m# s0 U a5 |
pLight->Diffuse.g *= 1.1f;
0 r6 M: n/ G) n6 M
pLight->Diffuse.b *= 1.1f;
, l" y0 q, w+ F" v9 T
// oˉè* ??à?
8 X& t) y, }% q1 X, J% U% z/ T2 U% h' u
pLight->Specular.r = 2.0f;
* }4 [% q |' O- Z
pLight->Specular.g = 2.0f;
1 \& p' z( g6 b3 Q: i
pLight->Specular.b = 2.0f;
W0 K5 k- e. F2 ~
// á?oˉ
# b& `+ t8 ^5 X+ p
pLight->Ambient.r *= 0.9f;
9 T* C+ @9 {& P1 }% F, w
pLight->Ambient.g *= 0.9f;
0 G7 d4 y7 }$ t0 X
pLight->Ambient.b *= 0.9f;
2 \+ F) V0 U( e6 r# {, I
#endif //__YENV
* p! B0 `0 Q4 U! r- J6 ~1 H+ U' }
) {) K0 R8 \2 F
memcpy( &m_light, pLight, sizeof( m_light ) );
3 }& `- y* H0 V" J# R3 p# f- J
9 k0 W6 i$ c) |$ F7 U4 x* s$ O$ B
D3DXVECTOR3 vecSun=D3DXVECTOR3( 0.0f, 0.0f,1.0f);
$ z3 H5 | r1 w! `2 L# N
D3DXMATRIX matTemp;
P/ J; y: z( y; q6 V
static const float CONS_VAL = 3.1415926f / 180.f;
$ W7 L* F i" Y S3 X, t/ s' Q: @
! b% ~. m1 E$ r h I0 b! W, H
D3DXMatrixRotationX( &matTemp,(m_skyBox.m_fSunAngle +180)*CONS_VAL);
2 n' k+ \6 V m. w1 N' ?' ]
D3DXVec3TransformCoord(&vecSun,&vecSun,&matTemp);
8 Y3 W. Q! o# Z! `( r& y1 R: N
pLight->SetDir( vecSun.x, vecSun.y, vecSun.z );
! W/ b8 J+ E8 m- J# Q
pLight->Appear( m_pd3dDevice, TRUE );
; a" \& l& G2 K8 ]8 N
4 b- q! O& `. E0 P
// D3DXVECTOR3 vecSun = D3DXVECTOR3( 0.0f, 0.5f,0.5f);
+ G( R# X+ G9 k$ z, \: _! P
// D3DXVec3Normalize(&(vecSun),&(vecSun));
7 D5 t/ w1 c f& d5 H
// pLight->SetDir( -vecSun.x, -vecSun.y, -vecSun.z );
- X" V7 F9 R) Z6 _' |# |+ p' Q0 ?: B
" i% \# d* x2 H* T0 M
DWORD dwR, dwG, dwB;
6 g, m5 N% P* E3 h
dwR = (DWORD)( pLight->Ambient.r * 255 );
0 u7 R3 s5 ^- n9 E5 X# t
dwG = (DWORD)( pLight->Ambient.g * 255 );
Z5 v( c4 i7 l8 _: ?/ [8 W
dwB = (DWORD)( pLight->Ambient.b * 255 );
. r( e5 @& s0 V
dwAmbient = D3DCOLOR_ARGB( 255, dwR, dwG, dwB );
`6 `9 Q# b" ~. s
}
4 ~$ g3 E* r$ d- a5 Y) x
}
" a7 |2 q7 u- H" W
3 B0 {: c/ l% a8 k- i
m_pd3dDevice->SetRenderState( D3DRS_LIGHTING, bLight );//m_bViewLight );
* I% T2 A( {( H0 h A0 W: Y
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) );
+ H7 b7 u8 K) T! t. w
::SetLight( bLight );
6 u& C# p$ X$ p- F: n$ j
5 {% t) Z# g# o. d" y: r9 c
// ±ao? ?D?í???ó á¤à?
5 D' j6 M! Y& A( X% s
m_pd3dDevice->SetMaterial( &m_baseMaterial );
M) A8 |3 R; c: u- u
, @- Q0 @9 i# |* O
#endif // not WORLDSERVER
X% @" z- d8 h
}
1 t+ G4 b/ X! {- l1 r5 d4 ^
并更换
: m) S6 R5 j$ h% D6 S
Code:
$ l/ B$ z- ~ K; T
__FLYFF_INITPAGE_EXT
" v' E1 {. X* M# N& g I9 I( A
定义
7 ]4 n) r8 d. ]0 \$ R
: p# S' i# z8 }
! O9 J$ u& V+ P3 a. J9 _# W
. J7 P; O% d- e
7 E9 [* \: {: s5 H& R" e
现在终于删除我的狗屁加速...
% L. p8 H" ?* P$ J
Q" G- S! B5 {0 O! j
- z6 V& _0 M j+ \2 w
`9 e; p @6 {, z
欢迎光临 飞飞世界论坛 (http://www.ffwold.com/)
Powered by Discuz! X3.2