further adaptations
This commit is contained in:
parent
cd2c6128d1
commit
c6034277fc
52 changed files with 87 additions and 87 deletions
|
|
@ -1,7 +1,7 @@
|
|||
## Command line parsing module for Nimrod.
|
||||
##
|
||||
## `Nimrod <http://nimrod-code.org>`_ provides the `parseopt module
|
||||
## <http://nimrod-code.org/parseopt.html>`_ to parse options from the
|
||||
## `Nim <http://nim-code.org>`_ provides the `parseopt module
|
||||
## <http://nim-code.org/parseopt.html>`_ to parse options from the
|
||||
## commandline. This module tries to provide functionality to prevent you from
|
||||
## writing commandline parsing and let you concentrate on providing the best
|
||||
## possible experience for your users.
|
||||
|
|
@ -169,7 +169,7 @@ template new_parsed_parameter*(tkind: Tparam_kind, expr): Tparsed_parameter =
|
|||
## assign the variable to, and thus you reduce code clutter and may use this
|
||||
## to initialise single assignments variables in `let` blocks. Example:
|
||||
##
|
||||
## .. code-block:: nimrod
|
||||
## .. code-block:: nim
|
||||
## let
|
||||
## parsed_param1 = new_parsed_parameter(PK_FLOAT, 3.41)
|
||||
## parsed_param2 = new_parsed_parameter(PK_BIGGEST_INT, 2358123 * 23123)
|
||||
|
|
|
|||
|
|
@ -21,8 +21,8 @@
|
|||
|
||||
const Lib = "libchipmunk.so.6.1.1"
|
||||
|
||||
when defined(MoreNimrod):
|
||||
{.hint: "MoreNimrod defined; some Chipmunk functions replaced in Nimrod".}
|
||||
when defined(MoreNim):
|
||||
{.hint: "MoreNim defined; some Chipmunk functions replaced in Nim".}
|
||||
{.deadCodeElim: on.}
|
||||
from math import sqrt, sin, cos, arctan2
|
||||
when defined(CpUseFloat):
|
||||
|
|
@ -729,7 +729,7 @@ proc isRogue*(body: PBody): Bool {.inline.} =
|
|||
|
||||
defGetter(PBody, CpFloat, m, Mass)
|
||||
#/ Set the mass of a body.
|
||||
when defined(MoreNimrod):
|
||||
when defined(MoreNim):
|
||||
defSetter(PBody, CpFloat, m, Mass)
|
||||
else:
|
||||
proc setMass*(body: PBody; m: CpFloat){.
|
||||
|
|
@ -738,7 +738,7 @@ else:
|
|||
#/ Get the moment of a body.
|
||||
defGetter(PBody, CpFloat, i, Moment)
|
||||
#/ Set the moment of a body.
|
||||
when defined(MoreNimrod):
|
||||
when defined(MoreNim):
|
||||
defSetter(PBody, CpFloat, i, Moment)
|
||||
else:
|
||||
proc SetMoment*(body: PBody; i: CpFloat) {.
|
||||
|
|
@ -747,7 +747,7 @@ else:
|
|||
#/ Get the position of a body.
|
||||
defGetter(PBody, TVector, p, Pos)
|
||||
#/ Set the position of a body.
|
||||
when defined(MoreNimrod):
|
||||
when defined(MoreNim):
|
||||
defSetter(PBody, TVector, p, Pos)
|
||||
else:
|
||||
proc setPos*(body: PBody; pos: TVector) {.
|
||||
|
|
@ -1088,7 +1088,7 @@ proc getSegmentRadius*(shape: PShape): CpFloat {.
|
|||
#var VersionString*{.importc: "cpVersionString", dynlib: Lib.}: cstring
|
||||
#/ Calculate the moment of inertia for a circle.
|
||||
#/ @c r1 and @c r2 are the inner and outer diameters. A solid circle has an inner diameter of 0.
|
||||
when defined(MoreNimrod):
|
||||
when defined(MoreNim):
|
||||
proc momentForCircle*(m, r1, r2: CpFloat; offset: TVector): CpFloat {.cdecl.} =
|
||||
result = m * (0.5 * (r1 * r1 + r2 * r2) + lenSq(offset))
|
||||
else:
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ when isMainModule:
|
|||
for i in 1..paramCount():
|
||||
args.add paramStr(i)
|
||||
args.add " "
|
||||
quit(shell("nimrod", "c", "-r", "nakefile.nim", args))
|
||||
quit(shell("nim", "c", "-r", "nakefile.nim", args))
|
||||
else:
|
||||
addQuitProc(proc() {.noconv.} =
|
||||
var
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import nake
|
|||
nakeImports
|
||||
|
||||
task "install", "compile and install nake binary":
|
||||
if shell("nimrod", "c", "nake") == 0:
|
||||
if shell("nim", "c", "nake") == 0:
|
||||
let path = getEnv("PATH").split(PathSep)
|
||||
for index, dir in pairs(path):
|
||||
echo " ", index, ". ", dir
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@ const
|
|||
ServerDefines = "-d:NoSFML --forceBuild"
|
||||
|
||||
task "server", "build the server":
|
||||
if shell("nimrod", ServerDefines, "-r", "compile", "enet_server") != 0:
|
||||
if shell("nim", ServerDefines, "-r", "compile", "enet_server") != 0:
|
||||
quit "Failed to build"
|
||||
task "gui", "build the server GUI mode":
|
||||
if shell("nimrod", "--app:gui", ServerDefines, "-r", "compile", "enet_server") != 0:
|
||||
if shell("nim", "--app:gui", ServerDefines, "-r", "compile", "enet_server") != 0:
|
||||
quit "Failed to build"
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ when isMainModule:
|
|||
for i in 1..paramCount():
|
||||
args.add paramStr(i)
|
||||
args.add " "
|
||||
quit(shell("nimrod", "c", "-r", "nakefile.nim", args))
|
||||
quit(shell("nim", "c", "-r", "nakefile.nim", args))
|
||||
else:
|
||||
addQuitProc(proc() {.noconv.} =
|
||||
var
|
||||
|
|
|
|||
|
|
@ -9,16 +9,16 @@ const
|
|||
BinLibs = "http://dl.dropbox.com/u/37533467/libs-2012-09-12.zip"
|
||||
ExeName = "keineschweine"
|
||||
ServerDefines = "-d:NoSFML -d:NoChipmunk"
|
||||
TestBuildDefines = "-d:escapeMenuTest -d:debugWeps -d:showFPS -d:moreNimrod -d:debugKeys -d:foo -d:recordMode --forceBuild"
|
||||
TestBuildDefines = "-d:escapeMenuTest -d:debugWeps -d:showFPS -d:moreNim -d:debugKeys -d:foo -d:recordMode --forceBuild"
|
||||
ReleaseDefines = "-d:release --deadCodeElim:on"
|
||||
ReleaseTestDefines = "-d:debugWeps -d:debugKeys --forceBuild"
|
||||
|
||||
task "testprofile", "..":
|
||||
if shell("nimrod", TestBuildDefines, "--profiler:on", "--stacktrace:on", "compile", ExeName) == 0:
|
||||
if shell("nim", TestBuildDefines, "--profiler:on", "--stacktrace:on", "compile", ExeName) == 0:
|
||||
shell "."/ExeName, "offline"
|
||||
|
||||
task "test", "Build with test defines":
|
||||
if shell("nimrod", TestBuildDefines, "compile", ExeName) != 0:
|
||||
if shell("nim", TestBuildDefines, "compile", ExeName) != 0:
|
||||
quit "The build failed."
|
||||
|
||||
task "testrun", "Build with test defines and run":
|
||||
|
|
@ -26,22 +26,22 @@ task "testrun", "Build with test defines and run":
|
|||
shell "."/ExeName
|
||||
|
||||
task "test2", "Build release test build test release build":
|
||||
if shell("nimrod", ReleaseDefines, ReleaseTestDefines, "compile", ExeName) == 0:
|
||||
if shell("nim", ReleaseDefines, ReleaseTestDefines, "compile", ExeName) == 0:
|
||||
shell "."/ExeName
|
||||
|
||||
discard """task "dirserver", "build the directory server":
|
||||
withDir "server":
|
||||
if shell("nimrod", ServerDefines, "compile", "dirserver") != 0:
|
||||
if shell("nim", ServerDefines, "compile", "dirserver") != 0:
|
||||
echo "Failed to build the dirserver"
|
||||
quit 1"""
|
||||
|
||||
task "zoneserver", "build the zone server":
|
||||
withDir "enet_server":
|
||||
if shell("nimrod", ServerDefines, "compile", "enet_server") != 0:
|
||||
if shell("nim", ServerDefines, "compile", "enet_server") != 0:
|
||||
quit "Failed to build the zoneserver"
|
||||
task "zoneserver-gui", "build the zone server, with gui!":
|
||||
withDir "enet_server":
|
||||
if shell("nimrod", ServerDefines, "--app:gui", "compile", "enet_server") != 0:
|
||||
if shell("nim", ServerDefines, "--app:gui", "compile", "enet_server") != 0:
|
||||
quit "Failed to build the zoneserver"
|
||||
|
||||
task "servers", "build the server and directory server":
|
||||
|
|
@ -54,7 +54,7 @@ task "all", "run SERVERS and TEST tasks":
|
|||
runTask "test"
|
||||
|
||||
task "release", "release build":
|
||||
let res = shell("nimrod", ReleaseDefines, "compile", ExeName)
|
||||
let res = shell("nim", ReleaseDefines, "compile", ExeName)
|
||||
if res != 0:
|
||||
echo "The build failed."
|
||||
quit 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue