From baf7299fa3d8cd7bff4e201048f710e31f0e879f Mon Sep 17 00:00:00 2001 From: Chris Taylor Date: Thu, 31 Mar 2005 13:21:47 +0000 Subject: [PATCH] no using TmapList, initialise texture category globals, no CurrentTmap (just use CurrentTexture) --- ChangeLog | 3 +++ main/editor/texpage.c | 51 ++++++++++++++++++------------------------- 2 files changed, 24 insertions(+), 30 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d26d2a2..adbb989c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,9 @@ OL_ constants; use "object" instead of "robot" in some places; draw and place reactors with correct modelnum + * main/editor/texpage.c: no using TmapList, initialise texture + category globals, no CurrentTmap (just use CurrentTexture) + 2005-03-29 Bradley Bell * mem/mem.c: remove obsolete malloc.h diff --git a/main/editor/texpage.c b/main/editor/texpage.c index 80de38ec..bad764e6 100644 --- a/main/editor/texpage.c +++ b/main/editor/texpage.c @@ -1,4 +1,4 @@ -/* $Id: texpage.c,v 1.4 2005-01-24 22:22:37 schaffner Exp $ */ +/* $Id: texpage.c,v 1.5 2005-03-31 13:21:47 chris Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -28,7 +28,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #include #ifdef RCS -static char rcsid[] = "$Id: texpage.c,v 1.4 2005-01-24 22:22:37 schaffner Exp $"; +static char rcsid[] = "$Id: texpage.c,v 1.5 2005-03-31 13:21:47 chris Exp $"; #endif #include "inferno.h" @@ -52,12 +52,11 @@ static char rcsid[] = "$Id: texpage.c,v 1.4 2005-01-24 22:22:37 schaffner Exp $" static UI_GADGET_USERBOX * TmapBox[TMAPS_PER_PAGE]; static UI_GADGET_USERBOX * TmapCurrent; -int CurrentTmap = 0; // Used globally int CurrentTexture = 0; // Used globally -int TextureLights; -int TextureEffects; -int TextureMetals; +int TextureLights = 275; +int TextureEffects = 308; +int TextureMetals = 202; static int TexturePage = 0; @@ -94,15 +93,16 @@ void texpage_redraw() { int i; - for (i=0; icanvas); - if (i+TexturePage*TMAPS_PER_PAGE < Num_tmaps ) { - PIGGY_PAGE_IN( Textures[TmapList[i+TexturePage*TMAPS_PER_PAGE]]); - gr_ubitmap(0,0, &GameBitmaps[Textures[TmapList[i+TexturePage*TMAPS_PER_PAGE]].index]); + if (i + TexturePage*TMAPS_PER_PAGE < NumTextures) + { + PIGGY_PAGE_IN(Textures[i + TexturePage*TMAPS_PER_PAGE]); + gr_ubitmap(0, 0, &GameBitmaps[Textures[i + TexturePage*TMAPS_PER_PAGE].index]); } else gr_clear_canvas( CGREY ); - } + } } //shows the current texture, updating the window and printing the name, base @@ -157,7 +157,8 @@ static int texpage_goto_prev() static int texpage_goto_next() { - if ((TexturePage+1)*TMAPS_PER_PAGE < Num_tmaps ) { + if ((TexturePage + 1)*TMAPS_PER_PAGE < NumTextures) + { TexturePage++; texpage_redraw(); } @@ -169,22 +170,13 @@ static int texpage_goto_next() //the list int texpage_grab_current(int n) { - int i; - - if ( (n<0) || ( n>= Num_tmaps) ) return 0; + if ((n < 0) || (n >= NumTextures)) return 0; CurrentTexture = n; - for (i=0;ib1_clicked && (i+TexturePage*TMAPS_PER_PAGE < Num_tmaps)) { - CurrentTmap = i+TexturePage*TMAPS_PER_PAGE; - CurrentTexture = TmapList[CurrentTmap]; + if (TmapBox[i]->b1_clicked && (i + TexturePage*TMAPS_PER_PAGE < NumTextures)) + { + CurrentTexture = i + TexturePage*TMAPS_PER_PAGE; texpage_show_current(); if (keyd_pressed[KEY_LSHIFT]) { -- 2.39.2