Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9320 in orxonox.OLD for branches/proxy/src/subprojects


Ignore:
Timestamp:
Jul 18, 2006, 11:04:32 AM (18 years ago)
Author:
bensch
Message:

valgrind stuff

Location:
branches/proxy/src/subprojects/recapture_mouse
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/subprojects/recapture_mouse/Makefile.am

    r9317 r9320  
    2727
    2828recapturemouse_SOURCES= \
    29                 ../framework.cc \
    30                 recapturer.cc \
    31                 $(MAINSRCDIR)/world_entities/space_ships/space_ship.cc \
    32                 $(MAINSRCDIR)/world_entities/weapons/test_gun.cc
    33 
     29                recapturer.cc
  • branches/proxy/src/subprojects/recapture_mouse/recapturer.cc

    r9318 r9320  
    1616*/
    1717
    18 #include "framework.h"
     18#include "event_handler.h"
    1919
    20 #include "light.h"
     20int verbose = 3;
    2121
    22 #include "objModel.h"
    23 #include "md2/md2Model.h"
    24 #include "primitive_model.h"
    25 #include <stdlib.h>
    26 
    27 #include "vertex_array_model.h"
    28 
    29 #include "util/loading/resource_manager.h"
    30 
    31 Model* obj;
    32 
    33 void Framework::moduleInit(int argc, char** argv)
     22int main(int argc, char** argv)
    3423{
    35   ResourceManager::getInstance()->addImageDir("./");
    36 
    37   for (int i = 0; i < argc; i++)
    38   {
    39     printf("%s\n", argv[i]);
    40   }
    41   ResourceManager::getInstance()->addImageDir("");
    42 
    43 
    44   if (argc>=3)
    45   {
    46     if( strstr(argv[1], ".obj") != NULL)
    47       obj = new OBJModel (argv[1], atof(argv[2]));
    48     else if( strstr(argv[1], ".md2") != NULL)
    49     {
    50       obj = new MD2Model(argv[1], argv[2]);
    51       ((MD2Model*)obj)->tick(0.1f);
    52     }
    53   }
    54   else if (argc>=2)
    55   {
    56     if( strstr(argv[1], ".obj") != NULL)
    57       obj = new OBJModel(argv[1]);
    58     else if( strstr(argv[1], ".md2") != NULL) {
    59       obj = new MD2Model(argv[1], "fake_texture.bad");
    60       obj = new MD2Model(argv[1], argv[2]);
    61       ((MD2Model*)obj)->tick(0.1f);
    62     }
    63   }
    64  // else
    65     obj = new PrimitiveModel(PRIM_CYLINDER);
    66 
    67 
    68   ResourceManager::getInstance()->debug();
    69 
    70   LightManager* lightMan = LightManager::getInstance();
    71   lightMan->setAmbientColor(.1,.1,.1);
    72   (new Light())->setAbsCoor(5.0, 10.0, 40.0);
    73   (new Light())->setAbsCoor(-10, -20, -100);
     24  EventHandler::getInstance()->grabEvents(true);
     25  EventHandler::getInstance()->grabEvents(false);
     26  exit(-1);
    7427}
    75 
    76 void Framework::moduleEventHandler(SDL_Event* event)
    77 {
    78   switch (event->type)
    79     {
    80     case SDL_KEYDOWN:
    81       switch (event->key.keysym.sym)
    82         {
    83         case SDLK_i:
    84           break;
    85         }
    86     }
    87 }
    88 
    89 void Framework::moduleTick(float dt)
    90 {
    91 
    92 }
    93 
    94 void Framework::moduleDraw(void) const
    95 {
    96   LightManager::getInstance()->draw();
    97   obj->draw();
    98 
    99 }
    100 
    101 
    102 void Framework::moduleHelp(void) const
    103 {
    104 
    105 }
Note: See TracChangeset for help on using the changeset viewer.