From 92988d26b0a3342e9934570d896311c38d94f4fd Mon Sep 17 00:00:00 2001 From: Alexander Monakov Date: Sun, 6 Jun 2010 19:35:48 +0400 Subject: [PATCH] Remove Random.cpp --- CMakeLists.txt | 1 - Source/OpenGL_Windows.cpp | 2 -- Source/Random.c | 61 --------------------------------------- Source/Random.h | 15 +++------- 4 files changed, 4 insertions(+), 75 deletions(-) delete mode 100644 Source/Random.c diff --git a/CMakeLists.txt b/CMakeLists.txt index d86c839..383779d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,7 +66,6 @@ set(LUGARU_SRCS ${SRCDIR}/Person.cpp ${SRCDIR}/private.c ${SRCDIR}/Quaternions.cpp - ${SRCDIR}/Random.c ${SRCDIR}/Skeleton.cpp ${SRCDIR}/Skybox.cpp ${SRCDIR}/Sprite.cpp diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 776eb43..37ad22f 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -230,8 +230,6 @@ Boolean SetUp (Game & game) LOGFUNC; - randSeed = UpTime().lo; - osx = 0; cellophane=0; texdetail=4; diff --git a/Source/Random.c b/Source/Random.c deleted file mode 100644 index add3a78..0000000 --- a/Source/Random.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -Copyright (C) 2003, 2010 - Wolfire Games - -This file is part of Lugaru. - -Lugaru 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 2 -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, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#include "Random.h" -#include "stdlib.h" - - -int randSeed = 1; - -short Random() -{ - /*unsigned int value = (unsigned int)randSeed; - unsigned int out=0; - int i=31; - - while (i > 0) - { - value ^= 0x81010000; - value ^= out; - if (value & 1) - { - value >>= 1; - value |= 0x80000000; - } - else - value >>= 1; - out <<= 1; - out |= (value&0x1); - i--; - } - if (value&0x80000000) - { - out <<= 1; - out |= 1; - } - else - out <<= 1; - - randSeed += out; - */ - return rand(); -} diff --git a/Source/Random.h b/Source/Random.h index 10f66cb..3d53ebe 100644 --- a/Source/Random.h +++ b/Source/Random.h @@ -22,18 +22,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef _RANDOM_H_ #define _RANDOM_H_ +#include -#if defined(__cplusplus) -extern "C" { -#endif - - -extern int randSeed; -short Random (); - - -#if defined(__cplusplus) +static inline short Random() +{ + return rand(); } -#endif #endif -- 2.39.5