Skip to content

Commit

Permalink
Added the ability to dynamically initialize any renderobject that has…
Browse files Browse the repository at this point in the history
… a TSP,cleaned up unused TSP variables and functions,added the ability to load type 2 and 6 primitive types
  • Loading branch information
AdrianoDiDio committed Apr 1, 2024
1 parent 91b9d96 commit 0d4f5d6
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 520 deletions.
1 change: 0 additions & 1 deletion libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ set(IMGUI_SOURCE_FILES cimgui/cimgui.cpp

add_library(cimgui STATIC ${IMGUI_SOURCE_FILES})
target_compile_definitions(cimgui PRIVATE "IMGUI_USER_CONFIG=\"${PROJECT_SOURCE_DIR}/src/Common/IMGUIConfig.h\"")

target_include_directories(cimgui PRIVATE cimgui/imgui)
target_link_libraries(cimgui SDL2)

Expand Down
5 changes: 1 addition & 4 deletions src/JPModelViewer/BSD.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,17 +803,14 @@ void BSDDrawRenderObject(BSDRenderObject_t *RenderObject,const VRAM_t *VRAM,Came
mat4 ModelViewMatrix;
mat4 MVPMatrix;
Shader_t *Shader;
static int Once = 0;

if( !RenderObject ) {
return;
}

if( RenderObject->TSP ) {
if( !Once ) {
if( !RenderObject->RenderObjectShader ) {
BSDCreateRenderObjectShader(RenderObject);
TSPCreateVAOs(RenderObject->TSP);
Once = 1;
}
TSPDrawList(RenderObject->TSP,VRAM,Camera,RenderObject->RenderObjectShader,ProjectionMatrix);
return;
Expand Down
1 change: 1 addition & 0 deletions src/JPModelViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ set_target_properties(${PROJECT_NAME} PROPERTIES DEBUG_POSTFIX -Debug)
set_target_properties(${PROJECT_NAME} PROPERTIES RELEASE_POSTFIX -Release)

target_compile_options(${PROJECT_NAME} PRIVATE "-fdiagnostics-color=always")
target_compile_options(${PROJECT_NAME} PRIVATE "-Wno-unknown-pragmas")
if(WIN32)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall)
target_compile_definitions(${PROJECT_NAME} PRIVATE "-DSDL_MAIN_HANDLED")
Expand Down
Loading

0 comments on commit 0d4f5d6

Please sign in to comment.