-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
igl | third-party | Replace a patch with a Python script
Reviewed By: xiendong Differential Revision: D67150237 fbshipit-source-id: ea69f176892801f5335f24496dfd3389576fa1b4
- Loading branch information
1 parent
d48d29b
commit 9ee800e
Showing
3 changed files
with
32 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
import shutil | ||
from pathlib import Path | ||
|
||
base_dir=os.getcwd() | ||
lib_dir=os.path.join(base_dir, "src", "nanovg") | ||
|
||
file = Path(os.path.join(lib_dir, "example/demo.c")) | ||
file.write_text(file.read_text() | ||
.replace("#include <GLFW/glfw3.h>", "") | ||
.replace("#define STB_IMAGE_WRITE_IMPLEMENTATION", "") | ||
.replace("glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image);", "// glReadPixels(0, 0, w, h, GL_RGBA, GL_UNSIGNED_BYTE, image);") | ||
) | ||
|
||
file = Path(os.path.join(lib_dir, "example/perf.c")) | ||
file.write_text(file.read_text() | ||
.replace("void startGPUTimer(GPUtimer* timer)", | ||
("""#if 0 | ||
void startGPUTimer(GPUtimer* timer) | ||
""")) | ||
.replace("void initGraph(PerfGraph* fps, int style, const char* name)", | ||
("""#endif | ||
void initGraph(PerfGraph* fps, int style, const char* name) | ||
""")) | ||
) | ||
|
||
|