move GFX2_GetTicks() to osdep.c
This commit is contained in:
parent
8876541953
commit
c037c2c911
@ -807,7 +807,7 @@ endif
|
|||||||
doc doxygen htmldoc check
|
doc doxygen htmldoc check
|
||||||
|
|
||||||
# This is the list of the objects we want to build. Dependancies are built by "make depend" automatically.
|
# This is the list of the objects we want to build. Dependancies are built by "make depend" automatically.
|
||||||
OBJS = main.o init.o graph.o $(APIOBJ) misc.o special.o \
|
OBJS = main.o init.o graph.o $(APIOBJ) misc.o osdep.o special.o \
|
||||||
buttons.o palette.o help.o operatio.o pages.o \
|
buttons.o palette.o help.o operatio.o pages.o \
|
||||||
readline.o engine.o filesel.o fileseltools.o \
|
readline.o engine.o filesel.o fileseltools.o \
|
||||||
op_c.o readini.o saveini.o \
|
op_c.o readini.o saveini.o \
|
||||||
|
|||||||
@ -49,6 +49,7 @@
|
|||||||
#include "struct.h"
|
#include "struct.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
|
|||||||
@ -36,6 +36,7 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "special.h"
|
#include "special.h"
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
#include "operatio.h"
|
#include "operatio.h"
|
||||||
|
|||||||
@ -36,6 +36,7 @@
|
|||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "io.h" // find_last_separator
|
#include "io.h" // find_last_separator
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "pages.h" // Backup()
|
#include "pages.h" // Backup()
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
|
|||||||
@ -39,6 +39,7 @@
|
|||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "pxsimple.h"
|
#include "pxsimple.h"
|
||||||
#include "pxtall.h"
|
#include "pxtall.h"
|
||||||
#include "pxwide.h"
|
#include "pxwide.h"
|
||||||
|
|||||||
@ -58,6 +58,7 @@
|
|||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "loadsave.h"
|
#include "loadsave.h"
|
||||||
|
|||||||
@ -33,6 +33,7 @@
|
|||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "help.h"
|
#include "help.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "readline.h"
|
#include "readline.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "keycodes.h"
|
#include "keycodes.h"
|
||||||
|
|||||||
@ -62,6 +62,7 @@
|
|||||||
#include "loadsave.h"
|
#include "loadsave.h"
|
||||||
#include "loadsavefuncs.h"
|
#include "loadsavefuncs.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "op_c.h"
|
#include "op_c.h"
|
||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
|
|||||||
23
src/misc.c
23
src/misc.c
@ -28,19 +28,13 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#if !defined(USE_SDL) && !defined(USE_SDL2)
|
|
||||||
#if defined(WIN32)
|
|
||||||
#include <windows.h>
|
|
||||||
#else
|
|
||||||
#include <sys/time.h>
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#include "struct.h"
|
#include "struct.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "errors.h"
|
#include "errors.h"
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
@ -864,18 +858,3 @@ int Convert_videomode_arg(const char *argument)
|
|||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
dword GFX2_GetTicks(void)
|
|
||||||
{
|
|
||||||
#if defined(USE_SDL) || defined(USE_SDL2)
|
|
||||||
return SDL_GetTicks();
|
|
||||||
#elif defined(WIN32)
|
|
||||||
return GetTickCount();
|
|
||||||
#else
|
|
||||||
struct timeval tv;
|
|
||||||
if (gettimeofday(&tv, NULL) < 0)
|
|
||||||
return 0;
|
|
||||||
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@ -150,7 +150,4 @@ int Max(int a,int b);
|
|||||||
const char* Mode_label(int mode);
|
const char* Mode_label(int mode);
|
||||||
int Convert_videomode_arg(const char *argument);
|
int Convert_videomode_arg(const char *argument);
|
||||||
|
|
||||||
/// Return a number of milliseconds
|
|
||||||
dword GFX2_GetTicks(void);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -27,6 +27,7 @@
|
|||||||
#include "struct.h"
|
#include "struct.h"
|
||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "engine.h"
|
#include "engine.h"
|
||||||
#include "graph.h"
|
#include "graph.h"
|
||||||
#include "operatio.h"
|
#include "operatio.h"
|
||||||
|
|||||||
50
src/osdep.c
Normal file
50
src/osdep.c
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
/* vim:expandtab:ts=2 sw=2:
|
||||||
|
*/
|
||||||
|
/* Grafx2 - The Ultimate 256-color bitmap paint program
|
||||||
|
|
||||||
|
Copyright 2020 Thomas Bernard
|
||||||
|
Copyright 2011 Pawel Góralski
|
||||||
|
Copyright 2008 Yves Rizoud
|
||||||
|
Copyright 2008 Franck Charlet
|
||||||
|
Copyright 2007 Adrien Destugues
|
||||||
|
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
|
||||||
|
|
||||||
|
Grafx2 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; version 2
|
||||||
|
of the License.
|
||||||
|
|
||||||
|
Grafx2 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 Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||||
|
*/
|
||||||
|
#if defined(USE_SDL) || defined(USE_SDL2)
|
||||||
|
#include <SDL.h>
|
||||||
|
#else
|
||||||
|
#if defined(WIN32)
|
||||||
|
#include <windows.h>
|
||||||
|
#else
|
||||||
|
#include <sys/time.h>
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include "struct.h"
|
||||||
|
|
||||||
|
dword GFX2_GetTicks(void)
|
||||||
|
{
|
||||||
|
#if defined(USE_SDL) || defined(USE_SDL2)
|
||||||
|
return SDL_GetTicks();
|
||||||
|
#elif defined(WIN32)
|
||||||
|
return GetTickCount();
|
||||||
|
#else
|
||||||
|
struct timeval tv;
|
||||||
|
if (gettimeofday(&tv, NULL) < 0)
|
||||||
|
return 0;
|
||||||
|
return tv.tv_sec * 1000 + tv.tv_usec / 1000;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
36
src/osdep.h
Normal file
36
src/osdep.h
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
/* vim:expandtab:ts=2 sw=2:
|
||||||
|
*/
|
||||||
|
/* Grafx2 - The Ultimate 256-color bitmap paint program
|
||||||
|
|
||||||
|
Copyright 2020 Thomas Bernard
|
||||||
|
Copyright 2011 Pawel Góralski
|
||||||
|
Copyright 2008 Yves Rizoud
|
||||||
|
Copyright 2008 Franck Charlet
|
||||||
|
Copyright 2007 Adrien Destugues
|
||||||
|
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
|
||||||
|
|
||||||
|
Grafx2 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; version 2
|
||||||
|
of the License.
|
||||||
|
|
||||||
|
Grafx2 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 Grafx2; if not, see <http://www.gnu.org/licenses/>
|
||||||
|
*/
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
///@file osdep.h
|
||||||
|
/// OS Dependend code
|
||||||
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef OSDEP_H_DEFINED
|
||||||
|
#define OSDEP_H_DEFINED
|
||||||
|
|
||||||
|
/// Return a number of milliseconds
|
||||||
|
dword GFX2_GetTicks(void);
|
||||||
|
|
||||||
|
#endif
|
||||||
@ -29,6 +29,7 @@
|
|||||||
#include "special.h"
|
#include "special.h"
|
||||||
#include "pages.h"
|
#include "pages.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "buttons.h"
|
#include "buttons.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,7 @@
|
|||||||
#include "windows.h"
|
#include "windows.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
|
#include "osdep.h"
|
||||||
#include "tiles.h"
|
#include "tiles.h"
|
||||||
|
|
||||||
// These helpers are only needed internally at the moment
|
// These helpers are only needed internally at the moment
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user