From fc209ddba4edd51781af6faabea3a7226ba6a7e4 Mon Sep 17 00:00:00 2001 From: "Azamat H. Hackimov" Date: Sun, 28 Jul 2024 05:43:10 +0300 Subject: [PATCH] Remove unused texture.h --- 2dlib/surface.cpp | 1 - Descent3/gametexture.cpp | 1 - Descent3/lighting.cpp | 1 - Descent3/megacell.cpp | 6 - Descent3/procedurals.cpp | 2 - Descent3/render.cpp | 6 - Descent3/terrain.cpp | 2 - Descent3/terrainrender.cpp | 3 - bitmap/bitmain.cpp | 3 +- bitmap/tga.cpp | 1 - editor/MainFrm.cpp | 4 +- editor/ProceduralDialog.cpp | 3 +- editor/TerrainDialog.cpp | 1 - editor/TextureDialog.cpp | 1 - editor/WireframeGrWnd.cpp | 10 +- editor/WorldTexturesDialog.cpp | 3 +- editor/drawworld.cpp | 4 +- editor/editorView.cpp | 1 - editor/editor_lighting.cpp | 1 - editor/editor_object_lighting.cpp | 7 - lib/texture.h | 233 ------------------------------ 21 files changed, 7 insertions(+), 287 deletions(-) delete mode 100644 lib/texture.h diff --git a/2dlib/surface.cpp b/2dlib/surface.cpp index 3a924580..df72ea26 100644 --- a/2dlib/surface.cpp +++ b/2dlib/surface.cpp @@ -93,7 +93,6 @@ #include "lib2d.h" #include "pserror.h" #include "renderer.h" -#include "texture.h" static inline unsigned XLAT_RGB_TO_16(ddgr_color c) { uint8_t r, g, b; diff --git a/Descent3/gametexture.cpp b/Descent3/gametexture.cpp index c9961f0c..c6f334aa 100644 --- a/Descent3/gametexture.cpp +++ b/Descent3/gametexture.cpp @@ -272,7 +272,6 @@ #include "bitmap.h" #include "pserror.h" #include "vclip.h" -#include "texture.h" #include "game.h" #include "bumpmap.h" #include diff --git a/Descent3/lighting.cpp b/Descent3/lighting.cpp index f99fbe91..af892579 100644 --- a/Descent3/lighting.cpp +++ b/Descent3/lighting.cpp @@ -25,7 +25,6 @@ */ #include "3d.h" -#include "texture.h" #include "gametexture.h" #include "lighting.h" #include "lightmap.h" diff --git a/Descent3/megacell.cpp b/Descent3/megacell.cpp index efc9c022..ced1a5f3 100644 --- a/Descent3/megacell.cpp +++ b/Descent3/megacell.cpp @@ -37,15 +37,9 @@ * $NoKeywords: $ */ -#include "pstypes.h" #include "pserror.h" -#include "terrain.h" -#include "texture.h" -#include "gametexture.h" #include "megacell.h" #include "bitmap.h" -#include -#include #include #include diff --git a/Descent3/procedurals.cpp b/Descent3/procedurals.cpp index 0b5532fe..55152b2e 100644 --- a/Descent3/procedurals.cpp +++ b/Descent3/procedurals.cpp @@ -47,9 +47,7 @@ #include "bitmap.h" #include "gr.h" #include "gametexture.h" -#include "vclip.h" #include "game.h" -#include "texture.h" #include "mem.h" #include "ddio.h" #include "config.h" diff --git a/Descent3/render.cpp b/Descent3/render.cpp index 0368e569..d2e471ee 100644 --- a/Descent3/render.cpp +++ b/Descent3/render.cpp @@ -31,13 +31,9 @@ #include "render.h" #include #include -#include "descent.h" #include "3d.h" #include "mono.h" #include "gametexture.h" -#include "texture.h" -#include "vclip.h" -#include "program.h" #include "game.h" #include "renderobject.h" #include "door.h" @@ -54,14 +50,12 @@ #include "scorch.h" #include "findintersection.h" #include "special_face.h" -#include "BOA.h" #include "config.h" #include "gameloop.h" #include "doorway.h" #include "TelComAutoMap.h" #include "postrender.h" #include "mem.h" -#include "Macros.h" #include "psrand.h" #include "player.h" #include "args.h" diff --git a/Descent3/terrain.cpp b/Descent3/terrain.cpp index 494ac30c..84423b2f 100644 --- a/Descent3/terrain.cpp +++ b/Descent3/terrain.cpp @@ -26,7 +26,6 @@ #include "mono.h" #include "terrain.h" #include "pserror.h" -#include "texture.h" #include "bitmap.h" #include "gametexture.h" #include "lighting.h" @@ -34,7 +33,6 @@ #include "weather.h" #include #include "mem.h" -#include "Macros.h" #include "dedicated_server.h" #include "psrand.h" #ifdef EDITOR diff --git a/Descent3/terrainrender.cpp b/Descent3/terrainrender.cpp index 12c1f1a8..05b4d004 100644 --- a/Descent3/terrainrender.cpp +++ b/Descent3/terrainrender.cpp @@ -801,7 +801,6 @@ void RenderMine(int viewer_roomnum, int flag_automap, int called_from_terrain, b #include "descent.h" #include "render.h" #include "game.h" -#include "texture.h" #include "ddio.h" #include "polymodel.h" #include "lighting.h" @@ -815,12 +814,10 @@ void RenderMine(int viewer_roomnum, int flag_automap, int called_from_terrain, b #include "editor\d3edit.h" #endif #include "fireball.h" -#include #include #include "config.h" #include "gameloop.h" #include "postrender.h" -#include "Macros.h" #include "psrand.h" #include "player.h" diff --git a/bitmap/bitmain.cpp b/bitmap/bitmain.cpp index a0f2a6d5..6a6edfa9 100644 --- a/bitmap/bitmain.cpp +++ b/bitmap/bitmain.cpp @@ -305,9 +305,7 @@ #include #include "cfile.h" -#include "texture.h" #include "bitmap.h" -#include "pstypes.h" #include "pserror.h" #include "mono.h" #include "iff.h" @@ -316,6 +314,7 @@ #include "bumpmap.h" #include "mem.h" #include "psrand.h" +#include "grdefs.h" #define BM_FILETYPE_TGA 1 #define BM_FILETYPE_PCX 2 diff --git a/bitmap/tga.cpp b/bitmap/tga.cpp index 072da9cf..18c610cc 100644 --- a/bitmap/tga.cpp +++ b/bitmap/tga.cpp @@ -138,7 +138,6 @@ #include "bitmap.h" #include "mono.h" #include "grdefs.h" -#include "texture.h" #include "byteswap.h" #include #include "mem.h" diff --git a/editor/MainFrm.cpp b/editor/MainFrm.cpp index 40393ab1..568735e7 100644 --- a/editor/MainFrm.cpp +++ b/editor/MainFrm.cpp @@ -807,7 +807,7 @@ // D3 EDITOR HEADERS #include "pserror.h" -#include "Application.h" +#include "application.h" #include "AppDatabase.h" #include "program.h" #include "gr.h" @@ -831,7 +831,6 @@ #include "objinfo.h" #include "HFile.h" #include "hroom.h" -#include "texture.h" #include "read3ds.h" #include "terrain.h" #include "HObject.h" @@ -843,6 +842,7 @@ #include "ViewerPropDlg.h" #include "mem.h" #include "findintersection.h" +#include "renderer.h" #ifdef _DEBUG #define new DEBUG_NEW diff --git a/editor/ProceduralDialog.cpp b/editor/ProceduralDialog.cpp index b61aeb24..7aa55435 100644 --- a/editor/ProceduralDialog.cpp +++ b/editor/ProceduralDialog.cpp @@ -29,8 +29,7 @@ #include "pserror.h" #include "mono.h" #include "vclip.h" -#include "macros.h" -#include "texture.h" +#include "Macros.h" #include "EditLineDialog.h" #include "ddio.h" #include "game.h" diff --git a/editor/TerrainDialog.cpp b/editor/TerrainDialog.cpp index a86698f0..d714925e 100644 --- a/editor/TerrainDialog.cpp +++ b/editor/TerrainDialog.cpp @@ -219,7 +219,6 @@ #include "terrain.h" #include "gametexture.h" #include "bitmap.h" -#include "texture.h" #include "group.h" #include "editor/d3edit.h" #include "room.h" diff --git a/editor/TextureDialog.cpp b/editor/TextureDialog.cpp index 64af3351..42849763 100644 --- a/editor/TextureDialog.cpp +++ b/editor/TextureDialog.cpp @@ -155,7 +155,6 @@ #include "TextureDialog.h" #include "HTexture.h" -#include "texture.h" #include "gametexture.h" #include "gr.h" #include "descent.h" diff --git a/editor/WireframeGrWnd.cpp b/editor/WireframeGrWnd.cpp index 406aaf6c..f0515c86 100644 --- a/editor/WireframeGrWnd.cpp +++ b/editor/WireframeGrWnd.cpp @@ -190,14 +190,11 @@ #include "moveworld.h" #include "selectedroom.h" #include "terrain.h" -#include "texture.h" #include "bitmap.h" #include "erooms.h" -#include #include "gr.h" #include "mono.h" -#include "macros.h" #include "ddio.h" #include "SelManager.h" #include "room.h" @@ -623,7 +620,6 @@ void CWireframeGrWnd::SetMagCoords(int x1, int y1, int x2, int y2) { void CWireframeGrWnd::DrawTerrainCell(int seg) { grSurface *cur_surf; uint16_t *destptr; - int lightval; int i, t, x, y; int segx = seg % TERRAIN_WIDTH; int segz = seg / TERRAIN_WIDTH; @@ -652,12 +648,8 @@ void CWireframeGrWnd::DrawTerrainCell(int seg) { uint16_t fadepixel = 0; int bm_handle = GameTextures[Terrain_tex_seg[Terrain_seg[(y * TERRAIN_WIDTH + x)].texseg_index].tex_index].bm_handle; - lightval = Ubyte_to_float[Terrain_seg[y * TERRAIN_WIDTH + x].l] * (MAX_TEXTURE_SHADES - 1); - uint16_t pix; - - pix = *bm_data(bm_handle, 0); - // fadepixel=(TexShadeTable16[lightval][pix>>8])+TexShadeTable8[lightval][pix & 0xFF]; + uint16_t pix = *bm_data(bm_handle, 0); if (TerrainSelected[y * TERRAIN_WIDTH + x]) { int red = ((fadepixel >> 10) & 0x1f) << 3; diff --git a/editor/WorldTexturesDialog.cpp b/editor/WorldTexturesDialog.cpp index 1fd13819..a105c0ba 100644 --- a/editor/WorldTexturesDialog.cpp +++ b/editor/WorldTexturesDialog.cpp @@ -249,8 +249,7 @@ #include "pserror.h" #include "mono.h" #include "vclip.h" -#include "macros.h" -#include "texture.h" +#include "Macros.h" #include "EditLineDialog.h" #include "ddio.h" #include "polymodel.h" diff --git a/editor/drawworld.cpp b/editor/drawworld.cpp index b57851d7..4f8f4dd4 100644 --- a/editor/drawworld.cpp +++ b/editor/drawworld.cpp @@ -211,14 +211,12 @@ #include "descent.h" #include "d3edit.h" -#include "render.h" #include "selectedroom.h" #include "terrain.h" -#include "texture.h" -#include "gametexture.h" #include "object.h" #include "erooms.h" #include "group.h" +#include "renderer.h" int Draw_all_rooms = 1; diff --git a/editor/editorView.cpp b/editor/editorView.cpp index 668aed60..a2d93146 100644 --- a/editor/editorView.cpp +++ b/editor/editorView.cpp @@ -343,7 +343,6 @@ #include "args.h" #include "terrain.h" -#include "texture.h" #include "mem.h" diff --git a/editor/editor_lighting.cpp b/editor/editor_lighting.cpp index fb00324b..eaba0633 100644 --- a/editor/editor_lighting.cpp +++ b/editor/editor_lighting.cpp @@ -27,7 +27,6 @@ #include #include #include "3d.h" -#include "texture.h" #include "gametexture.h" #include "erooms.h" #include "editor_lighting.h" diff --git a/editor/editor_object_lighting.cpp b/editor/editor_object_lighting.cpp index 73674f73..3b2dee91 100644 --- a/editor/editor_object_lighting.cpp +++ b/editor/editor_object_lighting.cpp @@ -19,21 +19,14 @@ #include #include "3d.h" -#include "texture.h" #include "gametexture.h" -#include "erooms.h" #include "editor_lighting.h" -#include "descent.h" #include "room.h" #include "lightmap.h" #include "polymodel.h" -#include "objinfo.h" #include #include -#include "terrain.h" #include "radiosity.h" -#include "lighting.h" -#include "findintersection.h" #include "lightmap_info.h" #include "object_lighting.h" #include "mem.h" diff --git a/lib/texture.h b/lib/texture.h deleted file mode 100644 index 38b20885..00000000 --- a/lib/texture.h +++ /dev/null @@ -1,233 +0,0 @@ -/* -* Descent 3 -* Copyright (C) 2024 Parallax Software -* -* 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 3 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, see . - ---- HISTORICAL COMMENTS FOLLOW --- - - * $Logfile: /DescentIII/Main/lib/texture.h $ - * $Revision: 9 $ - * $Date: 5/05/98 3:02p $ - * $Author: Jason $ - * - * Header for texture mapper library - * - * $Log: /DescentIII/Main/lib/texture.h $ - * - * 9 5/05/98 3:02p Jason - * attempting to add different screen resolutions - * - * 8 1/14/98 5:49p Jeff - * tex_LFBLock stuff added (samir.) - * - * 7 12/22/97 7:32p Samir - * Took out include to gr.h - * - * 6 12/19/97 5:22p Samir - * Added more drawing primatives for software. - * - * 5 12/19/97 12:20p Jason - * changes for better 2d/3d system integration - * - * 4 10/15/97 5:20p Jason - * did a HUGE overhaul of the bitmap system - * - * 3 9/16/97 4:09p Jason - * implemented software zbuffer - * - * 2 9/09/97 12:34p Jason - * made software transparency work correctly with new alpha type - * - * 2 6/24/97 7:45p Matt - * Removed include of manage.h - * - * 1 6/23/97 9:25p Samir - * added because source safe sucks - * - * 40 5/22/97 11:59a Jason - * add a ScaleBitmap function to the abstracted render library - * - * 39 5/19/97 5:10p Jason - * changes for our new abstracted renderer code - * - * 38 5/12/97 11:41a Jason - * made game work (default) to 16bit no mip maps mode - * Saves us alot of memory - * - * 37 5/01/97 4:37p Jason - * added alpha blending (slow) - * - * 36 4/30/97 3:15p Jason - * changes to support both 8bit and 16bit rendering in software - * - * 35 4/11/97 4:20p Jason - * implemented a general fog system - * - * 34 3/25/97 2:33p Jason - * added Software_renderer byte - * - * 33 3/20/97 11:54a Jason - * changes to support special triangle drawer - * - * 32 3/14/97 4:33p Jason - * added tex_SetMipState function - * - * 31 3/13/97 6:19p Jason - * implemented tex_GetRenderType function - * - * 30 2/26/97 6:00p Matt - * Renamed 3d lib structs for D3 naming convention - * - * $NoKeywords: $ - */ - -#ifndef TEXTURE_H -#define TEXTURE_H - -#include "3d.h" -#include "pstypes.h" -#include "renderer.h" - -#define MAX_TEXTURE_SHADES 32 - -struct texs_texpoint { - int screenx, screeny; - float flscreenx, flscreeny; - - fix ucoord, vcoord; - float flucoord, flvcoord, flzcoord; - - fix monolight; - fix redlight, greenlight, bluelight; -}; - -// For the following enum table: LIN=Linear, PER=Perspective, NON=No Transparency, LIT = Shaded, -// COLORED=Colored lighting, TRANS=Transparency -// ALPHA=Alpha renderer - -#define MAX_RENDER_TYPES 15 - -extern void (*Texture_functions[])(g3Point *, int); - -// Our shade tables -extern uint8_t TexShadeTable8[MAX_TEXTURE_SHADES][256]; -extern uint32_t TexShadeTable16[MAX_TEXTURE_SHADES][256]; -extern uint8_t TexRevShadeTable8[MAX_TEXTURE_SHADES][256]; -extern uint32_t TexRevShadeTable16[MAX_TEXTURE_SHADES][256]; - -int tex_Init(); - -// These are the different routines for drawing the various types of effects on a texture -void tex_PerUnlitTexturedQuad(g3Point *, int); -void tex_PerLitTexturedQuad(g3Point *, int); -void tex_UnlitTexturedQuad(g3Point *, int); -void tex_LitTexturedQuad(g3Point *, int); -void tex_ColoredTexturedQuad(g3Point *, int); -void tex_PerColoredTexturedQuad(g3Point *, int); -void tex_UnlitTransQuad(g3Point *, int); -void tex_LitTransQuad(g3Point *, int); -void tex_PerUnlitTransQuad(g3Point *, int); -void tex_PerLitTransQuad(g3Point *, int); -void tex_LinFlatShade(g3Point *, int); -void tex_PerFlatShade(g3Point *, int); -void tex_LitTexturedTriangle(g3Point *, int); -void tex_FlatPolyTriangle(g3Point *, int); -void tex_SetFlatColor(ddgr_color color); -void tex_UnlitTexturedQuad16(g3Point *p, int nv); -void tex_LitTexturedQuad16(g3Point *p, int nv); -void tex_PerUnlitTexturedQuad16(g3Point *p, int nv); -void tex_PerLitTexturedQuad16(g3Point *p, int nv); -void tex_LitTexturedTriangle16(g3Point *p, int nv); -void tex_LinFlatShade16(g3Point *p, int nv); -void tex_PerFlatShade16(g3Point *p, int nv); -void tex_AlphaTexturedQuad(g3Point *p, int nv); - -// These functions get the extremes of a polygon -void tex_GetVertexOrdering(texs_texpoint *t, int nv, int *vlt, int *vlb, int *vrt, int *vrb, int *bottom_y_ind); -int tex_PrevIndex(int val, int modulus); -int tex_NextIndex(int val, int modulus); - -// Builds the 1/n table -void tex_BuildRecipTable(); - -// Draws a solid color polygon. "color" is a color in 5-6-5 format. -void tex_DrawFlatPolygon(g3Point **pv, int nv); - -// Given a handle to a texture and nv point vertices, does a fan algorithm to draw them all -// Uses the function set by tex_SetRenderType -void tex_DrawPointList(int handle, g3Point **p, int nv); - -// Tells the software renderer whether or not to use mipping -void tex_SetMipState(int); - -// Sets the fog state to TRUE or FALSE -void tex_SetFogState(int on); - -// Sets the a lighting state for the software renderer -void tex_SetLighting(light_state); - -// Sets a color model (see renderer.h for valid models) -void tex_SetColorModel(color_model); - -// Sets a texturing type (see renderer.h) -void tex_SetTextureType(texture_type); - -// Sets the near and far plane of fog -void tex_SetFogBorders(float fog_near, float fog_far); - -// Sets the alpha type -void tex_SetAlphaType(int8_t); - -// ZBuffer variables -void tex_SetZBufferState(int state); -void tex_ClearZBuffer(); -void tex_StartFrame(int x1, int y1, int x2, int y2); -void tex_EndFrame(); - -// Sets the software renderer to render to a particular place -void tex_SetSoftwareParameters(float, int, int, int, uint8_t *); - -// Fills in projection variables -void tex_GetProjectionParameters(int *width, int *height); - -// Returns the aspect ratio of the physical screen -float tex_GetAspectRatio(); - -// software line renderer. -void tex_DrawLine(int x1, int y1, int x2, int y2); - -// fill rect supported. -void tex_FillRect(ddgr_color color, int x1, int y1, int x2, int y2); - -// set pixel -void tex_SetPixel(ddgr_color color, int x, int y); - -// get pixel -ddgr_color tex_GetPixel(int x, int y); - -// fillcircle -void tex_FillCircle(ddgr_color col, int x, int y, int r); - -// draw circle -void tex_DrawCircle(int x, int y, int r); - -// lfb stuff -void tex_GetLFBLock(renderer_lfb *lfb); - -void tex_ReleaseLFBLock(renderer_lfb *lfb); - -void tex_GetRenderState(rendering_state *rs); - -#endif