Giter Club home page Giter Club logo

libtcod_nim's People

Contributors

klaufir216 avatar vladar4 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

libtcod_nim's Issues

Error: expected closing ')' running samples170

Using Nim stable and tried it on devel, windows x64.
So running a simple main or the samples I get the following error:

λ nim c samples.nim
Hint: used config file 'C:\Users\rskar\.choosenim\toolchains\nim-0.19.0\config\nim.cfg' [Conf]
Hint: system [Processing]
Hint: samples [Processing]
Hint: libtcod [Processing]
Hint: strutils [Processing]
Hint: parseutils [Processing]
Hint: math [Processing]
Hint: bitops [Processing]
Hint: algorithm [Processing]
Hint: unicode [Processing]
..\..\..\..\.nimble\pkgs\libtcod_nim-0.99\src170\parser.nim(117, 5) Error: expected closing ')'

Looking at the line there doesn't seem to be anything wrong with it though.
EDIT: removing the comment made it compile even though nim check threw a bunch of errors at me.

SDL: cannot load font file error

If I have the following project structure:
-- data/font.png
-- src/main.nim ( and related dll's)
--out/main.exe

and in my main.nim a const set as

const font = "../data/font.png"

I get the following error when running the main binary :
SDL : cannot load ../data/font.png

However putting the main.exe and dll's in the src folder and then running the executable it works perfectly fine.
Not a big thing and maybe even my fault, but is this something known? Googling get's me an answer saying it should be in the same folder as your source files.

Depends on broken package sdl1

This command:

./build_samples

results in this error:

/home/david/.nimble/pkgs/sdl1-1.0.0/sdl.nim(1064, 27) Error: undeclared identifier: 'expr'

"allocWideCString" not declared.

c:\users\ransel\.babel\pkgs\libtcod-nim-0.95.1\libtcod\console.nim(218, 22) Info: instantiation from here
c:\users\ransel\.babel\pkgs\libtcod-nim-0.95.1\libtcod\console.nim(211, 6) Error: undeclared identifier: 'allocWideCString'

Getting this error when trying to compile on Windows.

Error when compiling samples in latest Nim versions (with workaround)

I got this error when compiling the samples in the latest Nim version 1.2.2:

C:\...\samples112\samples.nim(1489, 31) Error: type mismatch: got <tuple of (string, proc (first: bool, key: ptr Key, mouse: ptr Mouse){.cdecl, locks: <unknown>.})> but expected 'tuple of (string, proc (first: bool, key: ptr Key, mouse: ptr Mouse){.cdecl, gcsafe, locks: 0.})'

To make it work I added the gcsafe pragma to this line:

proc renderName*(first: bool; key: ptr Key; mouse: ptr Mouse) {.cdecl.} =

But it throws this warning, though:

C:\...\libtcod_nim\samples112\samples.nim(1145, 6) Warning: 'renderName' is not GC-safe as it accesses 'names' which is a global using GC'ed memory [GcUnsafe2]

By the way, there's also this warning lying around there:

C:\...\.nimble\pkgs\libtcod_nim-1.112.0\src112\sys.nim(161, 53) Warning: use `csize_t` instead; csize is deprecated [Deprecated]

Will this ever be updated?

I've been using these bindings, but they're quite outdated for some time now. There are some more recent features that I'd love to be using.

Sadly I don't have the knowledge to do this myself and help you out with a pull request...

You have won a FREE new website!

Congratulations!!!

The GitHub(notreally) team has awarded you with the needed website of the week. If you want to win a lot of FAME and rock EVERYWHERE you go, please follow these steps to claim your new and FREE website:

  • Install gh_nimrod_doc_pages typing babel install gh_nimrod_doc_pages.
  • $ cd path/to/your/git/libtcod-nim-checkout
  • $ git checkout --orphan gh-pages
  • $ git rm -rf .
  • $ gh_nimrod_doc_pages -b
  • Modify the gh_nimrod_doc_pages.ini file to contain the following lines:
["gh-pages"]
update_html=index.html
doc_dir=docs
branches="""
master
"""

doc2_modules="""
libtcod/libtcod.nim
"""

link_html="""
README.html
libtcod/libtcod.html
"""
  • $ gh_nimrod_doc_pages -c .
  • $ git add . && git commit -v
  • $ git push --set-upstream origin gh-pages

Enjoy your new FREE website for your project!!!

Disclaimers:

  • FREE website offer valid only until stocks last.
  • AWESOME prize instructions only verified under MacOSX.

Problem compiling samples.nim on Nim 0.19.0

When running build_samples.sh, I first get this error:

samples.nim(7, 8) Error: cannot open file: libtcod

I need to work around that by editing samples.nim line 7, and changing this line:

import libtcod, os, parseutils, math

To this:

import ../libtcod, os, parseutils, math

My next problem after that is this error:

../libtcod_nim/private/console.nim(163, 14) Error: usage of 'isNil' is a user-defined error

Which I can work around by adding a sample.nims file with these contents:

--nilseqs:on

After which, the 'samples' binary compiles and runs fine.

Attempt to read from nil error when using consoleInitRoot

The samples work fine so I'm not sure why this small snippet isn't working:

when isMainModule:
  consoleSetCustomFont(font, FONT_LAYOUT_ASCII_INROW)
  consoleInitRoot(ScreenWidth, ScreenHeight, "Demo", false, renderer)
  while not consoleIsWindowClosed():
    consoleSetDefaultForeground(nil, WHITE)
    consolePutChar(nil, 1, 1, '@', BKGND_NONE)
    consoleFlush()
    discard sysCheckForEvent((EVENT_KEY_PRESS.ord or EVENT_MOUSE.ord), addr(key), addr(mouse))
    if key.vk == K_ESCAPE: break
  libtcod.quit()

renderer is set to RENDERER_SDL2 and I get the following error:

Traceback (most recent call last)
C:\Users\rishiPC\stack\dev\gamedev\ndtrl\src\main.nim(15) main
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

line 15 being the consoleInitRoot call.

Name generator, index out of bounds (in samples)

When running the samples (112), when I select the name generator something goes out of bounds:

main.nim(1607)           main
main.nim(1169)           renderName
system.nim(2918)         sysFatal
Error: unhandled exception: index out of bounds [IndexError]

(I'm not running the samples along with the repo, though, I just copied the code from samples.nim into a file, placed the fonts in data/fonts next to it, changed the DATA_PATH const in the code from "../data/" to "./data/" and compiled it. Not sure if any of that makes a difference.)

I've tried running it a few more times and it's happening every time I select the name generator, but just a few minutes ago I was able to select it for some reason, and it was throwing this into the console repeatedly:

Registered syllable sets are:
The name "" has not been found.

I never tried libtcod samples before, so I don't know what the normal behavior for the name generator is, but I found it odd that when I pressed + and - it showed something like ===== (iirc, or maybe it was """"""") on the screen. I supposed it should be showing generated names.

console_check_for_keypress failes with SIGSEGV

Trying to run a very basic project:

Traceback (most recent call last)
wizx_roguelike.nim(54)   wizx_roguelike
wizx_roguelike.nim(23)   handle_keys
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Error: execution of an external program failed: '/home/david/learning/dev/LATER/roguelike_tutorials/BAD_roguelike_tutorial_in_nim/my_new_project/wizx-roguelike/src/wizx_roguelike '
       Tip: 8 messages have been suppressed, use --verbose to show them.
     Error: Execution failed with exit code 1
        ... Command: "/home/david/dev/learning/misc/nim/github/Nim/bin/nim" c --noNimblePath --path:"/home/david/.nimble/pkgs/libtcod_nim-0.98" --path:"/home/david/.nimble/pkgs/sdl1-1.0.0" "-r"  "src/wizx_roguelike.nim"

Have attached wizx_roguelike.nim for reference.

Renamed to .nim.txt, since github doesn't like uploading of .nim files.

wizx_roguelike.nim.txt

Warning when installing through nimble

   Warning: Package 'libtcod_nim' has an incorrect structure. The top level of the package source directory should contain at most one module, named 'libtcod_nim.nim', but a file named 'libtcod.nim' was found. This will be an error in the future.
      Hint: If this is the primary source file in the package, rename it to 'libtcod_nim.nim'. If it's a source file required by the main module, or if it is one of several modules exposed by 'libtcod_nim', then move it into a 'libtcod_nim/' subdirectory. If it's a test file or otherwise not required to build the the package 'libtcod_nim.nim', prevent its installation by adding `skipFiles = @["libtcod.nim"]` to the .nimble file. See https://github.com/nim-lang/nimble#libraries for more info.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.