카본 메서드를 코코아로 변환해야하고 탄소 메서드 getPtrSize가 실제로하는 작업에 대한 문서를 찾는 데 어려움이 있습니다. 코드에서 이미지의 바이트 표현을 반환하지만 실제로 이름과 일치하지 않는 것 같습니다. 누군가가 나에게이 방법에 대한 좋은 설명을 주거나 그것을 설명하는 문서에 연결시켜 줄 수 있습니까? 번역 할 코드는 탄소에 대한 다리가있는 MCL이라는 일반적인 리스프 구현에 있습니다. (CCL로 변환하는 것은 코코아 브리지를 사용하는 일반적인 리스프 구현입니다.) (a 메소드 호출은 탄소 방법임을 의미 #_before) 여기 MCL 코드 :카본 메서드와 동일한 코코아 메서드 getPtrSize
(defmethod COPY-CONTENT-INTO ((Source inflatable-icon)
(Destination inflatable-icon))
;; check for size compatibility to avoid disaster
(unless (and (= (rows Source) (rows Destination))
(= (columns Source) (columns Destination))
(= (#_getPtrSize (image Source))
(#_getPtrSize (image Destination))))
(error "cannot copy content of source into destination
inflatable icon: incompatible sizes"))
;; given that they are the same size only copy content
(setf (is-upright Destination) (is-upright Source))
(setf (height Destination) (height Source))
(setf (dz Destination) (dz Source))
(setf (surfaces Destination) (surfaces Source))
(setf (distance Destination) (distance Source))
;; arrays
(noise-map Source) ;; accessor makes array if needed
(noise-map Destination) ;; ;; accessor makes array if needed
(dotimes (Row (rows Source))
(dotimes (Column (columns Source))
(setf (aref (noise-map Destination) Row Column)
(aref (noise-map Source) Row Column))
(setf (aref (altitudes Destination) Row Column)
(aref (altitudes Source) Row Column))))
(setf (connectors Destination)
(mapcar #'copy-instance (connectors Source)))
(setf (visible-alpha-threshold Destination)
(visible-alpha-threshold Source))
;; copy Image: slow byte copy
(dotimes (I (#_getPtrSize (image Source)))
(%put-byte (image Destination) (%get-byte (image Source) i) i))
;; flat texture optimization:
;; do not copy texture-id
;; -> destination should get its own texture id from OpenGL
(setf (is-flat Destination) (is-flat Source))
;; do not compile flat textures: the display list overhead
;; slows things down by about 2x
(setf (auto-compile Destination) (not (is-flat Source)))
;; to make change visible we have to reset the compiled flag
(setf (is-compiled Destination) nil))
이것은 사실입니까? +1 내 마음을 불고. –