Rendering optimization related to culling + Started working on docs
This commit is contained in:
parent
58f9176dfc
commit
ecce403966
2
.gitignore
vendored
2
.gitignore
vendored
@ -7,3 +7,5 @@ x64
|
|||||||
x86
|
x86
|
||||||
*/x86
|
*/x86
|
||||||
gameenv/imgui.ini
|
gameenv/imgui.ini
|
||||||
|
docs/game/build
|
||||||
|
docs/internal/client
|
2924
client.doxyfile
Normal file
2924
client.doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
2924
docs.Doxyfile
Normal file
2924
docs.Doxyfile
Normal file
File diff suppressed because it is too large
Load Diff
9
docs/game/src/index.md
Normal file
9
docs/game/src/index.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
\mainpage MPFW Docs home
|
||||||
|
|
||||||
|
Welcome to MPFW, a Quake-based C++ engine for modern games.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
# Getting Started
|
||||||
|
Here are pages to get started quickly:
|
||||||
|
- [Minimal files](minimalfiles.md)
|
1
docs/game/src/minimalfiles.md
Normal file
1
docs/game/src/minimalfiles.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
# Minimal files
|
BIN
docs/game/src/quakeconsole_mpfw_home.png
Normal file
BIN
docs/game/src/quakeconsole_mpfw_home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 76 KiB |
@ -150,15 +150,6 @@ void ___test___(T a, T b) {
|
|||||||
|
|
||||||
|
|
||||||
bool consoleOn = false;
|
bool consoleOn = false;
|
||||||
bool waitingForFrameToFinish = false;
|
|
||||||
bool physicsThreadShouldDie = false;
|
|
||||||
void PhysicsThread(MPFW::Console::CommandHandlerResources* chr) {
|
|
||||||
float ctime = GetTime();
|
|
||||||
while(!physicsThreadShouldDie){
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -233,8 +224,7 @@ int main() {
|
|||||||
bool indivFaceMode = false;
|
bool indivFaceMode = false;
|
||||||
int indivFace = 0;
|
int indivFace = 0;
|
||||||
std::string cmdBuf = "";
|
std::string cmdBuf = "";
|
||||||
int framebuffer = 0;
|
int framebuffer = 0; // buffer of frames, not a frame buffer
|
||||||
std::thread physics(PhysicsThread, &chr);
|
|
||||||
|
|
||||||
|
|
||||||
while (!WindowShouldClose()) {
|
while (!WindowShouldClose()) {
|
||||||
@ -316,19 +306,23 @@ int main() {
|
|||||||
if (chr.cvars["vid_2d_background"] == "true") DrawRectangleGradientV(0, 0, GetScreenWidth(), GetScreenHeight(), WHITE, LIGHTGRAY);
|
if (chr.cvars["vid_2d_background"] == "true") DrawRectangleGradientV(0, 0, GetScreenWidth(), GetScreenHeight(), WHITE, LIGHTGRAY);
|
||||||
|
|
||||||
if (chr.cvars["vid_3d_renderer"] == "true") {
|
if (chr.cvars["vid_3d_renderer"] == "true") {
|
||||||
|
bool cullSky = chr.cvars["vid_3d_cull_sky"] == "true";
|
||||||
|
bool cullClips = chr.cvars["vid_3d_cull_clips"] == "true";
|
||||||
|
bool cullTriggers = chr.cvars["vid_3d_cull_triggers"] == "true";
|
||||||
BeginMode3D(camera);
|
BeginMode3D(camera);
|
||||||
if(chr.cvars["vid_3d_grid"] == "true") DrawGrid(10000, 10);
|
if(chr.cvars["vid_3d_grid"] == "true") DrawGrid(10000, 10);
|
||||||
|
rlColor4ub(255, 255, 255, 255);
|
||||||
for (int i = 0; i < map.data.renderFaces.size(); i++) {
|
for (int i = 0; i < map.data.renderFaces.size(); i++) {
|
||||||
if (
|
if (
|
||||||
!(chr.cvars["vid_3d_cull_sky"] == "true" && map.data.renderFaces[i].skyFace) &&
|
!(cullSky && map.data.renderFaces[i].skyFace) &&
|
||||||
!(chr.cvars["vid_3d_cull_clips"] == "true" && map.data.renderFaces[i].clipFace) &&
|
!(cullClips && map.data.renderFaces[i].clipFace) &&
|
||||||
!(chr.cvars["vid_3d_cull_triggers"] == "true" && map.data.renderFaces[i].triggerFace)
|
!(cullTriggers && map.data.renderFaces[i].triggerFace)
|
||||||
){
|
){
|
||||||
rlColor4ub(255, 255, 255, 255);
|
|
||||||
rlSetTexture(map.data.renderFaces[i].glTextureId);
|
rlSetTexture(map.data.renderFaces[i].glTextureId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for (int j = 1; j < map.data.renderFaces[i].vertices.size(); j++) {
|
for (int j = 1; j < map.data.renderFaces[i].vertices.size(); j++) {
|
||||||
rlBegin(RL_QUADS); // for texturing reasons because rlgl
|
rlBegin(RL_QUADS); // for texturing reasons because rlgl
|
||||||
Vector3 a = map.data.renderFaces[i].vertices[0],
|
Vector3 a = map.data.renderFaces[i].vertices[0],
|
||||||
@ -387,8 +381,6 @@ int main() {
|
|||||||
uiRenderer.Render();
|
uiRenderer.Render();
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
}
|
}
|
||||||
physicsThreadShouldDie = true;
|
|
||||||
physics.join();
|
|
||||||
|
|
||||||
CloseWindow();
|
CloseWindow();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user