Ein bisschen Code was der eine oder andere gebrauchen könnte (weil diese Funktionen noch nicht im SDK sind): Code: function getLowerLayerTileId(RPG::Map *map, int x, int y) { int ret; asm volatile("call *%%esi" : "=a" (ret), "=d" (RPG::_edx), "=c" (RPG::_ecx) : "S" (0x4A80CC), "a" (map), "d" (x), "c" (y) : "cc", "memory"); return ret; } function getUpperLayerTileId(RPG::Map *map, int x, int y) { int ret; asm volatile("call *%%esi" : "=a" (ret), "=d" (RPG::_edx), "=c" (RPG::_ecx) : "S" (0x4A80F4), "a" (map), "d" (x), "c" (y) : "cc", "memory"); return ret; } function getTerrainId(RPG::Map *map, int tileId) { int ret; asm volatile("movl 20(%%eax), %%eax; call *%%esi" : "=a" (ret), "=d" (RPG::_edx) : "S" (0x47D038), "a" (map), "d" (tileId) : "cc", "memory"); return ret; } Um damit z.B: die Terrain ID eines Feldes zu bekommen: Code: int terrainId = getTerrainId(RPG::map, getLowerLayerTileId(RPG::map, x, y));
function getLowerLayerTileId(RPG::Map *map, int x, int y) { int ret; asm volatile("call *%%esi" : "=a" (ret), "=d" (RPG::_edx), "=c" (RPG::_ecx) : "S" (0x4A80CC), "a" (map), "d" (x), "c" (y) : "cc", "memory"); return ret; } function getUpperLayerTileId(RPG::Map *map, int x, int y) { int ret; asm volatile("call *%%esi" : "=a" (ret), "=d" (RPG::_edx), "=c" (RPG::_ecx) : "S" (0x4A80F4), "a" (map), "d" (x), "c" (y) : "cc", "memory"); return ret; } function getTerrainId(RPG::Map *map, int tileId) { int ret; asm volatile("movl 20(%%eax), %%eax; call *%%esi" : "=a" (ret), "=d" (RPG::_edx) : "S" (0x47D038), "a" (map), "d" (tileId) : "cc", "memory"); return ret; }
int terrainId = getTerrainId(RPG::map, getLowerLayerTileId(RPG::map, x, y));
-- Mir war nichtmal bewusst dass ich nominiert wurde, aber: Cool! Hälfte des Lobes muss aber unbedingt an Archeia!Now all new and shiny: CherryShare | Patches und Tools | Programmwunschthread | www.cherrytree.at | Cherry = CherryDT
Geändert von Cherry (28.02.2013 um 14:57 Uhr)
Foren-Regeln