From bca5cb14660f7f50ed677b9f98faa9a55ac0e321 Mon Sep 17 00:00:00 2001 From: Francisco Javier Trujillo Mata Date: Mon, 9 Sep 2024 21:21:54 +0200 Subject: [PATCH] Fix folders usage --- examples/logo/logo.cpp | 23 ++++++++++------------- examples/shared_code/file_ops.h | 21 --------------------- examples/tricked_out/tricked_out.cpp | 3 +-- 3 files changed, 11 insertions(+), 36 deletions(-) delete mode 100644 examples/shared_code/file_ops.h diff --git a/examples/logo/logo.cpp b/examples/logo/logo.cpp index b7c839c..47f3826 100644 --- a/examples/logo/logo.cpp +++ b/examples/logo/logo.cpp @@ -14,9 +14,6 @@ #include "GL/gl.h" #include "GL/glut.h" -// in 'shared_code' -#include "file_ops.h" - #include "ps2glmesh.h" /******************************************** @@ -123,8 +120,8 @@ void init_models(void) // ps2 ps2_list = glGenLists(7); - mesh = LoadMesh(FILE_PREFIX "ps2.gl"); - LoadRTexFile(FILE_PREFIX "plywd_b.rtx", tex_ids[0]); + mesh = LoadMesh("ps2.gl"); + LoadRTexFile("plywd_b.rtx", tex_ids[0]); glNewList(ps2_list, GL_COMPILE); { glPushMatrix(); @@ -137,8 +134,8 @@ void init_models(void) // gl gl_list = ps2_list + 1; - mesh = LoadMesh(FILE_PREFIX "gl.gl"); - LoadRTexFile(FILE_PREFIX "plywd_y.rtx", tex_ids[1]); + mesh = LoadMesh("gl.gl"); + LoadRTexFile("plywd_y.rtx", tex_ids[1]); glNewList(gl_list, GL_COMPILE); { glBindTexture(GL_TEXTURE_2D, tex_ids[1]); @@ -149,8 +146,8 @@ void init_models(void) // wet paint wet_list = ps2_list + 2; - mesh = LoadMesh(FILE_PREFIX "note.gl"); - LoadRTexFile(FILE_PREFIX "wetpaint.rtx", tex_ids[2]); + mesh = LoadMesh("note.gl"); + LoadRTexFile("wetpaint.rtx", tex_ids[2]); glNewList(wet_list, GL_COMPILE); { glBindTexture(GL_TEXTURE_2D, tex_ids[2]); @@ -162,7 +159,7 @@ void init_models(void) // circle circle_list = ps2_list + 3; - mesh = LoadMesh(FILE_PREFIX "cir.gl"); + mesh = LoadMesh("cir.gl"); glNewList(circle_list, GL_COMPILE); { DrawMesh(mesh); @@ -172,7 +169,7 @@ void init_models(void) // square square_list = ps2_list + 4; - mesh = LoadMesh(FILE_PREFIX "sq.gl"); + mesh = LoadMesh("sq.gl"); glNewList(square_list, GL_COMPILE); { DrawMesh(mesh); @@ -182,7 +179,7 @@ void init_models(void) // triangle tri_list = ps2_list + 5; - mesh = LoadMesh(FILE_PREFIX "tri.gl"); + mesh = LoadMesh("tri.gl"); glNewList(tri_list, GL_COMPILE); { DrawMesh(mesh); @@ -192,7 +189,7 @@ void init_models(void) // x x_list = ps2_list + 6; - mesh = LoadMesh(FILE_PREFIX "x.gl"); + mesh = LoadMesh("x.gl"); glNewList(x_list, GL_COMPILE); { DrawMesh(mesh); diff --git a/examples/shared_code/file_ops.h b/examples/shared_code/file_ops.h deleted file mode 100644 index 6fc53c8..0000000 --- a/examples/shared_code/file_ops.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2000,2001,2002 Sony Computer Entertainment America - - This file is subject to the terms and conditions of the GNU Lesser - General Public License Version 2.1. See the file "COPYING" in the - main directory of this archive for more details. */ - -#ifndef file_ops_h -#define file_ops_h - -#include "stdio.h" -#ifdef CDROM -#define FILE_PREFIX "cdrom0:" -#define FILE_SEP '\\' -#define FILE_TERM ";1" -#else -#define FILE_PREFIX "host0:" -#define FILE_SEP '/' -#define FILE_TERM "" -#endif - -#endif // file_ops_h diff --git a/examples/tricked_out/tricked_out.cpp b/examples/tricked_out/tricked_out.cpp index 0a4718b..06cc93d 100644 --- a/examples/tricked_out/tricked_out.cpp +++ b/examples/tricked_out/tricked_out.cpp @@ -18,7 +18,6 @@ #include "ps2s/eetimer.h" #include "ps2s/math.h" -#include "file_ops.h" #include "text_stuff.h" #include "billboard_renderer.h" @@ -189,7 +188,7 @@ void init_billboards() void load_bb_texture() { // the texture file is just an rgba image with no header info - int tex_fd = open(FILE_PREFIX "car.bin", O_RDONLY); + int tex_fd = open("car.bin", O_RDONLY); assert(tex_fd != -1); int image_size = 128 * 128 * 4; // 128x128 32-bit image