Project

General

Profile

Feature #1847

C++ internal data for thinkers

Added by skyjake over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Redesign
Target version:
Start date:
2014-07-20
% Done:

100%

Tags:

Description

Much like map data has been converted to C++ and exposed publicly via a tightly controlled API (DMU), thinkers (e.g., map objects) would benefit greatly from having hidden internal data. Such data is needed for:
  • renderer per-object state (halo, flare, 3D model, etc.)
  • clientside extra data for tracking objects
  • the thinker's Doomsday Script instance Record
  • any other internal per-object bookkeeping

Having this data as part of a thinker would avoid the need to maintain any hashes or other lookups on the side for such data.

The challenge is that thinkers are managed as POD structs allocated from the memory zone. At a minimum (or as a first step), it would be necessary to add an extra pointer to the mobj struct that points to the C++ instance data, and have this extra instance allocated and deallocated when the object is created and destroyed.

History

#2 Updated by skyjake over 10 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

#3 Updated by skyjake over 10 years ago

The mechanism for private thinker data has now been implemented. In the future, all the various thinker types should be revised to take advantage of this (if appropriate). The changes do not preclude use of the old C style struct thinkers.

Also available in: Atom PDF