Merge branch terrible and branch awful
authorSam Moore <[email protected]>
Thu, 23 Oct 2014 11:49:35 +0000 (19:49 +0800)
committerSam Moore <[email protected]>
Thu, 23 Oct 2014 11:49:35 +0000 (19:49 +0800)
scr.Present was in wrong place
Merging sucks
Everything sucks
GPUs suck
fglrx sucks
professionalism sucks
I hope no one looking to hire me ever reads these.

Conflicts:
src/main.h

1  2 
src/Makefile
src/bezier.cpp
src/bezier.h
src/debugscript.cpp
src/debugscript.h
src/main.cpp
src/main.h
src/screen.cpp
src/turtles_all_the_way_down.script
src/view.cpp
src/view.h

diff --cc src/Makefile
Simple merge
diff --cc src/bezier.cpp
Simple merge
diff --cc src/bezier.h
Simple merge
@@@ -398,9 -418,14 +418,14 @@@ bool DebugScript::Execute(View *view, S
        }
        case AT_PrintBounds:
        {
 -              printf("%s\t%s\t%s\t%s\n", Str(view->GetBounds().x).c_str(), Str(view->GetBounds().y).c_str(), Str(view->GetBounds().w).c_str(), Str(view->GetBounds().h).c_str());
 +              printf("%s\t%s\t%s\t%s\t%s\t%s\n", Str(view->GetBounds().x).c_str(), Str(view->GetBounds().y).c_str(), Str(view->GetBounds().w).c_str(), Str(view->GetBounds().h).c_str(), Str(Log10(view->GetBounds().w)).c_str(), Str(Log10(view->GetBounds().h)).c_str());
                break;
        }
+       case AT_ProfileDisplay:
+       {
+               g_profiler.Enable(currentAction.iz);
+               break;
+       }
        default:
                Fatal("Unknown script command in queue.");
        }
@@@ -43,8 -43,9 +43,9 @@@ private
                AT_SetBounds,
                AT_QueryGPUBounds, // query bounds of Beziers when transformed to GPU
                AT_ScreenShot, // take screenshot
 -              AT_PrintFPS, // Print FPS statistics about the frames
 +              AT_PrintSPF, // Print FPS statistics about the frames
                AT_PrintBounds, // Print bounds
+               AT_ProfileDisplay,
                AT_Quit
        };
  
diff --cc src/main.cpp
@@@ -36,18 -34,12 +36,18 @@@ int main(int argc, char ** argv
        #endif
  
        // We want to crash if we ever get a NaN.
--      // AH, so *this* is where that got enabled, I was looking for compiler flags
++      // Not any more
        #ifndef __MINGW32__
-       feenableexcept(FE_DIVBYZERO | FE_INVALID); // | FE_OVERFLOW);
 -      feenableexcept(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
++      //feenableexcept(FE_DIVBYZERO | FE_INVALID); // | FE_OVERFLOW);
        #endif
        #if REALTYPE == REAL_MPFRCPP
 -      mpfr_set_default_prec(6);
 +      
 +              #ifdef MPFR_PRECISION
 +              mpfr_set_default_prec(MPFR_PRECISION);
 +              #else
 +              mpfr_set_default_prec(23);
 +              #endif
 +              
        #endif
        DebugRealInfo();
  
diff --cc src/main.h
@@@ -209,15 -210,10 +214,21 @@@ void MainLoop(Document & doc, Screen & 
                        scr.DebugFontPrint("Doing rendering using CPU.\n");
                }
                #endif // 0
 -              
 +
-               scr.Present();
 +              if (make_movie)
 +              {
 +                      std::stringstream s;
 +                      s << "frame" << frames << ".bmp";
 +                      scr.ScreenShot(s.str().c_str());
-               }               
++              }       
++
++      
 +
+               g_profiler.BeginZone("scr.Present()");
+               scr.Present();
+               g_profiler.EndZone();
+               g_profiler.EndFrame();
++              
++              
        }
  }
diff --cc src/screen.cpp
@@@ -45,11 -45,11 +45,12 @@@ Screen::Screen(bool visible
        }
  
        SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3);
 -      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 1);
 +      SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 3);
        SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_DEBUG_FLAG);
        SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
--
++      //SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
        m_gl_context = SDL_GL_CreateContext(m_window);
++      //SDL_GL_SetSwapInterval(1);
  
        ogl_LoadFunctions();
  
@@@ -1,12 -1,10 +1,12 @@@
 -# BECAUSE I CAN
 +# Script for the turtles video
  gpu
  lazy
 -profileon
--#debugfont off
  
- loop 1000 wait
 +# Wait to start video
++# loop 1000 wait
 +
 +#Load first turtle...
  loadsvg svg-tests/turtle.svg
  loop 50 pxzoom 430 170 1
  loadsvg svg-tests/turtle.svg
diff --cc src/view.cpp
@@@ -525,9 -541,10 +545,10 @@@ void View::RenderRange(int width, int h
  
  void View::UpdateObjBoundsVBO(unsigned first_obj, unsigned last_obj)
  {
+       PROFILE_SCOPE("View::UpdateObjBoundsVBO");
        if (m_query_gpu_bounds_on_next_frame != NULL)
        {
 -              fprintf(m_query_gpu_bounds_on_next_frame,"# View: %s\t%s\t%s\t%s", Str(m_bounds.x).c_str(), Str(m_bounds.y).c_str(), Str(m_bounds.w).c_str(), Str(m_bounds.h).c_str());
 +              fprintf(m_query_gpu_bounds_on_next_frame,"# View: %s\t%s\t%s\t%s\n", Str(m_bounds.x).c_str(), Str(m_bounds.y).c_str(), Str(m_bounds.w).c_str(), Str(m_bounds.h).c_str());
        }       
        
        //m_objbounds_vbo.Invalidate();
diff --cc src/view.h
Simple merge

UCC git Repository :: git.ucc.asn.au