Skip to content
Snippets Groups Projects
Commit 458f2d21 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix coompile

parent 42a826c7
No related branches found
No related tags found
No related merge requests found
......@@ -11,9 +11,7 @@
#include <string>
#include "CGNSOptions.h"
#include "meshPartitionOptions.h"
///
#include "GamePad.h"
///
// The interface-independent context.
......
......@@ -48,17 +48,16 @@
// .... ...
//
#include <math.h>
#include <cstring>
#include <string>
#include <iostream>
#include <stdio.h>
#include "GamePad.h"
#include "Context.h"
#include <unistd.h>
#if defined(WIN32)
#include <math.h>
#if !defined(WIN32)
#include <unistd.h>
#endif
GamePad::GamePad() : active(false), frequency(.01), gamepad_fd(0) {
......@@ -109,8 +108,7 @@ GamePad::GamePad() : active(false), frequency(.01), gamepad_fd(0) {
joyGetPosEx( gamepad_fd,&infoex) ;
infoex.dwFlags = JOY_RETURNALL;
#else
#if defined(__APPLE__)
#elif defined(__APPLE__)
// ??
......@@ -128,8 +126,7 @@ GamePad::GamePad() : active(false), frequency(.01), gamepad_fd(0) {
std::cout << (int)buttons <<" buttons)" << std::endl;
active = true;
}
#endif //(__APPLE__)
#endif //(WIN32)
#endif
for (int i=0;i<std::min(9,(int)buttons);i++) button_map[i]=i;
for (int i=0;i<std::min(7,(int)axes);i++) axe_map[i]=i;
......@@ -144,22 +141,17 @@ GamePad::GamePad() : active(false), frequency(.01), gamepad_fd(0) {
}
}
GamePad::~GamePad() {
active = false;
gamepad_fd = 0;
#if !defined(WIN32)
#if !defined(__APPLE__)
#if !defined(WIN32) && !defined(__APPLE__)
close(gamepad_fd);
#endif //!(__APPLE__)
#endif //!(WIN32)
#endif
}
bool GamePad::toggle(const int _nbut) {
bool res;
if( toggle_status[_nbut] ){ res = true; toggle_status[_nbut]=false;}
......@@ -167,8 +159,6 @@ bool GamePad::toggle(const int _nbut) {
return res;
}
int GamePad::read_event() {
#if defined(WIN32)
......@@ -216,8 +206,7 @@ int GamePad::read_event() {
std::cout<< infoex.dwButtonNumber << std::endl;
std::cout<< infoex.dwPOV << std::endl;
*/
#else
#if defined(__APPLE__)
#elif defined(__APPLE__)
// ??
......@@ -250,14 +239,11 @@ int GamePad::read_event() {
}
}
#endif //(__APPLE__)
#endif //(WIN32)
#endif
return 1;
}
void GamePad::affiche() {
for (int i=0;i<6;i++) std::cout<<("_________");
std::cout<<std::endl; std::cout<<" axis ";
......@@ -275,4 +261,3 @@ void GamePad::affiche() {
std::cout<<std::endl;
}
......@@ -13,19 +13,16 @@
#define GP_BUTTONS 32
#define GP_AXES 6
#if defined(WIN32)
#include <windows.h>
#include <mmsystem.h>
#else
#if defined(__APPLE__)
#elif defined(__APPLE__)
// ??
#else // LINUX
#include <linux/joystick.h>
#include <fcntl.h>
#define GAMEPAD_DEV "/dev/input/js0"
#endif
#endif
class GamePad {
public:
......@@ -56,10 +53,11 @@ class GamePad {
int axes;
int buttons;
#else
#if defined(__APPLE__)
#elif defined(__APPLE__)
// ??
int axes;
int buttons;
#else // LINUX
......@@ -68,8 +66,7 @@ class GamePad {
__u8 axes;
__u8 buttons;
#endif
#endif
};
#endif // _GAMEPAD_H_
#endif
......@@ -1177,7 +1177,7 @@ void insertVerticesInRegion (GRegion *gr)
int COUNT_MISS_1 = 0;
int COUNT_MISS_2 = 0;
clock_t t1 = clock();
double t1 = Cpu();
while(1){
if(allTets.empty()){
Msg::Error("No tetrahedra in region %d %d", gr->tag(), allTets.size());
......@@ -1287,8 +1287,8 @@ void insertVerticesInRegion (GRegion *gr)
}
memoryCleanup(myFactory, allTets);
clock_t t2 = clock();
double dt = (double)(t2-t1)/CLOCKS_PER_SEC;
double t2 = Cpu();
double dt = (t2-t1);
int COUNT_MISS = COUNT_MISS_1+COUNT_MISS_2;
Msg::Info("3D Point Insertion Terminated : %9d Delaunay cavities modified for star shapeness",NB_CORRECTION_OF_CAVITY);
Msg::Info(" : %9d points could not be inserted among %d",COUNT_MISS,vSizes.size() - COUNT_MISS);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment