From 6029825fe57b4a07ab4782b338d5c427c9e6af06 Mon Sep 17 00:00:00 2001 From: Patrik Gornicz Date: Mon, 18 May 2009 13:43:59 -0400 Subject: [PATCH] moved ticks to lib --- src/dir.mk | 1 - src/main.cpp | 2 +- src/ticks.cpp | 45 --------------------------------------------- src/ticks.h | 34 ---------------------------------- 4 files changed, 1 insertion(+), 81 deletions(-) delete mode 100644 src/ticks.cpp delete mode 100644 src/ticks.h diff --git a/src/dir.mk b/src/dir.mk index 4c30aa9..cd1e410 100644 --- a/src/dir.mk +++ b/src/dir.mk @@ -2,7 +2,6 @@ NEWSRCS := # insure blank NEWSRCS += game.cpp NEWSRCS += main.cpp -NEWSRCS += ticks.cpp NEWSRCS += handleSignal.cpp NEWSRCS += entityCreator.cpp diff --git a/src/main.cpp b/src/main.cpp index ce5a7ae..05f9a25 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -16,6 +16,7 @@ */ #include +#include using namespace pg; #include @@ -29,7 +30,6 @@ using std::endl; #include "handleSignal.h" #include "game.h" -#include "ticks.h" #include "graphics/graphics.h" #include "input/inputManager.h" diff --git a/src/ticks.cpp b/src/ticks.cpp deleted file mode 100644 index 54699b1..0000000 --- a/src/ticks.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include "ticks.h" - -#include - -/* this file is specific to a UNIX system */ - -/// ***** Public Methods ***** - -// returns the current microseconds from unix time -MICRO tickCountMicro() -{ - timeval tv; - gettimeofday(&tv, 0); - - return (long int)tv.tv_sec * 1000000 + tv.tv_usec; -} - -// returns the current milliseconds from unix time -MICRO tickCountMilli() -{ - return tickCountMicro() / 1000; -} - -// returns the current seconds from unix time -MICRO tickCountSec() -{ - return tickCountMicro() / 1000000; -} diff --git a/src/ticks.h b/src/ticks.h deleted file mode 100644 index 3c89a2e..0000000 --- a/src/ticks.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (C) 2008 Patrik Gornicz, Gornicz_P (at) hotmail (dot) com. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#ifndef TICKS_H -#define TICKS_H - -/// ***** Public Methods ***** - -typedef long int MICRO; - -// returns the current seconds from program start -MICRO tickCountSec(); - -// returns the current milliseconds from program start -MICRO tickCountMilli(); - -// returns the current microseconds from program start -MICRO tickCountMicro(); - -#endif // TICKS_H -- 2.10.2