Skip to content

Commit 8248184

Browse files
committed
Ughhhh forgot what I did.
1 parent 92d88b5 commit 8248184

File tree

9 files changed

+24
-15087
lines changed

9 files changed

+24
-15087
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+
vbsp\.js*

build.bat

-1
This file was deleted.

build.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
emcc src/main.cpp -o vbsp.js -std=c++11 -s EXPORTED_FUNCTIONS="['_initRenderer','_loadMap','_setCam','_setSkybox','_setModel']" -s TOTAL_MEMORY=117440512 -s MODULARIZE=1 -s EXPORT_NAME="'VBSP'" --post-js src/post.js --post-js src/kvparse.js --js-library src/library.js -O3

colors.json

Whitespace-only changes.

src/library.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,29 @@ mergeInto(LibraryManager.library, {
66

77
var match = name.match(/maps\/[^/]*\/(.*)_.*_.*_.*/);
88

9-
if (match != null)
9+
if (match != null) {
10+
//console.log(name+" -> "+match[1]);
1011
name = match[1];
12+
}
13+
14+
if (name == "tools/toolstrigger")
15+
return -1;
1116

1217
var color = color_table[name];
1318

1419
if (color != null) {
1520
return color;
1621
}
1722

18-
color = pick_color(name);
23+
console.log(">>> "+name);
24+
25+
return 0xFFFFFF;
26+
27+
/*color = pick_color(name);
1928
2029
color_table[name] = color;
2130
22-
return color;
31+
return color;*/
2332
},
2433
parse_ents: function(data) {
2534
data = Pointer_stringify(data);

src/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ int loadMap(bsp_header_t* bsp_file) {
325325
tex_g = 0.76;
326326
tex_b = 1;
327327
} else {
328-
int color = 0xFFFFFF00 >> 8; // pick_color(texture_name); //0xFFFFFF00 >> 8;
328+
int color = /*0xFFFFFF00 >> 8;*/ pick_color(texture_name); //0xFFFFFF00 >> 8;
329329
if (color==-1) // no-draw hinting
330330
continue;
331331
tex_r = ((color >> 16) & 255) / 255.0f;;

src/post.js

+8-16
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ var colors = {
139139
info: 0x00FFFF
140140
}
141141

142+
/*
142143
color_table = {
143144
"gm_construct/construct_credits": colors.info,
144145
"gm_construct/color_room": 0xffffff,
@@ -349,11 +350,11 @@ color_table = {
349350
350351
//"coalmines/blendgroundtowall_coalmines": 0xCC9C68, //TF2
351352
};
353+
*/
352354

353-
function pick_color(name) {
354-
//console.log(name);
355-
356-
if (name.indexOf("concrete") > -1)
355+
function guess_color(name) {
356+
357+
/*if (name.indexOf("concrete") > -1)
357358
return colors.concrete;
358359
359360
if (name.indexOf("cement") > -1)
@@ -365,9 +366,8 @@ function pick_color(name) {
365366
if (name.indexOf("plaster") > -1)
366367
return colors.plaster;
367368
368-
if (name.indexOf("metal") > -1) {
369-
return 0x24201b; // good 4 now
370-
}
369+
if (name.indexOf("metal") > -1)
370+
return 0x24201b;
371371
372372
if (name.indexOf("brick") > -1)
373373
return colors.brick;
@@ -380,7 +380,6 @@ function pick_color(name) {
380380
381381
if (name.indexOf("glass") > -1 || name.indexOf("window") > -1)
382382
return colors.glass;
383-
384383
385384
if (name.indexOf("mud") > -1)
386385
return colors.mud;
@@ -397,11 +396,8 @@ function pick_color(name) {
397396
if (name.indexOf("grass") > -1)
398397
return colors.grass;
399398
400-
401-
402399
if (name.indexOf("stone") > -1)
403400
return colors.concrete;
404-
405401
406402
if (name.indexOf("water") > -1)
407403
return colors.water;
@@ -413,7 +409,7 @@ function pick_color(name) {
413409
return 0xFF0000;
414410
415411
if (name.indexOf("sign") > -1)
416-
return 0x008002;
412+
return 0x008002;*/
417413

418414
/*if (name.indexOf("red") > -1)
419415
return 0xEB5B5B;
@@ -423,10 +419,6 @@ function pick_color(name) {
423419

424420
//if (name.indexOf("building_template") > -1)
425421
// return 0xFF00FF;
426-
427-
console.log("> Can't guess color of \""+name+"\".");
428-
429-
return 0xFF00FF;
430422
}
431423

432424
//Module.load = Module.cwrap("load", "number", []);

0 commit comments

Comments
 (0)