ref: 5b6f23990a4006e4811491f336d3a586836fbac2
parent: 90da953b2310151b5a56f3ea78d8528100fd1fa0
author: Simon Howard <[email protected]>
date: Sat Sep 6 16:36:54 EDT 2008
Split off patch code from r_defs.h into a common file. Remove dependency of v_video.h on Doom rendering code. Subversion-branch: /branches/raven-branch Subversion-revision: 1206
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -51,6 +51,7 @@
s_sound.c s_sound.h \
tables.c tables.h \
v_video.c v_video.h \
+ v_patch.h \
w_checksum.c w_checksum.h \
w_wad.c w_wad.h \
w_file.c w_file.h \
--- a/src/doom/r_defs.h
+++ b/src/doom/r_defs.h
@@ -44,6 +44,7 @@
#include "i_video.h"
+#include "v_patch.h"
@@ -284,18 +285,6 @@
-// posts are runs of non masked source pixels
-typedef struct
-{
- byte topdelta; // -1 is the last post in a column
- byte length; // length data bytes follows
-} PACKEDATTR post_t;
-
-// column_t is a list of 0 or more post_t, (byte)-1 terminated
-typedef post_t column_t;
-
-
-
// PC direct to screen pointers
//B UNUSED - keep till detailshift in r_draw.c resolved
//extern byte* destview;
@@ -348,27 +337,6 @@
short* maskedtexturecol;
} drawseg_t;
-
-
-
-// Patches.
-// A patch holds one or more columns.
-// Patches are used for sprites and all masked pictures,
-// and we compose textures from the TEXTURE1/2 lists
-// of patches.
-typedef struct
-{
- short width; // bounding box size
- short height;
- short leftoffset; // pixels to the left of origin
- short topoffset; // pixels below the origin
- int columnofs[8]; // only [width] used
- // the [0] is &columnofs[width]
-} PACKEDATTR patch_t;
-
-
-
-
--- a/src/f_wipe.c
+++ b/src/f_wipe.c
@@ -24,9 +24,7 @@
//
//-----------------------------------------------------------------------------
-
-
-
+#include <string.h>
#include "z_zone.h"
#include "i_video.h"
--- /dev/null
+++ b/src/v_patch.h
@@ -1,0 +1,58 @@
+// Emacs style mode select -*- C++ -*-
+//-----------------------------------------------------------------------------
+//
+// Copyright(C) 1993-1996 Id Software, Inc.
+// Copyright(C) 2005 Simon Howard
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 2
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+// 02111-1307, USA.
+//
+// DESCRIPTION:
+// Refresh/rendering module, shared data struct definitions.
+//
+//-----------------------------------------------------------------------------
+
+
+#ifndef V_PATCH_H
+#define V_PATCH_H
+
+// Patches.
+// A patch holds one or more columns.
+// Patches are used for sprites and all masked pictures,
+// and we compose textures from the TEXTURE1/2 lists
+// of patches.
+
+typedef struct
+{
+ short width; // bounding box size
+ short height;
+ short leftoffset; // pixels to the left of origin
+ short topoffset; // pixels below the origin
+ int columnofs[8]; // only [width] used
+ // the [0] is &columnofs[width]
+} PACKEDATTR patch_t;
+
+// posts are runs of non masked source pixels
+typedef struct
+{
+ byte topdelta; // -1 is the last post in a column
+ byte length; // length data bytes follows
+} PACKEDATTR post_t;
+
+// column_t is a list of 0 or more post_t, (byte)-1 terminated
+typedef post_t column_t;
+
+#endif
+
--- a/src/v_video.c
+++ b/src/v_video.c
@@ -30,7 +30,6 @@
#include "i_system.h"
-#include "r_local.h"
#include "doomtype.h"
#include "doomdata.h"
--- a/src/v_video.h
+++ b/src/v_video.h
@@ -33,7 +33,7 @@
#include "doomtype.h"
// Needed because we are refering to patches.
-#include "r_data.h"
+#include "v_patch.h"
//
// VIDEO