From: Alexander Monakov Date: Sun, 6 Jun 2010 16:08:55 +0000 (+0400) Subject: Merge X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=1994d4975f864a17540733a03a811a962083039a;hp=705156dced26432e41deada8d9811c05d52b44ce;p=lugaru.git Merge --- 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/GameTick.cpp b/Source/GameTick.cpp index 0330b0e..28a5395 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -2738,7 +2738,7 @@ void Game::Tick() gameon=1; OPENAL_SetPaused(channels[stream_music3], true); } - if(Input::Button()&&!oldbutton&&(selected-7>=accountactive->getCampaignChoicesMade())){//selected>=7&&(selected-7<=campaignnumchoices)){ + if(Input::Button()&&!oldbutton&&(selected-7>=accountactive->getCampaignChoicesMade())){ fireSound(); flash(); diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 3699818..4e163eb 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; @@ -772,7 +770,7 @@ int main(int argc, char **argv) pgame = 0; CleanUp (); - + return 0; } catch (const std::exception& error) 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