////////////////////////////////////// API Implementation //////////////////////////////////////
| 123 | // API Implementation |
| 124 | /////////////////////////////////////////// |
| 125 | void pda_start(const char* levelName) |
| 126 | { |
| 127 | // TFE |
| 128 | reticle_enable(false); |
| 129 | s_mouseAccum = { 0 }; |
| 130 | mouseOldPosX = 0, mouseOldPosZ = 0; |
| 131 | pauseLevelSound(); |
| 132 | if (!s_pdaLoaded) |
| 133 | { |
| 134 | if (!menu_openResourceArchive("dfbrief.lfd")) |
| 135 | { |
| 136 | return; |
| 137 | } |
| 138 | LRect rect; |
| 139 | |
| 140 | s_briefing = lactorDelt_load(levelName, &s_pdaRect, 0, 0, 0); |
| 141 | s_goalsActor = lactorAnim_load(levelName, &rect, 0, 0, 0); |
| 142 | s_weapons = lactorAnim_load("guns", &rect, 0, 0, 0); |
| 143 | s_items = lactorAnim_load("items", &rect, 0, 0, 0); |
| 144 | menu_closeResourceArchive(); |
| 145 | |
| 146 | lactor_setTime(s_goalsActor, -1, -1); |
| 147 | lactor_setTime(s_weapons, -1, -1); |
| 148 | lactor_setTime(s_items, -1, -1); |
| 149 | |
| 150 | if (s_briefing) |
| 151 | { |
| 152 | lactor_setTime(s_briefing, -1, -1); |
| 153 | lactorDelt_getFrame(s_briefing, &rect); |
| 154 | |
| 155 | s_briefingMaxY = (rect.bottom - rect.top) - (s_pdaRect.bottom - s_pdaRect.top) + BRIEF_VERT_MARGIN; |
| 156 | // Round to a factor of the line scrolling value. |
| 157 | s_briefingMaxY = s_briefingMaxY + BRIEF_LINE_SCROLL - (s_briefingMaxY % BRIEF_LINE_SCROLL); |
| 158 | |
| 159 | if (s_briefingMaxY < -BRIEF_VERT_MARGIN) |
| 160 | { |
| 161 | s_briefingMaxY = -BRIEF_VERT_MARGIN; |
| 162 | } |
| 163 | s_briefY = -BRIEF_VERT_MARGIN; |
| 164 | |
| 165 | } |
| 166 | s_overlayRect = s_pdaRect; |
| 167 | |
| 168 | if (!menu_openResourceArchive("menu.lfd")) |
| 169 | { |
| 170 | return; |
| 171 | } |
| 172 | s_framebuffer = ldraw_getBitmap(); |
| 173 | lcanvas_getBounds(&s_viewBounds); |
| 174 | |
| 175 | s_pdaArt = lactorAnim_load("pda", &s_viewBounds, 0, 0, 0); |
| 176 | s_palette = lpalette_load("menu"); |
| 177 | lactor_setTime(s_pdaArt, -1, -1); |
| 178 | |
| 179 | menu_closeResourceArchive(); |
| 180 | |
| 181 | s_pdaLoaded = JTRUE; |
| 182 | } |
no test coverage detected