Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Whoops, I guess RECT is reserved on Windows

  • Loading branch information...
commit 3fcd3eed11600e18470ee975f7b5c317c47a5757 1 parent 428ae91
Jer Wilson superjer authored
34 deadking/maps/patio.txt
View
@@ -0,0 +1,34 @@
+deadking 1 1
+deadking/textures/tiles.png
+24 64 24
+15 1 15
+ !!!) !!!) !!!( !!!( !!!( !!!) !!!( !!!( !!!( !!!) !!!( !!!) !!!( !!!( !!!(
+
+ !!!( !!!( !!!( !!!( !!!) !!!( !!!( !!!( !!!( !!!( !!!) !!!( !!!( !!!) !!!(
+
+ !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!) !!!( !!!( !!!)
+
+ !!!( !!!) !!!. !!!. !!!. !!!. !!!( !!!( !!!( !!!( !!!) !!!( !!!) !!!) !!!(
+
+ !!!( !!!( !!!. !!!' !!!' !!!. !!!) !!!( !!!( !!!( !!!) !!!) !!!( !!!( !!!)
+
+ !!!( !!!( !!!. !!!' !!!' !!!. !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!(
+
+ !!!) !!!( !!!. !!!. !!!. !!!. !!!( !!!) !!!( !!!) !!!( !!!+ !!!* !!!) !!!(
+
+ !!!( !!!( !!!( !!!) !!!) !!!( !!!( !!!) !!!( !!!( !!!( !!!* !!!+ !!!( !!!(
+
+ !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!( !!!* !!!* !!!) !!!(
+
+ !!!( !!!( !!!( !!!) !!!) !!!( !!!( !!!( !!!( !!!( !!!( !!!+ !!!+ !!!( !!!(
+
+ !!!( !!!( !!!) !!!( !!!( !!!) !!!( !!!( !!!) !!!) !!!( !!!+ !!!* !!!( !!!(
+
+ !!!) !!!( !!!( !!!( !!!( !!!( !!!) !!!( !!!( !!!( !!!( !!!* !!!+ !!!) !!!(
+
+ !!!( !!!( !!!( !!!) !!!( !!!) !!!( !!!( !!!- !!!- !!!- !!!+ !!!* !!!- !!!-
+
+ !!!) !!!) !!!( !!!( !!!( !!!( !!!( !!!( !!!" !!!, !!!! !!!+ !!!* !!!, !!!,
+
+ !!!) !!!( !!!) !!!) !!!( !!!( !!!( !!!) !!!, !!!! !!!, !!!* !!!+ !!!! !!!"
+
52 deadking/mod.c
View
@@ -355,11 +355,11 @@ void mod_predraw(Uint32 vidfr)
}
SJGL_SetTex( ntex );
- SJGL_Blit( &(RECT){(tile%co->tilex)*co->tilew,
- (tile/co->tilex)*co->tileh,
- co->tilew,
- co->tileh
- },
+ SJGL_Blit( &(REC){(tile%co->tilex)*co->tilew,
+ (tile/co->tilex)*co->tileh,
+ co->tilew,
+ co->tileh
+ },
TILE2NATIVE_X(co,i,j,k) - co->tileuw/2,
TILE2NATIVE_Y(co,i,j,k) + co->bsy, // right now, drawing tiles at the bottom of the cube
0 );
@@ -391,9 +391,9 @@ void mod_draw(int objid,Uint32 vidfrmod,OBJ_t *o)
void mod_huddraw(Uint32 vidfr)
{
SJGL_SetTex( sys_tex[TEX_HUD].num );
- SJGL_Blit( &(RECT){0,0,160,50}, 0, NATIVEH-50, 0 );
- SJGL_Blit( &(RECT){0,0,160,50}, 160, NATIVEH-50, 0 );
- SJGL_Blit( &(RECT){0,0,160,50}, 320, NATIVEH-50, 0 );
+ SJGL_Blit( &(REC){0,0,160,50}, 0, NATIVEH-50, 0 );
+ SJGL_Blit( &(REC){0,0,160,50}, 160, NATIVEH-50, 0 );
+ SJGL_Blit( &(REC){0,0,160,50}, 320, NATIVEH-50, 0 );
MOTHER_t *mo = fr[vidfr%maxframes].objs[0].data;
@@ -405,14 +405,14 @@ void mod_huddraw(Uint32 vidfr)
PERSON_t *pe = fr[vidfr%maxframes].objs[mo->party[i]].data;
#define BAR_W(stat) (pe->stat>0 ? 15+32*pe->stat/pe->max_##stat : 0)
- SJGL_Blit( &(RECT){0,50+6*0,BAR_W(hp),6}, 57 , NATIVEH-50+13+9*0, 0 );
- SJGL_Blit( &(RECT){0,50+6*1,BAR_W(mp),6}, 57+51, NATIVEH-50+13+9*0, 0 );
- SJGL_Blit( &(RECT){0,50+6*2,BAR_W(st),6}, 57 , NATIVEH-50+13+9*1, 0 );
- SJGL_Blit( &(RECT){0,50+6*3,BAR_W(ap),6}, 57+51, NATIVEH-50+13+9*1, 0 );
- SJGL_Blit( &(RECT){0,50+6*4,BAR_W(pn),6}, 57 , NATIVEH-50+13+9*2, 0 );
- SJGL_Blit( &(RECT){0,50+6*5,BAR_W(ml),6}, 57+51, NATIVEH-50+13+9*2, 0 );
- SJGL_Blit( &(RECT){0,50+6*6,BAR_W(to),6}, 57 , NATIVEH-50+13+9*3, 0 );
- SJGL_Blit( &(RECT){0,50+6*7,BAR_W(xp),6}, 57+51, NATIVEH-50+13+9*3, 0 );
+ SJGL_Blit( &(REC){0,50+6*0,BAR_W(hp),6}, 57 , NATIVEH-50+13+9*0, 0 );
+ SJGL_Blit( &(REC){0,50+6*1,BAR_W(mp),6}, 57+51, NATIVEH-50+13+9*0, 0 );
+ SJGL_Blit( &(REC){0,50+6*2,BAR_W(st),6}, 57 , NATIVEH-50+13+9*1, 0 );
+ SJGL_Blit( &(REC){0,50+6*3,BAR_W(ap),6}, 57+51, NATIVEH-50+13+9*1, 0 );
+ SJGL_Blit( &(REC){0,50+6*4,BAR_W(pn),6}, 57 , NATIVEH-50+13+9*2, 0 );
+ SJGL_Blit( &(REC){0,50+6*5,BAR_W(ml),6}, 57+51, NATIVEH-50+13+9*2, 0 );
+ SJGL_Blit( &(REC){0,50+6*6,BAR_W(to),6}, 57 , NATIVEH-50+13+9*3, 0 );
+ SJGL_Blit( &(REC){0,50+6*7,BAR_W(xp),6}, 57+51, NATIVEH-50+13+9*3, 0 );
#undef BAR_W
}
}
@@ -457,11 +457,11 @@ void mod_postdraw(Uint32 vidfr)
+ ((j-dny)%gh->clipboard_y)*gh->clipboard_x
+ ((i-dnx)%gh->clipboard_x)
].data[0];
- SJGL_Blit( &(RECT){(tile%co->tilex)*co->tilew,
- (tile/co->tilex)*co->tileh,
- co->tilew,
- co->tileh
- },
+ SJGL_Blit( &(REC){(tile%co->tilex)*co->tilew,
+ (tile/co->tilex)*co->tileh,
+ co->tilew,
+ co->tileh
+ },
TILE2NATIVE_X(co,i,j,k) - co->tileuw/2,
TILE2NATIVE_Y(co,i,j,k) + co->bsy, // right now, drawing tiles at the bottom of the cube
NATIVEH );
@@ -478,7 +478,7 @@ void mod_outerdraw(Uint32 vidfr,int w,int h)
glPushAttrib(GL_CURRENT_BIT);
SJGL_SetTex( mytex );
- SJGL_Blit( &(RECT){0,0,256,256}, w-256, 0, 0 );
+ SJGL_Blit( &(REC){0,0,256,256}, w-256, 0, 0 );
CONTEXT_t *co = fr[vidfr%maxframes].objs[mycontext].data;
@@ -486,10 +486,10 @@ void mod_outerdraw(Uint32 vidfr,int w,int h)
glColor4f(1,1,0,0.8f);
int x = w-256+(mytile%co->tilex)*co->tilew;
int y = (mytile/co->tilex)*co->tileh;
- SJGL_Blit( &(RECT){0,0,co->tilew+4, 2}, x- 2, y- 2, 0 );
- SJGL_Blit( &(RECT){0,0,co->tilew+4, 2}, x- 2, y+co->tileh, 0 );
- SJGL_Blit( &(RECT){0,0, 2,co->tileh}, x- 2, y , 0 );
- SJGL_Blit( &(RECT){0,0, 2,co->tileh}, x+co->tilew, y , 0 );
+ SJGL_Blit( &(REC){0,0,co->tilew+4, 2}, x- 2, y- 2, 0 );
+ SJGL_Blit( &(REC){0,0,co->tilew+4, 2}, x- 2, y+co->tileh, 0 );
+ SJGL_Blit( &(REC){0,0, 2,co->tileh}, x- 2, y , 0 );
+ SJGL_Blit( &(REC){0,0, 2,co->tileh}, x+co->tilew, y , 0 );
SJF_DrawText( w-256, 260, mytex < tex_count ? textures[mytex].filename : "ERROR! mytex > tex_count" );
4 deadking/obj_amigo.c
View
@@ -68,8 +68,8 @@ void obj_amigo_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
SJGL_SetTex( sys_tex[TEX_AMIGO].num );
int c = POINT2NATIVE_X(am->pos);
int d = POINT2NATIVE_Y(am->pos);
- SJGL_Blit(&(RECT){ x, y, w, h }, c-34, d-32, z);
- SJGL_Blit(&(RECT){ tip.x, tip.y, tip.w, tip.h }, c-34+tip.dx, d-32+tip.dy, z);
+ SJGL_Blit(&(REC){ x, y, w, h }, c-34, d-32, z);
+ SJGL_Blit(&(REC){ tip.x, tip.y, tip.w, tip.h }, c-34+tip.dx, d-32+tip.dy, z);
}
void obj_amigo_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
2  deadking/obj_amigosword.c
View
@@ -18,7 +18,7 @@ void obj_amigosword_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
int posx = TILE2NATIVE_X(co,sw->pos.x/16,0,sw->pos.y/16);
int posy = TILE2NATIVE_Y(co,sw->pos.x/16,0,sw->pos.y/16);
SJGL_SetTex( sys_tex[TEX_AMIGO].num );
- SJGL_Blit( &(RECT){ 200, 50+50*(hotfr%3), 56, 50 }, posx-25, posy-28, sw->pos.y );
+ SJGL_Blit( &(REC){ 200, 50+50*(hotfr%3), 56, 50 }, posx-25, posy-28, sw->pos.y );
}
void obj_amigosword_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
2  deadking/obj_bullet.c
View
@@ -18,7 +18,7 @@ void obj_bullet_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
int g = POINT2NATIVE_X(bu->pos);
int h = POINT2NATIVE_Y(bu->pos);
SJGL_SetTex( sys_tex[TEX_PLAYER].num );
- SJGL_Blit( &(RECT){144,150,4,4}, g-2, h-2, NATIVEH );
+ SJGL_Blit( &(REC){144,150,4,4}, g-2, h-2, NATIVEH );
}
void obj_bullet_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
4 deadking/obj_dummy.c
View
@@ -25,12 +25,12 @@ void obj_dummy_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
SJGL_SetTex( sys_tex[TEX_WORLD].num );
if( w > h ) while( w>0 && w<400 ) {
- SJGL_Blit( &(RECT){offs, 16,16,16}, c, d, 0 );
+ SJGL_Blit( &(REC){offs, 16,16,16}, c, d, 0 );
c += 16;
w -= 16;
offs = w==16 ? 32 : 16;
} else while( h>0 && h<400 ) {
- SJGL_Blit( &(RECT){ 48,offs,16,16}, c, d, 0 );
+ SJGL_Blit( &(REC){ 48,offs,16,16}, c, d, 0 );
d += 16;
h -= 16;
offs = h==16 ? 32 : 16;
2  deadking/obj_ghost.c
View
@@ -22,7 +22,7 @@ void obj_ghost_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
int h = TILE2NATIVE_Y(co, gh->pos.x, gh->pos.y, gh->pos.z);
SJGL_SetTex( sys_tex[TEX_PLAYER].num );
- SJGL_Blit( &(RECT){80,177,16,16}, g, h, NATIVEH );
+ SJGL_Blit( &(REC){80,177,16,16}, g, h, NATIVEH );
}
void obj_ghost_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
6 deadking/obj_person.c
View
@@ -18,10 +18,10 @@ void obj_person_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
int c = POINT2NATIVE_X(pe->pos);
int d = POINT2NATIVE_Y(pe->pos);
SJGL_SetTex( sys_tex[TEX_PERSON].num );
- RECT rect;
+ REC rect;
int flip = 0;
- #define P_REC(x,y,w,h) (rect = (RECT){(x)*17,(y)*45,(w)*17,(h)*45})
+ #define P_REC(x,y,w,h) (rect = (REC){(x)*17,(y)*45,(w)*17,(h)*45})
switch( (pe->walkcounter/4) % 4 ) { // entangled_walkcounter
case 0:
case 2: switch( pe->dir ) { // standing
@@ -73,7 +73,7 @@ void obj_person_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
SJGL_Blit( &rect, x, y, d );
// draw shadow
- SJGL_Blit( &(RECT){0 ,502,20,10}, c-10, d-5 , d-1 );
+ SJGL_Blit( &(REC){0 ,502,20,10}, c-10, d-5 , d-1 );
}
void obj_person_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
16 deadking/obj_player.c
View
@@ -30,31 +30,31 @@ void obj_player_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
if( pl->facingr ) {
if( pl->model==4 ) //girl hair
- SJGL_Blit( &(RECT){80,120,20,15}, c-4, d+(pl->goingd?4:0)+pl->gundown/7, r );
+ SJGL_Blit( &(REC){80,120,20,15}, c-4, d+(pl->goingd?4:0)+pl->gundown/7, r );
- SJGL_Blit( &(RECT){ushift,pl->model*30,20,30}, c, d, r);
+ SJGL_Blit( &(REC){ushift,pl->model*30,20,30}, c, d, r);
if( !pl->stabbing ) //gun
- SJGL_Blit( &(RECT){ 0+gunshift,150,24,27}, c+5-pl->gunback, d+5+pl->gundown/5, r );
+ SJGL_Blit( &(REC){ 0+gunshift,150,24,27}, c+5-pl->gunback, d+5+pl->gundown/5, r );
} else {
if( pl->model==4 ) //girl hair
- SJGL_Blit( &(RECT){100,120,20,15}, c+4, d+(pl->goingd?4:0)+pl->gundown/7, r );
+ SJGL_Blit( &(REC){100,120,20,15}, c+4, d+(pl->goingd?4:0)+pl->gundown/7, r );
- SJGL_Blit( &(RECT){ushift,pl->model*30,20,30}, c, d, r);
+ SJGL_Blit( &(REC){ushift,pl->model*30,20,30}, c, d, r);
if( !pl->stabbing ) //gun
- SJGL_Blit( &(RECT){24+gunshift,150,24,27}, c-9+pl->gunback, d+5+pl->gundown/5, r );
+ SJGL_Blit( &(REC){24+gunshift,150,24,27}, c-9+pl->gunback, d+5+pl->gundown/5, r );
}
if( pl->stabbing ) //up/down stabbing
- SJGL_Blit( &(RECT){148+(pl->stabbing<0?5:0),150,5,27}, c+8, d-(pl->stabbing<0?15:-15), r );
+ SJGL_Blit( &(REC){148+(pl->stabbing<0?5:0),150,5,27}, c+8, d-(pl->stabbing<0?15:-15), r );
// draw shadow
V shadow = (V){pl->pos.x, co->bsy*co->y, pl->pos.z};
int sc = POINT2NATIVE_X(shadow) - 10;
int sd = POINT2NATIVE_Y(shadow) - 5;
SJGL_SetTex( sys_tex[TEX_PERSON].num );
- SJGL_Blit( &(RECT){0,246,20,10}, sc, sd, r-1 );
+ SJGL_Blit( &(REC){0,246,20,10}, sc, sd, r-1 );
}
void obj_player_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
2  deadking/obj_slug.c
View
@@ -18,7 +18,7 @@ void obj_slug_draw( int objid, Uint32 vidfr, OBJ_t *o, CONTEXT_t *co )
int c = POINT2NATIVE_X(sl->pos);
int d = POINT2NATIVE_Y(sl->pos);
SJGL_SetTex( sys_tex[TEX_PLAYER].num );
- SJGL_Blit( &(RECT){(sl->vel.x>0?20:0)+(sl->dead?40:0),177,20,16}, c-10, d-8, sl->pos.y );
+ SJGL_Blit( &(REC){(sl->vel.x>0?20:0)+(sl->dead?40:0),177,20,16}, c-10, d-8, sl->pos.y );
}
void obj_slug_adv( int objid, Uint32 a, Uint32 b, OBJ_t *oa, OBJ_t *ob )
2  engine/sjdl.c
View
@@ -59,7 +59,7 @@ void SJGL_SetTex(GLuint tex)
//uses GL to do draw a sprite
-int SJGL_Blit(RECT *s, int x, int y, int z)
+int SJGL_Blit(REC *s, int x, int y, int z)
{
if( z<0 ) z = (y+s->h)*-z;
4 engine/sjdl.h
View
@@ -15,12 +15,12 @@
typedef struct{
int x,y,w,h;
-} RECT;
+} REC;
SDL_Surface *SJDL_CopyScaled(SDL_Surface *src, Uint32 flags, int scale);
void SJGL_SetTex(GLuint tex);
-int SJGL_Blit(RECT *s, int x, int y, int z);
+int SJGL_Blit(REC *s, int x, int y, int z);
void SJDL_SetPixel(SDL_Surface *surf, int x, int y, Uint8 R, Uint8 G, Uint8 B);
void SJDL_GetPixel(SDL_Surface *surf, int x, int y, Uint8 *R, Uint8 *G, Uint8 *B);
GLenum SJDL_GLFormatOf(SDL_Surface *surf);
8 engine/video.c
View
@@ -178,11 +178,11 @@ void render()
if( flags & CBF_SOLID ) {
glColor4f(1,0,0,1);
- SJGL_Blit( &(RECT){0,0,16,16}, x*16, y*16, z );
- SJGL_Blit( &(RECT){0,0,12,12}, x*16+2, y*16+2, z );
+ SJGL_Blit( &(REC){0,0,16,16}, x*16, y*16, z );
+ SJGL_Blit( &(REC){0,0,12,12}, x*16+2, y*16+2, z );
} else if( flags & CBF_PLAT ) {
glColor4f(0,1,0,1);
- SJGL_Blit( &(RECT){0,0,16, 2}, x*16, y*16, z );
+ SJGL_Blit( &(REC){0,0,16, 2}, x*16, y*16, z );
}
}
}
@@ -193,7 +193,7 @@ void render()
V *pos = flex(o,OBJF_POS);
V *hull = flex(o,OBJF_HULL);
if( pos && hull ) {
- RECT rect = (RECT){0, 0, hull[1].x-hull[0].x, hull[1].y-hull[0].y};
+ REC rect = (REC){0, 0, hull[1].x-hull[0].x, hull[1].y-hull[0].y};
SJGL_Blit( &rect, pos->x+hull[0].x, pos->y+hull[0].y, 0 );
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.