Skip to content

Commit 6ca8ef4

Browse files
committed
Fix path separator
1 parent 4ed09be commit 6ca8ef4

File tree

32 files changed

+637
-637
lines changed

32 files changed

+637
-637
lines changed

booksamples/chapter-08/resources/models/cube/cube_mat.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
{
1313
"id": "cube-mat-1",
14-
"texture_path": "resources\\models\\cube\\cube.png",
14+
"texture_path": "resources/models/cube/cube.png",
1515
"diffuse_color": {
1616
"x": 0.0,
1717
"y": 0.0,

booksamples/chapter-08/src/main/java/org/vulkanb/eng/model/ModelGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ private String processTexture(AIScene aiScene, AIMaterial aiMaterial, String bas
205205
// Embedded texture
206206
var aiTexture = AITexture.create(aiScene.mTextures().get(embeddedTextureIdx));
207207
String baseFileName = aiTexture.mFilename().dataString() + ".png";
208-
texturePath = baseDir + File.separator + baseFileName;
208+
texturePath = baseDir + "/" + baseFileName;
209209
Logger.info("Dumping texture file to [{}]", texturePath);
210210
var channel = FileChannel.open(Path.of(texturePath), StandardOpenOption.CREATE, StandardOpenOption.WRITE);
211211
channel.write(aiTexture.pcDataCompressed());
212212
} else {
213-
texturePath = baseDir + File.separator + new File(texturePath).getName();
213+
texturePath = baseDir + "/" + new File(texturePath).getName();
214214
}
215215
}
216216
}

booksamples/chapter-09/resources/models/sponza/Sponza_mat.json

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"id": "Sponza-mat-0",
4-
"texture_path": "resources\\models\\sponza\\5061699253647017043.png",
4+
"texture_path": "resources/models/sponza/5061699253647017043.png",
55
"diffuse_color": {
66
"x": 0.588,
77
"y": 0.588,
@@ -11,7 +11,7 @@
1111
},
1212
{
1313
"id": "Sponza-mat-1",
14-
"texture_path": "resources\\models\\sponza\\8006627369776289000.png",
14+
"texture_path": "resources/models/sponza/8006627369776289000.png",
1515
"diffuse_color": {
1616
"x": 0.588,
1717
"y": 0.588,
@@ -21,7 +21,7 @@
2121
},
2222
{
2323
"id": "Sponza-mat-2",
24-
"texture_path": "resources\\models\\sponza\\7268504077753552595.jpg",
24+
"texture_path": "resources/models/sponza/7268504077753552595.jpg",
2525
"diffuse_color": {
2626
"x": 0.588,
2727
"y": 0.588,
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"id": "Sponza-mat-3",
34-
"texture_path": "resources\\models\\sponza\\8750083169368950601.jpg",
34+
"texture_path": "resources/models/sponza/8750083169368950601.jpg",
3535
"diffuse_color": {
3636
"x": 0.588,
3737
"y": 0.588,
@@ -41,7 +41,7 @@
4141
},
4242
{
4343
"id": "Sponza-mat-4",
44-
"texture_path": "resources\\models\\sponza\\5792855332885324923.jpg",
44+
"texture_path": "resources/models/sponza/5792855332885324923.jpg",
4545
"diffuse_color": {
4646
"x": 0.588,
4747
"y": 0.588,
@@ -51,7 +51,7 @@
5151
},
5252
{
5353
"id": "Sponza-mat-5",
54-
"texture_path": "resources\\models\\sponza\\14650633544276105767.jpg",
54+
"texture_path": "resources/models/sponza/14650633544276105767.jpg",
5555
"diffuse_color": {
5656
"x": 0.588,
5757
"y": 0.588,
@@ -61,7 +61,7 @@
6161
},
6262
{
6363
"id": "Sponza-mat-6",
64-
"texture_path": "resources\\models\\sponza\\15295713303328085182.jpg",
64+
"texture_path": "resources/models/sponza/15295713303328085182.jpg",
6565
"diffuse_color": {
6666
"x": 0.588,
6767
"y": 0.588,
@@ -71,7 +71,7 @@
7171
},
7272
{
7373
"id": "Sponza-mat-7",
74-
"texture_path": "resources\\models\\sponza\\6047387724914829168.jpg",
74+
"texture_path": "resources/models/sponza/6047387724914829168.jpg",
7575
"diffuse_color": {
7676
"x": 0.588,
7777
"y": 0.588,
@@ -81,7 +81,7 @@
8181
},
8282
{
8383
"id": "Sponza-mat-8",
84-
"texture_path": "resources\\models\\sponza\\5823059166183034438.jpg",
84+
"texture_path": "resources/models/sponza/5823059166183034438.jpg",
8585
"diffuse_color": {
8686
"x": 0.588,
8787
"y": 0.588,
@@ -91,7 +91,7 @@
9191
},
9292
{
9393
"id": "Sponza-mat-9",
94-
"texture_path": "resources\\models\\sponza\\7441062115984513793.jpg",
94+
"texture_path": "resources/models/sponza/7441062115984513793.jpg",
9595
"diffuse_color": {
9696
"x": 0.588,
9797
"y": 0.588,
@@ -101,7 +101,7 @@
101101
},
102102
{
103103
"id": "Sponza-mat-10",
104-
"texture_path": "resources\\models\\sponza\\11490520546946913238.jpg",
104+
"texture_path": "resources/models/sponza/11490520546946913238.jpg",
105105
"diffuse_color": {
106106
"x": 0.588,
107107
"y": 0.588,
@@ -111,7 +111,7 @@
111111
},
112112
{
113113
"id": "Sponza-mat-11",
114-
"texture_path": "resources\\models\\sponza\\6151467286084645207.jpg",
114+
"texture_path": "resources/models/sponza/6151467286084645207.jpg",
115115
"diffuse_color": {
116116
"x": 0.588,
117117
"y": 0.588,
@@ -121,7 +121,7 @@
121121
},
122122
{
123123
"id": "Sponza-mat-12",
124-
"texture_path": "resources\\models\\sponza\\white.png",
124+
"texture_path": "resources/models/sponza/white.png",
125125
"diffuse_color": {
126126
"x": 0.588,
127127
"y": 0.588,
@@ -131,7 +131,7 @@
131131
},
132132
{
133133
"id": "Sponza-mat-13",
134-
"texture_path": "resources\\models\\sponza\\4975155472559461469.jpg",
134+
"texture_path": "resources/models/sponza/4975155472559461469.jpg",
135135
"diffuse_color": {
136136
"x": 0.588,
137137
"y": 0.588,
@@ -141,7 +141,7 @@
141141
},
142142
{
143143
"id": "Sponza-mat-14",
144-
"texture_path": "resources\\models\\sponza\\4675343432951571524.jpg",
144+
"texture_path": "resources/models/sponza/4675343432951571524.jpg",
145145
"diffuse_color": {
146146
"x": 0.588,
147147
"y": 0.588,
@@ -151,7 +151,7 @@
151151
},
152152
{
153153
"id": "Sponza-mat-15",
154-
"texture_path": "resources\\models\\sponza\\2775690330959970771.jpg",
154+
"texture_path": "resources/models/sponza/2775690330959970771.jpg",
155155
"diffuse_color": {
156156
"x": 0.588,
157157
"y": 0.588,
@@ -161,7 +161,7 @@
161161
},
162162
{
163163
"id": "Sponza-mat-16",
164-
"texture_path": "resources\\models\\sponza\\2185409758123873465.jpg",
164+
"texture_path": "resources/models/sponza/2185409758123873465.jpg",
165165
"diffuse_color": {
166166
"x": 0.588,
167167
"y": 0.588,
@@ -171,7 +171,7 @@
171171
},
172172
{
173173
"id": "Sponza-mat-17",
174-
"texture_path": "resources\\models\\sponza\\17876391417123941155.jpg",
174+
"texture_path": "resources/models/sponza/17876391417123941155.jpg",
175175
"diffuse_color": {
176176
"x": 0.588,
177177
"y": 0.588,
@@ -181,7 +181,7 @@
181181
},
182182
{
183183
"id": "Sponza-mat-18",
184-
"texture_path": "resources\\models\\sponza\\11474523244911310074.jpg",
184+
"texture_path": "resources/models/sponza/11474523244911310074.jpg",
185185
"diffuse_color": {
186186
"x": 0.588,
187187
"y": 0.588,
@@ -191,7 +191,7 @@
191191
},
192192
{
193193
"id": "Sponza-mat-19",
194-
"texture_path": "resources\\models\\sponza\\9288698199695299068.jpg",
194+
"texture_path": "resources/models/sponza/9288698199695299068.jpg",
195195
"diffuse_color": {
196196
"x": 0.588,
197197
"y": 0.588,
@@ -201,7 +201,7 @@
201201
},
202202
{
203203
"id": "Sponza-mat-20",
204-
"texture_path": "resources\\models\\sponza\\16275776544635328252.png",
204+
"texture_path": "resources/models/sponza/16275776544635328252.png",
205205
"diffuse_color": {
206206
"x": 0.588,
207207
"y": 0.588,
@@ -211,7 +211,7 @@
211211
},
212212
{
213213
"id": "Sponza-mat-21",
214-
"texture_path": "resources\\models\\sponza\\755318871556304029.jpg",
214+
"texture_path": "resources/models/sponza/755318871556304029.jpg",
215215
"diffuse_color": {
216216
"x": 0.588,
217217
"y": 0.588,
@@ -221,7 +221,7 @@
221221
},
222222
{
223223
"id": "Sponza-mat-22",
224-
"texture_path": "resources\\models\\sponza\\8481240838833932244.jpg",
224+
"texture_path": "resources/models/sponza/8481240838833932244.jpg",
225225
"diffuse_color": {
226226
"x": 0.588,
227227
"y": 0.588,
@@ -231,7 +231,7 @@
231231
},
232232
{
233233
"id": "Sponza-mat-23",
234-
"texture_path": "resources\\models\\sponza\\6772804448157695701.jpg",
234+
"texture_path": "resources/models/sponza/6772804448157695701.jpg",
235235
"diffuse_color": {
236236
"x": 0.588,
237237
"y": 0.588,
@@ -241,7 +241,7 @@
241241
},
242242
{
243243
"id": "Sponza-mat-24",
244-
"texture_path": "resources\\models\\sponza\\2969916736137545357.jpg",
244+
"texture_path": "resources/models/sponza/2969916736137545357.jpg",
245245
"diffuse_color": {
246246
"x": 0.588,
247247
"y": 0.588,

booksamples/chapter-09/src/main/java/org/vulkanb/eng/model/ModelGenerator.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,12 +205,12 @@ private String processTexture(AIScene aiScene, AIMaterial aiMaterial, String bas
205205
// Embedded texture
206206
var aiTexture = AITexture.create(aiScene.mTextures().get(embeddedTextureIdx));
207207
String baseFileName = aiTexture.mFilename().dataString() + ".png";
208-
texturePath = baseDir + File.separator + baseFileName;
208+
texturePath = baseDir + "/" + baseFileName;
209209
Logger.info("Dumping texture file to [{}]", texturePath);
210210
var channel = FileChannel.open(Path.of(texturePath), StandardOpenOption.CREATE, StandardOpenOption.WRITE);
211211
channel.write(aiTexture.pcDataCompressed());
212212
} else {
213-
texturePath = baseDir + File.separator + new File(texturePath).getName();
213+
texturePath = baseDir + "/" + new File(texturePath).getName();
214214
}
215215
}
216216
}

0 commit comments

Comments
 (0)