moved ticks to lib
authorPatrik Gornicz <Gornicz.P@gmail.com>
Mon, 18 May 2009 17:43:59 +0000 (13:43 -0400)
committerPatrik Gornicz <Gornicz.P@gmail.com>
Mon, 18 May 2009 17:43:59 +0000 (13:43 -0400)
src/dir.mk
src/main.cpp
src/ticks.cpp [deleted file]
src/ticks.h [deleted file]

index 4c30aa9..cd1e410 100644 (file)
@@ -2,7 +2,6 @@ NEWSRCS := # insure blank
 
 NEWSRCS += game.cpp
 NEWSRCS += main.cpp
-NEWSRCS += ticks.cpp
 NEWSRCS += handleSignal.cpp
 
 NEWSRCS += entityCreator.cpp
index ce5a7ae..05f9a25 100644 (file)
@@ -16,6 +16,7 @@
  */
 
 #include <pg/debug.h>
+#include <pg/ticks.h>
 using namespace pg;
 
 #include <iostream>
@@ -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 (file)
index 54699b1..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-
-#include "ticks.h"
-
-#include <sys/time.h>
-
-/* 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 (file)
index 3c89a2e..0000000
+++ /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 <http://www.gnu.org/licenses/>.
- */
-
-#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