本文整理汇总了C++中SCX函数的典型用法代码示例。如果您正苦于以下问题:C++ SCX函数的具体用法?C++ SCX怎么用?C++ SCX使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SCX函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: face_punch_blood
/******************************************************************************
Function: void face_punch_blood(void)
By: David Schwartz
Date: Mar 1995
Parameters: current_proc->a11 - dude to bloody
Returns: None
Description: hit in the face blood
******************************************************************************/
void face_punch_blood(void)
{
current_proc->a11=(ADDRESS)current_proc->pa8;
if (random()>0)
{
(long)current_proc->a0=1; // xvel range
(long)current_proc->a1=SCX(0x30000); // xvel min
(long)current_proc->a2=SCY(0x20000); // yvel range
(long)current_proc->a3=SCY(0x20000); // yvel min
current_proc->a4=SCY(0x0010)<<16|(-SCX(0x10));
current_proc->a5=0x00040002;
spawn_drip_neg;
}
/* face3 */
get_tg_blood;
lineup_1pwm(current_proc->pa8,(OBJECT *)current_proc->a11);
flip_single(current_proc->pa8);
current_proc->a0=((OBJECT*)current_proc->a11)->ochar;
if (current_proc->a0==FT_JAX)
multi_adjust_xy(current_proc->pa8,SCX(0xc),SCY(0x15));
else multi_adjust_xy(current_proc->pa8,SCX(0x8),SCY(0x10));
(current_proc->pa8)->oyvel.pos=-SCY(0x8000);
set_proj_vel(current_proc->pa8,SCX(0x10000),-1);
insert_object(current_proc->pa8,&objlst);
current_proc->pa9=a_face_blood;
framew(3);
blood_death(current_proc->pa8);
}
示例2: draw_bezier
static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
Color *colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
WPGPoint* pts;
guint16 data[2];
int i;
DIAG_NOTE(g_message("draw_bezier n:%d %fx%f ...",
numpoints, points->p1.x, points->p1.y));
WriteLineAttr(renderer, colour);
WriteRecHead(renderer, WPG_POLYCURVE, (3 * numpoints - 2) * sizeof(WPGPoint) + 3 * sizeof(guint16));
pts = g_new(WPGPoint, 3 * numpoints - 2);
/* ??? size of equivalent data in pre5.1 files ? DWORD */
memset (data, 0, sizeof(guint16) * 2);
fwrite_le(data, sizeof(guint16), 2, renderer->file);
/* num points */
data[0] = 3 * numpoints - 2;
fwrite_le(data, sizeof(guint16), 1, renderer->file);
/* WPG's Poly Curve is a cubic bezier compatible with Dia's bezier.
* http://www.fileformat.info/format/wpg/egff.htm
* could lead to the assumption of ony quadratic bezier support,
* but that's not the case.
*/
pts[0].x = SCX( points[0].p1.x);
pts[0].y = SCY(-points[0].p1.y);
for (i = 1; i < numpoints; i++)
{
switch (points[i].type)
{
case BEZ_MOVE_TO:
case BEZ_LINE_TO:
/* just the point */
pts[i*3-2].x = pts[i*3-1].x = pts[i*3].x = SCX( points[i].p1.x);
pts[i*3-2].y = pts[i*3-1].y = pts[i*3].y = SCY(-points[i].p1.y);
break;
case BEZ_CURVE_TO:
/* first control point */
pts[i*3-2].x = SCX( points[i].p1.x);
pts[i*3-2].y = SCY(-points[i].p1.y);
/* second control point */
pts[i*3-1].x = SCX( points[i].p2.x);
pts[i*3-1].y = SCY(-points[i].p2.y);
/* this segments end point */
pts[i*3].x = SCX( points[i].p3.x);
pts[i*3].y = SCY(-points[i].p3.y);
break;
}
}
fwrite_le(pts, sizeof(gint16), 2*(numpoints*3-2), renderer->file);
g_free(pts);
}
示例3: draw_arc
static void
draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
Color *colour)
{
WmfRenderer *renderer = WMF_RENDERER (self);
W32::HPEN hPen;
W32::POINT ptStart, ptEnd;
DIAG_NOTE(renderer, "draw_arc %fx%f <%f,<%f @%f,%f\n",
width, height, angle1, angle2, center->x, center->y);
hPen = UsePen(renderer, colour);
/* calculate start and end points of arc */
ptStart.x = SCX(center->x + (width / 2.0) * cos((M_PI / 180.0) * angle1));
ptStart.y = SCY(center->y - (height / 2.0) * sin((M_PI / 180.0) * angle1));
ptEnd.x = SCX(center->x + (width / 2.0) * cos((M_PI / 180.0) * angle2));
ptEnd.y = SCY(center->y - (height / 2.0) * sin((M_PI / 180.0) * angle2));
W32::MoveToEx(renderer->hFileDC, ptStart.x, ptStart.y, NULL);
W32::Arc(renderer->hFileDC,
SCX(center->x - width / 2), /* bbox corners */
SCY(center->y - height / 2),
SCX(center->x + width / 2),
SCY(center->y + height / 2),
ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);
DonePen(renderer, hPen);
}
示例4: swat_crossing_people
void swat_crossing_people(void)
{
OBJECT *odog,*owagon;
void *dogani,*wagonani;
current_proc->pdata.p_otherguy=current_proc->pa8;
process_sleep(0x50);
/* create dog */
get_char_ani(ANIM_TABLE2,ANIM_F2_FRIEND); // get ptr to anim table
dogani=current_proc->pa9;
current_proc->pa9=COMPUTE_ADDR((current_proc->pa8)->oheap,GET_LONG(current_proc->pa9)); // get ptr to frame
gso_dmawnz(odog,(ADDRESS)current_proc->pa9,(current_proc->pa8)->oheap,0);
alloc_cache((OIMGTBL *)current_proc->pa9,(current_proc->pa8)->oheap,odog);
odog->oxpos.u.intpos=worldtlx.u.intpos-SCX(0x30);
odog->oxvel.pos=SCX(0x30000);
odog->oypos.u.intpos=ground_y-SCY(0x20);
odog->ozval=100;
insert_object(odog,&objlst);
/* create wagon */
get_char_ani(ANIM_TABLE2,ANIM_F3_FRIEND); // get ptr to anim table
wagonani=current_proc->pa9;
current_proc->pa9=COMPUTE_ADDR((current_proc->pa8)->oheap,GET_LONG(current_proc->pa9)); // get ptr to frame
gso_dmawnz(owagon,(ADDRESS)current_proc->pa9,(current_proc->pa8)->oheap,0);
alloc_cache((OIMGTBL *)current_proc->pa9,(current_proc->pa8)->oheap,owagon);
match_ani_points(odog,owagon); // match to two
multi_adjust_xy(owagon,-66,-25); // lineup wagon with dog
owagon->oxvel.pos=SCX(0x30000); // set speed to match dog
owagon->ozval=200;
insert_object(owagon,&objlst);
/* cross */
do
{
process_sleep(3);
/* update dog */
current_proc->pa8=odog;
current_proc->pa9=dogani;
frame_a9(odog);
dogani=current_proc->pa9;
/* update wagon */
current_proc->pa8=owagon;
current_proc->pa9=wagonani;
frame_a9(owagon);
wagonani=current_proc->pa9;
} while (abs(worldtlx.u.intpos-odog->oxpos.u.intpos)<700);
delobjp(odog);
delobjp(owagon);
process_suicide();
}
示例5: draw_bezier
static void
draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
Color *colour)
{
WmfRenderer *renderer = WMF_RENDERER (self);
W32::HPEN hPen;
W32::POINT * pts;
int i;
DIAG_NOTE(renderer, "draw_bezier n:%d %fx%f ...\n",
numpoints, points->p1.x, points->p1.y);
pts = g_new(W32::POINT, (numpoints-1) * 3 + 1);
pts[0].x = SCX(points[0].p1.x);
pts[0].y = SCY(points[0].p1.y);
for (i = 1; i < numpoints; i++)
{
switch(points[i].type)
{
case _BezPoint::BEZ_MOVE_TO:
g_warning("only first BezPoint can be a BEZ_MOVE_TO");
break;
case _BezPoint::BEZ_LINE_TO:
/* everyhing the same ?*/
pts[i*3-2].x = pts[i*3-1].x =
pts[i*3 ].x = SCX(points[i].p1.x);
pts[i*3-2].y = pts[i*3-1].y =
pts[i*3 ].y = SCY(points[i].p1.y);
break;
case _BezPoint::BEZ_CURVE_TO:
/* control points */
pts[i*3-2].x = SCX(points[i].p1.x);
pts[i*3-2].y = SCY(points[i].p1.y);
pts[i*3-1].x = SCX(points[i].p2.x);
pts[i*3-1].y = SCY(points[i].p2.y);
/* end point */
pts[i*3 ].x = SCX(points[i].p3.x);
pts[i*3 ].y = SCY(points[i].p3.y);
break;
default:
break;
}
}
hPen = UsePen(renderer, colour);
W32::PolyBezier(renderer->hFileDC,
pts, (numpoints-1)*3+1);
DonePen(renderer, hPen);
g_free(pts);
}
示例6: follow_path
/*
pa0 - scale factor for x speed
pa1 - scale factor for y speed
pa10 - address of path
*/
WORD follow_path(long pa0,long pa1,PATHPTR *pa10)
{
OBJECT *obj=current_proc->pa8;
/* fp_e0 */
do
{
if (pa10->p_xvel==SCX(0xeac) && pa10->p_yvel==SCY(0xeac))
{
/* fpp9 */
return(SYSTEM_CARRY_CLR);
}
obj->oxvel.pos=safe32mult(pa10->p_xvel,pa0);
obj->oyvel.pos=safe32mult(pa10->p_yvel,pa1);
//obj->oxvel.pos=pa10->p_xvel;
//obj->oyvel.pos=pa10->p_yvel;
current_proc->a11=pa10->p_time;
/* fp_e2 */
do
{
if (obj->oxpos.u.intpos<-SCX(40))
obj->oxpos.u.intpos=-SCX(40);
if (obj->oxpos.u.intpos>SCX(440))
obj->oxpos.u.intpos=SCX(440);
process_sleep(1);
if (are_we_shot()==SYSTEM_CARRY_SET)
{
return(fp_9d());
}
if (are_we_hitting_player()!=0)
{
kill_player();
return(fp_9d());
}
/* fp_e3 */
if (randper(pa10->p_shot+shoot_randper)==SYSTEM_CARRY_SET)
{
start_enemy_missile();
//start_enemy_missile();
}
/* fp_e4 */
}
while(--current_proc->a11>0);
pa10++;
}
while(1);
}
示例7: hatb_drip
void hatb_drip(void)
{
(OBJECT *)current_proc->a11=current_proc->pa8;
get_jt_blood;
a11_blood_lineup(SCX(0x10),SCY(0x60));
set_proj_vel(current_proc->pa8,SCX(0x20000)+randu(SCX(0x60000)),-1);
stack_jump(drip_entry);
}
示例8: check_direction
int check_direction( int dir ) {
int pos, tile;
if( !dir ) {
msg("You have to specify a direction when building a mine (i.e. 'build mine to the north').");
return -1;
}
set_direction(SINVERT_C(dir));
// Multiply up.
dir = SMAKE_C(SCX(dir)*5, SCY(dir)*3, 0);
pos = OFFSET_C(this_player()->query_coord(), dir);
// Snap to grid
pos = MAKE_C(((CX(pos)-1) / 5) * 5 + 1, ((CY(pos)-1) / 3) * 3 + 1, 0);
// Now check to see if the tiletype is valid. Query the center of the tile
// to make life a bit easier.
tile = environment(this_player())->get_tiletype(CX(pos)+2, CY(pos)+1);
if( !tile ) {
msg("You can't build off the edge of the map.");
return -1;
}
tile -= '0'; // get_tiletype uses the zbuffer, which offsets by '0' ...
if( tile != LAYER_MOUNTAIN ) {
//debug("tile=="+as_string(tile)+", pos = "+MAKE_CSTR(pos));
msg( "Mines must be built against a mountain face. Find a mountainous place." );
return -1;
}
// Offset horizontally a bit to make the entrance stick out...
if( SCX(dir) )
pos = OFFSET_C(pos, SMAKE_C(-SCX(dir) / 5,0,0));
// If facing south, adjust to find the entrance.
// The mountain tiles have funny patterns, and this helps
// to compensate.
if( query_direction() == SMAKE_C(0,1,0) ) {
pos = MAKE_C(CX(pos), CY(pos)-1, CZ(pos) );
while( environment(this_player())->get_tiletype(CX(pos)+2, CY(pos)+3) == '0' + LAYER_MOUNTAIN ) {
pos = MAKE_C(CX(pos),CY(pos)+1,CZ(pos));
}
}
// This is a north-facing version to snug the mine up as close as it can go.
if( query_direction() == SMAKE_C(0,-1,0) ) {
pos = MAKE_C(CX(pos), CY(pos)-1, CZ(pos) );
while( environment(this_player())->get_tiletype(CX(pos)+2, CY(pos)) != '0' + LAYER_MOUNTAIN ) {
pos = MAKE_C(CX(pos),CY(pos)+1,CZ(pos));
}
}
set_coord( pos );
return 0;
}
示例9: sbox
void sbox(double xx0, double yy0, double xx1, double yy1){
int x0=SCX(xx0), y0=SCY(yy0), x1=SCX(xx1), y1=SCY(yy1);
int t;
if(x1<x0){ t=x0; x0=x1; x1=t; }
if(y1<y0){ t=y0; y0=y1; y1=t; }
if(x0<clipminx) x0=clipminx;
if(y0<clipminy) y0=clipminy;
if(x1>clipmaxx) x1=clipmaxx;
if(y1>clipmaxy) y1=clipmaxy;
if(x1<x0 || y1<y0) return;
m_clrwin(x0, y0, x1, y1, e1->backgr);
}
示例10: hatb2
void hatb2(void)
{
(current_proc->pa8)->oyvel.pos=srandarc(SCY(0x10000));
set_proj_vel(current_proc->pa8,SCX(0x10000)+randu(SCX(0x20000)),-1);
flip_single(current_proc->pa8);
insert_object(current_proc->pa8,&objlst);
current_proc->pa9=a_bigger;
framew(6);
blood_death(current_proc->pa8);
}
示例11: face_blood
/******************************************************************************
Function: void face_blood(void)
By: David Schwartz
Date: Mar 1995
Parameters: current_proc->a11 - dude to bloody
Returns: None
Description: hit in the face hard blood
******************************************************************************/
void face_blood(void)
{
get_jt_blood;
lineup_with_a11_offset(SCX(0x0000),-SCY(0x0010));
insert_object(current_proc->pa8,&objlst);
(current_proc->pa8)->oyvel.pos=-randu(SCY(0x12000));
set_proj_vel(current_proc->pa8,-(SCX(0x30000)+randu(SCX(0x20000))),-1);
current_proc->pa9=a_bigger;
framew(6);
blood_death(current_proc->pa8);
}
示例12: move_wave
void move_wave(void)
{
/* mw1 */
do
{
process_sleep(2);
if (++wave_x_position>SCX(155))
{
dive_randper+=2;
shoot_randper+=5;
if (shoot_randper>25)
{
shoot_randper+=25;
dive_randper=shoot_randper;
}
/* mw2 */
do
{
process_sleep(2);
wave_x_position--;
}
while(wave_x_position>0);
}
}
while(1);
}
示例13: draw_polyline
static void
draw_polyline(DiaRenderer *self,
Point *points, int num_points,
Color *line_colour)
{
WpgRenderer *renderer = WPG_RENDERER (self);
int i;
gint16* pData;
DIAG_NOTE(g_message("draw_polyline n:%d %f,%f ...",
num_points, points->x, points->y));
g_return_if_fail(1 < num_points);
WriteLineAttr(renderer, line_colour);
WriteRecHead(renderer, WPG_POLYLINE, num_points * 2 * sizeof(gint16) + sizeof(gint16));
pData = g_new(gint16, num_points * 2);
/* number of points */
pData[0] = num_points;
fwrite_le(pData, sizeof(gint16), 1, renderer->file);
/* point data */
for (i = 0; i < num_points; i++)
{
pData[2*i] = SCX(points[i].x);
pData[2*i+1] = SCY(-points[i].y);
}
fwrite_le(pData, sizeof(gint16), num_points*2, renderer->file);
g_free(pData);
}
示例14: hatb1
void hatb1(void)
{
(OBJECT *)current_proc->a11=current_proc->pa8;
get_jt_blood;
a11_blood_lineup(SCX(0x10),SCY(0x38));
stack_jump(hatb2);
}
示例15: draw_ellipse
static void
draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
Color *fill, Color *stroke)
{
WpgRenderer *renderer = WPG_RENDERER (self);
WPGEllipse ell;
DIAG_NOTE(g_message("draw_ellipse %fx%f center @ %f,%f",
width, height, center->x, center->y));
ell.x = SCX(center->x);
ell.y = SCY(-center->y);
ell.RotAngle = 0;
ell.rx = SC(width / 2.0);
ell.ry = SC(height / 2.0);
ell.StartAngle = 0;
ell.EndAngle = 360;
ell.Flags = 0;
if (stroke)
WriteLineAttr(renderer, stroke);
if (fill)
WriteFillAttr(renderer, fill, TRUE);
WriteRecHead(renderer, WPG_ELLIPSE, sizeof(WPGEllipse));
g_assert(16 == sizeof(WPGEllipse));
fwrite_le(&ell, sizeof(guint16), sizeof(WPGEllipse) / sizeof(guint16), renderer->file);
if (fill)
WriteFillAttr(renderer, fill, FALSE);
}