Giter VIP home page Giter VIP logo

aoi's People

Contributors

donnki avatar jerryzhou avatar rocaltair 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  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  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  avatar

Watchers

 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

aoi's Issues

c89 style

considering cross-platform, use c89 style please.

maybe you need this args for gcc or clang compiling

-Werror=declaration-after-statement -std=c89

bugs: lua.h include

in laoi.c
see line 4,5

#include </usr/local/include/lua.h>
#include </usr/local/include/lauxlib.h>

please use

#include <lua.h>
#include <lauxlib.h>

some bugs while divide > 3

I guess I found some bugs

Something goes wrong while divide > 3.

see the code:

Is there anything wrong with myself?

local laoi = require "laoi"

for divide = 1, 10 do
        local map = laoi.new_map({512, 512}, divide)

        local unitA = laoi.new_unit(1, {56, 29})
        map:unit_add(unitA)

        local unitB = laoi.new_unit(2, {72, 31})
        map:unit_add(unitB)

        table.foreach(map:unit_search(unitA, 30), function(unitId, unit)
                print(string.format("divide=%d,unitId=%d", divide, unitId))
        end)
end

_imapsearchcollectnode_withclear这个函数的一些疑问

`

/* 获取可能存在数据的节点 */
for (i=0; i<4; ++i) {
    tpos.x =  offsets[2*i];
    tpos.y =  offsets[2*i+1];
    /* 跟刚刚一样的节点 */
    if (tnode && tpos.x >= tnode->code.pos.x
        && (tnode->code.pos.x + map->nodesizes[tnode->level].w > tpos.x)
        && tpos.y >= tnode->code.pos.y
        && (tnode->code.pos.y + map->nodesizes[tnode->level].h > tpos.y)) {
        continue;
    }

`

这里tnode一直是null,没有赋值,那if tnode的判断是多余了,还是有bug?

死循环问题

/* 搜集树上的所有单元 */
void imapcollectunit
....
unit = node->units;
for (;unit;unit=unit->next) {

这个 units链表中节点的next自己指向了自己,导致死循环。

(gdb) p unit
$8 = (iunit *) 0x7fffee67a618
(gdb) p unit->next
$9 = (struct iunit *) 0x7fffee67a618
(gdb) p unit->pre
$10 = (struct iunit *) 0x7fffee67a618

(gdb) p unit->node->units
$16 = (struct iunit *) 0x7fffee67a618
(gdb) p unit->next->next
$17 = (struct iunit *) 0x7fffee67a618
(gdb) p unit->next->next->next
$18 = (struct iunit *) 0x7fffee67a618

以上的问题是偶现的,由于逻辑有点复杂,暂时还没定位到问题,初步估计是 节点重复list_add_front(node->units, unit)导致的。

@JerryZhou

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.