////////////////////////////////////////////////////////////////////// // // Pixie // // Copyright © 1999 - 2003, Okan Arikan // // Contact: okan@cs.berkeley.edu // // This library 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 library 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 library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// // // File : texmake.cpp // Classes : - // Description : Texture making program // //////////////////////////////////////////////////////////////////////// #include #include #include #include "common/global.h" #include "common/os.h" #include "ri/ri.h" const char *tileSizeArgument = "-tilesize"; const char *smodeArgument = "-smode"; const char *tmodeArgument = "-tmode"; const char *filterArgument = "-filter"; const char *filterWidthArgument = "-filterwidth"; const char *sfilterWidthArgument = "-sfilterwidth"; const char *tfilterWidthArgument = "-tfilterwidth"; const char *inputPathArgument = "-input"; const char *outputPathArgument = "-output"; const char *shadowArgument = "-shadow"; const char *envlatArgument = "-envlatl"; const char *envcubeArgument = "-envcube"; const char *fovArgument = "-fov"; void printUsage() { printf("Usage: texmake [-(shadow|envlatl|envcube)] [-smode ] [-tmode ] [-filter ] [-filterwidth ] [-filterheight ] [-sfilterwidth ] [-tfilterwidth ] \n"); } int main(int argc, char* argv[]) { int tileSize = 32; char *smode = "periodic"; char *tmode = "periodic"; float filterWidth = 3; float filterHeight = 3; char *inPath = "."; char *outPath = "."; float fov = 90; RtFilterFunc filter = RiCatmullRomFilter; int i; char *textureMode = "texture"; int processed; RtToken tokens[50]; RtPointer vals[50]; char *files[50]; int currentFile = 0; int currentParameter = 0; if (argc == 1) { printUsage(); return 0; } // Init the memory manager memoryManagerInit(); for (i=1;i